From 87e7ec4dce93d0bf5b52bd4ab69be6800b23e637 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 18 Jan 2024 11:46:31 +0000 Subject: [PATCH 1/2] fix!: remove BufferTask method which cannot be called from client libraries PiperOrigin-RevId: 599211253 Source-Link: https://github.com/googleapis/googleapis/commit/1654062e8ac5d9bcddc4792bc85f4193f8d73cb2 Source-Link: https://github.com/googleapis/googleapis-gen/commit/2055a533af154dcc263d5c0bcd78af84b44ef332 Copy-Tag: eyJwIjoiVGFza3MvLk93bEJvdC55YW1sIiwiaCI6IjIwNTVhNTMzYWYxNTRkY2MyNjNkNWMwYmNkNzhhZjg0YjQ0ZWYzMzIifQ== --- .../Google/Cloud/Tasks/V2/Cloudtasks.php | 114 + .../Google/Cloud/Tasks/V2/Queue.php | Bin 0 -> 1983 bytes .../Google/Cloud/Tasks/V2/Target.php | Bin 0 -> 1761 bytes .../Google/Cloud/Tasks/V2/Task.php | Bin 0 -> 2022 bytes .../Cloud/Tasks/V2/AppEngineHttpRequest.php | 469 ++++ .../Cloud/Tasks/V2/AppEngineRouting.php | 373 ++++ .../src/Google/Cloud/Tasks/V2/Attempt.php | 229 ++ .../Cloud/Tasks/V2/CreateQueueRequest.php | 160 ++ .../Cloud/Tasks/V2/CreateTaskRequest.php | 349 +++ .../Cloud/Tasks/V2/DeleteQueueRequest.php | 87 + .../Cloud/Tasks/V2/DeleteTaskRequest.php | 87 + .../Google/Cloud/Tasks/V2/GetQueueRequest.php | 86 + .../Google/Cloud/Tasks/V2/GetTaskRequest.php | 157 ++ .../src/Google/Cloud/Tasks/V2/HttpMethod.php | 96 + .../src/Google/Cloud/Tasks/V2/HttpRequest.php | 421 ++++ .../Cloud/Tasks/V2/ListQueuesRequest.php | 269 +++ .../Cloud/Tasks/V2/ListQueuesResponse.php | 122 + .../Cloud/Tasks/V2/ListTasksRequest.php | 269 +++ .../Cloud/Tasks/V2/ListTasksResponse.php | 118 + .../src/Google/Cloud/Tasks/V2/OAuthToken.php | 128 ++ .../src/Google/Cloud/Tasks/V2/OidcToken.php | 126 ++ .../Cloud/Tasks/V2/PauseQueueRequest.php | 87 + .../Cloud/Tasks/V2/PurgeQueueRequest.php | 87 + .../proto/src/Google/Cloud/Tasks/V2/Queue.php | 611 +++++ .../src/Google/Cloud/Tasks/V2/Queue/State.php | 89 + .../src/Google/Cloud/Tasks/V2/RateLimits.php | 308 +++ .../Cloud/Tasks/V2/ResumeQueueRequest.php | 87 + .../src/Google/Cloud/Tasks/V2/RetryConfig.php | 490 ++++ .../Google/Cloud/Tasks/V2/RunTaskRequest.php | 157 ++ .../Tasks/V2/StackdriverLoggingConfig.php | 80 + .../proto/src/Google/Cloud/Tasks/V2/Task.php | 684 ++++++ .../src/Google/Cloud/Tasks/V2/Task/View.php | 79 + .../Cloud/Tasks/V2/UpdateQueueRequest.php | 165 ++ .../V2/CloudTasksClient/create_queue.php | 89 + .../V2/CloudTasksClient/create_task.php | 80 + .../V2/CloudTasksClient/delete_queue.php | 82 + .../V2/CloudTasksClient/delete_task.php | 74 + .../V2/CloudTasksClient/get_iam_policy.php | 79 + .../V2/CloudTasksClient/get_location.php | 57 + .../samples/V2/CloudTasksClient/get_queue.php | 72 + .../samples/V2/CloudTasksClient/get_task.php | 72 + .../V2/CloudTasksClient/list_locations.php | 62 + .../V2/CloudTasksClient/list_queues.php | 79 + .../V2/CloudTasksClient/list_tasks.php | 85 + .../V2/CloudTasksClient/pause_queue.php | 79 + .../V2/CloudTasksClient/purge_queue.php | 77 + .../V2/CloudTasksClient/resume_queue.php | 85 + .../samples/V2/CloudTasksClient/run_task.php | 97 + .../V2/CloudTasksClient/set_iam_policy.php | 83 + .../CloudTasksClient/test_iam_permissions.php | 85 + .../V2/CloudTasksClient/update_queue.php | 73 + .../v2/src/V2/Client/CloudTasksClient.php | 887 ++++++++ .../Tasks/v2/src/V2/CloudTasksClient.php | 34 + .../v2/src/V2/Gapic/CloudTasksGapicClient.php | 1466 ++++++++++++ .../Tasks/v2/src/V2/gapic_metadata.json | 108 + .../resources/cloud_tasks_client_config.json | 135 ++ .../cloud_tasks_descriptor_config.php | 256 +++ .../cloud_tasks_rest_client_config.php | 220 ++ .../Unit/V2/Client/CloudTasksClientTest.php | 1316 +++++++++++ .../v2/tests/Unit/V2/CloudTasksClientTest.php | 1189 ++++++++++ .../Google/Cloud/Tasks/V2Beta2/Cloudtasks.php | Bin 0 -> 8540 bytes .../Google/Cloud/Tasks/V2Beta2/OldTarget.php | 27 + .../Google/Cloud/Tasks/V2Beta2/Queue.php | Bin 0 -> 2576 bytes .../Google/Cloud/Tasks/V2Beta2/Target.php | Bin 0 -> 3089 bytes .../Google/Cloud/Tasks/V2Beta2/Task.php | Bin 0 -> 2129 bytes .../Tasks/V2beta2/AcknowledgeTaskRequest.php | 132 ++ .../Tasks/V2beta2/AppEngineHttpRequest.php | 484 ++++ .../Tasks/V2beta2/AppEngineHttpTarget.php | 114 + .../Cloud/Tasks/V2beta2/AppEngineRouting.php | 536 +++++ .../Cloud/Tasks/V2beta2/AttemptStatus.php | 229 ++ .../Tasks/V2beta2/CancelLeaseRequest.php | 206 ++ .../Tasks/V2beta2/CreateQueueRequest.php | 136 ++ .../Cloud/Tasks/V2beta2/CreateTaskRequest.php | 302 +++ .../Tasks/V2beta2/DeleteQueueRequest.php | 72 + .../Cloud/Tasks/V2beta2/DeleteTaskRequest.php | 72 + .../Cloud/Tasks/V2beta2/GetQueueRequest.php | 128 ++ .../Cloud/Tasks/V2beta2/GetTaskRequest.php | 146 ++ .../Google/Cloud/Tasks/V2beta2/HttpMethod.php | 96 + .../Cloud/Tasks/V2beta2/HttpRequest.php | 416 ++++ .../Google/Cloud/Tasks/V2beta2/HttpTarget.php | 375 ++++ .../Cloud/Tasks/V2beta2/HttpTarget/Header.php | 104 + .../V2beta2/HttpTarget/HeaderOverride.php | 80 + .../Cloud/Tasks/V2beta2/LeaseTasksRequest.php | 442 ++++ .../Tasks/V2beta2/LeaseTasksResponse.php | 68 + .../Cloud/Tasks/V2beta2/ListQueuesRequest.php | 310 +++ .../Tasks/V2beta2/ListQueuesResponse.php | 126 ++ .../Cloud/Tasks/V2beta2/ListTasksRequest.php | 258 +++ .../Cloud/Tasks/V2beta2/ListTasksResponse.php | 122 + .../Google/Cloud/Tasks/V2beta2/OAuthToken.php | 128 ++ .../Google/Cloud/Tasks/V2beta2/OidcToken.php | 126 ++ .../Cloud/Tasks/V2beta2/PathOverride.php | 68 + .../Cloud/Tasks/V2beta2/PauseQueueRequest.php | 72 + .../Cloud/Tasks/V2beta2/PullMessage.php | 165 ++ .../Google/Cloud/Tasks/V2beta2/PullTarget.php | 33 + .../Cloud/Tasks/V2beta2/PurgeQueueRequest.php | 72 + .../Cloud/Tasks/V2beta2/QueryOverride.php | 72 + .../src/Google/Cloud/Tasks/V2beta2/Queue.php | 771 +++++++ .../Cloud/Tasks/V2beta2/Queue/State.php | 93 + .../Google/Cloud/Tasks/V2beta2/QueueStats.php | 253 +++ .../Google/Cloud/Tasks/V2beta2/RateLimits.php | 349 +++ .../Cloud/Tasks/V2beta2/RenewLeaseRequest.php | 258 +++ .../Tasks/V2beta2/ResumeQueueRequest.php | 72 + .../Cloud/Tasks/V2beta2/RetryConfig.php | 548 +++++ .../Cloud/Tasks/V2beta2/RunTaskRequest.php | 146 ++ .../src/Google/Cloud/Tasks/V2beta2/Task.php | 484 ++++ .../Google/Cloud/Tasks/V2beta2/Task/View.php | 83 + .../Google/Cloud/Tasks/V2beta2/TaskStatus.php | 241 ++ .../Tasks/V2beta2/UpdateQueueRequest.php | 150 ++ .../Tasks/V2beta2/UploadQueueYamlRequest.php | 120 + .../Cloud/Tasks/V2beta2/UriOverride.php | 353 +++ .../Tasks/V2beta2/UriOverride/Scheme.php | 66 + .../UriOverride/UriOverrideEnforceMode.php | 67 + .../CloudTasksClient/acknowledge_task.php | 82 + .../V2beta2/CloudTasksClient/cancel_lease.php | 76 + .../V2beta2/CloudTasksClient/create_queue.php | 85 + .../V2beta2/CloudTasksClient/create_task.php | 80 + .../V2beta2/CloudTasksClient/delete_queue.php | 77 + .../V2beta2/CloudTasksClient/delete_task.php | 69 + .../CloudTasksClient/get_iam_policy.php | 74 + .../V2beta2/CloudTasksClient/get_location.php | 53 + .../V2beta2/CloudTasksClient/get_queue.php | 67 + .../V2beta2/CloudTasksClient/get_task.php | 67 + .../V2beta2/CloudTasksClient/lease_tasks.php | 93 + .../CloudTasksClient/list_locations.php | 58 + .../V2beta2/CloudTasksClient/list_queues.php | 74 + .../V2beta2/CloudTasksClient/list_tasks.php | 80 + .../V2beta2/CloudTasksClient/pause_queue.php | 74 + .../V2beta2/CloudTasksClient/purge_queue.php | 72 + .../V2beta2/CloudTasksClient/renew_lease.php | 78 + .../V2beta2/CloudTasksClient/resume_queue.php | 81 + .../V2beta2/CloudTasksClient/run_task.php | 96 + .../CloudTasksClient/set_iam_policy.php | 79 + .../CloudTasksClient/test_iam_permissions.php | 81 + .../V2beta2/CloudTasksClient/update_queue.php | 70 + .../CloudTasksClient/upload_queue_yaml.php | 69 + .../v2beta2/src/V2beta2/CloudTasksClient.php | 36 + .../V2beta2/Gapic/CloudTasksGapicClient.php | 1977 +++++++++++++++++ .../v2beta2/src/V2beta2/gapic_metadata.json | 133 ++ .../resources/cloud_tasks_client_config.json | 160 ++ .../cloud_tasks_descriptor_config.php | 42 + .../cloud_tasks_rest_client_config.php | 268 +++ .../Unit/V2beta2/CloudTasksClientTest.php | 1492 +++++++++++++ .../Google/Cloud/Tasks/V2Beta3/Cloudtasks.php | 116 + .../Google/Cloud/Tasks/V2Beta3/Queue.php | Bin 0 -> 2709 bytes .../Google/Cloud/Tasks/V2Beta3/Target.php | Bin 0 -> 3007 bytes .../Google/Cloud/Tasks/V2Beta3/Task.php | Bin 0 -> 2155 bytes .../Tasks/V2beta3/AppEngineHttpQueue.php | 114 + .../Tasks/V2beta3/AppEngineHttpRequest.php | 478 ++++ .../Cloud/Tasks/V2beta3/AppEngineRouting.php | 380 ++++ .../Google/Cloud/Tasks/V2beta3/Attempt.php | 229 ++ .../Tasks/V2beta3/CreateQueueRequest.php | 136 ++ .../Cloud/Tasks/V2beta3/CreateTaskRequest.php | 302 +++ .../Tasks/V2beta3/DeleteQueueRequest.php | 72 + .../Cloud/Tasks/V2beta3/DeleteTaskRequest.php | 72 + .../Cloud/Tasks/V2beta3/GetQueueRequest.php | 128 ++ .../Cloud/Tasks/V2beta3/GetTaskRequest.php | 146 ++ .../Google/Cloud/Tasks/V2beta3/HttpMethod.php | 96 + .../Cloud/Tasks/V2beta3/HttpRequest.php | 433 ++++ .../Google/Cloud/Tasks/V2beta3/HttpTarget.php | 367 +++ .../Cloud/Tasks/V2beta3/HttpTarget/Header.php | 104 + .../V2beta3/HttpTarget/HeaderOverride.php | 80 + .../Cloud/Tasks/V2beta3/ListQueuesRequest.php | 310 +++ .../Tasks/V2beta3/ListQueuesResponse.php | 126 ++ .../Cloud/Tasks/V2beta3/ListTasksRequest.php | 258 +++ .../Cloud/Tasks/V2beta3/ListTasksResponse.php | 122 + .../Google/Cloud/Tasks/V2beta3/OAuthToken.php | 128 ++ .../Google/Cloud/Tasks/V2beta3/OidcToken.php | 126 ++ .../Cloud/Tasks/V2beta3/PathOverride.php | 68 + .../Cloud/Tasks/V2beta3/PauseQueueRequest.php | 72 + .../Cloud/Tasks/V2beta3/PullMessage.php | 132 ++ .../Cloud/Tasks/V2beta3/PurgeQueueRequest.php | 72 + .../Cloud/Tasks/V2beta3/QueryOverride.php | 72 + .../src/Google/Cloud/Tasks/V2beta3/Queue.php | 883 ++++++++ .../Cloud/Tasks/V2beta3/Queue/State.php | 89 + .../Google/Cloud/Tasks/V2beta3/Queue/Type.php | 64 + .../Google/Cloud/Tasks/V2beta3/QueueStats.php | 253 +++ .../Google/Cloud/Tasks/V2beta3/RateLimits.php | 317 +++ .../Tasks/V2beta3/ResumeQueueRequest.php | 72 + .../Cloud/Tasks/V2beta3/RetryConfig.php | 502 +++++ .../Cloud/Tasks/V2beta3/RunTaskRequest.php | 146 ++ .../V2beta3/StackdriverLoggingConfig.php | 80 + .../src/Google/Cloud/Tasks/V2beta3/Task.php | 746 +++++++ .../Google/Cloud/Tasks/V2beta3/Task/View.php | 81 + .../Tasks/V2beta3/UpdateQueueRequest.php | 150 ++ .../Cloud/Tasks/V2beta3/UriOverride.php | 353 +++ .../Tasks/V2beta3/UriOverride/Scheme.php | 66 + .../UriOverride/UriOverrideEnforceMode.php | 67 + .../V2beta3/CloudTasksClient/create_queue.php | 85 + .../V2beta3/CloudTasksClient/create_task.php | 76 + .../V2beta3/CloudTasksClient/delete_queue.php | 77 + .../V2beta3/CloudTasksClient/delete_task.php | 69 + .../CloudTasksClient/get_iam_policy.php | 74 + .../V2beta3/CloudTasksClient/get_location.php | 53 + .../V2beta3/CloudTasksClient/get_queue.php | 67 + .../V2beta3/CloudTasksClient/get_task.php | 67 + .../CloudTasksClient/list_locations.php | 58 + .../V2beta3/CloudTasksClient/list_queues.php | 74 + .../V2beta3/CloudTasksClient/list_tasks.php | 80 + .../V2beta3/CloudTasksClient/pause_queue.php | 74 + .../V2beta3/CloudTasksClient/purge_queue.php | 72 + .../V2beta3/CloudTasksClient/resume_queue.php | 81 + .../V2beta3/CloudTasksClient/run_task.php | 93 + .../CloudTasksClient/set_iam_policy.php | 79 + .../CloudTasksClient/test_iam_permissions.php | 81 + .../V2beta3/CloudTasksClient/update_queue.php | 70 + .../v2beta3/src/V2beta3/CloudTasksClient.php | 36 + .../V2beta3/Gapic/CloudTasksGapicClient.php | 1542 +++++++++++++ .../v2beta3/src/V2beta3/gapic_metadata.json | 108 + .../resources/cloud_tasks_client_config.json | 135 ++ .../cloud_tasks_descriptor_config.php | 42 + .../cloud_tasks_rest_client_config.php | 220 ++ .../Unit/V2beta3/CloudTasksClientTest.php | 1189 ++++++++++ 212 files changed, 42429 insertions(+) create mode 100644 owl-bot-staging/Tasks/v2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2/Cloudtasks.php create mode 100644 owl-bot-staging/Tasks/v2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2/Queue.php create mode 100644 owl-bot-staging/Tasks/v2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2/Target.php create mode 100644 owl-bot-staging/Tasks/v2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2/Task.php create mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/AppEngineHttpRequest.php create mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/AppEngineRouting.php create mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Attempt.php create mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/CreateQueueRequest.php create mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/CreateTaskRequest.php create mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/DeleteQueueRequest.php create mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/DeleteTaskRequest.php create mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/GetQueueRequest.php create mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/GetTaskRequest.php create mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/HttpMethod.php create mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/HttpRequest.php create mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ListQueuesRequest.php create mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ListQueuesResponse.php create mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ListTasksRequest.php create mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ListTasksResponse.php create mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/OAuthToken.php create mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/OidcToken.php create mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/PauseQueueRequest.php create mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/PurgeQueueRequest.php create mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Queue.php create mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Queue/State.php create mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/RateLimits.php create mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ResumeQueueRequest.php create mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/RetryConfig.php create mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/RunTaskRequest.php create mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/StackdriverLoggingConfig.php create mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Task.php create mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Task/View.php create mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/UpdateQueueRequest.php create mode 100644 owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/create_queue.php create mode 100644 owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/create_task.php create mode 100644 owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/delete_queue.php create mode 100644 owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/delete_task.php create mode 100644 owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/get_iam_policy.php create mode 100644 owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/get_location.php create mode 100644 owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/get_queue.php create mode 100644 owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/get_task.php create mode 100644 owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/list_locations.php create mode 100644 owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/list_queues.php create mode 100644 owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/list_tasks.php create mode 100644 owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/pause_queue.php create mode 100644 owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/purge_queue.php create mode 100644 owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/resume_queue.php create mode 100644 owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/run_task.php create mode 100644 owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/set_iam_policy.php create mode 100644 owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/test_iam_permissions.php create mode 100644 owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/update_queue.php create mode 100644 owl-bot-staging/Tasks/v2/src/V2/Client/CloudTasksClient.php create mode 100644 owl-bot-staging/Tasks/v2/src/V2/CloudTasksClient.php create mode 100644 owl-bot-staging/Tasks/v2/src/V2/Gapic/CloudTasksGapicClient.php create mode 100644 owl-bot-staging/Tasks/v2/src/V2/gapic_metadata.json create mode 100644 owl-bot-staging/Tasks/v2/src/V2/resources/cloud_tasks_client_config.json create mode 100644 owl-bot-staging/Tasks/v2/src/V2/resources/cloud_tasks_descriptor_config.php create mode 100644 owl-bot-staging/Tasks/v2/src/V2/resources/cloud_tasks_rest_client_config.php create mode 100644 owl-bot-staging/Tasks/v2/tests/Unit/V2/Client/CloudTasksClientTest.php create mode 100644 owl-bot-staging/Tasks/v2/tests/Unit/V2/CloudTasksClientTest.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta2/Cloudtasks.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta2/OldTarget.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta2/Queue.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta2/Target.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta2/Task.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AcknowledgeTaskRequest.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AppEngineHttpRequest.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AppEngineHttpTarget.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AppEngineRouting.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AttemptStatus.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/CancelLeaseRequest.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/CreateQueueRequest.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/CreateTaskRequest.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/DeleteQueueRequest.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/DeleteTaskRequest.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/GetQueueRequest.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/GetTaskRequest.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/HttpMethod.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/HttpRequest.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/HttpTarget.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/HttpTarget/Header.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/HttpTarget/HeaderOverride.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/LeaseTasksRequest.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/LeaseTasksResponse.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ListQueuesRequest.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ListQueuesResponse.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ListTasksRequest.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ListTasksResponse.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/OAuthToken.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/OidcToken.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PathOverride.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PauseQueueRequest.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PullMessage.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PullTarget.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PurgeQueueRequest.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/QueryOverride.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Queue.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Queue/State.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/QueueStats.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/RateLimits.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/RenewLeaseRequest.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ResumeQueueRequest.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/RetryConfig.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/RunTaskRequest.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Task.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Task/View.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/TaskStatus.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/UpdateQueueRequest.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/UploadQueueYamlRequest.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/UriOverride.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/UriOverride/Scheme.php create mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/UriOverride/UriOverrideEnforceMode.php create mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/acknowledge_task.php create mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/cancel_lease.php create mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/create_queue.php create mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/create_task.php create mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/delete_queue.php create mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/delete_task.php create mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/get_iam_policy.php create mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/get_location.php create mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/get_queue.php create mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/get_task.php create mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/lease_tasks.php create mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/list_locations.php create mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/list_queues.php create mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/list_tasks.php create mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/pause_queue.php create mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/purge_queue.php create mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/renew_lease.php create mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/resume_queue.php create mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/run_task.php create mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/set_iam_policy.php create mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/test_iam_permissions.php create mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/update_queue.php create mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/upload_queue_yaml.php create mode 100644 owl-bot-staging/Tasks/v2beta2/src/V2beta2/CloudTasksClient.php create mode 100644 owl-bot-staging/Tasks/v2beta2/src/V2beta2/Gapic/CloudTasksGapicClient.php create mode 100644 owl-bot-staging/Tasks/v2beta2/src/V2beta2/gapic_metadata.json create mode 100644 owl-bot-staging/Tasks/v2beta2/src/V2beta2/resources/cloud_tasks_client_config.json create mode 100644 owl-bot-staging/Tasks/v2beta2/src/V2beta2/resources/cloud_tasks_descriptor_config.php create mode 100644 owl-bot-staging/Tasks/v2beta2/src/V2beta2/resources/cloud_tasks_rest_client_config.php create mode 100644 owl-bot-staging/Tasks/v2beta2/tests/Unit/V2beta2/CloudTasksClientTest.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta3/Cloudtasks.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta3/Queue.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta3/Target.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta3/Task.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/AppEngineHttpQueue.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/AppEngineHttpRequest.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/AppEngineRouting.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Attempt.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/CreateQueueRequest.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/CreateTaskRequest.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/DeleteQueueRequest.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/DeleteTaskRequest.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/GetQueueRequest.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/GetTaskRequest.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/HttpMethod.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/HttpRequest.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/HttpTarget.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/HttpTarget/Header.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/HttpTarget/HeaderOverride.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ListQueuesRequest.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ListQueuesResponse.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ListTasksRequest.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ListTasksResponse.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/OAuthToken.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/OidcToken.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/PathOverride.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/PauseQueueRequest.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/PullMessage.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/PurgeQueueRequest.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/QueryOverride.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Queue.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Queue/State.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Queue/Type.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/QueueStats.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/RateLimits.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ResumeQueueRequest.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/RetryConfig.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/RunTaskRequest.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/StackdriverLoggingConfig.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Task.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Task/View.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/UpdateQueueRequest.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/UriOverride.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/UriOverride/Scheme.php create mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/UriOverride/UriOverrideEnforceMode.php create mode 100644 owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/create_queue.php create mode 100644 owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/create_task.php create mode 100644 owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/delete_queue.php create mode 100644 owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/delete_task.php create mode 100644 owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/get_iam_policy.php create mode 100644 owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/get_location.php create mode 100644 owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/get_queue.php create mode 100644 owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/get_task.php create mode 100644 owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/list_locations.php create mode 100644 owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/list_queues.php create mode 100644 owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/list_tasks.php create mode 100644 owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/pause_queue.php create mode 100644 owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/purge_queue.php create mode 100644 owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/resume_queue.php create mode 100644 owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/run_task.php create mode 100644 owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/set_iam_policy.php create mode 100644 owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/test_iam_permissions.php create mode 100644 owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/update_queue.php create mode 100644 owl-bot-staging/Tasks/v2beta3/src/V2beta3/CloudTasksClient.php create mode 100644 owl-bot-staging/Tasks/v2beta3/src/V2beta3/Gapic/CloudTasksGapicClient.php create mode 100644 owl-bot-staging/Tasks/v2beta3/src/V2beta3/gapic_metadata.json create mode 100644 owl-bot-staging/Tasks/v2beta3/src/V2beta3/resources/cloud_tasks_client_config.json create mode 100644 owl-bot-staging/Tasks/v2beta3/src/V2beta3/resources/cloud_tasks_descriptor_config.php create mode 100644 owl-bot-staging/Tasks/v2beta3/src/V2beta3/resources/cloud_tasks_rest_client_config.php create mode 100644 owl-bot-staging/Tasks/v2beta3/tests/Unit/V2beta3/CloudTasksClientTest.php diff --git a/owl-bot-staging/Tasks/v2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2/Cloudtasks.php b/owl-bot-staging/Tasks/v2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2/Cloudtasks.php new file mode 100644 index 000000000000..00f7218c1d4a --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2/Cloudtasks.php @@ -0,0 +1,114 @@ +internalAddGeneratedFile( + ' +�% +&google/cloud/tasks/v2/cloudtasks.protogoogle.cloud.tasks.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto!google/cloud/tasks/v2/queue.proto google/cloud/tasks/v2/task.protogoogle/iam/v1/iam_policy.protogoogle/iam/v1/policy.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto"� +ListQueuesRequest7 +parent ( B\'�A�A!cloudtasks.googleapis.com/Queue +filter (  + page_size ( + +page_token ( "[ +ListQueuesResponse, +queues ( 2.google.cloud.tasks.v2.Queue +next_page_token ( "H +GetQueueRequest5 +name ( B\'�A�A! +cloudtasks.googleapis.com/Queue" +CreateQueueRequest7 +parent ( B\'�A�A!cloudtasks.googleapis.com/Queue0 +queue ( 2.google.cloud.tasks.v2.QueueB�A"w +UpdateQueueRequest0 +queue ( 2.google.cloud.tasks.v2.QueueB�A/ + update_mask ( 2.google.protobuf.FieldMask"K +DeleteQueueRequest5 +name ( B\'�A�A! +cloudtasks.googleapis.com/Queue"J +PurgeQueueRequest5 +name ( B\'�A�A! +cloudtasks.googleapis.com/Queue"J +PauseQueueRequest5 +name ( B\'�A�A! +cloudtasks.googleapis.com/Queue"K +ResumeQueueRequest5 +name ( B\'�A�A! +cloudtasks.googleapis.com/Queue"� +ListTasksRequest6 +parent ( B&�A�A cloudtasks.googleapis.com/Task7 + response_view (2 .google.cloud.tasks.v2.Task.View + page_size ( + +page_token ( "X +ListTasksResponse* +tasks ( 2.google.cloud.tasks.v2.Task +next_page_token ( " +GetTaskRequest4 +name ( B&�A�A +cloudtasks.googleapis.com/Task7 + response_view (2 .google.cloud.tasks.v2.Task.View"� +CreateTaskRequest6 +parent ( B&�A�A cloudtasks.googleapis.com/Task. +task ( 2.google.cloud.tasks.v2.TaskB�A7 + response_view (2 .google.cloud.tasks.v2.Task.View"I +DeleteTaskRequest4 +name ( B&�A�A +cloudtasks.googleapis.com/Task" +RunTaskRequest4 +name ( B&�A�A +cloudtasks.googleapis.com/Task7 + response_view (2 .google.cloud.tasks.v2.Task.View2� + +CloudTasks� + +ListQueues(.google.cloud.tasks.v2.ListQueuesRequest).google.cloud.tasks.v2.ListQueuesResponse";���,*/v2/{parent=projects/*/locations/*}/queues�Aparent� +GetQueue&.google.cloud.tasks.v2.GetQueueRequest.google.cloud.tasks.v2.Queue"9���,*/v2/{name=projects/*/locations/*/queues/*}�Aname� + CreateQueue).google.cloud.tasks.v2.CreateQueueRequest.google.cloud.tasks.v2.Queue"H���3"*/v2/{parent=projects/*/locations/*}/queues:queue�A parent,queue� + UpdateQueue).google.cloud.tasks.v2.UpdateQueueRequest.google.cloud.tasks.v2.Queue"S���920/v2/{queue.name=projects/*/locations/*/queues/*}:queue�Aqueue,update_mask� + DeleteQueue).google.cloud.tasks.v2.DeleteQueueRequest.google.protobuf.Empty"9���,**/v2/{name=projects/*/locations/*/queues/*}�Aname� + +PurgeQueue(.google.cloud.tasks.v2.PurgeQueueRequest.google.cloud.tasks.v2.Queue"B���5"0/v2/{name=projects/*/locations/*/queues/*}:purge:*�Aname� + +PauseQueue(.google.cloud.tasks.v2.PauseQueueRequest.google.cloud.tasks.v2.Queue"B���5"0/v2/{name=projects/*/locations/*/queues/*}:pause:*�Aname� + ResumeQueue).google.cloud.tasks.v2.ResumeQueueRequest.google.cloud.tasks.v2.Queue"C���6"1/v2/{name=projects/*/locations/*/queues/*}:resume:*�Aname� + GetIamPolicy".google.iam.v1.GetIamPolicyRequest.google.iam.v1.Policy"Q���@";/v2/{resource=projects/*/locations/*/queues/*}:getIamPolicy:*�Aresource� + SetIamPolicy".google.iam.v1.SetIamPolicyRequest.google.iam.v1.Policy"X���@";/v2/{resource=projects/*/locations/*/queues/*}:setIamPolicy:*�Aresource,policy� +TestIamPermissions(.google.iam.v1.TestIamPermissionsRequest).google.iam.v1.TestIamPermissionsResponse"c���F"A/v2/{resource=projects/*/locations/*/queues/*}:testIamPermissions:*�Aresource,permissions� + ListTasks\'.google.cloud.tasks.v2.ListTasksRequest(.google.cloud.tasks.v2.ListTasksResponse"C���42/v2/{parent=projects/*/locations/*/queues/*}/tasks�Aparent� +GetTask%.google.cloud.tasks.v2.GetTaskRequest.google.cloud.tasks.v2.Task"A���42/v2/{name=projects/*/locations/*/queues/*/tasks/*}�Aname� + +CreateTask(.google.cloud.tasks.v2.CreateTaskRequest.google.cloud.tasks.v2.Task"K���7"2/v2/{parent=projects/*/locations/*/queues/*}/tasks:*�A parent,task� + +DeleteTask(.google.cloud.tasks.v2.DeleteTaskRequest.google.protobuf.Empty"A���4*2/v2/{name=projects/*/locations/*/queues/*/tasks/*}�Aname� +RunTask%.google.cloud.tasks.v2.RunTaskRequest.google.cloud.tasks.v2.Task"H���;"6/v2/{name=projects/*/locations/*/queues/*/tasks/*}:run:*�AnameM�Acloudtasks.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformBv +com.google.cloud.tasks.v2BCloudTasksProtoPZ>cloud.google.com/go/cloudtasks/apiv2/cloudtaskspb;cloudtaskspb�TASKSbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Tasks/v2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2/Queue.php b/owl-bot-staging/Tasks/v2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2/Queue.php new file mode 100644 index 0000000000000000000000000000000000000000..7934457c1550ea983a9692c5f7e75c7193348064 GIT binary patch literal 1983 zcmbVN;cgp65XNmB$T(ExM356Cx-pgFN^llNRLCJkPV7dOLSk$O33Srwe7C-Ad%oN5 z?nRW!FU4P;g4f_FnBBc|9O_Vn|M+h2`*vr(`F7^J@A(yn&&erGsR$H}$n-T)SCnv( zsVvMAGRDuZK@_OKJ2gb_L=(MHT1uu@noo*j^>%DVnl{Ex=dB=*h!QznJ)ICi zRW8y)6Sv-Av3&B@2-W4x8_`1c&P_r${B^9`@}kZHbLjkM`cjf!jy^#p{|9x#u>2~R z^YvU)g)g76Li27EEhT=A)@v?B(GnfNA6u~hPR}_z7UCLPy2h67b$hR|o~eu~)~ z6&Pb)bVDmDQZK$g`sa65=4Szo-#4IY?CWg9hW38FLMqKI=L|j#IQMB9vy}QG%N0vw zKf9(vu!z?0A*j~&4&1e&yIs!vhB>lC=PA_m)%6oLXG+%Z8~Xko>=7c*4AA)&w$XUv zwI62bjK%d0Lu}kd)X)=ybiRVB_BX9pk@BE@7scf6jy2M80eFs<^R-CzO>@*ILby7);JqgZhn>XzZRO8)KQ>Jv-indRBI8-1wSXm;SE@uWNH`$!L{;nVS6O5ywa_1(Rcx{Ql)*^od>`A z5yQr*!Ye9$j(SLnMT?A|D$XbHKtravkjj_X3yp=UPC-Rvmw4LEw$x~04Yg->_OA}otob_lF_ZO&4Eiq*(wv%;9~!0S8; zy!GS1;CJ9dBTc5qLK;hB$7-Vu^}8IPrIOfyG~73R%u0C7U>6HlrgGa)$6)F?)I(ud z`Q@4YT3${pcbwU&XNMlT0O#I~Ir#K&^<}zgg!=km+0MSO6Jce5p!0FStr;E$Y5V*F H765+(Bg%xr literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Tasks/v2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2/Target.php b/owl-bot-staging/Tasks/v2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2/Target.php new file mode 100644 index 0000000000000000000000000000000000000000..54926fb36dd67b638443466bc250c6cb509b8833 GIT binary patch literal 1761 zcmb7F|8Cnh5UzhDu20@72&d~eJWj3mhpfL(1Ni=M0!EQvaly`dXe_lefh!{ zM3{LvfEcexn&5z-Q)l#w2pnR8z0=&&J64{at3188{X>8t!fA@!JOX?GB%dUkMKnOE zz(W2!qp440DkzTVd&&I>&2f|x>3S18&*DH(79-_g#{ua+M@3A9eU>m;>k<0M#Zl$U z(!FUc2#;~(jY%4Cnh3@n2^|b%RhyC`Zx-U%g9I3i2Dri>2;*Hv8y$&32#B`r%BhT(?siPW;Y$)Pgt!*5OK z+%KZ>xWJgX&}J^Qx$bxVtb#TXB6&@I%}6Q?9cmem+7(pkHb=EThE?MS(3TS5uZUQ( zuw9j3KJ7m>Zw+UvP;x*d(D(@&OM*kf({>Hjx>~>YFFs{@b5eL%vEY|R3+gi#UbgEp zWy?4Kjp0lzeZekB+}@E!?M@!{P$FFgoIH>f0Ha}0I_~C<=ngWr1eShZn9%wg9}Q|3 zp~A3ccnEcT1~JHJ<9Z?hcuRFSZ<24AUQ=#mWq6e znw0;Pj;)_9*V1>4ChRyv_jsc38X7cg$DP_|=XzuG3w$oGfZG)uX~mAtm!?yB_p(?G z9}hNL^%ktS7m8~ECsf`HIVd+Iv%~E_v)%l*_6BjelxbnI%r6LMG zPq_?v!WAbm{}bN5g(oDI41kwyCwW2@PZO*G`w3<3=h*txwogS0ac<%AB_ka=gdGeM z#j=FNL7z#QaiP*|1g5?}WvU`f@3fy6*J^isg4_0uzJKYFTUcc|yLdas8B=+dY?^m# z2lHwbT)|UU@Zf+Ir2FRqo#U@UEwT$VXApybYj{OTKL?cnlm7#H#3B2NoQT_F4+ISk zA>FyW8e=l|?Q34-sT)OAT6RFJ?TScE>ofFM1Kp@n=L@T2*XY#ghLt%+dC0*OlO`pt`Q2W)0Wc4QCHM zB0_{Lnev2%Go?hBvEOr`xp@~1mOC$8>+yqV+^!G<19}6P0}FX`$MMn1f|E~-lh!p( z7O^kULrG^W%3~JlxSDkXUN6BVDQ=|$$3x3BW6*UhVChD{EA&~!p@S$o3nNCN7{YGe zGqA^(?kT0}e2G>o6ixF)HSYstN$+RSkJ3c4(C$Al``@F76P`&G5~bLQP|b$9VWYfZ zQ5kO6S~;)K3UsV<6uK44MfFq8{%9_P^=b!SbBE5odkl81m#D74&gW?DcsTeue7AQv z8f*`DhJ*gv9jAeodfmg}_FBz(fa*K%-o9PC>(Bn}GPGe{ZRKn=K?IjBv~|x2Ya8hI%vf7$_?b7M0Lz zXeLK`dW>qnytapB{Q=L@)DB0J1P|zk@pzsUG2XoRXME2T%y-YK9`=nL9Tz5zel4e0 OOc`To2f`f95&94G5|j!6 literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/AppEngineHttpRequest.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/AppEngineHttpRequest.php new file mode 100644 index 000000000000..ad547996af2e --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/AppEngineHttpRequest.php @@ -0,0 +1,469 @@ +google.cloud.tasks.v2.AppEngineHttpRequest + */ +class AppEngineHttpRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The HTTP method to use for the request. The default is POST. + * The app's request handler for the task's target URL must be able to handle + * HTTP requests with this http_method, otherwise the task attempt fails with + * error code 405 (Method Not Allowed). See [Writing a push task request + * handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) + * and the App Engine documentation for your runtime on [How Requests are + * Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). + * + * Generated from protobuf field .google.cloud.tasks.v2.HttpMethod http_method = 1; + */ + protected $http_method = 0; + /** + * Task-level setting for App Engine routing. + * * If [app_engine_routing_override is set on the + * queue][google.cloud.tasks.v2.Queue.app_engine_routing_override], this + * value is used for all tasks in the queue, no matter what the setting is + * for the [task-level + * app_engine_routing][google.cloud.tasks.v2.AppEngineHttpRequest.app_engine_routing]. + * + * Generated from protobuf field .google.cloud.tasks.v2.AppEngineRouting app_engine_routing = 2; + */ + protected $app_engine_routing = null; + /** + * The relative URI. + * The relative URI must begin with "/" and must be a valid HTTP relative URI. + * It can contain a path and query string arguments. + * If the relative URI is empty, then the root path "/" will be used. + * No spaces are allowed, and the maximum length allowed is 2083 characters. + * + * Generated from protobuf field string relative_uri = 3; + */ + protected $relative_uri = ''; + /** + * HTTP request headers. + * This map contains the header field names and values. + * Headers can be set when the + * [task is created][google.cloud.tasks.v2.CloudTasks.CreateTask]. + * Repeated headers are not supported but a header value can contain commas. + * Cloud Tasks sets some headers to default values: + * * `User-Agent`: By default, this header is + * `"AppEngine-Google; (+http://code.google.com/appengine)"`. + * This header can be modified, but Cloud Tasks will append + * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the + * modified `User-Agent`. + * If the task has a [body][google.cloud.tasks.v2.AppEngineHttpRequest.body], + * Cloud Tasks sets the following headers: + * * `Content-Type`: By default, the `Content-Type` header is set to + * `"application/octet-stream"`. The default can be overridden by explicitly + * setting `Content-Type` to a particular media type when the + * [task is created][google.cloud.tasks.v2.CloudTasks.CreateTask]. + * For example, `Content-Type` can be set to `"application/json"`. + * * `Content-Length`: This is computed by Cloud Tasks. This value is + * output only. It cannot be changed. + * The headers below cannot be set or overridden: + * * `Host` + * * `X-Google-*` + * * `X-AppEngine-*` + * In addition, Cloud Tasks sets some headers when the task is dispatched, + * such as headers containing information about the task; see + * [request + * headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers). + * These headers are set only when the task is dispatched, so they are not + * visible when the task is returned in a Cloud Tasks response. + * Although there is no specific limit for the maximum number of headers or + * the size, there is a limit on the maximum size of the + * [Task][google.cloud.tasks.v2.Task]. For more information, see the + * [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask] documentation. + * + * Generated from protobuf field map headers = 4; + */ + private $headers; + /** + * HTTP request body. + * A request body is allowed only if the HTTP method is POST or PUT. It is + * an error to set a body on a task with an incompatible + * [HttpMethod][google.cloud.tasks.v2.HttpMethod]. + * + * Generated from protobuf field bytes body = 5; + */ + protected $body = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $http_method + * The HTTP method to use for the request. The default is POST. + * The app's request handler for the task's target URL must be able to handle + * HTTP requests with this http_method, otherwise the task attempt fails with + * error code 405 (Method Not Allowed). See [Writing a push task request + * handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) + * and the App Engine documentation for your runtime on [How Requests are + * Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). + * @type \Google\Cloud\Tasks\V2\AppEngineRouting $app_engine_routing + * Task-level setting for App Engine routing. + * * If [app_engine_routing_override is set on the + * queue][google.cloud.tasks.v2.Queue.app_engine_routing_override], this + * value is used for all tasks in the queue, no matter what the setting is + * for the [task-level + * app_engine_routing][google.cloud.tasks.v2.AppEngineHttpRequest.app_engine_routing]. + * @type string $relative_uri + * The relative URI. + * The relative URI must begin with "/" and must be a valid HTTP relative URI. + * It can contain a path and query string arguments. + * If the relative URI is empty, then the root path "/" will be used. + * No spaces are allowed, and the maximum length allowed is 2083 characters. + * @type array|\Google\Protobuf\Internal\MapField $headers + * HTTP request headers. + * This map contains the header field names and values. + * Headers can be set when the + * [task is created][google.cloud.tasks.v2.CloudTasks.CreateTask]. + * Repeated headers are not supported but a header value can contain commas. + * Cloud Tasks sets some headers to default values: + * * `User-Agent`: By default, this header is + * `"AppEngine-Google; (+http://code.google.com/appengine)"`. + * This header can be modified, but Cloud Tasks will append + * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the + * modified `User-Agent`. + * If the task has a [body][google.cloud.tasks.v2.AppEngineHttpRequest.body], + * Cloud Tasks sets the following headers: + * * `Content-Type`: By default, the `Content-Type` header is set to + * `"application/octet-stream"`. The default can be overridden by explicitly + * setting `Content-Type` to a particular media type when the + * [task is created][google.cloud.tasks.v2.CloudTasks.CreateTask]. + * For example, `Content-Type` can be set to `"application/json"`. + * * `Content-Length`: This is computed by Cloud Tasks. This value is + * output only. It cannot be changed. + * The headers below cannot be set or overridden: + * * `Host` + * * `X-Google-*` + * * `X-AppEngine-*` + * In addition, Cloud Tasks sets some headers when the task is dispatched, + * such as headers containing information about the task; see + * [request + * headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers). + * These headers are set only when the task is dispatched, so they are not + * visible when the task is returned in a Cloud Tasks response. + * Although there is no specific limit for the maximum number of headers or + * the size, there is a limit on the maximum size of the + * [Task][google.cloud.tasks.v2.Task]. For more information, see the + * [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask] documentation. + * @type string $body + * HTTP request body. + * A request body is allowed only if the HTTP method is POST or PUT. It is + * an error to set a body on a task with an incompatible + * [HttpMethod][google.cloud.tasks.v2.HttpMethod]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2\Target::initOnce(); + parent::__construct($data); + } + + /** + * The HTTP method to use for the request. The default is POST. + * The app's request handler for the task's target URL must be able to handle + * HTTP requests with this http_method, otherwise the task attempt fails with + * error code 405 (Method Not Allowed). See [Writing a push task request + * handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) + * and the App Engine documentation for your runtime on [How Requests are + * Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). + * + * Generated from protobuf field .google.cloud.tasks.v2.HttpMethod http_method = 1; + * @return int + */ + public function getHttpMethod() + { + return $this->http_method; + } + + /** + * The HTTP method to use for the request. The default is POST. + * The app's request handler for the task's target URL must be able to handle + * HTTP requests with this http_method, otherwise the task attempt fails with + * error code 405 (Method Not Allowed). See [Writing a push task request + * handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) + * and the App Engine documentation for your runtime on [How Requests are + * Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). + * + * Generated from protobuf field .google.cloud.tasks.v2.HttpMethod http_method = 1; + * @param int $var + * @return $this + */ + public function setHttpMethod($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2\HttpMethod::class); + $this->http_method = $var; + + return $this; + } + + /** + * Task-level setting for App Engine routing. + * * If [app_engine_routing_override is set on the + * queue][google.cloud.tasks.v2.Queue.app_engine_routing_override], this + * value is used for all tasks in the queue, no matter what the setting is + * for the [task-level + * app_engine_routing][google.cloud.tasks.v2.AppEngineHttpRequest.app_engine_routing]. + * + * Generated from protobuf field .google.cloud.tasks.v2.AppEngineRouting app_engine_routing = 2; + * @return \Google\Cloud\Tasks\V2\AppEngineRouting|null + */ + public function getAppEngineRouting() + { + return $this->app_engine_routing; + } + + public function hasAppEngineRouting() + { + return isset($this->app_engine_routing); + } + + public function clearAppEngineRouting() + { + unset($this->app_engine_routing); + } + + /** + * Task-level setting for App Engine routing. + * * If [app_engine_routing_override is set on the + * queue][google.cloud.tasks.v2.Queue.app_engine_routing_override], this + * value is used for all tasks in the queue, no matter what the setting is + * for the [task-level + * app_engine_routing][google.cloud.tasks.v2.AppEngineHttpRequest.app_engine_routing]. + * + * Generated from protobuf field .google.cloud.tasks.v2.AppEngineRouting app_engine_routing = 2; + * @param \Google\Cloud\Tasks\V2\AppEngineRouting $var + * @return $this + */ + public function setAppEngineRouting($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2\AppEngineRouting::class); + $this->app_engine_routing = $var; + + return $this; + } + + /** + * The relative URI. + * The relative URI must begin with "/" and must be a valid HTTP relative URI. + * It can contain a path and query string arguments. + * If the relative URI is empty, then the root path "/" will be used. + * No spaces are allowed, and the maximum length allowed is 2083 characters. + * + * Generated from protobuf field string relative_uri = 3; + * @return string + */ + public function getRelativeUri() + { + return $this->relative_uri; + } + + /** + * The relative URI. + * The relative URI must begin with "/" and must be a valid HTTP relative URI. + * It can contain a path and query string arguments. + * If the relative URI is empty, then the root path "/" will be used. + * No spaces are allowed, and the maximum length allowed is 2083 characters. + * + * Generated from protobuf field string relative_uri = 3; + * @param string $var + * @return $this + */ + public function setRelativeUri($var) + { + GPBUtil::checkString($var, True); + $this->relative_uri = $var; + + return $this; + } + + /** + * HTTP request headers. + * This map contains the header field names and values. + * Headers can be set when the + * [task is created][google.cloud.tasks.v2.CloudTasks.CreateTask]. + * Repeated headers are not supported but a header value can contain commas. + * Cloud Tasks sets some headers to default values: + * * `User-Agent`: By default, this header is + * `"AppEngine-Google; (+http://code.google.com/appengine)"`. + * This header can be modified, but Cloud Tasks will append + * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the + * modified `User-Agent`. + * If the task has a [body][google.cloud.tasks.v2.AppEngineHttpRequest.body], + * Cloud Tasks sets the following headers: + * * `Content-Type`: By default, the `Content-Type` header is set to + * `"application/octet-stream"`. The default can be overridden by explicitly + * setting `Content-Type` to a particular media type when the + * [task is created][google.cloud.tasks.v2.CloudTasks.CreateTask]. + * For example, `Content-Type` can be set to `"application/json"`. + * * `Content-Length`: This is computed by Cloud Tasks. This value is + * output only. It cannot be changed. + * The headers below cannot be set or overridden: + * * `Host` + * * `X-Google-*` + * * `X-AppEngine-*` + * In addition, Cloud Tasks sets some headers when the task is dispatched, + * such as headers containing information about the task; see + * [request + * headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers). + * These headers are set only when the task is dispatched, so they are not + * visible when the task is returned in a Cloud Tasks response. + * Although there is no specific limit for the maximum number of headers or + * the size, there is a limit on the maximum size of the + * [Task][google.cloud.tasks.v2.Task]. For more information, see the + * [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask] documentation. + * + * Generated from protobuf field map headers = 4; + * @return \Google\Protobuf\Internal\MapField + */ + public function getHeaders() + { + return $this->headers; + } + + /** + * HTTP request headers. + * This map contains the header field names and values. + * Headers can be set when the + * [task is created][google.cloud.tasks.v2.CloudTasks.CreateTask]. + * Repeated headers are not supported but a header value can contain commas. + * Cloud Tasks sets some headers to default values: + * * `User-Agent`: By default, this header is + * `"AppEngine-Google; (+http://code.google.com/appengine)"`. + * This header can be modified, but Cloud Tasks will append + * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the + * modified `User-Agent`. + * If the task has a [body][google.cloud.tasks.v2.AppEngineHttpRequest.body], + * Cloud Tasks sets the following headers: + * * `Content-Type`: By default, the `Content-Type` header is set to + * `"application/octet-stream"`. The default can be overridden by explicitly + * setting `Content-Type` to a particular media type when the + * [task is created][google.cloud.tasks.v2.CloudTasks.CreateTask]. + * For example, `Content-Type` can be set to `"application/json"`. + * * `Content-Length`: This is computed by Cloud Tasks. This value is + * output only. It cannot be changed. + * The headers below cannot be set or overridden: + * * `Host` + * * `X-Google-*` + * * `X-AppEngine-*` + * In addition, Cloud Tasks sets some headers when the task is dispatched, + * such as headers containing information about the task; see + * [request + * headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers). + * These headers are set only when the task is dispatched, so they are not + * visible when the task is returned in a Cloud Tasks response. + * Although there is no specific limit for the maximum number of headers or + * the size, there is a limit on the maximum size of the + * [Task][google.cloud.tasks.v2.Task]. For more information, see the + * [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask] documentation. + * + * Generated from protobuf field map headers = 4; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setHeaders($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->headers = $arr; + + return $this; + } + + /** + * HTTP request body. + * A request body is allowed only if the HTTP method is POST or PUT. It is + * an error to set a body on a task with an incompatible + * [HttpMethod][google.cloud.tasks.v2.HttpMethod]. + * + * Generated from protobuf field bytes body = 5; + * @return string + */ + public function getBody() + { + return $this->body; + } + + /** + * HTTP request body. + * A request body is allowed only if the HTTP method is POST or PUT. It is + * an error to set a body on a task with an incompatible + * [HttpMethod][google.cloud.tasks.v2.HttpMethod]. + * + * Generated from protobuf field bytes body = 5; + * @param string $var + * @return $this + */ + public function setBody($var) + { + GPBUtil::checkString($var, False); + $this->body = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/AppEngineRouting.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/AppEngineRouting.php new file mode 100644 index 000000000000..265cf9515609 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/AppEngineRouting.php @@ -0,0 +1,373 @@ +google.cloud.tasks.v2.AppEngineRouting + */ +class AppEngineRouting extends \Google\Protobuf\Internal\Message +{ + /** + * App service. + * By default, the task is sent to the service which is the default + * service when the task is attempted. + * For some queues or tasks which were created using the App Engine + * Task Queue API, [host][google.cloud.tasks.v2.AppEngineRouting.host] is not + * parsable into [service][google.cloud.tasks.v2.AppEngineRouting.service], + * [version][google.cloud.tasks.v2.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2.AppEngineRouting.instance]. For example, + * some tasks which were created using the App Engine SDK use a custom domain + * name; custom domains are not parsed by Cloud Tasks. If + * [host][google.cloud.tasks.v2.AppEngineRouting.host] is not parsable, then + * [service][google.cloud.tasks.v2.AppEngineRouting.service], + * [version][google.cloud.tasks.v2.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2.AppEngineRouting.instance] are the empty + * string. + * + * Generated from protobuf field string service = 1; + */ + protected $service = ''; + /** + * App version. + * By default, the task is sent to the version which is the default + * version when the task is attempted. + * For some queues or tasks which were created using the App Engine + * Task Queue API, [host][google.cloud.tasks.v2.AppEngineRouting.host] is not + * parsable into [service][google.cloud.tasks.v2.AppEngineRouting.service], + * [version][google.cloud.tasks.v2.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2.AppEngineRouting.instance]. For example, + * some tasks which were created using the App Engine SDK use a custom domain + * name; custom domains are not parsed by Cloud Tasks. If + * [host][google.cloud.tasks.v2.AppEngineRouting.host] is not parsable, then + * [service][google.cloud.tasks.v2.AppEngineRouting.service], + * [version][google.cloud.tasks.v2.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2.AppEngineRouting.instance] are the empty + * string. + * + * Generated from protobuf field string version = 2; + */ + protected $version = ''; + /** + * App instance. + * By default, the task is sent to an instance which is available when + * the task is attempted. + * Requests can only be sent to a specific instance if + * [manual scaling is used in App Engine + * Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). + * App Engine Flex does not support instances. For more information, see + * [App Engine Standard request + * routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) + * and [App Engine Flex request + * routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). + * + * Generated from protobuf field string instance = 3; + */ + protected $instance = ''; + /** + * Output only. The host that the task is sent to. + * The host is constructed from the domain name of the app associated with + * the queue's project ID (for example .appspot.com), and the + * [service][google.cloud.tasks.v2.AppEngineRouting.service], + * [version][google.cloud.tasks.v2.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2.AppEngineRouting.instance]. Tasks which + * were created using the App Engine SDK might have a custom domain name. + * For more information, see + * [How Requests are + * Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). + * + * Generated from protobuf field string host = 4; + */ + protected $host = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $service + * App service. + * By default, the task is sent to the service which is the default + * service when the task is attempted. + * For some queues or tasks which were created using the App Engine + * Task Queue API, [host][google.cloud.tasks.v2.AppEngineRouting.host] is not + * parsable into [service][google.cloud.tasks.v2.AppEngineRouting.service], + * [version][google.cloud.tasks.v2.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2.AppEngineRouting.instance]. For example, + * some tasks which were created using the App Engine SDK use a custom domain + * name; custom domains are not parsed by Cloud Tasks. If + * [host][google.cloud.tasks.v2.AppEngineRouting.host] is not parsable, then + * [service][google.cloud.tasks.v2.AppEngineRouting.service], + * [version][google.cloud.tasks.v2.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2.AppEngineRouting.instance] are the empty + * string. + * @type string $version + * App version. + * By default, the task is sent to the version which is the default + * version when the task is attempted. + * For some queues or tasks which were created using the App Engine + * Task Queue API, [host][google.cloud.tasks.v2.AppEngineRouting.host] is not + * parsable into [service][google.cloud.tasks.v2.AppEngineRouting.service], + * [version][google.cloud.tasks.v2.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2.AppEngineRouting.instance]. For example, + * some tasks which were created using the App Engine SDK use a custom domain + * name; custom domains are not parsed by Cloud Tasks. If + * [host][google.cloud.tasks.v2.AppEngineRouting.host] is not parsable, then + * [service][google.cloud.tasks.v2.AppEngineRouting.service], + * [version][google.cloud.tasks.v2.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2.AppEngineRouting.instance] are the empty + * string. + * @type string $instance + * App instance. + * By default, the task is sent to an instance which is available when + * the task is attempted. + * Requests can only be sent to a specific instance if + * [manual scaling is used in App Engine + * Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). + * App Engine Flex does not support instances. For more information, see + * [App Engine Standard request + * routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) + * and [App Engine Flex request + * routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). + * @type string $host + * Output only. The host that the task is sent to. + * The host is constructed from the domain name of the app associated with + * the queue's project ID (for example .appspot.com), and the + * [service][google.cloud.tasks.v2.AppEngineRouting.service], + * [version][google.cloud.tasks.v2.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2.AppEngineRouting.instance]. Tasks which + * were created using the App Engine SDK might have a custom domain name. + * For more information, see + * [How Requests are + * Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2\Target::initOnce(); + parent::__construct($data); + } + + /** + * App service. + * By default, the task is sent to the service which is the default + * service when the task is attempted. + * For some queues or tasks which were created using the App Engine + * Task Queue API, [host][google.cloud.tasks.v2.AppEngineRouting.host] is not + * parsable into [service][google.cloud.tasks.v2.AppEngineRouting.service], + * [version][google.cloud.tasks.v2.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2.AppEngineRouting.instance]. For example, + * some tasks which were created using the App Engine SDK use a custom domain + * name; custom domains are not parsed by Cloud Tasks. If + * [host][google.cloud.tasks.v2.AppEngineRouting.host] is not parsable, then + * [service][google.cloud.tasks.v2.AppEngineRouting.service], + * [version][google.cloud.tasks.v2.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2.AppEngineRouting.instance] are the empty + * string. + * + * Generated from protobuf field string service = 1; + * @return string + */ + public function getService() + { + return $this->service; + } + + /** + * App service. + * By default, the task is sent to the service which is the default + * service when the task is attempted. + * For some queues or tasks which were created using the App Engine + * Task Queue API, [host][google.cloud.tasks.v2.AppEngineRouting.host] is not + * parsable into [service][google.cloud.tasks.v2.AppEngineRouting.service], + * [version][google.cloud.tasks.v2.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2.AppEngineRouting.instance]. For example, + * some tasks which were created using the App Engine SDK use a custom domain + * name; custom domains are not parsed by Cloud Tasks. If + * [host][google.cloud.tasks.v2.AppEngineRouting.host] is not parsable, then + * [service][google.cloud.tasks.v2.AppEngineRouting.service], + * [version][google.cloud.tasks.v2.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2.AppEngineRouting.instance] are the empty + * string. + * + * Generated from protobuf field string service = 1; + * @param string $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkString($var, True); + $this->service = $var; + + return $this; + } + + /** + * App version. + * By default, the task is sent to the version which is the default + * version when the task is attempted. + * For some queues or tasks which were created using the App Engine + * Task Queue API, [host][google.cloud.tasks.v2.AppEngineRouting.host] is not + * parsable into [service][google.cloud.tasks.v2.AppEngineRouting.service], + * [version][google.cloud.tasks.v2.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2.AppEngineRouting.instance]. For example, + * some tasks which were created using the App Engine SDK use a custom domain + * name; custom domains are not parsed by Cloud Tasks. If + * [host][google.cloud.tasks.v2.AppEngineRouting.host] is not parsable, then + * [service][google.cloud.tasks.v2.AppEngineRouting.service], + * [version][google.cloud.tasks.v2.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2.AppEngineRouting.instance] are the empty + * string. + * + * Generated from protobuf field string version = 2; + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * App version. + * By default, the task is sent to the version which is the default + * version when the task is attempted. + * For some queues or tasks which were created using the App Engine + * Task Queue API, [host][google.cloud.tasks.v2.AppEngineRouting.host] is not + * parsable into [service][google.cloud.tasks.v2.AppEngineRouting.service], + * [version][google.cloud.tasks.v2.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2.AppEngineRouting.instance]. For example, + * some tasks which were created using the App Engine SDK use a custom domain + * name; custom domains are not parsed by Cloud Tasks. If + * [host][google.cloud.tasks.v2.AppEngineRouting.host] is not parsable, then + * [service][google.cloud.tasks.v2.AppEngineRouting.service], + * [version][google.cloud.tasks.v2.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2.AppEngineRouting.instance] are the empty + * string. + * + * Generated from protobuf field string version = 2; + * @param string $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkString($var, True); + $this->version = $var; + + return $this; + } + + /** + * App instance. + * By default, the task is sent to an instance which is available when + * the task is attempted. + * Requests can only be sent to a specific instance if + * [manual scaling is used in App Engine + * Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). + * App Engine Flex does not support instances. For more information, see + * [App Engine Standard request + * routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) + * and [App Engine Flex request + * routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). + * + * Generated from protobuf field string instance = 3; + * @return string + */ + public function getInstance() + { + return $this->instance; + } + + /** + * App instance. + * By default, the task is sent to an instance which is available when + * the task is attempted. + * Requests can only be sent to a specific instance if + * [manual scaling is used in App Engine + * Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). + * App Engine Flex does not support instances. For more information, see + * [App Engine Standard request + * routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) + * and [App Engine Flex request + * routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). + * + * Generated from protobuf field string instance = 3; + * @param string $var + * @return $this + */ + public function setInstance($var) + { + GPBUtil::checkString($var, True); + $this->instance = $var; + + return $this; + } + + /** + * Output only. The host that the task is sent to. + * The host is constructed from the domain name of the app associated with + * the queue's project ID (for example .appspot.com), and the + * [service][google.cloud.tasks.v2.AppEngineRouting.service], + * [version][google.cloud.tasks.v2.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2.AppEngineRouting.instance]. Tasks which + * were created using the App Engine SDK might have a custom domain name. + * For more information, see + * [How Requests are + * Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). + * + * Generated from protobuf field string host = 4; + * @return string + */ + public function getHost() + { + return $this->host; + } + + /** + * Output only. The host that the task is sent to. + * The host is constructed from the domain name of the app associated with + * the queue's project ID (for example .appspot.com), and the + * [service][google.cloud.tasks.v2.AppEngineRouting.service], + * [version][google.cloud.tasks.v2.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2.AppEngineRouting.instance]. Tasks which + * were created using the App Engine SDK might have a custom domain name. + * For more information, see + * [How Requests are + * Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). + * + * Generated from protobuf field string host = 4; + * @param string $var + * @return $this + */ + public function setHost($var) + { + GPBUtil::checkString($var, True); + $this->host = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Attempt.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Attempt.php new file mode 100644 index 000000000000..880d0b5b6f34 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Attempt.php @@ -0,0 +1,229 @@ +google.cloud.tasks.v2.Attempt + */ +class Attempt extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The time that this attempt was scheduled. + * `schedule_time` will be truncated to the nearest microsecond. + * + * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 1; + */ + protected $schedule_time = null; + /** + * Output only. The time that this attempt was dispatched. + * `dispatch_time` will be truncated to the nearest microsecond. + * + * Generated from protobuf field .google.protobuf.Timestamp dispatch_time = 2; + */ + protected $dispatch_time = null; + /** + * Output only. The time that this attempt response was received. + * `response_time` will be truncated to the nearest microsecond. + * + * Generated from protobuf field .google.protobuf.Timestamp response_time = 3; + */ + protected $response_time = null; + /** + * Output only. The response from the worker for this attempt. + * If `response_time` is unset, then the task has not been attempted or is + * currently running and the `response_status` field is meaningless. + * + * Generated from protobuf field .google.rpc.Status response_status = 4; + */ + protected $response_status = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $schedule_time + * Output only. The time that this attempt was scheduled. + * `schedule_time` will be truncated to the nearest microsecond. + * @type \Google\Protobuf\Timestamp $dispatch_time + * Output only. The time that this attempt was dispatched. + * `dispatch_time` will be truncated to the nearest microsecond. + * @type \Google\Protobuf\Timestamp $response_time + * Output only. The time that this attempt response was received. + * `response_time` will be truncated to the nearest microsecond. + * @type \Google\Rpc\Status $response_status + * Output only. The response from the worker for this attempt. + * If `response_time` is unset, then the task has not been attempted or is + * currently running and the `response_status` field is meaningless. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2\Task::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The time that this attempt was scheduled. + * `schedule_time` will be truncated to the nearest microsecond. + * + * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getScheduleTime() + { + return $this->schedule_time; + } + + public function hasScheduleTime() + { + return isset($this->schedule_time); + } + + public function clearScheduleTime() + { + unset($this->schedule_time); + } + + /** + * Output only. The time that this attempt was scheduled. + * `schedule_time` will be truncated to the nearest microsecond. + * + * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setScheduleTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->schedule_time = $var; + + return $this; + } + + /** + * Output only. The time that this attempt was dispatched. + * `dispatch_time` will be truncated to the nearest microsecond. + * + * Generated from protobuf field .google.protobuf.Timestamp dispatch_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDispatchTime() + { + return $this->dispatch_time; + } + + public function hasDispatchTime() + { + return isset($this->dispatch_time); + } + + public function clearDispatchTime() + { + unset($this->dispatch_time); + } + + /** + * Output only. The time that this attempt was dispatched. + * `dispatch_time` will be truncated to the nearest microsecond. + * + * Generated from protobuf field .google.protobuf.Timestamp dispatch_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDispatchTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->dispatch_time = $var; + + return $this; + } + + /** + * Output only. The time that this attempt response was received. + * `response_time` will be truncated to the nearest microsecond. + * + * Generated from protobuf field .google.protobuf.Timestamp response_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getResponseTime() + { + return $this->response_time; + } + + public function hasResponseTime() + { + return isset($this->response_time); + } + + public function clearResponseTime() + { + unset($this->response_time); + } + + /** + * Output only. The time that this attempt response was received. + * `response_time` will be truncated to the nearest microsecond. + * + * Generated from protobuf field .google.protobuf.Timestamp response_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setResponseTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->response_time = $var; + + return $this; + } + + /** + * Output only. The response from the worker for this attempt. + * If `response_time` is unset, then the task has not been attempted or is + * currently running and the `response_status` field is meaningless. + * + * Generated from protobuf field .google.rpc.Status response_status = 4; + * @return \Google\Rpc\Status|null + */ + public function getResponseStatus() + { + return $this->response_status; + } + + public function hasResponseStatus() + { + return isset($this->response_status); + } + + public function clearResponseStatus() + { + unset($this->response_status); + } + + /** + * Output only. The response from the worker for this attempt. + * If `response_time` is unset, then the task has not been attempted or is + * currently running and the `response_status` field is meaningless. + * + * Generated from protobuf field .google.rpc.Status response_status = 4; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setResponseStatus($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->response_status = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/CreateQueueRequest.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/CreateQueueRequest.php new file mode 100644 index 000000000000..0efd1e6fd83c --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/CreateQueueRequest.php @@ -0,0 +1,160 @@ +google.cloud.tasks.v2.CreateQueueRequest + */ +class CreateQueueRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The location name in which the queue will be created. + * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * The list of allowed locations can be obtained by calling Cloud + * Tasks' implementation of + * [ListLocations][google.cloud.location.Locations.ListLocations]. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The queue to create. + * [Queue's name][google.cloud.tasks.v2.Queue.name] cannot be the same as an + * existing queue. + * + * Generated from protobuf field .google.cloud.tasks.v2.Queue queue = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $queue = null; + + /** + * @param string $parent Required. The location name in which the queue will be created. + * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * + * The list of allowed locations can be obtained by calling Cloud + * Tasks' implementation of + * [ListLocations][google.cloud.location.Locations.ListLocations]. Please see + * {@see CloudTasksClient::locationName()} for help formatting this field. + * @param \Google\Cloud\Tasks\V2\Queue $queue Required. The queue to create. + * + * [Queue's name][google.cloud.tasks.v2.Queue.name] cannot be the same as an + * existing queue. + * + * @return \Google\Cloud\Tasks\V2\CreateQueueRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Tasks\V2\Queue $queue): self + { + return (new self()) + ->setParent($parent) + ->setQueue($queue); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The location name in which the queue will be created. + * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * The list of allowed locations can be obtained by calling Cloud + * Tasks' implementation of + * [ListLocations][google.cloud.location.Locations.ListLocations]. + * @type \Google\Cloud\Tasks\V2\Queue $queue + * Required. The queue to create. + * [Queue's name][google.cloud.tasks.v2.Queue.name] cannot be the same as an + * existing queue. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * Required. The location name in which the queue will be created. + * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * The list of allowed locations can be obtained by calling Cloud + * Tasks' implementation of + * [ListLocations][google.cloud.location.Locations.ListLocations]. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The location name in which the queue will be created. + * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * The list of allowed locations can be obtained by calling Cloud + * Tasks' implementation of + * [ListLocations][google.cloud.location.Locations.ListLocations]. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The queue to create. + * [Queue's name][google.cloud.tasks.v2.Queue.name] cannot be the same as an + * existing queue. + * + * Generated from protobuf field .google.cloud.tasks.v2.Queue queue = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Tasks\V2\Queue|null + */ + public function getQueue() + { + return $this->queue; + } + + public function hasQueue() + { + return isset($this->queue); + } + + public function clearQueue() + { + unset($this->queue); + } + + /** + * Required. The queue to create. + * [Queue's name][google.cloud.tasks.v2.Queue.name] cannot be the same as an + * existing queue. + * + * Generated from protobuf field .google.cloud.tasks.v2.Queue queue = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Tasks\V2\Queue $var + * @return $this + */ + public function setQueue($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2\Queue::class); + $this->queue = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/CreateTaskRequest.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/CreateTaskRequest.php new file mode 100644 index 000000000000..5b1c36712fe2 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/CreateTaskRequest.php @@ -0,0 +1,349 @@ +google.cloud.tasks.v2.CreateTaskRequest + */ +class CreateTaskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * The queue must already exist. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The task to add. + * Task names have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. + * The user can optionally specify a task + * [name][google.cloud.tasks.v2.Task.name]. If a name is not specified then + * the system will generate a random unique task id, which will be set in the + * task returned in the [response][google.cloud.tasks.v2.Task.name]. + * If [schedule_time][google.cloud.tasks.v2.Task.schedule_time] is not set or + * is in the past then Cloud Tasks will set it to the current time. + * Task De-duplication: + * Explicitly specifying a task ID enables task de-duplication. If + * a task's ID is identical to that of an existing task or a task + * that was deleted or executed recently then the call will fail + * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. + * If the task's queue was created using Cloud Tasks, then another task with + * the same name can't be created for ~1hour after the original task was + * deleted or executed. If the task's queue was created using queue.yaml or + * queue.xml, then another task with the same name can't be created + * for ~9days after the original task was deleted or executed. + * Because there is an extra lookup cost to identify duplicate task + * names, these [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask] + * calls have significantly increased latency. Using hashed strings for the + * task id or for the prefix of the task id is recommended. Choosing task ids + * that are sequential or have sequential prefixes, for example using a + * timestamp, causes an increase in latency and error rates in all + * task commands. The infrastructure relies on an approximately + * uniform distribution of task ids to store and serve tasks + * efficiently. + * + * Generated from protobuf field .google.cloud.tasks.v2.Task task = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $task = null; + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2.Task] will be returned. + * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; + * not all information is retrieved by default because some data, such as + * payloads, might be desirable to return only when needed because + * of its large size or because of the sensitivity of data that it + * contains. + * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires + * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + * permission on the [Task][google.cloud.tasks.v2.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2.Task.View response_view = 3; + */ + protected $response_view = 0; + + /** + * @param string $parent Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * + * The queue must already exist. Please see + * {@see CloudTasksClient::queueName()} for help formatting this field. + * @param \Google\Cloud\Tasks\V2\Task $task Required. The task to add. + * + * Task names have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. + * The user can optionally specify a task + * [name][google.cloud.tasks.v2.Task.name]. If a name is not specified then + * the system will generate a random unique task id, which will be set in the + * task returned in the [response][google.cloud.tasks.v2.Task.name]. + * + * If [schedule_time][google.cloud.tasks.v2.Task.schedule_time] is not set or + * is in the past then Cloud Tasks will set it to the current time. + * + * Task De-duplication: + * + * Explicitly specifying a task ID enables task de-duplication. If + * a task's ID is identical to that of an existing task or a task + * that was deleted or executed recently then the call will fail + * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. + * If the task's queue was created using Cloud Tasks, then another task with + * the same name can't be created for ~1hour after the original task was + * deleted or executed. If the task's queue was created using queue.yaml or + * queue.xml, then another task with the same name can't be created + * for ~9days after the original task was deleted or executed. + * + * Because there is an extra lookup cost to identify duplicate task + * names, these [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask] + * calls have significantly increased latency. Using hashed strings for the + * task id or for the prefix of the task id is recommended. Choosing task ids + * that are sequential or have sequential prefixes, for example using a + * timestamp, causes an increase in latency and error rates in all + * task commands. The infrastructure relies on an approximately + * uniform distribution of task ids to store and serve tasks + * efficiently. + * + * @return \Google\Cloud\Tasks\V2\CreateTaskRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Tasks\V2\Task $task): self + { + return (new self()) + ->setParent($parent) + ->setTask($task); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * The queue must already exist. + * @type \Google\Cloud\Tasks\V2\Task $task + * Required. The task to add. + * Task names have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. + * The user can optionally specify a task + * [name][google.cloud.tasks.v2.Task.name]. If a name is not specified then + * the system will generate a random unique task id, which will be set in the + * task returned in the [response][google.cloud.tasks.v2.Task.name]. + * If [schedule_time][google.cloud.tasks.v2.Task.schedule_time] is not set or + * is in the past then Cloud Tasks will set it to the current time. + * Task De-duplication: + * Explicitly specifying a task ID enables task de-duplication. If + * a task's ID is identical to that of an existing task or a task + * that was deleted or executed recently then the call will fail + * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. + * If the task's queue was created using Cloud Tasks, then another task with + * the same name can't be created for ~1hour after the original task was + * deleted or executed. If the task's queue was created using queue.yaml or + * queue.xml, then another task with the same name can't be created + * for ~9days after the original task was deleted or executed. + * Because there is an extra lookup cost to identify duplicate task + * names, these [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask] + * calls have significantly increased latency. Using hashed strings for the + * task id or for the prefix of the task id is recommended. Choosing task ids + * that are sequential or have sequential prefixes, for example using a + * timestamp, causes an increase in latency and error rates in all + * task commands. The infrastructure relies on an approximately + * uniform distribution of task ids to store and serve tasks + * efficiently. + * @type int $response_view + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2.Task] will be returned. + * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; + * not all information is retrieved by default because some data, such as + * payloads, might be desirable to return only when needed because + * of its large size or because of the sensitivity of data that it + * contains. + * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires + * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + * permission on the [Task][google.cloud.tasks.v2.Task] resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * The queue must already exist. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * The queue must already exist. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The task to add. + * Task names have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. + * The user can optionally specify a task + * [name][google.cloud.tasks.v2.Task.name]. If a name is not specified then + * the system will generate a random unique task id, which will be set in the + * task returned in the [response][google.cloud.tasks.v2.Task.name]. + * If [schedule_time][google.cloud.tasks.v2.Task.schedule_time] is not set or + * is in the past then Cloud Tasks will set it to the current time. + * Task De-duplication: + * Explicitly specifying a task ID enables task de-duplication. If + * a task's ID is identical to that of an existing task or a task + * that was deleted or executed recently then the call will fail + * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. + * If the task's queue was created using Cloud Tasks, then another task with + * the same name can't be created for ~1hour after the original task was + * deleted or executed. If the task's queue was created using queue.yaml or + * queue.xml, then another task with the same name can't be created + * for ~9days after the original task was deleted or executed. + * Because there is an extra lookup cost to identify duplicate task + * names, these [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask] + * calls have significantly increased latency. Using hashed strings for the + * task id or for the prefix of the task id is recommended. Choosing task ids + * that are sequential or have sequential prefixes, for example using a + * timestamp, causes an increase in latency and error rates in all + * task commands. The infrastructure relies on an approximately + * uniform distribution of task ids to store and serve tasks + * efficiently. + * + * Generated from protobuf field .google.cloud.tasks.v2.Task task = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Tasks\V2\Task|null + */ + public function getTask() + { + return $this->task; + } + + public function hasTask() + { + return isset($this->task); + } + + public function clearTask() + { + unset($this->task); + } + + /** + * Required. The task to add. + * Task names have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. + * The user can optionally specify a task + * [name][google.cloud.tasks.v2.Task.name]. If a name is not specified then + * the system will generate a random unique task id, which will be set in the + * task returned in the [response][google.cloud.tasks.v2.Task.name]. + * If [schedule_time][google.cloud.tasks.v2.Task.schedule_time] is not set or + * is in the past then Cloud Tasks will set it to the current time. + * Task De-duplication: + * Explicitly specifying a task ID enables task de-duplication. If + * a task's ID is identical to that of an existing task or a task + * that was deleted or executed recently then the call will fail + * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. + * If the task's queue was created using Cloud Tasks, then another task with + * the same name can't be created for ~1hour after the original task was + * deleted or executed. If the task's queue was created using queue.yaml or + * queue.xml, then another task with the same name can't be created + * for ~9days after the original task was deleted or executed. + * Because there is an extra lookup cost to identify duplicate task + * names, these [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask] + * calls have significantly increased latency. Using hashed strings for the + * task id or for the prefix of the task id is recommended. Choosing task ids + * that are sequential or have sequential prefixes, for example using a + * timestamp, causes an increase in latency and error rates in all + * task commands. The infrastructure relies on an approximately + * uniform distribution of task ids to store and serve tasks + * efficiently. + * + * Generated from protobuf field .google.cloud.tasks.v2.Task task = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Tasks\V2\Task $var + * @return $this + */ + public function setTask($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2\Task::class); + $this->task = $var; + + return $this; + } + + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2.Task] will be returned. + * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; + * not all information is retrieved by default because some data, such as + * payloads, might be desirable to return only when needed because + * of its large size or because of the sensitivity of data that it + * contains. + * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires + * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + * permission on the [Task][google.cloud.tasks.v2.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2.Task.View response_view = 3; + * @return int + */ + public function getResponseView() + { + return $this->response_view; + } + + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2.Task] will be returned. + * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; + * not all information is retrieved by default because some data, such as + * payloads, might be desirable to return only when needed because + * of its large size or because of the sensitivity of data that it + * contains. + * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires + * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + * permission on the [Task][google.cloud.tasks.v2.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2.Task.View response_view = 3; + * @param int $var + * @return $this + */ + public function setResponseView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2\Task\View::class); + $this->response_view = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/DeleteQueueRequest.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/DeleteQueueRequest.php new file mode 100644 index 000000000000..9d6a391711c7 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/DeleteQueueRequest.php @@ -0,0 +1,87 @@ +google.cloud.tasks.v2.DeleteQueueRequest + */ +class DeleteQueueRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * Please see {@see CloudTasksClient::queueName()} for help formatting this field. + * + * @return \Google\Cloud\Tasks\V2\DeleteQueueRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/DeleteTaskRequest.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/DeleteTaskRequest.php new file mode 100644 index 000000000000..8b4e795d4dcf --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/DeleteTaskRequest.php @@ -0,0 +1,87 @@ +google.cloud.tasks.v2.DeleteTaskRequest + */ +class DeleteTaskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * Please see {@see CloudTasksClient::taskName()} for help formatting this field. + * + * @return \Google\Cloud\Tasks\V2\DeleteTaskRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/GetQueueRequest.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/GetQueueRequest.php new file mode 100644 index 000000000000..bf492cc9817b --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/GetQueueRequest.php @@ -0,0 +1,86 @@ +google.cloud.tasks.v2.GetQueueRequest + */ +class GetQueueRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the queue. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the queue. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * Please see {@see CloudTasksClient::queueName()} for help formatting this field. + * + * @return \Google\Cloud\Tasks\V2\GetQueueRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the queue. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the queue. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the queue. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/GetTaskRequest.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/GetTaskRequest.php new file mode 100644 index 000000000000..7ec071973327 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/GetTaskRequest.php @@ -0,0 +1,157 @@ +google.cloud.tasks.v2.GetTaskRequest + */ +class GetTaskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2.Task] will be returned. + * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; + * not all information is retrieved by default because some data, such as + * payloads, might be desirable to return only when needed because + * of its large size or because of the sensitivity of data that it + * contains. + * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires + * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + * permission on the [Task][google.cloud.tasks.v2.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2.Task.View response_view = 2; + */ + protected $response_view = 0; + + /** + * @param string $name Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * Please see {@see CloudTasksClient::taskName()} for help formatting this field. + * + * @return \Google\Cloud\Tasks\V2\GetTaskRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * @type int $response_view + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2.Task] will be returned. + * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; + * not all information is retrieved by default because some data, such as + * payloads, might be desirable to return only when needed because + * of its large size or because of the sensitivity of data that it + * contains. + * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires + * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + * permission on the [Task][google.cloud.tasks.v2.Task] resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2.Task] will be returned. + * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; + * not all information is retrieved by default because some data, such as + * payloads, might be desirable to return only when needed because + * of its large size or because of the sensitivity of data that it + * contains. + * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires + * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + * permission on the [Task][google.cloud.tasks.v2.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2.Task.View response_view = 2; + * @return int + */ + public function getResponseView() + { + return $this->response_view; + } + + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2.Task] will be returned. + * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; + * not all information is retrieved by default because some data, such as + * payloads, might be desirable to return only when needed because + * of its large size or because of the sensitivity of data that it + * contains. + * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires + * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + * permission on the [Task][google.cloud.tasks.v2.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2.Task.View response_view = 2; + * @param int $var + * @return $this + */ + public function setResponseView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2\Task\View::class); + $this->response_view = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/HttpMethod.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/HttpMethod.php new file mode 100644 index 000000000000..f545f185d4a0 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/HttpMethod.php @@ -0,0 +1,96 @@ +google.cloud.tasks.v2.HttpMethod + */ +class HttpMethod +{ + /** + * HTTP method unspecified + * + * Generated from protobuf enum HTTP_METHOD_UNSPECIFIED = 0; + */ + const HTTP_METHOD_UNSPECIFIED = 0; + /** + * HTTP POST + * + * Generated from protobuf enum POST = 1; + */ + const POST = 1; + /** + * HTTP GET + * + * Generated from protobuf enum GET = 2; + */ + const GET = 2; + /** + * HTTP HEAD + * + * Generated from protobuf enum HEAD = 3; + */ + const HEAD = 3; + /** + * HTTP PUT + * + * Generated from protobuf enum PUT = 4; + */ + const PUT = 4; + /** + * HTTP DELETE + * + * Generated from protobuf enum DELETE = 5; + */ + const DELETE = 5; + /** + * HTTP PATCH + * + * Generated from protobuf enum PATCH = 6; + */ + const PATCH = 6; + /** + * HTTP OPTIONS + * + * Generated from protobuf enum OPTIONS = 7; + */ + const OPTIONS = 7; + + private static $valueToName = [ + self::HTTP_METHOD_UNSPECIFIED => 'HTTP_METHOD_UNSPECIFIED', + self::POST => 'POST', + self::GET => 'GET', + self::HEAD => 'HEAD', + self::PUT => 'PUT', + self::DELETE => 'DELETE', + self::PATCH => 'PATCH', + self::OPTIONS => 'OPTIONS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/HttpRequest.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/HttpRequest.php new file mode 100644 index 000000000000..5d4f5a2be77e --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/HttpRequest.php @@ -0,0 +1,421 @@ +google.cloud.tasks.v2.HttpRequest + */ +class HttpRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The full url path that the request will be sent to. + * This string must begin with either "http://" or "https://". Some examples + * are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will + * encode some characters for safety and compatibility. The maximum allowed + * URL length is 2083 characters after encoding. + * The `Location` header response from a redirect response [`300` - `399`] + * may be followed. The redirect is not counted as a separate attempt. + * + * Generated from protobuf field string url = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $url = ''; + /** + * The HTTP method to use for the request. The default is POST. + * + * Generated from protobuf field .google.cloud.tasks.v2.HttpMethod http_method = 2; + */ + protected $http_method = 0; + /** + * HTTP request headers. + * This map contains the header field names and values. + * Headers can be set when the + * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. + * These headers represent a subset of the headers that will accompany the + * task's HTTP request. Some HTTP request headers will be ignored or replaced. + * A partial list of headers that will be ignored or replaced is: + * * Host: This will be computed by Cloud Tasks and derived from + * [HttpRequest.url][google.cloud.tasks.v2.HttpRequest.url]. + * * Content-Length: This will be computed by Cloud Tasks. + * * User-Agent: This will be set to `"Google-Cloud-Tasks"`. + * * `X-Google-*`: Google use only. + * * `X-AppEngine-*`: Google use only. + * `Content-Type` won't be set by Cloud Tasks. You can explicitly set + * `Content-Type` to a media type when the + * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. + * For example, `Content-Type` can be set to `"application/octet-stream"` or + * `"application/json"`. + * Headers which can have multiple values (according to RFC2616) can be + * specified using comma-separated values. + * The size of the headers must be less than 80KB. + * + * Generated from protobuf field map headers = 3; + */ + private $headers; + /** + * HTTP request body. + * A request body is allowed only if the + * [HTTP method][google.cloud.tasks.v2.HttpRequest.http_method] is POST, PUT, + * or PATCH. It is an error to set body on a task with an incompatible + * [HttpMethod][google.cloud.tasks.v2.HttpMethod]. + * + * Generated from protobuf field bytes body = 4; + */ + protected $body = ''; + protected $authorization_header; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $url + * Required. The full url path that the request will be sent to. + * This string must begin with either "http://" or "https://". Some examples + * are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will + * encode some characters for safety and compatibility. The maximum allowed + * URL length is 2083 characters after encoding. + * The `Location` header response from a redirect response [`300` - `399`] + * may be followed. The redirect is not counted as a separate attempt. + * @type int $http_method + * The HTTP method to use for the request. The default is POST. + * @type array|\Google\Protobuf\Internal\MapField $headers + * HTTP request headers. + * This map contains the header field names and values. + * Headers can be set when the + * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. + * These headers represent a subset of the headers that will accompany the + * task's HTTP request. Some HTTP request headers will be ignored or replaced. + * A partial list of headers that will be ignored or replaced is: + * * Host: This will be computed by Cloud Tasks and derived from + * [HttpRequest.url][google.cloud.tasks.v2.HttpRequest.url]. + * * Content-Length: This will be computed by Cloud Tasks. + * * User-Agent: This will be set to `"Google-Cloud-Tasks"`. + * * `X-Google-*`: Google use only. + * * `X-AppEngine-*`: Google use only. + * `Content-Type` won't be set by Cloud Tasks. You can explicitly set + * `Content-Type` to a media type when the + * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. + * For example, `Content-Type` can be set to `"application/octet-stream"` or + * `"application/json"`. + * Headers which can have multiple values (according to RFC2616) can be + * specified using comma-separated values. + * The size of the headers must be less than 80KB. + * @type string $body + * HTTP request body. + * A request body is allowed only if the + * [HTTP method][google.cloud.tasks.v2.HttpRequest.http_method] is POST, PUT, + * or PATCH. It is an error to set body on a task with an incompatible + * [HttpMethod][google.cloud.tasks.v2.HttpMethod]. + * @type \Google\Cloud\Tasks\V2\OAuthToken $oauth_token + * If specified, an + * [OAuth token](https://developers.google.com/identity/protocols/OAuth2) + * will be generated and attached as an `Authorization` header in the HTTP + * request. + * This type of authorization should generally only be used when calling + * Google APIs hosted on *.googleapis.com. + * @type \Google\Cloud\Tasks\V2\OidcToken $oidc_token + * If specified, an + * [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) + * token will be generated and attached as an `Authorization` header in the + * HTTP request. + * This type of authorization can be used for many scenarios, including + * calling Cloud Run, or endpoints where you intend to validate the token + * yourself. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2\Target::initOnce(); + parent::__construct($data); + } + + /** + * Required. The full url path that the request will be sent to. + * This string must begin with either "http://" or "https://". Some examples + * are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will + * encode some characters for safety and compatibility. The maximum allowed + * URL length is 2083 characters after encoding. + * The `Location` header response from a redirect response [`300` - `399`] + * may be followed. The redirect is not counted as a separate attempt. + * + * Generated from protobuf field string url = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUrl() + { + return $this->url; + } + + /** + * Required. The full url path that the request will be sent to. + * This string must begin with either "http://" or "https://". Some examples + * are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will + * encode some characters for safety and compatibility. The maximum allowed + * URL length is 2083 characters after encoding. + * The `Location` header response from a redirect response [`300` - `399`] + * may be followed. The redirect is not counted as a separate attempt. + * + * Generated from protobuf field string url = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setUrl($var) + { + GPBUtil::checkString($var, True); + $this->url = $var; + + return $this; + } + + /** + * The HTTP method to use for the request. The default is POST. + * + * Generated from protobuf field .google.cloud.tasks.v2.HttpMethod http_method = 2; + * @return int + */ + public function getHttpMethod() + { + return $this->http_method; + } + + /** + * The HTTP method to use for the request. The default is POST. + * + * Generated from protobuf field .google.cloud.tasks.v2.HttpMethod http_method = 2; + * @param int $var + * @return $this + */ + public function setHttpMethod($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2\HttpMethod::class); + $this->http_method = $var; + + return $this; + } + + /** + * HTTP request headers. + * This map contains the header field names and values. + * Headers can be set when the + * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. + * These headers represent a subset of the headers that will accompany the + * task's HTTP request. Some HTTP request headers will be ignored or replaced. + * A partial list of headers that will be ignored or replaced is: + * * Host: This will be computed by Cloud Tasks and derived from + * [HttpRequest.url][google.cloud.tasks.v2.HttpRequest.url]. + * * Content-Length: This will be computed by Cloud Tasks. + * * User-Agent: This will be set to `"Google-Cloud-Tasks"`. + * * `X-Google-*`: Google use only. + * * `X-AppEngine-*`: Google use only. + * `Content-Type` won't be set by Cloud Tasks. You can explicitly set + * `Content-Type` to a media type when the + * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. + * For example, `Content-Type` can be set to `"application/octet-stream"` or + * `"application/json"`. + * Headers which can have multiple values (according to RFC2616) can be + * specified using comma-separated values. + * The size of the headers must be less than 80KB. + * + * Generated from protobuf field map headers = 3; + * @return \Google\Protobuf\Internal\MapField + */ + public function getHeaders() + { + return $this->headers; + } + + /** + * HTTP request headers. + * This map contains the header field names and values. + * Headers can be set when the + * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. + * These headers represent a subset of the headers that will accompany the + * task's HTTP request. Some HTTP request headers will be ignored or replaced. + * A partial list of headers that will be ignored or replaced is: + * * Host: This will be computed by Cloud Tasks and derived from + * [HttpRequest.url][google.cloud.tasks.v2.HttpRequest.url]. + * * Content-Length: This will be computed by Cloud Tasks. + * * User-Agent: This will be set to `"Google-Cloud-Tasks"`. + * * `X-Google-*`: Google use only. + * * `X-AppEngine-*`: Google use only. + * `Content-Type` won't be set by Cloud Tasks. You can explicitly set + * `Content-Type` to a media type when the + * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. + * For example, `Content-Type` can be set to `"application/octet-stream"` or + * `"application/json"`. + * Headers which can have multiple values (according to RFC2616) can be + * specified using comma-separated values. + * The size of the headers must be less than 80KB. + * + * Generated from protobuf field map headers = 3; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setHeaders($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->headers = $arr; + + return $this; + } + + /** + * HTTP request body. + * A request body is allowed only if the + * [HTTP method][google.cloud.tasks.v2.HttpRequest.http_method] is POST, PUT, + * or PATCH. It is an error to set body on a task with an incompatible + * [HttpMethod][google.cloud.tasks.v2.HttpMethod]. + * + * Generated from protobuf field bytes body = 4; + * @return string + */ + public function getBody() + { + return $this->body; + } + + /** + * HTTP request body. + * A request body is allowed only if the + * [HTTP method][google.cloud.tasks.v2.HttpRequest.http_method] is POST, PUT, + * or PATCH. It is an error to set body on a task with an incompatible + * [HttpMethod][google.cloud.tasks.v2.HttpMethod]. + * + * Generated from protobuf field bytes body = 4; + * @param string $var + * @return $this + */ + public function setBody($var) + { + GPBUtil::checkString($var, False); + $this->body = $var; + + return $this; + } + + /** + * If specified, an + * [OAuth token](https://developers.google.com/identity/protocols/OAuth2) + * will be generated and attached as an `Authorization` header in the HTTP + * request. + * This type of authorization should generally only be used when calling + * Google APIs hosted on *.googleapis.com. + * + * Generated from protobuf field .google.cloud.tasks.v2.OAuthToken oauth_token = 5; + * @return \Google\Cloud\Tasks\V2\OAuthToken|null + */ + public function getOauthToken() + { + return $this->readOneof(5); + } + + public function hasOauthToken() + { + return $this->hasOneof(5); + } + + /** + * If specified, an + * [OAuth token](https://developers.google.com/identity/protocols/OAuth2) + * will be generated and attached as an `Authorization` header in the HTTP + * request. + * This type of authorization should generally only be used when calling + * Google APIs hosted on *.googleapis.com. + * + * Generated from protobuf field .google.cloud.tasks.v2.OAuthToken oauth_token = 5; + * @param \Google\Cloud\Tasks\V2\OAuthToken $var + * @return $this + */ + public function setOauthToken($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2\OAuthToken::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * If specified, an + * [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) + * token will be generated and attached as an `Authorization` header in the + * HTTP request. + * This type of authorization can be used for many scenarios, including + * calling Cloud Run, or endpoints where you intend to validate the token + * yourself. + * + * Generated from protobuf field .google.cloud.tasks.v2.OidcToken oidc_token = 6; + * @return \Google\Cloud\Tasks\V2\OidcToken|null + */ + public function getOidcToken() + { + return $this->readOneof(6); + } + + public function hasOidcToken() + { + return $this->hasOneof(6); + } + + /** + * If specified, an + * [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) + * token will be generated and attached as an `Authorization` header in the + * HTTP request. + * This type of authorization can be used for many scenarios, including + * calling Cloud Run, or endpoints where you intend to validate the token + * yourself. + * + * Generated from protobuf field .google.cloud.tasks.v2.OidcToken oidc_token = 6; + * @param \Google\Cloud\Tasks\V2\OidcToken $var + * @return $this + */ + public function setOidcToken($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2\OidcToken::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * @return string + */ + public function getAuthorizationHeader() + { + return $this->whichOneof("authorization_header"); + } + +} + diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ListQueuesRequest.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ListQueuesRequest.php new file mode 100644 index 000000000000..74ace2efa6b0 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ListQueuesRequest.php @@ -0,0 +1,269 @@ +google.cloud.tasks.v2.ListQueuesRequest + */ +class ListQueuesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The location name. + * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * `filter` can be used to specify a subset of queues. Any + * [Queue][google.cloud.tasks.v2.Queue] field can be used as a filter and + * several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The + * filter syntax is the same as described in [Stackdriver's Advanced Logs + * Filters](https://cloud.google.com/logging/docs/view/advanced_filters). + * Sample filter "state: PAUSED". + * Note that using filters might cause fewer queues than the + * requested page_size to be returned. + * + * Generated from protobuf field string filter = 2; + */ + protected $filter = ''; + /** + * Requested page size. + * The maximum page size is 9800. If unspecified, the page size will + * be the maximum. Fewer queues than requested might be returned, + * even if more queues exist; use the + * [next_page_token][google.cloud.tasks.v2.ListQueuesResponse.next_page_token] + * in the response to determine if more queues exist. + * + * Generated from protobuf field int32 page_size = 3; + */ + protected $page_size = 0; + /** + * A token identifying the page of results to return. + * To request the first page results, page_token must be empty. To + * request the next page of results, page_token must be the value of + * [next_page_token][google.cloud.tasks.v2.ListQueuesResponse.next_page_token] + * returned from the previous call to + * [ListQueues][google.cloud.tasks.v2.CloudTasks.ListQueues] method. It is an + * error to switch the value of the + * [filter][google.cloud.tasks.v2.ListQueuesRequest.filter] while iterating + * through pages. + * + * Generated from protobuf field string page_token = 4; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The location name. + * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * Please see {@see CloudTasksClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\Tasks\V2\ListQueuesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The location name. + * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * @type string $filter + * `filter` can be used to specify a subset of queues. Any + * [Queue][google.cloud.tasks.v2.Queue] field can be used as a filter and + * several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The + * filter syntax is the same as described in [Stackdriver's Advanced Logs + * Filters](https://cloud.google.com/logging/docs/view/advanced_filters). + * Sample filter "state: PAUSED". + * Note that using filters might cause fewer queues than the + * requested page_size to be returned. + * @type int $page_size + * Requested page size. + * The maximum page size is 9800. If unspecified, the page size will + * be the maximum. Fewer queues than requested might be returned, + * even if more queues exist; use the + * [next_page_token][google.cloud.tasks.v2.ListQueuesResponse.next_page_token] + * in the response to determine if more queues exist. + * @type string $page_token + * A token identifying the page of results to return. + * To request the first page results, page_token must be empty. To + * request the next page of results, page_token must be the value of + * [next_page_token][google.cloud.tasks.v2.ListQueuesResponse.next_page_token] + * returned from the previous call to + * [ListQueues][google.cloud.tasks.v2.CloudTasks.ListQueues] method. It is an + * error to switch the value of the + * [filter][google.cloud.tasks.v2.ListQueuesRequest.filter] while iterating + * through pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * Required. The location name. + * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The location name. + * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * `filter` can be used to specify a subset of queues. Any + * [Queue][google.cloud.tasks.v2.Queue] field can be used as a filter and + * several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The + * filter syntax is the same as described in [Stackdriver's Advanced Logs + * Filters](https://cloud.google.com/logging/docs/view/advanced_filters). + * Sample filter "state: PAUSED". + * Note that using filters might cause fewer queues than the + * requested page_size to be returned. + * + * Generated from protobuf field string filter = 2; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * `filter` can be used to specify a subset of queues. Any + * [Queue][google.cloud.tasks.v2.Queue] field can be used as a filter and + * several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The + * filter syntax is the same as described in [Stackdriver's Advanced Logs + * Filters](https://cloud.google.com/logging/docs/view/advanced_filters). + * Sample filter "state: PAUSED". + * Note that using filters might cause fewer queues than the + * requested page_size to be returned. + * + * Generated from protobuf field string filter = 2; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Requested page size. + * The maximum page size is 9800. If unspecified, the page size will + * be the maximum. Fewer queues than requested might be returned, + * even if more queues exist; use the + * [next_page_token][google.cloud.tasks.v2.ListQueuesResponse.next_page_token] + * in the response to determine if more queues exist. + * + * Generated from protobuf field int32 page_size = 3; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Requested page size. + * The maximum page size is 9800. If unspecified, the page size will + * be the maximum. Fewer queues than requested might be returned, + * even if more queues exist; use the + * [next_page_token][google.cloud.tasks.v2.ListQueuesResponse.next_page_token] + * in the response to determine if more queues exist. + * + * Generated from protobuf field int32 page_size = 3; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A token identifying the page of results to return. + * To request the first page results, page_token must be empty. To + * request the next page of results, page_token must be the value of + * [next_page_token][google.cloud.tasks.v2.ListQueuesResponse.next_page_token] + * returned from the previous call to + * [ListQueues][google.cloud.tasks.v2.CloudTasks.ListQueues] method. It is an + * error to switch the value of the + * [filter][google.cloud.tasks.v2.ListQueuesRequest.filter] while iterating + * through pages. + * + * Generated from protobuf field string page_token = 4; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A token identifying the page of results to return. + * To request the first page results, page_token must be empty. To + * request the next page of results, page_token must be the value of + * [next_page_token][google.cloud.tasks.v2.ListQueuesResponse.next_page_token] + * returned from the previous call to + * [ListQueues][google.cloud.tasks.v2.CloudTasks.ListQueues] method. It is an + * error to switch the value of the + * [filter][google.cloud.tasks.v2.ListQueuesRequest.filter] while iterating + * through pages. + * + * Generated from protobuf field string page_token = 4; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ListQueuesResponse.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ListQueuesResponse.php new file mode 100644 index 000000000000..35df0c08229f --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ListQueuesResponse.php @@ -0,0 +1,122 @@ +google.cloud.tasks.v2.ListQueuesResponse + */ +class ListQueuesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of queues. + * + * Generated from protobuf field repeated .google.cloud.tasks.v2.Queue queues = 1; + */ + private $queues; + /** + * A token to retrieve next page of results. + * To return the next page of results, call + * [ListQueues][google.cloud.tasks.v2.CloudTasks.ListQueues] with this value + * as the [page_token][google.cloud.tasks.v2.ListQueuesRequest.page_token]. + * If the next_page_token is empty, there are no more results. + * The page token is valid for only 2 hours. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Tasks\V2\Queue>|\Google\Protobuf\Internal\RepeatedField $queues + * The list of queues. + * @type string $next_page_token + * A token to retrieve next page of results. + * To return the next page of results, call + * [ListQueues][google.cloud.tasks.v2.CloudTasks.ListQueues] with this value + * as the [page_token][google.cloud.tasks.v2.ListQueuesRequest.page_token]. + * If the next_page_token is empty, there are no more results. + * The page token is valid for only 2 hours. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * The list of queues. + * + * Generated from protobuf field repeated .google.cloud.tasks.v2.Queue queues = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getQueues() + { + return $this->queues; + } + + /** + * The list of queues. + * + * Generated from protobuf field repeated .google.cloud.tasks.v2.Queue queues = 1; + * @param array<\Google\Cloud\Tasks\V2\Queue>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setQueues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Tasks\V2\Queue::class); + $this->queues = $arr; + + return $this; + } + + /** + * A token to retrieve next page of results. + * To return the next page of results, call + * [ListQueues][google.cloud.tasks.v2.CloudTasks.ListQueues] with this value + * as the [page_token][google.cloud.tasks.v2.ListQueuesRequest.page_token]. + * If the next_page_token is empty, there are no more results. + * The page token is valid for only 2 hours. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token to retrieve next page of results. + * To return the next page of results, call + * [ListQueues][google.cloud.tasks.v2.CloudTasks.ListQueues] with this value + * as the [page_token][google.cloud.tasks.v2.ListQueuesRequest.page_token]. + * If the next_page_token is empty, there are no more results. + * The page token is valid for only 2 hours. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ListTasksRequest.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ListTasksRequest.php new file mode 100644 index 000000000000..1919c39be9d2 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ListTasksRequest.php @@ -0,0 +1,269 @@ +google.cloud.tasks.v2.ListTasksRequest + */ +class ListTasksRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2.Task] will be returned. + * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; + * not all information is retrieved by default because some data, such as + * payloads, might be desirable to return only when needed because + * of its large size or because of the sensitivity of data that it + * contains. + * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires + * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + * permission on the [Task][google.cloud.tasks.v2.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2.Task.View response_view = 2; + */ + protected $response_view = 0; + /** + * Maximum page size. + * Fewer tasks than requested might be returned, even if more tasks exist; use + * [next_page_token][google.cloud.tasks.v2.ListTasksResponse.next_page_token] + * in the response to determine if more tasks exist. + * The maximum page size is 1000. If unspecified, the page size will be the + * maximum. + * + * Generated from protobuf field int32 page_size = 3; + */ + protected $page_size = 0; + /** + * A token identifying the page of results to return. + * To request the first page results, page_token must be empty. To + * request the next page of results, page_token must be the value of + * [next_page_token][google.cloud.tasks.v2.ListTasksResponse.next_page_token] + * returned from the previous call to + * [ListTasks][google.cloud.tasks.v2.CloudTasks.ListTasks] method. + * The page token is valid for only 2 hours. + * + * Generated from protobuf field string page_token = 4; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * Please see {@see CloudTasksClient::queueName()} for help formatting this field. + * + * @return \Google\Cloud\Tasks\V2\ListTasksRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * @type int $response_view + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2.Task] will be returned. + * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; + * not all information is retrieved by default because some data, such as + * payloads, might be desirable to return only when needed because + * of its large size or because of the sensitivity of data that it + * contains. + * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires + * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + * permission on the [Task][google.cloud.tasks.v2.Task] resource. + * @type int $page_size + * Maximum page size. + * Fewer tasks than requested might be returned, even if more tasks exist; use + * [next_page_token][google.cloud.tasks.v2.ListTasksResponse.next_page_token] + * in the response to determine if more tasks exist. + * The maximum page size is 1000. If unspecified, the page size will be the + * maximum. + * @type string $page_token + * A token identifying the page of results to return. + * To request the first page results, page_token must be empty. To + * request the next page of results, page_token must be the value of + * [next_page_token][google.cloud.tasks.v2.ListTasksResponse.next_page_token] + * returned from the previous call to + * [ListTasks][google.cloud.tasks.v2.CloudTasks.ListTasks] method. + * The page token is valid for only 2 hours. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2.Task] will be returned. + * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; + * not all information is retrieved by default because some data, such as + * payloads, might be desirable to return only when needed because + * of its large size or because of the sensitivity of data that it + * contains. + * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires + * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + * permission on the [Task][google.cloud.tasks.v2.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2.Task.View response_view = 2; + * @return int + */ + public function getResponseView() + { + return $this->response_view; + } + + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2.Task] will be returned. + * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; + * not all information is retrieved by default because some data, such as + * payloads, might be desirable to return only when needed because + * of its large size or because of the sensitivity of data that it + * contains. + * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires + * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + * permission on the [Task][google.cloud.tasks.v2.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2.Task.View response_view = 2; + * @param int $var + * @return $this + */ + public function setResponseView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2\Task\View::class); + $this->response_view = $var; + + return $this; + } + + /** + * Maximum page size. + * Fewer tasks than requested might be returned, even if more tasks exist; use + * [next_page_token][google.cloud.tasks.v2.ListTasksResponse.next_page_token] + * in the response to determine if more tasks exist. + * The maximum page size is 1000. If unspecified, the page size will be the + * maximum. + * + * Generated from protobuf field int32 page_size = 3; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Maximum page size. + * Fewer tasks than requested might be returned, even if more tasks exist; use + * [next_page_token][google.cloud.tasks.v2.ListTasksResponse.next_page_token] + * in the response to determine if more tasks exist. + * The maximum page size is 1000. If unspecified, the page size will be the + * maximum. + * + * Generated from protobuf field int32 page_size = 3; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A token identifying the page of results to return. + * To request the first page results, page_token must be empty. To + * request the next page of results, page_token must be the value of + * [next_page_token][google.cloud.tasks.v2.ListTasksResponse.next_page_token] + * returned from the previous call to + * [ListTasks][google.cloud.tasks.v2.CloudTasks.ListTasks] method. + * The page token is valid for only 2 hours. + * + * Generated from protobuf field string page_token = 4; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A token identifying the page of results to return. + * To request the first page results, page_token must be empty. To + * request the next page of results, page_token must be the value of + * [next_page_token][google.cloud.tasks.v2.ListTasksResponse.next_page_token] + * returned from the previous call to + * [ListTasks][google.cloud.tasks.v2.CloudTasks.ListTasks] method. + * The page token is valid for only 2 hours. + * + * Generated from protobuf field string page_token = 4; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ListTasksResponse.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ListTasksResponse.php new file mode 100644 index 000000000000..4aa25374a944 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ListTasksResponse.php @@ -0,0 +1,118 @@ +google.cloud.tasks.v2.ListTasksResponse + */ +class ListTasksResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of tasks. + * + * Generated from protobuf field repeated .google.cloud.tasks.v2.Task tasks = 1; + */ + private $tasks; + /** + * A token to retrieve next page of results. + * To return the next page of results, call + * [ListTasks][google.cloud.tasks.v2.CloudTasks.ListTasks] with this value as + * the [page_token][google.cloud.tasks.v2.ListTasksRequest.page_token]. + * If the next_page_token is empty, there are no more results. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Tasks\V2\Task>|\Google\Protobuf\Internal\RepeatedField $tasks + * The list of tasks. + * @type string $next_page_token + * A token to retrieve next page of results. + * To return the next page of results, call + * [ListTasks][google.cloud.tasks.v2.CloudTasks.ListTasks] with this value as + * the [page_token][google.cloud.tasks.v2.ListTasksRequest.page_token]. + * If the next_page_token is empty, there are no more results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * The list of tasks. + * + * Generated from protobuf field repeated .google.cloud.tasks.v2.Task tasks = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTasks() + { + return $this->tasks; + } + + /** + * The list of tasks. + * + * Generated from protobuf field repeated .google.cloud.tasks.v2.Task tasks = 1; + * @param array<\Google\Cloud\Tasks\V2\Task>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTasks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Tasks\V2\Task::class); + $this->tasks = $arr; + + return $this; + } + + /** + * A token to retrieve next page of results. + * To return the next page of results, call + * [ListTasks][google.cloud.tasks.v2.CloudTasks.ListTasks] with this value as + * the [page_token][google.cloud.tasks.v2.ListTasksRequest.page_token]. + * If the next_page_token is empty, there are no more results. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token to retrieve next page of results. + * To return the next page of results, call + * [ListTasks][google.cloud.tasks.v2.CloudTasks.ListTasks] with this value as + * the [page_token][google.cloud.tasks.v2.ListTasksRequest.page_token]. + * If the next_page_token is empty, there are no more results. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/OAuthToken.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/OAuthToken.php new file mode 100644 index 000000000000..a4533a9aaf28 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/OAuthToken.php @@ -0,0 +1,128 @@ +google.cloud.tasks.v2.OAuthToken + */ +class OAuthToken extends \Google\Protobuf\Internal\Message +{ + /** + * [Service account email](https://cloud.google.com/iam/docs/service-accounts) + * to be used for generating OAuth token. + * The service account must be within the same project as the queue. The + * caller must have iam.serviceAccounts.actAs permission for the service + * account. + * + * Generated from protobuf field string service_account_email = 1; + */ + protected $service_account_email = ''; + /** + * OAuth scope to be used for generating OAuth access token. + * If not specified, "https://www.googleapis.com/auth/cloud-platform" + * will be used. + * + * Generated from protobuf field string scope = 2; + */ + protected $scope = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $service_account_email + * [Service account email](https://cloud.google.com/iam/docs/service-accounts) + * to be used for generating OAuth token. + * The service account must be within the same project as the queue. The + * caller must have iam.serviceAccounts.actAs permission for the service + * account. + * @type string $scope + * OAuth scope to be used for generating OAuth access token. + * If not specified, "https://www.googleapis.com/auth/cloud-platform" + * will be used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2\Target::initOnce(); + parent::__construct($data); + } + + /** + * [Service account email](https://cloud.google.com/iam/docs/service-accounts) + * to be used for generating OAuth token. + * The service account must be within the same project as the queue. The + * caller must have iam.serviceAccounts.actAs permission for the service + * account. + * + * Generated from protobuf field string service_account_email = 1; + * @return string + */ + public function getServiceAccountEmail() + { + return $this->service_account_email; + } + + /** + * [Service account email](https://cloud.google.com/iam/docs/service-accounts) + * to be used for generating OAuth token. + * The service account must be within the same project as the queue. The + * caller must have iam.serviceAccounts.actAs permission for the service + * account. + * + * Generated from protobuf field string service_account_email = 1; + * @param string $var + * @return $this + */ + public function setServiceAccountEmail($var) + { + GPBUtil::checkString($var, True); + $this->service_account_email = $var; + + return $this; + } + + /** + * OAuth scope to be used for generating OAuth access token. + * If not specified, "https://www.googleapis.com/auth/cloud-platform" + * will be used. + * + * Generated from protobuf field string scope = 2; + * @return string + */ + public function getScope() + { + return $this->scope; + } + + /** + * OAuth scope to be used for generating OAuth access token. + * If not specified, "https://www.googleapis.com/auth/cloud-platform" + * will be used. + * + * Generated from protobuf field string scope = 2; + * @param string $var + * @return $this + */ + public function setScope($var) + { + GPBUtil::checkString($var, True); + $this->scope = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/OidcToken.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/OidcToken.php new file mode 100644 index 000000000000..5754271fc809 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/OidcToken.php @@ -0,0 +1,126 @@ +google.cloud.tasks.v2.OidcToken + */ +class OidcToken extends \Google\Protobuf\Internal\Message +{ + /** + * [Service account email](https://cloud.google.com/iam/docs/service-accounts) + * to be used for generating OIDC token. + * The service account must be within the same project as the queue. The + * caller must have iam.serviceAccounts.actAs permission for the service + * account. + * + * Generated from protobuf field string service_account_email = 1; + */ + protected $service_account_email = ''; + /** + * Audience to be used when generating OIDC token. If not specified, the URI + * specified in target will be used. + * + * Generated from protobuf field string audience = 2; + */ + protected $audience = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $service_account_email + * [Service account email](https://cloud.google.com/iam/docs/service-accounts) + * to be used for generating OIDC token. + * The service account must be within the same project as the queue. The + * caller must have iam.serviceAccounts.actAs permission for the service + * account. + * @type string $audience + * Audience to be used when generating OIDC token. If not specified, the URI + * specified in target will be used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2\Target::initOnce(); + parent::__construct($data); + } + + /** + * [Service account email](https://cloud.google.com/iam/docs/service-accounts) + * to be used for generating OIDC token. + * The service account must be within the same project as the queue. The + * caller must have iam.serviceAccounts.actAs permission for the service + * account. + * + * Generated from protobuf field string service_account_email = 1; + * @return string + */ + public function getServiceAccountEmail() + { + return $this->service_account_email; + } + + /** + * [Service account email](https://cloud.google.com/iam/docs/service-accounts) + * to be used for generating OIDC token. + * The service account must be within the same project as the queue. The + * caller must have iam.serviceAccounts.actAs permission for the service + * account. + * + * Generated from protobuf field string service_account_email = 1; + * @param string $var + * @return $this + */ + public function setServiceAccountEmail($var) + { + GPBUtil::checkString($var, True); + $this->service_account_email = $var; + + return $this; + } + + /** + * Audience to be used when generating OIDC token. If not specified, the URI + * specified in target will be used. + * + * Generated from protobuf field string audience = 2; + * @return string + */ + public function getAudience() + { + return $this->audience; + } + + /** + * Audience to be used when generating OIDC token. If not specified, the URI + * specified in target will be used. + * + * Generated from protobuf field string audience = 2; + * @param string $var + * @return $this + */ + public function setAudience($var) + { + GPBUtil::checkString($var, True); + $this->audience = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/PauseQueueRequest.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/PauseQueueRequest.php new file mode 100644 index 000000000000..64db439c96ab --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/PauseQueueRequest.php @@ -0,0 +1,87 @@ +google.cloud.tasks.v2.PauseQueueRequest + */ +class PauseQueueRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * Please see {@see CloudTasksClient::queueName()} for help formatting this field. + * + * @return \Google\Cloud\Tasks\V2\PauseQueueRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/PurgeQueueRequest.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/PurgeQueueRequest.php new file mode 100644 index 000000000000..2e24c8a7f5c3 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/PurgeQueueRequest.php @@ -0,0 +1,87 @@ +google.cloud.tasks.v2.PurgeQueueRequest + */ +class PurgeQueueRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * Please see {@see CloudTasksClient::queueName()} for help formatting this field. + * + * @return \Google\Cloud\Tasks\V2\PurgeQueueRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Queue.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Queue.php new file mode 100644 index 000000000000..d620fdefd4b3 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Queue.php @@ -0,0 +1,611 @@ +google.cloud.tasks.v2.Queue + */ +class Queue extends \Google\Protobuf\Internal\Message +{ + /** + * Caller-specified and required in + * [CreateQueue][google.cloud.tasks.v2.CloudTasks.CreateQueue], after which it + * becomes output only. + * The queue name. + * The queue name must have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), + * hyphens (-), colons (:), or periods (.). + * For more information, see + * [Identifying + * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) + * * `LOCATION_ID` is the canonical ID for the queue's location. + * The list of available locations can be obtained by calling + * [ListLocations][google.cloud.location.Locations.ListLocations]. + * For more information, see https://cloud.google.com/about/locations/. + * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or + * hyphens (-). The maximum length is 100 characters. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Overrides for + * [task-level + * app_engine_routing][google.cloud.tasks.v2.AppEngineHttpRequest.app_engine_routing]. + * These settings apply only to + * [App Engine tasks][google.cloud.tasks.v2.AppEngineHttpRequest] in this + * queue. [Http tasks][google.cloud.tasks.v2.HttpRequest] are not affected. + * If set, `app_engine_routing_override` is used for all + * [App Engine tasks][google.cloud.tasks.v2.AppEngineHttpRequest] in the + * queue, no matter what the setting is for the [task-level + * app_engine_routing][google.cloud.tasks.v2.AppEngineHttpRequest.app_engine_routing]. + * + * Generated from protobuf field .google.cloud.tasks.v2.AppEngineRouting app_engine_routing_override = 2; + */ + protected $app_engine_routing_override = null; + /** + * Rate limits for task dispatches. + * [rate_limits][google.cloud.tasks.v2.Queue.rate_limits] and + * [retry_config][google.cloud.tasks.v2.Queue.retry_config] are related + * because they both control task attempts. However they control task attempts + * in different ways: + * * [rate_limits][google.cloud.tasks.v2.Queue.rate_limits] controls the total + * rate of + * dispatches from a queue (i.e. all traffic dispatched from the + * queue, regardless of whether the dispatch is from a first + * attempt or a retry). + * * [retry_config][google.cloud.tasks.v2.Queue.retry_config] controls what + * happens to + * particular a task after its first attempt fails. That is, + * [retry_config][google.cloud.tasks.v2.Queue.retry_config] controls task + * retries (the second attempt, third attempt, etc). + * The queue's actual dispatch rate is the result of: + * * Number of tasks in the queue + * * User-specified throttling: + * [rate_limits][google.cloud.tasks.v2.Queue.rate_limits], + * [retry_config][google.cloud.tasks.v2.Queue.retry_config], and the + * [queue's state][google.cloud.tasks.v2.Queue.state]. + * * System throttling due to `429` (Too Many Requests) or `503` (Service + * Unavailable) responses from the worker, high error rates, or to smooth + * sudden large traffic spikes. + * + * Generated from protobuf field .google.cloud.tasks.v2.RateLimits rate_limits = 3; + */ + protected $rate_limits = null; + /** + * Settings that determine the retry behavior. + * * For tasks created using Cloud Tasks: the queue-level retry settings + * apply to all tasks in the queue that were created using Cloud Tasks. + * Retry settings cannot be set on individual tasks. + * * For tasks created using the App Engine SDK: the queue-level retry + * settings apply to all tasks in the queue which do not have retry settings + * explicitly set on the task and were created by the App Engine SDK. See + * [App Engine + * documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks). + * + * Generated from protobuf field .google.cloud.tasks.v2.RetryConfig retry_config = 4; + */ + protected $retry_config = null; + /** + * Output only. The state of the queue. + * `state` can only be changed by calling + * [PauseQueue][google.cloud.tasks.v2.CloudTasks.PauseQueue], + * [ResumeQueue][google.cloud.tasks.v2.CloudTasks.ResumeQueue], or uploading + * [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref). + * [UpdateQueue][google.cloud.tasks.v2.CloudTasks.UpdateQueue] cannot be used + * to change `state`. + * + * Generated from protobuf field .google.cloud.tasks.v2.Queue.State state = 5; + */ + protected $state = 0; + /** + * Output only. The last time this queue was purged. + * All tasks that were [created][google.cloud.tasks.v2.Task.create_time] + * before this time were purged. + * A queue can be purged using + * [PurgeQueue][google.cloud.tasks.v2.CloudTasks.PurgeQueue], the [App Engine + * Task Queue SDK, or the Cloud + * Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue). + * Purge time will be truncated to the nearest microsecond. Purge + * time will be unset if the queue has never been purged. + * + * Generated from protobuf field .google.protobuf.Timestamp purge_time = 6; + */ + protected $purge_time = null; + /** + * Configuration options for writing logs to + * [Stackdriver Logging](https://cloud.google.com/logging/docs/). If this + * field is unset, then no logs are written. + * + * Generated from protobuf field .google.cloud.tasks.v2.StackdriverLoggingConfig stackdriver_logging_config = 9; + */ + protected $stackdriver_logging_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Caller-specified and required in + * [CreateQueue][google.cloud.tasks.v2.CloudTasks.CreateQueue], after which it + * becomes output only. + * The queue name. + * The queue name must have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), + * hyphens (-), colons (:), or periods (.). + * For more information, see + * [Identifying + * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) + * * `LOCATION_ID` is the canonical ID for the queue's location. + * The list of available locations can be obtained by calling + * [ListLocations][google.cloud.location.Locations.ListLocations]. + * For more information, see https://cloud.google.com/about/locations/. + * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or + * hyphens (-). The maximum length is 100 characters. + * @type \Google\Cloud\Tasks\V2\AppEngineRouting $app_engine_routing_override + * Overrides for + * [task-level + * app_engine_routing][google.cloud.tasks.v2.AppEngineHttpRequest.app_engine_routing]. + * These settings apply only to + * [App Engine tasks][google.cloud.tasks.v2.AppEngineHttpRequest] in this + * queue. [Http tasks][google.cloud.tasks.v2.HttpRequest] are not affected. + * If set, `app_engine_routing_override` is used for all + * [App Engine tasks][google.cloud.tasks.v2.AppEngineHttpRequest] in the + * queue, no matter what the setting is for the [task-level + * app_engine_routing][google.cloud.tasks.v2.AppEngineHttpRequest.app_engine_routing]. + * @type \Google\Cloud\Tasks\V2\RateLimits $rate_limits + * Rate limits for task dispatches. + * [rate_limits][google.cloud.tasks.v2.Queue.rate_limits] and + * [retry_config][google.cloud.tasks.v2.Queue.retry_config] are related + * because they both control task attempts. However they control task attempts + * in different ways: + * * [rate_limits][google.cloud.tasks.v2.Queue.rate_limits] controls the total + * rate of + * dispatches from a queue (i.e. all traffic dispatched from the + * queue, regardless of whether the dispatch is from a first + * attempt or a retry). + * * [retry_config][google.cloud.tasks.v2.Queue.retry_config] controls what + * happens to + * particular a task after its first attempt fails. That is, + * [retry_config][google.cloud.tasks.v2.Queue.retry_config] controls task + * retries (the second attempt, third attempt, etc). + * The queue's actual dispatch rate is the result of: + * * Number of tasks in the queue + * * User-specified throttling: + * [rate_limits][google.cloud.tasks.v2.Queue.rate_limits], + * [retry_config][google.cloud.tasks.v2.Queue.retry_config], and the + * [queue's state][google.cloud.tasks.v2.Queue.state]. + * * System throttling due to `429` (Too Many Requests) or `503` (Service + * Unavailable) responses from the worker, high error rates, or to smooth + * sudden large traffic spikes. + * @type \Google\Cloud\Tasks\V2\RetryConfig $retry_config + * Settings that determine the retry behavior. + * * For tasks created using Cloud Tasks: the queue-level retry settings + * apply to all tasks in the queue that were created using Cloud Tasks. + * Retry settings cannot be set on individual tasks. + * * For tasks created using the App Engine SDK: the queue-level retry + * settings apply to all tasks in the queue which do not have retry settings + * explicitly set on the task and were created by the App Engine SDK. See + * [App Engine + * documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks). + * @type int $state + * Output only. The state of the queue. + * `state` can only be changed by calling + * [PauseQueue][google.cloud.tasks.v2.CloudTasks.PauseQueue], + * [ResumeQueue][google.cloud.tasks.v2.CloudTasks.ResumeQueue], or uploading + * [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref). + * [UpdateQueue][google.cloud.tasks.v2.CloudTasks.UpdateQueue] cannot be used + * to change `state`. + * @type \Google\Protobuf\Timestamp $purge_time + * Output only. The last time this queue was purged. + * All tasks that were [created][google.cloud.tasks.v2.Task.create_time] + * before this time were purged. + * A queue can be purged using + * [PurgeQueue][google.cloud.tasks.v2.CloudTasks.PurgeQueue], the [App Engine + * Task Queue SDK, or the Cloud + * Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue). + * Purge time will be truncated to the nearest microsecond. Purge + * time will be unset if the queue has never been purged. + * @type \Google\Cloud\Tasks\V2\StackdriverLoggingConfig $stackdriver_logging_config + * Configuration options for writing logs to + * [Stackdriver Logging](https://cloud.google.com/logging/docs/). If this + * field is unset, then no logs are written. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2\Queue::initOnce(); + parent::__construct($data); + } + + /** + * Caller-specified and required in + * [CreateQueue][google.cloud.tasks.v2.CloudTasks.CreateQueue], after which it + * becomes output only. + * The queue name. + * The queue name must have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), + * hyphens (-), colons (:), or periods (.). + * For more information, see + * [Identifying + * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) + * * `LOCATION_ID` is the canonical ID for the queue's location. + * The list of available locations can be obtained by calling + * [ListLocations][google.cloud.location.Locations.ListLocations]. + * For more information, see https://cloud.google.com/about/locations/. + * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or + * hyphens (-). The maximum length is 100 characters. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Caller-specified and required in + * [CreateQueue][google.cloud.tasks.v2.CloudTasks.CreateQueue], after which it + * becomes output only. + * The queue name. + * The queue name must have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), + * hyphens (-), colons (:), or periods (.). + * For more information, see + * [Identifying + * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) + * * `LOCATION_ID` is the canonical ID for the queue's location. + * The list of available locations can be obtained by calling + * [ListLocations][google.cloud.location.Locations.ListLocations]. + * For more information, see https://cloud.google.com/about/locations/. + * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or + * hyphens (-). The maximum length is 100 characters. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Overrides for + * [task-level + * app_engine_routing][google.cloud.tasks.v2.AppEngineHttpRequest.app_engine_routing]. + * These settings apply only to + * [App Engine tasks][google.cloud.tasks.v2.AppEngineHttpRequest] in this + * queue. [Http tasks][google.cloud.tasks.v2.HttpRequest] are not affected. + * If set, `app_engine_routing_override` is used for all + * [App Engine tasks][google.cloud.tasks.v2.AppEngineHttpRequest] in the + * queue, no matter what the setting is for the [task-level + * app_engine_routing][google.cloud.tasks.v2.AppEngineHttpRequest.app_engine_routing]. + * + * Generated from protobuf field .google.cloud.tasks.v2.AppEngineRouting app_engine_routing_override = 2; + * @return \Google\Cloud\Tasks\V2\AppEngineRouting|null + */ + public function getAppEngineRoutingOverride() + { + return $this->app_engine_routing_override; + } + + public function hasAppEngineRoutingOverride() + { + return isset($this->app_engine_routing_override); + } + + public function clearAppEngineRoutingOverride() + { + unset($this->app_engine_routing_override); + } + + /** + * Overrides for + * [task-level + * app_engine_routing][google.cloud.tasks.v2.AppEngineHttpRequest.app_engine_routing]. + * These settings apply only to + * [App Engine tasks][google.cloud.tasks.v2.AppEngineHttpRequest] in this + * queue. [Http tasks][google.cloud.tasks.v2.HttpRequest] are not affected. + * If set, `app_engine_routing_override` is used for all + * [App Engine tasks][google.cloud.tasks.v2.AppEngineHttpRequest] in the + * queue, no matter what the setting is for the [task-level + * app_engine_routing][google.cloud.tasks.v2.AppEngineHttpRequest.app_engine_routing]. + * + * Generated from protobuf field .google.cloud.tasks.v2.AppEngineRouting app_engine_routing_override = 2; + * @param \Google\Cloud\Tasks\V2\AppEngineRouting $var + * @return $this + */ + public function setAppEngineRoutingOverride($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2\AppEngineRouting::class); + $this->app_engine_routing_override = $var; + + return $this; + } + + /** + * Rate limits for task dispatches. + * [rate_limits][google.cloud.tasks.v2.Queue.rate_limits] and + * [retry_config][google.cloud.tasks.v2.Queue.retry_config] are related + * because they both control task attempts. However they control task attempts + * in different ways: + * * [rate_limits][google.cloud.tasks.v2.Queue.rate_limits] controls the total + * rate of + * dispatches from a queue (i.e. all traffic dispatched from the + * queue, regardless of whether the dispatch is from a first + * attempt or a retry). + * * [retry_config][google.cloud.tasks.v2.Queue.retry_config] controls what + * happens to + * particular a task after its first attempt fails. That is, + * [retry_config][google.cloud.tasks.v2.Queue.retry_config] controls task + * retries (the second attempt, third attempt, etc). + * The queue's actual dispatch rate is the result of: + * * Number of tasks in the queue + * * User-specified throttling: + * [rate_limits][google.cloud.tasks.v2.Queue.rate_limits], + * [retry_config][google.cloud.tasks.v2.Queue.retry_config], and the + * [queue's state][google.cloud.tasks.v2.Queue.state]. + * * System throttling due to `429` (Too Many Requests) or `503` (Service + * Unavailable) responses from the worker, high error rates, or to smooth + * sudden large traffic spikes. + * + * Generated from protobuf field .google.cloud.tasks.v2.RateLimits rate_limits = 3; + * @return \Google\Cloud\Tasks\V2\RateLimits|null + */ + public function getRateLimits() + { + return $this->rate_limits; + } + + public function hasRateLimits() + { + return isset($this->rate_limits); + } + + public function clearRateLimits() + { + unset($this->rate_limits); + } + + /** + * Rate limits for task dispatches. + * [rate_limits][google.cloud.tasks.v2.Queue.rate_limits] and + * [retry_config][google.cloud.tasks.v2.Queue.retry_config] are related + * because they both control task attempts. However they control task attempts + * in different ways: + * * [rate_limits][google.cloud.tasks.v2.Queue.rate_limits] controls the total + * rate of + * dispatches from a queue (i.e. all traffic dispatched from the + * queue, regardless of whether the dispatch is from a first + * attempt or a retry). + * * [retry_config][google.cloud.tasks.v2.Queue.retry_config] controls what + * happens to + * particular a task after its first attempt fails. That is, + * [retry_config][google.cloud.tasks.v2.Queue.retry_config] controls task + * retries (the second attempt, third attempt, etc). + * The queue's actual dispatch rate is the result of: + * * Number of tasks in the queue + * * User-specified throttling: + * [rate_limits][google.cloud.tasks.v2.Queue.rate_limits], + * [retry_config][google.cloud.tasks.v2.Queue.retry_config], and the + * [queue's state][google.cloud.tasks.v2.Queue.state]. + * * System throttling due to `429` (Too Many Requests) or `503` (Service + * Unavailable) responses from the worker, high error rates, or to smooth + * sudden large traffic spikes. + * + * Generated from protobuf field .google.cloud.tasks.v2.RateLimits rate_limits = 3; + * @param \Google\Cloud\Tasks\V2\RateLimits $var + * @return $this + */ + public function setRateLimits($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2\RateLimits::class); + $this->rate_limits = $var; + + return $this; + } + + /** + * Settings that determine the retry behavior. + * * For tasks created using Cloud Tasks: the queue-level retry settings + * apply to all tasks in the queue that were created using Cloud Tasks. + * Retry settings cannot be set on individual tasks. + * * For tasks created using the App Engine SDK: the queue-level retry + * settings apply to all tasks in the queue which do not have retry settings + * explicitly set on the task and were created by the App Engine SDK. See + * [App Engine + * documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks). + * + * Generated from protobuf field .google.cloud.tasks.v2.RetryConfig retry_config = 4; + * @return \Google\Cloud\Tasks\V2\RetryConfig|null + */ + public function getRetryConfig() + { + return $this->retry_config; + } + + public function hasRetryConfig() + { + return isset($this->retry_config); + } + + public function clearRetryConfig() + { + unset($this->retry_config); + } + + /** + * Settings that determine the retry behavior. + * * For tasks created using Cloud Tasks: the queue-level retry settings + * apply to all tasks in the queue that were created using Cloud Tasks. + * Retry settings cannot be set on individual tasks. + * * For tasks created using the App Engine SDK: the queue-level retry + * settings apply to all tasks in the queue which do not have retry settings + * explicitly set on the task and were created by the App Engine SDK. See + * [App Engine + * documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks). + * + * Generated from protobuf field .google.cloud.tasks.v2.RetryConfig retry_config = 4; + * @param \Google\Cloud\Tasks\V2\RetryConfig $var + * @return $this + */ + public function setRetryConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2\RetryConfig::class); + $this->retry_config = $var; + + return $this; + } + + /** + * Output only. The state of the queue. + * `state` can only be changed by calling + * [PauseQueue][google.cloud.tasks.v2.CloudTasks.PauseQueue], + * [ResumeQueue][google.cloud.tasks.v2.CloudTasks.ResumeQueue], or uploading + * [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref). + * [UpdateQueue][google.cloud.tasks.v2.CloudTasks.UpdateQueue] cannot be used + * to change `state`. + * + * Generated from protobuf field .google.cloud.tasks.v2.Queue.State state = 5; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The state of the queue. + * `state` can only be changed by calling + * [PauseQueue][google.cloud.tasks.v2.CloudTasks.PauseQueue], + * [ResumeQueue][google.cloud.tasks.v2.CloudTasks.ResumeQueue], or uploading + * [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref). + * [UpdateQueue][google.cloud.tasks.v2.CloudTasks.UpdateQueue] cannot be used + * to change `state`. + * + * Generated from protobuf field .google.cloud.tasks.v2.Queue.State state = 5; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2\Queue\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. The last time this queue was purged. + * All tasks that were [created][google.cloud.tasks.v2.Task.create_time] + * before this time were purged. + * A queue can be purged using + * [PurgeQueue][google.cloud.tasks.v2.CloudTasks.PurgeQueue], the [App Engine + * Task Queue SDK, or the Cloud + * Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue). + * Purge time will be truncated to the nearest microsecond. Purge + * time will be unset if the queue has never been purged. + * + * Generated from protobuf field .google.protobuf.Timestamp purge_time = 6; + * @return \Google\Protobuf\Timestamp|null + */ + public function getPurgeTime() + { + return $this->purge_time; + } + + public function hasPurgeTime() + { + return isset($this->purge_time); + } + + public function clearPurgeTime() + { + unset($this->purge_time); + } + + /** + * Output only. The last time this queue was purged. + * All tasks that were [created][google.cloud.tasks.v2.Task.create_time] + * before this time were purged. + * A queue can be purged using + * [PurgeQueue][google.cloud.tasks.v2.CloudTasks.PurgeQueue], the [App Engine + * Task Queue SDK, or the Cloud + * Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue). + * Purge time will be truncated to the nearest microsecond. Purge + * time will be unset if the queue has never been purged. + * + * Generated from protobuf field .google.protobuf.Timestamp purge_time = 6; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setPurgeTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->purge_time = $var; + + return $this; + } + + /** + * Configuration options for writing logs to + * [Stackdriver Logging](https://cloud.google.com/logging/docs/). If this + * field is unset, then no logs are written. + * + * Generated from protobuf field .google.cloud.tasks.v2.StackdriverLoggingConfig stackdriver_logging_config = 9; + * @return \Google\Cloud\Tasks\V2\StackdriverLoggingConfig|null + */ + public function getStackdriverLoggingConfig() + { + return $this->stackdriver_logging_config; + } + + public function hasStackdriverLoggingConfig() + { + return isset($this->stackdriver_logging_config); + } + + public function clearStackdriverLoggingConfig() + { + unset($this->stackdriver_logging_config); + } + + /** + * Configuration options for writing logs to + * [Stackdriver Logging](https://cloud.google.com/logging/docs/). If this + * field is unset, then no logs are written. + * + * Generated from protobuf field .google.cloud.tasks.v2.StackdriverLoggingConfig stackdriver_logging_config = 9; + * @param \Google\Cloud\Tasks\V2\StackdriverLoggingConfig $var + * @return $this + */ + public function setStackdriverLoggingConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2\StackdriverLoggingConfig::class); + $this->stackdriver_logging_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Queue/State.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Queue/State.php new file mode 100644 index 000000000000..2c4722b35ec5 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Queue/State.php @@ -0,0 +1,89 @@ +google.cloud.tasks.v2.Queue.State + */ +class State +{ + /** + * Unspecified state. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The queue is running. Tasks can be dispatched. + * If the queue was created using Cloud Tasks and the queue has + * had no activity (method calls or task dispatches) for 30 days, + * the queue may take a few minutes to re-activate. Some method + * calls may return [NOT_FOUND][google.rpc.Code.NOT_FOUND] and + * tasks may not be dispatched for a few minutes until the queue + * has been re-activated. + * + * Generated from protobuf enum RUNNING = 1; + */ + const RUNNING = 1; + /** + * Tasks are paused by the user. If the queue is paused then Cloud + * Tasks will stop delivering tasks from it, but more tasks can + * still be added to it by the user. + * + * Generated from protobuf enum PAUSED = 2; + */ + const PAUSED = 2; + /** + * The queue is disabled. + * A queue becomes `DISABLED` when + * [queue.yaml](https://cloud.google.com/appengine/docs/python/config/queueref) + * or + * [queue.xml](https://cloud.google.com/appengine/docs/standard/java/config/queueref) + * is uploaded which does not contain the queue. You cannot directly disable + * a queue. + * When a queue is disabled, tasks can still be added to a queue + * but the tasks are not dispatched. + * To permanently delete this queue and all of its tasks, call + * [DeleteQueue][google.cloud.tasks.v2.CloudTasks.DeleteQueue]. + * + * Generated from protobuf enum DISABLED = 3; + */ + const DISABLED = 3; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::RUNNING => 'RUNNING', + self::PAUSED => 'PAUSED', + self::DISABLED => 'DISABLED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\Tasks\V2\Queue_State::class); + diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/RateLimits.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/RateLimits.php new file mode 100644 index 000000000000..27f254540e19 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/RateLimits.php @@ -0,0 +1,308 @@ +google.cloud.tasks.v2.RateLimits + */ +class RateLimits extends \Google\Protobuf\Internal\Message +{ + /** + * The maximum rate at which tasks are dispatched from this queue. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * * The maximum allowed value is 500. + * This field has the same meaning as + * [rate in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate). + * + * Generated from protobuf field double max_dispatches_per_second = 1; + */ + protected $max_dispatches_per_second = 0.0; + /** + * Output only. The max burst size. + * Max burst size limits how fast tasks in queue are processed when + * many tasks are in the queue and the rate is high. This field + * allows the queue to have a high rate so processing starts shortly + * after a task is enqueued, but still limits resource usage when + * many tasks are enqueued in a short period of time. + * The [token bucket](https://wikipedia.org/wiki/Token_Bucket) + * algorithm is used to control the rate of task dispatches. Each + * queue has a token bucket that holds tokens, up to the maximum + * specified by `max_burst_size`. Each time a task is dispatched, a + * token is removed from the bucket. Tasks will be dispatched until + * the queue's bucket runs out of tokens. The bucket will be + * continuously refilled with new tokens based on + * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second]. + * Cloud Tasks will pick the value of `max_burst_size` based on the + * value of + * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second]. + * For queues that were created or updated using + * `queue.yaml/xml`, `max_burst_size` is equal to + * [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size). + * Since `max_burst_size` is output only, if + * [UpdateQueue][google.cloud.tasks.v2.CloudTasks.UpdateQueue] is called on a + * queue created by `queue.yaml/xml`, `max_burst_size` will be reset based on + * the value of + * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second], + * regardless of whether + * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second] + * is updated. + * + * Generated from protobuf field int32 max_burst_size = 2; + */ + protected $max_burst_size = 0; + /** + * The maximum number of concurrent tasks that Cloud Tasks allows + * to be dispatched for this queue. After this threshold has been + * reached, Cloud Tasks stops dispatching tasks until the number of + * concurrent requests decreases. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * The maximum allowed value is 5,000. + * This field has the same meaning as + * [max_concurrent_requests in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests). + * + * Generated from protobuf field int32 max_concurrent_dispatches = 3; + */ + protected $max_concurrent_dispatches = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $max_dispatches_per_second + * The maximum rate at which tasks are dispatched from this queue. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * * The maximum allowed value is 500. + * This field has the same meaning as + * [rate in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate). + * @type int $max_burst_size + * Output only. The max burst size. + * Max burst size limits how fast tasks in queue are processed when + * many tasks are in the queue and the rate is high. This field + * allows the queue to have a high rate so processing starts shortly + * after a task is enqueued, but still limits resource usage when + * many tasks are enqueued in a short period of time. + * The [token bucket](https://wikipedia.org/wiki/Token_Bucket) + * algorithm is used to control the rate of task dispatches. Each + * queue has a token bucket that holds tokens, up to the maximum + * specified by `max_burst_size`. Each time a task is dispatched, a + * token is removed from the bucket. Tasks will be dispatched until + * the queue's bucket runs out of tokens. The bucket will be + * continuously refilled with new tokens based on + * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second]. + * Cloud Tasks will pick the value of `max_burst_size` based on the + * value of + * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second]. + * For queues that were created or updated using + * `queue.yaml/xml`, `max_burst_size` is equal to + * [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size). + * Since `max_burst_size` is output only, if + * [UpdateQueue][google.cloud.tasks.v2.CloudTasks.UpdateQueue] is called on a + * queue created by `queue.yaml/xml`, `max_burst_size` will be reset based on + * the value of + * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second], + * regardless of whether + * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second] + * is updated. + * @type int $max_concurrent_dispatches + * The maximum number of concurrent tasks that Cloud Tasks allows + * to be dispatched for this queue. After this threshold has been + * reached, Cloud Tasks stops dispatching tasks until the number of + * concurrent requests decreases. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * The maximum allowed value is 5,000. + * This field has the same meaning as + * [max_concurrent_requests in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2\Queue::initOnce(); + parent::__construct($data); + } + + /** + * The maximum rate at which tasks are dispatched from this queue. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * * The maximum allowed value is 500. + * This field has the same meaning as + * [rate in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate). + * + * Generated from protobuf field double max_dispatches_per_second = 1; + * @return float + */ + public function getMaxDispatchesPerSecond() + { + return $this->max_dispatches_per_second; + } + + /** + * The maximum rate at which tasks are dispatched from this queue. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * * The maximum allowed value is 500. + * This field has the same meaning as + * [rate in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate). + * + * Generated from protobuf field double max_dispatches_per_second = 1; + * @param float $var + * @return $this + */ + public function setMaxDispatchesPerSecond($var) + { + GPBUtil::checkDouble($var); + $this->max_dispatches_per_second = $var; + + return $this; + } + + /** + * Output only. The max burst size. + * Max burst size limits how fast tasks in queue are processed when + * many tasks are in the queue and the rate is high. This field + * allows the queue to have a high rate so processing starts shortly + * after a task is enqueued, but still limits resource usage when + * many tasks are enqueued in a short period of time. + * The [token bucket](https://wikipedia.org/wiki/Token_Bucket) + * algorithm is used to control the rate of task dispatches. Each + * queue has a token bucket that holds tokens, up to the maximum + * specified by `max_burst_size`. Each time a task is dispatched, a + * token is removed from the bucket. Tasks will be dispatched until + * the queue's bucket runs out of tokens. The bucket will be + * continuously refilled with new tokens based on + * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second]. + * Cloud Tasks will pick the value of `max_burst_size` based on the + * value of + * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second]. + * For queues that were created or updated using + * `queue.yaml/xml`, `max_burst_size` is equal to + * [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size). + * Since `max_burst_size` is output only, if + * [UpdateQueue][google.cloud.tasks.v2.CloudTasks.UpdateQueue] is called on a + * queue created by `queue.yaml/xml`, `max_burst_size` will be reset based on + * the value of + * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second], + * regardless of whether + * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second] + * is updated. + * + * Generated from protobuf field int32 max_burst_size = 2; + * @return int + */ + public function getMaxBurstSize() + { + return $this->max_burst_size; + } + + /** + * Output only. The max burst size. + * Max burst size limits how fast tasks in queue are processed when + * many tasks are in the queue and the rate is high. This field + * allows the queue to have a high rate so processing starts shortly + * after a task is enqueued, but still limits resource usage when + * many tasks are enqueued in a short period of time. + * The [token bucket](https://wikipedia.org/wiki/Token_Bucket) + * algorithm is used to control the rate of task dispatches. Each + * queue has a token bucket that holds tokens, up to the maximum + * specified by `max_burst_size`. Each time a task is dispatched, a + * token is removed from the bucket. Tasks will be dispatched until + * the queue's bucket runs out of tokens. The bucket will be + * continuously refilled with new tokens based on + * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second]. + * Cloud Tasks will pick the value of `max_burst_size` based on the + * value of + * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second]. + * For queues that were created or updated using + * `queue.yaml/xml`, `max_burst_size` is equal to + * [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size). + * Since `max_burst_size` is output only, if + * [UpdateQueue][google.cloud.tasks.v2.CloudTasks.UpdateQueue] is called on a + * queue created by `queue.yaml/xml`, `max_burst_size` will be reset based on + * the value of + * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second], + * regardless of whether + * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second] + * is updated. + * + * Generated from protobuf field int32 max_burst_size = 2; + * @param int $var + * @return $this + */ + public function setMaxBurstSize($var) + { + GPBUtil::checkInt32($var); + $this->max_burst_size = $var; + + return $this; + } + + /** + * The maximum number of concurrent tasks that Cloud Tasks allows + * to be dispatched for this queue. After this threshold has been + * reached, Cloud Tasks stops dispatching tasks until the number of + * concurrent requests decreases. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * The maximum allowed value is 5,000. + * This field has the same meaning as + * [max_concurrent_requests in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests). + * + * Generated from protobuf field int32 max_concurrent_dispatches = 3; + * @return int + */ + public function getMaxConcurrentDispatches() + { + return $this->max_concurrent_dispatches; + } + + /** + * The maximum number of concurrent tasks that Cloud Tasks allows + * to be dispatched for this queue. After this threshold has been + * reached, Cloud Tasks stops dispatching tasks until the number of + * concurrent requests decreases. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * The maximum allowed value is 5,000. + * This field has the same meaning as + * [max_concurrent_requests in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests). + * + * Generated from protobuf field int32 max_concurrent_dispatches = 3; + * @param int $var + * @return $this + */ + public function setMaxConcurrentDispatches($var) + { + GPBUtil::checkInt32($var); + $this->max_concurrent_dispatches = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ResumeQueueRequest.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ResumeQueueRequest.php new file mode 100644 index 000000000000..9d16294a8e1e --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ResumeQueueRequest.php @@ -0,0 +1,87 @@ +google.cloud.tasks.v2.ResumeQueueRequest + */ +class ResumeQueueRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * Please see {@see CloudTasksClient::queueName()} for help formatting this field. + * + * @return \Google\Cloud\Tasks\V2\ResumeQueueRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/RetryConfig.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/RetryConfig.php new file mode 100644 index 000000000000..64252afa351d --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/RetryConfig.php @@ -0,0 +1,490 @@ +google.cloud.tasks.v2.RetryConfig + */ +class RetryConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Number of attempts per task. + * Cloud Tasks will attempt the task `max_attempts` times (that is, if the + * first attempt fails, then there will be `max_attempts - 1` retries). Must + * be >= -1. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * -1 indicates unlimited attempts. + * This field has the same meaning as + * [task_retry_limit in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * + * Generated from protobuf field int32 max_attempts = 1; + */ + protected $max_attempts = 0; + /** + * If positive, `max_retry_duration` specifies the time limit for + * retrying a failed task, measured from when the task was first + * attempted. Once `max_retry_duration` time has passed *and* the + * task has been attempted + * [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times, no + * further attempts will be made and the task will be deleted. + * If zero, then the task age is unlimited. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * `max_retry_duration` will be truncated to the nearest second. + * This field has the same meaning as + * [task_age_limit in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * + * Generated from protobuf field .google.protobuf.Duration max_retry_duration = 2; + */ + protected $max_retry_duration = null; + /** + * A task will be [scheduled][google.cloud.tasks.v2.Task.schedule_time] for + * retry between [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff] + * and [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] duration + * after it fails, if the queue's + * [RetryConfig][google.cloud.tasks.v2.RetryConfig] specifies that the task + * should be retried. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * `min_backoff` will be truncated to the nearest second. + * This field has the same meaning as + * [min_backoff_seconds in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * + * Generated from protobuf field .google.protobuf.Duration min_backoff = 3; + */ + protected $min_backoff = null; + /** + * A task will be [scheduled][google.cloud.tasks.v2.Task.schedule_time] for + * retry between [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff] + * and [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] duration + * after it fails, if the queue's + * [RetryConfig][google.cloud.tasks.v2.RetryConfig] specifies that the task + * should be retried. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * `max_backoff` will be truncated to the nearest second. + * This field has the same meaning as + * [max_backoff_seconds in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * + * Generated from protobuf field .google.protobuf.Duration max_backoff = 4; + */ + protected $max_backoff = null; + /** + * The time between retries will double `max_doublings` times. + * A task's retry interval starts at + * [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff], then doubles + * `max_doublings` times, then increases linearly, and finally + * retries at intervals of + * [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] up to + * [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times. + * For example, if + * [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff] is 10s, + * [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] is 300s, and + * `max_doublings` is 3, then the a task will first be retried in + * 10s. The retry interval will double three times, and then + * increase linearly by 2^3 * 10s. Finally, the task will retry at + * intervals of [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] + * until the task has been attempted + * [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times. Thus, + * the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, 300s, .... + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * This field has the same meaning as + * [max_doublings in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * + * Generated from protobuf field int32 max_doublings = 5; + */ + protected $max_doublings = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $max_attempts + * Number of attempts per task. + * Cloud Tasks will attempt the task `max_attempts` times (that is, if the + * first attempt fails, then there will be `max_attempts - 1` retries). Must + * be >= -1. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * -1 indicates unlimited attempts. + * This field has the same meaning as + * [task_retry_limit in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * @type \Google\Protobuf\Duration $max_retry_duration + * If positive, `max_retry_duration` specifies the time limit for + * retrying a failed task, measured from when the task was first + * attempted. Once `max_retry_duration` time has passed *and* the + * task has been attempted + * [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times, no + * further attempts will be made and the task will be deleted. + * If zero, then the task age is unlimited. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * `max_retry_duration` will be truncated to the nearest second. + * This field has the same meaning as + * [task_age_limit in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * @type \Google\Protobuf\Duration $min_backoff + * A task will be [scheduled][google.cloud.tasks.v2.Task.schedule_time] for + * retry between [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff] + * and [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] duration + * after it fails, if the queue's + * [RetryConfig][google.cloud.tasks.v2.RetryConfig] specifies that the task + * should be retried. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * `min_backoff` will be truncated to the nearest second. + * This field has the same meaning as + * [min_backoff_seconds in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * @type \Google\Protobuf\Duration $max_backoff + * A task will be [scheduled][google.cloud.tasks.v2.Task.schedule_time] for + * retry between [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff] + * and [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] duration + * after it fails, if the queue's + * [RetryConfig][google.cloud.tasks.v2.RetryConfig] specifies that the task + * should be retried. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * `max_backoff` will be truncated to the nearest second. + * This field has the same meaning as + * [max_backoff_seconds in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * @type int $max_doublings + * The time between retries will double `max_doublings` times. + * A task's retry interval starts at + * [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff], then doubles + * `max_doublings` times, then increases linearly, and finally + * retries at intervals of + * [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] up to + * [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times. + * For example, if + * [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff] is 10s, + * [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] is 300s, and + * `max_doublings` is 3, then the a task will first be retried in + * 10s. The retry interval will double three times, and then + * increase linearly by 2^3 * 10s. Finally, the task will retry at + * intervals of [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] + * until the task has been attempted + * [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times. Thus, + * the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, 300s, .... + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * This field has the same meaning as + * [max_doublings in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2\Queue::initOnce(); + parent::__construct($data); + } + + /** + * Number of attempts per task. + * Cloud Tasks will attempt the task `max_attempts` times (that is, if the + * first attempt fails, then there will be `max_attempts - 1` retries). Must + * be >= -1. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * -1 indicates unlimited attempts. + * This field has the same meaning as + * [task_retry_limit in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * + * Generated from protobuf field int32 max_attempts = 1; + * @return int + */ + public function getMaxAttempts() + { + return $this->max_attempts; + } + + /** + * Number of attempts per task. + * Cloud Tasks will attempt the task `max_attempts` times (that is, if the + * first attempt fails, then there will be `max_attempts - 1` retries). Must + * be >= -1. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * -1 indicates unlimited attempts. + * This field has the same meaning as + * [task_retry_limit in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * + * Generated from protobuf field int32 max_attempts = 1; + * @param int $var + * @return $this + */ + public function setMaxAttempts($var) + { + GPBUtil::checkInt32($var); + $this->max_attempts = $var; + + return $this; + } + + /** + * If positive, `max_retry_duration` specifies the time limit for + * retrying a failed task, measured from when the task was first + * attempted. Once `max_retry_duration` time has passed *and* the + * task has been attempted + * [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times, no + * further attempts will be made and the task will be deleted. + * If zero, then the task age is unlimited. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * `max_retry_duration` will be truncated to the nearest second. + * This field has the same meaning as + * [task_age_limit in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * + * Generated from protobuf field .google.protobuf.Duration max_retry_duration = 2; + * @return \Google\Protobuf\Duration|null + */ + public function getMaxRetryDuration() + { + return $this->max_retry_duration; + } + + public function hasMaxRetryDuration() + { + return isset($this->max_retry_duration); + } + + public function clearMaxRetryDuration() + { + unset($this->max_retry_duration); + } + + /** + * If positive, `max_retry_duration` specifies the time limit for + * retrying a failed task, measured from when the task was first + * attempted. Once `max_retry_duration` time has passed *and* the + * task has been attempted + * [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times, no + * further attempts will be made and the task will be deleted. + * If zero, then the task age is unlimited. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * `max_retry_duration` will be truncated to the nearest second. + * This field has the same meaning as + * [task_age_limit in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * + * Generated from protobuf field .google.protobuf.Duration max_retry_duration = 2; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setMaxRetryDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->max_retry_duration = $var; + + return $this; + } + + /** + * A task will be [scheduled][google.cloud.tasks.v2.Task.schedule_time] for + * retry between [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff] + * and [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] duration + * after it fails, if the queue's + * [RetryConfig][google.cloud.tasks.v2.RetryConfig] specifies that the task + * should be retried. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * `min_backoff` will be truncated to the nearest second. + * This field has the same meaning as + * [min_backoff_seconds in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * + * Generated from protobuf field .google.protobuf.Duration min_backoff = 3; + * @return \Google\Protobuf\Duration|null + */ + public function getMinBackoff() + { + return $this->min_backoff; + } + + public function hasMinBackoff() + { + return isset($this->min_backoff); + } + + public function clearMinBackoff() + { + unset($this->min_backoff); + } + + /** + * A task will be [scheduled][google.cloud.tasks.v2.Task.schedule_time] for + * retry between [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff] + * and [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] duration + * after it fails, if the queue's + * [RetryConfig][google.cloud.tasks.v2.RetryConfig] specifies that the task + * should be retried. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * `min_backoff` will be truncated to the nearest second. + * This field has the same meaning as + * [min_backoff_seconds in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * + * Generated from protobuf field .google.protobuf.Duration min_backoff = 3; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setMinBackoff($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->min_backoff = $var; + + return $this; + } + + /** + * A task will be [scheduled][google.cloud.tasks.v2.Task.schedule_time] for + * retry between [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff] + * and [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] duration + * after it fails, if the queue's + * [RetryConfig][google.cloud.tasks.v2.RetryConfig] specifies that the task + * should be retried. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * `max_backoff` will be truncated to the nearest second. + * This field has the same meaning as + * [max_backoff_seconds in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * + * Generated from protobuf field .google.protobuf.Duration max_backoff = 4; + * @return \Google\Protobuf\Duration|null + */ + public function getMaxBackoff() + { + return $this->max_backoff; + } + + public function hasMaxBackoff() + { + return isset($this->max_backoff); + } + + public function clearMaxBackoff() + { + unset($this->max_backoff); + } + + /** + * A task will be [scheduled][google.cloud.tasks.v2.Task.schedule_time] for + * retry between [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff] + * and [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] duration + * after it fails, if the queue's + * [RetryConfig][google.cloud.tasks.v2.RetryConfig] specifies that the task + * should be retried. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * `max_backoff` will be truncated to the nearest second. + * This field has the same meaning as + * [max_backoff_seconds in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * + * Generated from protobuf field .google.protobuf.Duration max_backoff = 4; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setMaxBackoff($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->max_backoff = $var; + + return $this; + } + + /** + * The time between retries will double `max_doublings` times. + * A task's retry interval starts at + * [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff], then doubles + * `max_doublings` times, then increases linearly, and finally + * retries at intervals of + * [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] up to + * [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times. + * For example, if + * [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff] is 10s, + * [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] is 300s, and + * `max_doublings` is 3, then the a task will first be retried in + * 10s. The retry interval will double three times, and then + * increase linearly by 2^3 * 10s. Finally, the task will retry at + * intervals of [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] + * until the task has been attempted + * [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times. Thus, + * the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, 300s, .... + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * This field has the same meaning as + * [max_doublings in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * + * Generated from protobuf field int32 max_doublings = 5; + * @return int + */ + public function getMaxDoublings() + { + return $this->max_doublings; + } + + /** + * The time between retries will double `max_doublings` times. + * A task's retry interval starts at + * [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff], then doubles + * `max_doublings` times, then increases linearly, and finally + * retries at intervals of + * [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] up to + * [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times. + * For example, if + * [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff] is 10s, + * [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] is 300s, and + * `max_doublings` is 3, then the a task will first be retried in + * 10s. The retry interval will double three times, and then + * increase linearly by 2^3 * 10s. Finally, the task will retry at + * intervals of [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] + * until the task has been attempted + * [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times. Thus, + * the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, 300s, .... + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * This field has the same meaning as + * [max_doublings in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * + * Generated from protobuf field int32 max_doublings = 5; + * @param int $var + * @return $this + */ + public function setMaxDoublings($var) + { + GPBUtil::checkInt32($var); + $this->max_doublings = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/RunTaskRequest.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/RunTaskRequest.php new file mode 100644 index 000000000000..bcdf65c9a418 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/RunTaskRequest.php @@ -0,0 +1,157 @@ +google.cloud.tasks.v2.RunTaskRequest + */ +class RunTaskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2.Task] will be returned. + * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; + * not all information is retrieved by default because some data, such as + * payloads, might be desirable to return only when needed because + * of its large size or because of the sensitivity of data that it + * contains. + * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires + * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + * permission on the [Task][google.cloud.tasks.v2.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2.Task.View response_view = 2; + */ + protected $response_view = 0; + + /** + * @param string $name Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * Please see {@see CloudTasksClient::taskName()} for help formatting this field. + * + * @return \Google\Cloud\Tasks\V2\RunTaskRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * @type int $response_view + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2.Task] will be returned. + * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; + * not all information is retrieved by default because some data, such as + * payloads, might be desirable to return only when needed because + * of its large size or because of the sensitivity of data that it + * contains. + * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires + * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + * permission on the [Task][google.cloud.tasks.v2.Task] resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2.Task] will be returned. + * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; + * not all information is retrieved by default because some data, such as + * payloads, might be desirable to return only when needed because + * of its large size or because of the sensitivity of data that it + * contains. + * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires + * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + * permission on the [Task][google.cloud.tasks.v2.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2.Task.View response_view = 2; + * @return int + */ + public function getResponseView() + { + return $this->response_view; + } + + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2.Task] will be returned. + * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; + * not all information is retrieved by default because some data, such as + * payloads, might be desirable to return only when needed because + * of its large size or because of the sensitivity of data that it + * contains. + * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires + * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + * permission on the [Task][google.cloud.tasks.v2.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2.Task.View response_view = 2; + * @param int $var + * @return $this + */ + public function setResponseView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2\Task\View::class); + $this->response_view = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/StackdriverLoggingConfig.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/StackdriverLoggingConfig.php new file mode 100644 index 000000000000..67e03f8a8ae6 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/StackdriverLoggingConfig.php @@ -0,0 +1,80 @@ +google.cloud.tasks.v2.StackdriverLoggingConfig + */ +class StackdriverLoggingConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies the fraction of operations to write to + * [Stackdriver Logging](https://cloud.google.com/logging/docs/). + * This field may contain any value between 0.0 and 1.0, inclusive. + * 0.0 is the default and means that no operations are logged. + * + * Generated from protobuf field double sampling_ratio = 1; + */ + protected $sampling_ratio = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $sampling_ratio + * Specifies the fraction of operations to write to + * [Stackdriver Logging](https://cloud.google.com/logging/docs/). + * This field may contain any value between 0.0 and 1.0, inclusive. + * 0.0 is the default and means that no operations are logged. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2\Queue::initOnce(); + parent::__construct($data); + } + + /** + * Specifies the fraction of operations to write to + * [Stackdriver Logging](https://cloud.google.com/logging/docs/). + * This field may contain any value between 0.0 and 1.0, inclusive. + * 0.0 is the default and means that no operations are logged. + * + * Generated from protobuf field double sampling_ratio = 1; + * @return float + */ + public function getSamplingRatio() + { + return $this->sampling_ratio; + } + + /** + * Specifies the fraction of operations to write to + * [Stackdriver Logging](https://cloud.google.com/logging/docs/). + * This field may contain any value between 0.0 and 1.0, inclusive. + * 0.0 is the default and means that no operations are logged. + * + * Generated from protobuf field double sampling_ratio = 1; + * @param float $var + * @return $this + */ + public function setSamplingRatio($var) + { + GPBUtil::checkDouble($var); + $this->sampling_ratio = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Task.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Task.php new file mode 100644 index 000000000000..6606b429e387 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Task.php @@ -0,0 +1,684 @@ +google.cloud.tasks.v2.Task + */ +class Task extends \Google\Protobuf\Internal\Message +{ + /** + * Optionally caller-specified in + * [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask]. + * The task name. + * The task name must have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), + * hyphens (-), colons (:), or periods (.). + * For more information, see + * [Identifying + * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) + * * `LOCATION_ID` is the canonical ID for the task's location. + * The list of available locations can be obtained by calling + * [ListLocations][google.cloud.location.Locations.ListLocations]. + * For more information, see https://cloud.google.com/about/locations/. + * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or + * hyphens (-). The maximum length is 100 characters. + * * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), + * hyphens (-), or underscores (_). The maximum length is 500 characters. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The time when the task is scheduled to be attempted or retried. + * `schedule_time` will be truncated to the nearest microsecond. + * + * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 4; + */ + protected $schedule_time = null; + /** + * Output only. The time that the task was created. + * `create_time` will be truncated to the nearest second. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; + */ + protected $create_time = null; + /** + * The deadline for requests sent to the worker. If the worker does not + * respond by this deadline then the request is cancelled and the attempt + * is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the + * task according to the [RetryConfig][google.cloud.tasks.v2.RetryConfig]. + * Note that when the request is cancelled, Cloud Tasks will stop listening + * for the response, but whether the worker stops processing depends on the + * worker. For example, if the worker is stuck, it may not react to cancelled + * requests. + * The default and maximum values depend on the type of request: + * * For [HTTP tasks][google.cloud.tasks.v2.HttpRequest], the default is 10 + * minutes. The deadline + * must be in the interval [15 seconds, 30 minutes]. + * * For [App Engine tasks][google.cloud.tasks.v2.AppEngineHttpRequest], 0 + * indicates that the + * request has the default deadline. The default deadline depends on the + * [scaling + * type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling) + * of the service: 10 minutes for standard apps with automatic scaling, 24 + * hours for standard apps with manual and basic scaling, and 60 minutes for + * flex apps. If the request deadline is set, it must be in the interval [15 + * seconds, 24 hours 15 seconds]. Regardless of the task's + * `dispatch_deadline`, the app handler will not run for longer than than + * the service's timeout. We recommend setting the `dispatch_deadline` to + * at most a few seconds more than the app handler's timeout. For more + * information see + * [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts). + * `dispatch_deadline` will be truncated to the nearest millisecond. The + * deadline is an approximate deadline. + * + * Generated from protobuf field .google.protobuf.Duration dispatch_deadline = 6; + */ + protected $dispatch_deadline = null; + /** + * Output only. The number of attempts dispatched. + * This count includes attempts which have been dispatched but haven't + * received a response. + * + * Generated from protobuf field int32 dispatch_count = 7; + */ + protected $dispatch_count = 0; + /** + * Output only. The number of attempts which have received a response. + * + * Generated from protobuf field int32 response_count = 8; + */ + protected $response_count = 0; + /** + * Output only. The status of the task's first attempt. + * Only [dispatch_time][google.cloud.tasks.v2.Attempt.dispatch_time] will be + * set. The other [Attempt][google.cloud.tasks.v2.Attempt] information is not + * retained by Cloud Tasks. + * + * Generated from protobuf field .google.cloud.tasks.v2.Attempt first_attempt = 9; + */ + protected $first_attempt = null; + /** + * Output only. The status of the task's last attempt. + * + * Generated from protobuf field .google.cloud.tasks.v2.Attempt last_attempt = 10; + */ + protected $last_attempt = null; + /** + * Output only. The view specifies which subset of the + * [Task][google.cloud.tasks.v2.Task] has been returned. + * + * Generated from protobuf field .google.cloud.tasks.v2.Task.View view = 11; + */ + protected $view = 0; + protected $message_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Optionally caller-specified in + * [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask]. + * The task name. + * The task name must have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), + * hyphens (-), colons (:), or periods (.). + * For more information, see + * [Identifying + * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) + * * `LOCATION_ID` is the canonical ID for the task's location. + * The list of available locations can be obtained by calling + * [ListLocations][google.cloud.location.Locations.ListLocations]. + * For more information, see https://cloud.google.com/about/locations/. + * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or + * hyphens (-). The maximum length is 100 characters. + * * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), + * hyphens (-), or underscores (_). The maximum length is 500 characters. + * @type \Google\Cloud\Tasks\V2\AppEngineHttpRequest $app_engine_http_request + * HTTP request that is sent to the App Engine app handler. + * An App Engine task is a task that has + * [AppEngineHttpRequest][google.cloud.tasks.v2.AppEngineHttpRequest] set. + * @type \Google\Cloud\Tasks\V2\HttpRequest $http_request + * HTTP request that is sent to the worker. + * An HTTP task is a task that has + * [HttpRequest][google.cloud.tasks.v2.HttpRequest] set. + * @type \Google\Protobuf\Timestamp $schedule_time + * The time when the task is scheduled to be attempted or retried. + * `schedule_time` will be truncated to the nearest microsecond. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time that the task was created. + * `create_time` will be truncated to the nearest second. + * @type \Google\Protobuf\Duration $dispatch_deadline + * The deadline for requests sent to the worker. If the worker does not + * respond by this deadline then the request is cancelled and the attempt + * is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the + * task according to the [RetryConfig][google.cloud.tasks.v2.RetryConfig]. + * Note that when the request is cancelled, Cloud Tasks will stop listening + * for the response, but whether the worker stops processing depends on the + * worker. For example, if the worker is stuck, it may not react to cancelled + * requests. + * The default and maximum values depend on the type of request: + * * For [HTTP tasks][google.cloud.tasks.v2.HttpRequest], the default is 10 + * minutes. The deadline + * must be in the interval [15 seconds, 30 minutes]. + * * For [App Engine tasks][google.cloud.tasks.v2.AppEngineHttpRequest], 0 + * indicates that the + * request has the default deadline. The default deadline depends on the + * [scaling + * type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling) + * of the service: 10 minutes for standard apps with automatic scaling, 24 + * hours for standard apps with manual and basic scaling, and 60 minutes for + * flex apps. If the request deadline is set, it must be in the interval [15 + * seconds, 24 hours 15 seconds]. Regardless of the task's + * `dispatch_deadline`, the app handler will not run for longer than than + * the service's timeout. We recommend setting the `dispatch_deadline` to + * at most a few seconds more than the app handler's timeout. For more + * information see + * [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts). + * `dispatch_deadline` will be truncated to the nearest millisecond. The + * deadline is an approximate deadline. + * @type int $dispatch_count + * Output only. The number of attempts dispatched. + * This count includes attempts which have been dispatched but haven't + * received a response. + * @type int $response_count + * Output only. The number of attempts which have received a response. + * @type \Google\Cloud\Tasks\V2\Attempt $first_attempt + * Output only. The status of the task's first attempt. + * Only [dispatch_time][google.cloud.tasks.v2.Attempt.dispatch_time] will be + * set. The other [Attempt][google.cloud.tasks.v2.Attempt] information is not + * retained by Cloud Tasks. + * @type \Google\Cloud\Tasks\V2\Attempt $last_attempt + * Output only. The status of the task's last attempt. + * @type int $view + * Output only. The view specifies which subset of the + * [Task][google.cloud.tasks.v2.Task] has been returned. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2\Task::initOnce(); + parent::__construct($data); + } + + /** + * Optionally caller-specified in + * [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask]. + * The task name. + * The task name must have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), + * hyphens (-), colons (:), or periods (.). + * For more information, see + * [Identifying + * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) + * * `LOCATION_ID` is the canonical ID for the task's location. + * The list of available locations can be obtained by calling + * [ListLocations][google.cloud.location.Locations.ListLocations]. + * For more information, see https://cloud.google.com/about/locations/. + * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or + * hyphens (-). The maximum length is 100 characters. + * * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), + * hyphens (-), or underscores (_). The maximum length is 500 characters. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Optionally caller-specified in + * [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask]. + * The task name. + * The task name must have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), + * hyphens (-), colons (:), or periods (.). + * For more information, see + * [Identifying + * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) + * * `LOCATION_ID` is the canonical ID for the task's location. + * The list of available locations can be obtained by calling + * [ListLocations][google.cloud.location.Locations.ListLocations]. + * For more information, see https://cloud.google.com/about/locations/. + * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or + * hyphens (-). The maximum length is 100 characters. + * * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), + * hyphens (-), or underscores (_). The maximum length is 500 characters. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * HTTP request that is sent to the App Engine app handler. + * An App Engine task is a task that has + * [AppEngineHttpRequest][google.cloud.tasks.v2.AppEngineHttpRequest] set. + * + * Generated from protobuf field .google.cloud.tasks.v2.AppEngineHttpRequest app_engine_http_request = 2; + * @return \Google\Cloud\Tasks\V2\AppEngineHttpRequest|null + */ + public function getAppEngineHttpRequest() + { + return $this->readOneof(2); + } + + public function hasAppEngineHttpRequest() + { + return $this->hasOneof(2); + } + + /** + * HTTP request that is sent to the App Engine app handler. + * An App Engine task is a task that has + * [AppEngineHttpRequest][google.cloud.tasks.v2.AppEngineHttpRequest] set. + * + * Generated from protobuf field .google.cloud.tasks.v2.AppEngineHttpRequest app_engine_http_request = 2; + * @param \Google\Cloud\Tasks\V2\AppEngineHttpRequest $var + * @return $this + */ + public function setAppEngineHttpRequest($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2\AppEngineHttpRequest::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * HTTP request that is sent to the worker. + * An HTTP task is a task that has + * [HttpRequest][google.cloud.tasks.v2.HttpRequest] set. + * + * Generated from protobuf field .google.cloud.tasks.v2.HttpRequest http_request = 3; + * @return \Google\Cloud\Tasks\V2\HttpRequest|null + */ + public function getHttpRequest() + { + return $this->readOneof(3); + } + + public function hasHttpRequest() + { + return $this->hasOneof(3); + } + + /** + * HTTP request that is sent to the worker. + * An HTTP task is a task that has + * [HttpRequest][google.cloud.tasks.v2.HttpRequest] set. + * + * Generated from protobuf field .google.cloud.tasks.v2.HttpRequest http_request = 3; + * @param \Google\Cloud\Tasks\V2\HttpRequest $var + * @return $this + */ + public function setHttpRequest($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2\HttpRequest::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * The time when the task is scheduled to be attempted or retried. + * `schedule_time` will be truncated to the nearest microsecond. + * + * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getScheduleTime() + { + return $this->schedule_time; + } + + public function hasScheduleTime() + { + return isset($this->schedule_time); + } + + public function clearScheduleTime() + { + unset($this->schedule_time); + } + + /** + * The time when the task is scheduled to be attempted or retried. + * `schedule_time` will be truncated to the nearest microsecond. + * + * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setScheduleTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->schedule_time = $var; + + return $this; + } + + /** + * Output only. The time that the task was created. + * `create_time` will be truncated to the nearest second. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time that the task was created. + * `create_time` will be truncated to the nearest second. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * The deadline for requests sent to the worker. If the worker does not + * respond by this deadline then the request is cancelled and the attempt + * is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the + * task according to the [RetryConfig][google.cloud.tasks.v2.RetryConfig]. + * Note that when the request is cancelled, Cloud Tasks will stop listening + * for the response, but whether the worker stops processing depends on the + * worker. For example, if the worker is stuck, it may not react to cancelled + * requests. + * The default and maximum values depend on the type of request: + * * For [HTTP tasks][google.cloud.tasks.v2.HttpRequest], the default is 10 + * minutes. The deadline + * must be in the interval [15 seconds, 30 minutes]. + * * For [App Engine tasks][google.cloud.tasks.v2.AppEngineHttpRequest], 0 + * indicates that the + * request has the default deadline. The default deadline depends on the + * [scaling + * type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling) + * of the service: 10 minutes for standard apps with automatic scaling, 24 + * hours for standard apps with manual and basic scaling, and 60 minutes for + * flex apps. If the request deadline is set, it must be in the interval [15 + * seconds, 24 hours 15 seconds]. Regardless of the task's + * `dispatch_deadline`, the app handler will not run for longer than than + * the service's timeout. We recommend setting the `dispatch_deadline` to + * at most a few seconds more than the app handler's timeout. For more + * information see + * [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts). + * `dispatch_deadline` will be truncated to the nearest millisecond. The + * deadline is an approximate deadline. + * + * Generated from protobuf field .google.protobuf.Duration dispatch_deadline = 6; + * @return \Google\Protobuf\Duration|null + */ + public function getDispatchDeadline() + { + return $this->dispatch_deadline; + } + + public function hasDispatchDeadline() + { + return isset($this->dispatch_deadline); + } + + public function clearDispatchDeadline() + { + unset($this->dispatch_deadline); + } + + /** + * The deadline for requests sent to the worker. If the worker does not + * respond by this deadline then the request is cancelled and the attempt + * is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the + * task according to the [RetryConfig][google.cloud.tasks.v2.RetryConfig]. + * Note that when the request is cancelled, Cloud Tasks will stop listening + * for the response, but whether the worker stops processing depends on the + * worker. For example, if the worker is stuck, it may not react to cancelled + * requests. + * The default and maximum values depend on the type of request: + * * For [HTTP tasks][google.cloud.tasks.v2.HttpRequest], the default is 10 + * minutes. The deadline + * must be in the interval [15 seconds, 30 minutes]. + * * For [App Engine tasks][google.cloud.tasks.v2.AppEngineHttpRequest], 0 + * indicates that the + * request has the default deadline. The default deadline depends on the + * [scaling + * type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling) + * of the service: 10 minutes for standard apps with automatic scaling, 24 + * hours for standard apps with manual and basic scaling, and 60 minutes for + * flex apps. If the request deadline is set, it must be in the interval [15 + * seconds, 24 hours 15 seconds]. Regardless of the task's + * `dispatch_deadline`, the app handler will not run for longer than than + * the service's timeout. We recommend setting the `dispatch_deadline` to + * at most a few seconds more than the app handler's timeout. For more + * information see + * [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts). + * `dispatch_deadline` will be truncated to the nearest millisecond. The + * deadline is an approximate deadline. + * + * Generated from protobuf field .google.protobuf.Duration dispatch_deadline = 6; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setDispatchDeadline($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->dispatch_deadline = $var; + + return $this; + } + + /** + * Output only. The number of attempts dispatched. + * This count includes attempts which have been dispatched but haven't + * received a response. + * + * Generated from protobuf field int32 dispatch_count = 7; + * @return int + */ + public function getDispatchCount() + { + return $this->dispatch_count; + } + + /** + * Output only. The number of attempts dispatched. + * This count includes attempts which have been dispatched but haven't + * received a response. + * + * Generated from protobuf field int32 dispatch_count = 7; + * @param int $var + * @return $this + */ + public function setDispatchCount($var) + { + GPBUtil::checkInt32($var); + $this->dispatch_count = $var; + + return $this; + } + + /** + * Output only. The number of attempts which have received a response. + * + * Generated from protobuf field int32 response_count = 8; + * @return int + */ + public function getResponseCount() + { + return $this->response_count; + } + + /** + * Output only. The number of attempts which have received a response. + * + * Generated from protobuf field int32 response_count = 8; + * @param int $var + * @return $this + */ + public function setResponseCount($var) + { + GPBUtil::checkInt32($var); + $this->response_count = $var; + + return $this; + } + + /** + * Output only. The status of the task's first attempt. + * Only [dispatch_time][google.cloud.tasks.v2.Attempt.dispatch_time] will be + * set. The other [Attempt][google.cloud.tasks.v2.Attempt] information is not + * retained by Cloud Tasks. + * + * Generated from protobuf field .google.cloud.tasks.v2.Attempt first_attempt = 9; + * @return \Google\Cloud\Tasks\V2\Attempt|null + */ + public function getFirstAttempt() + { + return $this->first_attempt; + } + + public function hasFirstAttempt() + { + return isset($this->first_attempt); + } + + public function clearFirstAttempt() + { + unset($this->first_attempt); + } + + /** + * Output only. The status of the task's first attempt. + * Only [dispatch_time][google.cloud.tasks.v2.Attempt.dispatch_time] will be + * set. The other [Attempt][google.cloud.tasks.v2.Attempt] information is not + * retained by Cloud Tasks. + * + * Generated from protobuf field .google.cloud.tasks.v2.Attempt first_attempt = 9; + * @param \Google\Cloud\Tasks\V2\Attempt $var + * @return $this + */ + public function setFirstAttempt($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2\Attempt::class); + $this->first_attempt = $var; + + return $this; + } + + /** + * Output only. The status of the task's last attempt. + * + * Generated from protobuf field .google.cloud.tasks.v2.Attempt last_attempt = 10; + * @return \Google\Cloud\Tasks\V2\Attempt|null + */ + public function getLastAttempt() + { + return $this->last_attempt; + } + + public function hasLastAttempt() + { + return isset($this->last_attempt); + } + + public function clearLastAttempt() + { + unset($this->last_attempt); + } + + /** + * Output only. The status of the task's last attempt. + * + * Generated from protobuf field .google.cloud.tasks.v2.Attempt last_attempt = 10; + * @param \Google\Cloud\Tasks\V2\Attempt $var + * @return $this + */ + public function setLastAttempt($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2\Attempt::class); + $this->last_attempt = $var; + + return $this; + } + + /** + * Output only. The view specifies which subset of the + * [Task][google.cloud.tasks.v2.Task] has been returned. + * + * Generated from protobuf field .google.cloud.tasks.v2.Task.View view = 11; + * @return int + */ + public function getView() + { + return $this->view; + } + + /** + * Output only. The view specifies which subset of the + * [Task][google.cloud.tasks.v2.Task] has been returned. + * + * Generated from protobuf field .google.cloud.tasks.v2.Task.View view = 11; + * @param int $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2\Task\View::class); + $this->view = $var; + + return $this; + } + + /** + * @return string + */ + public function getMessageType() + { + return $this->whichOneof("message_type"); + } + +} + diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Task/View.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Task/View.php new file mode 100644 index 000000000000..14abd3e680ee --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Task/View.php @@ -0,0 +1,79 @@ +google.cloud.tasks.v2.Task.View + */ +class View +{ + /** + * Unspecified. Defaults to BASIC. + * + * Generated from protobuf enum VIEW_UNSPECIFIED = 0; + */ + const VIEW_UNSPECIFIED = 0; + /** + * The basic view omits fields which can be large or can contain + * sensitive data. + * This view does not include the + * [body in + * AppEngineHttpRequest][google.cloud.tasks.v2.AppEngineHttpRequest.body]. + * Bodies are desirable to return only when needed, because they + * can be large and because of the sensitivity of the data that you + * choose to store in it. + * + * Generated from protobuf enum BASIC = 1; + */ + const BASIC = 1; + /** + * All information is returned. + * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires + * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + * permission on the [Queue][google.cloud.tasks.v2.Queue] resource. + * + * Generated from protobuf enum FULL = 2; + */ + const FULL = 2; + + private static $valueToName = [ + self::VIEW_UNSPECIFIED => 'VIEW_UNSPECIFIED', + self::BASIC => 'BASIC', + self::FULL => 'FULL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(View::class, \Google\Cloud\Tasks\V2\Task_View::class); + diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/UpdateQueueRequest.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/UpdateQueueRequest.php new file mode 100644 index 000000000000..7a609a96f605 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/UpdateQueueRequest.php @@ -0,0 +1,165 @@ +google.cloud.tasks.v2.UpdateQueueRequest + */ +class UpdateQueueRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The queue to create or update. + * The queue's [name][google.cloud.tasks.v2.Queue.name] must be specified. + * Output only fields cannot be modified using UpdateQueue. + * Any value specified for an output only field will be ignored. + * The queue's [name][google.cloud.tasks.v2.Queue.name] cannot be changed. + * + * Generated from protobuf field .google.cloud.tasks.v2.Queue queue = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $queue = null; + /** + * A mask used to specify which fields of the queue are being updated. + * If empty, then all fields will be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Tasks\V2\Queue $queue Required. The queue to create or update. + * + * The queue's [name][google.cloud.tasks.v2.Queue.name] must be specified. + * + * Output only fields cannot be modified using UpdateQueue. + * Any value specified for an output only field will be ignored. + * The queue's [name][google.cloud.tasks.v2.Queue.name] cannot be changed. + * @param \Google\Protobuf\FieldMask $updateMask A mask used to specify which fields of the queue are being updated. + * + * If empty, then all fields will be updated. + * + * @return \Google\Cloud\Tasks\V2\UpdateQueueRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Tasks\V2\Queue $queue, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setQueue($queue) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Tasks\V2\Queue $queue + * Required. The queue to create or update. + * The queue's [name][google.cloud.tasks.v2.Queue.name] must be specified. + * Output only fields cannot be modified using UpdateQueue. + * Any value specified for an output only field will be ignored. + * The queue's [name][google.cloud.tasks.v2.Queue.name] cannot be changed. + * @type \Google\Protobuf\FieldMask $update_mask + * A mask used to specify which fields of the queue are being updated. + * If empty, then all fields will be updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * Required. The queue to create or update. + * The queue's [name][google.cloud.tasks.v2.Queue.name] must be specified. + * Output only fields cannot be modified using UpdateQueue. + * Any value specified for an output only field will be ignored. + * The queue's [name][google.cloud.tasks.v2.Queue.name] cannot be changed. + * + * Generated from protobuf field .google.cloud.tasks.v2.Queue queue = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Tasks\V2\Queue|null + */ + public function getQueue() + { + return $this->queue; + } + + public function hasQueue() + { + return isset($this->queue); + } + + public function clearQueue() + { + unset($this->queue); + } + + /** + * Required. The queue to create or update. + * The queue's [name][google.cloud.tasks.v2.Queue.name] must be specified. + * Output only fields cannot be modified using UpdateQueue. + * Any value specified for an output only field will be ignored. + * The queue's [name][google.cloud.tasks.v2.Queue.name] cannot be changed. + * + * Generated from protobuf field .google.cloud.tasks.v2.Queue queue = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Tasks\V2\Queue $var + * @return $this + */ + public function setQueue($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2\Queue::class); + $this->queue = $var; + + return $this; + } + + /** + * A mask used to specify which fields of the queue are being updated. + * If empty, then all fields will be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * A mask used to specify which fields of the queue are being updated. + * If empty, then all fields will be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/create_queue.php b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/create_queue.php new file mode 100644 index 000000000000..80a4a56b620e --- /dev/null +++ b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/create_queue.php @@ -0,0 +1,89 @@ +setParent($formattedParent) + ->setQueue($queue); + + // Call the API and handle any network failures. + try { + /** @var Queue $response */ + $response = $cloudTasksClient->createQueue($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = CloudTasksClient::locationName('[PROJECT]', '[LOCATION]'); + + create_queue_sample($formattedParent); +} +// [END cloudtasks_v2_generated_CloudTasks_CreateQueue_sync] diff --git a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/create_task.php b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/create_task.php new file mode 100644 index 000000000000..aa2e0fce0bdb --- /dev/null +++ b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/create_task.php @@ -0,0 +1,80 @@ +setParent($formattedParent) + ->setTask($task); + + // Call the API and handle any network failures. + try { + /** @var Task $response */ + $response = $cloudTasksClient->createTask($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = CloudTasksClient::queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + + create_task_sample($formattedParent); +} +// [END cloudtasks_v2_generated_CloudTasks_CreateTask_sync] diff --git a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/delete_queue.php b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/delete_queue.php new file mode 100644 index 000000000000..74fe50d44f70 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/delete_queue.php @@ -0,0 +1,82 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $cloudTasksClient->deleteQueue($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudTasksClient::queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + + delete_queue_sample($formattedName); +} +// [END cloudtasks_v2_generated_CloudTasks_DeleteQueue_sync] diff --git a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/delete_task.php b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/delete_task.php new file mode 100644 index 000000000000..b61653507f6b --- /dev/null +++ b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/delete_task.php @@ -0,0 +1,74 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $cloudTasksClient->deleteTask($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudTasksClient::taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + + delete_task_sample($formattedName); +} +// [END cloudtasks_v2_generated_CloudTasks_DeleteTask_sync] diff --git a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/get_iam_policy.php b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/get_iam_policy.php new file mode 100644 index 000000000000..4dc02aa93c2a --- /dev/null +++ b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/get_iam_policy.php @@ -0,0 +1,79 @@ +setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $cloudTasksClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + get_iam_policy_sample($resource); +} +// [END cloudtasks_v2_generated_CloudTasks_GetIamPolicy_sync] diff --git a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/get_location.php b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/get_location.php new file mode 100644 index 000000000000..195480970c8c --- /dev/null +++ b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END cloudtasks_v2_generated_CloudTasks_GetLocation_sync] diff --git a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/get_queue.php b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/get_queue.php new file mode 100644 index 000000000000..4d61129ad1a5 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/get_queue.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Queue $response */ + $response = $cloudTasksClient->getQueue($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudTasksClient::queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + + get_queue_sample($formattedName); +} +// [END cloudtasks_v2_generated_CloudTasks_GetQueue_sync] diff --git a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/get_task.php b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/get_task.php new file mode 100644 index 000000000000..da3d8cf9ba56 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/get_task.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Task $response */ + $response = $cloudTasksClient->getTask($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudTasksClient::taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + + get_task_sample($formattedName); +} +// [END cloudtasks_v2_generated_CloudTasks_GetTask_sync] diff --git a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/list_locations.php b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/list_locations.php new file mode 100644 index 000000000000..469efba56cde --- /dev/null +++ b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END cloudtasks_v2_generated_CloudTasks_ListLocations_sync] diff --git a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/list_queues.php b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/list_queues.php new file mode 100644 index 000000000000..c542b08e9048 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/list_queues.php @@ -0,0 +1,79 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $cloudTasksClient->listQueues($request); + + /** @var Queue $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = CloudTasksClient::locationName('[PROJECT]', '[LOCATION]'); + + list_queues_sample($formattedParent); +} +// [END cloudtasks_v2_generated_CloudTasks_ListQueues_sync] diff --git a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/list_tasks.php b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/list_tasks.php new file mode 100644 index 000000000000..860cd25ca38a --- /dev/null +++ b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/list_tasks.php @@ -0,0 +1,85 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $cloudTasksClient->listTasks($request); + + /** @var Task $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = CloudTasksClient::queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + + list_tasks_sample($formattedParent); +} +// [END cloudtasks_v2_generated_CloudTasks_ListTasks_sync] diff --git a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/pause_queue.php b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/pause_queue.php new file mode 100644 index 000000000000..e83e2a958bd3 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/pause_queue.php @@ -0,0 +1,79 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Queue $response */ + $response = $cloudTasksClient->pauseQueue($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudTasksClient::queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + + pause_queue_sample($formattedName); +} +// [END cloudtasks_v2_generated_CloudTasks_PauseQueue_sync] diff --git a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/purge_queue.php b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/purge_queue.php new file mode 100644 index 000000000000..592b7e9758d8 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/purge_queue.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Queue $response */ + $response = $cloudTasksClient->purgeQueue($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudTasksClient::queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + + purge_queue_sample($formattedName); +} +// [END cloudtasks_v2_generated_CloudTasks_PurgeQueue_sync] diff --git a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/resume_queue.php b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/resume_queue.php new file mode 100644 index 000000000000..17f2fa3b1e61 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/resume_queue.php @@ -0,0 +1,85 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Queue $response */ + $response = $cloudTasksClient->resumeQueue($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudTasksClient::queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + + resume_queue_sample($formattedName); +} +// [END cloudtasks_v2_generated_CloudTasks_ResumeQueue_sync] diff --git a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/run_task.php b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/run_task.php new file mode 100644 index 000000000000..59e8bfc56383 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/run_task.php @@ -0,0 +1,97 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Task $response */ + $response = $cloudTasksClient->runTask($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudTasksClient::taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + + run_task_sample($formattedName); +} +// [END cloudtasks_v2_generated_CloudTasks_RunTask_sync] diff --git a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/set_iam_policy.php b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/set_iam_policy.php new file mode 100644 index 000000000000..dcc4a9703774 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/set_iam_policy.php @@ -0,0 +1,83 @@ +setResource($resource) + ->setPolicy($policy); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $cloudTasksClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + set_iam_policy_sample($resource); +} +// [END cloudtasks_v2_generated_CloudTasks_SetIamPolicy_sync] diff --git a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/test_iam_permissions.php b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/test_iam_permissions.php new file mode 100644 index 000000000000..9f07c46f31ae --- /dev/null +++ b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/test_iam_permissions.php @@ -0,0 +1,85 @@ +setResource($resource) + ->setPermissions($permissions); + + // Call the API and handle any network failures. + try { + /** @var TestIamPermissionsResponse $response */ + $response = $cloudTasksClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + $permissionsElement = '[PERMISSIONS]'; + + test_iam_permissions_sample($resource, $permissionsElement); +} +// [END cloudtasks_v2_generated_CloudTasks_TestIamPermissions_sync] diff --git a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/update_queue.php b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/update_queue.php new file mode 100644 index 000000000000..0fb29ecda689 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/update_queue.php @@ -0,0 +1,73 @@ +setQueue($queue); + + // Call the API and handle any network failures. + try { + /** @var Queue $response */ + $response = $cloudTasksClient->updateQueue($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END cloudtasks_v2_generated_CloudTasks_UpdateQueue_sync] diff --git a/owl-bot-staging/Tasks/v2/src/V2/Client/CloudTasksClient.php b/owl-bot-staging/Tasks/v2/src/V2/Client/CloudTasksClient.php new file mode 100644 index 000000000000..33e5b6ace4d6 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/src/V2/Client/CloudTasksClient.php @@ -0,0 +1,887 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/cloud_tasks_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/cloud_tasks_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/cloud_tasks_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/cloud_tasks_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a queue + * resource. + * + * @param string $project + * @param string $location + * @param string $queue + * + * @return string The formatted queue resource. + */ + public static function queueName(string $project, string $location, string $queue): string + { + return self::getPathTemplate('queue')->render([ + 'project' => $project, + 'location' => $location, + 'queue' => $queue, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a task + * resource. + * + * @param string $project + * @param string $location + * @param string $queue + * @param string $task + * + * @return string The formatted task resource. + */ + public static function taskName(string $project, string $location, string $queue, string $task): string + { + return self::getPathTemplate('task')->render([ + 'project' => $project, + 'location' => $location, + 'queue' => $queue, + 'task' => $task, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - location: projects/{project}/locations/{location} + * - queue: projects/{project}/locations/{location}/queues/{queue} + * - task: projects/{project}/locations/{location}/queues/{queue}/tasks/{task} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'cloudtasks.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a queue. + * + * Queues created with this method allow tasks to live for a maximum of 31 + * days. After a task is 31 days old, the task will be deleted regardless of + * whether it was dispatched or not. + * + * WARNING: Using this method may have unintended side effects if you are + * using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + * Read + * [Overview of Queue Management and + * queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using + * this method. + * + * The async variant is {@see CloudTasksClient::createQueueAsync()} . + * + * @example samples/V2/CloudTasksClient/create_queue.php + * + * @param CreateQueueRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Queue + * + * @throws ApiException Thrown if the API call fails. + */ + public function createQueue(CreateQueueRequest $request, array $callOptions = []): Queue + { + return $this->startApiCall('CreateQueue', $request, $callOptions)->wait(); + } + + /** + * Creates a task and adds it to a queue. + * + * Tasks cannot be updated after creation; there is no UpdateTask command. + * + * * The maximum task size is 100KB. + * + * The async variant is {@see CloudTasksClient::createTaskAsync()} . + * + * @example samples/V2/CloudTasksClient/create_task.php + * + * @param CreateTaskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Task + * + * @throws ApiException Thrown if the API call fails. + */ + public function createTask(CreateTaskRequest $request, array $callOptions = []): Task + { + return $this->startApiCall('CreateTask', $request, $callOptions)->wait(); + } + + /** + * Deletes a queue. + * + * This command will delete the queue even if it has tasks in it. + * + * Note: If you delete a queue, a queue with the same name can't be created + * for 7 days. + * + * WARNING: Using this method may have unintended side effects if you are + * using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + * Read + * [Overview of Queue Management and + * queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using + * this method. + * + * The async variant is {@see CloudTasksClient::deleteQueueAsync()} . + * + * @example samples/V2/CloudTasksClient/delete_queue.php + * + * @param DeleteQueueRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteQueue(DeleteQueueRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteQueue', $request, $callOptions)->wait(); + } + + /** + * Deletes a task. + * + * A task can be deleted if it is scheduled or dispatched. A task + * cannot be deleted if it has executed successfully or permanently + * failed. + * + * The async variant is {@see CloudTasksClient::deleteTaskAsync()} . + * + * @example samples/V2/CloudTasksClient/delete_task.php + * + * @param DeleteTaskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteTask(DeleteTaskRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteTask', $request, $callOptions)->wait(); + } + + /** + * Gets the access control policy for a [Queue][google.cloud.tasks.v2.Queue]. + * Returns an empty policy if the resource exists and does not have a policy + * set. + * + * Authorization requires the following + * [Google IAM](https://cloud.google.com/iam) permission on the specified + * resource parent: + * + * * `cloudtasks.queues.getIamPolicy` + * + * The async variant is {@see CloudTasksClient::getIamPolicyAsync()} . + * + * @example samples/V2/CloudTasksClient/get_iam_policy.php + * + * @param GetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Gets a queue. + * + * The async variant is {@see CloudTasksClient::getQueueAsync()} . + * + * @example samples/V2/CloudTasksClient/get_queue.php + * + * @param GetQueueRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Queue + * + * @throws ApiException Thrown if the API call fails. + */ + public function getQueue(GetQueueRequest $request, array $callOptions = []): Queue + { + return $this->startApiCall('GetQueue', $request, $callOptions)->wait(); + } + + /** + * Gets a task. + * + * The async variant is {@see CloudTasksClient::getTaskAsync()} . + * + * @example samples/V2/CloudTasksClient/get_task.php + * + * @param GetTaskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Task + * + * @throws ApiException Thrown if the API call fails. + */ + public function getTask(GetTaskRequest $request, array $callOptions = []): Task + { + return $this->startApiCall('GetTask', $request, $callOptions)->wait(); + } + + /** + * Lists queues. + * + * Queues are returned in lexicographical order. + * + * The async variant is {@see CloudTasksClient::listQueuesAsync()} . + * + * @example samples/V2/CloudTasksClient/list_queues.php + * + * @param ListQueuesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listQueues(ListQueuesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListQueues', $request, $callOptions); + } + + /** + * Lists the tasks in a queue. + * + * By default, only the [BASIC][google.cloud.tasks.v2.Task.View.BASIC] view is + * retrieved due to performance considerations; + * [response_view][google.cloud.tasks.v2.ListTasksRequest.response_view] + * controls the subset of information which is returned. + * + * The tasks may be returned in any order. The ordering may change at any + * time. + * + * The async variant is {@see CloudTasksClient::listTasksAsync()} . + * + * @example samples/V2/CloudTasksClient/list_tasks.php + * + * @param ListTasksRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listTasks(ListTasksRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListTasks', $request, $callOptions); + } + + /** + * Pauses the queue. + * + * If a queue is paused then the system will stop dispatching tasks + * until the queue is resumed via + * [ResumeQueue][google.cloud.tasks.v2.CloudTasks.ResumeQueue]. Tasks can + * still be added when the queue is paused. A queue is paused if its + * [state][google.cloud.tasks.v2.Queue.state] is + * [PAUSED][google.cloud.tasks.v2.Queue.State.PAUSED]. + * + * The async variant is {@see CloudTasksClient::pauseQueueAsync()} . + * + * @example samples/V2/CloudTasksClient/pause_queue.php + * + * @param PauseQueueRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Queue + * + * @throws ApiException Thrown if the API call fails. + */ + public function pauseQueue(PauseQueueRequest $request, array $callOptions = []): Queue + { + return $this->startApiCall('PauseQueue', $request, $callOptions)->wait(); + } + + /** + * Purges a queue by deleting all of its tasks. + * + * All tasks created before this method is called are permanently deleted. + * + * Purge operations can take up to one minute to take effect. Tasks + * might be dispatched before the purge takes effect. A purge is irreversible. + * + * The async variant is {@see CloudTasksClient::purgeQueueAsync()} . + * + * @example samples/V2/CloudTasksClient/purge_queue.php + * + * @param PurgeQueueRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Queue + * + * @throws ApiException Thrown if the API call fails. + */ + public function purgeQueue(PurgeQueueRequest $request, array $callOptions = []): Queue + { + return $this->startApiCall('PurgeQueue', $request, $callOptions)->wait(); + } + + /** + * Resume a queue. + * + * This method resumes a queue after it has been + * [PAUSED][google.cloud.tasks.v2.Queue.State.PAUSED] or + * [DISABLED][google.cloud.tasks.v2.Queue.State.DISABLED]. The state of a + * queue is stored in the queue's [state][google.cloud.tasks.v2.Queue.state]; + * after calling this method it will be set to + * [RUNNING][google.cloud.tasks.v2.Queue.State.RUNNING]. + * + * WARNING: Resuming many high-QPS queues at the same time can + * lead to target overloading. If you are resuming high-QPS + * queues, follow the 500/50/5 pattern described in + * [Managing Cloud Tasks Scaling + * Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling). + * + * The async variant is {@see CloudTasksClient::resumeQueueAsync()} . + * + * @example samples/V2/CloudTasksClient/resume_queue.php + * + * @param ResumeQueueRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Queue + * + * @throws ApiException Thrown if the API call fails. + */ + public function resumeQueue(ResumeQueueRequest $request, array $callOptions = []): Queue + { + return $this->startApiCall('ResumeQueue', $request, $callOptions)->wait(); + } + + /** + * Forces a task to run now. + * + * When this method is called, Cloud Tasks will dispatch the task, even if + * the task is already running, the queue has reached its + * [RateLimits][google.cloud.tasks.v2.RateLimits] or is + * [PAUSED][google.cloud.tasks.v2.Queue.State.PAUSED]. + * + * This command is meant to be used for manual debugging. For + * example, [RunTask][google.cloud.tasks.v2.CloudTasks.RunTask] can be used to + * retry a failed task after a fix has been made or to manually force a task + * to be dispatched now. + * + * The dispatched task is returned. That is, the task that is returned + * contains the [status][Task.status] after the task is dispatched but + * before the task is received by its target. + * + * If Cloud Tasks receives a successful response from the task's + * target, then the task will be deleted; otherwise the task's + * [schedule_time][google.cloud.tasks.v2.Task.schedule_time] will be reset to + * the time that [RunTask][google.cloud.tasks.v2.CloudTasks.RunTask] was + * called plus the retry delay specified in the queue's + * [RetryConfig][google.cloud.tasks.v2.RetryConfig]. + * + * [RunTask][google.cloud.tasks.v2.CloudTasks.RunTask] returns + * [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a + * task that has already succeeded or permanently failed. + * + * The async variant is {@see CloudTasksClient::runTaskAsync()} . + * + * @example samples/V2/CloudTasksClient/run_task.php + * + * @param RunTaskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Task + * + * @throws ApiException Thrown if the API call fails. + */ + public function runTask(RunTaskRequest $request, array $callOptions = []): Task + { + return $this->startApiCall('RunTask', $request, $callOptions)->wait(); + } + + /** + * Sets the access control policy for a [Queue][google.cloud.tasks.v2.Queue]. + * Replaces any existing policy. + * + * Note: The Cloud Console does not check queue-level IAM permissions yet. + * Project-level permissions are required to use the Cloud Console. + * + * Authorization requires the following + * [Google IAM](https://cloud.google.com/iam) permission on the specified + * resource parent: + * + * * `cloudtasks.queues.setIamPolicy` + * + * The async variant is {@see CloudTasksClient::setIamPolicyAsync()} . + * + * @example samples/V2/CloudTasksClient/set_iam_policy.php + * + * @param SetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on a + * [Queue][google.cloud.tasks.v2.Queue]. If the resource does not exist, this + * will return an empty set of permissions, not a + * [NOT_FOUND][google.rpc.Code.NOT_FOUND] error. + * + * Note: This operation is designed to be used for building permission-aware + * UIs and command-line tools, not for authorization checking. This operation + * may "fail open" without warning. + * + * The async variant is {@see CloudTasksClient::testIamPermissionsAsync()} . + * + * @example samples/V2/CloudTasksClient/test_iam_permissions.php + * + * @param TestIamPermissionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestIamPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } + + /** + * Updates a queue. + * + * This method creates the queue if it does not exist and updates + * the queue if it does exist. + * + * Queues created with this method allow tasks to live for a maximum of 31 + * days. After a task is 31 days old, the task will be deleted regardless of + * whether it was dispatched or not. + * + * WARNING: Using this method may have unintended side effects if you are + * using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + * Read + * [Overview of Queue Management and + * queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using + * this method. + * + * The async variant is {@see CloudTasksClient::updateQueueAsync()} . + * + * @example samples/V2/CloudTasksClient/update_queue.php + * + * @param UpdateQueueRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Queue + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateQueue(UpdateQueueRequest $request, array $callOptions = []): Queue + { + return $this->startApiCall('UpdateQueue', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see CloudTasksClient::getLocationAsync()} . + * + * @example samples/V2/CloudTasksClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see CloudTasksClient::listLocationsAsync()} . + * + * @example samples/V2/CloudTasksClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Tasks/v2/src/V2/CloudTasksClient.php b/owl-bot-staging/Tasks/v2/src/V2/CloudTasksClient.php new file mode 100644 index 000000000000..e34ca4466502 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/src/V2/CloudTasksClient.php @@ -0,0 +1,34 @@ +locationName('[PROJECT]', '[LOCATION]'); + * $queue = new Queue(); + * $response = $cloudTasksClient->createQueue($formattedParent, $queue); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + * + * @deprecated Please use the new service client {@see \Google\Cloud\Tasks\V2\Client\CloudTasksClient}. + */ +class CloudTasksGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.tasks.v2.CloudTasks'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'cloudtasks.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'cloudtasks.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static $locationNameTemplate; + + private static $queueNameTemplate; + + private static $taskNameTemplate; + + private static $pathTemplateMap; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/cloud_tasks_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/cloud_tasks_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/cloud_tasks_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/cloud_tasks_rest_client_config.php', + ], + ], + ]; + } + + private static function getLocationNameTemplate() + { + if (self::$locationNameTemplate == null) { + self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); + } + + return self::$locationNameTemplate; + } + + private static function getQueueNameTemplate() + { + if (self::$queueNameTemplate == null) { + self::$queueNameTemplate = new PathTemplate('projects/{project}/locations/{location}/queues/{queue}'); + } + + return self::$queueNameTemplate; + } + + private static function getTaskNameTemplate() + { + if (self::$taskNameTemplate == null) { + self::$taskNameTemplate = new PathTemplate('projects/{project}/locations/{location}/queues/{queue}/tasks/{task}'); + } + + return self::$taskNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'location' => self::getLocationNameTemplate(), + 'queue' => self::getQueueNameTemplate(), + 'task' => self::getTaskNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName($project, $location) + { + return self::getLocationNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a queue + * resource. + * + * @param string $project + * @param string $location + * @param string $queue + * + * @return string The formatted queue resource. + */ + public static function queueName($project, $location, $queue) + { + return self::getQueueNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'queue' => $queue, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a task + * resource. + * + * @param string $project + * @param string $location + * @param string $queue + * @param string $task + * + * @return string The formatted task resource. + */ + public static function taskName($project, $location, $queue, $task) + { + return self::getTaskNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'queue' => $queue, + 'task' => $task, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - location: projects/{project}/locations/{location} + * - queue: projects/{project}/locations/{location}/queues/{queue} + * - task: projects/{project}/locations/{location}/queues/{queue}/tasks/{task} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'cloudtasks.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** + * Creates a queue. + * + * Queues created with this method allow tasks to live for a maximum of 31 + * days. After a task is 31 days old, the task will be deleted regardless of + * whether it was dispatched or not. + * + * WARNING: Using this method may have unintended side effects if you are + * using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + * Read + * [Overview of Queue Management and + * queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using + * this method. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $formattedParent = $cloudTasksClient->locationName('[PROJECT]', '[LOCATION]'); + * $queue = new Queue(); + * $response = $cloudTasksClient->createQueue($formattedParent, $queue); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $parent Required. The location name in which the queue will be created. + * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * + * The list of allowed locations can be obtained by calling Cloud + * Tasks' implementation of + * [ListLocations][google.cloud.location.Locations.ListLocations]. + * @param Queue $queue Required. The queue to create. + * + * [Queue's name][google.cloud.tasks.v2.Queue.name] cannot be the same as an + * existing queue. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Tasks\V2\Queue + * + * @throws ApiException if the remote call fails + */ + public function createQueue($parent, $queue, array $optionalArgs = []) + { + $request = new CreateQueueRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setQueue($queue); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateQueue', Queue::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a task and adds it to a queue. + * + * Tasks cannot be updated after creation; there is no UpdateTask command. + * + * * The maximum task size is 100KB. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $formattedParent = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * $task = new Task(); + * $response = $cloudTasksClient->createTask($formattedParent, $task); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $parent Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * + * The queue must already exist. + * @param Task $task Required. The task to add. + * + * Task names have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. + * The user can optionally specify a task + * [name][google.cloud.tasks.v2.Task.name]. If a name is not specified then + * the system will generate a random unique task id, which will be set in the + * task returned in the [response][google.cloud.tasks.v2.Task.name]. + * + * If [schedule_time][google.cloud.tasks.v2.Task.schedule_time] is not set or + * is in the past then Cloud Tasks will set it to the current time. + * + * Task De-duplication: + * + * Explicitly specifying a task ID enables task de-duplication. If + * a task's ID is identical to that of an existing task or a task + * that was deleted or executed recently then the call will fail + * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. + * If the task's queue was created using Cloud Tasks, then another task with + * the same name can't be created for ~1hour after the original task was + * deleted or executed. If the task's queue was created using queue.yaml or + * queue.xml, then another task with the same name can't be created + * for ~9days after the original task was deleted or executed. + * + * Because there is an extra lookup cost to identify duplicate task + * names, these [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask] + * calls have significantly increased latency. Using hashed strings for the + * task id or for the prefix of the task id is recommended. Choosing task ids + * that are sequential or have sequential prefixes, for example using a + * timestamp, causes an increase in latency and error rates in all + * task commands. The infrastructure relies on an approximately + * uniform distribution of task ids to store and serve tasks + * efficiently. + * @param array $optionalArgs { + * Optional. + * + * @type int $responseView + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2.Task] will be returned. + * + * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; + * not all information is retrieved by default because some data, such as + * payloads, might be desirable to return only when needed because + * of its large size or because of the sensitivity of data that it + * contains. + * + * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires + * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + * permission on the [Task][google.cloud.tasks.v2.Task] resource. + * For allowed values, use constants defined on {@see \Google\Cloud\Tasks\V2\Task\View} + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Tasks\V2\Task + * + * @throws ApiException if the remote call fails + */ + public function createTask($parent, $task, array $optionalArgs = []) + { + $request = new CreateTaskRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setTask($task); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['responseView'])) { + $request->setResponseView($optionalArgs['responseView']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateTask', Task::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes a queue. + * + * This command will delete the queue even if it has tasks in it. + * + * Note: If you delete a queue, a queue with the same name can't be created + * for 7 days. + * + * WARNING: Using this method may have unintended side effects if you are + * using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + * Read + * [Overview of Queue Management and + * queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using + * this method. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * $cloudTasksClient->deleteQueue($formattedName); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $name Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException if the remote call fails + */ + public function deleteQueue($name, array $optionalArgs = []) + { + $request = new DeleteQueueRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteQueue', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes a task. + * + * A task can be deleted if it is scheduled or dispatched. A task + * cannot be deleted if it has executed successfully or permanently + * failed. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $formattedName = $cloudTasksClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + * $cloudTasksClient->deleteTask($formattedName); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $name Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException if the remote call fails + */ + public function deleteTask($name, array $optionalArgs = []) + { + $request = new DeleteTaskRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteTask', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the access control policy for a [Queue][google.cloud.tasks.v2.Queue]. + * Returns an empty policy if the resource exists and does not have a policy + * set. + * + * Authorization requires the following + * [Google IAM](https://cloud.google.com/iam) permission on the specified + * resource parent: + * + * * `cloudtasks.queues.getIamPolicy` + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $resource = 'resource'; + * $response = $cloudTasksClient->getIamPolicy($resource); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $resource REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param array $optionalArgs { + * Optional. + * + * @type GetPolicyOptions $options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\Policy + * + * @throws ApiException if the remote call fails + */ + public function getIamPolicy($resource, array $optionalArgs = []) + { + $request = new GetIamPolicyRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['options'])) { + $request->setOptions($optionalArgs['options']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets a queue. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * $response = $cloudTasksClient->getQueue($formattedName); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $name Required. The resource name of the queue. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Tasks\V2\Queue + * + * @throws ApiException if the remote call fails + */ + public function getQueue($name, array $optionalArgs = []) + { + $request = new GetQueueRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetQueue', Queue::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets a task. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $formattedName = $cloudTasksClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + * $response = $cloudTasksClient->getTask($formattedName); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $name Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * @param array $optionalArgs { + * Optional. + * + * @type int $responseView + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2.Task] will be returned. + * + * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; + * not all information is retrieved by default because some data, such as + * payloads, might be desirable to return only when needed because + * of its large size or because of the sensitivity of data that it + * contains. + * + * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires + * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + * permission on the [Task][google.cloud.tasks.v2.Task] resource. + * For allowed values, use constants defined on {@see \Google\Cloud\Tasks\V2\Task\View} + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Tasks\V2\Task + * + * @throws ApiException if the remote call fails + */ + public function getTask($name, array $optionalArgs = []) + { + $request = new GetTaskRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['responseView'])) { + $request->setResponseView($optionalArgs['responseView']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetTask', Task::class, $optionalArgs, $request)->wait(); + } + + /** + * Lists queues. + * + * Queues are returned in lexicographical order. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $formattedParent = $cloudTasksClient->locationName('[PROJECT]', '[LOCATION]'); + * // Iterate over pages of elements + * $pagedResponse = $cloudTasksClient->listQueues($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $cloudTasksClient->listQueues($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $parent Required. The location name. + * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * @param array $optionalArgs { + * Optional. + * + * @type string $filter + * `filter` can be used to specify a subset of queues. Any + * [Queue][google.cloud.tasks.v2.Queue] field can be used as a filter and + * several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The + * filter syntax is the same as described in [Stackdriver's Advanced Logs + * Filters](https://cloud.google.com/logging/docs/view/advanced_filters). + * + * Sample filter "state: PAUSED". + * + * Note that using filters might cause fewer queues than the + * requested page_size to be returned. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listQueues($parent, array $optionalArgs = []) + { + $request = new ListQueuesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListQueues', $optionalArgs, ListQueuesResponse::class, $request); + } + + /** + * Lists the tasks in a queue. + * + * By default, only the [BASIC][google.cloud.tasks.v2.Task.View.BASIC] view is + * retrieved due to performance considerations; + * [response_view][google.cloud.tasks.v2.ListTasksRequest.response_view] + * controls the subset of information which is returned. + * + * The tasks may be returned in any order. The ordering may change at any + * time. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $formattedParent = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * // Iterate over pages of elements + * $pagedResponse = $cloudTasksClient->listTasks($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $cloudTasksClient->listTasks($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $parent Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * @param array $optionalArgs { + * Optional. + * + * @type int $responseView + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2.Task] will be returned. + * + * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; + * not all information is retrieved by default because some data, such as + * payloads, might be desirable to return only when needed because + * of its large size or because of the sensitivity of data that it + * contains. + * + * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires + * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + * permission on the [Task][google.cloud.tasks.v2.Task] resource. + * For allowed values, use constants defined on {@see \Google\Cloud\Tasks\V2\Task\View} + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listTasks($parent, array $optionalArgs = []) + { + $request = new ListTasksRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['responseView'])) { + $request->setResponseView($optionalArgs['responseView']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListTasks', $optionalArgs, ListTasksResponse::class, $request); + } + + /** + * Pauses the queue. + * + * If a queue is paused then the system will stop dispatching tasks + * until the queue is resumed via + * [ResumeQueue][google.cloud.tasks.v2.CloudTasks.ResumeQueue]. Tasks can + * still be added when the queue is paused. A queue is paused if its + * [state][google.cloud.tasks.v2.Queue.state] is + * [PAUSED][google.cloud.tasks.v2.Queue.State.PAUSED]. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * $response = $cloudTasksClient->pauseQueue($formattedName); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $name Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Tasks\V2\Queue + * + * @throws ApiException if the remote call fails + */ + public function pauseQueue($name, array $optionalArgs = []) + { + $request = new PauseQueueRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('PauseQueue', Queue::class, $optionalArgs, $request)->wait(); + } + + /** + * Purges a queue by deleting all of its tasks. + * + * All tasks created before this method is called are permanently deleted. + * + * Purge operations can take up to one minute to take effect. Tasks + * might be dispatched before the purge takes effect. A purge is irreversible. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * $response = $cloudTasksClient->purgeQueue($formattedName); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $name Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Tasks\V2\Queue + * + * @throws ApiException if the remote call fails + */ + public function purgeQueue($name, array $optionalArgs = []) + { + $request = new PurgeQueueRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('PurgeQueue', Queue::class, $optionalArgs, $request)->wait(); + } + + /** + * Resume a queue. + * + * This method resumes a queue after it has been + * [PAUSED][google.cloud.tasks.v2.Queue.State.PAUSED] or + * [DISABLED][google.cloud.tasks.v2.Queue.State.DISABLED]. The state of a + * queue is stored in the queue's [state][google.cloud.tasks.v2.Queue.state]; + * after calling this method it will be set to + * [RUNNING][google.cloud.tasks.v2.Queue.State.RUNNING]. + * + * WARNING: Resuming many high-QPS queues at the same time can + * lead to target overloading. If you are resuming high-QPS + * queues, follow the 500/50/5 pattern described in + * [Managing Cloud Tasks Scaling + * Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling). + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * $response = $cloudTasksClient->resumeQueue($formattedName); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $name Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Tasks\V2\Queue + * + * @throws ApiException if the remote call fails + */ + public function resumeQueue($name, array $optionalArgs = []) + { + $request = new ResumeQueueRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('ResumeQueue', Queue::class, $optionalArgs, $request)->wait(); + } + + /** + * Forces a task to run now. + * + * When this method is called, Cloud Tasks will dispatch the task, even if + * the task is already running, the queue has reached its + * [RateLimits][google.cloud.tasks.v2.RateLimits] or is + * [PAUSED][google.cloud.tasks.v2.Queue.State.PAUSED]. + * + * This command is meant to be used for manual debugging. For + * example, [RunTask][google.cloud.tasks.v2.CloudTasks.RunTask] can be used to + * retry a failed task after a fix has been made or to manually force a task + * to be dispatched now. + * + * The dispatched task is returned. That is, the task that is returned + * contains the [status][Task.status] after the task is dispatched but + * before the task is received by its target. + * + * If Cloud Tasks receives a successful response from the task's + * target, then the task will be deleted; otherwise the task's + * [schedule_time][google.cloud.tasks.v2.Task.schedule_time] will be reset to + * the time that [RunTask][google.cloud.tasks.v2.CloudTasks.RunTask] was + * called plus the retry delay specified in the queue's + * [RetryConfig][google.cloud.tasks.v2.RetryConfig]. + * + * [RunTask][google.cloud.tasks.v2.CloudTasks.RunTask] returns + * [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a + * task that has already succeeded or permanently failed. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $formattedName = $cloudTasksClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + * $response = $cloudTasksClient->runTask($formattedName); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $name Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * @param array $optionalArgs { + * Optional. + * + * @type int $responseView + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2.Task] will be returned. + * + * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; + * not all information is retrieved by default because some data, such as + * payloads, might be desirable to return only when needed because + * of its large size or because of the sensitivity of data that it + * contains. + * + * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires + * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + * permission on the [Task][google.cloud.tasks.v2.Task] resource. + * For allowed values, use constants defined on {@see \Google\Cloud\Tasks\V2\Task\View} + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Tasks\V2\Task + * + * @throws ApiException if the remote call fails + */ + public function runTask($name, array $optionalArgs = []) + { + $request = new RunTaskRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['responseView'])) { + $request->setResponseView($optionalArgs['responseView']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('RunTask', Task::class, $optionalArgs, $request)->wait(); + } + + /** + * Sets the access control policy for a [Queue][google.cloud.tasks.v2.Queue]. + * Replaces any existing policy. + * + * Note: The Cloud Console does not check queue-level IAM permissions yet. + * Project-level permissions are required to use the Cloud Console. + * + * Authorization requires the following + * [Google IAM](https://cloud.google.com/iam) permission on the specified + * resource parent: + * + * * `cloudtasks.queues.setIamPolicy` + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $resource = 'resource'; + * $policy = new Policy(); + * $response = $cloudTasksClient->setIamPolicy($resource, $policy); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $resource REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * + * `paths: "bindings, etag"` + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\Policy + * + * @throws ApiException if the remote call fails + */ + public function setIamPolicy($resource, $policy, array $optionalArgs = []) + { + $request = new SetIamPolicyRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $request->setPolicy($policy); + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns permissions that a caller has on a + * [Queue][google.cloud.tasks.v2.Queue]. If the resource does not exist, this + * will return an empty set of permissions, not a + * [NOT_FOUND][google.rpc.Code.NOT_FOUND] error. + * + * Note: This operation is designed to be used for building permission-aware + * UIs and command-line tools, not for authorization checking. This operation + * may "fail open" without warning. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $resource = 'resource'; + * $permissions = []; + * $response = $cloudTasksClient->testIamPermissions($resource, $permissions); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $resource REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse + * + * @throws ApiException if the remote call fails + */ + public function testIamPermissions($resource, $permissions, array $optionalArgs = []) + { + $request = new TestIamPermissionsRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $request->setPermissions($permissions); + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('TestIamPermissions', TestIamPermissionsResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Updates a queue. + * + * This method creates the queue if it does not exist and updates + * the queue if it does exist. + * + * Queues created with this method allow tasks to live for a maximum of 31 + * days. After a task is 31 days old, the task will be deleted regardless of + * whether it was dispatched or not. + * + * WARNING: Using this method may have unintended side effects if you are + * using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + * Read + * [Overview of Queue Management and + * queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using + * this method. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $queue = new Queue(); + * $response = $cloudTasksClient->updateQueue($queue); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param Queue $queue Required. The queue to create or update. + * + * The queue's [name][google.cloud.tasks.v2.Queue.name] must be specified. + * + * Output only fields cannot be modified using UpdateQueue. + * Any value specified for an output only field will be ignored. + * The queue's [name][google.cloud.tasks.v2.Queue.name] cannot be changed. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * A mask used to specify which fields of the queue are being updated. + * + * If empty, then all fields will be updated. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Tasks\V2\Queue + * + * @throws ApiException if the remote call fails + */ + public function updateQueue($queue, array $optionalArgs = []) + { + $request = new UpdateQueueRequest(); + $requestParamHeaders = []; + $request->setQueue($queue); + $requestParamHeaders['queue.name'] = $queue->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateQueue', Queue::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets information about a location. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $response = $cloudTasksClient->getLocation(); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Resource name for the location. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Location\Location + * + * @throws ApiException if the remote call fails + */ + public function getLocation(array $optionalArgs = []) + { + $request = new GetLocationRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $cloudTasksClient->listLocations(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $cloudTasksClient->listLocations(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The resource that owns the locations collection, if applicable. + * @type string $filter + * The standard list filter. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listLocations(array $optionalArgs = []) + { + $request = new ListLocationsRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); + } +} diff --git a/owl-bot-staging/Tasks/v2/src/V2/gapic_metadata.json b/owl-bot-staging/Tasks/v2/src/V2/gapic_metadata.json new file mode 100644 index 000000000000..1081b788279a --- /dev/null +++ b/owl-bot-staging/Tasks/v2/src/V2/gapic_metadata.json @@ -0,0 +1,108 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.tasks.v2", + "libraryPackage": "Google\\Cloud\\Tasks\\V2", + "services": { + "CloudTasks": { + "clients": { + "grpc": { + "libraryClient": "CloudTasksGapicClient", + "rpcs": { + "CreateQueue": { + "methods": [ + "createQueue" + ] + }, + "CreateTask": { + "methods": [ + "createTask" + ] + }, + "DeleteQueue": { + "methods": [ + "deleteQueue" + ] + }, + "DeleteTask": { + "methods": [ + "deleteTask" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "GetQueue": { + "methods": [ + "getQueue" + ] + }, + "GetTask": { + "methods": [ + "getTask" + ] + }, + "ListQueues": { + "methods": [ + "listQueues" + ] + }, + "ListTasks": { + "methods": [ + "listTasks" + ] + }, + "PauseQueue": { + "methods": [ + "pauseQueue" + ] + }, + "PurgeQueue": { + "methods": [ + "purgeQueue" + ] + }, + "ResumeQueue": { + "methods": [ + "resumeQueue" + ] + }, + "RunTask": { + "methods": [ + "runTask" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "UpdateQueue": { + "methods": [ + "updateQueue" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/Tasks/v2/src/V2/resources/cloud_tasks_client_config.json b/owl-bot-staging/Tasks/v2/src/V2/resources/cloud_tasks_client_config.json new file mode 100644 index 000000000000..8f9b26e3639f --- /dev/null +++ b/owl-bot-staging/Tasks/v2/src/V2/resources/cloud_tasks_client_config.json @@ -0,0 +1,135 @@ +{ + "interfaces": { + "google.cloud.tasks.v2.CloudTasks": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "no_retry_1_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 20000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 20000, + "total_timeout_millis": 20000 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 20000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 20000, + "total_timeout_millis": 20000 + } + }, + "methods": { + "CreateQueue": { + "timeout_millis": 20000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateTask": { + "timeout_millis": 20000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteQueue": { + "timeout_millis": 20000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteTask": { + "timeout_millis": 20000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetIamPolicy": { + "timeout_millis": 20000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetQueue": { + "timeout_millis": 20000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetTask": { + "timeout_millis": 20000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListQueues": { + "timeout_millis": 20000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListTasks": { + "timeout_millis": 20000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "PauseQueue": { + "timeout_millis": 20000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "PurgeQueue": { + "timeout_millis": 20000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ResumeQueue": { + "timeout_millis": 20000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "RunTask": { + "timeout_millis": 20000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetIamPolicy": { + "timeout_millis": 20000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "timeout_millis": 20000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateQueue": { + "timeout_millis": 20000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/owl-bot-staging/Tasks/v2/src/V2/resources/cloud_tasks_descriptor_config.php b/owl-bot-staging/Tasks/v2/src/V2/resources/cloud_tasks_descriptor_config.php new file mode 100644 index 000000000000..56a0adfd3e31 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/src/V2/resources/cloud_tasks_descriptor_config.php @@ -0,0 +1,256 @@ + [ + 'google.cloud.tasks.v2.CloudTasks' => [ + 'CreateQueue' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Tasks\V2\Queue', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateTask' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Tasks\V2\Task', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteQueue' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteTask' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'GetQueue' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Tasks\V2\Queue', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetTask' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Tasks\V2\Task', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListQueues' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getQueues', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Tasks\V2\ListQueuesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListTasks' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getTasks', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Tasks\V2\ListTasksResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'PauseQueue' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Tasks\V2\Queue', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'PurgeQueue' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Tasks\V2\Queue', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ResumeQueue' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Tasks\V2\Queue', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'RunTask' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Tasks\V2\Task', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'UpdateQueue' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Tasks\V2\Queue', + 'headerParams' => [ + [ + 'keyName' => 'queue.name', + 'fieldAccessors' => [ + 'getQueue', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'location' => 'projects/{project}/locations/{location}', + 'queue' => 'projects/{project}/locations/{location}/queues/{queue}', + 'task' => 'projects/{project}/locations/{location}/queues/{queue}/tasks/{task}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Tasks/v2/src/V2/resources/cloud_tasks_rest_client_config.php b/owl-bot-staging/Tasks/v2/src/V2/resources/cloud_tasks_rest_client_config.php new file mode 100644 index 000000000000..88db041fc255 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/src/V2/resources/cloud_tasks_rest_client_config.php @@ -0,0 +1,220 @@ + [ + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.tasks.v2.CloudTasks' => [ + 'CreateQueue' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/queues', + 'body' => 'queue', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateTask' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/queues/*}/tasks', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteQueue' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/queues/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteTask' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/queues/*/tasks/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{resource=projects/*/locations/*/queues/*}:getIamPolicy', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'GetQueue' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/queues/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetTask' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/queues/*/tasks/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListQueues' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/queues', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListTasks' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/queues/*}/tasks', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'PauseQueue' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/queues/*}:pause', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'PurgeQueue' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/queues/*}:purge', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ResumeQueue' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/queues/*}:resume', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'RunTask' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/queues/*/tasks/*}:run', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{resource=projects/*/locations/*/queues/*}:setIamPolicy', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{resource=projects/*/locations/*/queues/*}:testIamPermissions', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'UpdateQueue' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{queue.name=projects/*/locations/*/queues/*}', + 'body' => 'queue', + 'placeholders' => [ + 'queue.name' => [ + 'getters' => [ + 'getQueue', + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Tasks/v2/tests/Unit/V2/Client/CloudTasksClientTest.php b/owl-bot-staging/Tasks/v2/tests/Unit/V2/Client/CloudTasksClientTest.php new file mode 100644 index 000000000000..71034c96e057 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/tests/Unit/V2/Client/CloudTasksClientTest.php @@ -0,0 +1,1316 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return CloudTasksClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new CloudTasksClient($options); + } + + /** @test */ + public function createQueueTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new Queue(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $queue = new Queue(); + $request = (new CreateQueueRequest()) + ->setParent($formattedParent) + ->setQueue($queue); + $response = $gapicClient->createQueue($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/CreateQueue', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getQueue(); + $this->assertProtobufEquals($queue, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createQueueExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $queue = new Queue(); + $request = (new CreateQueueRequest()) + ->setParent($formattedParent) + ->setQueue($queue); + try { + $gapicClient->createQueue($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createTaskTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $dispatchCount = 1217252086; + $responseCount = 424727441; + $expectedResponse = new Task(); + $expectedResponse->setName($name); + $expectedResponse->setDispatchCount($dispatchCount); + $expectedResponse->setResponseCount($responseCount); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $task = new Task(); + $request = (new CreateTaskRequest()) + ->setParent($formattedParent) + ->setTask($task); + $response = $gapicClient->createTask($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/CreateTask', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getTask(); + $this->assertProtobufEquals($task, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createTaskExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $task = new Task(); + $request = (new CreateTaskRequest()) + ->setParent($formattedParent) + ->setTask($task); + try { + $gapicClient->createTask($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteQueueTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $request = (new DeleteQueueRequest()) + ->setName($formattedName); + $gapicClient->deleteQueue($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/DeleteQueue', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteQueueExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $request = (new DeleteQueueRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteQueue($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteTaskTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $request = (new DeleteTaskRequest()) + ->setName($formattedName); + $gapicClient->deleteTask($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/DeleteTask', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteTaskExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $request = (new DeleteTaskRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteTask($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getQueueTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new Queue(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $request = (new GetQueueRequest()) + ->setName($formattedName); + $response = $gapicClient->getQueue($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/GetQueue', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getQueueExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $request = (new GetQueueRequest()) + ->setName($formattedName); + try { + $gapicClient->getQueue($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTaskTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $dispatchCount = 1217252086; + $responseCount = 424727441; + $expectedResponse = new Task(); + $expectedResponse->setName($name2); + $expectedResponse->setDispatchCount($dispatchCount); + $expectedResponse->setResponseCount($responseCount); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $request = (new GetTaskRequest()) + ->setName($formattedName); + $response = $gapicClient->getTask($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/GetTask', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTaskExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $request = (new GetTaskRequest()) + ->setName($formattedName); + try { + $gapicClient->getTask($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listQueuesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $queuesElement = new Queue(); + $queues = [ + $queuesElement, + ]; + $expectedResponse = new ListQueuesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setQueues($queues); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListQueuesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listQueues($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getQueues()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/ListQueues', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listQueuesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListQueuesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listQueues($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listTasksTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $tasksElement = new Task(); + $tasks = [ + $tasksElement, + ]; + $expectedResponse = new ListTasksResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTasks($tasks); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $request = (new ListTasksRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listTasks($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getTasks()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/ListTasks', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listTasksExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $request = (new ListTasksRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listTasks($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function pauseQueueTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new Queue(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $request = (new PauseQueueRequest()) + ->setName($formattedName); + $response = $gapicClient->pauseQueue($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/PauseQueue', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function pauseQueueExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $request = (new PauseQueueRequest()) + ->setName($formattedName); + try { + $gapicClient->pauseQueue($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function purgeQueueTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new Queue(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $request = (new PurgeQueueRequest()) + ->setName($formattedName); + $response = $gapicClient->purgeQueue($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/PurgeQueue', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function purgeQueueExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $request = (new PurgeQueueRequest()) + ->setName($formattedName); + try { + $gapicClient->purgeQueue($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function resumeQueueTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new Queue(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $request = (new ResumeQueueRequest()) + ->setName($formattedName); + $response = $gapicClient->resumeQueue($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/ResumeQueue', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function resumeQueueExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $request = (new ResumeQueueRequest()) + ->setName($formattedName); + try { + $gapicClient->resumeQueue($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function runTaskTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $dispatchCount = 1217252086; + $responseCount = 424727441; + $expectedResponse = new Task(); + $expectedResponse->setName($name2); + $expectedResponse->setDispatchCount($dispatchCount); + $expectedResponse->setResponseCount($responseCount); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $request = (new RunTaskRequest()) + ->setName($formattedName); + $response = $gapicClient->runTask($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/RunTask', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function runTaskExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $request = (new RunTaskRequest()) + ->setName($formattedName); + try { + $gapicClient->runTask($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateQueueTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new Queue(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $queue = new Queue(); + $request = (new UpdateQueueRequest()) + ->setQueue($queue); + $response = $gapicClient->updateQueue($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/UpdateQueue', $actualFuncCall); + $actualValue = $actualRequestObject->getQueue(); + $this->assertProtobufEquals($queue, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateQueueExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $queue = new Queue(); + $request = (new UpdateQueueRequest()) + ->setQueue($queue); + try { + $gapicClient->updateQueue($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createQueueAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new Queue(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $queue = new Queue(); + $request = (new CreateQueueRequest()) + ->setParent($formattedParent) + ->setQueue($queue); + $response = $gapicClient->createQueueAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/CreateQueue', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getQueue(); + $this->assertProtobufEquals($queue, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Tasks/v2/tests/Unit/V2/CloudTasksClientTest.php b/owl-bot-staging/Tasks/v2/tests/Unit/V2/CloudTasksClientTest.php new file mode 100644 index 000000000000..a662ec4fc05f --- /dev/null +++ b/owl-bot-staging/Tasks/v2/tests/Unit/V2/CloudTasksClientTest.php @@ -0,0 +1,1189 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return CloudTasksClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new CloudTasksClient($options); + } + + /** @test */ + public function createQueueTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new Queue(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $queue = new Queue(); + $response = $gapicClient->createQueue($formattedParent, $queue); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/CreateQueue', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getQueue(); + $this->assertProtobufEquals($queue, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createQueueExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $queue = new Queue(); + try { + $gapicClient->createQueue($formattedParent, $queue); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createTaskTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $dispatchCount = 1217252086; + $responseCount = 424727441; + $expectedResponse = new Task(); + $expectedResponse->setName($name); + $expectedResponse->setDispatchCount($dispatchCount); + $expectedResponse->setResponseCount($responseCount); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $task = new Task(); + $response = $gapicClient->createTask($formattedParent, $task); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/CreateTask', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getTask(); + $this->assertProtobufEquals($task, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createTaskExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $task = new Task(); + try { + $gapicClient->createTask($formattedParent, $task); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteQueueTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $gapicClient->deleteQueue($formattedName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/DeleteQueue', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteQueueExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + try { + $gapicClient->deleteQueue($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteTaskTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $gapicClient->deleteTask($formattedName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/DeleteTask', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteTaskExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + try { + $gapicClient->deleteTask($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $response = $gapicClient->getIamPolicy($resource); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + try { + $gapicClient->getIamPolicy($resource); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getQueueTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new Queue(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $response = $gapicClient->getQueue($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/GetQueue', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getQueueExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + try { + $gapicClient->getQueue($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTaskTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $dispatchCount = 1217252086; + $responseCount = 424727441; + $expectedResponse = new Task(); + $expectedResponse->setName($name2); + $expectedResponse->setDispatchCount($dispatchCount); + $expectedResponse->setResponseCount($responseCount); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $response = $gapicClient->getTask($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/GetTask', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTaskExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + try { + $gapicClient->getTask($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listQueuesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $queuesElement = new Queue(); + $queues = [ + $queuesElement, + ]; + $expectedResponse = new ListQueuesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setQueues($queues); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $response = $gapicClient->listQueues($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getQueues()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/ListQueues', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listQueuesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + try { + $gapicClient->listQueues($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listTasksTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $tasksElement = new Task(); + $tasks = [ + $tasksElement, + ]; + $expectedResponse = new ListTasksResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTasks($tasks); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $response = $gapicClient->listTasks($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getTasks()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/ListTasks', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listTasksExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + try { + $gapicClient->listTasks($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function pauseQueueTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new Queue(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $response = $gapicClient->pauseQueue($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/PauseQueue', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function pauseQueueExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + try { + $gapicClient->pauseQueue($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function purgeQueueTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new Queue(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $response = $gapicClient->purgeQueue($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/PurgeQueue', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function purgeQueueExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + try { + $gapicClient->purgeQueue($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function resumeQueueTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new Queue(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $response = $gapicClient->resumeQueue($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/ResumeQueue', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function resumeQueueExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + try { + $gapicClient->resumeQueue($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function runTaskTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $dispatchCount = 1217252086; + $responseCount = 424727441; + $expectedResponse = new Task(); + $expectedResponse->setName($name2); + $expectedResponse->setDispatchCount($dispatchCount); + $expectedResponse->setResponseCount($responseCount); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $response = $gapicClient->runTask($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/RunTask', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function runTaskExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + try { + $gapicClient->runTask($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $response = $gapicClient->setIamPolicy($resource, $policy); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + try { + $gapicClient->setIamPolicy($resource, $policy); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $response = $gapicClient->testIamPermissions($resource, $permissions); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + try { + $gapicClient->testIamPermissions($resource, $permissions); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateQueueTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new Queue(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $queue = new Queue(); + $response = $gapicClient->updateQueue($queue); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/UpdateQueue', $actualFuncCall); + $actualValue = $actualRequestObject->getQueue(); + $this->assertProtobufEquals($queue, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateQueueExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $queue = new Queue(); + try { + $gapicClient->updateQueue($queue); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $response = $gapicClient->getLocation(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->getLocation(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $response = $gapicClient->listLocations(); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->listLocations(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta2/Cloudtasks.php b/owl-bot-staging/Tasks/v2beta2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta2/Cloudtasks.php new file mode 100644 index 0000000000000000000000000000000000000000..0ee8065355d64963cfa3f15bb57910272fb211f1 GIT binary patch literal 8540 zcmc&)&u<)89q%}?sh`srKibqWBApCvGCLgIj`s;5dwh~9GQp(p+UBu;$aubH>MW@p!h_+o3` z_kHK{{k-qbH@^CfU_U@#)i;SpLMtXMz4@LV?-M-;{n)pCS8pb}yCl?Yza2O(2}`=Z zaaaG=-5veL#_gT+ur>0N&?Xgq&-eFSV%n~sw9MFw9!BOtxk+NH%%8DGC8if4&uWt> zuxz4lZr8RzsAa`geUquEuTvHE9jc=Kpj@LWRuQsYD~fcs##Et4NQa*wX}XTBN3j*d zuNR%D;doB$Sg!K}ux3r)wcLon_FmcD#Is|^_jJ19u4j|Qi#pdyWnT<@uzpRKptdO? zKt}zx7n9Jl-1-KI?9d5fKime&N+ ziIdPL&6w-b_(;xF!}g8F4~4Y#d!{lQ8der@~Urz03Gc8vLtP9iW z0$uM|lY0Y^|IC)~E3x;>LU+1OsON}9SrpPm&QUvqCJ9U>V(A22h4B{+&As77F^k;j z9s%>C7{7+50xN`bnAdb|ak^H&@M(48Kh^X21x6V^J&p{{EGj|yGMNT^8cppwE~N1J z3Az){q3OWdBaH~^#rz3)G>I`n>{0ALB;Ncio46pH?;FZG=_iQ2?2l;1x8*jxYk~CqT`4siu$Pl{n_-(X2<_jT;Io2HyA~n%yLv z8p+IMbdna=E?&@3UOEh<+6x%?V-4YTpd}^@r-U&6;aoX)x zP8g{&>LP`eVH3?HOc_7xp;Q=m5Z)jz>3RED=U{vj&21;)UbiXZE3=a5^HBzNLJ>~d zpN}>Noq02GeXGS>=et(hmG1K;G-U-r!)Xa0rbmpI(KJn;4ca&e?|4=Q4n%l~HWf8k zyY&4( zF25wf^owG;vGf3hJF^YVEZy0Lrj}{rEuQlPV39aXG#OJ1MBdPcy%7&g8xXgrA#YIi zlJu{2qzyp^`k#_v{0&k&Pai6haS!HIbdu5|oMR|EEOYdpCanNPPt&-K=6K|*_{U<> z_>7i0Vnu|iI<}KSQEOZ8HYgtvBV-a^L8o1+zai^4D|R#Gv(k-Z1un_PaR5WqYl||Z zR9o)YH=racR*vb}#!obKrfNU*{6m+t_84c!bL1=NnaJKJt;8h_+JOi!>MikUkIF00 zzv0;K!R&m6Cp3KP_AJE!w!PM+NLDPGZ@krrI)8M_tJ9hB)W)a#n6pfMcpTC08 zIvqM#=;J?X2xV;}z9i$bUt!7QgzGJoii-2lGp_&Wlh1xOv4YL?vgQ$Qtk)nPe4p5H zWG z6Nb`1qjab^mmWoM1c+M<;_Jq!3|4rn`?z|F6TZxd#eW6FN;8{}SP>in@pl;FYvs$? znX`A73Q?Qlo@1Mqm1Y_L9Kb8Ra6WiNP=Y@r-6t(Z>>fh8!IHvpA*|93eg`p?b=CPX zmB~p|1^jfAQCcw+N(%w31hm($XiFVP)0TY*(p2vMf|R~ZLHY+cYh@nDKWjyB1gy6h ztEC?D zI#?;Gi&EWlT{3*D@qn3q!?>QA4F<7m_MwT7-a@A!7y(bqz4-Tl@xHR$gHc@^g7K~6 zV2l(H4CAcCxXkaK@F&n+?7&42HHCz2CyMB`HeT!^tXD+BzF0s~l)!yv${pk8ICRH7 zAelkWW(Fzn-`CJ|I*8(B39+98ree~dp?!cD9E4FkbiR&X%Z$pc>sjgK*Ns_y|CNTm z0M1L*vLP!E0I)NEC8Sxz$i-fnh5A7)OD4Qemb7m%29OpK}dDR$~OXd+XqRPjV z$6rD{$|lEr#F?B#JSYnZK9>}nWAXWS+JUB1T0Xi=PNK_gu~c#4sc$oOYsT7`o?3A! zRL1dhf@Ah19dz-B8k+5z7W1=zm$0;K5brj#;FhtTSuhgs6)PKMnH`vJU+x%4@ju{D zvPm=lP%=3QeRwdw!;IK8YU3IKxA9^OW;UGfwPCsITt1@Bc{W1kcMytTaiflXGIj=U z;K}?J5~LU-^Alv}thq4!O!#PV-B=y_OcIa5X2a0J*2mSetk%#R6p2(WKac#gTB0|m zQN=V54-dN*O)H7_`Dgq~fosLPe%P*oN1lW4Dmf*gHoKnAwcGUj(YE%zbzbenrxW^J zX3tmtLBIq&z5g~4G*>g=LGw2glRMS>ckchIx`m8vp&RrYVr<3r3+XWXNc?rA47HEs je0$WKVuQ!47t(Ku%ly;4@+E)ZS9~VPzqTKtBZU47xL;}5 literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta2/OldTarget.php b/owl-bot-staging/Tasks/v2beta2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta2/OldTarget.php new file mode 100644 index 000000000000..e407dce1a21c --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta2/OldTarget.php @@ -0,0 +1,27 @@ +internalAddGeneratedFile( + ' +� ++google/cloud/tasks/v2beta2/old_target.protogoogle.cloud.tasks.v2beta2Bw +com.google.cloud.tasks.v2beta2BOldTargetProtoPZCcloud.google.com/go/cloudtasks/apiv2beta2/cloudtaskspb;cloudtaskspbbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta2/Queue.php b/owl-bot-staging/Tasks/v2beta2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta2/Queue.php new file mode 100644 index 0000000000000000000000000000000000000000..2bcab1231d847ca2cc6823db1ba869ce269cec23 GIT binary patch literal 2576 zcmbVOVNcse7;Z{K=^H@QT9M1Ta${XdwauO~tslbJl#oCpb&x`sw8@g?*q3m_v9Ie#PFqvqLtrfQA%d`<~~0@80)$?(UoK_!);!$N`OL;t3j%{v{D- zl<*`Lu^)$|pA7~yA$~mKEToA=Nb86k9`#7O)#-hV)HKc#pVrARj)x(&{V>h~TX^Yt zYG2g)RCqP}ZALR{sgMAXH=-%`d`b?w&F^tM@Py|aD7LdF*-lTgogZpV$=(6*LoZFq z8yN-O1HnI@^+V>9RCogaJ!7fMA|{v@vR`lwyJX;nDMjXW>>!JL!QzNW!cpYY>I7{^WNQ> zHKRS)tORRt`^=M)wlY*4cH)0fdki%syb+(xRbBkzTbB2%5d@PK?W2gRlcLHJZ^Q2^ z@cee_H8wQPQYyEU%B@`G8;|oC9%puvmsX2@!`Yq_U#J4+$fr3_nFWPs2YHq9@y&ma zi=q@7u=U#_l$BGAWwmKJWjfO0u?wJtW)rrjo9Iw=DOGloyG^@dR zTM=I&PdEJ49b*?NJPX4j&OH_9`Mfw?giq6_r}6M+`aiPoKt=9YZpcPVq-ObM`Z2;^ zD>P1h8LgIFx_%rD*w9>5Y-fAk$TsWMlH(0riKkFTK%BN<=9iik)3RK(a~$$*;}b-j+%TvN!o z%~Q*et4Ny*e>4`h+ECVOdIS$odW~M&Jv}_>w)Z;wopx*Oj!}X8$ESyfox_8*k^!*T zZJeIqz+DvPQmb>)Xuig`g}USX)%X!Mm7}zwv=GrosfEXmt=0Szi}N$}MQXp#pT>3= z`)UWlZ^h$SA2#^qtvoKq%@wF0~m1)_m!?Hws zLeLRM(MoHU(MeCh$RZ_V%sm;E8J2MLYcM2B3%1w~a@)>Pg9Vili`>5FpT~oNsqJ|K zUM?}mYeUV!KY|rGtss_XaWqVoiOS7YSdOyMWEER~mH@7#W0Mh_Hss4IW){?7DEe^G54Uu{oLwa@j%V(K0u_bTSkxPvI9 KzA21h4DdHY0Ydfw literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta2/Target.php b/owl-bot-staging/Tasks/v2beta2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta2/Target.php new file mode 100644 index 0000000000000000000000000000000000000000..ebd1a9fff9ae2f8e4d134e88d0f56c536425c5a9 GIT binary patch literal 3089 zcmc&$-EP}96t3;Wu8*BeRkJQ@w?Xro#o1a1@K#`Onil?1VgpU&#!B}C0|G5GHc?sB zC@O$E^nP!!_t-P+L3XiM*!@URRh+i*TI^!EvB;d??|kR*JbWBX1Ng!?#6D(-KUWx>&{kc#LX~bOIFea2vJiP0AG#c-6 z6h04k&+8-1QC*za1oK*K6Tn9^90th6#$ms8Bm~BYqv2t!K5R?%p)J*i&+09yz6aoX zC=3ldHUqzaA^w7BCvhvyku#&J zVr(?t2y)-xEW(T44TE7GF@Gh^kgoAJXGC{C*RL+wWLU{k9UU#f7iMg|8)ruap7$k>{zxRlbIjJRRXM zL=&uk0EGa}J&MMg86#6I>m|r>G}+9GL$NZ2o6R6F{R#1Lm-9f`(4WE`6a)^A?;S=X zPW*{O&oN_UjAKKk`n}rKG1XG5CrY{UM;12HOX=za{~Y0v>w8d|ilZ~bd`eZ2>-8^} z*_PUZ(L!49g8pWpac=J!pS}TQhCM;^bL>RS+ssLP^kXPYF&bkQZmt-)YN@`zEU>rb zSL-T$)8}lySdCR#joURSUlI`2d5-5X!bN=zR?m?aVO6X~_Pb2Q1}*iHKr4-gn4J?> zRi-E}M5#j2eM(c;;5zX|gNQav5-Y>Xl!jbnC283L^~gAZ!HVU64HtC`&O-W3pQk^l#v&LVbpgNsVbj9xsUkNN*YTS83y94fUj)9 z+S3TLdHQd`QPDGO?gWUTS(u3ZwgRP7MpCIZqQpvim*B>pjwur#Ox2en=2`iNckXP8~w?H4XyXKMUoE{JQX1jOL zGdtQf{W`34ZM&~!^dhXvuYs1WjNsPW4eC3vb$ZfstY_xQNv~r%=JA1b(l(tVOB^m+ zz5#2!14pa^j`>4xU=M@~fPC}G_st)Lk5&;1j;eO60IQDd>G(rds`6J3Kz36y)%T&i zh*V6UQhm7nj_CZi8DN2?NS{_J6ikvM^}#a#7vU$fAf@^L+5dMTuco$qO|P2Qw=Gy# zQVTKX6$lCT_unh^E5}F!;9|DvpTdX9bKoG?rIF7aJVPWI=kierT^b~hO64IG)5-R4 zs^S?z(U@TQjKqWCt56Xvd5!PDN0R%_k!g3W&TB*#Ez-9Jw%~68a)+j^W#g_fn;k7D zullF9wj#ORF`t;WsjbRZ>No9nSIY~S3s&FmS;qsd(Bkl!Sd^DQ*D5K-$6IAT^HW=G zO|RA!I@_I4wL+^68U^Il5*kp+hx0}js&I6QB(4R{YB8WW|k`HC(PhD&6F zm{Y7Y(QtdlRm2mnIf?lnaDsh2BC%osycs*n5~_KcU;{W#D68*c$7y1pi4;z}kBfBr zMg$Nb>?NAXgv8+iQ&e)HQ`v{mW^>GRDV_OJ-_5r*bbN&CF2`o`Mw0tj%Z$zMjT<@Rn3_z*-LWTvhNn=t zOfAOP8hraB&lPVCho!)WV8D7Qi4kZA{fW@?J2}tWa$&wTsBaDG=LX#hcb0M(b)0{< zKFT+3zS4h+|Gc!4$)ov>jRv&e{4Td@>dMGl36erX~vK z3NG`fSrDfbdRv;nx8iXYfGfZk!KJ;=@*aC>h-d9bP;qh*r(_uE3&FPkt{^mb;HT&_ zqBWZe9Su3OUri?wO|wK>7p{17>k`^CY|QfY`ykPZcZ42~xKuhSSaR8&MR%78*mC>k z${(Unp_|{}aR$9R&-Pyxv~ivJhTqKpwcc3fH-MCCSc{s&-U=xNvJj`hvR%GLpOlbX zHg{aFkPUi;@APR)uuD2E78cmJy=KbVH4Gt4Bi+QAp&3H|0e@Y)`2YX_ literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AcknowledgeTaskRequest.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AcknowledgeTaskRequest.php new file mode 100644 index 000000000000..5bc989f652e1 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AcknowledgeTaskRequest.php @@ -0,0 +1,132 @@ +google.cloud.tasks.v2beta2.AcknowledgeTaskRequest + */ +class AcknowledgeTaskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. The task's current schedule time, available in the + * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] returned by + * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] response or + * [RenewLease][google.cloud.tasks.v2beta2.CloudTasks.RenewLease] response. + * This restriction is to ensure that your worker currently holds the lease. + * + * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $schedule_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * @type \Google\Protobuf\Timestamp $schedule_time + * Required. The task's current schedule time, available in the + * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] returned by + * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] response or + * [RenewLease][google.cloud.tasks.v2beta2.CloudTasks.RenewLease] response. + * This restriction is to ensure that your worker currently holds the lease. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The task's current schedule time, available in the + * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] returned by + * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] response or + * [RenewLease][google.cloud.tasks.v2beta2.CloudTasks.RenewLease] response. + * This restriction is to ensure that your worker currently holds the lease. + * + * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getScheduleTime() + { + return $this->schedule_time; + } + + public function hasScheduleTime() + { + return isset($this->schedule_time); + } + + public function clearScheduleTime() + { + unset($this->schedule_time); + } + + /** + * Required. The task's current schedule time, available in the + * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] returned by + * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] response or + * [RenewLease][google.cloud.tasks.v2beta2.CloudTasks.RenewLease] response. + * This restriction is to ensure that your worker currently holds the lease. + * + * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setScheduleTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->schedule_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AppEngineHttpRequest.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AppEngineHttpRequest.php new file mode 100644 index 000000000000..b6c1deb04396 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AppEngineHttpRequest.php @@ -0,0 +1,484 @@ +google.cloud.tasks.v2beta2.AppEngineHttpRequest + */ +class AppEngineHttpRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The HTTP method to use for the request. The default is POST. + * The app's request handler for the task's target URL must be able to handle + * HTTP requests with this http_method, otherwise the task attempt fails with + * error code 405 (Method Not Allowed). See [Writing a push task request + * handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) + * and the App Engine documentation for your runtime on [How Requests are + * Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.HttpMethod http_method = 1; + */ + protected $http_method = 0; + /** + * Task-level setting for App Engine routing. + * If set, + * [app_engine_routing_override][google.cloud.tasks.v2beta2.AppEngineHttpTarget.app_engine_routing_override] + * is used for all tasks in the queue, no matter what the setting is for the + * [task-level + * app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.AppEngineRouting app_engine_routing = 2; + */ + protected $app_engine_routing = null; + /** + * The relative URL. + * The relative URL must begin with "/" and must be a valid HTTP relative URL. + * It can contain a path and query string arguments. + * If the relative URL is empty, then the root path "/" will be used. + * No spaces are allowed, and the maximum length allowed is 2083 characters. + * + * Generated from protobuf field string relative_url = 3; + */ + protected $relative_url = ''; + /** + * HTTP request headers. + * This map contains the header field names and values. + * Headers can be set when the + * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. + * Repeated headers are not supported but a header value can contain commas. + * Cloud Tasks sets some headers to default values: + * * `User-Agent`: By default, this header is + * `"AppEngine-Google; (+http://code.google.com/appengine)"`. + * This header can be modified, but Cloud Tasks will append + * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the + * modified `User-Agent`. + * If the task has a + * [payload][google.cloud.tasks.v2beta2.AppEngineHttpRequest.payload], Cloud + * Tasks sets the following headers: + * * `Content-Type`: By default, the `Content-Type` header is set to + * `"application/octet-stream"`. The default can be overridden by explicitly + * setting `Content-Type` to a particular media type when the + * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. + * For example, `Content-Type` can be set to `"application/json"`. + * * `Content-Length`: This is computed by Cloud Tasks. This value is + * output only. It cannot be changed. + * The headers below cannot be set or overridden: + * * `Host` + * * `X-Google-*` + * * `X-AppEngine-*` + * In addition, Cloud Tasks sets some headers when the task is dispatched, + * such as headers containing information about the task; see + * [request + * headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers). + * These headers are set only when the task is dispatched, so they are not + * visible when the task is returned in a Cloud Tasks response. + * Although there is no specific limit for the maximum number of headers or + * the size, there is a limit on the maximum size of the + * [Task][google.cloud.tasks.v2beta2.Task]. For more information, see the + * [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] + * documentation. + * + * Generated from protobuf field map headers = 4; + */ + private $headers; + /** + * Payload. + * The payload will be sent as the HTTP message body. A message + * body, and thus a payload, is allowed only if the HTTP method is + * POST or PUT. It is an error to set a data payload on a task with + * an incompatible [HttpMethod][google.cloud.tasks.v2beta2.HttpMethod]. + * + * Generated from protobuf field bytes payload = 5; + */ + protected $payload = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $http_method + * The HTTP method to use for the request. The default is POST. + * The app's request handler for the task's target URL must be able to handle + * HTTP requests with this http_method, otherwise the task attempt fails with + * error code 405 (Method Not Allowed). See [Writing a push task request + * handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) + * and the App Engine documentation for your runtime on [How Requests are + * Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). + * @type \Google\Cloud\Tasks\V2beta2\AppEngineRouting $app_engine_routing + * Task-level setting for App Engine routing. + * If set, + * [app_engine_routing_override][google.cloud.tasks.v2beta2.AppEngineHttpTarget.app_engine_routing_override] + * is used for all tasks in the queue, no matter what the setting is for the + * [task-level + * app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. + * @type string $relative_url + * The relative URL. + * The relative URL must begin with "/" and must be a valid HTTP relative URL. + * It can contain a path and query string arguments. + * If the relative URL is empty, then the root path "/" will be used. + * No spaces are allowed, and the maximum length allowed is 2083 characters. + * @type array|\Google\Protobuf\Internal\MapField $headers + * HTTP request headers. + * This map contains the header field names and values. + * Headers can be set when the + * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. + * Repeated headers are not supported but a header value can contain commas. + * Cloud Tasks sets some headers to default values: + * * `User-Agent`: By default, this header is + * `"AppEngine-Google; (+http://code.google.com/appengine)"`. + * This header can be modified, but Cloud Tasks will append + * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the + * modified `User-Agent`. + * If the task has a + * [payload][google.cloud.tasks.v2beta2.AppEngineHttpRequest.payload], Cloud + * Tasks sets the following headers: + * * `Content-Type`: By default, the `Content-Type` header is set to + * `"application/octet-stream"`. The default can be overridden by explicitly + * setting `Content-Type` to a particular media type when the + * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. + * For example, `Content-Type` can be set to `"application/json"`. + * * `Content-Length`: This is computed by Cloud Tasks. This value is + * output only. It cannot be changed. + * The headers below cannot be set or overridden: + * * `Host` + * * `X-Google-*` + * * `X-AppEngine-*` + * In addition, Cloud Tasks sets some headers when the task is dispatched, + * such as headers containing information about the task; see + * [request + * headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers). + * These headers are set only when the task is dispatched, so they are not + * visible when the task is returned in a Cloud Tasks response. + * Although there is no specific limit for the maximum number of headers or + * the size, there is a limit on the maximum size of the + * [Task][google.cloud.tasks.v2beta2.Task]. For more information, see the + * [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] + * documentation. + * @type string $payload + * Payload. + * The payload will be sent as the HTTP message body. A message + * body, and thus a payload, is allowed only if the HTTP method is + * POST or PUT. It is an error to set a data payload on a task with + * an incompatible [HttpMethod][google.cloud.tasks.v2beta2.HttpMethod]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Target::initOnce(); + parent::__construct($data); + } + + /** + * The HTTP method to use for the request. The default is POST. + * The app's request handler for the task's target URL must be able to handle + * HTTP requests with this http_method, otherwise the task attempt fails with + * error code 405 (Method Not Allowed). See [Writing a push task request + * handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) + * and the App Engine documentation for your runtime on [How Requests are + * Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.HttpMethod http_method = 1; + * @return int + */ + public function getHttpMethod() + { + return $this->http_method; + } + + /** + * The HTTP method to use for the request. The default is POST. + * The app's request handler for the task's target URL must be able to handle + * HTTP requests with this http_method, otherwise the task attempt fails with + * error code 405 (Method Not Allowed). See [Writing a push task request + * handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) + * and the App Engine documentation for your runtime on [How Requests are + * Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.HttpMethod http_method = 1; + * @param int $var + * @return $this + */ + public function setHttpMethod($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta2\HttpMethod::class); + $this->http_method = $var; + + return $this; + } + + /** + * Task-level setting for App Engine routing. + * If set, + * [app_engine_routing_override][google.cloud.tasks.v2beta2.AppEngineHttpTarget.app_engine_routing_override] + * is used for all tasks in the queue, no matter what the setting is for the + * [task-level + * app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.AppEngineRouting app_engine_routing = 2; + * @return \Google\Cloud\Tasks\V2beta2\AppEngineRouting|null + */ + public function getAppEngineRouting() + { + return $this->app_engine_routing; + } + + public function hasAppEngineRouting() + { + return isset($this->app_engine_routing); + } + + public function clearAppEngineRouting() + { + unset($this->app_engine_routing); + } + + /** + * Task-level setting for App Engine routing. + * If set, + * [app_engine_routing_override][google.cloud.tasks.v2beta2.AppEngineHttpTarget.app_engine_routing_override] + * is used for all tasks in the queue, no matter what the setting is for the + * [task-level + * app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.AppEngineRouting app_engine_routing = 2; + * @param \Google\Cloud\Tasks\V2beta2\AppEngineRouting $var + * @return $this + */ + public function setAppEngineRouting($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\AppEngineRouting::class); + $this->app_engine_routing = $var; + + return $this; + } + + /** + * The relative URL. + * The relative URL must begin with "/" and must be a valid HTTP relative URL. + * It can contain a path and query string arguments. + * If the relative URL is empty, then the root path "/" will be used. + * No spaces are allowed, and the maximum length allowed is 2083 characters. + * + * Generated from protobuf field string relative_url = 3; + * @return string + */ + public function getRelativeUrl() + { + return $this->relative_url; + } + + /** + * The relative URL. + * The relative URL must begin with "/" and must be a valid HTTP relative URL. + * It can contain a path and query string arguments. + * If the relative URL is empty, then the root path "/" will be used. + * No spaces are allowed, and the maximum length allowed is 2083 characters. + * + * Generated from protobuf field string relative_url = 3; + * @param string $var + * @return $this + */ + public function setRelativeUrl($var) + { + GPBUtil::checkString($var, True); + $this->relative_url = $var; + + return $this; + } + + /** + * HTTP request headers. + * This map contains the header field names and values. + * Headers can be set when the + * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. + * Repeated headers are not supported but a header value can contain commas. + * Cloud Tasks sets some headers to default values: + * * `User-Agent`: By default, this header is + * `"AppEngine-Google; (+http://code.google.com/appengine)"`. + * This header can be modified, but Cloud Tasks will append + * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the + * modified `User-Agent`. + * If the task has a + * [payload][google.cloud.tasks.v2beta2.AppEngineHttpRequest.payload], Cloud + * Tasks sets the following headers: + * * `Content-Type`: By default, the `Content-Type` header is set to + * `"application/octet-stream"`. The default can be overridden by explicitly + * setting `Content-Type` to a particular media type when the + * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. + * For example, `Content-Type` can be set to `"application/json"`. + * * `Content-Length`: This is computed by Cloud Tasks. This value is + * output only. It cannot be changed. + * The headers below cannot be set or overridden: + * * `Host` + * * `X-Google-*` + * * `X-AppEngine-*` + * In addition, Cloud Tasks sets some headers when the task is dispatched, + * such as headers containing information about the task; see + * [request + * headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers). + * These headers are set only when the task is dispatched, so they are not + * visible when the task is returned in a Cloud Tasks response. + * Although there is no specific limit for the maximum number of headers or + * the size, there is a limit on the maximum size of the + * [Task][google.cloud.tasks.v2beta2.Task]. For more information, see the + * [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] + * documentation. + * + * Generated from protobuf field map headers = 4; + * @return \Google\Protobuf\Internal\MapField + */ + public function getHeaders() + { + return $this->headers; + } + + /** + * HTTP request headers. + * This map contains the header field names and values. + * Headers can be set when the + * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. + * Repeated headers are not supported but a header value can contain commas. + * Cloud Tasks sets some headers to default values: + * * `User-Agent`: By default, this header is + * `"AppEngine-Google; (+http://code.google.com/appengine)"`. + * This header can be modified, but Cloud Tasks will append + * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the + * modified `User-Agent`. + * If the task has a + * [payload][google.cloud.tasks.v2beta2.AppEngineHttpRequest.payload], Cloud + * Tasks sets the following headers: + * * `Content-Type`: By default, the `Content-Type` header is set to + * `"application/octet-stream"`. The default can be overridden by explicitly + * setting `Content-Type` to a particular media type when the + * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. + * For example, `Content-Type` can be set to `"application/json"`. + * * `Content-Length`: This is computed by Cloud Tasks. This value is + * output only. It cannot be changed. + * The headers below cannot be set or overridden: + * * `Host` + * * `X-Google-*` + * * `X-AppEngine-*` + * In addition, Cloud Tasks sets some headers when the task is dispatched, + * such as headers containing information about the task; see + * [request + * headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers). + * These headers are set only when the task is dispatched, so they are not + * visible when the task is returned in a Cloud Tasks response. + * Although there is no specific limit for the maximum number of headers or + * the size, there is a limit on the maximum size of the + * [Task][google.cloud.tasks.v2beta2.Task]. For more information, see the + * [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] + * documentation. + * + * Generated from protobuf field map headers = 4; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setHeaders($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->headers = $arr; + + return $this; + } + + /** + * Payload. + * The payload will be sent as the HTTP message body. A message + * body, and thus a payload, is allowed only if the HTTP method is + * POST or PUT. It is an error to set a data payload on a task with + * an incompatible [HttpMethod][google.cloud.tasks.v2beta2.HttpMethod]. + * + * Generated from protobuf field bytes payload = 5; + * @return string + */ + public function getPayload() + { + return $this->payload; + } + + /** + * Payload. + * The payload will be sent as the HTTP message body. A message + * body, and thus a payload, is allowed only if the HTTP method is + * POST or PUT. It is an error to set a data payload on a task with + * an incompatible [HttpMethod][google.cloud.tasks.v2beta2.HttpMethod]. + * + * Generated from protobuf field bytes payload = 5; + * @param string $var + * @return $this + */ + public function setPayload($var) + { + GPBUtil::checkString($var, False); + $this->payload = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AppEngineHttpTarget.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AppEngineHttpTarget.php new file mode 100644 index 000000000000..17f72796c02a --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AppEngineHttpTarget.php @@ -0,0 +1,114 @@ +google.cloud.tasks.v2beta2.AppEngineHttpTarget + */ +class AppEngineHttpTarget extends \Google\Protobuf\Internal\Message +{ + /** + * Overrides for the + * [task-level + * app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. + * If set, `app_engine_routing_override` is used for all tasks in + * the queue, no matter what the setting is for the + * [task-level + * app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.AppEngineRouting app_engine_routing_override = 1; + */ + protected $app_engine_routing_override = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Tasks\V2beta2\AppEngineRouting $app_engine_routing_override + * Overrides for the + * [task-level + * app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. + * If set, `app_engine_routing_override` is used for all tasks in + * the queue, no matter what the setting is for the + * [task-level + * app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Target::initOnce(); + parent::__construct($data); + } + + /** + * Overrides for the + * [task-level + * app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. + * If set, `app_engine_routing_override` is used for all tasks in + * the queue, no matter what the setting is for the + * [task-level + * app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.AppEngineRouting app_engine_routing_override = 1; + * @return \Google\Cloud\Tasks\V2beta2\AppEngineRouting|null + */ + public function getAppEngineRoutingOverride() + { + return $this->app_engine_routing_override; + } + + public function hasAppEngineRoutingOverride() + { + return isset($this->app_engine_routing_override); + } + + public function clearAppEngineRoutingOverride() + { + unset($this->app_engine_routing_override); + } + + /** + * Overrides for the + * [task-level + * app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. + * If set, `app_engine_routing_override` is used for all tasks in + * the queue, no matter what the setting is for the + * [task-level + * app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.AppEngineRouting app_engine_routing_override = 1; + * @param \Google\Cloud\Tasks\V2beta2\AppEngineRouting $var + * @return $this + */ + public function setAppEngineRoutingOverride($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\AppEngineRouting::class); + $this->app_engine_routing_override = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AppEngineRouting.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AppEngineRouting.php new file mode 100644 index 000000000000..cb35bc64c659 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AppEngineRouting.php @@ -0,0 +1,536 @@ +google.cloud.tasks.v2beta2.AppEngineRouting + */ +class AppEngineRouting extends \Google\Protobuf\Internal\Message +{ + /** + * App service. + * By default, the task is sent to the service which is the default + * service when the task is attempted. + * For some queues or tasks which were created using the App Engine + * Task Queue API, [host][google.cloud.tasks.v2beta2.AppEngineRouting.host] is + * not parsable into + * [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], + * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance]. For + * example, some tasks which were created using the App Engine SDK use a + * custom domain name; custom domains are not parsed by Cloud Tasks. If + * [host][google.cloud.tasks.v2beta2.AppEngineRouting.host] is not parsable, + * then [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], + * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] are the + * empty string. + * + * Generated from protobuf field string service = 1; + */ + protected $service = ''; + /** + * App version. + * By default, the task is sent to the version which is the default + * version when the task is attempted. + * For some queues or tasks which were created using the App Engine + * Task Queue API, [host][google.cloud.tasks.v2beta2.AppEngineRouting.host] is + * not parsable into + * [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], + * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance]. For + * example, some tasks which were created using the App Engine SDK use a + * custom domain name; custom domains are not parsed by Cloud Tasks. If + * [host][google.cloud.tasks.v2beta2.AppEngineRouting.host] is not parsable, + * then [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], + * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] are the + * empty string. + * + * Generated from protobuf field string version = 2; + */ + protected $version = ''; + /** + * App instance. + * By default, the task is sent to an instance which is available when + * the task is attempted. + * Requests can only be sent to a specific instance if + * [manual scaling is used in App Engine + * Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). + * App Engine Flex does not support instances. For more information, see + * [App Engine Standard request + * routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) + * and [App Engine Flex request + * routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). + * + * Generated from protobuf field string instance = 3; + */ + protected $instance = ''; + /** + * Output only. The host that the task is sent to. + * For more information, see + * [How Requests are + * Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). + * The host is constructed as: + * * `host = [application_domain_name]`
+ * `| [service] + '.' + [application_domain_name]`
+ * `| [version] + '.' + [application_domain_name]`
+ * `| [version_dot_service]+ '.' + [application_domain_name]`
+ * `| [instance] + '.' + [application_domain_name]`
+ * `| [instance_dot_service] + '.' + [application_domain_name]`
+ * `| [instance_dot_version] + '.' + [application_domain_name]`
+ * `| [instance_dot_version_dot_service] + '.' + [application_domain_name]` + * * `application_domain_name` = The domain name of the app, for + * example .appspot.com, which is associated with the + * queue's project ID. Some tasks which were created using the App Engine + * SDK use a custom domain name. + * * `service =` + * [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] + * * `version =` + * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] + * * `version_dot_service =` + * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] `+ '.' +` + * [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] + * * `instance =` + * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] + * * `instance_dot_service =` + * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] `+ '.' + * +` [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] + * * `instance_dot_version =` + * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] `+ '.' + * +` [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] + * * `instance_dot_version_dot_service =` + * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] `+ '.' + * +` [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] `+ '.' + * +` [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] + * If [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] is empty, + * then the task will be sent to the service which is the default service when + * the task is attempted. + * If [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] is empty, + * then the task will be sent to the version which is the default version when + * the task is attempted. + * If [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] is + * empty, then the task will be sent to an instance which is available when + * the task is attempted. + * If [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], + * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], or + * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] is + * invalid, then the task will be sent to the default version of the default + * service when the task is attempted. + * + * Generated from protobuf field string host = 4; + */ + protected $host = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $service + * App service. + * By default, the task is sent to the service which is the default + * service when the task is attempted. + * For some queues or tasks which were created using the App Engine + * Task Queue API, [host][google.cloud.tasks.v2beta2.AppEngineRouting.host] is + * not parsable into + * [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], + * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance]. For + * example, some tasks which were created using the App Engine SDK use a + * custom domain name; custom domains are not parsed by Cloud Tasks. If + * [host][google.cloud.tasks.v2beta2.AppEngineRouting.host] is not parsable, + * then [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], + * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] are the + * empty string. + * @type string $version + * App version. + * By default, the task is sent to the version which is the default + * version when the task is attempted. + * For some queues or tasks which were created using the App Engine + * Task Queue API, [host][google.cloud.tasks.v2beta2.AppEngineRouting.host] is + * not parsable into + * [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], + * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance]. For + * example, some tasks which were created using the App Engine SDK use a + * custom domain name; custom domains are not parsed by Cloud Tasks. If + * [host][google.cloud.tasks.v2beta2.AppEngineRouting.host] is not parsable, + * then [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], + * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] are the + * empty string. + * @type string $instance + * App instance. + * By default, the task is sent to an instance which is available when + * the task is attempted. + * Requests can only be sent to a specific instance if + * [manual scaling is used in App Engine + * Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). + * App Engine Flex does not support instances. For more information, see + * [App Engine Standard request + * routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) + * and [App Engine Flex request + * routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). + * @type string $host + * Output only. The host that the task is sent to. + * For more information, see + * [How Requests are + * Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). + * The host is constructed as: + * * `host = [application_domain_name]`
+ * `| [service] + '.' + [application_domain_name]`
+ * `| [version] + '.' + [application_domain_name]`
+ * `| [version_dot_service]+ '.' + [application_domain_name]`
+ * `| [instance] + '.' + [application_domain_name]`
+ * `| [instance_dot_service] + '.' + [application_domain_name]`
+ * `| [instance_dot_version] + '.' + [application_domain_name]`
+ * `| [instance_dot_version_dot_service] + '.' + [application_domain_name]` + * * `application_domain_name` = The domain name of the app, for + * example .appspot.com, which is associated with the + * queue's project ID. Some tasks which were created using the App Engine + * SDK use a custom domain name. + * * `service =` + * [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] + * * `version =` + * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] + * * `version_dot_service =` + * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] `+ '.' +` + * [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] + * * `instance =` + * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] + * * `instance_dot_service =` + * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] `+ '.' + * +` [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] + * * `instance_dot_version =` + * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] `+ '.' + * +` [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] + * * `instance_dot_version_dot_service =` + * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] `+ '.' + * +` [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] `+ '.' + * +` [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] + * If [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] is empty, + * then the task will be sent to the service which is the default service when + * the task is attempted. + * If [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] is empty, + * then the task will be sent to the version which is the default version when + * the task is attempted. + * If [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] is + * empty, then the task will be sent to an instance which is available when + * the task is attempted. + * If [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], + * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], or + * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] is + * invalid, then the task will be sent to the default version of the default + * service when the task is attempted. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Target::initOnce(); + parent::__construct($data); + } + + /** + * App service. + * By default, the task is sent to the service which is the default + * service when the task is attempted. + * For some queues or tasks which were created using the App Engine + * Task Queue API, [host][google.cloud.tasks.v2beta2.AppEngineRouting.host] is + * not parsable into + * [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], + * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance]. For + * example, some tasks which were created using the App Engine SDK use a + * custom domain name; custom domains are not parsed by Cloud Tasks. If + * [host][google.cloud.tasks.v2beta2.AppEngineRouting.host] is not parsable, + * then [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], + * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] are the + * empty string. + * + * Generated from protobuf field string service = 1; + * @return string + */ + public function getService() + { + return $this->service; + } + + /** + * App service. + * By default, the task is sent to the service which is the default + * service when the task is attempted. + * For some queues or tasks which were created using the App Engine + * Task Queue API, [host][google.cloud.tasks.v2beta2.AppEngineRouting.host] is + * not parsable into + * [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], + * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance]. For + * example, some tasks which were created using the App Engine SDK use a + * custom domain name; custom domains are not parsed by Cloud Tasks. If + * [host][google.cloud.tasks.v2beta2.AppEngineRouting.host] is not parsable, + * then [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], + * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] are the + * empty string. + * + * Generated from protobuf field string service = 1; + * @param string $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkString($var, True); + $this->service = $var; + + return $this; + } + + /** + * App version. + * By default, the task is sent to the version which is the default + * version when the task is attempted. + * For some queues or tasks which were created using the App Engine + * Task Queue API, [host][google.cloud.tasks.v2beta2.AppEngineRouting.host] is + * not parsable into + * [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], + * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance]. For + * example, some tasks which were created using the App Engine SDK use a + * custom domain name; custom domains are not parsed by Cloud Tasks. If + * [host][google.cloud.tasks.v2beta2.AppEngineRouting.host] is not parsable, + * then [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], + * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] are the + * empty string. + * + * Generated from protobuf field string version = 2; + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * App version. + * By default, the task is sent to the version which is the default + * version when the task is attempted. + * For some queues or tasks which were created using the App Engine + * Task Queue API, [host][google.cloud.tasks.v2beta2.AppEngineRouting.host] is + * not parsable into + * [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], + * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance]. For + * example, some tasks which were created using the App Engine SDK use a + * custom domain name; custom domains are not parsed by Cloud Tasks. If + * [host][google.cloud.tasks.v2beta2.AppEngineRouting.host] is not parsable, + * then [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], + * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] are the + * empty string. + * + * Generated from protobuf field string version = 2; + * @param string $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkString($var, True); + $this->version = $var; + + return $this; + } + + /** + * App instance. + * By default, the task is sent to an instance which is available when + * the task is attempted. + * Requests can only be sent to a specific instance if + * [manual scaling is used in App Engine + * Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). + * App Engine Flex does not support instances. For more information, see + * [App Engine Standard request + * routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) + * and [App Engine Flex request + * routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). + * + * Generated from protobuf field string instance = 3; + * @return string + */ + public function getInstance() + { + return $this->instance; + } + + /** + * App instance. + * By default, the task is sent to an instance which is available when + * the task is attempted. + * Requests can only be sent to a specific instance if + * [manual scaling is used in App Engine + * Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). + * App Engine Flex does not support instances. For more information, see + * [App Engine Standard request + * routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) + * and [App Engine Flex request + * routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). + * + * Generated from protobuf field string instance = 3; + * @param string $var + * @return $this + */ + public function setInstance($var) + { + GPBUtil::checkString($var, True); + $this->instance = $var; + + return $this; + } + + /** + * Output only. The host that the task is sent to. + * For more information, see + * [How Requests are + * Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). + * The host is constructed as: + * * `host = [application_domain_name]`
+ * `| [service] + '.' + [application_domain_name]`
+ * `| [version] + '.' + [application_domain_name]`
+ * `| [version_dot_service]+ '.' + [application_domain_name]`
+ * `| [instance] + '.' + [application_domain_name]`
+ * `| [instance_dot_service] + '.' + [application_domain_name]`
+ * `| [instance_dot_version] + '.' + [application_domain_name]`
+ * `| [instance_dot_version_dot_service] + '.' + [application_domain_name]` + * * `application_domain_name` = The domain name of the app, for + * example .appspot.com, which is associated with the + * queue's project ID. Some tasks which were created using the App Engine + * SDK use a custom domain name. + * * `service =` + * [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] + * * `version =` + * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] + * * `version_dot_service =` + * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] `+ '.' +` + * [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] + * * `instance =` + * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] + * * `instance_dot_service =` + * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] `+ '.' + * +` [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] + * * `instance_dot_version =` + * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] `+ '.' + * +` [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] + * * `instance_dot_version_dot_service =` + * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] `+ '.' + * +` [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] `+ '.' + * +` [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] + * If [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] is empty, + * then the task will be sent to the service which is the default service when + * the task is attempted. + * If [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] is empty, + * then the task will be sent to the version which is the default version when + * the task is attempted. + * If [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] is + * empty, then the task will be sent to an instance which is available when + * the task is attempted. + * If [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], + * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], or + * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] is + * invalid, then the task will be sent to the default version of the default + * service when the task is attempted. + * + * Generated from protobuf field string host = 4; + * @return string + */ + public function getHost() + { + return $this->host; + } + + /** + * Output only. The host that the task is sent to. + * For more information, see + * [How Requests are + * Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). + * The host is constructed as: + * * `host = [application_domain_name]`
+ * `| [service] + '.' + [application_domain_name]`
+ * `| [version] + '.' + [application_domain_name]`
+ * `| [version_dot_service]+ '.' + [application_domain_name]`
+ * `| [instance] + '.' + [application_domain_name]`
+ * `| [instance_dot_service] + '.' + [application_domain_name]`
+ * `| [instance_dot_version] + '.' + [application_domain_name]`
+ * `| [instance_dot_version_dot_service] + '.' + [application_domain_name]` + * * `application_domain_name` = The domain name of the app, for + * example .appspot.com, which is associated with the + * queue's project ID. Some tasks which were created using the App Engine + * SDK use a custom domain name. + * * `service =` + * [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] + * * `version =` + * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] + * * `version_dot_service =` + * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] `+ '.' +` + * [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] + * * `instance =` + * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] + * * `instance_dot_service =` + * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] `+ '.' + * +` [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] + * * `instance_dot_version =` + * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] `+ '.' + * +` [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] + * * `instance_dot_version_dot_service =` + * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] `+ '.' + * +` [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] `+ '.' + * +` [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] + * If [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] is empty, + * then the task will be sent to the service which is the default service when + * the task is attempted. + * If [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] is empty, + * then the task will be sent to the version which is the default version when + * the task is attempted. + * If [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] is + * empty, then the task will be sent to an instance which is available when + * the task is attempted. + * If [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], + * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], or + * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] is + * invalid, then the task will be sent to the default version of the default + * service when the task is attempted. + * + * Generated from protobuf field string host = 4; + * @param string $var + * @return $this + */ + public function setHost($var) + { + GPBUtil::checkString($var, True); + $this->host = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AttemptStatus.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AttemptStatus.php new file mode 100644 index 000000000000..f249c75a16f2 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AttemptStatus.php @@ -0,0 +1,229 @@ +google.cloud.tasks.v2beta2.AttemptStatus + */ +class AttemptStatus extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The time that this attempt was scheduled. + * `schedule_time` will be truncated to the nearest microsecond. + * + * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 1; + */ + protected $schedule_time = null; + /** + * Output only. The time that this attempt was dispatched. + * `dispatch_time` will be truncated to the nearest microsecond. + * + * Generated from protobuf field .google.protobuf.Timestamp dispatch_time = 2; + */ + protected $dispatch_time = null; + /** + * Output only. The time that this attempt response was received. + * `response_time` will be truncated to the nearest microsecond. + * + * Generated from protobuf field .google.protobuf.Timestamp response_time = 3; + */ + protected $response_time = null; + /** + * Output only. The response from the target for this attempt. + * If the task has not been attempted or the task is currently running + * then the response status is unset. + * + * Generated from protobuf field .google.rpc.Status response_status = 4; + */ + protected $response_status = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $schedule_time + * Output only. The time that this attempt was scheduled. + * `schedule_time` will be truncated to the nearest microsecond. + * @type \Google\Protobuf\Timestamp $dispatch_time + * Output only. The time that this attempt was dispatched. + * `dispatch_time` will be truncated to the nearest microsecond. + * @type \Google\Protobuf\Timestamp $response_time + * Output only. The time that this attempt response was received. + * `response_time` will be truncated to the nearest microsecond. + * @type \Google\Rpc\Status $response_status + * Output only. The response from the target for this attempt. + * If the task has not been attempted or the task is currently running + * then the response status is unset. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Task::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The time that this attempt was scheduled. + * `schedule_time` will be truncated to the nearest microsecond. + * + * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getScheduleTime() + { + return $this->schedule_time; + } + + public function hasScheduleTime() + { + return isset($this->schedule_time); + } + + public function clearScheduleTime() + { + unset($this->schedule_time); + } + + /** + * Output only. The time that this attempt was scheduled. + * `schedule_time` will be truncated to the nearest microsecond. + * + * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setScheduleTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->schedule_time = $var; + + return $this; + } + + /** + * Output only. The time that this attempt was dispatched. + * `dispatch_time` will be truncated to the nearest microsecond. + * + * Generated from protobuf field .google.protobuf.Timestamp dispatch_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDispatchTime() + { + return $this->dispatch_time; + } + + public function hasDispatchTime() + { + return isset($this->dispatch_time); + } + + public function clearDispatchTime() + { + unset($this->dispatch_time); + } + + /** + * Output only. The time that this attempt was dispatched. + * `dispatch_time` will be truncated to the nearest microsecond. + * + * Generated from protobuf field .google.protobuf.Timestamp dispatch_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDispatchTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->dispatch_time = $var; + + return $this; + } + + /** + * Output only. The time that this attempt response was received. + * `response_time` will be truncated to the nearest microsecond. + * + * Generated from protobuf field .google.protobuf.Timestamp response_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getResponseTime() + { + return $this->response_time; + } + + public function hasResponseTime() + { + return isset($this->response_time); + } + + public function clearResponseTime() + { + unset($this->response_time); + } + + /** + * Output only. The time that this attempt response was received. + * `response_time` will be truncated to the nearest microsecond. + * + * Generated from protobuf field .google.protobuf.Timestamp response_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setResponseTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->response_time = $var; + + return $this; + } + + /** + * Output only. The response from the target for this attempt. + * If the task has not been attempted or the task is currently running + * then the response status is unset. + * + * Generated from protobuf field .google.rpc.Status response_status = 4; + * @return \Google\Rpc\Status|null + */ + public function getResponseStatus() + { + return $this->response_status; + } + + public function hasResponseStatus() + { + return isset($this->response_status); + } + + public function clearResponseStatus() + { + unset($this->response_status); + } + + /** + * Output only. The response from the target for this attempt. + * If the task has not been attempted or the task is currently running + * then the response status is unset. + * + * Generated from protobuf field .google.rpc.Status response_status = 4; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setResponseStatus($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->response_status = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/CancelLeaseRequest.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/CancelLeaseRequest.php new file mode 100644 index 000000000000..a07ba30cb995 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/CancelLeaseRequest.php @@ -0,0 +1,206 @@ +google.cloud.tasks.v2beta2.CancelLeaseRequest + */ +class CancelLeaseRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. The task's current schedule time, available in the + * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] returned by + * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] response or + * [RenewLease][google.cloud.tasks.v2beta2.CloudTasks.RenewLease] response. + * This restriction is to ensure that your worker currently holds the lease. + * + * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $schedule_time = null; + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta2.Task] will be returned. + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta2.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View response_view = 3; + */ + protected $response_view = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * @type \Google\Protobuf\Timestamp $schedule_time + * Required. The task's current schedule time, available in the + * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] returned by + * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] response or + * [RenewLease][google.cloud.tasks.v2beta2.CloudTasks.RenewLease] response. + * This restriction is to ensure that your worker currently holds the lease. + * @type int $response_view + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta2.Task] will be returned. + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta2.Task] resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The task's current schedule time, available in the + * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] returned by + * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] response or + * [RenewLease][google.cloud.tasks.v2beta2.CloudTasks.RenewLease] response. + * This restriction is to ensure that your worker currently holds the lease. + * + * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getScheduleTime() + { + return $this->schedule_time; + } + + public function hasScheduleTime() + { + return isset($this->schedule_time); + } + + public function clearScheduleTime() + { + unset($this->schedule_time); + } + + /** + * Required. The task's current schedule time, available in the + * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] returned by + * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] response or + * [RenewLease][google.cloud.tasks.v2beta2.CloudTasks.RenewLease] response. + * This restriction is to ensure that your worker currently holds the lease. + * + * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setScheduleTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->schedule_time = $var; + + return $this; + } + + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta2.Task] will be returned. + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta2.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View response_view = 3; + * @return int + */ + public function getResponseView() + { + return $this->response_view; + } + + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta2.Task] will be returned. + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta2.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View response_view = 3; + * @param int $var + * @return $this + */ + public function setResponseView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta2\Task\View::class); + $this->response_view = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/CreateQueueRequest.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/CreateQueueRequest.php new file mode 100644 index 000000000000..0eeb5944f56e --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/CreateQueueRequest.php @@ -0,0 +1,136 @@ +google.cloud.tasks.v2beta2.CreateQueueRequest + */ +class CreateQueueRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The location name in which the queue will be created. + * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * The list of allowed locations can be obtained by calling Cloud + * Tasks' implementation of + * [ListLocations][google.cloud.location.Locations.ListLocations]. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The queue to create. + * [Queue's name][google.cloud.tasks.v2beta2.Queue.name] cannot be the same as + * an existing queue. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.Queue queue = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $queue = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The location name in which the queue will be created. + * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * The list of allowed locations can be obtained by calling Cloud + * Tasks' implementation of + * [ListLocations][google.cloud.location.Locations.ListLocations]. + * @type \Google\Cloud\Tasks\V2beta2\Queue $queue + * Required. The queue to create. + * [Queue's name][google.cloud.tasks.v2beta2.Queue.name] cannot be the same as + * an existing queue. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * Required. The location name in which the queue will be created. + * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * The list of allowed locations can be obtained by calling Cloud + * Tasks' implementation of + * [ListLocations][google.cloud.location.Locations.ListLocations]. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The location name in which the queue will be created. + * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * The list of allowed locations can be obtained by calling Cloud + * Tasks' implementation of + * [ListLocations][google.cloud.location.Locations.ListLocations]. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The queue to create. + * [Queue's name][google.cloud.tasks.v2beta2.Queue.name] cannot be the same as + * an existing queue. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.Queue queue = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Tasks\V2beta2\Queue|null + */ + public function getQueue() + { + return $this->queue; + } + + public function hasQueue() + { + return isset($this->queue); + } + + public function clearQueue() + { + unset($this->queue); + } + + /** + * Required. The queue to create. + * [Queue's name][google.cloud.tasks.v2beta2.Queue.name] cannot be the same as + * an existing queue. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.Queue queue = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Tasks\V2beta2\Queue $var + * @return $this + */ + public function setQueue($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\Queue::class); + $this->queue = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/CreateTaskRequest.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/CreateTaskRequest.php new file mode 100644 index 000000000000..ccf05e0c56db --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/CreateTaskRequest.php @@ -0,0 +1,302 @@ +google.cloud.tasks.v2beta2.CreateTaskRequest + */ +class CreateTaskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * The queue must already exist. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The task to add. + * Task names have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. + * The user can optionally specify a task + * [name][google.cloud.tasks.v2beta2.Task.name]. If a name is not specified + * then the system will generate a random unique task id, which will be set in + * the task returned in the [response][google.cloud.tasks.v2beta2.Task.name]. + * If [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] is not + * set or is in the past then Cloud Tasks will set it to the current time. + * Task De-duplication: + * Explicitly specifying a task ID enables task de-duplication. If + * a task's ID is identical to that of an existing task or a task + * that was deleted or completed recently then the call will fail + * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. + * If the task's queue was created using Cloud Tasks, then another task with + * the same name can't be created for ~1 hour after the original task was + * deleted or completed. If the task's queue was created using queue.yaml or + * queue.xml, then another task with the same name can't be created + * for ~9 days after the original task was deleted or completed. + * Because there is an extra lookup cost to identify duplicate task + * names, these [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] + * calls have significantly increased latency. Using hashed strings for the + * task id or for the prefix of the task id is recommended. Choosing task ids + * that are sequential or have sequential prefixes, for example using a + * timestamp, causes an increase in latency and error rates in all + * task commands. The infrastructure relies on an approximately + * uniform distribution of task ids to store and serve tasks + * efficiently. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.Task task = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $task = null; + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta2.Task] will be returned. + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta2.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View response_view = 3; + */ + protected $response_view = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * The queue must already exist. + * @type \Google\Cloud\Tasks\V2beta2\Task $task + * Required. The task to add. + * Task names have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. + * The user can optionally specify a task + * [name][google.cloud.tasks.v2beta2.Task.name]. If a name is not specified + * then the system will generate a random unique task id, which will be set in + * the task returned in the [response][google.cloud.tasks.v2beta2.Task.name]. + * If [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] is not + * set or is in the past then Cloud Tasks will set it to the current time. + * Task De-duplication: + * Explicitly specifying a task ID enables task de-duplication. If + * a task's ID is identical to that of an existing task or a task + * that was deleted or completed recently then the call will fail + * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. + * If the task's queue was created using Cloud Tasks, then another task with + * the same name can't be created for ~1 hour after the original task was + * deleted or completed. If the task's queue was created using queue.yaml or + * queue.xml, then another task with the same name can't be created + * for ~9 days after the original task was deleted or completed. + * Because there is an extra lookup cost to identify duplicate task + * names, these [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] + * calls have significantly increased latency. Using hashed strings for the + * task id or for the prefix of the task id is recommended. Choosing task ids + * that are sequential or have sequential prefixes, for example using a + * timestamp, causes an increase in latency and error rates in all + * task commands. The infrastructure relies on an approximately + * uniform distribution of task ids to store and serve tasks + * efficiently. + * @type int $response_view + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta2.Task] will be returned. + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta2.Task] resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * The queue must already exist. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * The queue must already exist. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The task to add. + * Task names have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. + * The user can optionally specify a task + * [name][google.cloud.tasks.v2beta2.Task.name]. If a name is not specified + * then the system will generate a random unique task id, which will be set in + * the task returned in the [response][google.cloud.tasks.v2beta2.Task.name]. + * If [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] is not + * set or is in the past then Cloud Tasks will set it to the current time. + * Task De-duplication: + * Explicitly specifying a task ID enables task de-duplication. If + * a task's ID is identical to that of an existing task or a task + * that was deleted or completed recently then the call will fail + * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. + * If the task's queue was created using Cloud Tasks, then another task with + * the same name can't be created for ~1 hour after the original task was + * deleted or completed. If the task's queue was created using queue.yaml or + * queue.xml, then another task with the same name can't be created + * for ~9 days after the original task was deleted or completed. + * Because there is an extra lookup cost to identify duplicate task + * names, these [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] + * calls have significantly increased latency. Using hashed strings for the + * task id or for the prefix of the task id is recommended. Choosing task ids + * that are sequential or have sequential prefixes, for example using a + * timestamp, causes an increase in latency and error rates in all + * task commands. The infrastructure relies on an approximately + * uniform distribution of task ids to store and serve tasks + * efficiently. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.Task task = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Tasks\V2beta2\Task|null + */ + public function getTask() + { + return $this->task; + } + + public function hasTask() + { + return isset($this->task); + } + + public function clearTask() + { + unset($this->task); + } + + /** + * Required. The task to add. + * Task names have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. + * The user can optionally specify a task + * [name][google.cloud.tasks.v2beta2.Task.name]. If a name is not specified + * then the system will generate a random unique task id, which will be set in + * the task returned in the [response][google.cloud.tasks.v2beta2.Task.name]. + * If [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] is not + * set or is in the past then Cloud Tasks will set it to the current time. + * Task De-duplication: + * Explicitly specifying a task ID enables task de-duplication. If + * a task's ID is identical to that of an existing task or a task + * that was deleted or completed recently then the call will fail + * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. + * If the task's queue was created using Cloud Tasks, then another task with + * the same name can't be created for ~1 hour after the original task was + * deleted or completed. If the task's queue was created using queue.yaml or + * queue.xml, then another task with the same name can't be created + * for ~9 days after the original task was deleted or completed. + * Because there is an extra lookup cost to identify duplicate task + * names, these [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] + * calls have significantly increased latency. Using hashed strings for the + * task id or for the prefix of the task id is recommended. Choosing task ids + * that are sequential or have sequential prefixes, for example using a + * timestamp, causes an increase in latency and error rates in all + * task commands. The infrastructure relies on an approximately + * uniform distribution of task ids to store and serve tasks + * efficiently. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.Task task = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Tasks\V2beta2\Task $var + * @return $this + */ + public function setTask($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\Task::class); + $this->task = $var; + + return $this; + } + + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta2.Task] will be returned. + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta2.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View response_view = 3; + * @return int + */ + public function getResponseView() + { + return $this->response_view; + } + + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta2.Task] will be returned. + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta2.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View response_view = 3; + * @param int $var + * @return $this + */ + public function setResponseView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta2\Task\View::class); + $this->response_view = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/DeleteQueueRequest.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/DeleteQueueRequest.php new file mode 100644 index 000000000000..204cb50c0a33 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/DeleteQueueRequest.php @@ -0,0 +1,72 @@ +google.cloud.tasks.v2beta2.DeleteQueueRequest + */ +class DeleteQueueRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/DeleteTaskRequest.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/DeleteTaskRequest.php new file mode 100644 index 000000000000..90e1ae6db930 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/DeleteTaskRequest.php @@ -0,0 +1,72 @@ +google.cloud.tasks.v2beta2.DeleteTaskRequest + */ +class DeleteTaskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/GetQueueRequest.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/GetQueueRequest.php new file mode 100644 index 000000000000..06c2a0ecd5ce --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/GetQueueRequest.php @@ -0,0 +1,128 @@ +google.cloud.tasks.v2beta2.GetQueueRequest + */ +class GetQueueRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the queue. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. Read mask is used for a more granular control over what the API + * returns. If the mask is not present all fields will be returned except + * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly + * specified in the mask. + * + * Generated from protobuf field .google.protobuf.FieldMask read_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $read_mask = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the queue. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * @type \Google\Protobuf\FieldMask $read_mask + * Optional. Read mask is used for a more granular control over what the API + * returns. If the mask is not present all fields will be returned except + * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly + * specified in the mask. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the queue. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the queue. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. Read mask is used for a more granular control over what the API + * returns. If the mask is not present all fields will be returned except + * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly + * specified in the mask. + * + * Generated from protobuf field .google.protobuf.FieldMask read_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getReadMask() + { + return $this->read_mask; + } + + public function hasReadMask() + { + return isset($this->read_mask); + } + + public function clearReadMask() + { + unset($this->read_mask); + } + + /** + * Optional. Read mask is used for a more granular control over what the API + * returns. If the mask is not present all fields will be returned except + * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly + * specified in the mask. + * + * Generated from protobuf field .google.protobuf.FieldMask read_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setReadMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->read_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/GetTaskRequest.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/GetTaskRequest.php new file mode 100644 index 000000000000..e1c29520dd88 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/GetTaskRequest.php @@ -0,0 +1,146 @@ +google.cloud.tasks.v2beta2.GetTaskRequest + */ +class GetTaskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta2.Task] will be returned. + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta2.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View response_view = 2; + */ + protected $response_view = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * @type int $response_view + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta2.Task] will be returned. + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta2.Task] resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta2.Task] will be returned. + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta2.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View response_view = 2; + * @return int + */ + public function getResponseView() + { + return $this->response_view; + } + + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta2.Task] will be returned. + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta2.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View response_view = 2; + * @param int $var + * @return $this + */ + public function setResponseView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta2\Task\View::class); + $this->response_view = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/HttpMethod.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/HttpMethod.php new file mode 100644 index 000000000000..b70a89dc91d7 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/HttpMethod.php @@ -0,0 +1,96 @@ +google.cloud.tasks.v2beta2.HttpMethod + */ +class HttpMethod +{ + /** + * HTTP method unspecified + * + * Generated from protobuf enum HTTP_METHOD_UNSPECIFIED = 0; + */ + const HTTP_METHOD_UNSPECIFIED = 0; + /** + * HTTP POST + * + * Generated from protobuf enum POST = 1; + */ + const POST = 1; + /** + * HTTP GET + * + * Generated from protobuf enum GET = 2; + */ + const GET = 2; + /** + * HTTP HEAD + * + * Generated from protobuf enum HEAD = 3; + */ + const HEAD = 3; + /** + * HTTP PUT + * + * Generated from protobuf enum PUT = 4; + */ + const PUT = 4; + /** + * HTTP DELETE + * + * Generated from protobuf enum DELETE = 5; + */ + const DELETE = 5; + /** + * HTTP PATCH + * + * Generated from protobuf enum PATCH = 6; + */ + const PATCH = 6; + /** + * HTTP OPTIONS + * + * Generated from protobuf enum OPTIONS = 7; + */ + const OPTIONS = 7; + + private static $valueToName = [ + self::HTTP_METHOD_UNSPECIFIED => 'HTTP_METHOD_UNSPECIFIED', + self::POST => 'POST', + self::GET => 'GET', + self::HEAD => 'HEAD', + self::PUT => 'PUT', + self::DELETE => 'DELETE', + self::PATCH => 'PATCH', + self::OPTIONS => 'OPTIONS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/HttpRequest.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/HttpRequest.php new file mode 100644 index 000000000000..28eb2b523d6d --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/HttpRequest.php @@ -0,0 +1,416 @@ +google.cloud.tasks.v2beta2.HttpRequest + */ +class HttpRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The full url path that the request will be sent to. + * This string must begin with either "http://" or "https://". Some examples + * are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will + * encode some characters for safety and compatibility. The maximum allowed + * URL length is 2083 characters after encoding. + * The `Location` header response from a redirect response [`300` - `399`] + * may be followed. The redirect is not counted as a separate attempt. + * + * Generated from protobuf field string url = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $url = ''; + /** + * The HTTP method to use for the request. The default is POST. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.HttpMethod http_method = 2; + */ + protected $http_method = 0; + /** + * HTTP request headers. + * This map contains the header field names and values. + * Headers can be set when running the + * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] or + * [task is created][google.cloud.tasks.v2beta2.CloudTasks.BufferTask]. + * These headers represent a subset of the headers that will accompany the + * task's HTTP request. Some HTTP request headers will be ignored or replaced. + * A partial list of headers that will be ignored or replaced is: + * * Any header that is prefixed with "X-CloudTasks-" will be treated + * as service header. Service headers define properties of the task and are + * predefined in CloudTask. + * * Host: This will be computed by Cloud Tasks and derived from + * [HttpRequest.url][google.cloud.tasks.v2beta2.HttpRequest.url]. + * * Content-Length: This will be computed by Cloud Tasks. + * * User-Agent: This will be set to `"Google-Cloud-Tasks"`. + * * `X-Google-*`: Google use only. + * * `X-AppEngine-*`: Google use only. + * `Content-Type` won't be set by Cloud Tasks. You can explicitly set + * `Content-Type` to a media type when the + * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. + * For example, `Content-Type` can be set to `"application/octet-stream"` or + * `"application/json"`. + * Headers which can have multiple values (according to RFC2616) can be + * specified using comma-separated values. + * The size of the headers must be less than 80KB. + * + * Generated from protobuf field map headers = 3; + */ + private $headers; + /** + * HTTP request body. + * A request body is allowed only if the + * [HTTP method][google.cloud.tasks.v2beta2.HttpRequest.http_method] is POST, + * PUT, or PATCH. It is an error to set body on a task with an incompatible + * [HttpMethod][google.cloud.tasks.v2beta2.HttpMethod]. + * + * Generated from protobuf field bytes body = 4; + */ + protected $body = ''; + protected $authorization_header; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $url + * Required. The full url path that the request will be sent to. + * This string must begin with either "http://" or "https://". Some examples + * are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will + * encode some characters for safety and compatibility. The maximum allowed + * URL length is 2083 characters after encoding. + * The `Location` header response from a redirect response [`300` - `399`] + * may be followed. The redirect is not counted as a separate attempt. + * @type int $http_method + * The HTTP method to use for the request. The default is POST. + * @type array|\Google\Protobuf\Internal\MapField $headers + * HTTP request headers. + * This map contains the header field names and values. + * Headers can be set when running the + * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] or + * [task is created][google.cloud.tasks.v2beta2.CloudTasks.BufferTask]. + * These headers represent a subset of the headers that will accompany the + * task's HTTP request. Some HTTP request headers will be ignored or replaced. + * A partial list of headers that will be ignored or replaced is: + * * Any header that is prefixed with "X-CloudTasks-" will be treated + * as service header. Service headers define properties of the task and are + * predefined in CloudTask. + * * Host: This will be computed by Cloud Tasks and derived from + * [HttpRequest.url][google.cloud.tasks.v2beta2.HttpRequest.url]. + * * Content-Length: This will be computed by Cloud Tasks. + * * User-Agent: This will be set to `"Google-Cloud-Tasks"`. + * * `X-Google-*`: Google use only. + * * `X-AppEngine-*`: Google use only. + * `Content-Type` won't be set by Cloud Tasks. You can explicitly set + * `Content-Type` to a media type when the + * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. + * For example, `Content-Type` can be set to `"application/octet-stream"` or + * `"application/json"`. + * Headers which can have multiple values (according to RFC2616) can be + * specified using comma-separated values. + * The size of the headers must be less than 80KB. + * @type string $body + * HTTP request body. + * A request body is allowed only if the + * [HTTP method][google.cloud.tasks.v2beta2.HttpRequest.http_method] is POST, + * PUT, or PATCH. It is an error to set body on a task with an incompatible + * [HttpMethod][google.cloud.tasks.v2beta2.HttpMethod]. + * @type \Google\Cloud\Tasks\V2beta2\OAuthToken $oauth_token + * If specified, an + * [OAuth token](https://developers.google.com/identity/protocols/OAuth2) + * will be generated and attached as an `Authorization` header in the HTTP + * request. + * This type of authorization should generally only be used when calling + * Google APIs hosted on *.googleapis.com. + * @type \Google\Cloud\Tasks\V2beta2\OidcToken $oidc_token + * If specified, an + * [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) + * token will be generated and attached as an `Authorization` header in the + * HTTP request. + * This type of authorization can be used for many scenarios, including + * calling Cloud Run, or endpoints where you intend to validate the token + * yourself. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Target::initOnce(); + parent::__construct($data); + } + + /** + * Required. The full url path that the request will be sent to. + * This string must begin with either "http://" or "https://". Some examples + * are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will + * encode some characters for safety and compatibility. The maximum allowed + * URL length is 2083 characters after encoding. + * The `Location` header response from a redirect response [`300` - `399`] + * may be followed. The redirect is not counted as a separate attempt. + * + * Generated from protobuf field string url = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUrl() + { + return $this->url; + } + + /** + * Required. The full url path that the request will be sent to. + * This string must begin with either "http://" or "https://". Some examples + * are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will + * encode some characters for safety and compatibility. The maximum allowed + * URL length is 2083 characters after encoding. + * The `Location` header response from a redirect response [`300` - `399`] + * may be followed. The redirect is not counted as a separate attempt. + * + * Generated from protobuf field string url = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setUrl($var) + { + GPBUtil::checkString($var, True); + $this->url = $var; + + return $this; + } + + /** + * The HTTP method to use for the request. The default is POST. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.HttpMethod http_method = 2; + * @return int + */ + public function getHttpMethod() + { + return $this->http_method; + } + + /** + * The HTTP method to use for the request. The default is POST. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.HttpMethod http_method = 2; + * @param int $var + * @return $this + */ + public function setHttpMethod($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta2\HttpMethod::class); + $this->http_method = $var; + + return $this; + } + + /** + * HTTP request headers. + * This map contains the header field names and values. + * Headers can be set when running the + * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] or + * [task is created][google.cloud.tasks.v2beta2.CloudTasks.BufferTask]. + * These headers represent a subset of the headers that will accompany the + * task's HTTP request. Some HTTP request headers will be ignored or replaced. + * A partial list of headers that will be ignored or replaced is: + * * Any header that is prefixed with "X-CloudTasks-" will be treated + * as service header. Service headers define properties of the task and are + * predefined in CloudTask. + * * Host: This will be computed by Cloud Tasks and derived from + * [HttpRequest.url][google.cloud.tasks.v2beta2.HttpRequest.url]. + * * Content-Length: This will be computed by Cloud Tasks. + * * User-Agent: This will be set to `"Google-Cloud-Tasks"`. + * * `X-Google-*`: Google use only. + * * `X-AppEngine-*`: Google use only. + * `Content-Type` won't be set by Cloud Tasks. You can explicitly set + * `Content-Type` to a media type when the + * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. + * For example, `Content-Type` can be set to `"application/octet-stream"` or + * `"application/json"`. + * Headers which can have multiple values (according to RFC2616) can be + * specified using comma-separated values. + * The size of the headers must be less than 80KB. + * + * Generated from protobuf field map headers = 3; + * @return \Google\Protobuf\Internal\MapField + */ + public function getHeaders() + { + return $this->headers; + } + + /** + * HTTP request headers. + * This map contains the header field names and values. + * Headers can be set when running the + * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] or + * [task is created][google.cloud.tasks.v2beta2.CloudTasks.BufferTask]. + * These headers represent a subset of the headers that will accompany the + * task's HTTP request. Some HTTP request headers will be ignored or replaced. + * A partial list of headers that will be ignored or replaced is: + * * Any header that is prefixed with "X-CloudTasks-" will be treated + * as service header. Service headers define properties of the task and are + * predefined in CloudTask. + * * Host: This will be computed by Cloud Tasks and derived from + * [HttpRequest.url][google.cloud.tasks.v2beta2.HttpRequest.url]. + * * Content-Length: This will be computed by Cloud Tasks. + * * User-Agent: This will be set to `"Google-Cloud-Tasks"`. + * * `X-Google-*`: Google use only. + * * `X-AppEngine-*`: Google use only. + * `Content-Type` won't be set by Cloud Tasks. You can explicitly set + * `Content-Type` to a media type when the + * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. + * For example, `Content-Type` can be set to `"application/octet-stream"` or + * `"application/json"`. + * Headers which can have multiple values (according to RFC2616) can be + * specified using comma-separated values. + * The size of the headers must be less than 80KB. + * + * Generated from protobuf field map headers = 3; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setHeaders($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->headers = $arr; + + return $this; + } + + /** + * HTTP request body. + * A request body is allowed only if the + * [HTTP method][google.cloud.tasks.v2beta2.HttpRequest.http_method] is POST, + * PUT, or PATCH. It is an error to set body on a task with an incompatible + * [HttpMethod][google.cloud.tasks.v2beta2.HttpMethod]. + * + * Generated from protobuf field bytes body = 4; + * @return string + */ + public function getBody() + { + return $this->body; + } + + /** + * HTTP request body. + * A request body is allowed only if the + * [HTTP method][google.cloud.tasks.v2beta2.HttpRequest.http_method] is POST, + * PUT, or PATCH. It is an error to set body on a task with an incompatible + * [HttpMethod][google.cloud.tasks.v2beta2.HttpMethod]. + * + * Generated from protobuf field bytes body = 4; + * @param string $var + * @return $this + */ + public function setBody($var) + { + GPBUtil::checkString($var, False); + $this->body = $var; + + return $this; + } + + /** + * If specified, an + * [OAuth token](https://developers.google.com/identity/protocols/OAuth2) + * will be generated and attached as an `Authorization` header in the HTTP + * request. + * This type of authorization should generally only be used when calling + * Google APIs hosted on *.googleapis.com. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.OAuthToken oauth_token = 5; + * @return \Google\Cloud\Tasks\V2beta2\OAuthToken|null + */ + public function getOauthToken() + { + return $this->readOneof(5); + } + + public function hasOauthToken() + { + return $this->hasOneof(5); + } + + /** + * If specified, an + * [OAuth token](https://developers.google.com/identity/protocols/OAuth2) + * will be generated and attached as an `Authorization` header in the HTTP + * request. + * This type of authorization should generally only be used when calling + * Google APIs hosted on *.googleapis.com. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.OAuthToken oauth_token = 5; + * @param \Google\Cloud\Tasks\V2beta2\OAuthToken $var + * @return $this + */ + public function setOauthToken($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\OAuthToken::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * If specified, an + * [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) + * token will be generated and attached as an `Authorization` header in the + * HTTP request. + * This type of authorization can be used for many scenarios, including + * calling Cloud Run, or endpoints where you intend to validate the token + * yourself. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.OidcToken oidc_token = 6; + * @return \Google\Cloud\Tasks\V2beta2\OidcToken|null + */ + public function getOidcToken() + { + return $this->readOneof(6); + } + + public function hasOidcToken() + { + return $this->hasOneof(6); + } + + /** + * If specified, an + * [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) + * token will be generated and attached as an `Authorization` header in the + * HTTP request. + * This type of authorization can be used for many scenarios, including + * calling Cloud Run, or endpoints where you intend to validate the token + * yourself. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.OidcToken oidc_token = 6; + * @param \Google\Cloud\Tasks\V2beta2\OidcToken $var + * @return $this + */ + public function setOidcToken($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\OidcToken::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * @return string + */ + public function getAuthorizationHeader() + { + return $this->whichOneof("authorization_header"); + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/HttpTarget.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/HttpTarget.php new file mode 100644 index 000000000000..7b156261f564 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/HttpTarget.php @@ -0,0 +1,375 @@ +google.cloud.tasks.v2beta2.HttpTarget + */ +class HttpTarget extends \Google\Protobuf\Internal\Message +{ + /** + * Uri override. + * When specified, overrides the execution Uri for all the tasks in the queue. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.UriOverride uri_override = 1; + */ + protected $uri_override = null; + /** + * The HTTP method to use for the request. + * When specified, it overrides + * [HttpRequest][google.cloud.tasks.v2beta2.HttpTarget.http_method] for the + * task. Note that if the value is set to [HttpMethod][GET] the + * [HttpRequest][body] of the task will be ignored at execution time. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.HttpMethod http_method = 2; + */ + protected $http_method = 0; + /** + * HTTP target headers. + * This map contains the header field names and values. + * Headers will be set when running the + * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] and/or + * [task is created][google.cloud.tasks.v2beta2.CloudTasks.BufferTask]. + * These headers represent a subset of the headers that will accompany the + * task's HTTP request. Some HTTP request headers will be ignored or replaced. + * A partial list of headers that will be ignored or replaced is: + * * Any header that is prefixed with "X-CloudTasks-" will be treated + * as service header. Service headers define properties of the task and are + * predefined in CloudTask. + * * Host: This will be computed by Cloud Tasks and derived from + * [HttpRequest.url][google.cloud.tasks.v2beta2.HttpRequest.url]. + * * Content-Length: This will be computed by Cloud Tasks. + * * User-Agent: This will be set to `"Google-CloudTasks"`. + * * `X-Google-*`: Google use only. + * * `X-AppEngine-*`: Google use only. + * `Content-Type` won't be set by Cloud Tasks. You can explicitly set + * `Content-Type` to a media type when the + * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. + * For example, `Content-Type` can be set to `"application/octet-stream"` or + * `"application/json"`. + * Headers which can have multiple values (according to RFC2616) can be + * specified using comma-separated values. + * The size of the headers must be less than 80KB. + * Queue-level headers to override headers of all the tasks in the queue. + * + * Generated from protobuf field repeated .google.cloud.tasks.v2beta2.HttpTarget.HeaderOverride header_overrides = 3; + */ + private $header_overrides; + protected $authorization_header; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Tasks\V2beta2\UriOverride $uri_override + * Uri override. + * When specified, overrides the execution Uri for all the tasks in the queue. + * @type int $http_method + * The HTTP method to use for the request. + * When specified, it overrides + * [HttpRequest][google.cloud.tasks.v2beta2.HttpTarget.http_method] for the + * task. Note that if the value is set to [HttpMethod][GET] the + * [HttpRequest][body] of the task will be ignored at execution time. + * @type array<\Google\Cloud\Tasks\V2beta2\HttpTarget\HeaderOverride>|\Google\Protobuf\Internal\RepeatedField $header_overrides + * HTTP target headers. + * This map contains the header field names and values. + * Headers will be set when running the + * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] and/or + * [task is created][google.cloud.tasks.v2beta2.CloudTasks.BufferTask]. + * These headers represent a subset of the headers that will accompany the + * task's HTTP request. Some HTTP request headers will be ignored or replaced. + * A partial list of headers that will be ignored or replaced is: + * * Any header that is prefixed with "X-CloudTasks-" will be treated + * as service header. Service headers define properties of the task and are + * predefined in CloudTask. + * * Host: This will be computed by Cloud Tasks and derived from + * [HttpRequest.url][google.cloud.tasks.v2beta2.HttpRequest.url]. + * * Content-Length: This will be computed by Cloud Tasks. + * * User-Agent: This will be set to `"Google-CloudTasks"`. + * * `X-Google-*`: Google use only. + * * `X-AppEngine-*`: Google use only. + * `Content-Type` won't be set by Cloud Tasks. You can explicitly set + * `Content-Type` to a media type when the + * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. + * For example, `Content-Type` can be set to `"application/octet-stream"` or + * `"application/json"`. + * Headers which can have multiple values (according to RFC2616) can be + * specified using comma-separated values. + * The size of the headers must be less than 80KB. + * Queue-level headers to override headers of all the tasks in the queue. + * @type \Google\Cloud\Tasks\V2beta2\OAuthToken $oauth_token + * If specified, an + * [OAuth token](https://developers.google.com/identity/protocols/OAuth2) + * will be generated and attached as an `Authorization` header in the HTTP + * request. + * This type of authorization should generally only be used when calling + * Google APIs hosted on *.googleapis.com. + * @type \Google\Cloud\Tasks\V2beta2\OidcToken $oidc_token + * If specified, an + * [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) + * token will be generated and attached as an `Authorization` header in the + * HTTP request. + * This type of authorization can be used for many scenarios, including + * calling Cloud Run, or endpoints where you intend to validate the token + * yourself. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Target::initOnce(); + parent::__construct($data); + } + + /** + * Uri override. + * When specified, overrides the execution Uri for all the tasks in the queue. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.UriOverride uri_override = 1; + * @return \Google\Cloud\Tasks\V2beta2\UriOverride|null + */ + public function getUriOverride() + { + return $this->uri_override; + } + + public function hasUriOverride() + { + return isset($this->uri_override); + } + + public function clearUriOverride() + { + unset($this->uri_override); + } + + /** + * Uri override. + * When specified, overrides the execution Uri for all the tasks in the queue. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.UriOverride uri_override = 1; + * @param \Google\Cloud\Tasks\V2beta2\UriOverride $var + * @return $this + */ + public function setUriOverride($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\UriOverride::class); + $this->uri_override = $var; + + return $this; + } + + /** + * The HTTP method to use for the request. + * When specified, it overrides + * [HttpRequest][google.cloud.tasks.v2beta2.HttpTarget.http_method] for the + * task. Note that if the value is set to [HttpMethod][GET] the + * [HttpRequest][body] of the task will be ignored at execution time. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.HttpMethod http_method = 2; + * @return int + */ + public function getHttpMethod() + { + return $this->http_method; + } + + /** + * The HTTP method to use for the request. + * When specified, it overrides + * [HttpRequest][google.cloud.tasks.v2beta2.HttpTarget.http_method] for the + * task. Note that if the value is set to [HttpMethod][GET] the + * [HttpRequest][body] of the task will be ignored at execution time. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.HttpMethod http_method = 2; + * @param int $var + * @return $this + */ + public function setHttpMethod($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta2\HttpMethod::class); + $this->http_method = $var; + + return $this; + } + + /** + * HTTP target headers. + * This map contains the header field names and values. + * Headers will be set when running the + * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] and/or + * [task is created][google.cloud.tasks.v2beta2.CloudTasks.BufferTask]. + * These headers represent a subset of the headers that will accompany the + * task's HTTP request. Some HTTP request headers will be ignored or replaced. + * A partial list of headers that will be ignored or replaced is: + * * Any header that is prefixed with "X-CloudTasks-" will be treated + * as service header. Service headers define properties of the task and are + * predefined in CloudTask. + * * Host: This will be computed by Cloud Tasks and derived from + * [HttpRequest.url][google.cloud.tasks.v2beta2.HttpRequest.url]. + * * Content-Length: This will be computed by Cloud Tasks. + * * User-Agent: This will be set to `"Google-CloudTasks"`. + * * `X-Google-*`: Google use only. + * * `X-AppEngine-*`: Google use only. + * `Content-Type` won't be set by Cloud Tasks. You can explicitly set + * `Content-Type` to a media type when the + * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. + * For example, `Content-Type` can be set to `"application/octet-stream"` or + * `"application/json"`. + * Headers which can have multiple values (according to RFC2616) can be + * specified using comma-separated values. + * The size of the headers must be less than 80KB. + * Queue-level headers to override headers of all the tasks in the queue. + * + * Generated from protobuf field repeated .google.cloud.tasks.v2beta2.HttpTarget.HeaderOverride header_overrides = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getHeaderOverrides() + { + return $this->header_overrides; + } + + /** + * HTTP target headers. + * This map contains the header field names and values. + * Headers will be set when running the + * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] and/or + * [task is created][google.cloud.tasks.v2beta2.CloudTasks.BufferTask]. + * These headers represent a subset of the headers that will accompany the + * task's HTTP request. Some HTTP request headers will be ignored or replaced. + * A partial list of headers that will be ignored or replaced is: + * * Any header that is prefixed with "X-CloudTasks-" will be treated + * as service header. Service headers define properties of the task and are + * predefined in CloudTask. + * * Host: This will be computed by Cloud Tasks and derived from + * [HttpRequest.url][google.cloud.tasks.v2beta2.HttpRequest.url]. + * * Content-Length: This will be computed by Cloud Tasks. + * * User-Agent: This will be set to `"Google-CloudTasks"`. + * * `X-Google-*`: Google use only. + * * `X-AppEngine-*`: Google use only. + * `Content-Type` won't be set by Cloud Tasks. You can explicitly set + * `Content-Type` to a media type when the + * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. + * For example, `Content-Type` can be set to `"application/octet-stream"` or + * `"application/json"`. + * Headers which can have multiple values (according to RFC2616) can be + * specified using comma-separated values. + * The size of the headers must be less than 80KB. + * Queue-level headers to override headers of all the tasks in the queue. + * + * Generated from protobuf field repeated .google.cloud.tasks.v2beta2.HttpTarget.HeaderOverride header_overrides = 3; + * @param array<\Google\Cloud\Tasks\V2beta2\HttpTarget\HeaderOverride>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setHeaderOverrides($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Tasks\V2beta2\HttpTarget\HeaderOverride::class); + $this->header_overrides = $arr; + + return $this; + } + + /** + * If specified, an + * [OAuth token](https://developers.google.com/identity/protocols/OAuth2) + * will be generated and attached as an `Authorization` header in the HTTP + * request. + * This type of authorization should generally only be used when calling + * Google APIs hosted on *.googleapis.com. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.OAuthToken oauth_token = 5; + * @return \Google\Cloud\Tasks\V2beta2\OAuthToken|null + */ + public function getOauthToken() + { + return $this->readOneof(5); + } + + public function hasOauthToken() + { + return $this->hasOneof(5); + } + + /** + * If specified, an + * [OAuth token](https://developers.google.com/identity/protocols/OAuth2) + * will be generated and attached as an `Authorization` header in the HTTP + * request. + * This type of authorization should generally only be used when calling + * Google APIs hosted on *.googleapis.com. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.OAuthToken oauth_token = 5; + * @param \Google\Cloud\Tasks\V2beta2\OAuthToken $var + * @return $this + */ + public function setOauthToken($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\OAuthToken::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * If specified, an + * [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) + * token will be generated and attached as an `Authorization` header in the + * HTTP request. + * This type of authorization can be used for many scenarios, including + * calling Cloud Run, or endpoints where you intend to validate the token + * yourself. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.OidcToken oidc_token = 6; + * @return \Google\Cloud\Tasks\V2beta2\OidcToken|null + */ + public function getOidcToken() + { + return $this->readOneof(6); + } + + public function hasOidcToken() + { + return $this->hasOneof(6); + } + + /** + * If specified, an + * [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) + * token will be generated and attached as an `Authorization` header in the + * HTTP request. + * This type of authorization can be used for many scenarios, including + * calling Cloud Run, or endpoints where you intend to validate the token + * yourself. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.OidcToken oidc_token = 6; + * @param \Google\Cloud\Tasks\V2beta2\OidcToken $var + * @return $this + */ + public function setOidcToken($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\OidcToken::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * @return string + */ + public function getAuthorizationHeader() + { + return $this->whichOneof("authorization_header"); + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/HttpTarget/Header.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/HttpTarget/Header.php new file mode 100644 index 000000000000..9ef84f7b4c64 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/HttpTarget/Header.php @@ -0,0 +1,104 @@ +google.cloud.tasks.v2beta2.HttpTarget.Header + */ +class Header extends \Google\Protobuf\Internal\Message +{ + /** + * The key of the header. + * + * Generated from protobuf field string key = 1; + */ + protected $key = ''; + /** + * The value of the header. + * + * Generated from protobuf field string value = 2; + */ + protected $value = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $key + * The key of the header. + * @type string $value + * The value of the header. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Target::initOnce(); + parent::__construct($data); + } + + /** + * The key of the header. + * + * Generated from protobuf field string key = 1; + * @return string + */ + public function getKey() + { + return $this->key; + } + + /** + * The key of the header. + * + * Generated from protobuf field string key = 1; + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, True); + $this->key = $var; + + return $this; + } + + /** + * The value of the header. + * + * Generated from protobuf field string value = 2; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * The value of the header. + * + * Generated from protobuf field string value = 2; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Header::class, \Google\Cloud\Tasks\V2beta2\HttpTarget_Header::class); + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/HttpTarget/HeaderOverride.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/HttpTarget/HeaderOverride.php new file mode 100644 index 000000000000..1581e46bffbb --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/HttpTarget/HeaderOverride.php @@ -0,0 +1,80 @@ +google.cloud.tasks.v2beta2.HttpTarget.HeaderOverride + */ +class HeaderOverride extends \Google\Protobuf\Internal\Message +{ + /** + * header embodying a key and a value. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.HttpTarget.Header header = 1; + */ + protected $header = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Tasks\V2beta2\HttpTarget\Header $header + * header embodying a key and a value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Target::initOnce(); + parent::__construct($data); + } + + /** + * header embodying a key and a value. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.HttpTarget.Header header = 1; + * @return \Google\Cloud\Tasks\V2beta2\HttpTarget\Header|null + */ + public function getHeader() + { + return $this->header; + } + + public function hasHeader() + { + return isset($this->header); + } + + public function clearHeader() + { + unset($this->header); + } + + /** + * header embodying a key and a value. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.HttpTarget.Header header = 1; + * @param \Google\Cloud\Tasks\V2beta2\HttpTarget\Header $var + * @return $this + */ + public function setHeader($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\HttpTarget\Header::class); + $this->header = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(HeaderOverride::class, \Google\Cloud\Tasks\V2beta2\HttpTarget_HeaderOverride::class); + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/LeaseTasksRequest.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/LeaseTasksRequest.php new file mode 100644 index 000000000000..2d91df19985e --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/LeaseTasksRequest.php @@ -0,0 +1,442 @@ +google.cloud.tasks.v2beta2.LeaseTasksRequest + */ +class LeaseTasksRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The maximum number of tasks to lease. + * The system will make a best effort to return as close to as + * `max_tasks` as possible. + * The largest that `max_tasks` can be is 1000. + * The maximum total size of a [lease tasks + * response][google.cloud.tasks.v2beta2.LeaseTasksResponse] is 32 MB. If the + * sum of all task sizes requested reaches this limit, fewer tasks than + * requested are returned. + * + * Generated from protobuf field int32 max_tasks = 2; + */ + protected $max_tasks = 0; + /** + * Required. The duration of the lease. + * Each task returned in the + * [response][google.cloud.tasks.v2beta2.LeaseTasksResponse] will have its + * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] set to the + * current time plus the `lease_duration`. The task is leased until its + * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]; thus, the + * task will not be returned to another + * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] call before + * its [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]. + * After the worker has successfully finished the work associated + * with the task, the worker must call via + * [AcknowledgeTask][google.cloud.tasks.v2beta2.CloudTasks.AcknowledgeTask] + * before the [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]. + * Otherwise the task will be returned to a later + * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] call so that + * another worker can retry it. + * The maximum lease duration is 1 week. + * `lease_duration` will be truncated to the nearest second. + * + * Generated from protobuf field .google.protobuf.Duration lease_duration = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $lease_duration = null; + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta2.Task] will be returned. + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta2.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View response_view = 4; + */ + protected $response_view = 0; + /** + * `filter` can be used to specify a subset of tasks to lease. + * When `filter` is set to `tag=` then the + * [response][google.cloud.tasks.v2beta2.LeaseTasksResponse] will contain only + * tasks whose [tag][google.cloud.tasks.v2beta2.PullMessage.tag] is equal to + * ``. `` must be less than 500 characters. + * When `filter` is set to `tag_function=oldest_tag()`, only tasks which have + * the same tag as the task with the oldest + * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] will be + * returned. + * Grammar Syntax: + * * `filter = "tag=" tag | "tag_function=" function` + * * `tag = string` + * * `function = "oldest_tag()"` + * The `oldest_tag()` function returns tasks which have the same tag as the + * oldest task (ordered by schedule time). + * SDK compatibility: Although the SDK allows tags to be either + * string or + * [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), + * only UTF-8 encoded tags can be used in Cloud Tasks. Tag which + * aren't UTF-8 encoded can't be used in the + * [filter][google.cloud.tasks.v2beta2.LeaseTasksRequest.filter] and the + * task's [tag][google.cloud.tasks.v2beta2.PullMessage.tag] will be displayed + * as empty in Cloud Tasks. + * + * Generated from protobuf field string filter = 5; + */ + protected $filter = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * @type int $max_tasks + * The maximum number of tasks to lease. + * The system will make a best effort to return as close to as + * `max_tasks` as possible. + * The largest that `max_tasks` can be is 1000. + * The maximum total size of a [lease tasks + * response][google.cloud.tasks.v2beta2.LeaseTasksResponse] is 32 MB. If the + * sum of all task sizes requested reaches this limit, fewer tasks than + * requested are returned. + * @type \Google\Protobuf\Duration $lease_duration + * Required. The duration of the lease. + * Each task returned in the + * [response][google.cloud.tasks.v2beta2.LeaseTasksResponse] will have its + * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] set to the + * current time plus the `lease_duration`. The task is leased until its + * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]; thus, the + * task will not be returned to another + * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] call before + * its [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]. + * After the worker has successfully finished the work associated + * with the task, the worker must call via + * [AcknowledgeTask][google.cloud.tasks.v2beta2.CloudTasks.AcknowledgeTask] + * before the [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]. + * Otherwise the task will be returned to a later + * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] call so that + * another worker can retry it. + * The maximum lease duration is 1 week. + * `lease_duration` will be truncated to the nearest second. + * @type int $response_view + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta2.Task] will be returned. + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta2.Task] resource. + * @type string $filter + * `filter` can be used to specify a subset of tasks to lease. + * When `filter` is set to `tag=` then the + * [response][google.cloud.tasks.v2beta2.LeaseTasksResponse] will contain only + * tasks whose [tag][google.cloud.tasks.v2beta2.PullMessage.tag] is equal to + * ``. `` must be less than 500 characters. + * When `filter` is set to `tag_function=oldest_tag()`, only tasks which have + * the same tag as the task with the oldest + * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] will be + * returned. + * Grammar Syntax: + * * `filter = "tag=" tag | "tag_function=" function` + * * `tag = string` + * * `function = "oldest_tag()"` + * The `oldest_tag()` function returns tasks which have the same tag as the + * oldest task (ordered by schedule time). + * SDK compatibility: Although the SDK allows tags to be either + * string or + * [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), + * only UTF-8 encoded tags can be used in Cloud Tasks. Tag which + * aren't UTF-8 encoded can't be used in the + * [filter][google.cloud.tasks.v2beta2.LeaseTasksRequest.filter] and the + * task's [tag][google.cloud.tasks.v2beta2.PullMessage.tag] will be displayed + * as empty in Cloud Tasks. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The maximum number of tasks to lease. + * The system will make a best effort to return as close to as + * `max_tasks` as possible. + * The largest that `max_tasks` can be is 1000. + * The maximum total size of a [lease tasks + * response][google.cloud.tasks.v2beta2.LeaseTasksResponse] is 32 MB. If the + * sum of all task sizes requested reaches this limit, fewer tasks than + * requested are returned. + * + * Generated from protobuf field int32 max_tasks = 2; + * @return int + */ + public function getMaxTasks() + { + return $this->max_tasks; + } + + /** + * The maximum number of tasks to lease. + * The system will make a best effort to return as close to as + * `max_tasks` as possible. + * The largest that `max_tasks` can be is 1000. + * The maximum total size of a [lease tasks + * response][google.cloud.tasks.v2beta2.LeaseTasksResponse] is 32 MB. If the + * sum of all task sizes requested reaches this limit, fewer tasks than + * requested are returned. + * + * Generated from protobuf field int32 max_tasks = 2; + * @param int $var + * @return $this + */ + public function setMaxTasks($var) + { + GPBUtil::checkInt32($var); + $this->max_tasks = $var; + + return $this; + } + + /** + * Required. The duration of the lease. + * Each task returned in the + * [response][google.cloud.tasks.v2beta2.LeaseTasksResponse] will have its + * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] set to the + * current time plus the `lease_duration`. The task is leased until its + * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]; thus, the + * task will not be returned to another + * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] call before + * its [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]. + * After the worker has successfully finished the work associated + * with the task, the worker must call via + * [AcknowledgeTask][google.cloud.tasks.v2beta2.CloudTasks.AcknowledgeTask] + * before the [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]. + * Otherwise the task will be returned to a later + * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] call so that + * another worker can retry it. + * The maximum lease duration is 1 week. + * `lease_duration` will be truncated to the nearest second. + * + * Generated from protobuf field .google.protobuf.Duration lease_duration = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Duration|null + */ + public function getLeaseDuration() + { + return $this->lease_duration; + } + + public function hasLeaseDuration() + { + return isset($this->lease_duration); + } + + public function clearLeaseDuration() + { + unset($this->lease_duration); + } + + /** + * Required. The duration of the lease. + * Each task returned in the + * [response][google.cloud.tasks.v2beta2.LeaseTasksResponse] will have its + * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] set to the + * current time plus the `lease_duration`. The task is leased until its + * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]; thus, the + * task will not be returned to another + * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] call before + * its [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]. + * After the worker has successfully finished the work associated + * with the task, the worker must call via + * [AcknowledgeTask][google.cloud.tasks.v2beta2.CloudTasks.AcknowledgeTask] + * before the [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]. + * Otherwise the task will be returned to a later + * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] call so that + * another worker can retry it. + * The maximum lease duration is 1 week. + * `lease_duration` will be truncated to the nearest second. + * + * Generated from protobuf field .google.protobuf.Duration lease_duration = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setLeaseDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->lease_duration = $var; + + return $this; + } + + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta2.Task] will be returned. + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta2.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View response_view = 4; + * @return int + */ + public function getResponseView() + { + return $this->response_view; + } + + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta2.Task] will be returned. + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta2.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View response_view = 4; + * @param int $var + * @return $this + */ + public function setResponseView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta2\Task\View::class); + $this->response_view = $var; + + return $this; + } + + /** + * `filter` can be used to specify a subset of tasks to lease. + * When `filter` is set to `tag=` then the + * [response][google.cloud.tasks.v2beta2.LeaseTasksResponse] will contain only + * tasks whose [tag][google.cloud.tasks.v2beta2.PullMessage.tag] is equal to + * ``. `` must be less than 500 characters. + * When `filter` is set to `tag_function=oldest_tag()`, only tasks which have + * the same tag as the task with the oldest + * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] will be + * returned. + * Grammar Syntax: + * * `filter = "tag=" tag | "tag_function=" function` + * * `tag = string` + * * `function = "oldest_tag()"` + * The `oldest_tag()` function returns tasks which have the same tag as the + * oldest task (ordered by schedule time). + * SDK compatibility: Although the SDK allows tags to be either + * string or + * [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), + * only UTF-8 encoded tags can be used in Cloud Tasks. Tag which + * aren't UTF-8 encoded can't be used in the + * [filter][google.cloud.tasks.v2beta2.LeaseTasksRequest.filter] and the + * task's [tag][google.cloud.tasks.v2beta2.PullMessage.tag] will be displayed + * as empty in Cloud Tasks. + * + * Generated from protobuf field string filter = 5; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * `filter` can be used to specify a subset of tasks to lease. + * When `filter` is set to `tag=` then the + * [response][google.cloud.tasks.v2beta2.LeaseTasksResponse] will contain only + * tasks whose [tag][google.cloud.tasks.v2beta2.PullMessage.tag] is equal to + * ``. `` must be less than 500 characters. + * When `filter` is set to `tag_function=oldest_tag()`, only tasks which have + * the same tag as the task with the oldest + * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] will be + * returned. + * Grammar Syntax: + * * `filter = "tag=" tag | "tag_function=" function` + * * `tag = string` + * * `function = "oldest_tag()"` + * The `oldest_tag()` function returns tasks which have the same tag as the + * oldest task (ordered by schedule time). + * SDK compatibility: Although the SDK allows tags to be either + * string or + * [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), + * only UTF-8 encoded tags can be used in Cloud Tasks. Tag which + * aren't UTF-8 encoded can't be used in the + * [filter][google.cloud.tasks.v2beta2.LeaseTasksRequest.filter] and the + * task's [tag][google.cloud.tasks.v2beta2.PullMessage.tag] will be displayed + * as empty in Cloud Tasks. + * + * Generated from protobuf field string filter = 5; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/LeaseTasksResponse.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/LeaseTasksResponse.php new file mode 100644 index 000000000000..fabd60efa760 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/LeaseTasksResponse.php @@ -0,0 +1,68 @@ +google.cloud.tasks.v2beta2.LeaseTasksResponse + */ +class LeaseTasksResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The leased tasks. + * + * Generated from protobuf field repeated .google.cloud.tasks.v2beta2.Task tasks = 1; + */ + private $tasks; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Tasks\V2beta2\Task>|\Google\Protobuf\Internal\RepeatedField $tasks + * The leased tasks. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * The leased tasks. + * + * Generated from protobuf field repeated .google.cloud.tasks.v2beta2.Task tasks = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTasks() + { + return $this->tasks; + } + + /** + * The leased tasks. + * + * Generated from protobuf field repeated .google.cloud.tasks.v2beta2.Task tasks = 1; + * @param array<\Google\Cloud\Tasks\V2beta2\Task>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTasks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Tasks\V2beta2\Task::class); + $this->tasks = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ListQueuesRequest.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ListQueuesRequest.php new file mode 100644 index 000000000000..4122c329b917 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ListQueuesRequest.php @@ -0,0 +1,310 @@ +google.cloud.tasks.v2beta2.ListQueuesRequest + */ +class ListQueuesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The location name. + * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * `filter` can be used to specify a subset of queues. Any + * [Queue][google.cloud.tasks.v2beta2.Queue] field can be used as a filter and + * several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The + * filter syntax is the same as described in [Stackdriver's Advanced Logs + * Filters](https://cloud.google.com/logging/docs/view/advanced_filters). + * Sample filter "app_engine_http_target: *". + * Note that using filters might cause fewer queues than the + * requested_page size to be returned. + * + * Generated from protobuf field string filter = 2; + */ + protected $filter = ''; + /** + * Requested page size. + * The maximum page size is 9800. If unspecified, the page size will + * be the maximum. Fewer queues than requested might be returned, + * even if more queues exist; use the + * [next_page_token][google.cloud.tasks.v2beta2.ListQueuesResponse.next_page_token] + * in the response to determine if more queues exist. + * + * Generated from protobuf field int32 page_size = 3; + */ + protected $page_size = 0; + /** + * A token identifying the page of results to return. + * To request the first page results, page_token must be empty. To + * request the next page of results, page_token must be the value of + * [next_page_token][google.cloud.tasks.v2beta2.ListQueuesResponse.next_page_token] + * returned from the previous call to + * [ListQueues][google.cloud.tasks.v2beta2.CloudTasks.ListQueues] method. It + * is an error to switch the value of the + * [filter][google.cloud.tasks.v2beta2.ListQueuesRequest.filter] while + * iterating through pages. + * + * Generated from protobuf field string page_token = 4; + */ + protected $page_token = ''; + /** + * Optional. Read mask is used for a more granular control over what the API + * returns. If the mask is not present all fields will be returned except + * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly + * specified in the mask. + * + * Generated from protobuf field .google.protobuf.FieldMask read_mask = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $read_mask = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The location name. + * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * @type string $filter + * `filter` can be used to specify a subset of queues. Any + * [Queue][google.cloud.tasks.v2beta2.Queue] field can be used as a filter and + * several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The + * filter syntax is the same as described in [Stackdriver's Advanced Logs + * Filters](https://cloud.google.com/logging/docs/view/advanced_filters). + * Sample filter "app_engine_http_target: *". + * Note that using filters might cause fewer queues than the + * requested_page size to be returned. + * @type int $page_size + * Requested page size. + * The maximum page size is 9800. If unspecified, the page size will + * be the maximum. Fewer queues than requested might be returned, + * even if more queues exist; use the + * [next_page_token][google.cloud.tasks.v2beta2.ListQueuesResponse.next_page_token] + * in the response to determine if more queues exist. + * @type string $page_token + * A token identifying the page of results to return. + * To request the first page results, page_token must be empty. To + * request the next page of results, page_token must be the value of + * [next_page_token][google.cloud.tasks.v2beta2.ListQueuesResponse.next_page_token] + * returned from the previous call to + * [ListQueues][google.cloud.tasks.v2beta2.CloudTasks.ListQueues] method. It + * is an error to switch the value of the + * [filter][google.cloud.tasks.v2beta2.ListQueuesRequest.filter] while + * iterating through pages. + * @type \Google\Protobuf\FieldMask $read_mask + * Optional. Read mask is used for a more granular control over what the API + * returns. If the mask is not present all fields will be returned except + * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly + * specified in the mask. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * Required. The location name. + * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The location name. + * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * `filter` can be used to specify a subset of queues. Any + * [Queue][google.cloud.tasks.v2beta2.Queue] field can be used as a filter and + * several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The + * filter syntax is the same as described in [Stackdriver's Advanced Logs + * Filters](https://cloud.google.com/logging/docs/view/advanced_filters). + * Sample filter "app_engine_http_target: *". + * Note that using filters might cause fewer queues than the + * requested_page size to be returned. + * + * Generated from protobuf field string filter = 2; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * `filter` can be used to specify a subset of queues. Any + * [Queue][google.cloud.tasks.v2beta2.Queue] field can be used as a filter and + * several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The + * filter syntax is the same as described in [Stackdriver's Advanced Logs + * Filters](https://cloud.google.com/logging/docs/view/advanced_filters). + * Sample filter "app_engine_http_target: *". + * Note that using filters might cause fewer queues than the + * requested_page size to be returned. + * + * Generated from protobuf field string filter = 2; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Requested page size. + * The maximum page size is 9800. If unspecified, the page size will + * be the maximum. Fewer queues than requested might be returned, + * even if more queues exist; use the + * [next_page_token][google.cloud.tasks.v2beta2.ListQueuesResponse.next_page_token] + * in the response to determine if more queues exist. + * + * Generated from protobuf field int32 page_size = 3; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Requested page size. + * The maximum page size is 9800. If unspecified, the page size will + * be the maximum. Fewer queues than requested might be returned, + * even if more queues exist; use the + * [next_page_token][google.cloud.tasks.v2beta2.ListQueuesResponse.next_page_token] + * in the response to determine if more queues exist. + * + * Generated from protobuf field int32 page_size = 3; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A token identifying the page of results to return. + * To request the first page results, page_token must be empty. To + * request the next page of results, page_token must be the value of + * [next_page_token][google.cloud.tasks.v2beta2.ListQueuesResponse.next_page_token] + * returned from the previous call to + * [ListQueues][google.cloud.tasks.v2beta2.CloudTasks.ListQueues] method. It + * is an error to switch the value of the + * [filter][google.cloud.tasks.v2beta2.ListQueuesRequest.filter] while + * iterating through pages. + * + * Generated from protobuf field string page_token = 4; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A token identifying the page of results to return. + * To request the first page results, page_token must be empty. To + * request the next page of results, page_token must be the value of + * [next_page_token][google.cloud.tasks.v2beta2.ListQueuesResponse.next_page_token] + * returned from the previous call to + * [ListQueues][google.cloud.tasks.v2beta2.CloudTasks.ListQueues] method. It + * is an error to switch the value of the + * [filter][google.cloud.tasks.v2beta2.ListQueuesRequest.filter] while + * iterating through pages. + * + * Generated from protobuf field string page_token = 4; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Read mask is used for a more granular control over what the API + * returns. If the mask is not present all fields will be returned except + * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly + * specified in the mask. + * + * Generated from protobuf field .google.protobuf.FieldMask read_mask = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getReadMask() + { + return $this->read_mask; + } + + public function hasReadMask() + { + return isset($this->read_mask); + } + + public function clearReadMask() + { + unset($this->read_mask); + } + + /** + * Optional. Read mask is used for a more granular control over what the API + * returns. If the mask is not present all fields will be returned except + * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly + * specified in the mask. + * + * Generated from protobuf field .google.protobuf.FieldMask read_mask = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setReadMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->read_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ListQueuesResponse.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ListQueuesResponse.php new file mode 100644 index 000000000000..921cdffddec0 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ListQueuesResponse.php @@ -0,0 +1,126 @@ +google.cloud.tasks.v2beta2.ListQueuesResponse + */ +class ListQueuesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of queues. + * + * Generated from protobuf field repeated .google.cloud.tasks.v2beta2.Queue queues = 1; + */ + private $queues; + /** + * A token to retrieve next page of results. + * To return the next page of results, call + * [ListQueues][google.cloud.tasks.v2beta2.CloudTasks.ListQueues] with this + * value as the + * [page_token][google.cloud.tasks.v2beta2.ListQueuesRequest.page_token]. + * If the next_page_token is empty, there are no more results. + * The page token is valid for only 2 hours. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Tasks\V2beta2\Queue>|\Google\Protobuf\Internal\RepeatedField $queues + * The list of queues. + * @type string $next_page_token + * A token to retrieve next page of results. + * To return the next page of results, call + * [ListQueues][google.cloud.tasks.v2beta2.CloudTasks.ListQueues] with this + * value as the + * [page_token][google.cloud.tasks.v2beta2.ListQueuesRequest.page_token]. + * If the next_page_token is empty, there are no more results. + * The page token is valid for only 2 hours. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * The list of queues. + * + * Generated from protobuf field repeated .google.cloud.tasks.v2beta2.Queue queues = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getQueues() + { + return $this->queues; + } + + /** + * The list of queues. + * + * Generated from protobuf field repeated .google.cloud.tasks.v2beta2.Queue queues = 1; + * @param array<\Google\Cloud\Tasks\V2beta2\Queue>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setQueues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Tasks\V2beta2\Queue::class); + $this->queues = $arr; + + return $this; + } + + /** + * A token to retrieve next page of results. + * To return the next page of results, call + * [ListQueues][google.cloud.tasks.v2beta2.CloudTasks.ListQueues] with this + * value as the + * [page_token][google.cloud.tasks.v2beta2.ListQueuesRequest.page_token]. + * If the next_page_token is empty, there are no more results. + * The page token is valid for only 2 hours. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token to retrieve next page of results. + * To return the next page of results, call + * [ListQueues][google.cloud.tasks.v2beta2.CloudTasks.ListQueues] with this + * value as the + * [page_token][google.cloud.tasks.v2beta2.ListQueuesRequest.page_token]. + * If the next_page_token is empty, there are no more results. + * The page token is valid for only 2 hours. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ListTasksRequest.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ListTasksRequest.php new file mode 100644 index 000000000000..493471606cf7 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ListTasksRequest.php @@ -0,0 +1,258 @@ +google.cloud.tasks.v2beta2.ListTasksRequest + */ +class ListTasksRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta2.Task] will be returned. + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta2.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View response_view = 2; + */ + protected $response_view = 0; + /** + * Maximum page size. + * Fewer tasks than requested might be returned, even if more tasks exist; use + * [next_page_token][google.cloud.tasks.v2beta2.ListTasksResponse.next_page_token] + * in the response to determine if more tasks exist. + * The maximum page size is 1000. If unspecified, the page size will be the + * maximum. + * + * Generated from protobuf field int32 page_size = 4; + */ + protected $page_size = 0; + /** + * A token identifying the page of results to return. + * To request the first page results, page_token must be empty. To + * request the next page of results, page_token must be the value of + * [next_page_token][google.cloud.tasks.v2beta2.ListTasksResponse.next_page_token] + * returned from the previous call to + * [ListTasks][google.cloud.tasks.v2beta2.CloudTasks.ListTasks] method. + * The page token is valid for only 2 hours. + * + * Generated from protobuf field string page_token = 5; + */ + protected $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * @type int $response_view + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta2.Task] will be returned. + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta2.Task] resource. + * @type int $page_size + * Maximum page size. + * Fewer tasks than requested might be returned, even if more tasks exist; use + * [next_page_token][google.cloud.tasks.v2beta2.ListTasksResponse.next_page_token] + * in the response to determine if more tasks exist. + * The maximum page size is 1000. If unspecified, the page size will be the + * maximum. + * @type string $page_token + * A token identifying the page of results to return. + * To request the first page results, page_token must be empty. To + * request the next page of results, page_token must be the value of + * [next_page_token][google.cloud.tasks.v2beta2.ListTasksResponse.next_page_token] + * returned from the previous call to + * [ListTasks][google.cloud.tasks.v2beta2.CloudTasks.ListTasks] method. + * The page token is valid for only 2 hours. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta2.Task] will be returned. + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta2.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View response_view = 2; + * @return int + */ + public function getResponseView() + { + return $this->response_view; + } + + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta2.Task] will be returned. + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta2.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View response_view = 2; + * @param int $var + * @return $this + */ + public function setResponseView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta2\Task\View::class); + $this->response_view = $var; + + return $this; + } + + /** + * Maximum page size. + * Fewer tasks than requested might be returned, even if more tasks exist; use + * [next_page_token][google.cloud.tasks.v2beta2.ListTasksResponse.next_page_token] + * in the response to determine if more tasks exist. + * The maximum page size is 1000. If unspecified, the page size will be the + * maximum. + * + * Generated from protobuf field int32 page_size = 4; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Maximum page size. + * Fewer tasks than requested might be returned, even if more tasks exist; use + * [next_page_token][google.cloud.tasks.v2beta2.ListTasksResponse.next_page_token] + * in the response to determine if more tasks exist. + * The maximum page size is 1000. If unspecified, the page size will be the + * maximum. + * + * Generated from protobuf field int32 page_size = 4; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A token identifying the page of results to return. + * To request the first page results, page_token must be empty. To + * request the next page of results, page_token must be the value of + * [next_page_token][google.cloud.tasks.v2beta2.ListTasksResponse.next_page_token] + * returned from the previous call to + * [ListTasks][google.cloud.tasks.v2beta2.CloudTasks.ListTasks] method. + * The page token is valid for only 2 hours. + * + * Generated from protobuf field string page_token = 5; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A token identifying the page of results to return. + * To request the first page results, page_token must be empty. To + * request the next page of results, page_token must be the value of + * [next_page_token][google.cloud.tasks.v2beta2.ListTasksResponse.next_page_token] + * returned from the previous call to + * [ListTasks][google.cloud.tasks.v2beta2.CloudTasks.ListTasks] method. + * The page token is valid for only 2 hours. + * + * Generated from protobuf field string page_token = 5; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ListTasksResponse.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ListTasksResponse.php new file mode 100644 index 000000000000..1b085c352083 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ListTasksResponse.php @@ -0,0 +1,122 @@ +google.cloud.tasks.v2beta2.ListTasksResponse + */ +class ListTasksResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of tasks. + * + * Generated from protobuf field repeated .google.cloud.tasks.v2beta2.Task tasks = 1; + */ + private $tasks; + /** + * A token to retrieve next page of results. + * To return the next page of results, call + * [ListTasks][google.cloud.tasks.v2beta2.CloudTasks.ListTasks] with this + * value as the + * [page_token][google.cloud.tasks.v2beta2.ListTasksRequest.page_token]. + * If the next_page_token is empty, there are no more results. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Tasks\V2beta2\Task>|\Google\Protobuf\Internal\RepeatedField $tasks + * The list of tasks. + * @type string $next_page_token + * A token to retrieve next page of results. + * To return the next page of results, call + * [ListTasks][google.cloud.tasks.v2beta2.CloudTasks.ListTasks] with this + * value as the + * [page_token][google.cloud.tasks.v2beta2.ListTasksRequest.page_token]. + * If the next_page_token is empty, there are no more results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * The list of tasks. + * + * Generated from protobuf field repeated .google.cloud.tasks.v2beta2.Task tasks = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTasks() + { + return $this->tasks; + } + + /** + * The list of tasks. + * + * Generated from protobuf field repeated .google.cloud.tasks.v2beta2.Task tasks = 1; + * @param array<\Google\Cloud\Tasks\V2beta2\Task>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTasks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Tasks\V2beta2\Task::class); + $this->tasks = $arr; + + return $this; + } + + /** + * A token to retrieve next page of results. + * To return the next page of results, call + * [ListTasks][google.cloud.tasks.v2beta2.CloudTasks.ListTasks] with this + * value as the + * [page_token][google.cloud.tasks.v2beta2.ListTasksRequest.page_token]. + * If the next_page_token is empty, there are no more results. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token to retrieve next page of results. + * To return the next page of results, call + * [ListTasks][google.cloud.tasks.v2beta2.CloudTasks.ListTasks] with this + * value as the + * [page_token][google.cloud.tasks.v2beta2.ListTasksRequest.page_token]. + * If the next_page_token is empty, there are no more results. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/OAuthToken.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/OAuthToken.php new file mode 100644 index 000000000000..2753f9fc25ca --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/OAuthToken.php @@ -0,0 +1,128 @@ +google.cloud.tasks.v2beta2.OAuthToken + */ +class OAuthToken extends \Google\Protobuf\Internal\Message +{ + /** + * [Service account email](https://cloud.google.com/iam/docs/service-accounts) + * to be used for generating OAuth token. + * The service account must be within the same project as the queue. The + * caller must have iam.serviceAccounts.actAs permission for the service + * account. + * + * Generated from protobuf field string service_account_email = 1; + */ + protected $service_account_email = ''; + /** + * OAuth scope to be used for generating OAuth access token. + * If not specified, "https://www.googleapis.com/auth/cloud-platform" + * will be used. + * + * Generated from protobuf field string scope = 2; + */ + protected $scope = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $service_account_email + * [Service account email](https://cloud.google.com/iam/docs/service-accounts) + * to be used for generating OAuth token. + * The service account must be within the same project as the queue. The + * caller must have iam.serviceAccounts.actAs permission for the service + * account. + * @type string $scope + * OAuth scope to be used for generating OAuth access token. + * If not specified, "https://www.googleapis.com/auth/cloud-platform" + * will be used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Target::initOnce(); + parent::__construct($data); + } + + /** + * [Service account email](https://cloud.google.com/iam/docs/service-accounts) + * to be used for generating OAuth token. + * The service account must be within the same project as the queue. The + * caller must have iam.serviceAccounts.actAs permission for the service + * account. + * + * Generated from protobuf field string service_account_email = 1; + * @return string + */ + public function getServiceAccountEmail() + { + return $this->service_account_email; + } + + /** + * [Service account email](https://cloud.google.com/iam/docs/service-accounts) + * to be used for generating OAuth token. + * The service account must be within the same project as the queue. The + * caller must have iam.serviceAccounts.actAs permission for the service + * account. + * + * Generated from protobuf field string service_account_email = 1; + * @param string $var + * @return $this + */ + public function setServiceAccountEmail($var) + { + GPBUtil::checkString($var, True); + $this->service_account_email = $var; + + return $this; + } + + /** + * OAuth scope to be used for generating OAuth access token. + * If not specified, "https://www.googleapis.com/auth/cloud-platform" + * will be used. + * + * Generated from protobuf field string scope = 2; + * @return string + */ + public function getScope() + { + return $this->scope; + } + + /** + * OAuth scope to be used for generating OAuth access token. + * If not specified, "https://www.googleapis.com/auth/cloud-platform" + * will be used. + * + * Generated from protobuf field string scope = 2; + * @param string $var + * @return $this + */ + public function setScope($var) + { + GPBUtil::checkString($var, True); + $this->scope = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/OidcToken.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/OidcToken.php new file mode 100644 index 000000000000..91cdd96f6482 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/OidcToken.php @@ -0,0 +1,126 @@ +google.cloud.tasks.v2beta2.OidcToken + */ +class OidcToken extends \Google\Protobuf\Internal\Message +{ + /** + * [Service account email](https://cloud.google.com/iam/docs/service-accounts) + * to be used for generating OIDC token. + * The service account must be within the same project as the queue. The + * caller must have iam.serviceAccounts.actAs permission for the service + * account. + * + * Generated from protobuf field string service_account_email = 1; + */ + protected $service_account_email = ''; + /** + * Audience to be used when generating OIDC token. If not specified, the URI + * specified in target will be used. + * + * Generated from protobuf field string audience = 2; + */ + protected $audience = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $service_account_email + * [Service account email](https://cloud.google.com/iam/docs/service-accounts) + * to be used for generating OIDC token. + * The service account must be within the same project as the queue. The + * caller must have iam.serviceAccounts.actAs permission for the service + * account. + * @type string $audience + * Audience to be used when generating OIDC token. If not specified, the URI + * specified in target will be used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Target::initOnce(); + parent::__construct($data); + } + + /** + * [Service account email](https://cloud.google.com/iam/docs/service-accounts) + * to be used for generating OIDC token. + * The service account must be within the same project as the queue. The + * caller must have iam.serviceAccounts.actAs permission for the service + * account. + * + * Generated from protobuf field string service_account_email = 1; + * @return string + */ + public function getServiceAccountEmail() + { + return $this->service_account_email; + } + + /** + * [Service account email](https://cloud.google.com/iam/docs/service-accounts) + * to be used for generating OIDC token. + * The service account must be within the same project as the queue. The + * caller must have iam.serviceAccounts.actAs permission for the service + * account. + * + * Generated from protobuf field string service_account_email = 1; + * @param string $var + * @return $this + */ + public function setServiceAccountEmail($var) + { + GPBUtil::checkString($var, True); + $this->service_account_email = $var; + + return $this; + } + + /** + * Audience to be used when generating OIDC token. If not specified, the URI + * specified in target will be used. + * + * Generated from protobuf field string audience = 2; + * @return string + */ + public function getAudience() + { + return $this->audience; + } + + /** + * Audience to be used when generating OIDC token. If not specified, the URI + * specified in target will be used. + * + * Generated from protobuf field string audience = 2; + * @param string $var + * @return $this + */ + public function setAudience($var) + { + GPBUtil::checkString($var, True); + $this->audience = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PathOverride.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PathOverride.php new file mode 100644 index 000000000000..28b7445fa458 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PathOverride.php @@ -0,0 +1,68 @@ +google.cloud.tasks.v2beta2.PathOverride + */ +class PathOverride extends \Google\Protobuf\Internal\Message +{ + /** + * The URI path (e.g., /users/1234). Default is an empty string. + * + * Generated from protobuf field string path = 1; + */ + protected $path = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $path + * The URI path (e.g., /users/1234). Default is an empty string. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Target::initOnce(); + parent::__construct($data); + } + + /** + * The URI path (e.g., /users/1234). Default is an empty string. + * + * Generated from protobuf field string path = 1; + * @return string + */ + public function getPath() + { + return $this->path; + } + + /** + * The URI path (e.g., /users/1234). Default is an empty string. + * + * Generated from protobuf field string path = 1; + * @param string $var + * @return $this + */ + public function setPath($var) + { + GPBUtil::checkString($var, True); + $this->path = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PauseQueueRequest.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PauseQueueRequest.php new file mode 100644 index 000000000000..564bea2de0a6 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PauseQueueRequest.php @@ -0,0 +1,72 @@ +google.cloud.tasks.v2beta2.PauseQueueRequest + */ +class PauseQueueRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PullMessage.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PullMessage.php new file mode 100644 index 000000000000..06bfe1eb2054 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PullMessage.php @@ -0,0 +1,165 @@ +google.cloud.tasks.v2beta2.PullMessage + */ +class PullMessage extends \Google\Protobuf\Internal\Message +{ + /** + * A data payload consumed by the worker to execute the task. + * + * Generated from protobuf field bytes payload = 1; + */ + protected $payload = ''; + /** + * The task's tag. + * Tags allow similar tasks to be processed in a batch. If you label + * tasks with a tag, your worker can + * [lease tasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] with the + * same tag using + * [filter][google.cloud.tasks.v2beta2.LeaseTasksRequest.filter]. For example, + * if you want to aggregate the events associated with a specific user once a + * day, you could tag tasks with the user ID. + * The task's tag can only be set when the + * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. + * The tag must be less than 500 characters. + * SDK compatibility: Although the SDK allows tags to be either + * string or + * [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), + * only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8 + * encoded, the tag will be empty when the task is returned by Cloud Tasks. + * + * Generated from protobuf field string tag = 2; + */ + protected $tag = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $payload + * A data payload consumed by the worker to execute the task. + * @type string $tag + * The task's tag. + * Tags allow similar tasks to be processed in a batch. If you label + * tasks with a tag, your worker can + * [lease tasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] with the + * same tag using + * [filter][google.cloud.tasks.v2beta2.LeaseTasksRequest.filter]. For example, + * if you want to aggregate the events associated with a specific user once a + * day, you could tag tasks with the user ID. + * The task's tag can only be set when the + * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. + * The tag must be less than 500 characters. + * SDK compatibility: Although the SDK allows tags to be either + * string or + * [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), + * only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8 + * encoded, the tag will be empty when the task is returned by Cloud Tasks. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Target::initOnce(); + parent::__construct($data); + } + + /** + * A data payload consumed by the worker to execute the task. + * + * Generated from protobuf field bytes payload = 1; + * @return string + */ + public function getPayload() + { + return $this->payload; + } + + /** + * A data payload consumed by the worker to execute the task. + * + * Generated from protobuf field bytes payload = 1; + * @param string $var + * @return $this + */ + public function setPayload($var) + { + GPBUtil::checkString($var, False); + $this->payload = $var; + + return $this; + } + + /** + * The task's tag. + * Tags allow similar tasks to be processed in a batch. If you label + * tasks with a tag, your worker can + * [lease tasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] with the + * same tag using + * [filter][google.cloud.tasks.v2beta2.LeaseTasksRequest.filter]. For example, + * if you want to aggregate the events associated with a specific user once a + * day, you could tag tasks with the user ID. + * The task's tag can only be set when the + * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. + * The tag must be less than 500 characters. + * SDK compatibility: Although the SDK allows tags to be either + * string or + * [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), + * only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8 + * encoded, the tag will be empty when the task is returned by Cloud Tasks. + * + * Generated from protobuf field string tag = 2; + * @return string + */ + public function getTag() + { + return $this->tag; + } + + /** + * The task's tag. + * Tags allow similar tasks to be processed in a batch. If you label + * tasks with a tag, your worker can + * [lease tasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] with the + * same tag using + * [filter][google.cloud.tasks.v2beta2.LeaseTasksRequest.filter]. For example, + * if you want to aggregate the events associated with a specific user once a + * day, you could tag tasks with the user ID. + * The task's tag can only be set when the + * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. + * The tag must be less than 500 characters. + * SDK compatibility: Although the SDK allows tags to be either + * string or + * [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), + * only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8 + * encoded, the tag will be empty when the task is returned by Cloud Tasks. + * + * Generated from protobuf field string tag = 2; + * @param string $var + * @return $this + */ + public function setTag($var) + { + GPBUtil::checkString($var, True); + $this->tag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PullTarget.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PullTarget.php new file mode 100644 index 000000000000..32baa5104df5 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PullTarget.php @@ -0,0 +1,33 @@ +google.cloud.tasks.v2beta2.PullTarget + */ +class PullTarget extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Target::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PurgeQueueRequest.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PurgeQueueRequest.php new file mode 100644 index 000000000000..0b46a038df4b --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PurgeQueueRequest.php @@ -0,0 +1,72 @@ +google.cloud.tasks.v2beta2.PurgeQueueRequest + */ +class PurgeQueueRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/QueryOverride.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/QueryOverride.php new file mode 100644 index 000000000000..2bbe1049c6e7 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/QueryOverride.php @@ -0,0 +1,72 @@ +google.cloud.tasks.v2beta2.QueryOverride + */ +class QueryOverride extends \Google\Protobuf\Internal\Message +{ + /** + * The query parameters (e.g., qparam1=123&qparam2=456). Default is an empty + * string. + * + * Generated from protobuf field string query_params = 1; + */ + protected $query_params = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $query_params + * The query parameters (e.g., qparam1=123&qparam2=456). Default is an empty + * string. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Target::initOnce(); + parent::__construct($data); + } + + /** + * The query parameters (e.g., qparam1=123&qparam2=456). Default is an empty + * string. + * + * Generated from protobuf field string query_params = 1; + * @return string + */ + public function getQueryParams() + { + return $this->query_params; + } + + /** + * The query parameters (e.g., qparam1=123&qparam2=456). Default is an empty + * string. + * + * Generated from protobuf field string query_params = 1; + * @param string $var + * @return $this + */ + public function setQueryParams($var) + { + GPBUtil::checkString($var, True); + $this->query_params = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Queue.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Queue.php new file mode 100644 index 000000000000..405393e6f812 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Queue.php @@ -0,0 +1,771 @@ +google.cloud.tasks.v2beta2.Queue + */ +class Queue extends \Google\Protobuf\Internal\Message +{ + /** + * Caller-specified and required in + * [CreateQueue][google.cloud.tasks.v2beta2.CloudTasks.CreateQueue], after + * which it becomes output only. + * The queue name. + * The queue name must have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), + * hyphens (-), colons (:), or periods (.). + * For more information, see + * [Identifying + * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) + * * `LOCATION_ID` is the canonical ID for the queue's location. + * The list of available locations can be obtained by calling + * [ListLocations][google.cloud.location.Locations.ListLocations]. + * For more information, see https://cloud.google.com/about/locations/. + * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or + * hyphens (-). The maximum length is 100 characters. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Rate limits for task dispatches. + * [rate_limits][google.cloud.tasks.v2beta2.Queue.rate_limits] and + * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] are related + * because they both control task attempts however they control how tasks are + * attempted in different ways: + * * [rate_limits][google.cloud.tasks.v2beta2.Queue.rate_limits] controls the + * total rate of + * dispatches from a queue (i.e. all traffic dispatched from the + * queue, regardless of whether the dispatch is from a first + * attempt or a retry). + * * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] controls + * what happens to + * particular a task after its first attempt fails. That is, + * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] controls + * task retries (the second attempt, third attempt, etc). + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.RateLimits rate_limits = 5; + */ + protected $rate_limits = null; + /** + * Settings that determine the retry behavior. + * * For tasks created using Cloud Tasks: the queue-level retry settings + * apply to all tasks in the queue that were created using Cloud Tasks. + * Retry settings cannot be set on individual tasks. + * * For tasks created using the App Engine SDK: the queue-level retry + * settings apply to all tasks in the queue which do not have retry settings + * explicitly set on the task and were created by the App Engine SDK. See + * [App Engine + * documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks). + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.RetryConfig retry_config = 6; + */ + protected $retry_config = null; + /** + * Output only. The state of the queue. + * `state` can only be changed by called + * [PauseQueue][google.cloud.tasks.v2beta2.CloudTasks.PauseQueue], + * [ResumeQueue][google.cloud.tasks.v2beta2.CloudTasks.ResumeQueue], or + * uploading + * [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref). + * [UpdateQueue][google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue] cannot be + * used to change `state`. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.Queue.State state = 7; + */ + protected $state = 0; + /** + * Output only. The last time this queue was purged. + * All tasks that were [created][google.cloud.tasks.v2beta2.Task.create_time] + * before this time were purged. + * A queue can be purged using + * [PurgeQueue][google.cloud.tasks.v2beta2.CloudTasks.PurgeQueue], the [App + * Engine Task Queue SDK, or the Cloud + * Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue). + * Purge time will be truncated to the nearest microsecond. Purge + * time will be unset if the queue has never been purged. + * + * Generated from protobuf field .google.protobuf.Timestamp purge_time = 8; + */ + protected $purge_time = null; + /** + * The maximum amount of time that a task will be retained in + * this queue. + * Queues created by Cloud Tasks have a default `task_ttl` of 31 days. + * After a task has lived for `task_ttl`, the task will be deleted + * regardless of whether it was dispatched or not. + * The `task_ttl` for queues created via queue.yaml/xml is equal to the + * maximum duration because there is a + * [storage quota](https://cloud.google.com/appengine/quotas#Task_Queue) for + * these queues. To view the maximum valid duration, see the documentation for + * [Duration][google.protobuf.Duration]. + * + * Generated from protobuf field .google.protobuf.Duration task_ttl = 9; + */ + protected $task_ttl = null; + /** + * The task tombstone time to live (TTL). + * After a task is deleted or completed, the task's tombstone is + * retained for the length of time specified by `tombstone_ttl`. + * The tombstone is used by task de-duplication; another task with the same + * name can't be created until the tombstone has expired. For more information + * about task de-duplication, see the documentation for + * [CreateTaskRequest][google.cloud.tasks.v2beta2.CreateTaskRequest.task]. + * Queues created by Cloud Tasks have a default `tombstone_ttl` of 1 hour. + * + * Generated from protobuf field .google.protobuf.Duration tombstone_ttl = 10; + */ + protected $tombstone_ttl = null; + /** + * Output only. The realtime, informational statistics for a queue. In order + * to receive the statistics the caller should include this field in the + * FieldMask. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.QueueStats stats = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $stats = null; + protected $target_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Caller-specified and required in + * [CreateQueue][google.cloud.tasks.v2beta2.CloudTasks.CreateQueue], after + * which it becomes output only. + * The queue name. + * The queue name must have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), + * hyphens (-), colons (:), or periods (.). + * For more information, see + * [Identifying + * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) + * * `LOCATION_ID` is the canonical ID for the queue's location. + * The list of available locations can be obtained by calling + * [ListLocations][google.cloud.location.Locations.ListLocations]. + * For more information, see https://cloud.google.com/about/locations/. + * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or + * hyphens (-). The maximum length is 100 characters. + * @type \Google\Cloud\Tasks\V2beta2\AppEngineHttpTarget $app_engine_http_target + * App Engine HTTP target. + * An App Engine queue is a queue that has an + * [AppEngineHttpTarget][google.cloud.tasks.v2beta2.AppEngineHttpTarget]. + * @type \Google\Cloud\Tasks\V2beta2\PullTarget $pull_target + * Pull target. + * A pull queue is a queue that has a + * [PullTarget][google.cloud.tasks.v2beta2.PullTarget]. + * @type \Google\Cloud\Tasks\V2beta2\HttpTarget $http_target + * An http_target is used to override the target values for HTTP tasks. + * @type \Google\Cloud\Tasks\V2beta2\RateLimits $rate_limits + * Rate limits for task dispatches. + * [rate_limits][google.cloud.tasks.v2beta2.Queue.rate_limits] and + * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] are related + * because they both control task attempts however they control how tasks are + * attempted in different ways: + * * [rate_limits][google.cloud.tasks.v2beta2.Queue.rate_limits] controls the + * total rate of + * dispatches from a queue (i.e. all traffic dispatched from the + * queue, regardless of whether the dispatch is from a first + * attempt or a retry). + * * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] controls + * what happens to + * particular a task after its first attempt fails. That is, + * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] controls + * task retries (the second attempt, third attempt, etc). + * @type \Google\Cloud\Tasks\V2beta2\RetryConfig $retry_config + * Settings that determine the retry behavior. + * * For tasks created using Cloud Tasks: the queue-level retry settings + * apply to all tasks in the queue that were created using Cloud Tasks. + * Retry settings cannot be set on individual tasks. + * * For tasks created using the App Engine SDK: the queue-level retry + * settings apply to all tasks in the queue which do not have retry settings + * explicitly set on the task and were created by the App Engine SDK. See + * [App Engine + * documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks). + * @type int $state + * Output only. The state of the queue. + * `state` can only be changed by called + * [PauseQueue][google.cloud.tasks.v2beta2.CloudTasks.PauseQueue], + * [ResumeQueue][google.cloud.tasks.v2beta2.CloudTasks.ResumeQueue], or + * uploading + * [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref). + * [UpdateQueue][google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue] cannot be + * used to change `state`. + * @type \Google\Protobuf\Timestamp $purge_time + * Output only. The last time this queue was purged. + * All tasks that were [created][google.cloud.tasks.v2beta2.Task.create_time] + * before this time were purged. + * A queue can be purged using + * [PurgeQueue][google.cloud.tasks.v2beta2.CloudTasks.PurgeQueue], the [App + * Engine Task Queue SDK, or the Cloud + * Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue). + * Purge time will be truncated to the nearest microsecond. Purge + * time will be unset if the queue has never been purged. + * @type \Google\Protobuf\Duration $task_ttl + * The maximum amount of time that a task will be retained in + * this queue. + * Queues created by Cloud Tasks have a default `task_ttl` of 31 days. + * After a task has lived for `task_ttl`, the task will be deleted + * regardless of whether it was dispatched or not. + * The `task_ttl` for queues created via queue.yaml/xml is equal to the + * maximum duration because there is a + * [storage quota](https://cloud.google.com/appengine/quotas#Task_Queue) for + * these queues. To view the maximum valid duration, see the documentation for + * [Duration][google.protobuf.Duration]. + * @type \Google\Protobuf\Duration $tombstone_ttl + * The task tombstone time to live (TTL). + * After a task is deleted or completed, the task's tombstone is + * retained for the length of time specified by `tombstone_ttl`. + * The tombstone is used by task de-duplication; another task with the same + * name can't be created until the tombstone has expired. For more information + * about task de-duplication, see the documentation for + * [CreateTaskRequest][google.cloud.tasks.v2beta2.CreateTaskRequest.task]. + * Queues created by Cloud Tasks have a default `tombstone_ttl` of 1 hour. + * @type \Google\Cloud\Tasks\V2beta2\QueueStats $stats + * Output only. The realtime, informational statistics for a queue. In order + * to receive the statistics the caller should include this field in the + * FieldMask. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Queue::initOnce(); + parent::__construct($data); + } + + /** + * Caller-specified and required in + * [CreateQueue][google.cloud.tasks.v2beta2.CloudTasks.CreateQueue], after + * which it becomes output only. + * The queue name. + * The queue name must have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), + * hyphens (-), colons (:), or periods (.). + * For more information, see + * [Identifying + * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) + * * `LOCATION_ID` is the canonical ID for the queue's location. + * The list of available locations can be obtained by calling + * [ListLocations][google.cloud.location.Locations.ListLocations]. + * For more information, see https://cloud.google.com/about/locations/. + * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or + * hyphens (-). The maximum length is 100 characters. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Caller-specified and required in + * [CreateQueue][google.cloud.tasks.v2beta2.CloudTasks.CreateQueue], after + * which it becomes output only. + * The queue name. + * The queue name must have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), + * hyphens (-), colons (:), or periods (.). + * For more information, see + * [Identifying + * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) + * * `LOCATION_ID` is the canonical ID for the queue's location. + * The list of available locations can be obtained by calling + * [ListLocations][google.cloud.location.Locations.ListLocations]. + * For more information, see https://cloud.google.com/about/locations/. + * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or + * hyphens (-). The maximum length is 100 characters. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * App Engine HTTP target. + * An App Engine queue is a queue that has an + * [AppEngineHttpTarget][google.cloud.tasks.v2beta2.AppEngineHttpTarget]. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.AppEngineHttpTarget app_engine_http_target = 3; + * @return \Google\Cloud\Tasks\V2beta2\AppEngineHttpTarget|null + */ + public function getAppEngineHttpTarget() + { + return $this->readOneof(3); + } + + public function hasAppEngineHttpTarget() + { + return $this->hasOneof(3); + } + + /** + * App Engine HTTP target. + * An App Engine queue is a queue that has an + * [AppEngineHttpTarget][google.cloud.tasks.v2beta2.AppEngineHttpTarget]. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.AppEngineHttpTarget app_engine_http_target = 3; + * @param \Google\Cloud\Tasks\V2beta2\AppEngineHttpTarget $var + * @return $this + */ + public function setAppEngineHttpTarget($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\AppEngineHttpTarget::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Pull target. + * A pull queue is a queue that has a + * [PullTarget][google.cloud.tasks.v2beta2.PullTarget]. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.PullTarget pull_target = 4; + * @return \Google\Cloud\Tasks\V2beta2\PullTarget|null + */ + public function getPullTarget() + { + return $this->readOneof(4); + } + + public function hasPullTarget() + { + return $this->hasOneof(4); + } + + /** + * Pull target. + * A pull queue is a queue that has a + * [PullTarget][google.cloud.tasks.v2beta2.PullTarget]. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.PullTarget pull_target = 4; + * @param \Google\Cloud\Tasks\V2beta2\PullTarget $var + * @return $this + */ + public function setPullTarget($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\PullTarget::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * An http_target is used to override the target values for HTTP tasks. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.HttpTarget http_target = 17; + * @return \Google\Cloud\Tasks\V2beta2\HttpTarget|null + */ + public function getHttpTarget() + { + return $this->readOneof(17); + } + + public function hasHttpTarget() + { + return $this->hasOneof(17); + } + + /** + * An http_target is used to override the target values for HTTP tasks. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.HttpTarget http_target = 17; + * @param \Google\Cloud\Tasks\V2beta2\HttpTarget $var + * @return $this + */ + public function setHttpTarget($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\HttpTarget::class); + $this->writeOneof(17, $var); + + return $this; + } + + /** + * Rate limits for task dispatches. + * [rate_limits][google.cloud.tasks.v2beta2.Queue.rate_limits] and + * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] are related + * because they both control task attempts however they control how tasks are + * attempted in different ways: + * * [rate_limits][google.cloud.tasks.v2beta2.Queue.rate_limits] controls the + * total rate of + * dispatches from a queue (i.e. all traffic dispatched from the + * queue, regardless of whether the dispatch is from a first + * attempt or a retry). + * * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] controls + * what happens to + * particular a task after its first attempt fails. That is, + * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] controls + * task retries (the second attempt, third attempt, etc). + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.RateLimits rate_limits = 5; + * @return \Google\Cloud\Tasks\V2beta2\RateLimits|null + */ + public function getRateLimits() + { + return $this->rate_limits; + } + + public function hasRateLimits() + { + return isset($this->rate_limits); + } + + public function clearRateLimits() + { + unset($this->rate_limits); + } + + /** + * Rate limits for task dispatches. + * [rate_limits][google.cloud.tasks.v2beta2.Queue.rate_limits] and + * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] are related + * because they both control task attempts however they control how tasks are + * attempted in different ways: + * * [rate_limits][google.cloud.tasks.v2beta2.Queue.rate_limits] controls the + * total rate of + * dispatches from a queue (i.e. all traffic dispatched from the + * queue, regardless of whether the dispatch is from a first + * attempt or a retry). + * * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] controls + * what happens to + * particular a task after its first attempt fails. That is, + * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] controls + * task retries (the second attempt, third attempt, etc). + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.RateLimits rate_limits = 5; + * @param \Google\Cloud\Tasks\V2beta2\RateLimits $var + * @return $this + */ + public function setRateLimits($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\RateLimits::class); + $this->rate_limits = $var; + + return $this; + } + + /** + * Settings that determine the retry behavior. + * * For tasks created using Cloud Tasks: the queue-level retry settings + * apply to all tasks in the queue that were created using Cloud Tasks. + * Retry settings cannot be set on individual tasks. + * * For tasks created using the App Engine SDK: the queue-level retry + * settings apply to all tasks in the queue which do not have retry settings + * explicitly set on the task and were created by the App Engine SDK. See + * [App Engine + * documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks). + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.RetryConfig retry_config = 6; + * @return \Google\Cloud\Tasks\V2beta2\RetryConfig|null + */ + public function getRetryConfig() + { + return $this->retry_config; + } + + public function hasRetryConfig() + { + return isset($this->retry_config); + } + + public function clearRetryConfig() + { + unset($this->retry_config); + } + + /** + * Settings that determine the retry behavior. + * * For tasks created using Cloud Tasks: the queue-level retry settings + * apply to all tasks in the queue that were created using Cloud Tasks. + * Retry settings cannot be set on individual tasks. + * * For tasks created using the App Engine SDK: the queue-level retry + * settings apply to all tasks in the queue which do not have retry settings + * explicitly set on the task and were created by the App Engine SDK. See + * [App Engine + * documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks). + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.RetryConfig retry_config = 6; + * @param \Google\Cloud\Tasks\V2beta2\RetryConfig $var + * @return $this + */ + public function setRetryConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\RetryConfig::class); + $this->retry_config = $var; + + return $this; + } + + /** + * Output only. The state of the queue. + * `state` can only be changed by called + * [PauseQueue][google.cloud.tasks.v2beta2.CloudTasks.PauseQueue], + * [ResumeQueue][google.cloud.tasks.v2beta2.CloudTasks.ResumeQueue], or + * uploading + * [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref). + * [UpdateQueue][google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue] cannot be + * used to change `state`. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.Queue.State state = 7; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The state of the queue. + * `state` can only be changed by called + * [PauseQueue][google.cloud.tasks.v2beta2.CloudTasks.PauseQueue], + * [ResumeQueue][google.cloud.tasks.v2beta2.CloudTasks.ResumeQueue], or + * uploading + * [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref). + * [UpdateQueue][google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue] cannot be + * used to change `state`. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.Queue.State state = 7; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta2\Queue\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. The last time this queue was purged. + * All tasks that were [created][google.cloud.tasks.v2beta2.Task.create_time] + * before this time were purged. + * A queue can be purged using + * [PurgeQueue][google.cloud.tasks.v2beta2.CloudTasks.PurgeQueue], the [App + * Engine Task Queue SDK, or the Cloud + * Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue). + * Purge time will be truncated to the nearest microsecond. Purge + * time will be unset if the queue has never been purged. + * + * Generated from protobuf field .google.protobuf.Timestamp purge_time = 8; + * @return \Google\Protobuf\Timestamp|null + */ + public function getPurgeTime() + { + return $this->purge_time; + } + + public function hasPurgeTime() + { + return isset($this->purge_time); + } + + public function clearPurgeTime() + { + unset($this->purge_time); + } + + /** + * Output only. The last time this queue was purged. + * All tasks that were [created][google.cloud.tasks.v2beta2.Task.create_time] + * before this time were purged. + * A queue can be purged using + * [PurgeQueue][google.cloud.tasks.v2beta2.CloudTasks.PurgeQueue], the [App + * Engine Task Queue SDK, or the Cloud + * Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue). + * Purge time will be truncated to the nearest microsecond. Purge + * time will be unset if the queue has never been purged. + * + * Generated from protobuf field .google.protobuf.Timestamp purge_time = 8; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setPurgeTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->purge_time = $var; + + return $this; + } + + /** + * The maximum amount of time that a task will be retained in + * this queue. + * Queues created by Cloud Tasks have a default `task_ttl` of 31 days. + * After a task has lived for `task_ttl`, the task will be deleted + * regardless of whether it was dispatched or not. + * The `task_ttl` for queues created via queue.yaml/xml is equal to the + * maximum duration because there is a + * [storage quota](https://cloud.google.com/appengine/quotas#Task_Queue) for + * these queues. To view the maximum valid duration, see the documentation for + * [Duration][google.protobuf.Duration]. + * + * Generated from protobuf field .google.protobuf.Duration task_ttl = 9; + * @return \Google\Protobuf\Duration|null + */ + public function getTaskTtl() + { + return $this->task_ttl; + } + + public function hasTaskTtl() + { + return isset($this->task_ttl); + } + + public function clearTaskTtl() + { + unset($this->task_ttl); + } + + /** + * The maximum amount of time that a task will be retained in + * this queue. + * Queues created by Cloud Tasks have a default `task_ttl` of 31 days. + * After a task has lived for `task_ttl`, the task will be deleted + * regardless of whether it was dispatched or not. + * The `task_ttl` for queues created via queue.yaml/xml is equal to the + * maximum duration because there is a + * [storage quota](https://cloud.google.com/appengine/quotas#Task_Queue) for + * these queues. To view the maximum valid duration, see the documentation for + * [Duration][google.protobuf.Duration]. + * + * Generated from protobuf field .google.protobuf.Duration task_ttl = 9; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTaskTtl($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->task_ttl = $var; + + return $this; + } + + /** + * The task tombstone time to live (TTL). + * After a task is deleted or completed, the task's tombstone is + * retained for the length of time specified by `tombstone_ttl`. + * The tombstone is used by task de-duplication; another task with the same + * name can't be created until the tombstone has expired. For more information + * about task de-duplication, see the documentation for + * [CreateTaskRequest][google.cloud.tasks.v2beta2.CreateTaskRequest.task]. + * Queues created by Cloud Tasks have a default `tombstone_ttl` of 1 hour. + * + * Generated from protobuf field .google.protobuf.Duration tombstone_ttl = 10; + * @return \Google\Protobuf\Duration|null + */ + public function getTombstoneTtl() + { + return $this->tombstone_ttl; + } + + public function hasTombstoneTtl() + { + return isset($this->tombstone_ttl); + } + + public function clearTombstoneTtl() + { + unset($this->tombstone_ttl); + } + + /** + * The task tombstone time to live (TTL). + * After a task is deleted or completed, the task's tombstone is + * retained for the length of time specified by `tombstone_ttl`. + * The tombstone is used by task de-duplication; another task with the same + * name can't be created until the tombstone has expired. For more information + * about task de-duplication, see the documentation for + * [CreateTaskRequest][google.cloud.tasks.v2beta2.CreateTaskRequest.task]. + * Queues created by Cloud Tasks have a default `tombstone_ttl` of 1 hour. + * + * Generated from protobuf field .google.protobuf.Duration tombstone_ttl = 10; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTombstoneTtl($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->tombstone_ttl = $var; + + return $this; + } + + /** + * Output only. The realtime, informational statistics for a queue. In order + * to receive the statistics the caller should include this field in the + * FieldMask. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.QueueStats stats = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Tasks\V2beta2\QueueStats|null + */ + public function getStats() + { + return $this->stats; + } + + public function hasStats() + { + return isset($this->stats); + } + + public function clearStats() + { + unset($this->stats); + } + + /** + * Output only. The realtime, informational statistics for a queue. In order + * to receive the statistics the caller should include this field in the + * FieldMask. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.QueueStats stats = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Tasks\V2beta2\QueueStats $var + * @return $this + */ + public function setStats($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\QueueStats::class); + $this->stats = $var; + + return $this; + } + + /** + * @return string + */ + public function getTargetType() + { + return $this->whichOneof("target_type"); + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Queue/State.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Queue/State.php new file mode 100644 index 000000000000..f7bded4c9833 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Queue/State.php @@ -0,0 +1,93 @@ +google.cloud.tasks.v2beta2.Queue.State + */ +class State +{ + /** + * Unspecified state. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The queue is running. Tasks can be dispatched. + * If the queue was created using Cloud Tasks and the queue has + * had no activity (method calls or task dispatches) for 30 days, + * the queue may take a few minutes to re-activate. Some method + * calls may return [NOT_FOUND][google.rpc.Code.NOT_FOUND] and + * tasks may not be dispatched for a few minutes until the queue + * has been re-activated. + * + * Generated from protobuf enum RUNNING = 1; + */ + const RUNNING = 1; + /** + * Tasks are paused by the user. If the queue is paused then Cloud + * Tasks will stop delivering tasks from it, but more tasks can + * still be added to it by the user. When a pull queue is paused, + * all [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] calls + * will return a [FAILED_PRECONDITION][google.rpc.Code.FAILED_PRECONDITION]. + * + * Generated from protobuf enum PAUSED = 2; + */ + const PAUSED = 2; + /** + * The queue is disabled. + * A queue becomes `DISABLED` when + * [queue.yaml](https://cloud.google.com/appengine/docs/python/config/queueref) + * or + * [queue.xml](https://cloud.google.com/appengine/docs/standard/java/config/queueref) + * is uploaded which does not contain the queue. You cannot directly disable + * a queue. + * When a queue is disabled, tasks can still be added to a queue + * but the tasks are not dispatched and + * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] calls + * return a `FAILED_PRECONDITION` error. + * To permanently delete this queue and all of its tasks, call + * [DeleteQueue][google.cloud.tasks.v2beta2.CloudTasks.DeleteQueue]. + * + * Generated from protobuf enum DISABLED = 3; + */ + const DISABLED = 3; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::RUNNING => 'RUNNING', + self::PAUSED => 'PAUSED', + self::DISABLED => 'DISABLED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\Tasks\V2beta2\Queue_State::class); + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/QueueStats.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/QueueStats.php new file mode 100644 index 000000000000..2088ee83cf4e --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/QueueStats.php @@ -0,0 +1,253 @@ +google.cloud.tasks.v2beta2.QueueStats + */ +class QueueStats extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. An estimation of the number of tasks in the queue, that is, + * the tasks in the queue that haven't been executed, the tasks in the queue + * which the queue has dispatched but has not yet received a reply for, and + * the failed tasks that the queue is retrying. + * + * Generated from protobuf field int64 tasks_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $tasks_count = 0; + /** + * Output only. An estimation of the nearest time in the future where a task + * in the queue is scheduled to be executed. + * + * Generated from protobuf field .google.protobuf.Timestamp oldest_estimated_arrival_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $oldest_estimated_arrival_time = null; + /** + * Output only. The number of tasks that the queue has dispatched and received + * a reply for during the last minute. This variable counts both successful + * and non-successful executions. + * + * Generated from protobuf field int64 executed_last_minute_count = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $executed_last_minute_count = 0; + /** + * Output only. The number of requests that the queue has dispatched but has + * not received a reply for yet. + * + * Generated from protobuf field int64 concurrent_dispatches_count = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $concurrent_dispatches_count = 0; + /** + * Output only. The current maximum number of tasks per second executed by the + * queue. The maximum value of this variable is controlled by the RateLimits + * of the Queue. However, this value could be less to avoid overloading the + * endpoints tasks in the queue are targeting. + * + * Generated from protobuf field double effective_execution_rate = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $effective_execution_rate = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $tasks_count + * Output only. An estimation of the number of tasks in the queue, that is, + * the tasks in the queue that haven't been executed, the tasks in the queue + * which the queue has dispatched but has not yet received a reply for, and + * the failed tasks that the queue is retrying. + * @type \Google\Protobuf\Timestamp $oldest_estimated_arrival_time + * Output only. An estimation of the nearest time in the future where a task + * in the queue is scheduled to be executed. + * @type int|string $executed_last_minute_count + * Output only. The number of tasks that the queue has dispatched and received + * a reply for during the last minute. This variable counts both successful + * and non-successful executions. + * @type int|string $concurrent_dispatches_count + * Output only. The number of requests that the queue has dispatched but has + * not received a reply for yet. + * @type float $effective_execution_rate + * Output only. The current maximum number of tasks per second executed by the + * queue. The maximum value of this variable is controlled by the RateLimits + * of the Queue. However, this value could be less to avoid overloading the + * endpoints tasks in the queue are targeting. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Queue::initOnce(); + parent::__construct($data); + } + + /** + * Output only. An estimation of the number of tasks in the queue, that is, + * the tasks in the queue that haven't been executed, the tasks in the queue + * which the queue has dispatched but has not yet received a reply for, and + * the failed tasks that the queue is retrying. + * + * Generated from protobuf field int64 tasks_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getTasksCount() + { + return $this->tasks_count; + } + + /** + * Output only. An estimation of the number of tasks in the queue, that is, + * the tasks in the queue that haven't been executed, the tasks in the queue + * which the queue has dispatched but has not yet received a reply for, and + * the failed tasks that the queue is retrying. + * + * Generated from protobuf field int64 tasks_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setTasksCount($var) + { + GPBUtil::checkInt64($var); + $this->tasks_count = $var; + + return $this; + } + + /** + * Output only. An estimation of the nearest time in the future where a task + * in the queue is scheduled to be executed. + * + * Generated from protobuf field .google.protobuf.Timestamp oldest_estimated_arrival_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getOldestEstimatedArrivalTime() + { + return $this->oldest_estimated_arrival_time; + } + + public function hasOldestEstimatedArrivalTime() + { + return isset($this->oldest_estimated_arrival_time); + } + + public function clearOldestEstimatedArrivalTime() + { + unset($this->oldest_estimated_arrival_time); + } + + /** + * Output only. An estimation of the nearest time in the future where a task + * in the queue is scheduled to be executed. + * + * Generated from protobuf field .google.protobuf.Timestamp oldest_estimated_arrival_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setOldestEstimatedArrivalTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->oldest_estimated_arrival_time = $var; + + return $this; + } + + /** + * Output only. The number of tasks that the queue has dispatched and received + * a reply for during the last minute. This variable counts both successful + * and non-successful executions. + * + * Generated from protobuf field int64 executed_last_minute_count = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getExecutedLastMinuteCount() + { + return $this->executed_last_minute_count; + } + + /** + * Output only. The number of tasks that the queue has dispatched and received + * a reply for during the last minute. This variable counts both successful + * and non-successful executions. + * + * Generated from protobuf field int64 executed_last_minute_count = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setExecutedLastMinuteCount($var) + { + GPBUtil::checkInt64($var); + $this->executed_last_minute_count = $var; + + return $this; + } + + /** + * Output only. The number of requests that the queue has dispatched but has + * not received a reply for yet. + * + * Generated from protobuf field int64 concurrent_dispatches_count = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getConcurrentDispatchesCount() + { + return $this->concurrent_dispatches_count; + } + + /** + * Output only. The number of requests that the queue has dispatched but has + * not received a reply for yet. + * + * Generated from protobuf field int64 concurrent_dispatches_count = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setConcurrentDispatchesCount($var) + { + GPBUtil::checkInt64($var); + $this->concurrent_dispatches_count = $var; + + return $this; + } + + /** + * Output only. The current maximum number of tasks per second executed by the + * queue. The maximum value of this variable is controlled by the RateLimits + * of the Queue. However, this value could be less to avoid overloading the + * endpoints tasks in the queue are targeting. + * + * Generated from protobuf field double effective_execution_rate = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return float + */ + public function getEffectiveExecutionRate() + { + return $this->effective_execution_rate; + } + + /** + * Output only. The current maximum number of tasks per second executed by the + * queue. The maximum value of this variable is controlled by the RateLimits + * of the Queue. However, this value could be less to avoid overloading the + * endpoints tasks in the queue are targeting. + * + * Generated from protobuf field double effective_execution_rate = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param float $var + * @return $this + */ + public function setEffectiveExecutionRate($var) + { + GPBUtil::checkDouble($var); + $this->effective_execution_rate = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/RateLimits.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/RateLimits.php new file mode 100644 index 000000000000..1607a1fb59c4 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/RateLimits.php @@ -0,0 +1,349 @@ +google.cloud.tasks.v2beta2.RateLimits + */ +class RateLimits extends \Google\Protobuf\Internal\Message +{ + /** + * The maximum rate at which tasks are dispatched from this queue. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * * For [App Engine queues][google.cloud.tasks.v2beta2.AppEngineHttpTarget], + * the maximum allowed value + * is 500. + * * This field is output only for [pull + * queues][google.cloud.tasks.v2beta2.PullTarget]. In addition to the + * `max_tasks_dispatched_per_second` limit, a maximum of 10 QPS of + * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] requests + * are allowed per pull queue. + * This field has the same meaning as + * [rate in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate). + * + * Generated from protobuf field double max_tasks_dispatched_per_second = 1; + */ + protected $max_tasks_dispatched_per_second = 0.0; + /** + * The max burst size. + * Max burst size limits how fast tasks in queue are processed when + * many tasks are in the queue and the rate is high. This field + * allows the queue to have a high rate so processing starts shortly + * after a task is enqueued, but still limits resource usage when + * many tasks are enqueued in a short period of time. + * The [token bucket](https://wikipedia.org/wiki/Token_Bucket) + * algorithm is used to control the rate of task dispatches. Each + * queue has a token bucket that holds tokens, up to the maximum + * specified by `max_burst_size`. Each time a task is dispatched, a + * token is removed from the bucket. Tasks will be dispatched until + * the queue's bucket runs out of tokens. The bucket will be + * continuously refilled with new tokens based on + * [max_dispatches_per_second][RateLimits.max_dispatches_per_second]. + * The default value of `max_burst_size` is picked by Cloud Tasks + * based on the value of + * [max_dispatches_per_second][RateLimits.max_dispatches_per_second]. + * The maximum value of `max_burst_size` is 500. + * For App Engine queues that were created or updated using + * `queue.yaml/xml`, `max_burst_size` is equal to + * [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size). + * If + * [UpdateQueue][google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue] is called + * on a queue without explicitly setting a value for `max_burst_size`, + * `max_burst_size` value will get updated if + * [UpdateQueue][google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue] is + * updating [max_dispatches_per_second][RateLimits.max_dispatches_per_second]. + * + * Generated from protobuf field int32 max_burst_size = 2; + */ + protected $max_burst_size = 0; + /** + * The maximum number of concurrent tasks that Cloud Tasks allows + * to be dispatched for this queue. After this threshold has been + * reached, Cloud Tasks stops dispatching tasks until the number of + * concurrent requests decreases. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * The maximum allowed value is 5,000. + * This field is output only for + * [pull queues][google.cloud.tasks.v2beta2.PullTarget] and always -1, which + * indicates no limit. No other queue types can have `max_concurrent_tasks` + * set to -1. + * This field has the same meaning as + * [max_concurrent_requests in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests). + * + * Generated from protobuf field int32 max_concurrent_tasks = 3; + */ + protected $max_concurrent_tasks = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $max_tasks_dispatched_per_second + * The maximum rate at which tasks are dispatched from this queue. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * * For [App Engine queues][google.cloud.tasks.v2beta2.AppEngineHttpTarget], + * the maximum allowed value + * is 500. + * * This field is output only for [pull + * queues][google.cloud.tasks.v2beta2.PullTarget]. In addition to the + * `max_tasks_dispatched_per_second` limit, a maximum of 10 QPS of + * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] requests + * are allowed per pull queue. + * This field has the same meaning as + * [rate in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate). + * @type int $max_burst_size + * The max burst size. + * Max burst size limits how fast tasks in queue are processed when + * many tasks are in the queue and the rate is high. This field + * allows the queue to have a high rate so processing starts shortly + * after a task is enqueued, but still limits resource usage when + * many tasks are enqueued in a short period of time. + * The [token bucket](https://wikipedia.org/wiki/Token_Bucket) + * algorithm is used to control the rate of task dispatches. Each + * queue has a token bucket that holds tokens, up to the maximum + * specified by `max_burst_size`. Each time a task is dispatched, a + * token is removed from the bucket. Tasks will be dispatched until + * the queue's bucket runs out of tokens. The bucket will be + * continuously refilled with new tokens based on + * [max_dispatches_per_second][RateLimits.max_dispatches_per_second]. + * The default value of `max_burst_size` is picked by Cloud Tasks + * based on the value of + * [max_dispatches_per_second][RateLimits.max_dispatches_per_second]. + * The maximum value of `max_burst_size` is 500. + * For App Engine queues that were created or updated using + * `queue.yaml/xml`, `max_burst_size` is equal to + * [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size). + * If + * [UpdateQueue][google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue] is called + * on a queue without explicitly setting a value for `max_burst_size`, + * `max_burst_size` value will get updated if + * [UpdateQueue][google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue] is + * updating [max_dispatches_per_second][RateLimits.max_dispatches_per_second]. + * @type int $max_concurrent_tasks + * The maximum number of concurrent tasks that Cloud Tasks allows + * to be dispatched for this queue. After this threshold has been + * reached, Cloud Tasks stops dispatching tasks until the number of + * concurrent requests decreases. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * The maximum allowed value is 5,000. + * This field is output only for + * [pull queues][google.cloud.tasks.v2beta2.PullTarget] and always -1, which + * indicates no limit. No other queue types can have `max_concurrent_tasks` + * set to -1. + * This field has the same meaning as + * [max_concurrent_requests in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Queue::initOnce(); + parent::__construct($data); + } + + /** + * The maximum rate at which tasks are dispatched from this queue. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * * For [App Engine queues][google.cloud.tasks.v2beta2.AppEngineHttpTarget], + * the maximum allowed value + * is 500. + * * This field is output only for [pull + * queues][google.cloud.tasks.v2beta2.PullTarget]. In addition to the + * `max_tasks_dispatched_per_second` limit, a maximum of 10 QPS of + * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] requests + * are allowed per pull queue. + * This field has the same meaning as + * [rate in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate). + * + * Generated from protobuf field double max_tasks_dispatched_per_second = 1; + * @return float + */ + public function getMaxTasksDispatchedPerSecond() + { + return $this->max_tasks_dispatched_per_second; + } + + /** + * The maximum rate at which tasks are dispatched from this queue. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * * For [App Engine queues][google.cloud.tasks.v2beta2.AppEngineHttpTarget], + * the maximum allowed value + * is 500. + * * This field is output only for [pull + * queues][google.cloud.tasks.v2beta2.PullTarget]. In addition to the + * `max_tasks_dispatched_per_second` limit, a maximum of 10 QPS of + * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] requests + * are allowed per pull queue. + * This field has the same meaning as + * [rate in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate). + * + * Generated from protobuf field double max_tasks_dispatched_per_second = 1; + * @param float $var + * @return $this + */ + public function setMaxTasksDispatchedPerSecond($var) + { + GPBUtil::checkDouble($var); + $this->max_tasks_dispatched_per_second = $var; + + return $this; + } + + /** + * The max burst size. + * Max burst size limits how fast tasks in queue are processed when + * many tasks are in the queue and the rate is high. This field + * allows the queue to have a high rate so processing starts shortly + * after a task is enqueued, but still limits resource usage when + * many tasks are enqueued in a short period of time. + * The [token bucket](https://wikipedia.org/wiki/Token_Bucket) + * algorithm is used to control the rate of task dispatches. Each + * queue has a token bucket that holds tokens, up to the maximum + * specified by `max_burst_size`. Each time a task is dispatched, a + * token is removed from the bucket. Tasks will be dispatched until + * the queue's bucket runs out of tokens. The bucket will be + * continuously refilled with new tokens based on + * [max_dispatches_per_second][RateLimits.max_dispatches_per_second]. + * The default value of `max_burst_size` is picked by Cloud Tasks + * based on the value of + * [max_dispatches_per_second][RateLimits.max_dispatches_per_second]. + * The maximum value of `max_burst_size` is 500. + * For App Engine queues that were created or updated using + * `queue.yaml/xml`, `max_burst_size` is equal to + * [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size). + * If + * [UpdateQueue][google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue] is called + * on a queue without explicitly setting a value for `max_burst_size`, + * `max_burst_size` value will get updated if + * [UpdateQueue][google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue] is + * updating [max_dispatches_per_second][RateLimits.max_dispatches_per_second]. + * + * Generated from protobuf field int32 max_burst_size = 2; + * @return int + */ + public function getMaxBurstSize() + { + return $this->max_burst_size; + } + + /** + * The max burst size. + * Max burst size limits how fast tasks in queue are processed when + * many tasks are in the queue and the rate is high. This field + * allows the queue to have a high rate so processing starts shortly + * after a task is enqueued, but still limits resource usage when + * many tasks are enqueued in a short period of time. + * The [token bucket](https://wikipedia.org/wiki/Token_Bucket) + * algorithm is used to control the rate of task dispatches. Each + * queue has a token bucket that holds tokens, up to the maximum + * specified by `max_burst_size`. Each time a task is dispatched, a + * token is removed from the bucket. Tasks will be dispatched until + * the queue's bucket runs out of tokens. The bucket will be + * continuously refilled with new tokens based on + * [max_dispatches_per_second][RateLimits.max_dispatches_per_second]. + * The default value of `max_burst_size` is picked by Cloud Tasks + * based on the value of + * [max_dispatches_per_second][RateLimits.max_dispatches_per_second]. + * The maximum value of `max_burst_size` is 500. + * For App Engine queues that were created or updated using + * `queue.yaml/xml`, `max_burst_size` is equal to + * [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size). + * If + * [UpdateQueue][google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue] is called + * on a queue without explicitly setting a value for `max_burst_size`, + * `max_burst_size` value will get updated if + * [UpdateQueue][google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue] is + * updating [max_dispatches_per_second][RateLimits.max_dispatches_per_second]. + * + * Generated from protobuf field int32 max_burst_size = 2; + * @param int $var + * @return $this + */ + public function setMaxBurstSize($var) + { + GPBUtil::checkInt32($var); + $this->max_burst_size = $var; + + return $this; + } + + /** + * The maximum number of concurrent tasks that Cloud Tasks allows + * to be dispatched for this queue. After this threshold has been + * reached, Cloud Tasks stops dispatching tasks until the number of + * concurrent requests decreases. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * The maximum allowed value is 5,000. + * This field is output only for + * [pull queues][google.cloud.tasks.v2beta2.PullTarget] and always -1, which + * indicates no limit. No other queue types can have `max_concurrent_tasks` + * set to -1. + * This field has the same meaning as + * [max_concurrent_requests in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests). + * + * Generated from protobuf field int32 max_concurrent_tasks = 3; + * @return int + */ + public function getMaxConcurrentTasks() + { + return $this->max_concurrent_tasks; + } + + /** + * The maximum number of concurrent tasks that Cloud Tasks allows + * to be dispatched for this queue. After this threshold has been + * reached, Cloud Tasks stops dispatching tasks until the number of + * concurrent requests decreases. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * The maximum allowed value is 5,000. + * This field is output only for + * [pull queues][google.cloud.tasks.v2beta2.PullTarget] and always -1, which + * indicates no limit. No other queue types can have `max_concurrent_tasks` + * set to -1. + * This field has the same meaning as + * [max_concurrent_requests in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests). + * + * Generated from protobuf field int32 max_concurrent_tasks = 3; + * @param int $var + * @return $this + */ + public function setMaxConcurrentTasks($var) + { + GPBUtil::checkInt32($var); + $this->max_concurrent_tasks = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/RenewLeaseRequest.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/RenewLeaseRequest.php new file mode 100644 index 000000000000..dd4bae70caa0 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/RenewLeaseRequest.php @@ -0,0 +1,258 @@ +google.cloud.tasks.v2beta2.RenewLeaseRequest + */ +class RenewLeaseRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. The task's current schedule time, available in the + * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] returned by + * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] response or + * [RenewLease][google.cloud.tasks.v2beta2.CloudTasks.RenewLease] response. + * This restriction is to ensure that your worker currently holds the lease. + * + * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $schedule_time = null; + /** + * Required. The desired new lease duration, starting from now. + * The maximum lease duration is 1 week. + * `lease_duration` will be truncated to the nearest second. + * + * Generated from protobuf field .google.protobuf.Duration lease_duration = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $lease_duration = null; + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta2.Task] will be returned. + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta2.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View response_view = 4; + */ + protected $response_view = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * @type \Google\Protobuf\Timestamp $schedule_time + * Required. The task's current schedule time, available in the + * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] returned by + * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] response or + * [RenewLease][google.cloud.tasks.v2beta2.CloudTasks.RenewLease] response. + * This restriction is to ensure that your worker currently holds the lease. + * @type \Google\Protobuf\Duration $lease_duration + * Required. The desired new lease duration, starting from now. + * The maximum lease duration is 1 week. + * `lease_duration` will be truncated to the nearest second. + * @type int $response_view + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta2.Task] will be returned. + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta2.Task] resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The task's current schedule time, available in the + * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] returned by + * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] response or + * [RenewLease][google.cloud.tasks.v2beta2.CloudTasks.RenewLease] response. + * This restriction is to ensure that your worker currently holds the lease. + * + * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getScheduleTime() + { + return $this->schedule_time; + } + + public function hasScheduleTime() + { + return isset($this->schedule_time); + } + + public function clearScheduleTime() + { + unset($this->schedule_time); + } + + /** + * Required. The task's current schedule time, available in the + * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] returned by + * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] response or + * [RenewLease][google.cloud.tasks.v2beta2.CloudTasks.RenewLease] response. + * This restriction is to ensure that your worker currently holds the lease. + * + * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setScheduleTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->schedule_time = $var; + + return $this; + } + + /** + * Required. The desired new lease duration, starting from now. + * The maximum lease duration is 1 week. + * `lease_duration` will be truncated to the nearest second. + * + * Generated from protobuf field .google.protobuf.Duration lease_duration = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Duration|null + */ + public function getLeaseDuration() + { + return $this->lease_duration; + } + + public function hasLeaseDuration() + { + return isset($this->lease_duration); + } + + public function clearLeaseDuration() + { + unset($this->lease_duration); + } + + /** + * Required. The desired new lease duration, starting from now. + * The maximum lease duration is 1 week. + * `lease_duration` will be truncated to the nearest second. + * + * Generated from protobuf field .google.protobuf.Duration lease_duration = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setLeaseDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->lease_duration = $var; + + return $this; + } + + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta2.Task] will be returned. + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta2.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View response_view = 4; + * @return int + */ + public function getResponseView() + { + return $this->response_view; + } + + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta2.Task] will be returned. + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta2.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View response_view = 4; + * @param int $var + * @return $this + */ + public function setResponseView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta2\Task\View::class); + $this->response_view = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ResumeQueueRequest.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ResumeQueueRequest.php new file mode 100644 index 000000000000..2313b11ba861 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ResumeQueueRequest.php @@ -0,0 +1,72 @@ +google.cloud.tasks.v2beta2.ResumeQueueRequest + */ +class ResumeQueueRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/RetryConfig.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/RetryConfig.php new file mode 100644 index 000000000000..72adfcb1e3c1 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/RetryConfig.php @@ -0,0 +1,548 @@ +google.cloud.tasks.v2beta2.RetryConfig + */ +class RetryConfig extends \Google\Protobuf\Internal\Message +{ + /** + * If positive, `max_retry_duration` specifies the time limit for + * retrying a failed task, measured from when the task was first + * attempted. Once `max_retry_duration` time has passed *and* the + * task has been attempted + * [max_attempts][google.cloud.tasks.v2beta2.RetryConfig.max_attempts] times, + * no further attempts will be made and the task will be deleted. + * If zero, then the task age is unlimited. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * This field is output only for [pull + * queues][google.cloud.tasks.v2beta2.PullTarget]. + * `max_retry_duration` will be truncated to the nearest second. + * This field has the same meaning as + * [task_age_limit in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * + * Generated from protobuf field .google.protobuf.Duration max_retry_duration = 3; + */ + protected $max_retry_duration = null; + /** + * A task will be [scheduled][google.cloud.tasks.v2beta2.Task.schedule_time] + * for retry between + * [min_backoff][google.cloud.tasks.v2beta2.RetryConfig.min_backoff] and + * [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] duration + * after it fails, if the queue's + * [RetryConfig][google.cloud.tasks.v2beta2.RetryConfig] specifies that the + * task should be retried. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * This field is output only for [pull + * queues][google.cloud.tasks.v2beta2.PullTarget]. + * `min_backoff` will be truncated to the nearest second. + * This field has the same meaning as + * [min_backoff_seconds in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * + * Generated from protobuf field .google.protobuf.Duration min_backoff = 4; + */ + protected $min_backoff = null; + /** + * A task will be [scheduled][google.cloud.tasks.v2beta2.Task.schedule_time] + * for retry between + * [min_backoff][google.cloud.tasks.v2beta2.RetryConfig.min_backoff] and + * [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] duration + * after it fails, if the queue's + * [RetryConfig][google.cloud.tasks.v2beta2.RetryConfig] specifies that the + * task should be retried. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * This field is output only for [pull + * queues][google.cloud.tasks.v2beta2.PullTarget]. + * `max_backoff` will be truncated to the nearest second. + * This field has the same meaning as + * [max_backoff_seconds in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * + * Generated from protobuf field .google.protobuf.Duration max_backoff = 5; + */ + protected $max_backoff = null; + /** + * The time between retries will double `max_doublings` times. + * A task's retry interval starts at + * [min_backoff][google.cloud.tasks.v2beta2.RetryConfig.min_backoff], then + * doubles `max_doublings` times, then increases linearly, and finally retries + * at intervals of + * [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] up to + * [max_attempts][google.cloud.tasks.v2beta2.RetryConfig.max_attempts] times. + * For example, if + * [min_backoff][google.cloud.tasks.v2beta2.RetryConfig.min_backoff] is 10s, + * [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] is 300s, + * and `max_doublings` is 3, then the a task will first be retried in 10s. The + * retry interval will double three times, and then increase linearly by 2^3 * + * 10s. Finally, the task will retry at intervals of + * [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] until the + * task has been attempted + * [max_attempts][google.cloud.tasks.v2beta2.RetryConfig.max_attempts] times. + * Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, + * 300s, .... + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * This field is output only for [pull + * queues][google.cloud.tasks.v2beta2.PullTarget]. + * This field has the same meaning as + * [max_doublings in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * + * Generated from protobuf field int32 max_doublings = 6; + */ + protected $max_doublings = 0; + protected $num_attempts; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $max_attempts + * The maximum number of attempts for a task. + * Cloud Tasks will attempt the task `max_attempts` times (that + * is, if the first attempt fails, then there will be + * `max_attempts - 1` retries). Must be > 0. + * @type bool $unlimited_attempts + * If true, then the number of attempts is unlimited. + * @type \Google\Protobuf\Duration $max_retry_duration + * If positive, `max_retry_duration` specifies the time limit for + * retrying a failed task, measured from when the task was first + * attempted. Once `max_retry_duration` time has passed *and* the + * task has been attempted + * [max_attempts][google.cloud.tasks.v2beta2.RetryConfig.max_attempts] times, + * no further attempts will be made and the task will be deleted. + * If zero, then the task age is unlimited. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * This field is output only for [pull + * queues][google.cloud.tasks.v2beta2.PullTarget]. + * `max_retry_duration` will be truncated to the nearest second. + * This field has the same meaning as + * [task_age_limit in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * @type \Google\Protobuf\Duration $min_backoff + * A task will be [scheduled][google.cloud.tasks.v2beta2.Task.schedule_time] + * for retry between + * [min_backoff][google.cloud.tasks.v2beta2.RetryConfig.min_backoff] and + * [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] duration + * after it fails, if the queue's + * [RetryConfig][google.cloud.tasks.v2beta2.RetryConfig] specifies that the + * task should be retried. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * This field is output only for [pull + * queues][google.cloud.tasks.v2beta2.PullTarget]. + * `min_backoff` will be truncated to the nearest second. + * This field has the same meaning as + * [min_backoff_seconds in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * @type \Google\Protobuf\Duration $max_backoff + * A task will be [scheduled][google.cloud.tasks.v2beta2.Task.schedule_time] + * for retry between + * [min_backoff][google.cloud.tasks.v2beta2.RetryConfig.min_backoff] and + * [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] duration + * after it fails, if the queue's + * [RetryConfig][google.cloud.tasks.v2beta2.RetryConfig] specifies that the + * task should be retried. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * This field is output only for [pull + * queues][google.cloud.tasks.v2beta2.PullTarget]. + * `max_backoff` will be truncated to the nearest second. + * This field has the same meaning as + * [max_backoff_seconds in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * @type int $max_doublings + * The time between retries will double `max_doublings` times. + * A task's retry interval starts at + * [min_backoff][google.cloud.tasks.v2beta2.RetryConfig.min_backoff], then + * doubles `max_doublings` times, then increases linearly, and finally retries + * at intervals of + * [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] up to + * [max_attempts][google.cloud.tasks.v2beta2.RetryConfig.max_attempts] times. + * For example, if + * [min_backoff][google.cloud.tasks.v2beta2.RetryConfig.min_backoff] is 10s, + * [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] is 300s, + * and `max_doublings` is 3, then the a task will first be retried in 10s. The + * retry interval will double three times, and then increase linearly by 2^3 * + * 10s. Finally, the task will retry at intervals of + * [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] until the + * task has been attempted + * [max_attempts][google.cloud.tasks.v2beta2.RetryConfig.max_attempts] times. + * Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, + * 300s, .... + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * This field is output only for [pull + * queues][google.cloud.tasks.v2beta2.PullTarget]. + * This field has the same meaning as + * [max_doublings in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Queue::initOnce(); + parent::__construct($data); + } + + /** + * The maximum number of attempts for a task. + * Cloud Tasks will attempt the task `max_attempts` times (that + * is, if the first attempt fails, then there will be + * `max_attempts - 1` retries). Must be > 0. + * + * Generated from protobuf field int32 max_attempts = 1; + * @return int + */ + public function getMaxAttempts() + { + return $this->readOneof(1); + } + + public function hasMaxAttempts() + { + return $this->hasOneof(1); + } + + /** + * The maximum number of attempts for a task. + * Cloud Tasks will attempt the task `max_attempts` times (that + * is, if the first attempt fails, then there will be + * `max_attempts - 1` retries). Must be > 0. + * + * Generated from protobuf field int32 max_attempts = 1; + * @param int $var + * @return $this + */ + public function setMaxAttempts($var) + { + GPBUtil::checkInt32($var); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * If true, then the number of attempts is unlimited. + * + * Generated from protobuf field bool unlimited_attempts = 2; + * @return bool + */ + public function getUnlimitedAttempts() + { + return $this->readOneof(2); + } + + public function hasUnlimitedAttempts() + { + return $this->hasOneof(2); + } + + /** + * If true, then the number of attempts is unlimited. + * + * Generated from protobuf field bool unlimited_attempts = 2; + * @param bool $var + * @return $this + */ + public function setUnlimitedAttempts($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * If positive, `max_retry_duration` specifies the time limit for + * retrying a failed task, measured from when the task was first + * attempted. Once `max_retry_duration` time has passed *and* the + * task has been attempted + * [max_attempts][google.cloud.tasks.v2beta2.RetryConfig.max_attempts] times, + * no further attempts will be made and the task will be deleted. + * If zero, then the task age is unlimited. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * This field is output only for [pull + * queues][google.cloud.tasks.v2beta2.PullTarget]. + * `max_retry_duration` will be truncated to the nearest second. + * This field has the same meaning as + * [task_age_limit in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * + * Generated from protobuf field .google.protobuf.Duration max_retry_duration = 3; + * @return \Google\Protobuf\Duration|null + */ + public function getMaxRetryDuration() + { + return $this->max_retry_duration; + } + + public function hasMaxRetryDuration() + { + return isset($this->max_retry_duration); + } + + public function clearMaxRetryDuration() + { + unset($this->max_retry_duration); + } + + /** + * If positive, `max_retry_duration` specifies the time limit for + * retrying a failed task, measured from when the task was first + * attempted. Once `max_retry_duration` time has passed *and* the + * task has been attempted + * [max_attempts][google.cloud.tasks.v2beta2.RetryConfig.max_attempts] times, + * no further attempts will be made and the task will be deleted. + * If zero, then the task age is unlimited. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * This field is output only for [pull + * queues][google.cloud.tasks.v2beta2.PullTarget]. + * `max_retry_duration` will be truncated to the nearest second. + * This field has the same meaning as + * [task_age_limit in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * + * Generated from protobuf field .google.protobuf.Duration max_retry_duration = 3; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setMaxRetryDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->max_retry_duration = $var; + + return $this; + } + + /** + * A task will be [scheduled][google.cloud.tasks.v2beta2.Task.schedule_time] + * for retry between + * [min_backoff][google.cloud.tasks.v2beta2.RetryConfig.min_backoff] and + * [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] duration + * after it fails, if the queue's + * [RetryConfig][google.cloud.tasks.v2beta2.RetryConfig] specifies that the + * task should be retried. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * This field is output only for [pull + * queues][google.cloud.tasks.v2beta2.PullTarget]. + * `min_backoff` will be truncated to the nearest second. + * This field has the same meaning as + * [min_backoff_seconds in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * + * Generated from protobuf field .google.protobuf.Duration min_backoff = 4; + * @return \Google\Protobuf\Duration|null + */ + public function getMinBackoff() + { + return $this->min_backoff; + } + + public function hasMinBackoff() + { + return isset($this->min_backoff); + } + + public function clearMinBackoff() + { + unset($this->min_backoff); + } + + /** + * A task will be [scheduled][google.cloud.tasks.v2beta2.Task.schedule_time] + * for retry between + * [min_backoff][google.cloud.tasks.v2beta2.RetryConfig.min_backoff] and + * [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] duration + * after it fails, if the queue's + * [RetryConfig][google.cloud.tasks.v2beta2.RetryConfig] specifies that the + * task should be retried. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * This field is output only for [pull + * queues][google.cloud.tasks.v2beta2.PullTarget]. + * `min_backoff` will be truncated to the nearest second. + * This field has the same meaning as + * [min_backoff_seconds in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * + * Generated from protobuf field .google.protobuf.Duration min_backoff = 4; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setMinBackoff($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->min_backoff = $var; + + return $this; + } + + /** + * A task will be [scheduled][google.cloud.tasks.v2beta2.Task.schedule_time] + * for retry between + * [min_backoff][google.cloud.tasks.v2beta2.RetryConfig.min_backoff] and + * [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] duration + * after it fails, if the queue's + * [RetryConfig][google.cloud.tasks.v2beta2.RetryConfig] specifies that the + * task should be retried. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * This field is output only for [pull + * queues][google.cloud.tasks.v2beta2.PullTarget]. + * `max_backoff` will be truncated to the nearest second. + * This field has the same meaning as + * [max_backoff_seconds in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * + * Generated from protobuf field .google.protobuf.Duration max_backoff = 5; + * @return \Google\Protobuf\Duration|null + */ + public function getMaxBackoff() + { + return $this->max_backoff; + } + + public function hasMaxBackoff() + { + return isset($this->max_backoff); + } + + public function clearMaxBackoff() + { + unset($this->max_backoff); + } + + /** + * A task will be [scheduled][google.cloud.tasks.v2beta2.Task.schedule_time] + * for retry between + * [min_backoff][google.cloud.tasks.v2beta2.RetryConfig.min_backoff] and + * [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] duration + * after it fails, if the queue's + * [RetryConfig][google.cloud.tasks.v2beta2.RetryConfig] specifies that the + * task should be retried. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * This field is output only for [pull + * queues][google.cloud.tasks.v2beta2.PullTarget]. + * `max_backoff` will be truncated to the nearest second. + * This field has the same meaning as + * [max_backoff_seconds in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * + * Generated from protobuf field .google.protobuf.Duration max_backoff = 5; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setMaxBackoff($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->max_backoff = $var; + + return $this; + } + + /** + * The time between retries will double `max_doublings` times. + * A task's retry interval starts at + * [min_backoff][google.cloud.tasks.v2beta2.RetryConfig.min_backoff], then + * doubles `max_doublings` times, then increases linearly, and finally retries + * at intervals of + * [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] up to + * [max_attempts][google.cloud.tasks.v2beta2.RetryConfig.max_attempts] times. + * For example, if + * [min_backoff][google.cloud.tasks.v2beta2.RetryConfig.min_backoff] is 10s, + * [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] is 300s, + * and `max_doublings` is 3, then the a task will first be retried in 10s. The + * retry interval will double three times, and then increase linearly by 2^3 * + * 10s. Finally, the task will retry at intervals of + * [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] until the + * task has been attempted + * [max_attempts][google.cloud.tasks.v2beta2.RetryConfig.max_attempts] times. + * Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, + * 300s, .... + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * This field is output only for [pull + * queues][google.cloud.tasks.v2beta2.PullTarget]. + * This field has the same meaning as + * [max_doublings in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * + * Generated from protobuf field int32 max_doublings = 6; + * @return int + */ + public function getMaxDoublings() + { + return $this->max_doublings; + } + + /** + * The time between retries will double `max_doublings` times. + * A task's retry interval starts at + * [min_backoff][google.cloud.tasks.v2beta2.RetryConfig.min_backoff], then + * doubles `max_doublings` times, then increases linearly, and finally retries + * at intervals of + * [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] up to + * [max_attempts][google.cloud.tasks.v2beta2.RetryConfig.max_attempts] times. + * For example, if + * [min_backoff][google.cloud.tasks.v2beta2.RetryConfig.min_backoff] is 10s, + * [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] is 300s, + * and `max_doublings` is 3, then the a task will first be retried in 10s. The + * retry interval will double three times, and then increase linearly by 2^3 * + * 10s. Finally, the task will retry at intervals of + * [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] until the + * task has been attempted + * [max_attempts][google.cloud.tasks.v2beta2.RetryConfig.max_attempts] times. + * Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, + * 300s, .... + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * This field is output only for [pull + * queues][google.cloud.tasks.v2beta2.PullTarget]. + * This field has the same meaning as + * [max_doublings in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * + * Generated from protobuf field int32 max_doublings = 6; + * @param int $var + * @return $this + */ + public function setMaxDoublings($var) + { + GPBUtil::checkInt32($var); + $this->max_doublings = $var; + + return $this; + } + + /** + * @return string + */ + public function getNumAttempts() + { + return $this->whichOneof("num_attempts"); + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/RunTaskRequest.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/RunTaskRequest.php new file mode 100644 index 000000000000..43840ad89f47 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/RunTaskRequest.php @@ -0,0 +1,146 @@ +google.cloud.tasks.v2beta2.RunTaskRequest + */ +class RunTaskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta2.Task] will be returned. + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta2.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View response_view = 2; + */ + protected $response_view = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * @type int $response_view + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta2.Task] will be returned. + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta2.Task] resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta2.Task] will be returned. + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta2.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View response_view = 2; + * @return int + */ + public function getResponseView() + { + return $this->response_view; + } + + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta2.Task] will be returned. + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta2.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View response_view = 2; + * @param int $var + * @return $this + */ + public function setResponseView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta2\Task\View::class); + $this->response_view = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Task.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Task.php new file mode 100644 index 000000000000..820e2333cf67 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Task.php @@ -0,0 +1,484 @@ +google.cloud.tasks.v2beta2.Task + */ +class Task extends \Google\Protobuf\Internal\Message +{ + /** + * Optionally caller-specified in + * [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. + * The task name. + * The task name must have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), + * hyphens (-), colons (:), or periods (.). + * For more information, see + * [Identifying + * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) + * * `LOCATION_ID` is the canonical ID for the task's location. + * The list of available locations can be obtained by calling + * [ListLocations][google.cloud.location.Locations.ListLocations]. + * For more information, see https://cloud.google.com/about/locations/. + * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or + * hyphens (-). The maximum length is 100 characters. + * * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), + * hyphens (-), or underscores (_). The maximum length is 500 characters. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The time when the task is scheduled to be attempted. + * For App Engine queues, this is when the task will be attempted or retried. + * For pull queues, this is the time when the task is available to + * be leased; if a task is currently leased, this is the time when + * the current lease expires, that is, the time that the task was + * leased plus the + * [lease_duration][google.cloud.tasks.v2beta2.LeaseTasksRequest.lease_duration]. + * `schedule_time` will be truncated to the nearest microsecond. + * + * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 5; + */ + protected $schedule_time = null; + /** + * Output only. The time that the task was created. + * `create_time` will be truncated to the nearest second. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6; + */ + protected $create_time = null; + /** + * Output only. The task status. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.TaskStatus status = 7; + */ + protected $status = null; + /** + * Output only. The view specifies which subset of the + * [Task][google.cloud.tasks.v2beta2.Task] has been returned. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View view = 8; + */ + protected $view = 0; + protected $payload_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Optionally caller-specified in + * [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. + * The task name. + * The task name must have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), + * hyphens (-), colons (:), or periods (.). + * For more information, see + * [Identifying + * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) + * * `LOCATION_ID` is the canonical ID for the task's location. + * The list of available locations can be obtained by calling + * [ListLocations][google.cloud.location.Locations.ListLocations]. + * For more information, see https://cloud.google.com/about/locations/. + * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or + * hyphens (-). The maximum length is 100 characters. + * * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), + * hyphens (-), or underscores (_). The maximum length is 500 characters. + * @type \Google\Cloud\Tasks\V2beta2\AppEngineHttpRequest $app_engine_http_request + * App Engine HTTP request that is sent to the task's target. Can + * be set only if + * [app_engine_http_target][google.cloud.tasks.v2beta2.Queue.app_engine_http_target] + * is set on the queue. + * An App Engine task is a task that has + * [AppEngineHttpRequest][google.cloud.tasks.v2beta2.AppEngineHttpRequest] + * set. + * @type \Google\Cloud\Tasks\V2beta2\PullMessage $pull_message + * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] to process + * the task. Can be set only if + * [pull_target][google.cloud.tasks.v2beta2.Queue.pull_target] is set on the + * queue. + * A pull task is a task that has + * [PullMessage][google.cloud.tasks.v2beta2.PullMessage] set. + * @type \Google\Cloud\Tasks\V2beta2\HttpRequest $http_request + * HTTP request that is sent to the task's target. + * An HTTP task is a task that has + * [HttpRequest][google.cloud.tasks.v2beta2.HttpRequest] set. + * @type \Google\Protobuf\Timestamp $schedule_time + * The time when the task is scheduled to be attempted. + * For App Engine queues, this is when the task will be attempted or retried. + * For pull queues, this is the time when the task is available to + * be leased; if a task is currently leased, this is the time when + * the current lease expires, that is, the time that the task was + * leased plus the + * [lease_duration][google.cloud.tasks.v2beta2.LeaseTasksRequest.lease_duration]. + * `schedule_time` will be truncated to the nearest microsecond. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time that the task was created. + * `create_time` will be truncated to the nearest second. + * @type \Google\Cloud\Tasks\V2beta2\TaskStatus $status + * Output only. The task status. + * @type int $view + * Output only. The view specifies which subset of the + * [Task][google.cloud.tasks.v2beta2.Task] has been returned. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Task::initOnce(); + parent::__construct($data); + } + + /** + * Optionally caller-specified in + * [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. + * The task name. + * The task name must have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), + * hyphens (-), colons (:), or periods (.). + * For more information, see + * [Identifying + * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) + * * `LOCATION_ID` is the canonical ID for the task's location. + * The list of available locations can be obtained by calling + * [ListLocations][google.cloud.location.Locations.ListLocations]. + * For more information, see https://cloud.google.com/about/locations/. + * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or + * hyphens (-). The maximum length is 100 characters. + * * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), + * hyphens (-), or underscores (_). The maximum length is 500 characters. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Optionally caller-specified in + * [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. + * The task name. + * The task name must have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), + * hyphens (-), colons (:), or periods (.). + * For more information, see + * [Identifying + * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) + * * `LOCATION_ID` is the canonical ID for the task's location. + * The list of available locations can be obtained by calling + * [ListLocations][google.cloud.location.Locations.ListLocations]. + * For more information, see https://cloud.google.com/about/locations/. + * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or + * hyphens (-). The maximum length is 100 characters. + * * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), + * hyphens (-), or underscores (_). The maximum length is 500 characters. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * App Engine HTTP request that is sent to the task's target. Can + * be set only if + * [app_engine_http_target][google.cloud.tasks.v2beta2.Queue.app_engine_http_target] + * is set on the queue. + * An App Engine task is a task that has + * [AppEngineHttpRequest][google.cloud.tasks.v2beta2.AppEngineHttpRequest] + * set. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.AppEngineHttpRequest app_engine_http_request = 3; + * @return \Google\Cloud\Tasks\V2beta2\AppEngineHttpRequest|null + */ + public function getAppEngineHttpRequest() + { + return $this->readOneof(3); + } + + public function hasAppEngineHttpRequest() + { + return $this->hasOneof(3); + } + + /** + * App Engine HTTP request that is sent to the task's target. Can + * be set only if + * [app_engine_http_target][google.cloud.tasks.v2beta2.Queue.app_engine_http_target] + * is set on the queue. + * An App Engine task is a task that has + * [AppEngineHttpRequest][google.cloud.tasks.v2beta2.AppEngineHttpRequest] + * set. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.AppEngineHttpRequest app_engine_http_request = 3; + * @param \Google\Cloud\Tasks\V2beta2\AppEngineHttpRequest $var + * @return $this + */ + public function setAppEngineHttpRequest($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\AppEngineHttpRequest::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] to process + * the task. Can be set only if + * [pull_target][google.cloud.tasks.v2beta2.Queue.pull_target] is set on the + * queue. + * A pull task is a task that has + * [PullMessage][google.cloud.tasks.v2beta2.PullMessage] set. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.PullMessage pull_message = 4; + * @return \Google\Cloud\Tasks\V2beta2\PullMessage|null + */ + public function getPullMessage() + { + return $this->readOneof(4); + } + + public function hasPullMessage() + { + return $this->hasOneof(4); + } + + /** + * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] to process + * the task. Can be set only if + * [pull_target][google.cloud.tasks.v2beta2.Queue.pull_target] is set on the + * queue. + * A pull task is a task that has + * [PullMessage][google.cloud.tasks.v2beta2.PullMessage] set. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.PullMessage pull_message = 4; + * @param \Google\Cloud\Tasks\V2beta2\PullMessage $var + * @return $this + */ + public function setPullMessage($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\PullMessage::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * HTTP request that is sent to the task's target. + * An HTTP task is a task that has + * [HttpRequest][google.cloud.tasks.v2beta2.HttpRequest] set. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.HttpRequest http_request = 13; + * @return \Google\Cloud\Tasks\V2beta2\HttpRequest|null + */ + public function getHttpRequest() + { + return $this->readOneof(13); + } + + public function hasHttpRequest() + { + return $this->hasOneof(13); + } + + /** + * HTTP request that is sent to the task's target. + * An HTTP task is a task that has + * [HttpRequest][google.cloud.tasks.v2beta2.HttpRequest] set. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.HttpRequest http_request = 13; + * @param \Google\Cloud\Tasks\V2beta2\HttpRequest $var + * @return $this + */ + public function setHttpRequest($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\HttpRequest::class); + $this->writeOneof(13, $var); + + return $this; + } + + /** + * The time when the task is scheduled to be attempted. + * For App Engine queues, this is when the task will be attempted or retried. + * For pull queues, this is the time when the task is available to + * be leased; if a task is currently leased, this is the time when + * the current lease expires, that is, the time that the task was + * leased plus the + * [lease_duration][google.cloud.tasks.v2beta2.LeaseTasksRequest.lease_duration]. + * `schedule_time` will be truncated to the nearest microsecond. + * + * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 5; + * @return \Google\Protobuf\Timestamp|null + */ + public function getScheduleTime() + { + return $this->schedule_time; + } + + public function hasScheduleTime() + { + return isset($this->schedule_time); + } + + public function clearScheduleTime() + { + unset($this->schedule_time); + } + + /** + * The time when the task is scheduled to be attempted. + * For App Engine queues, this is when the task will be attempted or retried. + * For pull queues, this is the time when the task is available to + * be leased; if a task is currently leased, this is the time when + * the current lease expires, that is, the time that the task was + * leased plus the + * [lease_duration][google.cloud.tasks.v2beta2.LeaseTasksRequest.lease_duration]. + * `schedule_time` will be truncated to the nearest microsecond. + * + * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 5; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setScheduleTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->schedule_time = $var; + + return $this; + } + + /** + * Output only. The time that the task was created. + * `create_time` will be truncated to the nearest second. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time that the task was created. + * `create_time` will be truncated to the nearest second. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The task status. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.TaskStatus status = 7; + * @return \Google\Cloud\Tasks\V2beta2\TaskStatus|null + */ + public function getStatus() + { + return $this->status; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * Output only. The task status. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.TaskStatus status = 7; + * @param \Google\Cloud\Tasks\V2beta2\TaskStatus $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\TaskStatus::class); + $this->status = $var; + + return $this; + } + + /** + * Output only. The view specifies which subset of the + * [Task][google.cloud.tasks.v2beta2.Task] has been returned. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View view = 8; + * @return int + */ + public function getView() + { + return $this->view; + } + + /** + * Output only. The view specifies which subset of the + * [Task][google.cloud.tasks.v2beta2.Task] has been returned. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View view = 8; + * @param int $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta2\Task\View::class); + $this->view = $var; + + return $this; + } + + /** + * @return string + */ + public function getPayloadType() + { + return $this->whichOneof("payload_type"); + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Task/View.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Task/View.php new file mode 100644 index 000000000000..d3d0db2c9c71 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Task/View.php @@ -0,0 +1,83 @@ +google.cloud.tasks.v2beta2.Task.View + */ +class View +{ + /** + * Unspecified. Defaults to BASIC. + * + * Generated from protobuf enum VIEW_UNSPECIFIED = 0; + */ + const VIEW_UNSPECIFIED = 0; + /** + * The basic view omits fields which can be large or can contain + * sensitive data. + * This view does not include the + * ([payload in + * AppEngineHttpRequest][google.cloud.tasks.v2beta2.AppEngineHttpRequest] + * and [payload in + * PullMessage][google.cloud.tasks.v2beta2.PullMessage.payload]). These + * payloads are desirable to return only when needed, because they can be + * large and because of the sensitivity of the data that you choose to store + * in it. + * + * Generated from protobuf enum BASIC = 1; + */ + const BASIC = 1; + /** + * All information is returned. + * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Queue][google.cloud.tasks.v2beta2.Queue] resource. + * + * Generated from protobuf enum FULL = 2; + */ + const FULL = 2; + + private static $valueToName = [ + self::VIEW_UNSPECIFIED => 'VIEW_UNSPECIFIED', + self::BASIC => 'BASIC', + self::FULL => 'FULL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(View::class, \Google\Cloud\Tasks\V2beta2\Task_View::class); + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/TaskStatus.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/TaskStatus.php new file mode 100644 index 000000000000..9b7ced73522f --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/TaskStatus.php @@ -0,0 +1,241 @@ +google.cloud.tasks.v2beta2.TaskStatus + */ +class TaskStatus extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The number of attempts dispatched. + * This count includes attempts which have been dispatched but haven't + * received a response. + * + * Generated from protobuf field int32 attempt_dispatch_count = 1; + */ + protected $attempt_dispatch_count = 0; + /** + * Output only. The number of attempts which have received a response. + * This field is not calculated for [pull + * tasks][google.cloud.tasks.v2beta2.PullMessage]. + * + * Generated from protobuf field int32 attempt_response_count = 2; + */ + protected $attempt_response_count = 0; + /** + * Output only. The status of the task's first attempt. + * Only + * [dispatch_time][google.cloud.tasks.v2beta2.AttemptStatus.dispatch_time] + * will be set. The other + * [AttemptStatus][google.cloud.tasks.v2beta2.AttemptStatus] information is + * not retained by Cloud Tasks. + * This field is not calculated for [pull + * tasks][google.cloud.tasks.v2beta2.PullMessage]. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.AttemptStatus first_attempt_status = 3; + */ + protected $first_attempt_status = null; + /** + * Output only. The status of the task's last attempt. + * This field is not calculated for [pull + * tasks][google.cloud.tasks.v2beta2.PullMessage]. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.AttemptStatus last_attempt_status = 4; + */ + protected $last_attempt_status = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $attempt_dispatch_count + * Output only. The number of attempts dispatched. + * This count includes attempts which have been dispatched but haven't + * received a response. + * @type int $attempt_response_count + * Output only. The number of attempts which have received a response. + * This field is not calculated for [pull + * tasks][google.cloud.tasks.v2beta2.PullMessage]. + * @type \Google\Cloud\Tasks\V2beta2\AttemptStatus $first_attempt_status + * Output only. The status of the task's first attempt. + * Only + * [dispatch_time][google.cloud.tasks.v2beta2.AttemptStatus.dispatch_time] + * will be set. The other + * [AttemptStatus][google.cloud.tasks.v2beta2.AttemptStatus] information is + * not retained by Cloud Tasks. + * This field is not calculated for [pull + * tasks][google.cloud.tasks.v2beta2.PullMessage]. + * @type \Google\Cloud\Tasks\V2beta2\AttemptStatus $last_attempt_status + * Output only. The status of the task's last attempt. + * This field is not calculated for [pull + * tasks][google.cloud.tasks.v2beta2.PullMessage]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Task::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The number of attempts dispatched. + * This count includes attempts which have been dispatched but haven't + * received a response. + * + * Generated from protobuf field int32 attempt_dispatch_count = 1; + * @return int + */ + public function getAttemptDispatchCount() + { + return $this->attempt_dispatch_count; + } + + /** + * Output only. The number of attempts dispatched. + * This count includes attempts which have been dispatched but haven't + * received a response. + * + * Generated from protobuf field int32 attempt_dispatch_count = 1; + * @param int $var + * @return $this + */ + public function setAttemptDispatchCount($var) + { + GPBUtil::checkInt32($var); + $this->attempt_dispatch_count = $var; + + return $this; + } + + /** + * Output only. The number of attempts which have received a response. + * This field is not calculated for [pull + * tasks][google.cloud.tasks.v2beta2.PullMessage]. + * + * Generated from protobuf field int32 attempt_response_count = 2; + * @return int + */ + public function getAttemptResponseCount() + { + return $this->attempt_response_count; + } + + /** + * Output only. The number of attempts which have received a response. + * This field is not calculated for [pull + * tasks][google.cloud.tasks.v2beta2.PullMessage]. + * + * Generated from protobuf field int32 attempt_response_count = 2; + * @param int $var + * @return $this + */ + public function setAttemptResponseCount($var) + { + GPBUtil::checkInt32($var); + $this->attempt_response_count = $var; + + return $this; + } + + /** + * Output only. The status of the task's first attempt. + * Only + * [dispatch_time][google.cloud.tasks.v2beta2.AttemptStatus.dispatch_time] + * will be set. The other + * [AttemptStatus][google.cloud.tasks.v2beta2.AttemptStatus] information is + * not retained by Cloud Tasks. + * This field is not calculated for [pull + * tasks][google.cloud.tasks.v2beta2.PullMessage]. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.AttemptStatus first_attempt_status = 3; + * @return \Google\Cloud\Tasks\V2beta2\AttemptStatus|null + */ + public function getFirstAttemptStatus() + { + return $this->first_attempt_status; + } + + public function hasFirstAttemptStatus() + { + return isset($this->first_attempt_status); + } + + public function clearFirstAttemptStatus() + { + unset($this->first_attempt_status); + } + + /** + * Output only. The status of the task's first attempt. + * Only + * [dispatch_time][google.cloud.tasks.v2beta2.AttemptStatus.dispatch_time] + * will be set. The other + * [AttemptStatus][google.cloud.tasks.v2beta2.AttemptStatus] information is + * not retained by Cloud Tasks. + * This field is not calculated for [pull + * tasks][google.cloud.tasks.v2beta2.PullMessage]. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.AttemptStatus first_attempt_status = 3; + * @param \Google\Cloud\Tasks\V2beta2\AttemptStatus $var + * @return $this + */ + public function setFirstAttemptStatus($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\AttemptStatus::class); + $this->first_attempt_status = $var; + + return $this; + } + + /** + * Output only. The status of the task's last attempt. + * This field is not calculated for [pull + * tasks][google.cloud.tasks.v2beta2.PullMessage]. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.AttemptStatus last_attempt_status = 4; + * @return \Google\Cloud\Tasks\V2beta2\AttemptStatus|null + */ + public function getLastAttemptStatus() + { + return $this->last_attempt_status; + } + + public function hasLastAttemptStatus() + { + return isset($this->last_attempt_status); + } + + public function clearLastAttemptStatus() + { + unset($this->last_attempt_status); + } + + /** + * Output only. The status of the task's last attempt. + * This field is not calculated for [pull + * tasks][google.cloud.tasks.v2beta2.PullMessage]. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.AttemptStatus last_attempt_status = 4; + * @param \Google\Cloud\Tasks\V2beta2\AttemptStatus $var + * @return $this + */ + public function setLastAttemptStatus($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\AttemptStatus::class); + $this->last_attempt_status = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/UpdateQueueRequest.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/UpdateQueueRequest.php new file mode 100644 index 000000000000..c32717481e98 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/UpdateQueueRequest.php @@ -0,0 +1,150 @@ +google.cloud.tasks.v2beta2.UpdateQueueRequest + */ +class UpdateQueueRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The queue to create or update. + * The queue's [name][google.cloud.tasks.v2beta2.Queue.name] must be + * specified. + * Output only fields cannot be modified using UpdateQueue. + * Any value specified for an output only field will be ignored. + * The queue's [name][google.cloud.tasks.v2beta2.Queue.name] cannot be + * changed. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.Queue queue = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $queue = null; + /** + * A mask used to specify which fields of the queue are being updated. + * If empty, then all fields will be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Tasks\V2beta2\Queue $queue + * Required. The queue to create or update. + * The queue's [name][google.cloud.tasks.v2beta2.Queue.name] must be + * specified. + * Output only fields cannot be modified using UpdateQueue. + * Any value specified for an output only field will be ignored. + * The queue's [name][google.cloud.tasks.v2beta2.Queue.name] cannot be + * changed. + * @type \Google\Protobuf\FieldMask $update_mask + * A mask used to specify which fields of the queue are being updated. + * If empty, then all fields will be updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * Required. The queue to create or update. + * The queue's [name][google.cloud.tasks.v2beta2.Queue.name] must be + * specified. + * Output only fields cannot be modified using UpdateQueue. + * Any value specified for an output only field will be ignored. + * The queue's [name][google.cloud.tasks.v2beta2.Queue.name] cannot be + * changed. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.Queue queue = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Tasks\V2beta2\Queue|null + */ + public function getQueue() + { + return $this->queue; + } + + public function hasQueue() + { + return isset($this->queue); + } + + public function clearQueue() + { + unset($this->queue); + } + + /** + * Required. The queue to create or update. + * The queue's [name][google.cloud.tasks.v2beta2.Queue.name] must be + * specified. + * Output only fields cannot be modified using UpdateQueue. + * Any value specified for an output only field will be ignored. + * The queue's [name][google.cloud.tasks.v2beta2.Queue.name] cannot be + * changed. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.Queue queue = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Tasks\V2beta2\Queue $var + * @return $this + */ + public function setQueue($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\Queue::class); + $this->queue = $var; + + return $this; + } + + /** + * A mask used to specify which fields of the queue are being updated. + * If empty, then all fields will be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * A mask used to specify which fields of the queue are being updated. + * If empty, then all fields will be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/UploadQueueYamlRequest.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/UploadQueueYamlRequest.php new file mode 100644 index 000000000000..1d8bc2fa466d --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/UploadQueueYamlRequest.php @@ -0,0 +1,120 @@ +google.cloud.tasks.v2beta2.UploadQueueYamlRequest + */ +class UploadQueueYamlRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The App ID is supplied as an HTTP parameter. Unlike internal + * usage of App ID, it does not include a region prefix. Rather, the App ID + * represents the Project ID against which to make the request. + * + * Generated from protobuf field string app_id = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $app_id = ''; + /** + * The http body contains the queue.yaml file which used to update queue lists + * + * Generated from protobuf field optional .google.api.HttpBody http_body = 2; + */ + protected $http_body = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $app_id + * Required. The App ID is supplied as an HTTP parameter. Unlike internal + * usage of App ID, it does not include a region prefix. Rather, the App ID + * represents the Project ID against which to make the request. + * @type \Google\Api\HttpBody $http_body + * The http body contains the queue.yaml file which used to update queue lists + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * Required. The App ID is supplied as an HTTP parameter. Unlike internal + * usage of App ID, it does not include a region prefix. Rather, the App ID + * represents the Project ID against which to make the request. + * + * Generated from protobuf field string app_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getAppId() + { + return $this->app_id; + } + + /** + * Required. The App ID is supplied as an HTTP parameter. Unlike internal + * usage of App ID, it does not include a region prefix. Rather, the App ID + * represents the Project ID against which to make the request. + * + * Generated from protobuf field string app_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setAppId($var) + { + GPBUtil::checkString($var, True); + $this->app_id = $var; + + return $this; + } + + /** + * The http body contains the queue.yaml file which used to update queue lists + * + * Generated from protobuf field optional .google.api.HttpBody http_body = 2; + * @return \Google\Api\HttpBody|null + */ + public function getHttpBody() + { + return $this->http_body; + } + + public function hasHttpBody() + { + return isset($this->http_body); + } + + public function clearHttpBody() + { + unset($this->http_body); + } + + /** + * The http body contains the queue.yaml file which used to update queue lists + * + * Generated from protobuf field optional .google.api.HttpBody http_body = 2; + * @param \Google\Api\HttpBody $var + * @return $this + */ + public function setHttpBody($var) + { + GPBUtil::checkMessage($var, \Google\Api\HttpBody::class); + $this->http_body = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/UriOverride.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/UriOverride.php new file mode 100644 index 000000000000..7d21cb8e089e --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/UriOverride.php @@ -0,0 +1,353 @@ +google.cloud.tasks.v2beta2.UriOverride + */ +class UriOverride extends \Google\Protobuf\Internal\Message +{ + /** + * Scheme override. + * When specified, the task URI scheme is replaced by the provided value (HTTP + * or HTTPS). + * + * Generated from protobuf field optional .google.cloud.tasks.v2beta2.UriOverride.Scheme scheme = 1; + */ + protected $scheme = null; + /** + * Host override. + * When specified, replaces the host part of the task URL. For example, + * if the task URL is "https://www.google.com," and host value is set to + * "example.net", the overridden URI will be changed to "https://example.net." + * Host value cannot be an empty string (INVALID_ARGUMENT). + * + * Generated from protobuf field optional string host = 2; + */ + protected $host = null; + /** + * Port override. + * When specified, replaces the port part of the task URI. For instance, + * for a URI http://www.google.com/foo and port=123, the overridden URI + * becomes http://www.google.com:123/foo. Note that the port value must be a + * positive integer. Setting the port to 0 (Zero) clears the URI port. + * + * Generated from protobuf field optional int64 port = 3; + */ + protected $port = null; + /** + * URI path. + * When specified, replaces the existing path of the task URL. Setting the + * path value to an empty string clears the URI path segment. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.PathOverride path_override = 4; + */ + protected $path_override = null; + /** + * URI Query. + * When specified, replaces the query part of the task URI. Setting the + * query value to an empty string clears the URI query segment. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.QueryOverride query_override = 5; + */ + protected $query_override = null; + /** + * URI Override Enforce Mode + * When specified, determines the Target UriOverride mode. If not specified, + * it defaults to ALWAYS. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.UriOverride.UriOverrideEnforceMode uri_override_enforce_mode = 6; + */ + protected $uri_override_enforce_mode = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $scheme + * Scheme override. + * When specified, the task URI scheme is replaced by the provided value (HTTP + * or HTTPS). + * @type string $host + * Host override. + * When specified, replaces the host part of the task URL. For example, + * if the task URL is "https://www.google.com," and host value is set to + * "example.net", the overridden URI will be changed to "https://example.net." + * Host value cannot be an empty string (INVALID_ARGUMENT). + * @type int|string $port + * Port override. + * When specified, replaces the port part of the task URI. For instance, + * for a URI http://www.google.com/foo and port=123, the overridden URI + * becomes http://www.google.com:123/foo. Note that the port value must be a + * positive integer. Setting the port to 0 (Zero) clears the URI port. + * @type \Google\Cloud\Tasks\V2beta2\PathOverride $path_override + * URI path. + * When specified, replaces the existing path of the task URL. Setting the + * path value to an empty string clears the URI path segment. + * @type \Google\Cloud\Tasks\V2beta2\QueryOverride $query_override + * URI Query. + * When specified, replaces the query part of the task URI. Setting the + * query value to an empty string clears the URI query segment. + * @type int $uri_override_enforce_mode + * URI Override Enforce Mode + * When specified, determines the Target UriOverride mode. If not specified, + * it defaults to ALWAYS. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Target::initOnce(); + parent::__construct($data); + } + + /** + * Scheme override. + * When specified, the task URI scheme is replaced by the provided value (HTTP + * or HTTPS). + * + * Generated from protobuf field optional .google.cloud.tasks.v2beta2.UriOverride.Scheme scheme = 1; + * @return int + */ + public function getScheme() + { + return isset($this->scheme) ? $this->scheme : 0; + } + + public function hasScheme() + { + return isset($this->scheme); + } + + public function clearScheme() + { + unset($this->scheme); + } + + /** + * Scheme override. + * When specified, the task URI scheme is replaced by the provided value (HTTP + * or HTTPS). + * + * Generated from protobuf field optional .google.cloud.tasks.v2beta2.UriOverride.Scheme scheme = 1; + * @param int $var + * @return $this + */ + public function setScheme($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta2\UriOverride\Scheme::class); + $this->scheme = $var; + + return $this; + } + + /** + * Host override. + * When specified, replaces the host part of the task URL. For example, + * if the task URL is "https://www.google.com," and host value is set to + * "example.net", the overridden URI will be changed to "https://example.net." + * Host value cannot be an empty string (INVALID_ARGUMENT). + * + * Generated from protobuf field optional string host = 2; + * @return string + */ + public function getHost() + { + return isset($this->host) ? $this->host : ''; + } + + public function hasHost() + { + return isset($this->host); + } + + public function clearHost() + { + unset($this->host); + } + + /** + * Host override. + * When specified, replaces the host part of the task URL. For example, + * if the task URL is "https://www.google.com," and host value is set to + * "example.net", the overridden URI will be changed to "https://example.net." + * Host value cannot be an empty string (INVALID_ARGUMENT). + * + * Generated from protobuf field optional string host = 2; + * @param string $var + * @return $this + */ + public function setHost($var) + { + GPBUtil::checkString($var, True); + $this->host = $var; + + return $this; + } + + /** + * Port override. + * When specified, replaces the port part of the task URI. For instance, + * for a URI http://www.google.com/foo and port=123, the overridden URI + * becomes http://www.google.com:123/foo. Note that the port value must be a + * positive integer. Setting the port to 0 (Zero) clears the URI port. + * + * Generated from protobuf field optional int64 port = 3; + * @return int|string + */ + public function getPort() + { + return isset($this->port) ? $this->port : 0; + } + + public function hasPort() + { + return isset($this->port); + } + + public function clearPort() + { + unset($this->port); + } + + /** + * Port override. + * When specified, replaces the port part of the task URI. For instance, + * for a URI http://www.google.com/foo and port=123, the overridden URI + * becomes http://www.google.com:123/foo. Note that the port value must be a + * positive integer. Setting the port to 0 (Zero) clears the URI port. + * + * Generated from protobuf field optional int64 port = 3; + * @param int|string $var + * @return $this + */ + public function setPort($var) + { + GPBUtil::checkInt64($var); + $this->port = $var; + + return $this; + } + + /** + * URI path. + * When specified, replaces the existing path of the task URL. Setting the + * path value to an empty string clears the URI path segment. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.PathOverride path_override = 4; + * @return \Google\Cloud\Tasks\V2beta2\PathOverride|null + */ + public function getPathOverride() + { + return $this->path_override; + } + + public function hasPathOverride() + { + return isset($this->path_override); + } + + public function clearPathOverride() + { + unset($this->path_override); + } + + /** + * URI path. + * When specified, replaces the existing path of the task URL. Setting the + * path value to an empty string clears the URI path segment. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.PathOverride path_override = 4; + * @param \Google\Cloud\Tasks\V2beta2\PathOverride $var + * @return $this + */ + public function setPathOverride($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\PathOverride::class); + $this->path_override = $var; + + return $this; + } + + /** + * URI Query. + * When specified, replaces the query part of the task URI. Setting the + * query value to an empty string clears the URI query segment. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.QueryOverride query_override = 5; + * @return \Google\Cloud\Tasks\V2beta2\QueryOverride|null + */ + public function getQueryOverride() + { + return $this->query_override; + } + + public function hasQueryOverride() + { + return isset($this->query_override); + } + + public function clearQueryOverride() + { + unset($this->query_override); + } + + /** + * URI Query. + * When specified, replaces the query part of the task URI. Setting the + * query value to an empty string clears the URI query segment. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.QueryOverride query_override = 5; + * @param \Google\Cloud\Tasks\V2beta2\QueryOverride $var + * @return $this + */ + public function setQueryOverride($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\QueryOverride::class); + $this->query_override = $var; + + return $this; + } + + /** + * URI Override Enforce Mode + * When specified, determines the Target UriOverride mode. If not specified, + * it defaults to ALWAYS. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.UriOverride.UriOverrideEnforceMode uri_override_enforce_mode = 6; + * @return int + */ + public function getUriOverrideEnforceMode() + { + return $this->uri_override_enforce_mode; + } + + /** + * URI Override Enforce Mode + * When specified, determines the Target UriOverride mode. If not specified, + * it defaults to ALWAYS. + * + * Generated from protobuf field .google.cloud.tasks.v2beta2.UriOverride.UriOverrideEnforceMode uri_override_enforce_mode = 6; + * @param int $var + * @return $this + */ + public function setUriOverrideEnforceMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta2\UriOverride\UriOverrideEnforceMode::class); + $this->uri_override_enforce_mode = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/UriOverride/Scheme.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/UriOverride/Scheme.php new file mode 100644 index 000000000000..d27231a2038d --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/UriOverride/Scheme.php @@ -0,0 +1,66 @@ +google.cloud.tasks.v2beta2.UriOverride.Scheme + */ +class Scheme +{ + /** + * Scheme unspecified. Defaults to HTTPS. + * + * Generated from protobuf enum SCHEME_UNSPECIFIED = 0; + */ + const SCHEME_UNSPECIFIED = 0; + /** + * Convert the scheme to HTTP, e.g., https://www.google.ca will change to + * http://www.google.ca. + * + * Generated from protobuf enum HTTP = 1; + */ + const HTTP = 1; + /** + * Convert the scheme to HTTPS, e.g., http://www.google.ca will change to + * https://www.google.ca. + * + * Generated from protobuf enum HTTPS = 2; + */ + const HTTPS = 2; + + private static $valueToName = [ + self::SCHEME_UNSPECIFIED => 'SCHEME_UNSPECIFIED', + self::HTTP => 'HTTP', + self::HTTPS => 'HTTPS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Scheme::class, \Google\Cloud\Tasks\V2beta2\UriOverride_Scheme::class); + diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/UriOverride/UriOverrideEnforceMode.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/UriOverride/UriOverrideEnforceMode.php new file mode 100644 index 000000000000..16736bffe052 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/UriOverride/UriOverrideEnforceMode.php @@ -0,0 +1,67 @@ +google.cloud.tasks.v2beta2.UriOverride.UriOverrideEnforceMode + */ +class UriOverrideEnforceMode +{ + /** + * OverrideMode Unspecified. Defaults to ALWAYS. + * + * Generated from protobuf enum URI_OVERRIDE_ENFORCE_MODE_UNSPECIFIED = 0; + */ + const URI_OVERRIDE_ENFORCE_MODE_UNSPECIFIED = 0; + /** + * In the IF_NOT_EXISTS mode, queue-level configuration is only + * applied where task-level configuration does not exist. + * + * Generated from protobuf enum IF_NOT_EXISTS = 1; + */ + const IF_NOT_EXISTS = 1; + /** + * In the ALWAYS mode, queue-level configuration overrides all + * task-level configuration + * + * Generated from protobuf enum ALWAYS = 2; + */ + const ALWAYS = 2; + + private static $valueToName = [ + self::URI_OVERRIDE_ENFORCE_MODE_UNSPECIFIED => 'URI_OVERRIDE_ENFORCE_MODE_UNSPECIFIED', + self::IF_NOT_EXISTS => 'IF_NOT_EXISTS', + self::ALWAYS => 'ALWAYS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(UriOverrideEnforceMode::class, \Google\Cloud\Tasks\V2beta2\UriOverride_UriOverrideEnforceMode::class); + diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/acknowledge_task.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/acknowledge_task.php new file mode 100644 index 000000000000..dfa44bea000a --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/acknowledge_task.php @@ -0,0 +1,82 @@ +acknowledgeTask($formattedName, $scheduleTime); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudTasksClient::taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + + acknowledge_task_sample($formattedName); +} +// [END cloudtasks_v2beta2_generated_CloudTasks_AcknowledgeTask_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/cancel_lease.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/cancel_lease.php new file mode 100644 index 000000000000..fa0956fddef3 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/cancel_lease.php @@ -0,0 +1,76 @@ +cancelLease($formattedName, $scheduleTime); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudTasksClient::taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + + cancel_lease_sample($formattedName); +} +// [END cloudtasks_v2beta2_generated_CloudTasks_CancelLease_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/create_queue.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/create_queue.php new file mode 100644 index 000000000000..b427abdbd306 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/create_queue.php @@ -0,0 +1,85 @@ +createQueue($formattedParent, $queue); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = CloudTasksClient::locationName('[PROJECT]', '[LOCATION]'); + + create_queue_sample($formattedParent); +} +// [END cloudtasks_v2beta2_generated_CloudTasks_CreateQueue_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/create_task.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/create_task.php new file mode 100644 index 000000000000..e5e238114b44 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/create_task.php @@ -0,0 +1,80 @@ +createTask($formattedParent, $task); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = CloudTasksClient::queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + + create_task_sample($formattedParent); +} +// [END cloudtasks_v2beta2_generated_CloudTasks_CreateTask_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/delete_queue.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/delete_queue.php new file mode 100644 index 000000000000..84fb02ab903b --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/delete_queue.php @@ -0,0 +1,77 @@ +deleteQueue($formattedName); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudTasksClient::queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + + delete_queue_sample($formattedName); +} +// [END cloudtasks_v2beta2_generated_CloudTasks_DeleteQueue_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/delete_task.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/delete_task.php new file mode 100644 index 000000000000..06124f19250e --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/delete_task.php @@ -0,0 +1,69 @@ +deleteTask($formattedName); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudTasksClient::taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + + delete_task_sample($formattedName); +} +// [END cloudtasks_v2beta2_generated_CloudTasks_DeleteTask_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/get_iam_policy.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/get_iam_policy.php new file mode 100644 index 000000000000..1e41025e96ff --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/get_iam_policy.php @@ -0,0 +1,74 @@ +getIamPolicy($resource); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + get_iam_policy_sample($resource); +} +// [END cloudtasks_v2beta2_generated_CloudTasks_GetIamPolicy_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/get_location.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/get_location.php new file mode 100644 index 000000000000..4aaddcc22a3d --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/get_location.php @@ -0,0 +1,53 @@ +getLocation(); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END cloudtasks_v2beta2_generated_CloudTasks_GetLocation_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/get_queue.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/get_queue.php new file mode 100644 index 000000000000..5fb478085e54 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/get_queue.php @@ -0,0 +1,67 @@ +getQueue($formattedName); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudTasksClient::queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + + get_queue_sample($formattedName); +} +// [END cloudtasks_v2beta2_generated_CloudTasks_GetQueue_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/get_task.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/get_task.php new file mode 100644 index 000000000000..780914b39107 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/get_task.php @@ -0,0 +1,67 @@ +getTask($formattedName); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudTasksClient::taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + + get_task_sample($formattedName); +} +// [END cloudtasks_v2beta2_generated_CloudTasks_GetTask_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/lease_tasks.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/lease_tasks.php new file mode 100644 index 000000000000..ff53bf1ceb01 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/lease_tasks.php @@ -0,0 +1,93 @@ +leaseTasks($formattedParent, $leaseDuration); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = CloudTasksClient::queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + + lease_tasks_sample($formattedParent); +} +// [END cloudtasks_v2beta2_generated_CloudTasks_LeaseTasks_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/list_locations.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/list_locations.php new file mode 100644 index 000000000000..4b8b6f73d3fe --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/list_locations.php @@ -0,0 +1,58 @@ +listLocations(); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END cloudtasks_v2beta2_generated_CloudTasks_ListLocations_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/list_queues.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/list_queues.php new file mode 100644 index 000000000000..e0d3bf4d4cff --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/list_queues.php @@ -0,0 +1,74 @@ +listQueues($formattedParent); + + /** @var Queue $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = CloudTasksClient::locationName('[PROJECT]', '[LOCATION]'); + + list_queues_sample($formattedParent); +} +// [END cloudtasks_v2beta2_generated_CloudTasks_ListQueues_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/list_tasks.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/list_tasks.php new file mode 100644 index 000000000000..47ab73268ce6 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/list_tasks.php @@ -0,0 +1,80 @@ +listTasks($formattedParent); + + /** @var Task $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = CloudTasksClient::queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + + list_tasks_sample($formattedParent); +} +// [END cloudtasks_v2beta2_generated_CloudTasks_ListTasks_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/pause_queue.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/pause_queue.php new file mode 100644 index 000000000000..dd98a7e55fc3 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/pause_queue.php @@ -0,0 +1,74 @@ +pauseQueue($formattedName); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudTasksClient::queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + + pause_queue_sample($formattedName); +} +// [END cloudtasks_v2beta2_generated_CloudTasks_PauseQueue_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/purge_queue.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/purge_queue.php new file mode 100644 index 000000000000..3a1827680371 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/purge_queue.php @@ -0,0 +1,72 @@ +purgeQueue($formattedName); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudTasksClient::queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + + purge_queue_sample($formattedName); +} +// [END cloudtasks_v2beta2_generated_CloudTasks_PurgeQueue_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/renew_lease.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/renew_lease.php new file mode 100644 index 000000000000..59ff5f7d8ba2 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/renew_lease.php @@ -0,0 +1,78 @@ +renewLease($formattedName, $scheduleTime, $leaseDuration); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudTasksClient::taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + + renew_lease_sample($formattedName); +} +// [END cloudtasks_v2beta2_generated_CloudTasks_RenewLease_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/resume_queue.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/resume_queue.php new file mode 100644 index 000000000000..d787c841efa8 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/resume_queue.php @@ -0,0 +1,81 @@ +resumeQueue($formattedName); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudTasksClient::queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + + resume_queue_sample($formattedName); +} +// [END cloudtasks_v2beta2_generated_CloudTasks_ResumeQueue_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/run_task.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/run_task.php new file mode 100644 index 000000000000..10dddc23c693 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/run_task.php @@ -0,0 +1,96 @@ +runTask($formattedName); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudTasksClient::taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + + run_task_sample($formattedName); +} +// [END cloudtasks_v2beta2_generated_CloudTasks_RunTask_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/set_iam_policy.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/set_iam_policy.php new file mode 100644 index 000000000000..cb9b2123bea6 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/set_iam_policy.php @@ -0,0 +1,79 @@ +setIamPolicy($resource, $policy); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + set_iam_policy_sample($resource); +} +// [END cloudtasks_v2beta2_generated_CloudTasks_SetIamPolicy_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/test_iam_permissions.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/test_iam_permissions.php new file mode 100644 index 000000000000..a5e276e15c38 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/test_iam_permissions.php @@ -0,0 +1,81 @@ +testIamPermissions($resource, $permissions); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + $permissionsElement = '[PERMISSIONS]'; + + test_iam_permissions_sample($resource, $permissionsElement); +} +// [END cloudtasks_v2beta2_generated_CloudTasks_TestIamPermissions_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/update_queue.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/update_queue.php new file mode 100644 index 000000000000..4e20bc98ab2c --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/update_queue.php @@ -0,0 +1,70 @@ +updateQueue($queue); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END cloudtasks_v2beta2_generated_CloudTasks_UpdateQueue_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/upload_queue_yaml.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/upload_queue_yaml.php new file mode 100644 index 000000000000..270900884e50 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/upload_queue_yaml.php @@ -0,0 +1,69 @@ +uploadQueueYaml($appId); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $appId = '[APP_ID]'; + + upload_queue_yaml_sample($appId); +} +// [END cloudtasks_v2beta2_generated_CloudTasks_UploadQueueYaml_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/src/V2beta2/CloudTasksClient.php b/owl-bot-staging/Tasks/v2beta2/src/V2beta2/CloudTasksClient.php new file mode 100644 index 000000000000..f2e76ac1bacc --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/src/V2beta2/CloudTasksClient.php @@ -0,0 +1,36 @@ +taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + * $scheduleTime = new Timestamp(); + * $cloudTasksClient->acknowledgeTask($formattedName, $scheduleTime); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + * + * @experimental + * + * @deprecated This class will be removed in the next major version update. + */ +class CloudTasksGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.tasks.v2beta2.CloudTasks'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'cloudtasks.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'cloudtasks.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static $locationNameTemplate; + + private static $queueNameTemplate; + + private static $taskNameTemplate; + + private static $pathTemplateMap; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/cloud_tasks_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/cloud_tasks_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/cloud_tasks_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/cloud_tasks_rest_client_config.php', + ], + ], + ]; + } + + private static function getLocationNameTemplate() + { + if (self::$locationNameTemplate == null) { + self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); + } + + return self::$locationNameTemplate; + } + + private static function getQueueNameTemplate() + { + if (self::$queueNameTemplate == null) { + self::$queueNameTemplate = new PathTemplate('projects/{project}/locations/{location}/queues/{queue}'); + } + + return self::$queueNameTemplate; + } + + private static function getTaskNameTemplate() + { + if (self::$taskNameTemplate == null) { + self::$taskNameTemplate = new PathTemplate('projects/{project}/locations/{location}/queues/{queue}/tasks/{task}'); + } + + return self::$taskNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'location' => self::getLocationNameTemplate(), + 'queue' => self::getQueueNameTemplate(), + 'task' => self::getTaskNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + * + * @experimental + */ + public static function locationName($project, $location) + { + return self::getLocationNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a queue + * resource. + * + * @param string $project + * @param string $location + * @param string $queue + * + * @return string The formatted queue resource. + * + * @experimental + */ + public static function queueName($project, $location, $queue) + { + return self::getQueueNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'queue' => $queue, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a task + * resource. + * + * @param string $project + * @param string $location + * @param string $queue + * @param string $task + * + * @return string The formatted task resource. + * + * @experimental + */ + public static function taskName($project, $location, $queue, $task) + { + return self::getTaskNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'queue' => $queue, + 'task' => $task, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - location: projects/{project}/locations/{location} + * - queue: projects/{project}/locations/{location}/queues/{queue} + * - task: projects/{project}/locations/{location}/queues/{queue}/tasks/{task} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + * + * @experimental + */ + public static function parseName($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'cloudtasks.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** + * Acknowledges a pull task. + * + * The worker, that is, the entity that + * [leased][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] this task must + * call this method to indicate that the work associated with the task has + * finished. + * + * The worker must acknowledge a task within the + * [lease_duration][google.cloud.tasks.v2beta2.LeaseTasksRequest.lease_duration] + * or the lease will expire and the task will become available to be leased + * again. After the task is acknowledged, it will not be returned + * by a later [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks], + * [GetTask][google.cloud.tasks.v2beta2.CloudTasks.GetTask], or + * [ListTasks][google.cloud.tasks.v2beta2.CloudTasks.ListTasks]. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $formattedName = $cloudTasksClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + * $scheduleTime = new Timestamp(); + * $cloudTasksClient->acknowledgeTask($formattedName, $scheduleTime); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $name Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * @param Timestamp $scheduleTime Required. The task's current schedule time, available in the + * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] returned by + * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] response or + * [RenewLease][google.cloud.tasks.v2beta2.CloudTasks.RenewLease] response. + * This restriction is to ensure that your worker currently holds the lease. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function acknowledgeTask($name, $scheduleTime, array $optionalArgs = []) + { + $request = new AcknowledgeTaskRequest(); + $requestParamHeaders = []; + $request->setName($name); + $request->setScheduleTime($scheduleTime); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('AcknowledgeTask', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Cancel a pull task's lease. + * + * The worker can use this method to cancel a task's lease by + * setting its [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] + * to now. This will make the task available to be leased to the next caller + * of [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks]. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $formattedName = $cloudTasksClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + * $scheduleTime = new Timestamp(); + * $response = $cloudTasksClient->cancelLease($formattedName, $scheduleTime); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $name Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * @param Timestamp $scheduleTime Required. The task's current schedule time, available in the + * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] returned by + * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] response or + * [RenewLease][google.cloud.tasks.v2beta2.CloudTasks.RenewLease] response. + * This restriction is to ensure that your worker currently holds the lease. + * @param array $optionalArgs { + * Optional. + * + * @type int $responseView + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta2.Task] will be returned. + * + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * + * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta2.Task] resource. + * For allowed values, use constants defined on {@see \Google\Cloud\Tasks\V2beta2\Task\View} + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Tasks\V2beta2\Task + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function cancelLease($name, $scheduleTime, array $optionalArgs = []) + { + $request = new CancelLeaseRequest(); + $requestParamHeaders = []; + $request->setName($name); + $request->setScheduleTime($scheduleTime); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['responseView'])) { + $request->setResponseView($optionalArgs['responseView']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CancelLease', Task::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a queue. + * + * Queues created with this method allow tasks to live for a maximum of 31 + * days. After a task is 31 days old, the task will be deleted regardless of + * whether it was dispatched or not. + * + * WARNING: Using this method may have unintended side effects if you are + * using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + * Read + * [Overview of Queue Management and + * queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using + * this method. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $formattedParent = $cloudTasksClient->locationName('[PROJECT]', '[LOCATION]'); + * $queue = new Queue(); + * $response = $cloudTasksClient->createQueue($formattedParent, $queue); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $parent Required. The location name in which the queue will be created. + * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * + * The list of allowed locations can be obtained by calling Cloud + * Tasks' implementation of + * [ListLocations][google.cloud.location.Locations.ListLocations]. + * @param Queue $queue Required. The queue to create. + * + * [Queue's name][google.cloud.tasks.v2beta2.Queue.name] cannot be the same as + * an existing queue. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Tasks\V2beta2\Queue + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function createQueue($parent, $queue, array $optionalArgs = []) + { + $request = new CreateQueueRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setQueue($queue); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateQueue', Queue::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a task and adds it to a queue. + * + * Tasks cannot be updated after creation; there is no UpdateTask command. + * + * * For [App Engine queues][google.cloud.tasks.v2beta2.AppEngineHttpTarget], + * the maximum task size is + * 100KB. + * * For [pull queues][google.cloud.tasks.v2beta2.PullTarget], the maximum + * task size is 1MB. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $formattedParent = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * $task = new Task(); + * $response = $cloudTasksClient->createTask($formattedParent, $task); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $parent Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * + * The queue must already exist. + * @param Task $task Required. The task to add. + * + * Task names have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. + * The user can optionally specify a task + * [name][google.cloud.tasks.v2beta2.Task.name]. If a name is not specified + * then the system will generate a random unique task id, which will be set in + * the task returned in the [response][google.cloud.tasks.v2beta2.Task.name]. + * + * If [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] is not + * set or is in the past then Cloud Tasks will set it to the current time. + * + * Task De-duplication: + * + * Explicitly specifying a task ID enables task de-duplication. If + * a task's ID is identical to that of an existing task or a task + * that was deleted or completed recently then the call will fail + * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. + * If the task's queue was created using Cloud Tasks, then another task with + * the same name can't be created for ~1 hour after the original task was + * deleted or completed. If the task's queue was created using queue.yaml or + * queue.xml, then another task with the same name can't be created + * for ~9 days after the original task was deleted or completed. + * + * Because there is an extra lookup cost to identify duplicate task + * names, these [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] + * calls have significantly increased latency. Using hashed strings for the + * task id or for the prefix of the task id is recommended. Choosing task ids + * that are sequential or have sequential prefixes, for example using a + * timestamp, causes an increase in latency and error rates in all + * task commands. The infrastructure relies on an approximately + * uniform distribution of task ids to store and serve tasks + * efficiently. + * @param array $optionalArgs { + * Optional. + * + * @type int $responseView + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta2.Task] will be returned. + * + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * + * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta2.Task] resource. + * For allowed values, use constants defined on {@see \Google\Cloud\Tasks\V2beta2\Task\View} + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Tasks\V2beta2\Task + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function createTask($parent, $task, array $optionalArgs = []) + { + $request = new CreateTaskRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setTask($task); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['responseView'])) { + $request->setResponseView($optionalArgs['responseView']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateTask', Task::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes a queue. + * + * This command will delete the queue even if it has tasks in it. + * + * Note: If you delete a queue, a queue with the same name can't be created + * for 7 days. + * + * WARNING: Using this method may have unintended side effects if you are + * using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + * Read + * [Overview of Queue Management and + * queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using + * this method. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * $cloudTasksClient->deleteQueue($formattedName); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $name Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function deleteQueue($name, array $optionalArgs = []) + { + $request = new DeleteQueueRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteQueue', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes a task. + * + * A task can be deleted if it is scheduled or dispatched. A task + * cannot be deleted if it has completed successfully or permanently + * failed. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $formattedName = $cloudTasksClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + * $cloudTasksClient->deleteTask($formattedName); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $name Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function deleteTask($name, array $optionalArgs = []) + { + $request = new DeleteTaskRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteTask', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the access control policy for a + * [Queue][google.cloud.tasks.v2beta2.Queue]. Returns an empty policy if the + * resource exists and does not have a policy set. + * + * Authorization requires the following + * [Google IAM](https://cloud.google.com/iam) permission on the specified + * resource parent: + * + * * `cloudtasks.queues.getIamPolicy` + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $resource = 'resource'; + * $response = $cloudTasksClient->getIamPolicy($resource); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $resource REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param array $optionalArgs { + * Optional. + * + * @type GetPolicyOptions $options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\Policy + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function getIamPolicy($resource, array $optionalArgs = []) + { + $request = new GetIamPolicyRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['options'])) { + $request->setOptions($optionalArgs['options']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets a queue. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * $response = $cloudTasksClient->getQueue($formattedName); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $name Required. The resource name of the queue. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $readMask + * Optional. Read mask is used for a more granular control over what the API + * returns. If the mask is not present all fields will be returned except + * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly + * specified in the mask. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Tasks\V2beta2\Queue + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function getQueue($name, array $optionalArgs = []) + { + $request = new GetQueueRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['readMask'])) { + $request->setReadMask($optionalArgs['readMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetQueue', Queue::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets a task. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $formattedName = $cloudTasksClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + * $response = $cloudTasksClient->getTask($formattedName); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $name Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * @param array $optionalArgs { + * Optional. + * + * @type int $responseView + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta2.Task] will be returned. + * + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * + * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta2.Task] resource. + * For allowed values, use constants defined on {@see \Google\Cloud\Tasks\V2beta2\Task\View} + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Tasks\V2beta2\Task + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function getTask($name, array $optionalArgs = []) + { + $request = new GetTaskRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['responseView'])) { + $request->setResponseView($optionalArgs['responseView']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetTask', Task::class, $optionalArgs, $request)->wait(); + } + + /** + * Leases tasks from a pull queue for + * [lease_duration][google.cloud.tasks.v2beta2.LeaseTasksRequest.lease_duration]. + * + * This method is invoked by the worker to obtain a lease. The + * worker must acknowledge the task via + * [AcknowledgeTask][google.cloud.tasks.v2beta2.CloudTasks.AcknowledgeTask] + * after they have performed the work associated with the task. + * + * The [payload][google.cloud.tasks.v2beta2.PullMessage.payload] is intended + * to store data that the worker needs to perform the work associated with the + * task. To return the payloads in the + * [response][google.cloud.tasks.v2beta2.LeaseTasksResponse], set + * [response_view][google.cloud.tasks.v2beta2.LeaseTasksRequest.response_view] + * to [FULL][google.cloud.tasks.v2beta2.Task.View.FULL]. + * + * A maximum of 10 qps of + * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] requests are + * allowed per queue. [RESOURCE_EXHAUSTED][google.rpc.Code.RESOURCE_EXHAUSTED] + * is returned when this limit is + * exceeded. [RESOURCE_EXHAUSTED][google.rpc.Code.RESOURCE_EXHAUSTED] + * is also returned when + * [max_tasks_dispatched_per_second][google.cloud.tasks.v2beta2.RateLimits.max_tasks_dispatched_per_second] + * is exceeded. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $formattedParent = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * $leaseDuration = new Duration(); + * $response = $cloudTasksClient->leaseTasks($formattedParent, $leaseDuration); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $parent Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * @param Duration $leaseDuration Required. The duration of the lease. + * + * Each task returned in the + * [response][google.cloud.tasks.v2beta2.LeaseTasksResponse] will have its + * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] set to the + * current time plus the `lease_duration`. The task is leased until its + * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]; thus, the + * task will not be returned to another + * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] call before + * its [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]. + * + * + * After the worker has successfully finished the work associated + * with the task, the worker must call via + * [AcknowledgeTask][google.cloud.tasks.v2beta2.CloudTasks.AcknowledgeTask] + * before the [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]. + * Otherwise the task will be returned to a later + * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] call so that + * another worker can retry it. + * + * The maximum lease duration is 1 week. + * `lease_duration` will be truncated to the nearest second. + * @param array $optionalArgs { + * Optional. + * + * @type int $maxTasks + * The maximum number of tasks to lease. + * + * The system will make a best effort to return as close to as + * `max_tasks` as possible. + * + * The largest that `max_tasks` can be is 1000. + * + * The maximum total size of a [lease tasks + * response][google.cloud.tasks.v2beta2.LeaseTasksResponse] is 32 MB. If the + * sum of all task sizes requested reaches this limit, fewer tasks than + * requested are returned. + * @type int $responseView + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta2.Task] will be returned. + * + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * + * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta2.Task] resource. + * For allowed values, use constants defined on {@see \Google\Cloud\Tasks\V2beta2\Task\View} + * @type string $filter + * `filter` can be used to specify a subset of tasks to lease. + * + * When `filter` is set to `tag=` then the + * [response][google.cloud.tasks.v2beta2.LeaseTasksResponse] will contain only + * tasks whose [tag][google.cloud.tasks.v2beta2.PullMessage.tag] is equal to + * ``. `` must be less than 500 characters. + * + * When `filter` is set to `tag_function=oldest_tag()`, only tasks which have + * the same tag as the task with the oldest + * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] will be + * returned. + * + * Grammar Syntax: + * + * * `filter = "tag=" tag | "tag_function=" function` + * + * * `tag = string` + * + * * `function = "oldest_tag()"` + * + * The `oldest_tag()` function returns tasks which have the same tag as the + * oldest task (ordered by schedule time). + * + * SDK compatibility: Although the SDK allows tags to be either + * string or + * [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), + * only UTF-8 encoded tags can be used in Cloud Tasks. Tag which + * aren't UTF-8 encoded can't be used in the + * [filter][google.cloud.tasks.v2beta2.LeaseTasksRequest.filter] and the + * task's [tag][google.cloud.tasks.v2beta2.PullMessage.tag] will be displayed + * as empty in Cloud Tasks. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Tasks\V2beta2\LeaseTasksResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function leaseTasks($parent, $leaseDuration, array $optionalArgs = []) + { + $request = new LeaseTasksRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setLeaseDuration($leaseDuration); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['maxTasks'])) { + $request->setMaxTasks($optionalArgs['maxTasks']); + } + + if (isset($optionalArgs['responseView'])) { + $request->setResponseView($optionalArgs['responseView']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('LeaseTasks', LeaseTasksResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Lists queues. + * + * Queues are returned in lexicographical order. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $formattedParent = $cloudTasksClient->locationName('[PROJECT]', '[LOCATION]'); + * // Iterate over pages of elements + * $pagedResponse = $cloudTasksClient->listQueues($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $cloudTasksClient->listQueues($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $parent Required. The location name. + * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * @param array $optionalArgs { + * Optional. + * + * @type string $filter + * `filter` can be used to specify a subset of queues. Any + * [Queue][google.cloud.tasks.v2beta2.Queue] field can be used as a filter and + * several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The + * filter syntax is the same as described in [Stackdriver's Advanced Logs + * Filters](https://cloud.google.com/logging/docs/view/advanced_filters). + * + * Sample filter "app_engine_http_target: *". + * + * Note that using filters might cause fewer queues than the + * requested_page size to be returned. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type FieldMask $readMask + * Optional. Read mask is used for a more granular control over what the API + * returns. If the mask is not present all fields will be returned except + * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly + * specified in the mask. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function listQueues($parent, array $optionalArgs = []) + { + $request = new ListQueuesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['readMask'])) { + $request->setReadMask($optionalArgs['readMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListQueues', $optionalArgs, ListQueuesResponse::class, $request); + } + + /** + * Lists the tasks in a queue. + * + * By default, only the [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC] + * view is retrieved due to performance considerations; + * [response_view][google.cloud.tasks.v2beta2.ListTasksRequest.response_view] + * controls the subset of information which is returned. + * + * The tasks may be returned in any order. The ordering may change at any + * time. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $formattedParent = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * // Iterate over pages of elements + * $pagedResponse = $cloudTasksClient->listTasks($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $cloudTasksClient->listTasks($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $parent Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * @param array $optionalArgs { + * Optional. + * + * @type int $responseView + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta2.Task] will be returned. + * + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * + * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta2.Task] resource. + * For allowed values, use constants defined on {@see \Google\Cloud\Tasks\V2beta2\Task\View} + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function listTasks($parent, array $optionalArgs = []) + { + $request = new ListTasksRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['responseView'])) { + $request->setResponseView($optionalArgs['responseView']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListTasks', $optionalArgs, ListTasksResponse::class, $request); + } + + /** + * Pauses the queue. + * + * If a queue is paused then the system will stop dispatching tasks + * until the queue is resumed via + * [ResumeQueue][google.cloud.tasks.v2beta2.CloudTasks.ResumeQueue]. Tasks can + * still be added when the queue is paused. A queue is paused if its + * [state][google.cloud.tasks.v2beta2.Queue.state] is + * [PAUSED][google.cloud.tasks.v2beta2.Queue.State.PAUSED]. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * $response = $cloudTasksClient->pauseQueue($formattedName); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $name Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Tasks\V2beta2\Queue + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function pauseQueue($name, array $optionalArgs = []) + { + $request = new PauseQueueRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('PauseQueue', Queue::class, $optionalArgs, $request)->wait(); + } + + /** + * Purges a queue by deleting all of its tasks. + * + * All tasks created before this method is called are permanently deleted. + * + * Purge operations can take up to one minute to take effect. Tasks + * might be dispatched before the purge takes effect. A purge is irreversible. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * $response = $cloudTasksClient->purgeQueue($formattedName); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $name Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Tasks\V2beta2\Queue + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function purgeQueue($name, array $optionalArgs = []) + { + $request = new PurgeQueueRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('PurgeQueue', Queue::class, $optionalArgs, $request)->wait(); + } + + /** + * Renew the current lease of a pull task. + * + * The worker can use this method to extend the lease by a new + * duration, starting from now. The new task lease will be + * returned in the task's + * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $formattedName = $cloudTasksClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + * $scheduleTime = new Timestamp(); + * $leaseDuration = new Duration(); + * $response = $cloudTasksClient->renewLease($formattedName, $scheduleTime, $leaseDuration); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $name Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * @param Timestamp $scheduleTime Required. The task's current schedule time, available in the + * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] returned by + * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] response or + * [RenewLease][google.cloud.tasks.v2beta2.CloudTasks.RenewLease] response. + * This restriction is to ensure that your worker currently holds the lease. + * @param Duration $leaseDuration Required. The desired new lease duration, starting from now. + * + * + * The maximum lease duration is 1 week. + * `lease_duration` will be truncated to the nearest second. + * @param array $optionalArgs { + * Optional. + * + * @type int $responseView + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta2.Task] will be returned. + * + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * + * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta2.Task] resource. + * For allowed values, use constants defined on {@see \Google\Cloud\Tasks\V2beta2\Task\View} + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Tasks\V2beta2\Task + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function renewLease($name, $scheduleTime, $leaseDuration, array $optionalArgs = []) + { + $request = new RenewLeaseRequest(); + $requestParamHeaders = []; + $request->setName($name); + $request->setScheduleTime($scheduleTime); + $request->setLeaseDuration($leaseDuration); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['responseView'])) { + $request->setResponseView($optionalArgs['responseView']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('RenewLease', Task::class, $optionalArgs, $request)->wait(); + } + + /** + * Resume a queue. + * + * This method resumes a queue after it has been + * [PAUSED][google.cloud.tasks.v2beta2.Queue.State.PAUSED] or + * [DISABLED][google.cloud.tasks.v2beta2.Queue.State.DISABLED]. The state of a + * queue is stored in the queue's + * [state][google.cloud.tasks.v2beta2.Queue.state]; after calling this method + * it will be set to + * [RUNNING][google.cloud.tasks.v2beta2.Queue.State.RUNNING]. + * + * WARNING: Resuming many high-QPS queues at the same time can + * lead to target overloading. If you are resuming high-QPS + * queues, follow the 500/50/5 pattern described in + * [Managing Cloud Tasks Scaling + * Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling). + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * $response = $cloudTasksClient->resumeQueue($formattedName); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $name Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Tasks\V2beta2\Queue + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function resumeQueue($name, array $optionalArgs = []) + { + $request = new ResumeQueueRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('ResumeQueue', Queue::class, $optionalArgs, $request)->wait(); + } + + /** + * Forces a task to run now. + * + * When this method is called, Cloud Tasks will dispatch the task, even if + * the task is already running, the queue has reached its + * [RateLimits][google.cloud.tasks.v2beta2.RateLimits] or is + * [PAUSED][google.cloud.tasks.v2beta2.Queue.State.PAUSED]. + * + * This command is meant to be used for manual debugging. For + * example, [RunTask][google.cloud.tasks.v2beta2.CloudTasks.RunTask] can be + * used to retry a failed task after a fix has been made or to manually force + * a task to be dispatched now. + * + * The dispatched task is returned. That is, the task that is returned + * contains the [status][google.cloud.tasks.v2beta2.Task.status] after the + * task is dispatched but before the task is received by its target. + * + * If Cloud Tasks receives a successful response from the task's + * target, then the task will be deleted; otherwise the task's + * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] will be + * reset to the time that + * [RunTask][google.cloud.tasks.v2beta2.CloudTasks.RunTask] was called plus + * the retry delay specified in the queue's + * [RetryConfig][google.cloud.tasks.v2beta2.RetryConfig]. + * + * [RunTask][google.cloud.tasks.v2beta2.CloudTasks.RunTask] returns + * [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a + * task that has already succeeded or permanently failed. + * + * [RunTask][google.cloud.tasks.v2beta2.CloudTasks.RunTask] cannot be called + * on a [pull task][google.cloud.tasks.v2beta2.PullMessage]. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $formattedName = $cloudTasksClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + * $response = $cloudTasksClient->runTask($formattedName); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $name Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * @param array $optionalArgs { + * Optional. + * + * @type int $responseView + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta2.Task] will be returned. + * + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * + * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta2.Task] resource. + * For allowed values, use constants defined on {@see \Google\Cloud\Tasks\V2beta2\Task\View} + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Tasks\V2beta2\Task + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function runTask($name, array $optionalArgs = []) + { + $request = new RunTaskRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['responseView'])) { + $request->setResponseView($optionalArgs['responseView']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('RunTask', Task::class, $optionalArgs, $request)->wait(); + } + + /** + * Sets the access control policy for a + * [Queue][google.cloud.tasks.v2beta2.Queue]. Replaces any existing policy. + * + * Note: The Cloud Console does not check queue-level IAM permissions yet. + * Project-level permissions are required to use the Cloud Console. + * + * Authorization requires the following + * [Google IAM](https://cloud.google.com/iam) permission on the specified + * resource parent: + * + * * `cloudtasks.queues.setIamPolicy` + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $resource = 'resource'; + * $policy = new Policy(); + * $response = $cloudTasksClient->setIamPolicy($resource, $policy); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $resource REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * + * `paths: "bindings, etag"` + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\Policy + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function setIamPolicy($resource, $policy, array $optionalArgs = []) + { + $request = new SetIamPolicyRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $request->setPolicy($policy); + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns permissions that a caller has on a + * [Queue][google.cloud.tasks.v2beta2.Queue]. If the resource does not exist, + * this will return an empty set of permissions, not a + * [NOT_FOUND][google.rpc.Code.NOT_FOUND] error. + * + * Note: This operation is designed to be used for building permission-aware + * UIs and command-line tools, not for authorization checking. This operation + * may "fail open" without warning. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $resource = 'resource'; + * $permissions = []; + * $response = $cloudTasksClient->testIamPermissions($resource, $permissions); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $resource REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function testIamPermissions($resource, $permissions, array $optionalArgs = []) + { + $request = new TestIamPermissionsRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $request->setPermissions($permissions); + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('TestIamPermissions', TestIamPermissionsResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Updates a queue. + * + * This method creates the queue if it does not exist and updates + * the queue if it does exist. + * + * Queues created with this method allow tasks to live for a maximum of 31 + * days. After a task is 31 days old, the task will be deleted regardless of + * whether it was dispatched or not. + * + * WARNING: Using this method may have unintended side effects if you are + * using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + * Read + * [Overview of Queue Management and + * queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using + * this method. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $queue = new Queue(); + * $response = $cloudTasksClient->updateQueue($queue); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param Queue $queue Required. The queue to create or update. + * + * The queue's [name][google.cloud.tasks.v2beta2.Queue.name] must be + * specified. + * + * Output only fields cannot be modified using UpdateQueue. + * Any value specified for an output only field will be ignored. + * The queue's [name][google.cloud.tasks.v2beta2.Queue.name] cannot be + * changed. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * A mask used to specify which fields of the queue are being updated. + * + * If empty, then all fields will be updated. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Tasks\V2beta2\Queue + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function updateQueue($queue, array $optionalArgs = []) + { + $request = new UpdateQueueRequest(); + $requestParamHeaders = []; + $request->setQueue($queue); + $requestParamHeaders['queue.name'] = $queue->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateQueue', Queue::class, $optionalArgs, $request)->wait(); + } + + /** + * Update queue list by uploading a queue.yaml file. + * + * The queue.yaml file is supplied in the request body as a YAML encoded + * string. This method was added to support gcloud clients versions before + * 322.0.0. New clients should use CreateQueue instead of this method. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $appId = 'app_id'; + * $cloudTasksClient->uploadQueueYaml($appId); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $appId Required. The App ID is supplied as an HTTP parameter. Unlike internal + * usage of App ID, it does not include a region prefix. Rather, the App ID + * represents the Project ID against which to make the request. + * @param array $optionalArgs { + * Optional. + * + * @type HttpBody $httpBody + * The http body contains the queue.yaml file which used to update queue lists + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function uploadQueueYaml($appId, array $optionalArgs = []) + { + $request = new UploadQueueYamlRequest(); + $request->setAppId($appId); + if (isset($optionalArgs['httpBody'])) { + $request->setHttpBody($optionalArgs['httpBody']); + } + + return $this->startCall('UploadQueueYaml', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets information about a location. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $response = $cloudTasksClient->getLocation(); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Resource name for the location. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Location\Location + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function getLocation(array $optionalArgs = []) + { + $request = new GetLocationRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $cloudTasksClient->listLocations(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $cloudTasksClient->listLocations(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The resource that owns the locations collection, if applicable. + * @type string $filter + * The standard list filter. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function listLocations(array $optionalArgs = []) + { + $request = new ListLocationsRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); + } +} diff --git a/owl-bot-staging/Tasks/v2beta2/src/V2beta2/gapic_metadata.json b/owl-bot-staging/Tasks/v2beta2/src/V2beta2/gapic_metadata.json new file mode 100644 index 000000000000..92458443760a --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/src/V2beta2/gapic_metadata.json @@ -0,0 +1,133 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.tasks.v2beta2", + "libraryPackage": "Google\\Cloud\\Tasks\\V2beta2", + "services": { + "CloudTasks": { + "clients": { + "grpc": { + "libraryClient": "CloudTasksGapicClient", + "rpcs": { + "AcknowledgeTask": { + "methods": [ + "acknowledgeTask" + ] + }, + "CancelLease": { + "methods": [ + "cancelLease" + ] + }, + "CreateQueue": { + "methods": [ + "createQueue" + ] + }, + "CreateTask": { + "methods": [ + "createTask" + ] + }, + "DeleteQueue": { + "methods": [ + "deleteQueue" + ] + }, + "DeleteTask": { + "methods": [ + "deleteTask" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "GetQueue": { + "methods": [ + "getQueue" + ] + }, + "GetTask": { + "methods": [ + "getTask" + ] + }, + "LeaseTasks": { + "methods": [ + "leaseTasks" + ] + }, + "ListQueues": { + "methods": [ + "listQueues" + ] + }, + "ListTasks": { + "methods": [ + "listTasks" + ] + }, + "PauseQueue": { + "methods": [ + "pauseQueue" + ] + }, + "PurgeQueue": { + "methods": [ + "purgeQueue" + ] + }, + "RenewLease": { + "methods": [ + "renewLease" + ] + }, + "ResumeQueue": { + "methods": [ + "resumeQueue" + ] + }, + "RunTask": { + "methods": [ + "runTask" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "UpdateQueue": { + "methods": [ + "updateQueue" + ] + }, + "UploadQueueYaml": { + "methods": [ + "uploadQueueYaml" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/Tasks/v2beta2/src/V2beta2/resources/cloud_tasks_client_config.json b/owl-bot-staging/Tasks/v2beta2/src/V2beta2/resources/cloud_tasks_client_config.json new file mode 100644 index 000000000000..3e49652fe97e --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/src/V2beta2/resources/cloud_tasks_client_config.json @@ -0,0 +1,160 @@ +{ + "interfaces": { + "google.cloud.tasks.v2beta2.CloudTasks": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE", + "DEADLINE_EXCEEDED" + ], + "no_retry_1_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 20000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 20000, + "total_timeout_millis": 20000 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 20000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 20000, + "total_timeout_millis": 20000 + } + }, + "methods": { + "AcknowledgeTask": { + "timeout_millis": 20000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CancelLease": { + "timeout_millis": 20000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateQueue": { + "timeout_millis": 20000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateTask": { + "timeout_millis": 20000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteQueue": { + "timeout_millis": 20000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteTask": { + "timeout_millis": 20000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetIamPolicy": { + "timeout_millis": 20000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetQueue": { + "timeout_millis": 20000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetTask": { + "timeout_millis": 20000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "LeaseTasks": { + "timeout_millis": 20000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListQueues": { + "timeout_millis": 20000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListTasks": { + "timeout_millis": 20000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "PauseQueue": { + "timeout_millis": 20000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "PurgeQueue": { + "timeout_millis": 20000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "RenewLease": { + "timeout_millis": 20000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ResumeQueue": { + "timeout_millis": 20000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "RunTask": { + "timeout_millis": 20000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetIamPolicy": { + "timeout_millis": 20000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "timeout_millis": 20000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateQueue": { + "timeout_millis": 20000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UploadQueueYaml": { + "timeout_millis": 20000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/owl-bot-staging/Tasks/v2beta2/src/V2beta2/resources/cloud_tasks_descriptor_config.php b/owl-bot-staging/Tasks/v2beta2/src/V2beta2/resources/cloud_tasks_descriptor_config.php new file mode 100644 index 000000000000..5ba5625faa2d --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/src/V2beta2/resources/cloud_tasks_descriptor_config.php @@ -0,0 +1,42 @@ + [ + 'google.cloud.tasks.v2beta2.CloudTasks' => [ + 'ListQueues' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getQueues', + ], + ], + 'ListTasks' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getTasks', + ], + ], + 'GetLocation' => [ + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + ], + ], +]; diff --git a/owl-bot-staging/Tasks/v2beta2/src/V2beta2/resources/cloud_tasks_rest_client_config.php b/owl-bot-staging/Tasks/v2beta2/src/V2beta2/resources/cloud_tasks_rest_client_config.php new file mode 100644 index 000000000000..d6a4e451cb37 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/src/V2beta2/resources/cloud_tasks_rest_client_config.php @@ -0,0 +1,268 @@ + [ + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2beta2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.tasks.v2beta2.CloudTasks' => [ + 'AcknowledgeTask' => [ + 'method' => 'post', + 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:acknowledge', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'CancelLease' => [ + 'method' => 'post', + 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:cancelLease', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'CreateQueue' => [ + 'method' => 'post', + 'uriTemplate' => '/v2beta2/{parent=projects/*/locations/*}/queues', + 'body' => 'queue', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateTask' => [ + 'method' => 'post', + 'uriTemplate' => '/v2beta2/{parent=projects/*/locations/*/queues/*}/tasks', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteQueue' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*/queues/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteTask' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v2beta2/{resource=projects/*/locations/*/queues/*}:getIamPolicy', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'GetQueue' => [ + 'method' => 'get', + 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*/queues/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetTask' => [ + 'method' => 'get', + 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'LeaseTasks' => [ + 'method' => 'post', + 'uriTemplate' => '/v2beta2/{parent=projects/*/locations/*/queues/*}/tasks:lease', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListQueues' => [ + 'method' => 'get', + 'uriTemplate' => '/v2beta2/{parent=projects/*/locations/*}/queues', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListTasks' => [ + 'method' => 'get', + 'uriTemplate' => '/v2beta2/{parent=projects/*/locations/*/queues/*}/tasks', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'PauseQueue' => [ + 'method' => 'post', + 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*/queues/*}:pause', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'PurgeQueue' => [ + 'method' => 'post', + 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*/queues/*}:purge', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'RenewLease' => [ + 'method' => 'post', + 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:renewLease', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ResumeQueue' => [ + 'method' => 'post', + 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*/queues/*}:resume', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'RunTask' => [ + 'method' => 'post', + 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:run', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v2beta2/{resource=projects/*/locations/*/queues/*}:setIamPolicy', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v2beta2/{resource=projects/*/locations/*/queues/*}:testIamPermissions', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'UpdateQueue' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2beta2/{queue.name=projects/*/locations/*/queues/*}', + 'body' => 'queue', + 'placeholders' => [ + 'queue.name' => [ + 'getters' => [ + 'getQueue', + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Tasks/v2beta2/tests/Unit/V2beta2/CloudTasksClientTest.php b/owl-bot-staging/Tasks/v2beta2/tests/Unit/V2beta2/CloudTasksClientTest.php new file mode 100644 index 000000000000..e3fffafd8ee9 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/tests/Unit/V2beta2/CloudTasksClientTest.php @@ -0,0 +1,1492 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return CloudTasksClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new CloudTasksClient($options); + } + + /** @test */ + public function acknowledgeTaskTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $scheduleTime = new Timestamp(); + $gapicClient->acknowledgeTask($formattedName, $scheduleTime); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/AcknowledgeTask', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getScheduleTime(); + $this->assertProtobufEquals($scheduleTime, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function acknowledgeTaskExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $scheduleTime = new Timestamp(); + try { + $gapicClient->acknowledgeTask($formattedName, $scheduleTime); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function cancelLeaseTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new Task(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $scheduleTime = new Timestamp(); + $response = $gapicClient->cancelLease($formattedName, $scheduleTime); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/CancelLease', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getScheduleTime(); + $this->assertProtobufEquals($scheduleTime, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function cancelLeaseExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $scheduleTime = new Timestamp(); + try { + $gapicClient->cancelLease($formattedName, $scheduleTime); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createQueueTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new Queue(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $queue = new Queue(); + $response = $gapicClient->createQueue($formattedParent, $queue); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/CreateQueue', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getQueue(); + $this->assertProtobufEquals($queue, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createQueueExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $queue = new Queue(); + try { + $gapicClient->createQueue($formattedParent, $queue); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createTaskTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new Task(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $task = new Task(); + $response = $gapicClient->createTask($formattedParent, $task); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/CreateTask', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getTask(); + $this->assertProtobufEquals($task, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createTaskExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $task = new Task(); + try { + $gapicClient->createTask($formattedParent, $task); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteQueueTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $gapicClient->deleteQueue($formattedName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/DeleteQueue', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteQueueExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + try { + $gapicClient->deleteQueue($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteTaskTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $gapicClient->deleteTask($formattedName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/DeleteTask', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteTaskExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + try { + $gapicClient->deleteTask($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $response = $gapicClient->getIamPolicy($resource); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + try { + $gapicClient->getIamPolicy($resource); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getQueueTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new Queue(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $response = $gapicClient->getQueue($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/GetQueue', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getQueueExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + try { + $gapicClient->getQueue($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTaskTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new Task(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $response = $gapicClient->getTask($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/GetTask', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTaskExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + try { + $gapicClient->getTask($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function leaseTasksTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new LeaseTasksResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $leaseDuration = new Duration(); + $response = $gapicClient->leaseTasks($formattedParent, $leaseDuration); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/LeaseTasks', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getLeaseDuration(); + $this->assertProtobufEquals($leaseDuration, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function leaseTasksExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $leaseDuration = new Duration(); + try { + $gapicClient->leaseTasks($formattedParent, $leaseDuration); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listQueuesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $queuesElement = new Queue(); + $queues = [ + $queuesElement, + ]; + $expectedResponse = new ListQueuesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setQueues($queues); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $response = $gapicClient->listQueues($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getQueues()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/ListQueues', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listQueuesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + try { + $gapicClient->listQueues($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listTasksTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $tasksElement = new Task(); + $tasks = [ + $tasksElement, + ]; + $expectedResponse = new ListTasksResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTasks($tasks); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $response = $gapicClient->listTasks($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getTasks()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/ListTasks', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listTasksExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + try { + $gapicClient->listTasks($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function pauseQueueTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new Queue(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $response = $gapicClient->pauseQueue($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/PauseQueue', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function pauseQueueExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + try { + $gapicClient->pauseQueue($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function purgeQueueTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new Queue(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $response = $gapicClient->purgeQueue($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/PurgeQueue', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function purgeQueueExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + try { + $gapicClient->purgeQueue($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function renewLeaseTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new Task(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $scheduleTime = new Timestamp(); + $leaseDuration = new Duration(); + $response = $gapicClient->renewLease($formattedName, $scheduleTime, $leaseDuration); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/RenewLease', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getScheduleTime(); + $this->assertProtobufEquals($scheduleTime, $actualValue); + $actualValue = $actualRequestObject->getLeaseDuration(); + $this->assertProtobufEquals($leaseDuration, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function renewLeaseExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $scheduleTime = new Timestamp(); + $leaseDuration = new Duration(); + try { + $gapicClient->renewLease($formattedName, $scheduleTime, $leaseDuration); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function resumeQueueTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new Queue(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $response = $gapicClient->resumeQueue($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/ResumeQueue', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function resumeQueueExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + try { + $gapicClient->resumeQueue($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function runTaskTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new Task(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $response = $gapicClient->runTask($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/RunTask', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function runTaskExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + try { + $gapicClient->runTask($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $response = $gapicClient->setIamPolicy($resource, $policy); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + try { + $gapicClient->setIamPolicy($resource, $policy); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $response = $gapicClient->testIamPermissions($resource, $permissions); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + try { + $gapicClient->testIamPermissions($resource, $permissions); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateQueueTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new Queue(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $queue = new Queue(); + $response = $gapicClient->updateQueue($queue); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/UpdateQueue', $actualFuncCall); + $actualValue = $actualRequestObject->getQueue(); + $this->assertProtobufEquals($queue, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateQueueExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $queue = new Queue(); + try { + $gapicClient->updateQueue($queue); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function uploadQueueYamlTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $appId = 'appId-1411074055'; + $gapicClient->uploadQueueYaml($appId); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/UploadQueueYaml', $actualFuncCall); + $actualValue = $actualRequestObject->getAppId(); + $this->assertProtobufEquals($appId, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function uploadQueueYamlExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $appId = 'appId-1411074055'; + try { + $gapicClient->uploadQueueYaml($appId); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $response = $gapicClient->getLocation(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->getLocation(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $response = $gapicClient->listLocations(); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->listLocations(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta3/Cloudtasks.php b/owl-bot-staging/Tasks/v2beta3/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta3/Cloudtasks.php new file mode 100644 index 000000000000..c492fe303df0 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta3/Cloudtasks.php @@ -0,0 +1,116 @@ +internalAddGeneratedFile( + ' +�( ++google/cloud/tasks/v2beta3/cloudtasks.protogoogle.cloud.tasks.v2beta3google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto&google/cloud/tasks/v2beta3/queue.proto%google/cloud/tasks/v2beta3/task.protogoogle/iam/v1/iam_policy.protogoogle/iam/v1/policy.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto"� +ListQueuesRequest7 +parent ( B\'�A�A!cloudtasks.googleapis.com/Queue +filter (  + page_size ( + +page_token ( 2 + read_mask ( 2.google.protobuf.FieldMaskB�A"` +ListQueuesResponse1 +queues ( 2!.google.cloud.tasks.v2beta3.Queue +next_page_token ( "| +GetQueueRequest5 +name ( B\'�A�A! +cloudtasks.googleapis.com/Queue2 + read_mask ( 2.google.protobuf.FieldMaskB�A"� +CreateQueueRequest7 +parent ( B\'�A�A!cloudtasks.googleapis.com/Queue5 +queue ( 2!.google.cloud.tasks.v2beta3.QueueB�A"| +UpdateQueueRequest5 +queue ( 2!.google.cloud.tasks.v2beta3.QueueB�A/ + update_mask ( 2.google.protobuf.FieldMask"K +DeleteQueueRequest5 +name ( B\'�A�A! +cloudtasks.googleapis.com/Queue"J +PurgeQueueRequest5 +name ( B\'�A�A! +cloudtasks.googleapis.com/Queue"J +PauseQueueRequest5 +name ( B\'�A�A! +cloudtasks.googleapis.com/Queue"K +ResumeQueueRequest5 +name ( B\'�A�A! +cloudtasks.googleapis.com/Queue"� +ListTasksRequest6 +parent ( B&�A�A cloudtasks.googleapis.com/Task< + response_view (2%.google.cloud.tasks.v2beta3.Task.View + page_size ( + +page_token ( "] +ListTasksResponse/ +tasks ( 2 .google.cloud.tasks.v2beta3.Task +next_page_token ( "� +GetTaskRequest4 +name ( B&�A�A +cloudtasks.googleapis.com/Task< + response_view (2%.google.cloud.tasks.v2beta3.Task.View"� +CreateTaskRequest6 +parent ( B&�A�A cloudtasks.googleapis.com/Task3 +task ( 2 .google.cloud.tasks.v2beta3.TaskB�A< + response_view (2%.google.cloud.tasks.v2beta3.Task.View"I +DeleteTaskRequest4 +name ( B&�A�A +cloudtasks.googleapis.com/Task"� +RunTaskRequest4 +name ( B&�A�A +cloudtasks.googleapis.com/Task< + response_view (2%.google.cloud.tasks.v2beta3.Task.View2� + +CloudTasks� + +ListQueues-.google.cloud.tasks.v2beta3.ListQueuesRequest..google.cloud.tasks.v2beta3.ListQueuesResponse"@���1//v2beta3/{parent=projects/*/locations/*}/queues�Aparent� +GetQueue+.google.cloud.tasks.v2beta3.GetQueueRequest!.google.cloud.tasks.v2beta3.Queue">���1//v2beta3/{name=projects/*/locations/*/queues/*}�Aname� + CreateQueue..google.cloud.tasks.v2beta3.CreateQueueRequest!.google.cloud.tasks.v2beta3.Queue"M���8"//v2beta3/{parent=projects/*/locations/*}/queues:queue�A parent,queue� + UpdateQueue..google.cloud.tasks.v2beta3.UpdateQueueRequest!.google.cloud.tasks.v2beta3.Queue"X���>25/v2beta3/{queue.name=projects/*/locations/*/queues/*}:queue�Aqueue,update_mask� + DeleteQueue..google.cloud.tasks.v2beta3.DeleteQueueRequest.google.protobuf.Empty">���1*//v2beta3/{name=projects/*/locations/*/queues/*}�Aname� + +PurgeQueue-.google.cloud.tasks.v2beta3.PurgeQueueRequest!.google.cloud.tasks.v2beta3.Queue"G���:"5/v2beta3/{name=projects/*/locations/*/queues/*}:purge:*�Aname� + +PauseQueue-.google.cloud.tasks.v2beta3.PauseQueueRequest!.google.cloud.tasks.v2beta3.Queue"G���:"5/v2beta3/{name=projects/*/locations/*/queues/*}:pause:*�Aname� + ResumeQueue..google.cloud.tasks.v2beta3.ResumeQueueRequest!.google.cloud.tasks.v2beta3.Queue"H���;"6/v2beta3/{name=projects/*/locations/*/queues/*}:resume:*�Aname� + GetIamPolicy".google.iam.v1.GetIamPolicyRequest.google.iam.v1.Policy"V���E"@/v2beta3/{resource=projects/*/locations/*/queues/*}:getIamPolicy:*�Aresource� + SetIamPolicy".google.iam.v1.SetIamPolicyRequest.google.iam.v1.Policy"]���E"@/v2beta3/{resource=projects/*/locations/*/queues/*}:setIamPolicy:*�Aresource,policy� +TestIamPermissions(.google.iam.v1.TestIamPermissionsRequest).google.iam.v1.TestIamPermissionsResponse"h���K"F/v2beta3/{resource=projects/*/locations/*/queues/*}:testIamPermissions:*�Aresource,permissions� + ListTasks,.google.cloud.tasks.v2beta3.ListTasksRequest-.google.cloud.tasks.v2beta3.ListTasksResponse"H���97/v2beta3/{parent=projects/*/locations/*/queues/*}/tasks�Aparent� +GetTask*.google.cloud.tasks.v2beta3.GetTaskRequest .google.cloud.tasks.v2beta3.Task"F���97/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}�Aname� + +CreateTask-.google.cloud.tasks.v2beta3.CreateTaskRequest .google.cloud.tasks.v2beta3.Task"P���<"7/v2beta3/{parent=projects/*/locations/*/queues/*}/tasks:*�A parent,task� + +DeleteTask-.google.cloud.tasks.v2beta3.DeleteTaskRequest.google.protobuf.Empty"F���9*7/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}�Aname� +RunTask*.google.cloud.tasks.v2beta3.RunTaskRequest .google.cloud.tasks.v2beta3.Task"M���@";/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}:run:*�AnameM�Acloudtasks.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformB� +com.google.cloud.tasks.v2beta3BCloudTasksProtoPZCcloud.google.com/go/cloudtasks/apiv2beta3/cloudtaskspb;cloudtaskspb�TASKSbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta3/Queue.php b/owl-bot-staging/Tasks/v2beta3/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta3/Queue.php new file mode 100644 index 0000000000000000000000000000000000000000..bb64862a08116894b48971470b8d8d6688147eef GIT binary patch literal 2709 zcmbVOe^1*+7;b<7eFKPDWipx8Uem6m+U8X0R%u~uN=Sf63^Ed?b+TkR_9a~F*sgs> zWmUe(KF+?tzQO*S_9^z>ogJb!4QNOa{_#BT`JVTA?(X{^!;26ekwfa!$mY}~{VT#R zC<&v02TtITeli%)h&aJ0WFCzSLYk-K@M3g6yzbn666c|sg%o%FcLuMW@>bVViVPCQ!s@1M%bzS6R)H9m) z?$)ds?ZIY6sKM<=o=DnE&~ey_|3U3B^bog4;cTw#;@3a0v}bkKowVoxO4 zKR4jX?cA#s70!?@H>Asr)aAwPw1yqBN|Z{gOkXs2=G5m>z!Z5u1T0-B|p)p4Vzh+*n_elc3S)GgLbRAc}FY2%GvqJN&Dn*Gp7M8ck1U|e6fI5 zUv0L#^~N#YEta0alK39&9&GkrcHS?t3QL{y<72EKuewK@3pLaHxBe0yNR3peRT?nL zv4LA(Mb1)tfjxdj9UfQSrB~yM7dUbi!)Mv$SZ#Rt*W7qM zBZ@^g9kC3b&Fo-`6e^|2FF>bw7{lYsCACy>+&;xTsgx!shi=4hA1ym4_YEaQN1Sas zx!?BH(vYqH==Nctj&V|>3Wgv%$Xy2{?C(zB^q1xG_k3rvwSJ{eH&ch9SRU499E2oN K9aqLM2KW!{ENd(P literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta3/Target.php b/owl-bot-staging/Tasks/v2beta3/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta3/Target.php new file mode 100644 index 0000000000000000000000000000000000000000..60a36d89fa8ad8943c2ca79a34d02d289b79584f GIT binary patch literal 3007 zcmc&$+iu%N5RERDqLJ(>ted({Td-iDShKQb-d==QCzxN1aV>fok6A!Op?9mglJyTefQ zBHB4?j4?wG_#2&IR+lyb0yM)>h#agR4BCfWz(ov=4y5|1Bh*KhP#-;Sw1xUEfa9Ym z(k*EQegmEV!g%a^jvg_@_}^VGvc14#9`e1H+>1T^6!{V6s+VO?plGf&_D!&2Vv9?7^VU8M_n8_)C(D*11{QZa@W%EiIc7ElCw?2D=isFz_mUlF05q_7WT|*G;e8=hSSafVf5gnFq|2MUoh#WO6w zuQclQtKrt?6zfB&)w}U~CZpYg{FFpY;p}CSqmWRxmgCTKy{tHT0?PugO%eyz^88!5 zv9;*NHym!kit;G6up}*PFS77vP!N0;Q!j;JK-#cKs_ZKd&ek+t~<%sm^* z%ptc@dk6&;8|^k|!%ojQH0+b3;lSwh_xnb-dPBPj`JQDBsu`^WOX6u*&DO?n``re$ zZP++D?%U>b-B%G6kC ze6vVfT+VwIm)1#CgpgxJba%81;5^t>S>zqL7AYKCm$m(aImKGW+580 z#lsUC^Vv+U*L09iP|zOogqKQs%q9vSh<9` zpn{OZ{{Es1Uo)4u-o6d1!ec_cm%NXYz*fd;|74*oq>nK#rickpG4&Hr|A{pNit3IF zvc7*G;siqiIWhu9&qZGw6Zc%UhYHWb|BtykR1_x(vIYD#vp;064EY4KRu~$=#0#(p zJ?}{|)}Fx~6o$M7iDR3Rn0dh@P56ZLdy7Jt8a-CZwZF2knjX%R{1&fbx?H~+d!Stg zD$};y_#k{5pGg$^JRQ%l&AW@74khjAb>8GE9)OfV$FhT8p0&5 zVlYRTo_UTMlO=J$r&z?xN|moxg_~Z$w-LVcBwq0}mP1iYxl*kO@VcXDU%)4cJsUX= zi34Wi8S*Zwkhg}&Az{)QYLB3l_LKLiavUgjJuGm@wc*=Hwe_U4-hofW#IX+zt7mrK z8XtTx4a}j%r$!NS2ZmM6%2{Q!y49RG8k|_wyqG9m{&1}&@8s}^`4DVhVT zZypV+#WsU4`C7Yx#&%gXYPkarGQV`xdUUaTklD_JsD)SUyD0Q7R$eJ7Ps8!<{L8o? c*Wd@6>AH4LZGm%3R5U)EYZ5SuZgrW8Fq2tmPaj{KWoqnmZtnk022HM6*(hL{`2sB08++>NB zs18}+SJ+$ZdG;QAiXBNw$!5bdrZ1An``wYh``z95uf#;4$M}RrEFqEwczA{7gkh1y zGNy5ehuLVv5=`T%;2}$FjJv1!-RTAHb^8}z0W^)XgfbV8<9Hl0hlX($IFh8lq|V3Y zkV$f&|7`6Mp@>XbDhOrxWYB&K+X0cpJJDdTqrl#U0(+OuwgMj_L_?CMSgoRKgy9j{ zFys`cl1O+x;i=CfE;$MLZ*YSnJR)Jr061?u$|5Rx9AO1GjVNn8!^WqweIjDG@ewYL zGf*S|0bW0nEQv_yby-RiE@Yexz|?ieOqSHCmBzC?ta8UkxM9xdx^ss-!ZOL&?dTXM zOlC=RsL!n&%*ros0a-14@Inz{_dmPP!|HI$_aAz^8GLWy)O%ja)XDtK_aN5bd{xMWAFEMR8{3+)lgN{ zSG|HOjScG@JtRW-EE@BO`4cIHpRf-Z&|d!p3^tqJ*~a6di`gw9dK&o}fM*8x`i}Jq z)&AjWQ+x9Em${nrAhIy@A^#~Ev-;Kw9tHq-YwY0+&(T&&CoIT9<|~rwRqbN8I77j( zU5dj)s*&8N$vDP7r@V7&JnRn^=29PM28dq4W`-<=P7o&IsZ*WI~eZJ@Pw>%8CDsaW?> z_4xgpH#>LT$zLso9_dS%sxf*af~Pi26i17;1L^viQJFf|`Pa+|W2zeqtQDU#2c!$) zb*}Y$md}`L<#^WKMm0gM!k7fUyb^5h&kDL%5H%+kRUVtoWpV*XnMbX#yQ@IT6l;j7 zv1L)dMxT}tQ_#7Rts)~(>b7Zl?F5L7r^UtsVYD|CodY$q29=*W#-b>2AbT8};jA;^ sKn{xWe3KtBJiPrgT-TL!uwQo0Z_L!XHRRN}IbAT|w56FvGc-f!Zvwo*j{pDw literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/AppEngineHttpQueue.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/AppEngineHttpQueue.php new file mode 100644 index 000000000000..685601b84245 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/AppEngineHttpQueue.php @@ -0,0 +1,114 @@ +google.cloud.tasks.v2beta3.AppEngineHttpQueue + */ +class AppEngineHttpQueue extends \Google\Protobuf\Internal\Message +{ + /** + * Overrides for the + * [task-level + * app_engine_routing][google.cloud.tasks.v2beta3.AppEngineHttpRequest.app_engine_routing]. + * If set, `app_engine_routing_override` is used for all tasks in + * the queue, no matter what the setting is for the + * [task-level + * app_engine_routing][google.cloud.tasks.v2beta3.AppEngineHttpRequest.app_engine_routing]. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.AppEngineRouting app_engine_routing_override = 1; + */ + protected $app_engine_routing_override = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Tasks\V2beta3\AppEngineRouting $app_engine_routing_override + * Overrides for the + * [task-level + * app_engine_routing][google.cloud.tasks.v2beta3.AppEngineHttpRequest.app_engine_routing]. + * If set, `app_engine_routing_override` is used for all tasks in + * the queue, no matter what the setting is for the + * [task-level + * app_engine_routing][google.cloud.tasks.v2beta3.AppEngineHttpRequest.app_engine_routing]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Target::initOnce(); + parent::__construct($data); + } + + /** + * Overrides for the + * [task-level + * app_engine_routing][google.cloud.tasks.v2beta3.AppEngineHttpRequest.app_engine_routing]. + * If set, `app_engine_routing_override` is used for all tasks in + * the queue, no matter what the setting is for the + * [task-level + * app_engine_routing][google.cloud.tasks.v2beta3.AppEngineHttpRequest.app_engine_routing]. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.AppEngineRouting app_engine_routing_override = 1; + * @return \Google\Cloud\Tasks\V2beta3\AppEngineRouting|null + */ + public function getAppEngineRoutingOverride() + { + return $this->app_engine_routing_override; + } + + public function hasAppEngineRoutingOverride() + { + return isset($this->app_engine_routing_override); + } + + public function clearAppEngineRoutingOverride() + { + unset($this->app_engine_routing_override); + } + + /** + * Overrides for the + * [task-level + * app_engine_routing][google.cloud.tasks.v2beta3.AppEngineHttpRequest.app_engine_routing]. + * If set, `app_engine_routing_override` is used for all tasks in + * the queue, no matter what the setting is for the + * [task-level + * app_engine_routing][google.cloud.tasks.v2beta3.AppEngineHttpRequest.app_engine_routing]. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.AppEngineRouting app_engine_routing_override = 1; + * @param \Google\Cloud\Tasks\V2beta3\AppEngineRouting $var + * @return $this + */ + public function setAppEngineRoutingOverride($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\AppEngineRouting::class); + $this->app_engine_routing_override = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/AppEngineHttpRequest.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/AppEngineHttpRequest.php new file mode 100644 index 000000000000..7257325270f2 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/AppEngineHttpRequest.php @@ -0,0 +1,478 @@ +google.cloud.tasks.v2beta3.AppEngineHttpRequest + */ +class AppEngineHttpRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The HTTP method to use for the request. The default is POST. + * The app's request handler for the task's target URL must be able to handle + * HTTP requests with this http_method, otherwise the task attempt fails with + * error code 405 (Method Not Allowed). See [Writing a push task request + * handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) + * and the App Engine documentation for your runtime on [How Requests are + * Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.HttpMethod http_method = 1; + */ + protected $http_method = 0; + /** + * Task-level setting for App Engine routing. + * If set, + * [app_engine_routing_override][google.cloud.tasks.v2beta3.AppEngineHttpQueue.app_engine_routing_override] + * is used for all tasks in the queue, no matter what the setting is for the + * [task-level + * app_engine_routing][google.cloud.tasks.v2beta3.AppEngineHttpRequest.app_engine_routing]. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.AppEngineRouting app_engine_routing = 2; + */ + protected $app_engine_routing = null; + /** + * The relative URI. + * The relative URI must begin with "/" and must be a valid HTTP relative URI. + * It can contain a path and query string arguments. + * If the relative URI is empty, then the root path "/" will be used. + * No spaces are allowed, and the maximum length allowed is 2083 characters. + * + * Generated from protobuf field string relative_uri = 3; + */ + protected $relative_uri = ''; + /** + * HTTP request headers. + * This map contains the header field names and values. + * Headers can be set when the + * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. + * Repeated headers are not supported but a header value can contain commas. + * Cloud Tasks sets some headers to default values: + * * `User-Agent`: By default, this header is + * `"AppEngine-Google; (+http://code.google.com/appengine)"`. + * This header can be modified, but Cloud Tasks will append + * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the + * modified `User-Agent`. + * If the task has a + * [body][google.cloud.tasks.v2beta3.AppEngineHttpRequest.body], Cloud Tasks + * sets the following headers: + * * `Content-Type`: By default, the `Content-Type` header is set to + * `"application/octet-stream"`. The default can be overridden by explicitly + * setting `Content-Type` to a particular media type when the + * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. + * For example, `Content-Type` can be set to `"application/json"`. + * * `Content-Length`: This is computed by Cloud Tasks. This value is + * output only. It cannot be changed. + * The headers below cannot be set or overridden: + * * `Host` + * * `X-Google-*` + * * `X-AppEngine-*` + * In addition, Cloud Tasks sets some headers when the task is dispatched, + * such as headers containing information about the task; see + * [request + * headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers). + * These headers are set only when the task is dispatched, so they are not + * visible when the task is returned in a Cloud Tasks response. + * Although there is no specific limit for the maximum number of headers or + * the size, there is a limit on the maximum size of the + * [Task][google.cloud.tasks.v2beta3.Task]. For more information, see the + * [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask] + * documentation. + * + * Generated from protobuf field map headers = 4; + */ + private $headers; + /** + * HTTP request body. + * A request body is allowed only if the HTTP method is POST or PUT. It is + * an error to set a body on a task with an incompatible + * [HttpMethod][google.cloud.tasks.v2beta3.HttpMethod]. + * + * Generated from protobuf field bytes body = 5; + */ + protected $body = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $http_method + * The HTTP method to use for the request. The default is POST. + * The app's request handler for the task's target URL must be able to handle + * HTTP requests with this http_method, otherwise the task attempt fails with + * error code 405 (Method Not Allowed). See [Writing a push task request + * handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) + * and the App Engine documentation for your runtime on [How Requests are + * Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). + * @type \Google\Cloud\Tasks\V2beta3\AppEngineRouting $app_engine_routing + * Task-level setting for App Engine routing. + * If set, + * [app_engine_routing_override][google.cloud.tasks.v2beta3.AppEngineHttpQueue.app_engine_routing_override] + * is used for all tasks in the queue, no matter what the setting is for the + * [task-level + * app_engine_routing][google.cloud.tasks.v2beta3.AppEngineHttpRequest.app_engine_routing]. + * @type string $relative_uri + * The relative URI. + * The relative URI must begin with "/" and must be a valid HTTP relative URI. + * It can contain a path and query string arguments. + * If the relative URI is empty, then the root path "/" will be used. + * No spaces are allowed, and the maximum length allowed is 2083 characters. + * @type array|\Google\Protobuf\Internal\MapField $headers + * HTTP request headers. + * This map contains the header field names and values. + * Headers can be set when the + * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. + * Repeated headers are not supported but a header value can contain commas. + * Cloud Tasks sets some headers to default values: + * * `User-Agent`: By default, this header is + * `"AppEngine-Google; (+http://code.google.com/appengine)"`. + * This header can be modified, but Cloud Tasks will append + * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the + * modified `User-Agent`. + * If the task has a + * [body][google.cloud.tasks.v2beta3.AppEngineHttpRequest.body], Cloud Tasks + * sets the following headers: + * * `Content-Type`: By default, the `Content-Type` header is set to + * `"application/octet-stream"`. The default can be overridden by explicitly + * setting `Content-Type` to a particular media type when the + * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. + * For example, `Content-Type` can be set to `"application/json"`. + * * `Content-Length`: This is computed by Cloud Tasks. This value is + * output only. It cannot be changed. + * The headers below cannot be set or overridden: + * * `Host` + * * `X-Google-*` + * * `X-AppEngine-*` + * In addition, Cloud Tasks sets some headers when the task is dispatched, + * such as headers containing information about the task; see + * [request + * headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers). + * These headers are set only when the task is dispatched, so they are not + * visible when the task is returned in a Cloud Tasks response. + * Although there is no specific limit for the maximum number of headers or + * the size, there is a limit on the maximum size of the + * [Task][google.cloud.tasks.v2beta3.Task]. For more information, see the + * [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask] + * documentation. + * @type string $body + * HTTP request body. + * A request body is allowed only if the HTTP method is POST or PUT. It is + * an error to set a body on a task with an incompatible + * [HttpMethod][google.cloud.tasks.v2beta3.HttpMethod]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Target::initOnce(); + parent::__construct($data); + } + + /** + * The HTTP method to use for the request. The default is POST. + * The app's request handler for the task's target URL must be able to handle + * HTTP requests with this http_method, otherwise the task attempt fails with + * error code 405 (Method Not Allowed). See [Writing a push task request + * handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) + * and the App Engine documentation for your runtime on [How Requests are + * Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.HttpMethod http_method = 1; + * @return int + */ + public function getHttpMethod() + { + return $this->http_method; + } + + /** + * The HTTP method to use for the request. The default is POST. + * The app's request handler for the task's target URL must be able to handle + * HTTP requests with this http_method, otherwise the task attempt fails with + * error code 405 (Method Not Allowed). See [Writing a push task request + * handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) + * and the App Engine documentation for your runtime on [How Requests are + * Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.HttpMethod http_method = 1; + * @param int $var + * @return $this + */ + public function setHttpMethod($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta3\HttpMethod::class); + $this->http_method = $var; + + return $this; + } + + /** + * Task-level setting for App Engine routing. + * If set, + * [app_engine_routing_override][google.cloud.tasks.v2beta3.AppEngineHttpQueue.app_engine_routing_override] + * is used for all tasks in the queue, no matter what the setting is for the + * [task-level + * app_engine_routing][google.cloud.tasks.v2beta3.AppEngineHttpRequest.app_engine_routing]. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.AppEngineRouting app_engine_routing = 2; + * @return \Google\Cloud\Tasks\V2beta3\AppEngineRouting|null + */ + public function getAppEngineRouting() + { + return $this->app_engine_routing; + } + + public function hasAppEngineRouting() + { + return isset($this->app_engine_routing); + } + + public function clearAppEngineRouting() + { + unset($this->app_engine_routing); + } + + /** + * Task-level setting for App Engine routing. + * If set, + * [app_engine_routing_override][google.cloud.tasks.v2beta3.AppEngineHttpQueue.app_engine_routing_override] + * is used for all tasks in the queue, no matter what the setting is for the + * [task-level + * app_engine_routing][google.cloud.tasks.v2beta3.AppEngineHttpRequest.app_engine_routing]. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.AppEngineRouting app_engine_routing = 2; + * @param \Google\Cloud\Tasks\V2beta3\AppEngineRouting $var + * @return $this + */ + public function setAppEngineRouting($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\AppEngineRouting::class); + $this->app_engine_routing = $var; + + return $this; + } + + /** + * The relative URI. + * The relative URI must begin with "/" and must be a valid HTTP relative URI. + * It can contain a path and query string arguments. + * If the relative URI is empty, then the root path "/" will be used. + * No spaces are allowed, and the maximum length allowed is 2083 characters. + * + * Generated from protobuf field string relative_uri = 3; + * @return string + */ + public function getRelativeUri() + { + return $this->relative_uri; + } + + /** + * The relative URI. + * The relative URI must begin with "/" and must be a valid HTTP relative URI. + * It can contain a path and query string arguments. + * If the relative URI is empty, then the root path "/" will be used. + * No spaces are allowed, and the maximum length allowed is 2083 characters. + * + * Generated from protobuf field string relative_uri = 3; + * @param string $var + * @return $this + */ + public function setRelativeUri($var) + { + GPBUtil::checkString($var, True); + $this->relative_uri = $var; + + return $this; + } + + /** + * HTTP request headers. + * This map contains the header field names and values. + * Headers can be set when the + * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. + * Repeated headers are not supported but a header value can contain commas. + * Cloud Tasks sets some headers to default values: + * * `User-Agent`: By default, this header is + * `"AppEngine-Google; (+http://code.google.com/appengine)"`. + * This header can be modified, but Cloud Tasks will append + * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the + * modified `User-Agent`. + * If the task has a + * [body][google.cloud.tasks.v2beta3.AppEngineHttpRequest.body], Cloud Tasks + * sets the following headers: + * * `Content-Type`: By default, the `Content-Type` header is set to + * `"application/octet-stream"`. The default can be overridden by explicitly + * setting `Content-Type` to a particular media type when the + * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. + * For example, `Content-Type` can be set to `"application/json"`. + * * `Content-Length`: This is computed by Cloud Tasks. This value is + * output only. It cannot be changed. + * The headers below cannot be set or overridden: + * * `Host` + * * `X-Google-*` + * * `X-AppEngine-*` + * In addition, Cloud Tasks sets some headers when the task is dispatched, + * such as headers containing information about the task; see + * [request + * headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers). + * These headers are set only when the task is dispatched, so they are not + * visible when the task is returned in a Cloud Tasks response. + * Although there is no specific limit for the maximum number of headers or + * the size, there is a limit on the maximum size of the + * [Task][google.cloud.tasks.v2beta3.Task]. For more information, see the + * [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask] + * documentation. + * + * Generated from protobuf field map headers = 4; + * @return \Google\Protobuf\Internal\MapField + */ + public function getHeaders() + { + return $this->headers; + } + + /** + * HTTP request headers. + * This map contains the header field names and values. + * Headers can be set when the + * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. + * Repeated headers are not supported but a header value can contain commas. + * Cloud Tasks sets some headers to default values: + * * `User-Agent`: By default, this header is + * `"AppEngine-Google; (+http://code.google.com/appengine)"`. + * This header can be modified, but Cloud Tasks will append + * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the + * modified `User-Agent`. + * If the task has a + * [body][google.cloud.tasks.v2beta3.AppEngineHttpRequest.body], Cloud Tasks + * sets the following headers: + * * `Content-Type`: By default, the `Content-Type` header is set to + * `"application/octet-stream"`. The default can be overridden by explicitly + * setting `Content-Type` to a particular media type when the + * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. + * For example, `Content-Type` can be set to `"application/json"`. + * * `Content-Length`: This is computed by Cloud Tasks. This value is + * output only. It cannot be changed. + * The headers below cannot be set or overridden: + * * `Host` + * * `X-Google-*` + * * `X-AppEngine-*` + * In addition, Cloud Tasks sets some headers when the task is dispatched, + * such as headers containing information about the task; see + * [request + * headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers). + * These headers are set only when the task is dispatched, so they are not + * visible when the task is returned in a Cloud Tasks response. + * Although there is no specific limit for the maximum number of headers or + * the size, there is a limit on the maximum size of the + * [Task][google.cloud.tasks.v2beta3.Task]. For more information, see the + * [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask] + * documentation. + * + * Generated from protobuf field map headers = 4; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setHeaders($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->headers = $arr; + + return $this; + } + + /** + * HTTP request body. + * A request body is allowed only if the HTTP method is POST or PUT. It is + * an error to set a body on a task with an incompatible + * [HttpMethod][google.cloud.tasks.v2beta3.HttpMethod]. + * + * Generated from protobuf field bytes body = 5; + * @return string + */ + public function getBody() + { + return $this->body; + } + + /** + * HTTP request body. + * A request body is allowed only if the HTTP method is POST or PUT. It is + * an error to set a body on a task with an incompatible + * [HttpMethod][google.cloud.tasks.v2beta3.HttpMethod]. + * + * Generated from protobuf field bytes body = 5; + * @param string $var + * @return $this + */ + public function setBody($var) + { + GPBUtil::checkString($var, False); + $this->body = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/AppEngineRouting.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/AppEngineRouting.php new file mode 100644 index 000000000000..2546c50f732f --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/AppEngineRouting.php @@ -0,0 +1,380 @@ +google.cloud.tasks.v2beta3.AppEngineRouting + */ +class AppEngineRouting extends \Google\Protobuf\Internal\Message +{ + /** + * App service. + * By default, the task is sent to the service which is the default + * service when the task is attempted. + * For some queues or tasks which were created using the App Engine + * Task Queue API, [host][google.cloud.tasks.v2beta3.AppEngineRouting.host] is + * not parsable into + * [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], + * [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance]. For + * example, some tasks which were created using the App Engine SDK use a + * custom domain name; custom domains are not parsed by Cloud Tasks. If + * [host][google.cloud.tasks.v2beta3.AppEngineRouting.host] is not parsable, + * then [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], + * [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance] are the + * empty string. + * + * Generated from protobuf field string service = 1; + */ + protected $service = ''; + /** + * App version. + * By default, the task is sent to the version which is the default + * version when the task is attempted. + * For some queues or tasks which were created using the App Engine + * Task Queue API, [host][google.cloud.tasks.v2beta3.AppEngineRouting.host] is + * not parsable into + * [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], + * [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance]. For + * example, some tasks which were created using the App Engine SDK use a + * custom domain name; custom domains are not parsed by Cloud Tasks. If + * [host][google.cloud.tasks.v2beta3.AppEngineRouting.host] is not parsable, + * then [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], + * [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance] are the + * empty string. + * + * Generated from protobuf field string version = 2; + */ + protected $version = ''; + /** + * App instance. + * By default, the task is sent to an instance which is available when + * the task is attempted. + * Requests can only be sent to a specific instance if + * [manual scaling is used in App Engine + * Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). + * App Engine Flex does not support instances. For more information, see + * [App Engine Standard request + * routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) + * and [App Engine Flex request + * routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). + * + * Generated from protobuf field string instance = 3; + */ + protected $instance = ''; + /** + * Output only. The host that the task is sent to. + * The host is constructed from the domain name of the app associated with + * the queue's project ID (for example .appspot.com), and the + * [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], + * [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance]. Tasks + * which were created using the App Engine SDK might have a custom domain + * name. + * For more information, see + * [How Requests are + * Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). + * + * Generated from protobuf field string host = 4; + */ + protected $host = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $service + * App service. + * By default, the task is sent to the service which is the default + * service when the task is attempted. + * For some queues or tasks which were created using the App Engine + * Task Queue API, [host][google.cloud.tasks.v2beta3.AppEngineRouting.host] is + * not parsable into + * [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], + * [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance]. For + * example, some tasks which were created using the App Engine SDK use a + * custom domain name; custom domains are not parsed by Cloud Tasks. If + * [host][google.cloud.tasks.v2beta3.AppEngineRouting.host] is not parsable, + * then [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], + * [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance] are the + * empty string. + * @type string $version + * App version. + * By default, the task is sent to the version which is the default + * version when the task is attempted. + * For some queues or tasks which were created using the App Engine + * Task Queue API, [host][google.cloud.tasks.v2beta3.AppEngineRouting.host] is + * not parsable into + * [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], + * [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance]. For + * example, some tasks which were created using the App Engine SDK use a + * custom domain name; custom domains are not parsed by Cloud Tasks. If + * [host][google.cloud.tasks.v2beta3.AppEngineRouting.host] is not parsable, + * then [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], + * [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance] are the + * empty string. + * @type string $instance + * App instance. + * By default, the task is sent to an instance which is available when + * the task is attempted. + * Requests can only be sent to a specific instance if + * [manual scaling is used in App Engine + * Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). + * App Engine Flex does not support instances. For more information, see + * [App Engine Standard request + * routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) + * and [App Engine Flex request + * routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). + * @type string $host + * Output only. The host that the task is sent to. + * The host is constructed from the domain name of the app associated with + * the queue's project ID (for example .appspot.com), and the + * [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], + * [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance]. Tasks + * which were created using the App Engine SDK might have a custom domain + * name. + * For more information, see + * [How Requests are + * Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Target::initOnce(); + parent::__construct($data); + } + + /** + * App service. + * By default, the task is sent to the service which is the default + * service when the task is attempted. + * For some queues or tasks which were created using the App Engine + * Task Queue API, [host][google.cloud.tasks.v2beta3.AppEngineRouting.host] is + * not parsable into + * [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], + * [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance]. For + * example, some tasks which were created using the App Engine SDK use a + * custom domain name; custom domains are not parsed by Cloud Tasks. If + * [host][google.cloud.tasks.v2beta3.AppEngineRouting.host] is not parsable, + * then [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], + * [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance] are the + * empty string. + * + * Generated from protobuf field string service = 1; + * @return string + */ + public function getService() + { + return $this->service; + } + + /** + * App service. + * By default, the task is sent to the service which is the default + * service when the task is attempted. + * For some queues or tasks which were created using the App Engine + * Task Queue API, [host][google.cloud.tasks.v2beta3.AppEngineRouting.host] is + * not parsable into + * [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], + * [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance]. For + * example, some tasks which were created using the App Engine SDK use a + * custom domain name; custom domains are not parsed by Cloud Tasks. If + * [host][google.cloud.tasks.v2beta3.AppEngineRouting.host] is not parsable, + * then [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], + * [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance] are the + * empty string. + * + * Generated from protobuf field string service = 1; + * @param string $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkString($var, True); + $this->service = $var; + + return $this; + } + + /** + * App version. + * By default, the task is sent to the version which is the default + * version when the task is attempted. + * For some queues or tasks which were created using the App Engine + * Task Queue API, [host][google.cloud.tasks.v2beta3.AppEngineRouting.host] is + * not parsable into + * [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], + * [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance]. For + * example, some tasks which were created using the App Engine SDK use a + * custom domain name; custom domains are not parsed by Cloud Tasks. If + * [host][google.cloud.tasks.v2beta3.AppEngineRouting.host] is not parsable, + * then [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], + * [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance] are the + * empty string. + * + * Generated from protobuf field string version = 2; + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * App version. + * By default, the task is sent to the version which is the default + * version when the task is attempted. + * For some queues or tasks which were created using the App Engine + * Task Queue API, [host][google.cloud.tasks.v2beta3.AppEngineRouting.host] is + * not parsable into + * [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], + * [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance]. For + * example, some tasks which were created using the App Engine SDK use a + * custom domain name; custom domains are not parsed by Cloud Tasks. If + * [host][google.cloud.tasks.v2beta3.AppEngineRouting.host] is not parsable, + * then [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], + * [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance] are the + * empty string. + * + * Generated from protobuf field string version = 2; + * @param string $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkString($var, True); + $this->version = $var; + + return $this; + } + + /** + * App instance. + * By default, the task is sent to an instance which is available when + * the task is attempted. + * Requests can only be sent to a specific instance if + * [manual scaling is used in App Engine + * Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). + * App Engine Flex does not support instances. For more information, see + * [App Engine Standard request + * routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) + * and [App Engine Flex request + * routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). + * + * Generated from protobuf field string instance = 3; + * @return string + */ + public function getInstance() + { + return $this->instance; + } + + /** + * App instance. + * By default, the task is sent to an instance which is available when + * the task is attempted. + * Requests can only be sent to a specific instance if + * [manual scaling is used in App Engine + * Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). + * App Engine Flex does not support instances. For more information, see + * [App Engine Standard request + * routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) + * and [App Engine Flex request + * routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). + * + * Generated from protobuf field string instance = 3; + * @param string $var + * @return $this + */ + public function setInstance($var) + { + GPBUtil::checkString($var, True); + $this->instance = $var; + + return $this; + } + + /** + * Output only. The host that the task is sent to. + * The host is constructed from the domain name of the app associated with + * the queue's project ID (for example .appspot.com), and the + * [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], + * [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance]. Tasks + * which were created using the App Engine SDK might have a custom domain + * name. + * For more information, see + * [How Requests are + * Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). + * + * Generated from protobuf field string host = 4; + * @return string + */ + public function getHost() + { + return $this->host; + } + + /** + * Output only. The host that the task is sent to. + * The host is constructed from the domain name of the app associated with + * the queue's project ID (for example .appspot.com), and the + * [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], + * [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and + * [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance]. Tasks + * which were created using the App Engine SDK might have a custom domain + * name. + * For more information, see + * [How Requests are + * Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). + * + * Generated from protobuf field string host = 4; + * @param string $var + * @return $this + */ + public function setHost($var) + { + GPBUtil::checkString($var, True); + $this->host = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Attempt.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Attempt.php new file mode 100644 index 000000000000..e9dc7a0cad3a --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Attempt.php @@ -0,0 +1,229 @@ +google.cloud.tasks.v2beta3.Attempt + */ +class Attempt extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The time that this attempt was scheduled. + * `schedule_time` will be truncated to the nearest microsecond. + * + * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 1; + */ + protected $schedule_time = null; + /** + * Output only. The time that this attempt was dispatched. + * `dispatch_time` will be truncated to the nearest microsecond. + * + * Generated from protobuf field .google.protobuf.Timestamp dispatch_time = 2; + */ + protected $dispatch_time = null; + /** + * Output only. The time that this attempt response was received. + * `response_time` will be truncated to the nearest microsecond. + * + * Generated from protobuf field .google.protobuf.Timestamp response_time = 3; + */ + protected $response_time = null; + /** + * Output only. The response from the worker for this attempt. + * If `response_time` is unset, then the task has not been attempted or is + * currently running and the `response_status` field is meaningless. + * + * Generated from protobuf field .google.rpc.Status response_status = 4; + */ + protected $response_status = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $schedule_time + * Output only. The time that this attempt was scheduled. + * `schedule_time` will be truncated to the nearest microsecond. + * @type \Google\Protobuf\Timestamp $dispatch_time + * Output only. The time that this attempt was dispatched. + * `dispatch_time` will be truncated to the nearest microsecond. + * @type \Google\Protobuf\Timestamp $response_time + * Output only. The time that this attempt response was received. + * `response_time` will be truncated to the nearest microsecond. + * @type \Google\Rpc\Status $response_status + * Output only. The response from the worker for this attempt. + * If `response_time` is unset, then the task has not been attempted or is + * currently running and the `response_status` field is meaningless. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Task::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The time that this attempt was scheduled. + * `schedule_time` will be truncated to the nearest microsecond. + * + * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getScheduleTime() + { + return $this->schedule_time; + } + + public function hasScheduleTime() + { + return isset($this->schedule_time); + } + + public function clearScheduleTime() + { + unset($this->schedule_time); + } + + /** + * Output only. The time that this attempt was scheduled. + * `schedule_time` will be truncated to the nearest microsecond. + * + * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setScheduleTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->schedule_time = $var; + + return $this; + } + + /** + * Output only. The time that this attempt was dispatched. + * `dispatch_time` will be truncated to the nearest microsecond. + * + * Generated from protobuf field .google.protobuf.Timestamp dispatch_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDispatchTime() + { + return $this->dispatch_time; + } + + public function hasDispatchTime() + { + return isset($this->dispatch_time); + } + + public function clearDispatchTime() + { + unset($this->dispatch_time); + } + + /** + * Output only. The time that this attempt was dispatched. + * `dispatch_time` will be truncated to the nearest microsecond. + * + * Generated from protobuf field .google.protobuf.Timestamp dispatch_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDispatchTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->dispatch_time = $var; + + return $this; + } + + /** + * Output only. The time that this attempt response was received. + * `response_time` will be truncated to the nearest microsecond. + * + * Generated from protobuf field .google.protobuf.Timestamp response_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getResponseTime() + { + return $this->response_time; + } + + public function hasResponseTime() + { + return isset($this->response_time); + } + + public function clearResponseTime() + { + unset($this->response_time); + } + + /** + * Output only. The time that this attempt response was received. + * `response_time` will be truncated to the nearest microsecond. + * + * Generated from protobuf field .google.protobuf.Timestamp response_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setResponseTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->response_time = $var; + + return $this; + } + + /** + * Output only. The response from the worker for this attempt. + * If `response_time` is unset, then the task has not been attempted or is + * currently running and the `response_status` field is meaningless. + * + * Generated from protobuf field .google.rpc.Status response_status = 4; + * @return \Google\Rpc\Status|null + */ + public function getResponseStatus() + { + return $this->response_status; + } + + public function hasResponseStatus() + { + return isset($this->response_status); + } + + public function clearResponseStatus() + { + unset($this->response_status); + } + + /** + * Output only. The response from the worker for this attempt. + * If `response_time` is unset, then the task has not been attempted or is + * currently running and the `response_status` field is meaningless. + * + * Generated from protobuf field .google.rpc.Status response_status = 4; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setResponseStatus($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->response_status = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/CreateQueueRequest.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/CreateQueueRequest.php new file mode 100644 index 000000000000..55733073e210 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/CreateQueueRequest.php @@ -0,0 +1,136 @@ +google.cloud.tasks.v2beta3.CreateQueueRequest + */ +class CreateQueueRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The location name in which the queue will be created. + * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * The list of allowed locations can be obtained by calling Cloud + * Tasks' implementation of + * [ListLocations][google.cloud.location.Locations.ListLocations]. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The queue to create. + * [Queue's name][google.cloud.tasks.v2beta3.Queue.name] cannot be the same as + * an existing queue. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.Queue queue = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $queue = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The location name in which the queue will be created. + * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * The list of allowed locations can be obtained by calling Cloud + * Tasks' implementation of + * [ListLocations][google.cloud.location.Locations.ListLocations]. + * @type \Google\Cloud\Tasks\V2beta3\Queue $queue + * Required. The queue to create. + * [Queue's name][google.cloud.tasks.v2beta3.Queue.name] cannot be the same as + * an existing queue. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * Required. The location name in which the queue will be created. + * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * The list of allowed locations can be obtained by calling Cloud + * Tasks' implementation of + * [ListLocations][google.cloud.location.Locations.ListLocations]. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The location name in which the queue will be created. + * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * The list of allowed locations can be obtained by calling Cloud + * Tasks' implementation of + * [ListLocations][google.cloud.location.Locations.ListLocations]. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The queue to create. + * [Queue's name][google.cloud.tasks.v2beta3.Queue.name] cannot be the same as + * an existing queue. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.Queue queue = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Tasks\V2beta3\Queue|null + */ + public function getQueue() + { + return $this->queue; + } + + public function hasQueue() + { + return isset($this->queue); + } + + public function clearQueue() + { + unset($this->queue); + } + + /** + * Required. The queue to create. + * [Queue's name][google.cloud.tasks.v2beta3.Queue.name] cannot be the same as + * an existing queue. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.Queue queue = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Tasks\V2beta3\Queue $var + * @return $this + */ + public function setQueue($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\Queue::class); + $this->queue = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/CreateTaskRequest.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/CreateTaskRequest.php new file mode 100644 index 000000000000..2639a9271c86 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/CreateTaskRequest.php @@ -0,0 +1,302 @@ +google.cloud.tasks.v2beta3.CreateTaskRequest + */ +class CreateTaskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * The queue must already exist. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The task to add. + * Task names have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. + * The user can optionally specify a task + * [name][google.cloud.tasks.v2beta3.Task.name]. If a name is not specified + * then the system will generate a random unique task id, which will be set in + * the task returned in the [response][google.cloud.tasks.v2beta3.Task.name]. + * If [schedule_time][google.cloud.tasks.v2beta3.Task.schedule_time] is not + * set or is in the past then Cloud Tasks will set it to the current time. + * Task De-duplication: + * Explicitly specifying a task ID enables task de-duplication. If + * a task's ID is identical to that of an existing task or a task + * that was deleted or executed recently then the call will fail + * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. + * If the task's queue was created using Cloud Tasks, then another task with + * the same name can't be created for ~1 hour after the original task was + * deleted or executed. If the task's queue was created using queue.yaml or + * queue.xml, then another task with the same name can't be created + * for ~9 days after the original task was deleted or executed. + * Because there is an extra lookup cost to identify duplicate task + * names, these [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask] + * calls have significantly increased latency. Using hashed strings for the + * task id or for the prefix of the task id is recommended. Choosing task ids + * that are sequential or have sequential prefixes, for example using a + * timestamp, causes an increase in latency and error rates in all + * task commands. The infrastructure relies on an approximately + * uniform distribution of task ids to store and serve tasks + * efficiently. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.Task task = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $task = null; + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta3.Task] will be returned. + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta3.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.Task.View response_view = 3; + */ + protected $response_view = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * The queue must already exist. + * @type \Google\Cloud\Tasks\V2beta3\Task $task + * Required. The task to add. + * Task names have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. + * The user can optionally specify a task + * [name][google.cloud.tasks.v2beta3.Task.name]. If a name is not specified + * then the system will generate a random unique task id, which will be set in + * the task returned in the [response][google.cloud.tasks.v2beta3.Task.name]. + * If [schedule_time][google.cloud.tasks.v2beta3.Task.schedule_time] is not + * set or is in the past then Cloud Tasks will set it to the current time. + * Task De-duplication: + * Explicitly specifying a task ID enables task de-duplication. If + * a task's ID is identical to that of an existing task or a task + * that was deleted or executed recently then the call will fail + * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. + * If the task's queue was created using Cloud Tasks, then another task with + * the same name can't be created for ~1 hour after the original task was + * deleted or executed. If the task's queue was created using queue.yaml or + * queue.xml, then another task with the same name can't be created + * for ~9 days after the original task was deleted or executed. + * Because there is an extra lookup cost to identify duplicate task + * names, these [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask] + * calls have significantly increased latency. Using hashed strings for the + * task id or for the prefix of the task id is recommended. Choosing task ids + * that are sequential or have sequential prefixes, for example using a + * timestamp, causes an increase in latency and error rates in all + * task commands. The infrastructure relies on an approximately + * uniform distribution of task ids to store and serve tasks + * efficiently. + * @type int $response_view + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta3.Task] will be returned. + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta3.Task] resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * The queue must already exist. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * The queue must already exist. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The task to add. + * Task names have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. + * The user can optionally specify a task + * [name][google.cloud.tasks.v2beta3.Task.name]. If a name is not specified + * then the system will generate a random unique task id, which will be set in + * the task returned in the [response][google.cloud.tasks.v2beta3.Task.name]. + * If [schedule_time][google.cloud.tasks.v2beta3.Task.schedule_time] is not + * set or is in the past then Cloud Tasks will set it to the current time. + * Task De-duplication: + * Explicitly specifying a task ID enables task de-duplication. If + * a task's ID is identical to that of an existing task or a task + * that was deleted or executed recently then the call will fail + * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. + * If the task's queue was created using Cloud Tasks, then another task with + * the same name can't be created for ~1 hour after the original task was + * deleted or executed. If the task's queue was created using queue.yaml or + * queue.xml, then another task with the same name can't be created + * for ~9 days after the original task was deleted or executed. + * Because there is an extra lookup cost to identify duplicate task + * names, these [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask] + * calls have significantly increased latency. Using hashed strings for the + * task id or for the prefix of the task id is recommended. Choosing task ids + * that are sequential or have sequential prefixes, for example using a + * timestamp, causes an increase in latency and error rates in all + * task commands. The infrastructure relies on an approximately + * uniform distribution of task ids to store and serve tasks + * efficiently. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.Task task = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Tasks\V2beta3\Task|null + */ + public function getTask() + { + return $this->task; + } + + public function hasTask() + { + return isset($this->task); + } + + public function clearTask() + { + unset($this->task); + } + + /** + * Required. The task to add. + * Task names have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. + * The user can optionally specify a task + * [name][google.cloud.tasks.v2beta3.Task.name]. If a name is not specified + * then the system will generate a random unique task id, which will be set in + * the task returned in the [response][google.cloud.tasks.v2beta3.Task.name]. + * If [schedule_time][google.cloud.tasks.v2beta3.Task.schedule_time] is not + * set or is in the past then Cloud Tasks will set it to the current time. + * Task De-duplication: + * Explicitly specifying a task ID enables task de-duplication. If + * a task's ID is identical to that of an existing task or a task + * that was deleted or executed recently then the call will fail + * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. + * If the task's queue was created using Cloud Tasks, then another task with + * the same name can't be created for ~1 hour after the original task was + * deleted or executed. If the task's queue was created using queue.yaml or + * queue.xml, then another task with the same name can't be created + * for ~9 days after the original task was deleted or executed. + * Because there is an extra lookup cost to identify duplicate task + * names, these [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask] + * calls have significantly increased latency. Using hashed strings for the + * task id or for the prefix of the task id is recommended. Choosing task ids + * that are sequential or have sequential prefixes, for example using a + * timestamp, causes an increase in latency and error rates in all + * task commands. The infrastructure relies on an approximately + * uniform distribution of task ids to store and serve tasks + * efficiently. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.Task task = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Tasks\V2beta3\Task $var + * @return $this + */ + public function setTask($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\Task::class); + $this->task = $var; + + return $this; + } + + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta3.Task] will be returned. + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta3.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.Task.View response_view = 3; + * @return int + */ + public function getResponseView() + { + return $this->response_view; + } + + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta3.Task] will be returned. + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta3.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.Task.View response_view = 3; + * @param int $var + * @return $this + */ + public function setResponseView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta3\Task\View::class); + $this->response_view = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/DeleteQueueRequest.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/DeleteQueueRequest.php new file mode 100644 index 000000000000..0eebfa9c696d --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/DeleteQueueRequest.php @@ -0,0 +1,72 @@ +google.cloud.tasks.v2beta3.DeleteQueueRequest + */ +class DeleteQueueRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/DeleteTaskRequest.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/DeleteTaskRequest.php new file mode 100644 index 000000000000..d9576067cf94 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/DeleteTaskRequest.php @@ -0,0 +1,72 @@ +google.cloud.tasks.v2beta3.DeleteTaskRequest + */ +class DeleteTaskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/GetQueueRequest.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/GetQueueRequest.php new file mode 100644 index 000000000000..2d6609e8a7f1 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/GetQueueRequest.php @@ -0,0 +1,128 @@ +google.cloud.tasks.v2beta3.GetQueueRequest + */ +class GetQueueRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the queue. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. Read mask is used for a more granular control over what the API + * returns. If the mask is not present all fields will be returned except + * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly + * specified in the mask. + * + * Generated from protobuf field .google.protobuf.FieldMask read_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $read_mask = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the queue. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * @type \Google\Protobuf\FieldMask $read_mask + * Optional. Read mask is used for a more granular control over what the API + * returns. If the mask is not present all fields will be returned except + * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly + * specified in the mask. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the queue. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the queue. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. Read mask is used for a more granular control over what the API + * returns. If the mask is not present all fields will be returned except + * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly + * specified in the mask. + * + * Generated from protobuf field .google.protobuf.FieldMask read_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getReadMask() + { + return $this->read_mask; + } + + public function hasReadMask() + { + return isset($this->read_mask); + } + + public function clearReadMask() + { + unset($this->read_mask); + } + + /** + * Optional. Read mask is used for a more granular control over what the API + * returns. If the mask is not present all fields will be returned except + * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly + * specified in the mask. + * + * Generated from protobuf field .google.protobuf.FieldMask read_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setReadMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->read_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/GetTaskRequest.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/GetTaskRequest.php new file mode 100644 index 000000000000..1f16efccdc25 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/GetTaskRequest.php @@ -0,0 +1,146 @@ +google.cloud.tasks.v2beta3.GetTaskRequest + */ +class GetTaskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta3.Task] will be returned. + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta3.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.Task.View response_view = 2; + */ + protected $response_view = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * @type int $response_view + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta3.Task] will be returned. + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta3.Task] resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta3.Task] will be returned. + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta3.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.Task.View response_view = 2; + * @return int + */ + public function getResponseView() + { + return $this->response_view; + } + + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta3.Task] will be returned. + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta3.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.Task.View response_view = 2; + * @param int $var + * @return $this + */ + public function setResponseView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta3\Task\View::class); + $this->response_view = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/HttpMethod.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/HttpMethod.php new file mode 100644 index 000000000000..0c8164234fca --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/HttpMethod.php @@ -0,0 +1,96 @@ +google.cloud.tasks.v2beta3.HttpMethod + */ +class HttpMethod +{ + /** + * HTTP method unspecified + * + * Generated from protobuf enum HTTP_METHOD_UNSPECIFIED = 0; + */ + const HTTP_METHOD_UNSPECIFIED = 0; + /** + * HTTP POST + * + * Generated from protobuf enum POST = 1; + */ + const POST = 1; + /** + * HTTP GET + * + * Generated from protobuf enum GET = 2; + */ + const GET = 2; + /** + * HTTP HEAD + * + * Generated from protobuf enum HEAD = 3; + */ + const HEAD = 3; + /** + * HTTP PUT + * + * Generated from protobuf enum PUT = 4; + */ + const PUT = 4; + /** + * HTTP DELETE + * + * Generated from protobuf enum DELETE = 5; + */ + const DELETE = 5; + /** + * HTTP PATCH + * + * Generated from protobuf enum PATCH = 6; + */ + const PATCH = 6; + /** + * HTTP OPTIONS + * + * Generated from protobuf enum OPTIONS = 7; + */ + const OPTIONS = 7; + + private static $valueToName = [ + self::HTTP_METHOD_UNSPECIFIED => 'HTTP_METHOD_UNSPECIFIED', + self::POST => 'POST', + self::GET => 'GET', + self::HEAD => 'HEAD', + self::PUT => 'PUT', + self::DELETE => 'DELETE', + self::PATCH => 'PATCH', + self::OPTIONS => 'OPTIONS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/HttpRequest.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/HttpRequest.php new file mode 100644 index 000000000000..2177366bab53 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/HttpRequest.php @@ -0,0 +1,433 @@ +google.cloud.tasks.v2beta3.HttpRequest + */ +class HttpRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The full url path that the request will be sent to. + * This string must begin with either "http://" or "https://". Some examples + * are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will + * encode some characters for safety and compatibility. The maximum allowed + * URL length is 2083 characters after encoding. + * The `Location` header response from a redirect response [`300` - `399`] + * may be followed. The redirect is not counted as a separate attempt. + * + * Generated from protobuf field string url = 1; + */ + protected $url = ''; + /** + * The HTTP method to use for the request. The default is POST. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.HttpMethod http_method = 2; + */ + protected $http_method = 0; + /** + * HTTP request headers. + * This map contains the header field names and values. + * Headers can be set when the + * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. + * These headers represent a subset of the headers that will accompany the + * task's HTTP request. Some HTTP request headers will be ignored or replaced. + * A partial list of headers that will be ignored or replaced is: + * * Any header that is prefixed with "X-CloudTasks-" will be treated + * as service header. Service headers define properties of the task and are + * predefined in CloudTask. + * * Host: This will be computed by Cloud Tasks and derived from + * [HttpRequest.url][google.cloud.tasks.v2beta3.HttpRequest.url]. + * * Content-Length: This will be computed by Cloud Tasks. + * * User-Agent: This will be set to `"Google-Cloud-Tasks"`. + * * `X-Google-*`: Google use only. + * * `X-AppEngine-*`: Google use only. + * `Content-Type` won't be set by Cloud Tasks. You can explicitly set + * `Content-Type` to a media type when the + * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. + * For example, `Content-Type` can be set to `"application/octet-stream"` or + * `"application/json"`. + * Headers which can have multiple values (according to RFC2616) can be + * specified using comma-separated values. + * The size of the headers must be less than 80KB. + * + * Generated from protobuf field map headers = 3; + */ + private $headers; + /** + * HTTP request body. + * A request body is allowed only if the + * [HTTP method][google.cloud.tasks.v2beta3.HttpRequest.http_method] is POST, + * PUT, or PATCH. It is an error to set body on a task with an incompatible + * [HttpMethod][google.cloud.tasks.v2beta3.HttpMethod]. + * + * Generated from protobuf field bytes body = 4; + */ + protected $body = ''; + protected $authorization_header; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $url + * Required. The full url path that the request will be sent to. + * This string must begin with either "http://" or "https://". Some examples + * are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will + * encode some characters for safety and compatibility. The maximum allowed + * URL length is 2083 characters after encoding. + * The `Location` header response from a redirect response [`300` - `399`] + * may be followed. The redirect is not counted as a separate attempt. + * @type int $http_method + * The HTTP method to use for the request. The default is POST. + * @type array|\Google\Protobuf\Internal\MapField $headers + * HTTP request headers. + * This map contains the header field names and values. + * Headers can be set when the + * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. + * These headers represent a subset of the headers that will accompany the + * task's HTTP request. Some HTTP request headers will be ignored or replaced. + * A partial list of headers that will be ignored or replaced is: + * * Any header that is prefixed with "X-CloudTasks-" will be treated + * as service header. Service headers define properties of the task and are + * predefined in CloudTask. + * * Host: This will be computed by Cloud Tasks and derived from + * [HttpRequest.url][google.cloud.tasks.v2beta3.HttpRequest.url]. + * * Content-Length: This will be computed by Cloud Tasks. + * * User-Agent: This will be set to `"Google-Cloud-Tasks"`. + * * `X-Google-*`: Google use only. + * * `X-AppEngine-*`: Google use only. + * `Content-Type` won't be set by Cloud Tasks. You can explicitly set + * `Content-Type` to a media type when the + * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. + * For example, `Content-Type` can be set to `"application/octet-stream"` or + * `"application/json"`. + * Headers which can have multiple values (according to RFC2616) can be + * specified using comma-separated values. + * The size of the headers must be less than 80KB. + * @type string $body + * HTTP request body. + * A request body is allowed only if the + * [HTTP method][google.cloud.tasks.v2beta3.HttpRequest.http_method] is POST, + * PUT, or PATCH. It is an error to set body on a task with an incompatible + * [HttpMethod][google.cloud.tasks.v2beta3.HttpMethod]. + * @type \Google\Cloud\Tasks\V2beta3\OAuthToken $oauth_token + * If specified, an + * [OAuth token](https://developers.google.com/identity/protocols/OAuth2) + * will be generated and attached as an `Authorization` header in the HTTP + * request. + * This type of authorization should generally only be used when calling + * Google APIs hosted on *.googleapis.com. + * @type \Google\Cloud\Tasks\V2beta3\OidcToken $oidc_token + * If specified, an + * [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) + * token will be generated and attached as an `Authorization` header in the + * HTTP request. + * This type of authorization can be used for many scenarios, including + * calling Cloud Run, or endpoints where you intend to validate the token + * yourself. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Target::initOnce(); + parent::__construct($data); + } + + /** + * Required. The full url path that the request will be sent to. + * This string must begin with either "http://" or "https://". Some examples + * are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will + * encode some characters for safety and compatibility. The maximum allowed + * URL length is 2083 characters after encoding. + * The `Location` header response from a redirect response [`300` - `399`] + * may be followed. The redirect is not counted as a separate attempt. + * + * Generated from protobuf field string url = 1; + * @return string + */ + public function getUrl() + { + return $this->url; + } + + /** + * Required. The full url path that the request will be sent to. + * This string must begin with either "http://" or "https://". Some examples + * are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will + * encode some characters for safety and compatibility. The maximum allowed + * URL length is 2083 characters after encoding. + * The `Location` header response from a redirect response [`300` - `399`] + * may be followed. The redirect is not counted as a separate attempt. + * + * Generated from protobuf field string url = 1; + * @param string $var + * @return $this + */ + public function setUrl($var) + { + GPBUtil::checkString($var, True); + $this->url = $var; + + return $this; + } + + /** + * The HTTP method to use for the request. The default is POST. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.HttpMethod http_method = 2; + * @return int + */ + public function getHttpMethod() + { + return $this->http_method; + } + + /** + * The HTTP method to use for the request. The default is POST. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.HttpMethod http_method = 2; + * @param int $var + * @return $this + */ + public function setHttpMethod($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta3\HttpMethod::class); + $this->http_method = $var; + + return $this; + } + + /** + * HTTP request headers. + * This map contains the header field names and values. + * Headers can be set when the + * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. + * These headers represent a subset of the headers that will accompany the + * task's HTTP request. Some HTTP request headers will be ignored or replaced. + * A partial list of headers that will be ignored or replaced is: + * * Any header that is prefixed with "X-CloudTasks-" will be treated + * as service header. Service headers define properties of the task and are + * predefined in CloudTask. + * * Host: This will be computed by Cloud Tasks and derived from + * [HttpRequest.url][google.cloud.tasks.v2beta3.HttpRequest.url]. + * * Content-Length: This will be computed by Cloud Tasks. + * * User-Agent: This will be set to `"Google-Cloud-Tasks"`. + * * `X-Google-*`: Google use only. + * * `X-AppEngine-*`: Google use only. + * `Content-Type` won't be set by Cloud Tasks. You can explicitly set + * `Content-Type` to a media type when the + * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. + * For example, `Content-Type` can be set to `"application/octet-stream"` or + * `"application/json"`. + * Headers which can have multiple values (according to RFC2616) can be + * specified using comma-separated values. + * The size of the headers must be less than 80KB. + * + * Generated from protobuf field map headers = 3; + * @return \Google\Protobuf\Internal\MapField + */ + public function getHeaders() + { + return $this->headers; + } + + /** + * HTTP request headers. + * This map contains the header field names and values. + * Headers can be set when the + * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. + * These headers represent a subset of the headers that will accompany the + * task's HTTP request. Some HTTP request headers will be ignored or replaced. + * A partial list of headers that will be ignored or replaced is: + * * Any header that is prefixed with "X-CloudTasks-" will be treated + * as service header. Service headers define properties of the task and are + * predefined in CloudTask. + * * Host: This will be computed by Cloud Tasks and derived from + * [HttpRequest.url][google.cloud.tasks.v2beta3.HttpRequest.url]. + * * Content-Length: This will be computed by Cloud Tasks. + * * User-Agent: This will be set to `"Google-Cloud-Tasks"`. + * * `X-Google-*`: Google use only. + * * `X-AppEngine-*`: Google use only. + * `Content-Type` won't be set by Cloud Tasks. You can explicitly set + * `Content-Type` to a media type when the + * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. + * For example, `Content-Type` can be set to `"application/octet-stream"` or + * `"application/json"`. + * Headers which can have multiple values (according to RFC2616) can be + * specified using comma-separated values. + * The size of the headers must be less than 80KB. + * + * Generated from protobuf field map headers = 3; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setHeaders($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->headers = $arr; + + return $this; + } + + /** + * HTTP request body. + * A request body is allowed only if the + * [HTTP method][google.cloud.tasks.v2beta3.HttpRequest.http_method] is POST, + * PUT, or PATCH. It is an error to set body on a task with an incompatible + * [HttpMethod][google.cloud.tasks.v2beta3.HttpMethod]. + * + * Generated from protobuf field bytes body = 4; + * @return string + */ + public function getBody() + { + return $this->body; + } + + /** + * HTTP request body. + * A request body is allowed only if the + * [HTTP method][google.cloud.tasks.v2beta3.HttpRequest.http_method] is POST, + * PUT, or PATCH. It is an error to set body on a task with an incompatible + * [HttpMethod][google.cloud.tasks.v2beta3.HttpMethod]. + * + * Generated from protobuf field bytes body = 4; + * @param string $var + * @return $this + */ + public function setBody($var) + { + GPBUtil::checkString($var, False); + $this->body = $var; + + return $this; + } + + /** + * If specified, an + * [OAuth token](https://developers.google.com/identity/protocols/OAuth2) + * will be generated and attached as an `Authorization` header in the HTTP + * request. + * This type of authorization should generally only be used when calling + * Google APIs hosted on *.googleapis.com. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.OAuthToken oauth_token = 5; + * @return \Google\Cloud\Tasks\V2beta3\OAuthToken|null + */ + public function getOauthToken() + { + return $this->readOneof(5); + } + + public function hasOauthToken() + { + return $this->hasOneof(5); + } + + /** + * If specified, an + * [OAuth token](https://developers.google.com/identity/protocols/OAuth2) + * will be generated and attached as an `Authorization` header in the HTTP + * request. + * This type of authorization should generally only be used when calling + * Google APIs hosted on *.googleapis.com. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.OAuthToken oauth_token = 5; + * @param \Google\Cloud\Tasks\V2beta3\OAuthToken $var + * @return $this + */ + public function setOauthToken($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\OAuthToken::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * If specified, an + * [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) + * token will be generated and attached as an `Authorization` header in the + * HTTP request. + * This type of authorization can be used for many scenarios, including + * calling Cloud Run, or endpoints where you intend to validate the token + * yourself. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.OidcToken oidc_token = 6; + * @return \Google\Cloud\Tasks\V2beta3\OidcToken|null + */ + public function getOidcToken() + { + return $this->readOneof(6); + } + + public function hasOidcToken() + { + return $this->hasOneof(6); + } + + /** + * If specified, an + * [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) + * token will be generated and attached as an `Authorization` header in the + * HTTP request. + * This type of authorization can be used for many scenarios, including + * calling Cloud Run, or endpoints where you intend to validate the token + * yourself. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.OidcToken oidc_token = 6; + * @param \Google\Cloud\Tasks\V2beta3\OidcToken $var + * @return $this + */ + public function setOidcToken($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\OidcToken::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * @return string + */ + public function getAuthorizationHeader() + { + return $this->whichOneof("authorization_header"); + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/HttpTarget.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/HttpTarget.php new file mode 100644 index 000000000000..4f15822f4ebc --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/HttpTarget.php @@ -0,0 +1,367 @@ +google.cloud.tasks.v2beta3.HttpTarget + */ +class HttpTarget extends \Google\Protobuf\Internal\Message +{ + /** + * URI override. + * When specified, overrides the execution URI for all the tasks in the queue. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.UriOverride uri_override = 1; + */ + protected $uri_override = null; + /** + * The HTTP method to use for the request. + * When specified, it overrides + * [HttpRequest][google.cloud.tasks.v2beta3.HttpTarget.http_method] for the + * task. Note that if the value is set to [HttpMethod][GET] the + * [HttpRequest][body] of the task will be ignored at execution time. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.HttpMethod http_method = 2; + */ + protected $http_method = 0; + /** + * HTTP target headers. + * This map contains the header field names and values. + * Headers will be set when running the + * [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask] and/or + * [BufferTask][google.cloud.tasks.v2beta3.CloudTasks.BufferTask]. + * These headers represent a subset of the headers that will be configured for + * the task's HTTP request. Some HTTP request headers will be ignored or + * replaced. + * A partial list of headers that will be ignored or replaced is: + * * Several predefined headers, prefixed with "X-CloudTasks-", can + * be used to define properties of the task. + * * Host: This will be computed by Cloud Tasks and derived from + * [HttpRequest.url][google.cloud.tasks.v2beta3.Target.HttpRequest.url]. + * * Content-Length: This will be computed by Cloud Tasks. + * `Content-Type` won't be set by Cloud Tasks. You can explicitly set + * `Content-Type` to a media type when the + * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. + * For example,`Content-Type` can be set to `"application/octet-stream"` or + * `"application/json"`. The default value is set to `"application/json"`. + * * User-Agent: This will be set to `"Google-Cloud-Tasks"`. + * Headers which can have multiple values (according to RFC2616) can be + * specified using comma-separated values. + * The size of the headers must be less than 80KB. + * Queue-level headers to override headers of all the tasks in the queue. + * + * Generated from protobuf field repeated .google.cloud.tasks.v2beta3.HttpTarget.HeaderOverride header_overrides = 3; + */ + private $header_overrides; + protected $authorization_header; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Tasks\V2beta3\UriOverride $uri_override + * URI override. + * When specified, overrides the execution URI for all the tasks in the queue. + * @type int $http_method + * The HTTP method to use for the request. + * When specified, it overrides + * [HttpRequest][google.cloud.tasks.v2beta3.HttpTarget.http_method] for the + * task. Note that if the value is set to [HttpMethod][GET] the + * [HttpRequest][body] of the task will be ignored at execution time. + * @type array<\Google\Cloud\Tasks\V2beta3\HttpTarget\HeaderOverride>|\Google\Protobuf\Internal\RepeatedField $header_overrides + * HTTP target headers. + * This map contains the header field names and values. + * Headers will be set when running the + * [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask] and/or + * [BufferTask][google.cloud.tasks.v2beta3.CloudTasks.BufferTask]. + * These headers represent a subset of the headers that will be configured for + * the task's HTTP request. Some HTTP request headers will be ignored or + * replaced. + * A partial list of headers that will be ignored or replaced is: + * * Several predefined headers, prefixed with "X-CloudTasks-", can + * be used to define properties of the task. + * * Host: This will be computed by Cloud Tasks and derived from + * [HttpRequest.url][google.cloud.tasks.v2beta3.Target.HttpRequest.url]. + * * Content-Length: This will be computed by Cloud Tasks. + * `Content-Type` won't be set by Cloud Tasks. You can explicitly set + * `Content-Type` to a media type when the + * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. + * For example,`Content-Type` can be set to `"application/octet-stream"` or + * `"application/json"`. The default value is set to `"application/json"`. + * * User-Agent: This will be set to `"Google-Cloud-Tasks"`. + * Headers which can have multiple values (according to RFC2616) can be + * specified using comma-separated values. + * The size of the headers must be less than 80KB. + * Queue-level headers to override headers of all the tasks in the queue. + * @type \Google\Cloud\Tasks\V2beta3\OAuthToken $oauth_token + * If specified, an + * [OAuth token](https://developers.google.com/identity/protocols/OAuth2) + * will be generated and attached as the `Authorization` header in the HTTP + * request. + * This type of authorization should generally only be used when calling + * Google APIs hosted on *.googleapis.com. + * @type \Google\Cloud\Tasks\V2beta3\OidcToken $oidc_token + * If specified, an + * [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) + * token will be generated and attached as an `Authorization` header in the + * HTTP request. + * This type of authorization can be used for many scenarios, including + * calling Cloud Run, or endpoints where you intend to validate the token + * yourself. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Target::initOnce(); + parent::__construct($data); + } + + /** + * URI override. + * When specified, overrides the execution URI for all the tasks in the queue. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.UriOverride uri_override = 1; + * @return \Google\Cloud\Tasks\V2beta3\UriOverride|null + */ + public function getUriOverride() + { + return $this->uri_override; + } + + public function hasUriOverride() + { + return isset($this->uri_override); + } + + public function clearUriOverride() + { + unset($this->uri_override); + } + + /** + * URI override. + * When specified, overrides the execution URI for all the tasks in the queue. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.UriOverride uri_override = 1; + * @param \Google\Cloud\Tasks\V2beta3\UriOverride $var + * @return $this + */ + public function setUriOverride($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\UriOverride::class); + $this->uri_override = $var; + + return $this; + } + + /** + * The HTTP method to use for the request. + * When specified, it overrides + * [HttpRequest][google.cloud.tasks.v2beta3.HttpTarget.http_method] for the + * task. Note that if the value is set to [HttpMethod][GET] the + * [HttpRequest][body] of the task will be ignored at execution time. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.HttpMethod http_method = 2; + * @return int + */ + public function getHttpMethod() + { + return $this->http_method; + } + + /** + * The HTTP method to use for the request. + * When specified, it overrides + * [HttpRequest][google.cloud.tasks.v2beta3.HttpTarget.http_method] for the + * task. Note that if the value is set to [HttpMethod][GET] the + * [HttpRequest][body] of the task will be ignored at execution time. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.HttpMethod http_method = 2; + * @param int $var + * @return $this + */ + public function setHttpMethod($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta3\HttpMethod::class); + $this->http_method = $var; + + return $this; + } + + /** + * HTTP target headers. + * This map contains the header field names and values. + * Headers will be set when running the + * [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask] and/or + * [BufferTask][google.cloud.tasks.v2beta3.CloudTasks.BufferTask]. + * These headers represent a subset of the headers that will be configured for + * the task's HTTP request. Some HTTP request headers will be ignored or + * replaced. + * A partial list of headers that will be ignored or replaced is: + * * Several predefined headers, prefixed with "X-CloudTasks-", can + * be used to define properties of the task. + * * Host: This will be computed by Cloud Tasks and derived from + * [HttpRequest.url][google.cloud.tasks.v2beta3.Target.HttpRequest.url]. + * * Content-Length: This will be computed by Cloud Tasks. + * `Content-Type` won't be set by Cloud Tasks. You can explicitly set + * `Content-Type` to a media type when the + * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. + * For example,`Content-Type` can be set to `"application/octet-stream"` or + * `"application/json"`. The default value is set to `"application/json"`. + * * User-Agent: This will be set to `"Google-Cloud-Tasks"`. + * Headers which can have multiple values (according to RFC2616) can be + * specified using comma-separated values. + * The size of the headers must be less than 80KB. + * Queue-level headers to override headers of all the tasks in the queue. + * + * Generated from protobuf field repeated .google.cloud.tasks.v2beta3.HttpTarget.HeaderOverride header_overrides = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getHeaderOverrides() + { + return $this->header_overrides; + } + + /** + * HTTP target headers. + * This map contains the header field names and values. + * Headers will be set when running the + * [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask] and/or + * [BufferTask][google.cloud.tasks.v2beta3.CloudTasks.BufferTask]. + * These headers represent a subset of the headers that will be configured for + * the task's HTTP request. Some HTTP request headers will be ignored or + * replaced. + * A partial list of headers that will be ignored or replaced is: + * * Several predefined headers, prefixed with "X-CloudTasks-", can + * be used to define properties of the task. + * * Host: This will be computed by Cloud Tasks and derived from + * [HttpRequest.url][google.cloud.tasks.v2beta3.Target.HttpRequest.url]. + * * Content-Length: This will be computed by Cloud Tasks. + * `Content-Type` won't be set by Cloud Tasks. You can explicitly set + * `Content-Type` to a media type when the + * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. + * For example,`Content-Type` can be set to `"application/octet-stream"` or + * `"application/json"`. The default value is set to `"application/json"`. + * * User-Agent: This will be set to `"Google-Cloud-Tasks"`. + * Headers which can have multiple values (according to RFC2616) can be + * specified using comma-separated values. + * The size of the headers must be less than 80KB. + * Queue-level headers to override headers of all the tasks in the queue. + * + * Generated from protobuf field repeated .google.cloud.tasks.v2beta3.HttpTarget.HeaderOverride header_overrides = 3; + * @param array<\Google\Cloud\Tasks\V2beta3\HttpTarget\HeaderOverride>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setHeaderOverrides($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Tasks\V2beta3\HttpTarget\HeaderOverride::class); + $this->header_overrides = $arr; + + return $this; + } + + /** + * If specified, an + * [OAuth token](https://developers.google.com/identity/protocols/OAuth2) + * will be generated and attached as the `Authorization` header in the HTTP + * request. + * This type of authorization should generally only be used when calling + * Google APIs hosted on *.googleapis.com. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.OAuthToken oauth_token = 5; + * @return \Google\Cloud\Tasks\V2beta3\OAuthToken|null + */ + public function getOauthToken() + { + return $this->readOneof(5); + } + + public function hasOauthToken() + { + return $this->hasOneof(5); + } + + /** + * If specified, an + * [OAuth token](https://developers.google.com/identity/protocols/OAuth2) + * will be generated and attached as the `Authorization` header in the HTTP + * request. + * This type of authorization should generally only be used when calling + * Google APIs hosted on *.googleapis.com. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.OAuthToken oauth_token = 5; + * @param \Google\Cloud\Tasks\V2beta3\OAuthToken $var + * @return $this + */ + public function setOauthToken($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\OAuthToken::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * If specified, an + * [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) + * token will be generated and attached as an `Authorization` header in the + * HTTP request. + * This type of authorization can be used for many scenarios, including + * calling Cloud Run, or endpoints where you intend to validate the token + * yourself. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.OidcToken oidc_token = 6; + * @return \Google\Cloud\Tasks\V2beta3\OidcToken|null + */ + public function getOidcToken() + { + return $this->readOneof(6); + } + + public function hasOidcToken() + { + return $this->hasOneof(6); + } + + /** + * If specified, an + * [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) + * token will be generated and attached as an `Authorization` header in the + * HTTP request. + * This type of authorization can be used for many scenarios, including + * calling Cloud Run, or endpoints where you intend to validate the token + * yourself. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.OidcToken oidc_token = 6; + * @param \Google\Cloud\Tasks\V2beta3\OidcToken $var + * @return $this + */ + public function setOidcToken($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\OidcToken::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * @return string + */ + public function getAuthorizationHeader() + { + return $this->whichOneof("authorization_header"); + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/HttpTarget/Header.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/HttpTarget/Header.php new file mode 100644 index 000000000000..ad3499f31d87 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/HttpTarget/Header.php @@ -0,0 +1,104 @@ +google.cloud.tasks.v2beta3.HttpTarget.Header + */ +class Header extends \Google\Protobuf\Internal\Message +{ + /** + * The Key of the header. + * + * Generated from protobuf field string key = 1; + */ + protected $key = ''; + /** + * The Value of the header. + * + * Generated from protobuf field string value = 2; + */ + protected $value = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $key + * The Key of the header. + * @type string $value + * The Value of the header. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Target::initOnce(); + parent::__construct($data); + } + + /** + * The Key of the header. + * + * Generated from protobuf field string key = 1; + * @return string + */ + public function getKey() + { + return $this->key; + } + + /** + * The Key of the header. + * + * Generated from protobuf field string key = 1; + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, True); + $this->key = $var; + + return $this; + } + + /** + * The Value of the header. + * + * Generated from protobuf field string value = 2; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * The Value of the header. + * + * Generated from protobuf field string value = 2; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Header::class, \Google\Cloud\Tasks\V2beta3\HttpTarget_Header::class); + diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/HttpTarget/HeaderOverride.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/HttpTarget/HeaderOverride.php new file mode 100644 index 000000000000..4f9f1eea5497 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/HttpTarget/HeaderOverride.php @@ -0,0 +1,80 @@ +google.cloud.tasks.v2beta3.HttpTarget.HeaderOverride + */ +class HeaderOverride extends \Google\Protobuf\Internal\Message +{ + /** + * header embodying a key and a value. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.HttpTarget.Header header = 1; + */ + protected $header = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Tasks\V2beta3\HttpTarget\Header $header + * header embodying a key and a value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Target::initOnce(); + parent::__construct($data); + } + + /** + * header embodying a key and a value. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.HttpTarget.Header header = 1; + * @return \Google\Cloud\Tasks\V2beta3\HttpTarget\Header|null + */ + public function getHeader() + { + return $this->header; + } + + public function hasHeader() + { + return isset($this->header); + } + + public function clearHeader() + { + unset($this->header); + } + + /** + * header embodying a key and a value. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.HttpTarget.Header header = 1; + * @param \Google\Cloud\Tasks\V2beta3\HttpTarget\Header $var + * @return $this + */ + public function setHeader($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\HttpTarget\Header::class); + $this->header = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(HeaderOverride::class, \Google\Cloud\Tasks\V2beta3\HttpTarget_HeaderOverride::class); + diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ListQueuesRequest.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ListQueuesRequest.php new file mode 100644 index 000000000000..4bd825aa7a6d --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ListQueuesRequest.php @@ -0,0 +1,310 @@ +google.cloud.tasks.v2beta3.ListQueuesRequest + */ +class ListQueuesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The location name. + * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * `filter` can be used to specify a subset of queues. Any + * [Queue][google.cloud.tasks.v2beta3.Queue] field can be used as a filter and + * several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The + * filter syntax is the same as described in [Stackdriver's Advanced Logs + * Filters](https://cloud.google.com/logging/docs/view/advanced_filters). + * Sample filter "state: PAUSED". + * Note that using filters might cause fewer queues than the + * requested page_size to be returned. + * + * Generated from protobuf field string filter = 2; + */ + protected $filter = ''; + /** + * Requested page size. + * The maximum page size is 9800. If unspecified, the page size will + * be the maximum. Fewer queues than requested might be returned, + * even if more queues exist; use the + * [next_page_token][google.cloud.tasks.v2beta3.ListQueuesResponse.next_page_token] + * in the response to determine if more queues exist. + * + * Generated from protobuf field int32 page_size = 3; + */ + protected $page_size = 0; + /** + * A token identifying the page of results to return. + * To request the first page results, page_token must be empty. To + * request the next page of results, page_token must be the value of + * [next_page_token][google.cloud.tasks.v2beta3.ListQueuesResponse.next_page_token] + * returned from the previous call to + * [ListQueues][google.cloud.tasks.v2beta3.CloudTasks.ListQueues] method. It + * is an error to switch the value of the + * [filter][google.cloud.tasks.v2beta3.ListQueuesRequest.filter] while + * iterating through pages. + * + * Generated from protobuf field string page_token = 4; + */ + protected $page_token = ''; + /** + * Optional. Read mask is used for a more granular control over what the API + * returns. If the mask is not present all fields will be returned except + * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly + * specified in the mask. + * + * Generated from protobuf field .google.protobuf.FieldMask read_mask = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $read_mask = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The location name. + * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * @type string $filter + * `filter` can be used to specify a subset of queues. Any + * [Queue][google.cloud.tasks.v2beta3.Queue] field can be used as a filter and + * several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The + * filter syntax is the same as described in [Stackdriver's Advanced Logs + * Filters](https://cloud.google.com/logging/docs/view/advanced_filters). + * Sample filter "state: PAUSED". + * Note that using filters might cause fewer queues than the + * requested page_size to be returned. + * @type int $page_size + * Requested page size. + * The maximum page size is 9800. If unspecified, the page size will + * be the maximum. Fewer queues than requested might be returned, + * even if more queues exist; use the + * [next_page_token][google.cloud.tasks.v2beta3.ListQueuesResponse.next_page_token] + * in the response to determine if more queues exist. + * @type string $page_token + * A token identifying the page of results to return. + * To request the first page results, page_token must be empty. To + * request the next page of results, page_token must be the value of + * [next_page_token][google.cloud.tasks.v2beta3.ListQueuesResponse.next_page_token] + * returned from the previous call to + * [ListQueues][google.cloud.tasks.v2beta3.CloudTasks.ListQueues] method. It + * is an error to switch the value of the + * [filter][google.cloud.tasks.v2beta3.ListQueuesRequest.filter] while + * iterating through pages. + * @type \Google\Protobuf\FieldMask $read_mask + * Optional. Read mask is used for a more granular control over what the API + * returns. If the mask is not present all fields will be returned except + * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly + * specified in the mask. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * Required. The location name. + * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The location name. + * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * `filter` can be used to specify a subset of queues. Any + * [Queue][google.cloud.tasks.v2beta3.Queue] field can be used as a filter and + * several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The + * filter syntax is the same as described in [Stackdriver's Advanced Logs + * Filters](https://cloud.google.com/logging/docs/view/advanced_filters). + * Sample filter "state: PAUSED". + * Note that using filters might cause fewer queues than the + * requested page_size to be returned. + * + * Generated from protobuf field string filter = 2; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * `filter` can be used to specify a subset of queues. Any + * [Queue][google.cloud.tasks.v2beta3.Queue] field can be used as a filter and + * several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The + * filter syntax is the same as described in [Stackdriver's Advanced Logs + * Filters](https://cloud.google.com/logging/docs/view/advanced_filters). + * Sample filter "state: PAUSED". + * Note that using filters might cause fewer queues than the + * requested page_size to be returned. + * + * Generated from protobuf field string filter = 2; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Requested page size. + * The maximum page size is 9800. If unspecified, the page size will + * be the maximum. Fewer queues than requested might be returned, + * even if more queues exist; use the + * [next_page_token][google.cloud.tasks.v2beta3.ListQueuesResponse.next_page_token] + * in the response to determine if more queues exist. + * + * Generated from protobuf field int32 page_size = 3; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Requested page size. + * The maximum page size is 9800. If unspecified, the page size will + * be the maximum. Fewer queues than requested might be returned, + * even if more queues exist; use the + * [next_page_token][google.cloud.tasks.v2beta3.ListQueuesResponse.next_page_token] + * in the response to determine if more queues exist. + * + * Generated from protobuf field int32 page_size = 3; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A token identifying the page of results to return. + * To request the first page results, page_token must be empty. To + * request the next page of results, page_token must be the value of + * [next_page_token][google.cloud.tasks.v2beta3.ListQueuesResponse.next_page_token] + * returned from the previous call to + * [ListQueues][google.cloud.tasks.v2beta3.CloudTasks.ListQueues] method. It + * is an error to switch the value of the + * [filter][google.cloud.tasks.v2beta3.ListQueuesRequest.filter] while + * iterating through pages. + * + * Generated from protobuf field string page_token = 4; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A token identifying the page of results to return. + * To request the first page results, page_token must be empty. To + * request the next page of results, page_token must be the value of + * [next_page_token][google.cloud.tasks.v2beta3.ListQueuesResponse.next_page_token] + * returned from the previous call to + * [ListQueues][google.cloud.tasks.v2beta3.CloudTasks.ListQueues] method. It + * is an error to switch the value of the + * [filter][google.cloud.tasks.v2beta3.ListQueuesRequest.filter] while + * iterating through pages. + * + * Generated from protobuf field string page_token = 4; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Read mask is used for a more granular control over what the API + * returns. If the mask is not present all fields will be returned except + * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly + * specified in the mask. + * + * Generated from protobuf field .google.protobuf.FieldMask read_mask = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getReadMask() + { + return $this->read_mask; + } + + public function hasReadMask() + { + return isset($this->read_mask); + } + + public function clearReadMask() + { + unset($this->read_mask); + } + + /** + * Optional. Read mask is used for a more granular control over what the API + * returns. If the mask is not present all fields will be returned except + * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly + * specified in the mask. + * + * Generated from protobuf field .google.protobuf.FieldMask read_mask = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setReadMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->read_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ListQueuesResponse.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ListQueuesResponse.php new file mode 100644 index 000000000000..cf56f8b14ac2 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ListQueuesResponse.php @@ -0,0 +1,126 @@ +google.cloud.tasks.v2beta3.ListQueuesResponse + */ +class ListQueuesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of queues. + * + * Generated from protobuf field repeated .google.cloud.tasks.v2beta3.Queue queues = 1; + */ + private $queues; + /** + * A token to retrieve next page of results. + * To return the next page of results, call + * [ListQueues][google.cloud.tasks.v2beta3.CloudTasks.ListQueues] with this + * value as the + * [page_token][google.cloud.tasks.v2beta3.ListQueuesRequest.page_token]. + * If the next_page_token is empty, there are no more results. + * The page token is valid for only 2 hours. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Tasks\V2beta3\Queue>|\Google\Protobuf\Internal\RepeatedField $queues + * The list of queues. + * @type string $next_page_token + * A token to retrieve next page of results. + * To return the next page of results, call + * [ListQueues][google.cloud.tasks.v2beta3.CloudTasks.ListQueues] with this + * value as the + * [page_token][google.cloud.tasks.v2beta3.ListQueuesRequest.page_token]. + * If the next_page_token is empty, there are no more results. + * The page token is valid for only 2 hours. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * The list of queues. + * + * Generated from protobuf field repeated .google.cloud.tasks.v2beta3.Queue queues = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getQueues() + { + return $this->queues; + } + + /** + * The list of queues. + * + * Generated from protobuf field repeated .google.cloud.tasks.v2beta3.Queue queues = 1; + * @param array<\Google\Cloud\Tasks\V2beta3\Queue>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setQueues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Tasks\V2beta3\Queue::class); + $this->queues = $arr; + + return $this; + } + + /** + * A token to retrieve next page of results. + * To return the next page of results, call + * [ListQueues][google.cloud.tasks.v2beta3.CloudTasks.ListQueues] with this + * value as the + * [page_token][google.cloud.tasks.v2beta3.ListQueuesRequest.page_token]. + * If the next_page_token is empty, there are no more results. + * The page token is valid for only 2 hours. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token to retrieve next page of results. + * To return the next page of results, call + * [ListQueues][google.cloud.tasks.v2beta3.CloudTasks.ListQueues] with this + * value as the + * [page_token][google.cloud.tasks.v2beta3.ListQueuesRequest.page_token]. + * If the next_page_token is empty, there are no more results. + * The page token is valid for only 2 hours. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ListTasksRequest.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ListTasksRequest.php new file mode 100644 index 000000000000..c3e901881b52 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ListTasksRequest.php @@ -0,0 +1,258 @@ +google.cloud.tasks.v2beta3.ListTasksRequest + */ +class ListTasksRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta3.Task] will be returned. + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta3.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.Task.View response_view = 2; + */ + protected $response_view = 0; + /** + * Maximum page size. + * Fewer tasks than requested might be returned, even if more tasks exist; use + * [next_page_token][google.cloud.tasks.v2beta3.ListTasksResponse.next_page_token] + * in the response to determine if more tasks exist. + * The maximum page size is 1000. If unspecified, the page size will be the + * maximum. + * + * Generated from protobuf field int32 page_size = 3; + */ + protected $page_size = 0; + /** + * A token identifying the page of results to return. + * To request the first page results, page_token must be empty. To + * request the next page of results, page_token must be the value of + * [next_page_token][google.cloud.tasks.v2beta3.ListTasksResponse.next_page_token] + * returned from the previous call to + * [ListTasks][google.cloud.tasks.v2beta3.CloudTasks.ListTasks] method. + * The page token is valid for only 2 hours. + * + * Generated from protobuf field string page_token = 4; + */ + protected $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * @type int $response_view + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta3.Task] will be returned. + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta3.Task] resource. + * @type int $page_size + * Maximum page size. + * Fewer tasks than requested might be returned, even if more tasks exist; use + * [next_page_token][google.cloud.tasks.v2beta3.ListTasksResponse.next_page_token] + * in the response to determine if more tasks exist. + * The maximum page size is 1000. If unspecified, the page size will be the + * maximum. + * @type string $page_token + * A token identifying the page of results to return. + * To request the first page results, page_token must be empty. To + * request the next page of results, page_token must be the value of + * [next_page_token][google.cloud.tasks.v2beta3.ListTasksResponse.next_page_token] + * returned from the previous call to + * [ListTasks][google.cloud.tasks.v2beta3.CloudTasks.ListTasks] method. + * The page token is valid for only 2 hours. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta3.Task] will be returned. + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta3.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.Task.View response_view = 2; + * @return int + */ + public function getResponseView() + { + return $this->response_view; + } + + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta3.Task] will be returned. + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta3.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.Task.View response_view = 2; + * @param int $var + * @return $this + */ + public function setResponseView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta3\Task\View::class); + $this->response_view = $var; + + return $this; + } + + /** + * Maximum page size. + * Fewer tasks than requested might be returned, even if more tasks exist; use + * [next_page_token][google.cloud.tasks.v2beta3.ListTasksResponse.next_page_token] + * in the response to determine if more tasks exist. + * The maximum page size is 1000. If unspecified, the page size will be the + * maximum. + * + * Generated from protobuf field int32 page_size = 3; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Maximum page size. + * Fewer tasks than requested might be returned, even if more tasks exist; use + * [next_page_token][google.cloud.tasks.v2beta3.ListTasksResponse.next_page_token] + * in the response to determine if more tasks exist. + * The maximum page size is 1000. If unspecified, the page size will be the + * maximum. + * + * Generated from protobuf field int32 page_size = 3; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A token identifying the page of results to return. + * To request the first page results, page_token must be empty. To + * request the next page of results, page_token must be the value of + * [next_page_token][google.cloud.tasks.v2beta3.ListTasksResponse.next_page_token] + * returned from the previous call to + * [ListTasks][google.cloud.tasks.v2beta3.CloudTasks.ListTasks] method. + * The page token is valid for only 2 hours. + * + * Generated from protobuf field string page_token = 4; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A token identifying the page of results to return. + * To request the first page results, page_token must be empty. To + * request the next page of results, page_token must be the value of + * [next_page_token][google.cloud.tasks.v2beta3.ListTasksResponse.next_page_token] + * returned from the previous call to + * [ListTasks][google.cloud.tasks.v2beta3.CloudTasks.ListTasks] method. + * The page token is valid for only 2 hours. + * + * Generated from protobuf field string page_token = 4; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ListTasksResponse.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ListTasksResponse.php new file mode 100644 index 000000000000..f304ef62c9fa --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ListTasksResponse.php @@ -0,0 +1,122 @@ +google.cloud.tasks.v2beta3.ListTasksResponse + */ +class ListTasksResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of tasks. + * + * Generated from protobuf field repeated .google.cloud.tasks.v2beta3.Task tasks = 1; + */ + private $tasks; + /** + * A token to retrieve next page of results. + * To return the next page of results, call + * [ListTasks][google.cloud.tasks.v2beta3.CloudTasks.ListTasks] with this + * value as the + * [page_token][google.cloud.tasks.v2beta3.ListTasksRequest.page_token]. + * If the next_page_token is empty, there are no more results. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Tasks\V2beta3\Task>|\Google\Protobuf\Internal\RepeatedField $tasks + * The list of tasks. + * @type string $next_page_token + * A token to retrieve next page of results. + * To return the next page of results, call + * [ListTasks][google.cloud.tasks.v2beta3.CloudTasks.ListTasks] with this + * value as the + * [page_token][google.cloud.tasks.v2beta3.ListTasksRequest.page_token]. + * If the next_page_token is empty, there are no more results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * The list of tasks. + * + * Generated from protobuf field repeated .google.cloud.tasks.v2beta3.Task tasks = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTasks() + { + return $this->tasks; + } + + /** + * The list of tasks. + * + * Generated from protobuf field repeated .google.cloud.tasks.v2beta3.Task tasks = 1; + * @param array<\Google\Cloud\Tasks\V2beta3\Task>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTasks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Tasks\V2beta3\Task::class); + $this->tasks = $arr; + + return $this; + } + + /** + * A token to retrieve next page of results. + * To return the next page of results, call + * [ListTasks][google.cloud.tasks.v2beta3.CloudTasks.ListTasks] with this + * value as the + * [page_token][google.cloud.tasks.v2beta3.ListTasksRequest.page_token]. + * If the next_page_token is empty, there are no more results. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token to retrieve next page of results. + * To return the next page of results, call + * [ListTasks][google.cloud.tasks.v2beta3.CloudTasks.ListTasks] with this + * value as the + * [page_token][google.cloud.tasks.v2beta3.ListTasksRequest.page_token]. + * If the next_page_token is empty, there are no more results. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/OAuthToken.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/OAuthToken.php new file mode 100644 index 000000000000..792276e9814c --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/OAuthToken.php @@ -0,0 +1,128 @@ +google.cloud.tasks.v2beta3.OAuthToken + */ +class OAuthToken extends \Google\Protobuf\Internal\Message +{ + /** + * [Service account email](https://cloud.google.com/iam/docs/service-accounts) + * to be used for generating OAuth token. + * The service account must be within the same project as the queue. The + * caller must have iam.serviceAccounts.actAs permission for the service + * account. + * + * Generated from protobuf field string service_account_email = 1; + */ + protected $service_account_email = ''; + /** + * OAuth scope to be used for generating OAuth access token. + * If not specified, "https://www.googleapis.com/auth/cloud-platform" + * will be used. + * + * Generated from protobuf field string scope = 2; + */ + protected $scope = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $service_account_email + * [Service account email](https://cloud.google.com/iam/docs/service-accounts) + * to be used for generating OAuth token. + * The service account must be within the same project as the queue. The + * caller must have iam.serviceAccounts.actAs permission for the service + * account. + * @type string $scope + * OAuth scope to be used for generating OAuth access token. + * If not specified, "https://www.googleapis.com/auth/cloud-platform" + * will be used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Target::initOnce(); + parent::__construct($data); + } + + /** + * [Service account email](https://cloud.google.com/iam/docs/service-accounts) + * to be used for generating OAuth token. + * The service account must be within the same project as the queue. The + * caller must have iam.serviceAccounts.actAs permission for the service + * account. + * + * Generated from protobuf field string service_account_email = 1; + * @return string + */ + public function getServiceAccountEmail() + { + return $this->service_account_email; + } + + /** + * [Service account email](https://cloud.google.com/iam/docs/service-accounts) + * to be used for generating OAuth token. + * The service account must be within the same project as the queue. The + * caller must have iam.serviceAccounts.actAs permission for the service + * account. + * + * Generated from protobuf field string service_account_email = 1; + * @param string $var + * @return $this + */ + public function setServiceAccountEmail($var) + { + GPBUtil::checkString($var, True); + $this->service_account_email = $var; + + return $this; + } + + /** + * OAuth scope to be used for generating OAuth access token. + * If not specified, "https://www.googleapis.com/auth/cloud-platform" + * will be used. + * + * Generated from protobuf field string scope = 2; + * @return string + */ + public function getScope() + { + return $this->scope; + } + + /** + * OAuth scope to be used for generating OAuth access token. + * If not specified, "https://www.googleapis.com/auth/cloud-platform" + * will be used. + * + * Generated from protobuf field string scope = 2; + * @param string $var + * @return $this + */ + public function setScope($var) + { + GPBUtil::checkString($var, True); + $this->scope = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/OidcToken.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/OidcToken.php new file mode 100644 index 000000000000..3a02f601f855 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/OidcToken.php @@ -0,0 +1,126 @@ +google.cloud.tasks.v2beta3.OidcToken + */ +class OidcToken extends \Google\Protobuf\Internal\Message +{ + /** + * [Service account email](https://cloud.google.com/iam/docs/service-accounts) + * to be used for generating OIDC token. + * The service account must be within the same project as the queue. The + * caller must have iam.serviceAccounts.actAs permission for the service + * account. + * + * Generated from protobuf field string service_account_email = 1; + */ + protected $service_account_email = ''; + /** + * Audience to be used when generating OIDC token. If not specified, the URI + * specified in target will be used. + * + * Generated from protobuf field string audience = 2; + */ + protected $audience = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $service_account_email + * [Service account email](https://cloud.google.com/iam/docs/service-accounts) + * to be used for generating OIDC token. + * The service account must be within the same project as the queue. The + * caller must have iam.serviceAccounts.actAs permission for the service + * account. + * @type string $audience + * Audience to be used when generating OIDC token. If not specified, the URI + * specified in target will be used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Target::initOnce(); + parent::__construct($data); + } + + /** + * [Service account email](https://cloud.google.com/iam/docs/service-accounts) + * to be used for generating OIDC token. + * The service account must be within the same project as the queue. The + * caller must have iam.serviceAccounts.actAs permission for the service + * account. + * + * Generated from protobuf field string service_account_email = 1; + * @return string + */ + public function getServiceAccountEmail() + { + return $this->service_account_email; + } + + /** + * [Service account email](https://cloud.google.com/iam/docs/service-accounts) + * to be used for generating OIDC token. + * The service account must be within the same project as the queue. The + * caller must have iam.serviceAccounts.actAs permission for the service + * account. + * + * Generated from protobuf field string service_account_email = 1; + * @param string $var + * @return $this + */ + public function setServiceAccountEmail($var) + { + GPBUtil::checkString($var, True); + $this->service_account_email = $var; + + return $this; + } + + /** + * Audience to be used when generating OIDC token. If not specified, the URI + * specified in target will be used. + * + * Generated from protobuf field string audience = 2; + * @return string + */ + public function getAudience() + { + return $this->audience; + } + + /** + * Audience to be used when generating OIDC token. If not specified, the URI + * specified in target will be used. + * + * Generated from protobuf field string audience = 2; + * @param string $var + * @return $this + */ + public function setAudience($var) + { + GPBUtil::checkString($var, True); + $this->audience = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/PathOverride.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/PathOverride.php new file mode 100644 index 000000000000..152a9f931481 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/PathOverride.php @@ -0,0 +1,68 @@ +google.cloud.tasks.v2beta3.PathOverride + */ +class PathOverride extends \Google\Protobuf\Internal\Message +{ + /** + * The URI path (e.g., /users/1234). Default is an empty string. + * + * Generated from protobuf field string path = 1; + */ + protected $path = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $path + * The URI path (e.g., /users/1234). Default is an empty string. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Target::initOnce(); + parent::__construct($data); + } + + /** + * The URI path (e.g., /users/1234). Default is an empty string. + * + * Generated from protobuf field string path = 1; + * @return string + */ + public function getPath() + { + return $this->path; + } + + /** + * The URI path (e.g., /users/1234). Default is an empty string. + * + * Generated from protobuf field string path = 1; + * @param string $var + * @return $this + */ + public function setPath($var) + { + GPBUtil::checkString($var, True); + $this->path = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/PauseQueueRequest.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/PauseQueueRequest.php new file mode 100644 index 000000000000..574132cc393e --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/PauseQueueRequest.php @@ -0,0 +1,72 @@ +google.cloud.tasks.v2beta3.PauseQueueRequest + */ +class PauseQueueRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/PullMessage.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/PullMessage.php new file mode 100644 index 000000000000..b6d4df5107a3 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/PullMessage.php @@ -0,0 +1,132 @@ +google.cloud.tasks.v2beta3.PullMessage + */ +class PullMessage extends \Google\Protobuf\Internal\Message +{ + /** + * A data payload consumed by the worker to execute the task. + * + * Generated from protobuf field bytes payload = 1; + */ + protected $payload = ''; + /** + * The tasks's tag. + * The tag is less than 500 characters. + * SDK compatibility: Although the SDK allows tags to be either + * string or + * [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), + * only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8 + * encoded, the tag will be empty when the task is returned by Cloud Tasks. + * + * Generated from protobuf field string tag = 2; + */ + protected $tag = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $payload + * A data payload consumed by the worker to execute the task. + * @type string $tag + * The tasks's tag. + * The tag is less than 500 characters. + * SDK compatibility: Although the SDK allows tags to be either + * string or + * [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), + * only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8 + * encoded, the tag will be empty when the task is returned by Cloud Tasks. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Target::initOnce(); + parent::__construct($data); + } + + /** + * A data payload consumed by the worker to execute the task. + * + * Generated from protobuf field bytes payload = 1; + * @return string + */ + public function getPayload() + { + return $this->payload; + } + + /** + * A data payload consumed by the worker to execute the task. + * + * Generated from protobuf field bytes payload = 1; + * @param string $var + * @return $this + */ + public function setPayload($var) + { + GPBUtil::checkString($var, False); + $this->payload = $var; + + return $this; + } + + /** + * The tasks's tag. + * The tag is less than 500 characters. + * SDK compatibility: Although the SDK allows tags to be either + * string or + * [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), + * only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8 + * encoded, the tag will be empty when the task is returned by Cloud Tasks. + * + * Generated from protobuf field string tag = 2; + * @return string + */ + public function getTag() + { + return $this->tag; + } + + /** + * The tasks's tag. + * The tag is less than 500 characters. + * SDK compatibility: Although the SDK allows tags to be either + * string or + * [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), + * only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8 + * encoded, the tag will be empty when the task is returned by Cloud Tasks. + * + * Generated from protobuf field string tag = 2; + * @param string $var + * @return $this + */ + public function setTag($var) + { + GPBUtil::checkString($var, True); + $this->tag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/PurgeQueueRequest.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/PurgeQueueRequest.php new file mode 100644 index 000000000000..6ab84bcbdaa0 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/PurgeQueueRequest.php @@ -0,0 +1,72 @@ +google.cloud.tasks.v2beta3.PurgeQueueRequest + */ +class PurgeQueueRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/QueryOverride.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/QueryOverride.php new file mode 100644 index 000000000000..7614b5722bbb --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/QueryOverride.php @@ -0,0 +1,72 @@ +google.cloud.tasks.v2beta3.QueryOverride + */ +class QueryOverride extends \Google\Protobuf\Internal\Message +{ + /** + * The query parameters (e.g., qparam1=123&qparam2=456). Default is an empty + * string. + * + * Generated from protobuf field string query_params = 1; + */ + protected $query_params = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $query_params + * The query parameters (e.g., qparam1=123&qparam2=456). Default is an empty + * string. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Target::initOnce(); + parent::__construct($data); + } + + /** + * The query parameters (e.g., qparam1=123&qparam2=456). Default is an empty + * string. + * + * Generated from protobuf field string query_params = 1; + * @return string + */ + public function getQueryParams() + { + return $this->query_params; + } + + /** + * The query parameters (e.g., qparam1=123&qparam2=456). Default is an empty + * string. + * + * Generated from protobuf field string query_params = 1; + * @param string $var + * @return $this + */ + public function setQueryParams($var) + { + GPBUtil::checkString($var, True); + $this->query_params = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Queue.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Queue.php new file mode 100644 index 000000000000..f670e0985645 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Queue.php @@ -0,0 +1,883 @@ +google.cloud.tasks.v2beta3.Queue + */ +class Queue extends \Google\Protobuf\Internal\Message +{ + /** + * Caller-specified and required in + * [CreateQueue][google.cloud.tasks.v2beta3.CloudTasks.CreateQueue], after + * which it becomes output only. + * The queue name. + * The queue name must have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), + * hyphens (-), colons (:), or periods (.). + * For more information, see + * [Identifying + * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) + * * `LOCATION_ID` is the canonical ID for the queue's location. + * The list of available locations can be obtained by calling + * [ListLocations][google.cloud.location.Locations.ListLocations]. + * For more information, see https://cloud.google.com/about/locations/. + * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or + * hyphens (-). The maximum length is 100 characters. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Modifies HTTP target for HTTP tasks. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.HttpTarget http_target = 13; + */ + protected $http_target = null; + /** + * Rate limits for task dispatches. + * [rate_limits][google.cloud.tasks.v2beta3.Queue.rate_limits] and + * [retry_config][google.cloud.tasks.v2beta3.Queue.retry_config] are related + * because they both control task attempts. However they control task attempts + * in different ways: + * * [rate_limits][google.cloud.tasks.v2beta3.Queue.rate_limits] controls the + * total rate of + * dispatches from a queue (i.e. all traffic dispatched from the + * queue, regardless of whether the dispatch is from a first + * attempt or a retry). + * * [retry_config][google.cloud.tasks.v2beta3.Queue.retry_config] controls + * what happens to + * particular a task after its first attempt fails. That is, + * [retry_config][google.cloud.tasks.v2beta3.Queue.retry_config] controls + * task retries (the second attempt, third attempt, etc). + * The queue's actual dispatch rate is the result of: + * * Number of tasks in the queue + * * User-specified throttling: + * [rate_limits][google.cloud.tasks.v2beta3.Queue.rate_limits], + * [retry_config][google.cloud.tasks.v2beta3.Queue.retry_config], and the + * [queue's state][google.cloud.tasks.v2beta3.Queue.state]. + * * System throttling due to `429` (Too Many Requests) or `503` (Service + * Unavailable) responses from the worker, high error rates, or to smooth + * sudden large traffic spikes. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.RateLimits rate_limits = 4; + */ + protected $rate_limits = null; + /** + * Settings that determine the retry behavior. + * * For tasks created using Cloud Tasks: the queue-level retry settings + * apply to all tasks in the queue that were created using Cloud Tasks. + * Retry settings cannot be set on individual tasks. + * * For tasks created using the App Engine SDK: the queue-level retry + * settings apply to all tasks in the queue which do not have retry settings + * explicitly set on the task and were created by the App Engine SDK. See + * [App Engine + * documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks). + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.RetryConfig retry_config = 5; + */ + protected $retry_config = null; + /** + * Output only. The state of the queue. + * `state` can only be changed by called + * [PauseQueue][google.cloud.tasks.v2beta3.CloudTasks.PauseQueue], + * [ResumeQueue][google.cloud.tasks.v2beta3.CloudTasks.ResumeQueue], or + * uploading + * [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref). + * [UpdateQueue][google.cloud.tasks.v2beta3.CloudTasks.UpdateQueue] cannot be + * used to change `state`. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.Queue.State state = 6; + */ + protected $state = 0; + /** + * Output only. The last time this queue was purged. + * All tasks that were [created][google.cloud.tasks.v2beta3.Task.create_time] + * before this time were purged. + * A queue can be purged using + * [PurgeQueue][google.cloud.tasks.v2beta3.CloudTasks.PurgeQueue], the [App + * Engine Task Queue SDK, or the Cloud + * Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue). + * Purge time will be truncated to the nearest microsecond. Purge + * time will be unset if the queue has never been purged. + * + * Generated from protobuf field .google.protobuf.Timestamp purge_time = 7; + */ + protected $purge_time = null; + /** + * The maximum amount of time that a task will be retained in + * this queue. + * Queues created by Cloud Tasks have a default `task_ttl` of 31 days. + * After a task has lived for `task_ttl`, the task will be deleted + * regardless of whether it was dispatched or not. + * The `task_ttl` for queues created via queue.yaml/xml is equal to the + * maximum duration because there is a + * [storage quota](https://cloud.google.com/appengine/quotas#Task_Queue) for + * these queues. To view the maximum valid duration, see the documentation for + * [Duration][google.protobuf.Duration]. + * + * Generated from protobuf field .google.protobuf.Duration task_ttl = 8; + */ + protected $task_ttl = null; + /** + * The task tombstone time to live (TTL). + * After a task is deleted or executed, the task's tombstone is + * retained for the length of time specified by `tombstone_ttl`. + * The tombstone is used by task de-duplication; another task with the same + * name can't be created until the tombstone has expired. For more information + * about task de-duplication, see the documentation for + * [CreateTaskRequest][google.cloud.tasks.v2beta3.CreateTaskRequest.task]. + * Queues created by Cloud Tasks have a default `tombstone_ttl` of 1 hour. + * + * Generated from protobuf field .google.protobuf.Duration tombstone_ttl = 9; + */ + protected $tombstone_ttl = null; + /** + * Configuration options for writing logs to + * [Stackdriver Logging](https://cloud.google.com/logging/docs/). If this + * field is unset, then no logs are written. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.StackdriverLoggingConfig stackdriver_logging_config = 10; + */ + protected $stackdriver_logging_config = null; + /** + * Immutable. The type of a queue (push or pull). + * `Queue.type` is an immutable property of the queue that is set at the queue + * creation time. When left unspecified, the default value of `PUSH` is + * selected. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.Queue.Type type = 11 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $type = 0; + /** + * Output only. The realtime, informational statistics for a queue. In order + * to receive the statistics the caller should include this field in the + * FieldMask. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.QueueStats stats = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $stats = null; + protected $queue_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Caller-specified and required in + * [CreateQueue][google.cloud.tasks.v2beta3.CloudTasks.CreateQueue], after + * which it becomes output only. + * The queue name. + * The queue name must have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), + * hyphens (-), colons (:), or periods (.). + * For more information, see + * [Identifying + * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) + * * `LOCATION_ID` is the canonical ID for the queue's location. + * The list of available locations can be obtained by calling + * [ListLocations][google.cloud.location.Locations.ListLocations]. + * For more information, see https://cloud.google.com/about/locations/. + * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or + * hyphens (-). The maximum length is 100 characters. + * @type \Google\Cloud\Tasks\V2beta3\AppEngineHttpQueue $app_engine_http_queue + * [AppEngineHttpQueue][google.cloud.tasks.v2beta3.AppEngineHttpQueue] + * settings apply only to [App Engine + * tasks][google.cloud.tasks.v2beta3.AppEngineHttpRequest] in this queue. + * [Http tasks][google.cloud.tasks.v2beta3.HttpRequest] are not affected by + * this proto. + * @type \Google\Cloud\Tasks\V2beta3\HttpTarget $http_target + * Modifies HTTP target for HTTP tasks. + * @type \Google\Cloud\Tasks\V2beta3\RateLimits $rate_limits + * Rate limits for task dispatches. + * [rate_limits][google.cloud.tasks.v2beta3.Queue.rate_limits] and + * [retry_config][google.cloud.tasks.v2beta3.Queue.retry_config] are related + * because they both control task attempts. However they control task attempts + * in different ways: + * * [rate_limits][google.cloud.tasks.v2beta3.Queue.rate_limits] controls the + * total rate of + * dispatches from a queue (i.e. all traffic dispatched from the + * queue, regardless of whether the dispatch is from a first + * attempt or a retry). + * * [retry_config][google.cloud.tasks.v2beta3.Queue.retry_config] controls + * what happens to + * particular a task after its first attempt fails. That is, + * [retry_config][google.cloud.tasks.v2beta3.Queue.retry_config] controls + * task retries (the second attempt, third attempt, etc). + * The queue's actual dispatch rate is the result of: + * * Number of tasks in the queue + * * User-specified throttling: + * [rate_limits][google.cloud.tasks.v2beta3.Queue.rate_limits], + * [retry_config][google.cloud.tasks.v2beta3.Queue.retry_config], and the + * [queue's state][google.cloud.tasks.v2beta3.Queue.state]. + * * System throttling due to `429` (Too Many Requests) or `503` (Service + * Unavailable) responses from the worker, high error rates, or to smooth + * sudden large traffic spikes. + * @type \Google\Cloud\Tasks\V2beta3\RetryConfig $retry_config + * Settings that determine the retry behavior. + * * For tasks created using Cloud Tasks: the queue-level retry settings + * apply to all tasks in the queue that were created using Cloud Tasks. + * Retry settings cannot be set on individual tasks. + * * For tasks created using the App Engine SDK: the queue-level retry + * settings apply to all tasks in the queue which do not have retry settings + * explicitly set on the task and were created by the App Engine SDK. See + * [App Engine + * documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks). + * @type int $state + * Output only. The state of the queue. + * `state` can only be changed by called + * [PauseQueue][google.cloud.tasks.v2beta3.CloudTasks.PauseQueue], + * [ResumeQueue][google.cloud.tasks.v2beta3.CloudTasks.ResumeQueue], or + * uploading + * [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref). + * [UpdateQueue][google.cloud.tasks.v2beta3.CloudTasks.UpdateQueue] cannot be + * used to change `state`. + * @type \Google\Protobuf\Timestamp $purge_time + * Output only. The last time this queue was purged. + * All tasks that were [created][google.cloud.tasks.v2beta3.Task.create_time] + * before this time were purged. + * A queue can be purged using + * [PurgeQueue][google.cloud.tasks.v2beta3.CloudTasks.PurgeQueue], the [App + * Engine Task Queue SDK, or the Cloud + * Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue). + * Purge time will be truncated to the nearest microsecond. Purge + * time will be unset if the queue has never been purged. + * @type \Google\Protobuf\Duration $task_ttl + * The maximum amount of time that a task will be retained in + * this queue. + * Queues created by Cloud Tasks have a default `task_ttl` of 31 days. + * After a task has lived for `task_ttl`, the task will be deleted + * regardless of whether it was dispatched or not. + * The `task_ttl` for queues created via queue.yaml/xml is equal to the + * maximum duration because there is a + * [storage quota](https://cloud.google.com/appengine/quotas#Task_Queue) for + * these queues. To view the maximum valid duration, see the documentation for + * [Duration][google.protobuf.Duration]. + * @type \Google\Protobuf\Duration $tombstone_ttl + * The task tombstone time to live (TTL). + * After a task is deleted or executed, the task's tombstone is + * retained for the length of time specified by `tombstone_ttl`. + * The tombstone is used by task de-duplication; another task with the same + * name can't be created until the tombstone has expired. For more information + * about task de-duplication, see the documentation for + * [CreateTaskRequest][google.cloud.tasks.v2beta3.CreateTaskRequest.task]. + * Queues created by Cloud Tasks have a default `tombstone_ttl` of 1 hour. + * @type \Google\Cloud\Tasks\V2beta3\StackdriverLoggingConfig $stackdriver_logging_config + * Configuration options for writing logs to + * [Stackdriver Logging](https://cloud.google.com/logging/docs/). If this + * field is unset, then no logs are written. + * @type int $type + * Immutable. The type of a queue (push or pull). + * `Queue.type` is an immutable property of the queue that is set at the queue + * creation time. When left unspecified, the default value of `PUSH` is + * selected. + * @type \Google\Cloud\Tasks\V2beta3\QueueStats $stats + * Output only. The realtime, informational statistics for a queue. In order + * to receive the statistics the caller should include this field in the + * FieldMask. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Queue::initOnce(); + parent::__construct($data); + } + + /** + * Caller-specified and required in + * [CreateQueue][google.cloud.tasks.v2beta3.CloudTasks.CreateQueue], after + * which it becomes output only. + * The queue name. + * The queue name must have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), + * hyphens (-), colons (:), or periods (.). + * For more information, see + * [Identifying + * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) + * * `LOCATION_ID` is the canonical ID for the queue's location. + * The list of available locations can be obtained by calling + * [ListLocations][google.cloud.location.Locations.ListLocations]. + * For more information, see https://cloud.google.com/about/locations/. + * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or + * hyphens (-). The maximum length is 100 characters. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Caller-specified and required in + * [CreateQueue][google.cloud.tasks.v2beta3.CloudTasks.CreateQueue], after + * which it becomes output only. + * The queue name. + * The queue name must have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), + * hyphens (-), colons (:), or periods (.). + * For more information, see + * [Identifying + * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) + * * `LOCATION_ID` is the canonical ID for the queue's location. + * The list of available locations can be obtained by calling + * [ListLocations][google.cloud.location.Locations.ListLocations]. + * For more information, see https://cloud.google.com/about/locations/. + * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or + * hyphens (-). The maximum length is 100 characters. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * [AppEngineHttpQueue][google.cloud.tasks.v2beta3.AppEngineHttpQueue] + * settings apply only to [App Engine + * tasks][google.cloud.tasks.v2beta3.AppEngineHttpRequest] in this queue. + * [Http tasks][google.cloud.tasks.v2beta3.HttpRequest] are not affected by + * this proto. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.AppEngineHttpQueue app_engine_http_queue = 3; + * @return \Google\Cloud\Tasks\V2beta3\AppEngineHttpQueue|null + */ + public function getAppEngineHttpQueue() + { + return $this->readOneof(3); + } + + public function hasAppEngineHttpQueue() + { + return $this->hasOneof(3); + } + + /** + * [AppEngineHttpQueue][google.cloud.tasks.v2beta3.AppEngineHttpQueue] + * settings apply only to [App Engine + * tasks][google.cloud.tasks.v2beta3.AppEngineHttpRequest] in this queue. + * [Http tasks][google.cloud.tasks.v2beta3.HttpRequest] are not affected by + * this proto. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.AppEngineHttpQueue app_engine_http_queue = 3; + * @param \Google\Cloud\Tasks\V2beta3\AppEngineHttpQueue $var + * @return $this + */ + public function setAppEngineHttpQueue($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\AppEngineHttpQueue::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Modifies HTTP target for HTTP tasks. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.HttpTarget http_target = 13; + * @return \Google\Cloud\Tasks\V2beta3\HttpTarget|null + */ + public function getHttpTarget() + { + return $this->http_target; + } + + public function hasHttpTarget() + { + return isset($this->http_target); + } + + public function clearHttpTarget() + { + unset($this->http_target); + } + + /** + * Modifies HTTP target for HTTP tasks. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.HttpTarget http_target = 13; + * @param \Google\Cloud\Tasks\V2beta3\HttpTarget $var + * @return $this + */ + public function setHttpTarget($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\HttpTarget::class); + $this->http_target = $var; + + return $this; + } + + /** + * Rate limits for task dispatches. + * [rate_limits][google.cloud.tasks.v2beta3.Queue.rate_limits] and + * [retry_config][google.cloud.tasks.v2beta3.Queue.retry_config] are related + * because they both control task attempts. However they control task attempts + * in different ways: + * * [rate_limits][google.cloud.tasks.v2beta3.Queue.rate_limits] controls the + * total rate of + * dispatches from a queue (i.e. all traffic dispatched from the + * queue, regardless of whether the dispatch is from a first + * attempt or a retry). + * * [retry_config][google.cloud.tasks.v2beta3.Queue.retry_config] controls + * what happens to + * particular a task after its first attempt fails. That is, + * [retry_config][google.cloud.tasks.v2beta3.Queue.retry_config] controls + * task retries (the second attempt, third attempt, etc). + * The queue's actual dispatch rate is the result of: + * * Number of tasks in the queue + * * User-specified throttling: + * [rate_limits][google.cloud.tasks.v2beta3.Queue.rate_limits], + * [retry_config][google.cloud.tasks.v2beta3.Queue.retry_config], and the + * [queue's state][google.cloud.tasks.v2beta3.Queue.state]. + * * System throttling due to `429` (Too Many Requests) or `503` (Service + * Unavailable) responses from the worker, high error rates, or to smooth + * sudden large traffic spikes. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.RateLimits rate_limits = 4; + * @return \Google\Cloud\Tasks\V2beta3\RateLimits|null + */ + public function getRateLimits() + { + return $this->rate_limits; + } + + public function hasRateLimits() + { + return isset($this->rate_limits); + } + + public function clearRateLimits() + { + unset($this->rate_limits); + } + + /** + * Rate limits for task dispatches. + * [rate_limits][google.cloud.tasks.v2beta3.Queue.rate_limits] and + * [retry_config][google.cloud.tasks.v2beta3.Queue.retry_config] are related + * because they both control task attempts. However they control task attempts + * in different ways: + * * [rate_limits][google.cloud.tasks.v2beta3.Queue.rate_limits] controls the + * total rate of + * dispatches from a queue (i.e. all traffic dispatched from the + * queue, regardless of whether the dispatch is from a first + * attempt or a retry). + * * [retry_config][google.cloud.tasks.v2beta3.Queue.retry_config] controls + * what happens to + * particular a task after its first attempt fails. That is, + * [retry_config][google.cloud.tasks.v2beta3.Queue.retry_config] controls + * task retries (the second attempt, third attempt, etc). + * The queue's actual dispatch rate is the result of: + * * Number of tasks in the queue + * * User-specified throttling: + * [rate_limits][google.cloud.tasks.v2beta3.Queue.rate_limits], + * [retry_config][google.cloud.tasks.v2beta3.Queue.retry_config], and the + * [queue's state][google.cloud.tasks.v2beta3.Queue.state]. + * * System throttling due to `429` (Too Many Requests) or `503` (Service + * Unavailable) responses from the worker, high error rates, or to smooth + * sudden large traffic spikes. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.RateLimits rate_limits = 4; + * @param \Google\Cloud\Tasks\V2beta3\RateLimits $var + * @return $this + */ + public function setRateLimits($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\RateLimits::class); + $this->rate_limits = $var; + + return $this; + } + + /** + * Settings that determine the retry behavior. + * * For tasks created using Cloud Tasks: the queue-level retry settings + * apply to all tasks in the queue that were created using Cloud Tasks. + * Retry settings cannot be set on individual tasks. + * * For tasks created using the App Engine SDK: the queue-level retry + * settings apply to all tasks in the queue which do not have retry settings + * explicitly set on the task and were created by the App Engine SDK. See + * [App Engine + * documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks). + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.RetryConfig retry_config = 5; + * @return \Google\Cloud\Tasks\V2beta3\RetryConfig|null + */ + public function getRetryConfig() + { + return $this->retry_config; + } + + public function hasRetryConfig() + { + return isset($this->retry_config); + } + + public function clearRetryConfig() + { + unset($this->retry_config); + } + + /** + * Settings that determine the retry behavior. + * * For tasks created using Cloud Tasks: the queue-level retry settings + * apply to all tasks in the queue that were created using Cloud Tasks. + * Retry settings cannot be set on individual tasks. + * * For tasks created using the App Engine SDK: the queue-level retry + * settings apply to all tasks in the queue which do not have retry settings + * explicitly set on the task and were created by the App Engine SDK. See + * [App Engine + * documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks). + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.RetryConfig retry_config = 5; + * @param \Google\Cloud\Tasks\V2beta3\RetryConfig $var + * @return $this + */ + public function setRetryConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\RetryConfig::class); + $this->retry_config = $var; + + return $this; + } + + /** + * Output only. The state of the queue. + * `state` can only be changed by called + * [PauseQueue][google.cloud.tasks.v2beta3.CloudTasks.PauseQueue], + * [ResumeQueue][google.cloud.tasks.v2beta3.CloudTasks.ResumeQueue], or + * uploading + * [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref). + * [UpdateQueue][google.cloud.tasks.v2beta3.CloudTasks.UpdateQueue] cannot be + * used to change `state`. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.Queue.State state = 6; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The state of the queue. + * `state` can only be changed by called + * [PauseQueue][google.cloud.tasks.v2beta3.CloudTasks.PauseQueue], + * [ResumeQueue][google.cloud.tasks.v2beta3.CloudTasks.ResumeQueue], or + * uploading + * [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref). + * [UpdateQueue][google.cloud.tasks.v2beta3.CloudTasks.UpdateQueue] cannot be + * used to change `state`. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.Queue.State state = 6; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta3\Queue\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. The last time this queue was purged. + * All tasks that were [created][google.cloud.tasks.v2beta3.Task.create_time] + * before this time were purged. + * A queue can be purged using + * [PurgeQueue][google.cloud.tasks.v2beta3.CloudTasks.PurgeQueue], the [App + * Engine Task Queue SDK, or the Cloud + * Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue). + * Purge time will be truncated to the nearest microsecond. Purge + * time will be unset if the queue has never been purged. + * + * Generated from protobuf field .google.protobuf.Timestamp purge_time = 7; + * @return \Google\Protobuf\Timestamp|null + */ + public function getPurgeTime() + { + return $this->purge_time; + } + + public function hasPurgeTime() + { + return isset($this->purge_time); + } + + public function clearPurgeTime() + { + unset($this->purge_time); + } + + /** + * Output only. The last time this queue was purged. + * All tasks that were [created][google.cloud.tasks.v2beta3.Task.create_time] + * before this time were purged. + * A queue can be purged using + * [PurgeQueue][google.cloud.tasks.v2beta3.CloudTasks.PurgeQueue], the [App + * Engine Task Queue SDK, or the Cloud + * Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue). + * Purge time will be truncated to the nearest microsecond. Purge + * time will be unset if the queue has never been purged. + * + * Generated from protobuf field .google.protobuf.Timestamp purge_time = 7; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setPurgeTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->purge_time = $var; + + return $this; + } + + /** + * The maximum amount of time that a task will be retained in + * this queue. + * Queues created by Cloud Tasks have a default `task_ttl` of 31 days. + * After a task has lived for `task_ttl`, the task will be deleted + * regardless of whether it was dispatched or not. + * The `task_ttl` for queues created via queue.yaml/xml is equal to the + * maximum duration because there is a + * [storage quota](https://cloud.google.com/appengine/quotas#Task_Queue) for + * these queues. To view the maximum valid duration, see the documentation for + * [Duration][google.protobuf.Duration]. + * + * Generated from protobuf field .google.protobuf.Duration task_ttl = 8; + * @return \Google\Protobuf\Duration|null + */ + public function getTaskTtl() + { + return $this->task_ttl; + } + + public function hasTaskTtl() + { + return isset($this->task_ttl); + } + + public function clearTaskTtl() + { + unset($this->task_ttl); + } + + /** + * The maximum amount of time that a task will be retained in + * this queue. + * Queues created by Cloud Tasks have a default `task_ttl` of 31 days. + * After a task has lived for `task_ttl`, the task will be deleted + * regardless of whether it was dispatched or not. + * The `task_ttl` for queues created via queue.yaml/xml is equal to the + * maximum duration because there is a + * [storage quota](https://cloud.google.com/appengine/quotas#Task_Queue) for + * these queues. To view the maximum valid duration, see the documentation for + * [Duration][google.protobuf.Duration]. + * + * Generated from protobuf field .google.protobuf.Duration task_ttl = 8; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTaskTtl($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->task_ttl = $var; + + return $this; + } + + /** + * The task tombstone time to live (TTL). + * After a task is deleted or executed, the task's tombstone is + * retained for the length of time specified by `tombstone_ttl`. + * The tombstone is used by task de-duplication; another task with the same + * name can't be created until the tombstone has expired. For more information + * about task de-duplication, see the documentation for + * [CreateTaskRequest][google.cloud.tasks.v2beta3.CreateTaskRequest.task]. + * Queues created by Cloud Tasks have a default `tombstone_ttl` of 1 hour. + * + * Generated from protobuf field .google.protobuf.Duration tombstone_ttl = 9; + * @return \Google\Protobuf\Duration|null + */ + public function getTombstoneTtl() + { + return $this->tombstone_ttl; + } + + public function hasTombstoneTtl() + { + return isset($this->tombstone_ttl); + } + + public function clearTombstoneTtl() + { + unset($this->tombstone_ttl); + } + + /** + * The task tombstone time to live (TTL). + * After a task is deleted or executed, the task's tombstone is + * retained for the length of time specified by `tombstone_ttl`. + * The tombstone is used by task de-duplication; another task with the same + * name can't be created until the tombstone has expired. For more information + * about task de-duplication, see the documentation for + * [CreateTaskRequest][google.cloud.tasks.v2beta3.CreateTaskRequest.task]. + * Queues created by Cloud Tasks have a default `tombstone_ttl` of 1 hour. + * + * Generated from protobuf field .google.protobuf.Duration tombstone_ttl = 9; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTombstoneTtl($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->tombstone_ttl = $var; + + return $this; + } + + /** + * Configuration options for writing logs to + * [Stackdriver Logging](https://cloud.google.com/logging/docs/). If this + * field is unset, then no logs are written. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.StackdriverLoggingConfig stackdriver_logging_config = 10; + * @return \Google\Cloud\Tasks\V2beta3\StackdriverLoggingConfig|null + */ + public function getStackdriverLoggingConfig() + { + return $this->stackdriver_logging_config; + } + + public function hasStackdriverLoggingConfig() + { + return isset($this->stackdriver_logging_config); + } + + public function clearStackdriverLoggingConfig() + { + unset($this->stackdriver_logging_config); + } + + /** + * Configuration options for writing logs to + * [Stackdriver Logging](https://cloud.google.com/logging/docs/). If this + * field is unset, then no logs are written. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.StackdriverLoggingConfig stackdriver_logging_config = 10; + * @param \Google\Cloud\Tasks\V2beta3\StackdriverLoggingConfig $var + * @return $this + */ + public function setStackdriverLoggingConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\StackdriverLoggingConfig::class); + $this->stackdriver_logging_config = $var; + + return $this; + } + + /** + * Immutable. The type of a queue (push or pull). + * `Queue.type` is an immutable property of the queue that is set at the queue + * creation time. When left unspecified, the default value of `PUSH` is + * selected. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.Queue.Type type = 11 [(.google.api.field_behavior) = IMMUTABLE]; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Immutable. The type of a queue (push or pull). + * `Queue.type` is an immutable property of the queue that is set at the queue + * creation time. When left unspecified, the default value of `PUSH` is + * selected. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.Queue.Type type = 11 [(.google.api.field_behavior) = IMMUTABLE]; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta3\Queue\Type::class); + $this->type = $var; + + return $this; + } + + /** + * Output only. The realtime, informational statistics for a queue. In order + * to receive the statistics the caller should include this field in the + * FieldMask. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.QueueStats stats = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Tasks\V2beta3\QueueStats|null + */ + public function getStats() + { + return $this->stats; + } + + public function hasStats() + { + return isset($this->stats); + } + + public function clearStats() + { + unset($this->stats); + } + + /** + * Output only. The realtime, informational statistics for a queue. In order + * to receive the statistics the caller should include this field in the + * FieldMask. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.QueueStats stats = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Tasks\V2beta3\QueueStats $var + * @return $this + */ + public function setStats($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\QueueStats::class); + $this->stats = $var; + + return $this; + } + + /** + * @return string + */ + public function getQueueType() + { + return $this->whichOneof("queue_type"); + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Queue/State.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Queue/State.php new file mode 100644 index 000000000000..74d486e2a300 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Queue/State.php @@ -0,0 +1,89 @@ +google.cloud.tasks.v2beta3.Queue.State + */ +class State +{ + /** + * Unspecified state. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The queue is running. Tasks can be dispatched. + * If the queue was created using Cloud Tasks and the queue has + * had no activity (method calls or task dispatches) for 30 days, + * the queue may take a few minutes to re-activate. Some method + * calls may return [NOT_FOUND][google.rpc.Code.NOT_FOUND] and + * tasks may not be dispatched for a few minutes until the queue + * has been re-activated. + * + * Generated from protobuf enum RUNNING = 1; + */ + const RUNNING = 1; + /** + * Tasks are paused by the user. If the queue is paused then Cloud + * Tasks will stop delivering tasks from it, but more tasks can + * still be added to it by the user. + * + * Generated from protobuf enum PAUSED = 2; + */ + const PAUSED = 2; + /** + * The queue is disabled. + * A queue becomes `DISABLED` when + * [queue.yaml](https://cloud.google.com/appengine/docs/python/config/queueref) + * or + * [queue.xml](https://cloud.google.com/appengine/docs/standard/java/config/queueref) + * is uploaded which does not contain the queue. You cannot directly disable + * a queue. + * When a queue is disabled, tasks can still be added to a queue + * but the tasks are not dispatched. + * To permanently delete this queue and all of its tasks, call + * [DeleteQueue][google.cloud.tasks.v2beta3.CloudTasks.DeleteQueue]. + * + * Generated from protobuf enum DISABLED = 3; + */ + const DISABLED = 3; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::RUNNING => 'RUNNING', + self::PAUSED => 'PAUSED', + self::DISABLED => 'DISABLED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\Tasks\V2beta3\Queue_State::class); + diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Queue/Type.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Queue/Type.php new file mode 100644 index 000000000000..289c58b4f926 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Queue/Type.php @@ -0,0 +1,64 @@ +google.cloud.tasks.v2beta3.Queue.Type + */ +class Type +{ + /** + * Default value. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * A pull queue. + * + * Generated from protobuf enum PULL = 1; + */ + const PULL = 1; + /** + * A push queue. + * + * Generated from protobuf enum PUSH = 2; + */ + const PUSH = 2; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::PULL => 'PULL', + self::PUSH => 'PUSH', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\Tasks\V2beta3\Queue_Type::class); + diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/QueueStats.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/QueueStats.php new file mode 100644 index 000000000000..a02919639558 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/QueueStats.php @@ -0,0 +1,253 @@ +google.cloud.tasks.v2beta3.QueueStats + */ +class QueueStats extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. An estimation of the number of tasks in the queue, that is, + * the tasks in the queue that haven't been executed, the tasks in the queue + * which the queue has dispatched but has not yet received a reply for, and + * the failed tasks that the queue is retrying. + * + * Generated from protobuf field int64 tasks_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $tasks_count = 0; + /** + * Output only. An estimation of the nearest time in the future where a task + * in the queue is scheduled to be executed. + * + * Generated from protobuf field .google.protobuf.Timestamp oldest_estimated_arrival_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $oldest_estimated_arrival_time = null; + /** + * Output only. The number of tasks that the queue has dispatched and received + * a reply for during the last minute. This variable counts both successful + * and non-successful executions. + * + * Generated from protobuf field int64 executed_last_minute_count = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $executed_last_minute_count = 0; + /** + * Output only. The number of requests that the queue has dispatched but has + * not received a reply for yet. + * + * Generated from protobuf field int64 concurrent_dispatches_count = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $concurrent_dispatches_count = 0; + /** + * Output only. The current maximum number of tasks per second executed by the + * queue. The maximum value of this variable is controlled by the RateLimits + * of the Queue. However, this value could be less to avoid overloading the + * endpoints tasks in the queue are targeting. + * + * Generated from protobuf field double effective_execution_rate = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $effective_execution_rate = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $tasks_count + * Output only. An estimation of the number of tasks in the queue, that is, + * the tasks in the queue that haven't been executed, the tasks in the queue + * which the queue has dispatched but has not yet received a reply for, and + * the failed tasks that the queue is retrying. + * @type \Google\Protobuf\Timestamp $oldest_estimated_arrival_time + * Output only. An estimation of the nearest time in the future where a task + * in the queue is scheduled to be executed. + * @type int|string $executed_last_minute_count + * Output only. The number of tasks that the queue has dispatched and received + * a reply for during the last minute. This variable counts both successful + * and non-successful executions. + * @type int|string $concurrent_dispatches_count + * Output only. The number of requests that the queue has dispatched but has + * not received a reply for yet. + * @type float $effective_execution_rate + * Output only. The current maximum number of tasks per second executed by the + * queue. The maximum value of this variable is controlled by the RateLimits + * of the Queue. However, this value could be less to avoid overloading the + * endpoints tasks in the queue are targeting. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Queue::initOnce(); + parent::__construct($data); + } + + /** + * Output only. An estimation of the number of tasks in the queue, that is, + * the tasks in the queue that haven't been executed, the tasks in the queue + * which the queue has dispatched but has not yet received a reply for, and + * the failed tasks that the queue is retrying. + * + * Generated from protobuf field int64 tasks_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getTasksCount() + { + return $this->tasks_count; + } + + /** + * Output only. An estimation of the number of tasks in the queue, that is, + * the tasks in the queue that haven't been executed, the tasks in the queue + * which the queue has dispatched but has not yet received a reply for, and + * the failed tasks that the queue is retrying. + * + * Generated from protobuf field int64 tasks_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setTasksCount($var) + { + GPBUtil::checkInt64($var); + $this->tasks_count = $var; + + return $this; + } + + /** + * Output only. An estimation of the nearest time in the future where a task + * in the queue is scheduled to be executed. + * + * Generated from protobuf field .google.protobuf.Timestamp oldest_estimated_arrival_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getOldestEstimatedArrivalTime() + { + return $this->oldest_estimated_arrival_time; + } + + public function hasOldestEstimatedArrivalTime() + { + return isset($this->oldest_estimated_arrival_time); + } + + public function clearOldestEstimatedArrivalTime() + { + unset($this->oldest_estimated_arrival_time); + } + + /** + * Output only. An estimation of the nearest time in the future where a task + * in the queue is scheduled to be executed. + * + * Generated from protobuf field .google.protobuf.Timestamp oldest_estimated_arrival_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setOldestEstimatedArrivalTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->oldest_estimated_arrival_time = $var; + + return $this; + } + + /** + * Output only. The number of tasks that the queue has dispatched and received + * a reply for during the last minute. This variable counts both successful + * and non-successful executions. + * + * Generated from protobuf field int64 executed_last_minute_count = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getExecutedLastMinuteCount() + { + return $this->executed_last_minute_count; + } + + /** + * Output only. The number of tasks that the queue has dispatched and received + * a reply for during the last minute. This variable counts both successful + * and non-successful executions. + * + * Generated from protobuf field int64 executed_last_minute_count = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setExecutedLastMinuteCount($var) + { + GPBUtil::checkInt64($var); + $this->executed_last_minute_count = $var; + + return $this; + } + + /** + * Output only. The number of requests that the queue has dispatched but has + * not received a reply for yet. + * + * Generated from protobuf field int64 concurrent_dispatches_count = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getConcurrentDispatchesCount() + { + return $this->concurrent_dispatches_count; + } + + /** + * Output only. The number of requests that the queue has dispatched but has + * not received a reply for yet. + * + * Generated from protobuf field int64 concurrent_dispatches_count = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setConcurrentDispatchesCount($var) + { + GPBUtil::checkInt64($var); + $this->concurrent_dispatches_count = $var; + + return $this; + } + + /** + * Output only. The current maximum number of tasks per second executed by the + * queue. The maximum value of this variable is controlled by the RateLimits + * of the Queue. However, this value could be less to avoid overloading the + * endpoints tasks in the queue are targeting. + * + * Generated from protobuf field double effective_execution_rate = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return float + */ + public function getEffectiveExecutionRate() + { + return $this->effective_execution_rate; + } + + /** + * Output only. The current maximum number of tasks per second executed by the + * queue. The maximum value of this variable is controlled by the RateLimits + * of the Queue. However, this value could be less to avoid overloading the + * endpoints tasks in the queue are targeting. + * + * Generated from protobuf field double effective_execution_rate = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param float $var + * @return $this + */ + public function setEffectiveExecutionRate($var) + { + GPBUtil::checkDouble($var); + $this->effective_execution_rate = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/RateLimits.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/RateLimits.php new file mode 100644 index 000000000000..9e87d52e942a --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/RateLimits.php @@ -0,0 +1,317 @@ +google.cloud.tasks.v2beta3.RateLimits + */ +class RateLimits extends \Google\Protobuf\Internal\Message +{ + /** + * The maximum rate at which tasks are dispatched from this queue. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * * For [App Engine queues][google.cloud.tasks.v2beta3.AppEngineHttpQueue], + * the maximum allowed value + * is 500. + * This field has the same meaning as + * [rate in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate). + * + * Generated from protobuf field double max_dispatches_per_second = 1; + */ + protected $max_dispatches_per_second = 0.0; + /** + * The max burst size. + * Max burst size limits how fast tasks in queue are processed when + * many tasks are in the queue and the rate is high. This field + * allows the queue to have a high rate so processing starts shortly + * after a task is enqueued, but still limits resource usage when + * many tasks are enqueued in a short period of time. + * The [token bucket](https://wikipedia.org/wiki/Token_Bucket) + * algorithm is used to control the rate of task dispatches. Each + * queue has a token bucket that holds tokens, up to the maximum + * specified by `max_burst_size`. Each time a task is dispatched, a + * token is removed from the bucket. Tasks will be dispatched until + * the queue's bucket runs out of tokens. The bucket will be + * continuously refilled with new tokens based on + * [max_dispatches_per_second][google.cloud.tasks.v2beta3.RateLimits.max_dispatches_per_second]. + * The default value of `max_burst_size` is picked by Cloud Tasks + * based on the value of + * [max_dispatches_per_second][google.cloud.tasks.v2beta3.RateLimits.max_dispatches_per_second]. + * The maximum value of `max_burst_size` is 500. + * For App Engine queues that were created or updated using + * `queue.yaml/xml`, `max_burst_size` is equal to + * [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size). + * If + * [UpdateQueue][google.cloud.tasks.v2beta3.CloudTasks.UpdateQueue] is called + * on a queue without explicitly setting a value for `max_burst_size`, + * `max_burst_size` value will get updated if + * [UpdateQueue][google.cloud.tasks.v2beta3.CloudTasks.UpdateQueue] is + * updating + * [max_dispatches_per_second][google.cloud.tasks.v2beta3.RateLimits.max_dispatches_per_second]. + * + * Generated from protobuf field int32 max_burst_size = 2; + */ + protected $max_burst_size = 0; + /** + * The maximum number of concurrent tasks that Cloud Tasks allows + * to be dispatched for this queue. After this threshold has been + * reached, Cloud Tasks stops dispatching tasks until the number of + * concurrent requests decreases. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * The maximum allowed value is 5,000. + * This field has the same meaning as + * [max_concurrent_requests in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests). + * + * Generated from protobuf field int32 max_concurrent_dispatches = 3; + */ + protected $max_concurrent_dispatches = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $max_dispatches_per_second + * The maximum rate at which tasks are dispatched from this queue. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * * For [App Engine queues][google.cloud.tasks.v2beta3.AppEngineHttpQueue], + * the maximum allowed value + * is 500. + * This field has the same meaning as + * [rate in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate). + * @type int $max_burst_size + * The max burst size. + * Max burst size limits how fast tasks in queue are processed when + * many tasks are in the queue and the rate is high. This field + * allows the queue to have a high rate so processing starts shortly + * after a task is enqueued, but still limits resource usage when + * many tasks are enqueued in a short period of time. + * The [token bucket](https://wikipedia.org/wiki/Token_Bucket) + * algorithm is used to control the rate of task dispatches. Each + * queue has a token bucket that holds tokens, up to the maximum + * specified by `max_burst_size`. Each time a task is dispatched, a + * token is removed from the bucket. Tasks will be dispatched until + * the queue's bucket runs out of tokens. The bucket will be + * continuously refilled with new tokens based on + * [max_dispatches_per_second][google.cloud.tasks.v2beta3.RateLimits.max_dispatches_per_second]. + * The default value of `max_burst_size` is picked by Cloud Tasks + * based on the value of + * [max_dispatches_per_second][google.cloud.tasks.v2beta3.RateLimits.max_dispatches_per_second]. + * The maximum value of `max_burst_size` is 500. + * For App Engine queues that were created or updated using + * `queue.yaml/xml`, `max_burst_size` is equal to + * [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size). + * If + * [UpdateQueue][google.cloud.tasks.v2beta3.CloudTasks.UpdateQueue] is called + * on a queue without explicitly setting a value for `max_burst_size`, + * `max_burst_size` value will get updated if + * [UpdateQueue][google.cloud.tasks.v2beta3.CloudTasks.UpdateQueue] is + * updating + * [max_dispatches_per_second][google.cloud.tasks.v2beta3.RateLimits.max_dispatches_per_second]. + * @type int $max_concurrent_dispatches + * The maximum number of concurrent tasks that Cloud Tasks allows + * to be dispatched for this queue. After this threshold has been + * reached, Cloud Tasks stops dispatching tasks until the number of + * concurrent requests decreases. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * The maximum allowed value is 5,000. + * This field has the same meaning as + * [max_concurrent_requests in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Queue::initOnce(); + parent::__construct($data); + } + + /** + * The maximum rate at which tasks are dispatched from this queue. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * * For [App Engine queues][google.cloud.tasks.v2beta3.AppEngineHttpQueue], + * the maximum allowed value + * is 500. + * This field has the same meaning as + * [rate in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate). + * + * Generated from protobuf field double max_dispatches_per_second = 1; + * @return float + */ + public function getMaxDispatchesPerSecond() + { + return $this->max_dispatches_per_second; + } + + /** + * The maximum rate at which tasks are dispatched from this queue. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * * For [App Engine queues][google.cloud.tasks.v2beta3.AppEngineHttpQueue], + * the maximum allowed value + * is 500. + * This field has the same meaning as + * [rate in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate). + * + * Generated from protobuf field double max_dispatches_per_second = 1; + * @param float $var + * @return $this + */ + public function setMaxDispatchesPerSecond($var) + { + GPBUtil::checkDouble($var); + $this->max_dispatches_per_second = $var; + + return $this; + } + + /** + * The max burst size. + * Max burst size limits how fast tasks in queue are processed when + * many tasks are in the queue and the rate is high. This field + * allows the queue to have a high rate so processing starts shortly + * after a task is enqueued, but still limits resource usage when + * many tasks are enqueued in a short period of time. + * The [token bucket](https://wikipedia.org/wiki/Token_Bucket) + * algorithm is used to control the rate of task dispatches. Each + * queue has a token bucket that holds tokens, up to the maximum + * specified by `max_burst_size`. Each time a task is dispatched, a + * token is removed from the bucket. Tasks will be dispatched until + * the queue's bucket runs out of tokens. The bucket will be + * continuously refilled with new tokens based on + * [max_dispatches_per_second][google.cloud.tasks.v2beta3.RateLimits.max_dispatches_per_second]. + * The default value of `max_burst_size` is picked by Cloud Tasks + * based on the value of + * [max_dispatches_per_second][google.cloud.tasks.v2beta3.RateLimits.max_dispatches_per_second]. + * The maximum value of `max_burst_size` is 500. + * For App Engine queues that were created or updated using + * `queue.yaml/xml`, `max_burst_size` is equal to + * [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size). + * If + * [UpdateQueue][google.cloud.tasks.v2beta3.CloudTasks.UpdateQueue] is called + * on a queue without explicitly setting a value for `max_burst_size`, + * `max_burst_size` value will get updated if + * [UpdateQueue][google.cloud.tasks.v2beta3.CloudTasks.UpdateQueue] is + * updating + * [max_dispatches_per_second][google.cloud.tasks.v2beta3.RateLimits.max_dispatches_per_second]. + * + * Generated from protobuf field int32 max_burst_size = 2; + * @return int + */ + public function getMaxBurstSize() + { + return $this->max_burst_size; + } + + /** + * The max burst size. + * Max burst size limits how fast tasks in queue are processed when + * many tasks are in the queue and the rate is high. This field + * allows the queue to have a high rate so processing starts shortly + * after a task is enqueued, but still limits resource usage when + * many tasks are enqueued in a short period of time. + * The [token bucket](https://wikipedia.org/wiki/Token_Bucket) + * algorithm is used to control the rate of task dispatches. Each + * queue has a token bucket that holds tokens, up to the maximum + * specified by `max_burst_size`. Each time a task is dispatched, a + * token is removed from the bucket. Tasks will be dispatched until + * the queue's bucket runs out of tokens. The bucket will be + * continuously refilled with new tokens based on + * [max_dispatches_per_second][google.cloud.tasks.v2beta3.RateLimits.max_dispatches_per_second]. + * The default value of `max_burst_size` is picked by Cloud Tasks + * based on the value of + * [max_dispatches_per_second][google.cloud.tasks.v2beta3.RateLimits.max_dispatches_per_second]. + * The maximum value of `max_burst_size` is 500. + * For App Engine queues that were created or updated using + * `queue.yaml/xml`, `max_burst_size` is equal to + * [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size). + * If + * [UpdateQueue][google.cloud.tasks.v2beta3.CloudTasks.UpdateQueue] is called + * on a queue without explicitly setting a value for `max_burst_size`, + * `max_burst_size` value will get updated if + * [UpdateQueue][google.cloud.tasks.v2beta3.CloudTasks.UpdateQueue] is + * updating + * [max_dispatches_per_second][google.cloud.tasks.v2beta3.RateLimits.max_dispatches_per_second]. + * + * Generated from protobuf field int32 max_burst_size = 2; + * @param int $var + * @return $this + */ + public function setMaxBurstSize($var) + { + GPBUtil::checkInt32($var); + $this->max_burst_size = $var; + + return $this; + } + + /** + * The maximum number of concurrent tasks that Cloud Tasks allows + * to be dispatched for this queue. After this threshold has been + * reached, Cloud Tasks stops dispatching tasks until the number of + * concurrent requests decreases. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * The maximum allowed value is 5,000. + * This field has the same meaning as + * [max_concurrent_requests in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests). + * + * Generated from protobuf field int32 max_concurrent_dispatches = 3; + * @return int + */ + public function getMaxConcurrentDispatches() + { + return $this->max_concurrent_dispatches; + } + + /** + * The maximum number of concurrent tasks that Cloud Tasks allows + * to be dispatched for this queue. After this threshold has been + * reached, Cloud Tasks stops dispatching tasks until the number of + * concurrent requests decreases. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * The maximum allowed value is 5,000. + * This field has the same meaning as + * [max_concurrent_requests in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests). + * + * Generated from protobuf field int32 max_concurrent_dispatches = 3; + * @param int $var + * @return $this + */ + public function setMaxConcurrentDispatches($var) + { + GPBUtil::checkInt32($var); + $this->max_concurrent_dispatches = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ResumeQueueRequest.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ResumeQueueRequest.php new file mode 100644 index 000000000000..c1b61275d139 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ResumeQueueRequest.php @@ -0,0 +1,72 @@ +google.cloud.tasks.v2beta3.ResumeQueueRequest + */ +class ResumeQueueRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/RetryConfig.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/RetryConfig.php new file mode 100644 index 000000000000..39fa65ea3b58 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/RetryConfig.php @@ -0,0 +1,502 @@ +google.cloud.tasks.v2beta3.RetryConfig + */ +class RetryConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Number of attempts per task. + * Cloud Tasks will attempt the task `max_attempts` times (that is, if the + * first attempt fails, then there will be `max_attempts - 1` retries). Must + * be >= -1. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * -1 indicates unlimited attempts. + * This field has the same meaning as + * [task_retry_limit in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * + * Generated from protobuf field int32 max_attempts = 1; + */ + protected $max_attempts = 0; + /** + * If positive, `max_retry_duration` specifies the time limit for + * retrying a failed task, measured from when the task was first + * attempted. Once `max_retry_duration` time has passed *and* the + * task has been attempted + * [max_attempts][google.cloud.tasks.v2beta3.RetryConfig.max_attempts] times, + * no further attempts will be made and the task will be deleted. + * If zero, then the task age is unlimited. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * `max_retry_duration` will be truncated to the nearest second. + * This field has the same meaning as + * [task_age_limit in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * + * Generated from protobuf field .google.protobuf.Duration max_retry_duration = 2; + */ + protected $max_retry_duration = null; + /** + * A task will be [scheduled][google.cloud.tasks.v2beta3.Task.schedule_time] + * for retry between + * [min_backoff][google.cloud.tasks.v2beta3.RetryConfig.min_backoff] and + * [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] duration + * after it fails, if the queue's + * [RetryConfig][google.cloud.tasks.v2beta3.RetryConfig] specifies that the + * task should be retried. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * `min_backoff` will be truncated to the nearest second. + * This field has the same meaning as + * [min_backoff_seconds in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * + * Generated from protobuf field .google.protobuf.Duration min_backoff = 3; + */ + protected $min_backoff = null; + /** + * A task will be [scheduled][google.cloud.tasks.v2beta3.Task.schedule_time] + * for retry between + * [min_backoff][google.cloud.tasks.v2beta3.RetryConfig.min_backoff] and + * [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] duration + * after it fails, if the queue's + * [RetryConfig][google.cloud.tasks.v2beta3.RetryConfig] specifies that the + * task should be retried. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * `max_backoff` will be truncated to the nearest second. + * This field has the same meaning as + * [max_backoff_seconds in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * + * Generated from protobuf field .google.protobuf.Duration max_backoff = 4; + */ + protected $max_backoff = null; + /** + * The time between retries will double `max_doublings` times. + * A task's retry interval starts at + * [min_backoff][google.cloud.tasks.v2beta3.RetryConfig.min_backoff], then + * doubles `max_doublings` times, then increases linearly, and finally retries + * at intervals of + * [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] up to + * [max_attempts][google.cloud.tasks.v2beta3.RetryConfig.max_attempts] times. + * For example, if + * [min_backoff][google.cloud.tasks.v2beta3.RetryConfig.min_backoff] is 10s, + * [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] is 300s, + * and `max_doublings` is 3, then the a task will first be retried in 10s. The + * retry interval will double three times, and then increase linearly by 2^3 * + * 10s. Finally, the task will retry at intervals of + * [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] until the + * task has been attempted + * [max_attempts][google.cloud.tasks.v2beta3.RetryConfig.max_attempts] times. + * Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, + * 300s, .... + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * This field has the same meaning as + * [max_doublings in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * + * Generated from protobuf field int32 max_doublings = 5; + */ + protected $max_doublings = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $max_attempts + * Number of attempts per task. + * Cloud Tasks will attempt the task `max_attempts` times (that is, if the + * first attempt fails, then there will be `max_attempts - 1` retries). Must + * be >= -1. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * -1 indicates unlimited attempts. + * This field has the same meaning as + * [task_retry_limit in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * @type \Google\Protobuf\Duration $max_retry_duration + * If positive, `max_retry_duration` specifies the time limit for + * retrying a failed task, measured from when the task was first + * attempted. Once `max_retry_duration` time has passed *and* the + * task has been attempted + * [max_attempts][google.cloud.tasks.v2beta3.RetryConfig.max_attempts] times, + * no further attempts will be made and the task will be deleted. + * If zero, then the task age is unlimited. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * `max_retry_duration` will be truncated to the nearest second. + * This field has the same meaning as + * [task_age_limit in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * @type \Google\Protobuf\Duration $min_backoff + * A task will be [scheduled][google.cloud.tasks.v2beta3.Task.schedule_time] + * for retry between + * [min_backoff][google.cloud.tasks.v2beta3.RetryConfig.min_backoff] and + * [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] duration + * after it fails, if the queue's + * [RetryConfig][google.cloud.tasks.v2beta3.RetryConfig] specifies that the + * task should be retried. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * `min_backoff` will be truncated to the nearest second. + * This field has the same meaning as + * [min_backoff_seconds in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * @type \Google\Protobuf\Duration $max_backoff + * A task will be [scheduled][google.cloud.tasks.v2beta3.Task.schedule_time] + * for retry between + * [min_backoff][google.cloud.tasks.v2beta3.RetryConfig.min_backoff] and + * [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] duration + * after it fails, if the queue's + * [RetryConfig][google.cloud.tasks.v2beta3.RetryConfig] specifies that the + * task should be retried. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * `max_backoff` will be truncated to the nearest second. + * This field has the same meaning as + * [max_backoff_seconds in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * @type int $max_doublings + * The time between retries will double `max_doublings` times. + * A task's retry interval starts at + * [min_backoff][google.cloud.tasks.v2beta3.RetryConfig.min_backoff], then + * doubles `max_doublings` times, then increases linearly, and finally retries + * at intervals of + * [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] up to + * [max_attempts][google.cloud.tasks.v2beta3.RetryConfig.max_attempts] times. + * For example, if + * [min_backoff][google.cloud.tasks.v2beta3.RetryConfig.min_backoff] is 10s, + * [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] is 300s, + * and `max_doublings` is 3, then the a task will first be retried in 10s. The + * retry interval will double three times, and then increase linearly by 2^3 * + * 10s. Finally, the task will retry at intervals of + * [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] until the + * task has been attempted + * [max_attempts][google.cloud.tasks.v2beta3.RetryConfig.max_attempts] times. + * Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, + * 300s, .... + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * This field has the same meaning as + * [max_doublings in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Queue::initOnce(); + parent::__construct($data); + } + + /** + * Number of attempts per task. + * Cloud Tasks will attempt the task `max_attempts` times (that is, if the + * first attempt fails, then there will be `max_attempts - 1` retries). Must + * be >= -1. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * -1 indicates unlimited attempts. + * This field has the same meaning as + * [task_retry_limit in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * + * Generated from protobuf field int32 max_attempts = 1; + * @return int + */ + public function getMaxAttempts() + { + return $this->max_attempts; + } + + /** + * Number of attempts per task. + * Cloud Tasks will attempt the task `max_attempts` times (that is, if the + * first attempt fails, then there will be `max_attempts - 1` retries). Must + * be >= -1. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * -1 indicates unlimited attempts. + * This field has the same meaning as + * [task_retry_limit in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * + * Generated from protobuf field int32 max_attempts = 1; + * @param int $var + * @return $this + */ + public function setMaxAttempts($var) + { + GPBUtil::checkInt32($var); + $this->max_attempts = $var; + + return $this; + } + + /** + * If positive, `max_retry_duration` specifies the time limit for + * retrying a failed task, measured from when the task was first + * attempted. Once `max_retry_duration` time has passed *and* the + * task has been attempted + * [max_attempts][google.cloud.tasks.v2beta3.RetryConfig.max_attempts] times, + * no further attempts will be made and the task will be deleted. + * If zero, then the task age is unlimited. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * `max_retry_duration` will be truncated to the nearest second. + * This field has the same meaning as + * [task_age_limit in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * + * Generated from protobuf field .google.protobuf.Duration max_retry_duration = 2; + * @return \Google\Protobuf\Duration|null + */ + public function getMaxRetryDuration() + { + return $this->max_retry_duration; + } + + public function hasMaxRetryDuration() + { + return isset($this->max_retry_duration); + } + + public function clearMaxRetryDuration() + { + unset($this->max_retry_duration); + } + + /** + * If positive, `max_retry_duration` specifies the time limit for + * retrying a failed task, measured from when the task was first + * attempted. Once `max_retry_duration` time has passed *and* the + * task has been attempted + * [max_attempts][google.cloud.tasks.v2beta3.RetryConfig.max_attempts] times, + * no further attempts will be made and the task will be deleted. + * If zero, then the task age is unlimited. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * `max_retry_duration` will be truncated to the nearest second. + * This field has the same meaning as + * [task_age_limit in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * + * Generated from protobuf field .google.protobuf.Duration max_retry_duration = 2; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setMaxRetryDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->max_retry_duration = $var; + + return $this; + } + + /** + * A task will be [scheduled][google.cloud.tasks.v2beta3.Task.schedule_time] + * for retry between + * [min_backoff][google.cloud.tasks.v2beta3.RetryConfig.min_backoff] and + * [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] duration + * after it fails, if the queue's + * [RetryConfig][google.cloud.tasks.v2beta3.RetryConfig] specifies that the + * task should be retried. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * `min_backoff` will be truncated to the nearest second. + * This field has the same meaning as + * [min_backoff_seconds in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * + * Generated from protobuf field .google.protobuf.Duration min_backoff = 3; + * @return \Google\Protobuf\Duration|null + */ + public function getMinBackoff() + { + return $this->min_backoff; + } + + public function hasMinBackoff() + { + return isset($this->min_backoff); + } + + public function clearMinBackoff() + { + unset($this->min_backoff); + } + + /** + * A task will be [scheduled][google.cloud.tasks.v2beta3.Task.schedule_time] + * for retry between + * [min_backoff][google.cloud.tasks.v2beta3.RetryConfig.min_backoff] and + * [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] duration + * after it fails, if the queue's + * [RetryConfig][google.cloud.tasks.v2beta3.RetryConfig] specifies that the + * task should be retried. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * `min_backoff` will be truncated to the nearest second. + * This field has the same meaning as + * [min_backoff_seconds in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * + * Generated from protobuf field .google.protobuf.Duration min_backoff = 3; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setMinBackoff($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->min_backoff = $var; + + return $this; + } + + /** + * A task will be [scheduled][google.cloud.tasks.v2beta3.Task.schedule_time] + * for retry between + * [min_backoff][google.cloud.tasks.v2beta3.RetryConfig.min_backoff] and + * [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] duration + * after it fails, if the queue's + * [RetryConfig][google.cloud.tasks.v2beta3.RetryConfig] specifies that the + * task should be retried. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * `max_backoff` will be truncated to the nearest second. + * This field has the same meaning as + * [max_backoff_seconds in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * + * Generated from protobuf field .google.protobuf.Duration max_backoff = 4; + * @return \Google\Protobuf\Duration|null + */ + public function getMaxBackoff() + { + return $this->max_backoff; + } + + public function hasMaxBackoff() + { + return isset($this->max_backoff); + } + + public function clearMaxBackoff() + { + unset($this->max_backoff); + } + + /** + * A task will be [scheduled][google.cloud.tasks.v2beta3.Task.schedule_time] + * for retry between + * [min_backoff][google.cloud.tasks.v2beta3.RetryConfig.min_backoff] and + * [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] duration + * after it fails, if the queue's + * [RetryConfig][google.cloud.tasks.v2beta3.RetryConfig] specifies that the + * task should be retried. + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * `max_backoff` will be truncated to the nearest second. + * This field has the same meaning as + * [max_backoff_seconds in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * + * Generated from protobuf field .google.protobuf.Duration max_backoff = 4; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setMaxBackoff($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->max_backoff = $var; + + return $this; + } + + /** + * The time between retries will double `max_doublings` times. + * A task's retry interval starts at + * [min_backoff][google.cloud.tasks.v2beta3.RetryConfig.min_backoff], then + * doubles `max_doublings` times, then increases linearly, and finally retries + * at intervals of + * [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] up to + * [max_attempts][google.cloud.tasks.v2beta3.RetryConfig.max_attempts] times. + * For example, if + * [min_backoff][google.cloud.tasks.v2beta3.RetryConfig.min_backoff] is 10s, + * [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] is 300s, + * and `max_doublings` is 3, then the a task will first be retried in 10s. The + * retry interval will double three times, and then increase linearly by 2^3 * + * 10s. Finally, the task will retry at intervals of + * [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] until the + * task has been attempted + * [max_attempts][google.cloud.tasks.v2beta3.RetryConfig.max_attempts] times. + * Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, + * 300s, .... + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * This field has the same meaning as + * [max_doublings in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * + * Generated from protobuf field int32 max_doublings = 5; + * @return int + */ + public function getMaxDoublings() + { + return $this->max_doublings; + } + + /** + * The time between retries will double `max_doublings` times. + * A task's retry interval starts at + * [min_backoff][google.cloud.tasks.v2beta3.RetryConfig.min_backoff], then + * doubles `max_doublings` times, then increases linearly, and finally retries + * at intervals of + * [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] up to + * [max_attempts][google.cloud.tasks.v2beta3.RetryConfig.max_attempts] times. + * For example, if + * [min_backoff][google.cloud.tasks.v2beta3.RetryConfig.min_backoff] is 10s, + * [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] is 300s, + * and `max_doublings` is 3, then the a task will first be retried in 10s. The + * retry interval will double three times, and then increase linearly by 2^3 * + * 10s. Finally, the task will retry at intervals of + * [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] until the + * task has been attempted + * [max_attempts][google.cloud.tasks.v2beta3.RetryConfig.max_attempts] times. + * Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, + * 300s, .... + * If unspecified when the queue is created, Cloud Tasks will pick the + * default. + * This field has the same meaning as + * [max_doublings in + * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + * + * Generated from protobuf field int32 max_doublings = 5; + * @param int $var + * @return $this + */ + public function setMaxDoublings($var) + { + GPBUtil::checkInt32($var); + $this->max_doublings = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/RunTaskRequest.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/RunTaskRequest.php new file mode 100644 index 000000000000..01e52b93e151 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/RunTaskRequest.php @@ -0,0 +1,146 @@ +google.cloud.tasks.v2beta3.RunTaskRequest + */ +class RunTaskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta3.Task] will be returned. + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta3.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.Task.View response_view = 2; + */ + protected $response_view = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * @type int $response_view + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta3.Task] will be returned. + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta3.Task] resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta3.Task] will be returned. + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta3.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.Task.View response_view = 2; + * @return int + */ + public function getResponseView() + { + return $this->response_view; + } + + /** + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta3.Task] will be returned. + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta3.Task] resource. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.Task.View response_view = 2; + * @param int $var + * @return $this + */ + public function setResponseView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta3\Task\View::class); + $this->response_view = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/StackdriverLoggingConfig.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/StackdriverLoggingConfig.php new file mode 100644 index 000000000000..77ae9bd3407e --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/StackdriverLoggingConfig.php @@ -0,0 +1,80 @@ +google.cloud.tasks.v2beta3.StackdriverLoggingConfig + */ +class StackdriverLoggingConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies the fraction of operations to write to + * [Stackdriver Logging](https://cloud.google.com/logging/docs/). + * This field may contain any value between 0.0 and 1.0, inclusive. + * 0.0 is the default and means that no operations are logged. + * + * Generated from protobuf field double sampling_ratio = 1; + */ + protected $sampling_ratio = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $sampling_ratio + * Specifies the fraction of operations to write to + * [Stackdriver Logging](https://cloud.google.com/logging/docs/). + * This field may contain any value between 0.0 and 1.0, inclusive. + * 0.0 is the default and means that no operations are logged. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Queue::initOnce(); + parent::__construct($data); + } + + /** + * Specifies the fraction of operations to write to + * [Stackdriver Logging](https://cloud.google.com/logging/docs/). + * This field may contain any value between 0.0 and 1.0, inclusive. + * 0.0 is the default and means that no operations are logged. + * + * Generated from protobuf field double sampling_ratio = 1; + * @return float + */ + public function getSamplingRatio() + { + return $this->sampling_ratio; + } + + /** + * Specifies the fraction of operations to write to + * [Stackdriver Logging](https://cloud.google.com/logging/docs/). + * This field may contain any value between 0.0 and 1.0, inclusive. + * 0.0 is the default and means that no operations are logged. + * + * Generated from protobuf field double sampling_ratio = 1; + * @param float $var + * @return $this + */ + public function setSamplingRatio($var) + { + GPBUtil::checkDouble($var); + $this->sampling_ratio = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Task.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Task.php new file mode 100644 index 000000000000..5663cef6459a --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Task.php @@ -0,0 +1,746 @@ +google.cloud.tasks.v2beta3.Task + */ +class Task extends \Google\Protobuf\Internal\Message +{ + /** + * Optionally caller-specified in + * [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. + * The task name. + * The task name must have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), + * hyphens (-), colons (:), or periods (.). + * For more information, see + * [Identifying + * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) + * * `LOCATION_ID` is the canonical ID for the task's location. + * The list of available locations can be obtained by calling + * [ListLocations][google.cloud.location.Locations.ListLocations]. + * For more information, see https://cloud.google.com/about/locations/. + * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or + * hyphens (-). The maximum length is 100 characters. + * * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), + * hyphens (-), or underscores (_). The maximum length is 500 characters. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The time when the task is scheduled to be attempted. + * For App Engine queues, this is when the task will be attempted or retried. + * `schedule_time` will be truncated to the nearest microsecond. + * + * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 4; + */ + protected $schedule_time = null; + /** + * Output only. The time that the task was created. + * `create_time` will be truncated to the nearest second. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; + */ + protected $create_time = null; + /** + * The deadline for requests sent to the worker. If the worker does not + * respond by this deadline then the request is cancelled and the attempt + * is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the + * task according to the + * [RetryConfig][google.cloud.tasks.v2beta3.RetryConfig]. + * Note that when the request is cancelled, Cloud Tasks will stop listening + * for the response, but whether the worker stops processing depends on the + * worker. For example, if the worker is stuck, it may not react to cancelled + * requests. + * The default and maximum values depend on the type of request: + * * For [HTTP tasks][google.cloud.tasks.v2beta3.HttpRequest], the default is + * 10 minutes. The deadline + * must be in the interval [15 seconds, 30 minutes]. + * * For [App Engine tasks][google.cloud.tasks.v2beta3.AppEngineHttpRequest], + * 0 indicates that the + * request has the default deadline. The default deadline depends on the + * [scaling + * type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling) + * of the service: 10 minutes for standard apps with automatic scaling, 24 + * hours for standard apps with manual and basic scaling, and 60 minutes for + * flex apps. If the request deadline is set, it must be in the interval [15 + * seconds, 24 hours 15 seconds]. Regardless of the task's + * `dispatch_deadline`, the app handler will not run for longer than than + * the service's timeout. We recommend setting the `dispatch_deadline` to + * at most a few seconds more than the app handler's timeout. For more + * information see + * [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts). + * `dispatch_deadline` will be truncated to the nearest millisecond. The + * deadline is an approximate deadline. + * + * Generated from protobuf field .google.protobuf.Duration dispatch_deadline = 12; + */ + protected $dispatch_deadline = null; + /** + * Output only. The number of attempts dispatched. + * This count includes attempts which have been dispatched but haven't + * received a response. + * + * Generated from protobuf field int32 dispatch_count = 6; + */ + protected $dispatch_count = 0; + /** + * Output only. The number of attempts which have received a response. + * + * Generated from protobuf field int32 response_count = 7; + */ + protected $response_count = 0; + /** + * Output only. The status of the task's first attempt. + * Only [dispatch_time][google.cloud.tasks.v2beta3.Attempt.dispatch_time] will + * be set. The other [Attempt][google.cloud.tasks.v2beta3.Attempt] information + * is not retained by Cloud Tasks. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.Attempt first_attempt = 8; + */ + protected $first_attempt = null; + /** + * Output only. The status of the task's last attempt. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.Attempt last_attempt = 9; + */ + protected $last_attempt = null; + /** + * Output only. The view specifies which subset of the + * [Task][google.cloud.tasks.v2beta3.Task] has been returned. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.Task.View view = 10; + */ + protected $view = 0; + protected $payload_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Optionally caller-specified in + * [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. + * The task name. + * The task name must have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), + * hyphens (-), colons (:), or periods (.). + * For more information, see + * [Identifying + * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) + * * `LOCATION_ID` is the canonical ID for the task's location. + * The list of available locations can be obtained by calling + * [ListLocations][google.cloud.location.Locations.ListLocations]. + * For more information, see https://cloud.google.com/about/locations/. + * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or + * hyphens (-). The maximum length is 100 characters. + * * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), + * hyphens (-), or underscores (_). The maximum length is 500 characters. + * @type \Google\Cloud\Tasks\V2beta3\AppEngineHttpRequest $app_engine_http_request + * HTTP request that is sent to the App Engine app handler. + * An App Engine task is a task that has + * [AppEngineHttpRequest][google.cloud.tasks.v2beta3.AppEngineHttpRequest] + * set. + * @type \Google\Cloud\Tasks\V2beta3\HttpRequest $http_request + * HTTP request that is sent to the task's target. + * An HTTP task is a task that has + * [HttpRequest][google.cloud.tasks.v2beta3.HttpRequest] set. + * @type \Google\Cloud\Tasks\V2beta3\PullMessage $pull_message + * Pull Message contained in a task in a + * [PULL][google.cloud.tasks.v2beta3.Queue.type] queue type. This payload + * type cannot be explicitly set through Cloud Tasks API. Its purpose, + * currently is to provide backward compatibility with App Engine Task Queue + * [pull](https://cloud.google.com/appengine/docs/standard/java/taskqueue/pull/) + * queues to provide a way to inspect contents of pull tasks through the + * [CloudTasks.GetTask][google.cloud.tasks.v2beta3.CloudTasks.GetTask]. + * @type \Google\Protobuf\Timestamp $schedule_time + * The time when the task is scheduled to be attempted. + * For App Engine queues, this is when the task will be attempted or retried. + * `schedule_time` will be truncated to the nearest microsecond. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time that the task was created. + * `create_time` will be truncated to the nearest second. + * @type \Google\Protobuf\Duration $dispatch_deadline + * The deadline for requests sent to the worker. If the worker does not + * respond by this deadline then the request is cancelled and the attempt + * is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the + * task according to the + * [RetryConfig][google.cloud.tasks.v2beta3.RetryConfig]. + * Note that when the request is cancelled, Cloud Tasks will stop listening + * for the response, but whether the worker stops processing depends on the + * worker. For example, if the worker is stuck, it may not react to cancelled + * requests. + * The default and maximum values depend on the type of request: + * * For [HTTP tasks][google.cloud.tasks.v2beta3.HttpRequest], the default is + * 10 minutes. The deadline + * must be in the interval [15 seconds, 30 minutes]. + * * For [App Engine tasks][google.cloud.tasks.v2beta3.AppEngineHttpRequest], + * 0 indicates that the + * request has the default deadline. The default deadline depends on the + * [scaling + * type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling) + * of the service: 10 minutes for standard apps with automatic scaling, 24 + * hours for standard apps with manual and basic scaling, and 60 minutes for + * flex apps. If the request deadline is set, it must be in the interval [15 + * seconds, 24 hours 15 seconds]. Regardless of the task's + * `dispatch_deadline`, the app handler will not run for longer than than + * the service's timeout. We recommend setting the `dispatch_deadline` to + * at most a few seconds more than the app handler's timeout. For more + * information see + * [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts). + * `dispatch_deadline` will be truncated to the nearest millisecond. The + * deadline is an approximate deadline. + * @type int $dispatch_count + * Output only. The number of attempts dispatched. + * This count includes attempts which have been dispatched but haven't + * received a response. + * @type int $response_count + * Output only. The number of attempts which have received a response. + * @type \Google\Cloud\Tasks\V2beta3\Attempt $first_attempt + * Output only. The status of the task's first attempt. + * Only [dispatch_time][google.cloud.tasks.v2beta3.Attempt.dispatch_time] will + * be set. The other [Attempt][google.cloud.tasks.v2beta3.Attempt] information + * is not retained by Cloud Tasks. + * @type \Google\Cloud\Tasks\V2beta3\Attempt $last_attempt + * Output only. The status of the task's last attempt. + * @type int $view + * Output only. The view specifies which subset of the + * [Task][google.cloud.tasks.v2beta3.Task] has been returned. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Task::initOnce(); + parent::__construct($data); + } + + /** + * Optionally caller-specified in + * [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. + * The task name. + * The task name must have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), + * hyphens (-), colons (:), or periods (.). + * For more information, see + * [Identifying + * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) + * * `LOCATION_ID` is the canonical ID for the task's location. + * The list of available locations can be obtained by calling + * [ListLocations][google.cloud.location.Locations.ListLocations]. + * For more information, see https://cloud.google.com/about/locations/. + * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or + * hyphens (-). The maximum length is 100 characters. + * * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), + * hyphens (-), or underscores (_). The maximum length is 500 characters. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Optionally caller-specified in + * [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. + * The task name. + * The task name must have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), + * hyphens (-), colons (:), or periods (.). + * For more information, see + * [Identifying + * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) + * * `LOCATION_ID` is the canonical ID for the task's location. + * The list of available locations can be obtained by calling + * [ListLocations][google.cloud.location.Locations.ListLocations]. + * For more information, see https://cloud.google.com/about/locations/. + * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or + * hyphens (-). The maximum length is 100 characters. + * * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), + * hyphens (-), or underscores (_). The maximum length is 500 characters. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * HTTP request that is sent to the App Engine app handler. + * An App Engine task is a task that has + * [AppEngineHttpRequest][google.cloud.tasks.v2beta3.AppEngineHttpRequest] + * set. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.AppEngineHttpRequest app_engine_http_request = 3; + * @return \Google\Cloud\Tasks\V2beta3\AppEngineHttpRequest|null + */ + public function getAppEngineHttpRequest() + { + return $this->readOneof(3); + } + + public function hasAppEngineHttpRequest() + { + return $this->hasOneof(3); + } + + /** + * HTTP request that is sent to the App Engine app handler. + * An App Engine task is a task that has + * [AppEngineHttpRequest][google.cloud.tasks.v2beta3.AppEngineHttpRequest] + * set. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.AppEngineHttpRequest app_engine_http_request = 3; + * @param \Google\Cloud\Tasks\V2beta3\AppEngineHttpRequest $var + * @return $this + */ + public function setAppEngineHttpRequest($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\AppEngineHttpRequest::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * HTTP request that is sent to the task's target. + * An HTTP task is a task that has + * [HttpRequest][google.cloud.tasks.v2beta3.HttpRequest] set. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.HttpRequest http_request = 11; + * @return \Google\Cloud\Tasks\V2beta3\HttpRequest|null + */ + public function getHttpRequest() + { + return $this->readOneof(11); + } + + public function hasHttpRequest() + { + return $this->hasOneof(11); + } + + /** + * HTTP request that is sent to the task's target. + * An HTTP task is a task that has + * [HttpRequest][google.cloud.tasks.v2beta3.HttpRequest] set. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.HttpRequest http_request = 11; + * @param \Google\Cloud\Tasks\V2beta3\HttpRequest $var + * @return $this + */ + public function setHttpRequest($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\HttpRequest::class); + $this->writeOneof(11, $var); + + return $this; + } + + /** + * Pull Message contained in a task in a + * [PULL][google.cloud.tasks.v2beta3.Queue.type] queue type. This payload + * type cannot be explicitly set through Cloud Tasks API. Its purpose, + * currently is to provide backward compatibility with App Engine Task Queue + * [pull](https://cloud.google.com/appengine/docs/standard/java/taskqueue/pull/) + * queues to provide a way to inspect contents of pull tasks through the + * [CloudTasks.GetTask][google.cloud.tasks.v2beta3.CloudTasks.GetTask]. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.PullMessage pull_message = 13; + * @return \Google\Cloud\Tasks\V2beta3\PullMessage|null + */ + public function getPullMessage() + { + return $this->readOneof(13); + } + + public function hasPullMessage() + { + return $this->hasOneof(13); + } + + /** + * Pull Message contained in a task in a + * [PULL][google.cloud.tasks.v2beta3.Queue.type] queue type. This payload + * type cannot be explicitly set through Cloud Tasks API. Its purpose, + * currently is to provide backward compatibility with App Engine Task Queue + * [pull](https://cloud.google.com/appengine/docs/standard/java/taskqueue/pull/) + * queues to provide a way to inspect contents of pull tasks through the + * [CloudTasks.GetTask][google.cloud.tasks.v2beta3.CloudTasks.GetTask]. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.PullMessage pull_message = 13; + * @param \Google\Cloud\Tasks\V2beta3\PullMessage $var + * @return $this + */ + public function setPullMessage($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\PullMessage::class); + $this->writeOneof(13, $var); + + return $this; + } + + /** + * The time when the task is scheduled to be attempted. + * For App Engine queues, this is when the task will be attempted or retried. + * `schedule_time` will be truncated to the nearest microsecond. + * + * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getScheduleTime() + { + return $this->schedule_time; + } + + public function hasScheduleTime() + { + return isset($this->schedule_time); + } + + public function clearScheduleTime() + { + unset($this->schedule_time); + } + + /** + * The time when the task is scheduled to be attempted. + * For App Engine queues, this is when the task will be attempted or retried. + * `schedule_time` will be truncated to the nearest microsecond. + * + * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setScheduleTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->schedule_time = $var; + + return $this; + } + + /** + * Output only. The time that the task was created. + * `create_time` will be truncated to the nearest second. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time that the task was created. + * `create_time` will be truncated to the nearest second. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * The deadline for requests sent to the worker. If the worker does not + * respond by this deadline then the request is cancelled and the attempt + * is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the + * task according to the + * [RetryConfig][google.cloud.tasks.v2beta3.RetryConfig]. + * Note that when the request is cancelled, Cloud Tasks will stop listening + * for the response, but whether the worker stops processing depends on the + * worker. For example, if the worker is stuck, it may not react to cancelled + * requests. + * The default and maximum values depend on the type of request: + * * For [HTTP tasks][google.cloud.tasks.v2beta3.HttpRequest], the default is + * 10 minutes. The deadline + * must be in the interval [15 seconds, 30 minutes]. + * * For [App Engine tasks][google.cloud.tasks.v2beta3.AppEngineHttpRequest], + * 0 indicates that the + * request has the default deadline. The default deadline depends on the + * [scaling + * type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling) + * of the service: 10 minutes for standard apps with automatic scaling, 24 + * hours for standard apps with manual and basic scaling, and 60 minutes for + * flex apps. If the request deadline is set, it must be in the interval [15 + * seconds, 24 hours 15 seconds]. Regardless of the task's + * `dispatch_deadline`, the app handler will not run for longer than than + * the service's timeout. We recommend setting the `dispatch_deadline` to + * at most a few seconds more than the app handler's timeout. For more + * information see + * [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts). + * `dispatch_deadline` will be truncated to the nearest millisecond. The + * deadline is an approximate deadline. + * + * Generated from protobuf field .google.protobuf.Duration dispatch_deadline = 12; + * @return \Google\Protobuf\Duration|null + */ + public function getDispatchDeadline() + { + return $this->dispatch_deadline; + } + + public function hasDispatchDeadline() + { + return isset($this->dispatch_deadline); + } + + public function clearDispatchDeadline() + { + unset($this->dispatch_deadline); + } + + /** + * The deadline for requests sent to the worker. If the worker does not + * respond by this deadline then the request is cancelled and the attempt + * is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the + * task according to the + * [RetryConfig][google.cloud.tasks.v2beta3.RetryConfig]. + * Note that when the request is cancelled, Cloud Tasks will stop listening + * for the response, but whether the worker stops processing depends on the + * worker. For example, if the worker is stuck, it may not react to cancelled + * requests. + * The default and maximum values depend on the type of request: + * * For [HTTP tasks][google.cloud.tasks.v2beta3.HttpRequest], the default is + * 10 minutes. The deadline + * must be in the interval [15 seconds, 30 minutes]. + * * For [App Engine tasks][google.cloud.tasks.v2beta3.AppEngineHttpRequest], + * 0 indicates that the + * request has the default deadline. The default deadline depends on the + * [scaling + * type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling) + * of the service: 10 minutes for standard apps with automatic scaling, 24 + * hours for standard apps with manual and basic scaling, and 60 minutes for + * flex apps. If the request deadline is set, it must be in the interval [15 + * seconds, 24 hours 15 seconds]. Regardless of the task's + * `dispatch_deadline`, the app handler will not run for longer than than + * the service's timeout. We recommend setting the `dispatch_deadline` to + * at most a few seconds more than the app handler's timeout. For more + * information see + * [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts). + * `dispatch_deadline` will be truncated to the nearest millisecond. The + * deadline is an approximate deadline. + * + * Generated from protobuf field .google.protobuf.Duration dispatch_deadline = 12; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setDispatchDeadline($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->dispatch_deadline = $var; + + return $this; + } + + /** + * Output only. The number of attempts dispatched. + * This count includes attempts which have been dispatched but haven't + * received a response. + * + * Generated from protobuf field int32 dispatch_count = 6; + * @return int + */ + public function getDispatchCount() + { + return $this->dispatch_count; + } + + /** + * Output only. The number of attempts dispatched. + * This count includes attempts which have been dispatched but haven't + * received a response. + * + * Generated from protobuf field int32 dispatch_count = 6; + * @param int $var + * @return $this + */ + public function setDispatchCount($var) + { + GPBUtil::checkInt32($var); + $this->dispatch_count = $var; + + return $this; + } + + /** + * Output only. The number of attempts which have received a response. + * + * Generated from protobuf field int32 response_count = 7; + * @return int + */ + public function getResponseCount() + { + return $this->response_count; + } + + /** + * Output only. The number of attempts which have received a response. + * + * Generated from protobuf field int32 response_count = 7; + * @param int $var + * @return $this + */ + public function setResponseCount($var) + { + GPBUtil::checkInt32($var); + $this->response_count = $var; + + return $this; + } + + /** + * Output only. The status of the task's first attempt. + * Only [dispatch_time][google.cloud.tasks.v2beta3.Attempt.dispatch_time] will + * be set. The other [Attempt][google.cloud.tasks.v2beta3.Attempt] information + * is not retained by Cloud Tasks. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.Attempt first_attempt = 8; + * @return \Google\Cloud\Tasks\V2beta3\Attempt|null + */ + public function getFirstAttempt() + { + return $this->first_attempt; + } + + public function hasFirstAttempt() + { + return isset($this->first_attempt); + } + + public function clearFirstAttempt() + { + unset($this->first_attempt); + } + + /** + * Output only. The status of the task's first attempt. + * Only [dispatch_time][google.cloud.tasks.v2beta3.Attempt.dispatch_time] will + * be set. The other [Attempt][google.cloud.tasks.v2beta3.Attempt] information + * is not retained by Cloud Tasks. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.Attempt first_attempt = 8; + * @param \Google\Cloud\Tasks\V2beta3\Attempt $var + * @return $this + */ + public function setFirstAttempt($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\Attempt::class); + $this->first_attempt = $var; + + return $this; + } + + /** + * Output only. The status of the task's last attempt. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.Attempt last_attempt = 9; + * @return \Google\Cloud\Tasks\V2beta3\Attempt|null + */ + public function getLastAttempt() + { + return $this->last_attempt; + } + + public function hasLastAttempt() + { + return isset($this->last_attempt); + } + + public function clearLastAttempt() + { + unset($this->last_attempt); + } + + /** + * Output only. The status of the task's last attempt. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.Attempt last_attempt = 9; + * @param \Google\Cloud\Tasks\V2beta3\Attempt $var + * @return $this + */ + public function setLastAttempt($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\Attempt::class); + $this->last_attempt = $var; + + return $this; + } + + /** + * Output only. The view specifies which subset of the + * [Task][google.cloud.tasks.v2beta3.Task] has been returned. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.Task.View view = 10; + * @return int + */ + public function getView() + { + return $this->view; + } + + /** + * Output only. The view specifies which subset of the + * [Task][google.cloud.tasks.v2beta3.Task] has been returned. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.Task.View view = 10; + * @param int $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta3\Task\View::class); + $this->view = $var; + + return $this; + } + + /** + * @return string + */ + public function getPayloadType() + { + return $this->whichOneof("payload_type"); + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Task/View.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Task/View.php new file mode 100644 index 000000000000..7c45c3bd5ac8 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Task/View.php @@ -0,0 +1,81 @@ +google.cloud.tasks.v2beta3.Task.View + */ +class View +{ + /** + * Unspecified. Defaults to BASIC. + * + * Generated from protobuf enum VIEW_UNSPECIFIED = 0; + */ + const VIEW_UNSPECIFIED = 0; + /** + * The basic view omits fields which can be large or can contain + * sensitive data. + * This view does not include the + * [body in + * AppEngineHttpRequest][google.cloud.tasks.v2beta3.AppEngineHttpRequest.body]. + * Bodies are desirable to return only when needed, because they + * can be large and because of the sensitivity of the data that you + * choose to store in it. + * + * Generated from protobuf enum BASIC = 1; + */ + const BASIC = 1; + /** + * All information is returned. + * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Queue][google.cloud.tasks.v2beta3.Queue] resource. + * + * Generated from protobuf enum FULL = 2; + */ + const FULL = 2; + + private static $valueToName = [ + self::VIEW_UNSPECIFIED => 'VIEW_UNSPECIFIED', + self::BASIC => 'BASIC', + self::FULL => 'FULL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(View::class, \Google\Cloud\Tasks\V2beta3\Task_View::class); + diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/UpdateQueueRequest.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/UpdateQueueRequest.php new file mode 100644 index 000000000000..8fa7fdcb2fdd --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/UpdateQueueRequest.php @@ -0,0 +1,150 @@ +google.cloud.tasks.v2beta3.UpdateQueueRequest + */ +class UpdateQueueRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The queue to create or update. + * The queue's [name][google.cloud.tasks.v2beta3.Queue.name] must be + * specified. + * Output only fields cannot be modified using UpdateQueue. + * Any value specified for an output only field will be ignored. + * The queue's [name][google.cloud.tasks.v2beta3.Queue.name] cannot be + * changed. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.Queue queue = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $queue = null; + /** + * A mask used to specify which fields of the queue are being updated. + * If empty, then all fields will be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Tasks\V2beta3\Queue $queue + * Required. The queue to create or update. + * The queue's [name][google.cloud.tasks.v2beta3.Queue.name] must be + * specified. + * Output only fields cannot be modified using UpdateQueue. + * Any value specified for an output only field will be ignored. + * The queue's [name][google.cloud.tasks.v2beta3.Queue.name] cannot be + * changed. + * @type \Google\Protobuf\FieldMask $update_mask + * A mask used to specify which fields of the queue are being updated. + * If empty, then all fields will be updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Cloudtasks::initOnce(); + parent::__construct($data); + } + + /** + * Required. The queue to create or update. + * The queue's [name][google.cloud.tasks.v2beta3.Queue.name] must be + * specified. + * Output only fields cannot be modified using UpdateQueue. + * Any value specified for an output only field will be ignored. + * The queue's [name][google.cloud.tasks.v2beta3.Queue.name] cannot be + * changed. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.Queue queue = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Tasks\V2beta3\Queue|null + */ + public function getQueue() + { + return $this->queue; + } + + public function hasQueue() + { + return isset($this->queue); + } + + public function clearQueue() + { + unset($this->queue); + } + + /** + * Required. The queue to create or update. + * The queue's [name][google.cloud.tasks.v2beta3.Queue.name] must be + * specified. + * Output only fields cannot be modified using UpdateQueue. + * Any value specified for an output only field will be ignored. + * The queue's [name][google.cloud.tasks.v2beta3.Queue.name] cannot be + * changed. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.Queue queue = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Tasks\V2beta3\Queue $var + * @return $this + */ + public function setQueue($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\Queue::class); + $this->queue = $var; + + return $this; + } + + /** + * A mask used to specify which fields of the queue are being updated. + * If empty, then all fields will be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * A mask used to specify which fields of the queue are being updated. + * If empty, then all fields will be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/UriOverride.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/UriOverride.php new file mode 100644 index 000000000000..99ef21814b14 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/UriOverride.php @@ -0,0 +1,353 @@ +google.cloud.tasks.v2beta3.UriOverride + */ +class UriOverride extends \Google\Protobuf\Internal\Message +{ + /** + * Scheme override. + * When specified, the task URI scheme is replaced by the provided value (HTTP + * or HTTPS). + * + * Generated from protobuf field optional .google.cloud.tasks.v2beta3.UriOverride.Scheme scheme = 1; + */ + protected $scheme = null; + /** + * Host override. + * When specified, replaces the host part of the task URL. For example, + * if the task URL is "https://www.google.com," and host value is set to + * "example.net", the overridden URI will be changed to "https://example.net." + * Host value cannot be an empty string (INVALID_ARGUMENT). + * + * Generated from protobuf field optional string host = 2; + */ + protected $host = null; + /** + * Port override. + * When specified, replaces the port part of the task URI. For instance, + * for a URI http://www.google.com/foo and port=123, the overridden URI + * becomes http://www.google.com:123/foo. Note that the port value must be a + * positive integer. Setting the port to 0 (Zero) clears the URI port. + * + * Generated from protobuf field optional int64 port = 3; + */ + protected $port = null; + /** + * URI path. + * When specified, replaces the existing path of the task URL. Setting the + * path value to an empty string clears the URI path segment. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.PathOverride path_override = 4; + */ + protected $path_override = null; + /** + * URI Query. + * When specified, replaces the query part of the task URI. Setting the + * query value to an empty string clears the URI query segment. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.QueryOverride query_override = 5; + */ + protected $query_override = null; + /** + * URI Override Enforce Mode + * When specified, determines the Target UriOverride mode. If not specified, + * it defaults to ALWAYS. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.UriOverride.UriOverrideEnforceMode uri_override_enforce_mode = 6; + */ + protected $uri_override_enforce_mode = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $scheme + * Scheme override. + * When specified, the task URI scheme is replaced by the provided value (HTTP + * or HTTPS). + * @type string $host + * Host override. + * When specified, replaces the host part of the task URL. For example, + * if the task URL is "https://www.google.com," and host value is set to + * "example.net", the overridden URI will be changed to "https://example.net." + * Host value cannot be an empty string (INVALID_ARGUMENT). + * @type int|string $port + * Port override. + * When specified, replaces the port part of the task URI. For instance, + * for a URI http://www.google.com/foo and port=123, the overridden URI + * becomes http://www.google.com:123/foo. Note that the port value must be a + * positive integer. Setting the port to 0 (Zero) clears the URI port. + * @type \Google\Cloud\Tasks\V2beta3\PathOverride $path_override + * URI path. + * When specified, replaces the existing path of the task URL. Setting the + * path value to an empty string clears the URI path segment. + * @type \Google\Cloud\Tasks\V2beta3\QueryOverride $query_override + * URI Query. + * When specified, replaces the query part of the task URI. Setting the + * query value to an empty string clears the URI query segment. + * @type int $uri_override_enforce_mode + * URI Override Enforce Mode + * When specified, determines the Target UriOverride mode. If not specified, + * it defaults to ALWAYS. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Target::initOnce(); + parent::__construct($data); + } + + /** + * Scheme override. + * When specified, the task URI scheme is replaced by the provided value (HTTP + * or HTTPS). + * + * Generated from protobuf field optional .google.cloud.tasks.v2beta3.UriOverride.Scheme scheme = 1; + * @return int + */ + public function getScheme() + { + return isset($this->scheme) ? $this->scheme : 0; + } + + public function hasScheme() + { + return isset($this->scheme); + } + + public function clearScheme() + { + unset($this->scheme); + } + + /** + * Scheme override. + * When specified, the task URI scheme is replaced by the provided value (HTTP + * or HTTPS). + * + * Generated from protobuf field optional .google.cloud.tasks.v2beta3.UriOverride.Scheme scheme = 1; + * @param int $var + * @return $this + */ + public function setScheme($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta3\UriOverride\Scheme::class); + $this->scheme = $var; + + return $this; + } + + /** + * Host override. + * When specified, replaces the host part of the task URL. For example, + * if the task URL is "https://www.google.com," and host value is set to + * "example.net", the overridden URI will be changed to "https://example.net." + * Host value cannot be an empty string (INVALID_ARGUMENT). + * + * Generated from protobuf field optional string host = 2; + * @return string + */ + public function getHost() + { + return isset($this->host) ? $this->host : ''; + } + + public function hasHost() + { + return isset($this->host); + } + + public function clearHost() + { + unset($this->host); + } + + /** + * Host override. + * When specified, replaces the host part of the task URL. For example, + * if the task URL is "https://www.google.com," and host value is set to + * "example.net", the overridden URI will be changed to "https://example.net." + * Host value cannot be an empty string (INVALID_ARGUMENT). + * + * Generated from protobuf field optional string host = 2; + * @param string $var + * @return $this + */ + public function setHost($var) + { + GPBUtil::checkString($var, True); + $this->host = $var; + + return $this; + } + + /** + * Port override. + * When specified, replaces the port part of the task URI. For instance, + * for a URI http://www.google.com/foo and port=123, the overridden URI + * becomes http://www.google.com:123/foo. Note that the port value must be a + * positive integer. Setting the port to 0 (Zero) clears the URI port. + * + * Generated from protobuf field optional int64 port = 3; + * @return int|string + */ + public function getPort() + { + return isset($this->port) ? $this->port : 0; + } + + public function hasPort() + { + return isset($this->port); + } + + public function clearPort() + { + unset($this->port); + } + + /** + * Port override. + * When specified, replaces the port part of the task URI. For instance, + * for a URI http://www.google.com/foo and port=123, the overridden URI + * becomes http://www.google.com:123/foo. Note that the port value must be a + * positive integer. Setting the port to 0 (Zero) clears the URI port. + * + * Generated from protobuf field optional int64 port = 3; + * @param int|string $var + * @return $this + */ + public function setPort($var) + { + GPBUtil::checkInt64($var); + $this->port = $var; + + return $this; + } + + /** + * URI path. + * When specified, replaces the existing path of the task URL. Setting the + * path value to an empty string clears the URI path segment. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.PathOverride path_override = 4; + * @return \Google\Cloud\Tasks\V2beta3\PathOverride|null + */ + public function getPathOverride() + { + return $this->path_override; + } + + public function hasPathOverride() + { + return isset($this->path_override); + } + + public function clearPathOverride() + { + unset($this->path_override); + } + + /** + * URI path. + * When specified, replaces the existing path of the task URL. Setting the + * path value to an empty string clears the URI path segment. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.PathOverride path_override = 4; + * @param \Google\Cloud\Tasks\V2beta3\PathOverride $var + * @return $this + */ + public function setPathOverride($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\PathOverride::class); + $this->path_override = $var; + + return $this; + } + + /** + * URI Query. + * When specified, replaces the query part of the task URI. Setting the + * query value to an empty string clears the URI query segment. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.QueryOverride query_override = 5; + * @return \Google\Cloud\Tasks\V2beta3\QueryOverride|null + */ + public function getQueryOverride() + { + return $this->query_override; + } + + public function hasQueryOverride() + { + return isset($this->query_override); + } + + public function clearQueryOverride() + { + unset($this->query_override); + } + + /** + * URI Query. + * When specified, replaces the query part of the task URI. Setting the + * query value to an empty string clears the URI query segment. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.QueryOverride query_override = 5; + * @param \Google\Cloud\Tasks\V2beta3\QueryOverride $var + * @return $this + */ + public function setQueryOverride($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\QueryOverride::class); + $this->query_override = $var; + + return $this; + } + + /** + * URI Override Enforce Mode + * When specified, determines the Target UriOverride mode. If not specified, + * it defaults to ALWAYS. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.UriOverride.UriOverrideEnforceMode uri_override_enforce_mode = 6; + * @return int + */ + public function getUriOverrideEnforceMode() + { + return $this->uri_override_enforce_mode; + } + + /** + * URI Override Enforce Mode + * When specified, determines the Target UriOverride mode. If not specified, + * it defaults to ALWAYS. + * + * Generated from protobuf field .google.cloud.tasks.v2beta3.UriOverride.UriOverrideEnforceMode uri_override_enforce_mode = 6; + * @param int $var + * @return $this + */ + public function setUriOverrideEnforceMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta3\UriOverride\UriOverrideEnforceMode::class); + $this->uri_override_enforce_mode = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/UriOverride/Scheme.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/UriOverride/Scheme.php new file mode 100644 index 000000000000..1711330bfdfb --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/UriOverride/Scheme.php @@ -0,0 +1,66 @@ +google.cloud.tasks.v2beta3.UriOverride.Scheme + */ +class Scheme +{ + /** + * Scheme unspecified. Defaults to HTTPS. + * + * Generated from protobuf enum SCHEME_UNSPECIFIED = 0; + */ + const SCHEME_UNSPECIFIED = 0; + /** + * Convert the scheme to HTTP, e.g., https://www.google.ca will change to + * http://www.google.ca. + * + * Generated from protobuf enum HTTP = 1; + */ + const HTTP = 1; + /** + * Convert the scheme to HTTPS, e.g., http://www.google.ca will change to + * https://www.google.ca. + * + * Generated from protobuf enum HTTPS = 2; + */ + const HTTPS = 2; + + private static $valueToName = [ + self::SCHEME_UNSPECIFIED => 'SCHEME_UNSPECIFIED', + self::HTTP => 'HTTP', + self::HTTPS => 'HTTPS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Scheme::class, \Google\Cloud\Tasks\V2beta3\UriOverride_Scheme::class); + diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/UriOverride/UriOverrideEnforceMode.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/UriOverride/UriOverrideEnforceMode.php new file mode 100644 index 000000000000..be36cdfbe464 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/UriOverride/UriOverrideEnforceMode.php @@ -0,0 +1,67 @@ +google.cloud.tasks.v2beta3.UriOverride.UriOverrideEnforceMode + */ +class UriOverrideEnforceMode +{ + /** + * OverrideMode Unspecified. Defaults to ALWAYS. + * + * Generated from protobuf enum URI_OVERRIDE_ENFORCE_MODE_UNSPECIFIED = 0; + */ + const URI_OVERRIDE_ENFORCE_MODE_UNSPECIFIED = 0; + /** + * In the IF_NOT_EXISTS mode, queue-level configuration is only + * applied where task-level configuration does not exist. + * + * Generated from protobuf enum IF_NOT_EXISTS = 1; + */ + const IF_NOT_EXISTS = 1; + /** + * In the ALWAYS mode, queue-level configuration overrides all + * task-level configuration + * + * Generated from protobuf enum ALWAYS = 2; + */ + const ALWAYS = 2; + + private static $valueToName = [ + self::URI_OVERRIDE_ENFORCE_MODE_UNSPECIFIED => 'URI_OVERRIDE_ENFORCE_MODE_UNSPECIFIED', + self::IF_NOT_EXISTS => 'IF_NOT_EXISTS', + self::ALWAYS => 'ALWAYS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(UriOverrideEnforceMode::class, \Google\Cloud\Tasks\V2beta3\UriOverride_UriOverrideEnforceMode::class); + diff --git a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/create_queue.php b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/create_queue.php new file mode 100644 index 000000000000..a550d82cc75c --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/create_queue.php @@ -0,0 +1,85 @@ +createQueue($formattedParent, $queue); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = CloudTasksClient::locationName('[PROJECT]', '[LOCATION]'); + + create_queue_sample($formattedParent); +} +// [END cloudtasks_v2beta3_generated_CloudTasks_CreateQueue_sync] diff --git a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/create_task.php b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/create_task.php new file mode 100644 index 000000000000..4210d260bed5 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/create_task.php @@ -0,0 +1,76 @@ +createTask($formattedParent, $task); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = CloudTasksClient::queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + + create_task_sample($formattedParent); +} +// [END cloudtasks_v2beta3_generated_CloudTasks_CreateTask_sync] diff --git a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/delete_queue.php b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/delete_queue.php new file mode 100644 index 000000000000..a2468d76a522 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/delete_queue.php @@ -0,0 +1,77 @@ +deleteQueue($formattedName); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudTasksClient::queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + + delete_queue_sample($formattedName); +} +// [END cloudtasks_v2beta3_generated_CloudTasks_DeleteQueue_sync] diff --git a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/delete_task.php b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/delete_task.php new file mode 100644 index 000000000000..a131ad410095 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/delete_task.php @@ -0,0 +1,69 @@ +deleteTask($formattedName); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudTasksClient::taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + + delete_task_sample($formattedName); +} +// [END cloudtasks_v2beta3_generated_CloudTasks_DeleteTask_sync] diff --git a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/get_iam_policy.php b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/get_iam_policy.php new file mode 100644 index 000000000000..287e8a4b9401 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/get_iam_policy.php @@ -0,0 +1,74 @@ +getIamPolicy($resource); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + get_iam_policy_sample($resource); +} +// [END cloudtasks_v2beta3_generated_CloudTasks_GetIamPolicy_sync] diff --git a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/get_location.php b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/get_location.php new file mode 100644 index 000000000000..c87c50e29e10 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/get_location.php @@ -0,0 +1,53 @@ +getLocation(); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END cloudtasks_v2beta3_generated_CloudTasks_GetLocation_sync] diff --git a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/get_queue.php b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/get_queue.php new file mode 100644 index 000000000000..b7bb947057e2 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/get_queue.php @@ -0,0 +1,67 @@ +getQueue($formattedName); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudTasksClient::queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + + get_queue_sample($formattedName); +} +// [END cloudtasks_v2beta3_generated_CloudTasks_GetQueue_sync] diff --git a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/get_task.php b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/get_task.php new file mode 100644 index 000000000000..679006068828 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/get_task.php @@ -0,0 +1,67 @@ +getTask($formattedName); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudTasksClient::taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + + get_task_sample($formattedName); +} +// [END cloudtasks_v2beta3_generated_CloudTasks_GetTask_sync] diff --git a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/list_locations.php b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/list_locations.php new file mode 100644 index 000000000000..f5495e55af5d --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/list_locations.php @@ -0,0 +1,58 @@ +listLocations(); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END cloudtasks_v2beta3_generated_CloudTasks_ListLocations_sync] diff --git a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/list_queues.php b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/list_queues.php new file mode 100644 index 000000000000..5158c1b76ade --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/list_queues.php @@ -0,0 +1,74 @@ +listQueues($formattedParent); + + /** @var Queue $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = CloudTasksClient::locationName('[PROJECT]', '[LOCATION]'); + + list_queues_sample($formattedParent); +} +// [END cloudtasks_v2beta3_generated_CloudTasks_ListQueues_sync] diff --git a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/list_tasks.php b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/list_tasks.php new file mode 100644 index 000000000000..63228c12a8cc --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/list_tasks.php @@ -0,0 +1,80 @@ +listTasks($formattedParent); + + /** @var Task $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = CloudTasksClient::queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + + list_tasks_sample($formattedParent); +} +// [END cloudtasks_v2beta3_generated_CloudTasks_ListTasks_sync] diff --git a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/pause_queue.php b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/pause_queue.php new file mode 100644 index 000000000000..ec9dc04545e2 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/pause_queue.php @@ -0,0 +1,74 @@ +pauseQueue($formattedName); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudTasksClient::queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + + pause_queue_sample($formattedName); +} +// [END cloudtasks_v2beta3_generated_CloudTasks_PauseQueue_sync] diff --git a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/purge_queue.php b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/purge_queue.php new file mode 100644 index 000000000000..3b2d46dd6ac7 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/purge_queue.php @@ -0,0 +1,72 @@ +purgeQueue($formattedName); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudTasksClient::queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + + purge_queue_sample($formattedName); +} +// [END cloudtasks_v2beta3_generated_CloudTasks_PurgeQueue_sync] diff --git a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/resume_queue.php b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/resume_queue.php new file mode 100644 index 000000000000..7c944dd8e591 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/resume_queue.php @@ -0,0 +1,81 @@ +resumeQueue($formattedName); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudTasksClient::queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + + resume_queue_sample($formattedName); +} +// [END cloudtasks_v2beta3_generated_CloudTasks_ResumeQueue_sync] diff --git a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/run_task.php b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/run_task.php new file mode 100644 index 000000000000..2ada5904ec08 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/run_task.php @@ -0,0 +1,93 @@ +runTask($formattedName); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudTasksClient::taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + + run_task_sample($formattedName); +} +// [END cloudtasks_v2beta3_generated_CloudTasks_RunTask_sync] diff --git a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/set_iam_policy.php b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/set_iam_policy.php new file mode 100644 index 000000000000..547643a9d362 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/set_iam_policy.php @@ -0,0 +1,79 @@ +setIamPolicy($resource, $policy); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + set_iam_policy_sample($resource); +} +// [END cloudtasks_v2beta3_generated_CloudTasks_SetIamPolicy_sync] diff --git a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/test_iam_permissions.php b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/test_iam_permissions.php new file mode 100644 index 000000000000..fcf085d532b7 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/test_iam_permissions.php @@ -0,0 +1,81 @@ +testIamPermissions($resource, $permissions); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + $permissionsElement = '[PERMISSIONS]'; + + test_iam_permissions_sample($resource, $permissionsElement); +} +// [END cloudtasks_v2beta3_generated_CloudTasks_TestIamPermissions_sync] diff --git a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/update_queue.php b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/update_queue.php new file mode 100644 index 000000000000..d793d7f4046f --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/update_queue.php @@ -0,0 +1,70 @@ +updateQueue($queue); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END cloudtasks_v2beta3_generated_CloudTasks_UpdateQueue_sync] diff --git a/owl-bot-staging/Tasks/v2beta3/src/V2beta3/CloudTasksClient.php b/owl-bot-staging/Tasks/v2beta3/src/V2beta3/CloudTasksClient.php new file mode 100644 index 000000000000..59762f56ffc9 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/src/V2beta3/CloudTasksClient.php @@ -0,0 +1,36 @@ +locationName('[PROJECT]', '[LOCATION]'); + * $queue = new Queue(); + * $response = $cloudTasksClient->createQueue($formattedParent, $queue); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + * + * @experimental + * + * @deprecated This class will be removed in the next major version update. + */ +class CloudTasksGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.tasks.v2beta3.CloudTasks'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'cloudtasks.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'cloudtasks.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static $locationNameTemplate; + + private static $queueNameTemplate; + + private static $taskNameTemplate; + + private static $pathTemplateMap; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/cloud_tasks_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/cloud_tasks_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/cloud_tasks_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/cloud_tasks_rest_client_config.php', + ], + ], + ]; + } + + private static function getLocationNameTemplate() + { + if (self::$locationNameTemplate == null) { + self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); + } + + return self::$locationNameTemplate; + } + + private static function getQueueNameTemplate() + { + if (self::$queueNameTemplate == null) { + self::$queueNameTemplate = new PathTemplate('projects/{project}/locations/{location}/queues/{queue}'); + } + + return self::$queueNameTemplate; + } + + private static function getTaskNameTemplate() + { + if (self::$taskNameTemplate == null) { + self::$taskNameTemplate = new PathTemplate('projects/{project}/locations/{location}/queues/{queue}/tasks/{task}'); + } + + return self::$taskNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'location' => self::getLocationNameTemplate(), + 'queue' => self::getQueueNameTemplate(), + 'task' => self::getTaskNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + * + * @experimental + */ + public static function locationName($project, $location) + { + return self::getLocationNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a queue + * resource. + * + * @param string $project + * @param string $location + * @param string $queue + * + * @return string The formatted queue resource. + * + * @experimental + */ + public static function queueName($project, $location, $queue) + { + return self::getQueueNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'queue' => $queue, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a task + * resource. + * + * @param string $project + * @param string $location + * @param string $queue + * @param string $task + * + * @return string The formatted task resource. + * + * @experimental + */ + public static function taskName($project, $location, $queue, $task) + { + return self::getTaskNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'queue' => $queue, + 'task' => $task, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - location: projects/{project}/locations/{location} + * - queue: projects/{project}/locations/{location}/queues/{queue} + * - task: projects/{project}/locations/{location}/queues/{queue}/tasks/{task} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + * + * @experimental + */ + public static function parseName($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'cloudtasks.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** + * Creates a queue. + * + * Queues created with this method allow tasks to live for a maximum of 31 + * days. After a task is 31 days old, the task will be deleted regardless of + * whether it was dispatched or not. + * + * WARNING: Using this method may have unintended side effects if you are + * using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + * Read + * [Overview of Queue Management and + * queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using + * this method. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $formattedParent = $cloudTasksClient->locationName('[PROJECT]', '[LOCATION]'); + * $queue = new Queue(); + * $response = $cloudTasksClient->createQueue($formattedParent, $queue); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $parent Required. The location name in which the queue will be created. + * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * + * The list of allowed locations can be obtained by calling Cloud + * Tasks' implementation of + * [ListLocations][google.cloud.location.Locations.ListLocations]. + * @param Queue $queue Required. The queue to create. + * + * [Queue's name][google.cloud.tasks.v2beta3.Queue.name] cannot be the same as + * an existing queue. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Tasks\V2beta3\Queue + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function createQueue($parent, $queue, array $optionalArgs = []) + { + $request = new CreateQueueRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setQueue($queue); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateQueue', Queue::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a task and adds it to a queue. + * + * Tasks cannot be updated after creation; there is no UpdateTask command. + * + * * The maximum task size is 100KB. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $formattedParent = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * $task = new Task(); + * $response = $cloudTasksClient->createTask($formattedParent, $task); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $parent Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * + * The queue must already exist. + * @param Task $task Required. The task to add. + * + * Task names have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. + * The user can optionally specify a task + * [name][google.cloud.tasks.v2beta3.Task.name]. If a name is not specified + * then the system will generate a random unique task id, which will be set in + * the task returned in the [response][google.cloud.tasks.v2beta3.Task.name]. + * + * If [schedule_time][google.cloud.tasks.v2beta3.Task.schedule_time] is not + * set or is in the past then Cloud Tasks will set it to the current time. + * + * Task De-duplication: + * + * Explicitly specifying a task ID enables task de-duplication. If + * a task's ID is identical to that of an existing task or a task + * that was deleted or executed recently then the call will fail + * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. + * If the task's queue was created using Cloud Tasks, then another task with + * the same name can't be created for ~1 hour after the original task was + * deleted or executed. If the task's queue was created using queue.yaml or + * queue.xml, then another task with the same name can't be created + * for ~9 days after the original task was deleted or executed. + * + * Because there is an extra lookup cost to identify duplicate task + * names, these [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask] + * calls have significantly increased latency. Using hashed strings for the + * task id or for the prefix of the task id is recommended. Choosing task ids + * that are sequential or have sequential prefixes, for example using a + * timestamp, causes an increase in latency and error rates in all + * task commands. The infrastructure relies on an approximately + * uniform distribution of task ids to store and serve tasks + * efficiently. + * @param array $optionalArgs { + * Optional. + * + * @type int $responseView + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta3.Task] will be returned. + * + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * + * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta3.Task] resource. + * For allowed values, use constants defined on {@see \Google\Cloud\Tasks\V2beta3\Task\View} + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Tasks\V2beta3\Task + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function createTask($parent, $task, array $optionalArgs = []) + { + $request = new CreateTaskRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setTask($task); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['responseView'])) { + $request->setResponseView($optionalArgs['responseView']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateTask', Task::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes a queue. + * + * This command will delete the queue even if it has tasks in it. + * + * Note: If you delete a queue, a queue with the same name can't be created + * for 7 days. + * + * WARNING: Using this method may have unintended side effects if you are + * using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + * Read + * [Overview of Queue Management and + * queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using + * this method. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * $cloudTasksClient->deleteQueue($formattedName); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $name Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function deleteQueue($name, array $optionalArgs = []) + { + $request = new DeleteQueueRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteQueue', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes a task. + * + * A task can be deleted if it is scheduled or dispatched. A task + * cannot be deleted if it has executed successfully or permanently + * failed. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $formattedName = $cloudTasksClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + * $cloudTasksClient->deleteTask($formattedName); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $name Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function deleteTask($name, array $optionalArgs = []) + { + $request = new DeleteTaskRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteTask', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the access control policy for a + * [Queue][google.cloud.tasks.v2beta3.Queue]. Returns an empty policy if the + * resource exists and does not have a policy set. + * + * Authorization requires the following + * [Google IAM](https://cloud.google.com/iam) permission on the specified + * resource parent: + * + * * `cloudtasks.queues.getIamPolicy` + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $resource = 'resource'; + * $response = $cloudTasksClient->getIamPolicy($resource); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $resource REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param array $optionalArgs { + * Optional. + * + * @type GetPolicyOptions $options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\Policy + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function getIamPolicy($resource, array $optionalArgs = []) + { + $request = new GetIamPolicyRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['options'])) { + $request->setOptions($optionalArgs['options']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets a queue. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * $response = $cloudTasksClient->getQueue($formattedName); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $name Required. The resource name of the queue. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $readMask + * Optional. Read mask is used for a more granular control over what the API + * returns. If the mask is not present all fields will be returned except + * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly + * specified in the mask. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Tasks\V2beta3\Queue + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function getQueue($name, array $optionalArgs = []) + { + $request = new GetQueueRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['readMask'])) { + $request->setReadMask($optionalArgs['readMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetQueue', Queue::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets a task. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $formattedName = $cloudTasksClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + * $response = $cloudTasksClient->getTask($formattedName); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $name Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * @param array $optionalArgs { + * Optional. + * + * @type int $responseView + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta3.Task] will be returned. + * + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * + * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta3.Task] resource. + * For allowed values, use constants defined on {@see \Google\Cloud\Tasks\V2beta3\Task\View} + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Tasks\V2beta3\Task + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function getTask($name, array $optionalArgs = []) + { + $request = new GetTaskRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['responseView'])) { + $request->setResponseView($optionalArgs['responseView']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetTask', Task::class, $optionalArgs, $request)->wait(); + } + + /** + * Lists queues. + * + * Queues are returned in lexicographical order. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $formattedParent = $cloudTasksClient->locationName('[PROJECT]', '[LOCATION]'); + * // Iterate over pages of elements + * $pagedResponse = $cloudTasksClient->listQueues($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $cloudTasksClient->listQueues($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $parent Required. The location name. + * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * @param array $optionalArgs { + * Optional. + * + * @type string $filter + * `filter` can be used to specify a subset of queues. Any + * [Queue][google.cloud.tasks.v2beta3.Queue] field can be used as a filter and + * several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The + * filter syntax is the same as described in [Stackdriver's Advanced Logs + * Filters](https://cloud.google.com/logging/docs/view/advanced_filters). + * + * Sample filter "state: PAUSED". + * + * Note that using filters might cause fewer queues than the + * requested page_size to be returned. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type FieldMask $readMask + * Optional. Read mask is used for a more granular control over what the API + * returns. If the mask is not present all fields will be returned except + * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly + * specified in the mask. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function listQueues($parent, array $optionalArgs = []) + { + $request = new ListQueuesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['readMask'])) { + $request->setReadMask($optionalArgs['readMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListQueues', $optionalArgs, ListQueuesResponse::class, $request); + } + + /** + * Lists the tasks in a queue. + * + * By default, only the [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC] + * view is retrieved due to performance considerations; + * [response_view][google.cloud.tasks.v2beta3.ListTasksRequest.response_view] + * controls the subset of information which is returned. + * + * The tasks may be returned in any order. The ordering may change at any + * time. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $formattedParent = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * // Iterate over pages of elements + * $pagedResponse = $cloudTasksClient->listTasks($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $cloudTasksClient->listTasks($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $parent Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * @param array $optionalArgs { + * Optional. + * + * @type int $responseView + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta3.Task] will be returned. + * + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * + * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta3.Task] resource. + * For allowed values, use constants defined on {@see \Google\Cloud\Tasks\V2beta3\Task\View} + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function listTasks($parent, array $optionalArgs = []) + { + $request = new ListTasksRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['responseView'])) { + $request->setResponseView($optionalArgs['responseView']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListTasks', $optionalArgs, ListTasksResponse::class, $request); + } + + /** + * Pauses the queue. + * + * If a queue is paused then the system will stop dispatching tasks + * until the queue is resumed via + * [ResumeQueue][google.cloud.tasks.v2beta3.CloudTasks.ResumeQueue]. Tasks can + * still be added when the queue is paused. A queue is paused if its + * [state][google.cloud.tasks.v2beta3.Queue.state] is + * [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED]. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * $response = $cloudTasksClient->pauseQueue($formattedName); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $name Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Tasks\V2beta3\Queue + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function pauseQueue($name, array $optionalArgs = []) + { + $request = new PauseQueueRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('PauseQueue', Queue::class, $optionalArgs, $request)->wait(); + } + + /** + * Purges a queue by deleting all of its tasks. + * + * All tasks created before this method is called are permanently deleted. + * + * Purge operations can take up to one minute to take effect. Tasks + * might be dispatched before the purge takes effect. A purge is irreversible. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * $response = $cloudTasksClient->purgeQueue($formattedName); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $name Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Tasks\V2beta3\Queue + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function purgeQueue($name, array $optionalArgs = []) + { + $request = new PurgeQueueRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('PurgeQueue', Queue::class, $optionalArgs, $request)->wait(); + } + + /** + * Resume a queue. + * + * This method resumes a queue after it has been + * [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED] or + * [DISABLED][google.cloud.tasks.v2beta3.Queue.State.DISABLED]. The state of a + * queue is stored in the queue's + * [state][google.cloud.tasks.v2beta3.Queue.state]; after calling this method + * it will be set to + * [RUNNING][google.cloud.tasks.v2beta3.Queue.State.RUNNING]. + * + * WARNING: Resuming many high-QPS queues at the same time can + * lead to target overloading. If you are resuming high-QPS + * queues, follow the 500/50/5 pattern described in + * [Managing Cloud Tasks Scaling + * Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling). + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * $response = $cloudTasksClient->resumeQueue($formattedName); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $name Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Tasks\V2beta3\Queue + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function resumeQueue($name, array $optionalArgs = []) + { + $request = new ResumeQueueRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('ResumeQueue', Queue::class, $optionalArgs, $request)->wait(); + } + + /** + * Forces a task to run now. + * + * When this method is called, Cloud Tasks will dispatch the task, even if + * the task is already running, the queue has reached its + * [RateLimits][google.cloud.tasks.v2beta3.RateLimits] or is + * [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED]. + * + * This command is meant to be used for manual debugging. For + * example, [RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] can be + * used to retry a failed task after a fix has been made or to manually force + * a task to be dispatched now. + * + * The dispatched task is returned. That is, the task that is returned + * contains the [status][Task.status] after the task is dispatched but + * before the task is received by its target. + * + * If Cloud Tasks receives a successful response from the task's + * target, then the task will be deleted; otherwise the task's + * [schedule_time][google.cloud.tasks.v2beta3.Task.schedule_time] will be + * reset to the time that + * [RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] was called plus + * the retry delay specified in the queue's + * [RetryConfig][google.cloud.tasks.v2beta3.RetryConfig]. + * + * [RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] returns + * [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a + * task that has already succeeded or permanently failed. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $formattedName = $cloudTasksClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + * $response = $cloudTasksClient->runTask($formattedName); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $name Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * @param array $optionalArgs { + * Optional. + * + * @type int $responseView + * The response_view specifies which subset of the + * [Task][google.cloud.tasks.v2beta3.Task] will be returned. + * + * By default response_view is + * [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all information is + * retrieved by default because some data, such as payloads, might be + * desirable to return only when needed because of its large size or because + * of the sensitivity of data that it contains. + * + * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] + * requires `cloudtasks.tasks.fullView` [Google + * IAM](https://cloud.google.com/iam/) permission on the + * [Task][google.cloud.tasks.v2beta3.Task] resource. + * For allowed values, use constants defined on {@see \Google\Cloud\Tasks\V2beta3\Task\View} + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Tasks\V2beta3\Task + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function runTask($name, array $optionalArgs = []) + { + $request = new RunTaskRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['responseView'])) { + $request->setResponseView($optionalArgs['responseView']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('RunTask', Task::class, $optionalArgs, $request)->wait(); + } + + /** + * Sets the access control policy for a + * [Queue][google.cloud.tasks.v2beta3.Queue]. Replaces any existing policy. + * + * Note: The Cloud Console does not check queue-level IAM permissions yet. + * Project-level permissions are required to use the Cloud Console. + * + * Authorization requires the following + * [Google IAM](https://cloud.google.com/iam) permission on the specified + * resource parent: + * + * * `cloudtasks.queues.setIamPolicy` + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $resource = 'resource'; + * $policy = new Policy(); + * $response = $cloudTasksClient->setIamPolicy($resource, $policy); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $resource REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * + * `paths: "bindings, etag"` + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\Policy + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function setIamPolicy($resource, $policy, array $optionalArgs = []) + { + $request = new SetIamPolicyRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $request->setPolicy($policy); + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns permissions that a caller has on a + * [Queue][google.cloud.tasks.v2beta3.Queue]. If the resource does not exist, + * this will return an empty set of permissions, not a + * [NOT_FOUND][google.rpc.Code.NOT_FOUND] error. + * + * Note: This operation is designed to be used for building permission-aware + * UIs and command-line tools, not for authorization checking. This operation + * may "fail open" without warning. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $resource = 'resource'; + * $permissions = []; + * $response = $cloudTasksClient->testIamPermissions($resource, $permissions); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param string $resource REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function testIamPermissions($resource, $permissions, array $optionalArgs = []) + { + $request = new TestIamPermissionsRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $request->setPermissions($permissions); + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('TestIamPermissions', TestIamPermissionsResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Updates a queue. + * + * This method creates the queue if it does not exist and updates + * the queue if it does exist. + * + * Queues created with this method allow tasks to live for a maximum of 31 + * days. After a task is 31 days old, the task will be deleted regardless of + * whether it was dispatched or not. + * + * WARNING: Using this method may have unintended side effects if you are + * using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + * Read + * [Overview of Queue Management and + * queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using + * this method. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $queue = new Queue(); + * $response = $cloudTasksClient->updateQueue($queue); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param Queue $queue Required. The queue to create or update. + * + * The queue's [name][google.cloud.tasks.v2beta3.Queue.name] must be + * specified. + * + * Output only fields cannot be modified using UpdateQueue. + * Any value specified for an output only field will be ignored. + * The queue's [name][google.cloud.tasks.v2beta3.Queue.name] cannot be + * changed. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * A mask used to specify which fields of the queue are being updated. + * + * If empty, then all fields will be updated. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Tasks\V2beta3\Queue + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function updateQueue($queue, array $optionalArgs = []) + { + $request = new UpdateQueueRequest(); + $requestParamHeaders = []; + $request->setQueue($queue); + $requestParamHeaders['queue.name'] = $queue->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateQueue', Queue::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets information about a location. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * $response = $cloudTasksClient->getLocation(); + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Resource name for the location. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Location\Location + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function getLocation(array $optionalArgs = []) + { + $request = new GetLocationRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * Sample code: + * ``` + * $cloudTasksClient = new CloudTasksClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $cloudTasksClient->listLocations(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $cloudTasksClient->listLocations(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $cloudTasksClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The resource that owns the locations collection, if applicable. + * @type string $filter + * The standard list filter. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function listLocations(array $optionalArgs = []) + { + $request = new ListLocationsRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); + } +} diff --git a/owl-bot-staging/Tasks/v2beta3/src/V2beta3/gapic_metadata.json b/owl-bot-staging/Tasks/v2beta3/src/V2beta3/gapic_metadata.json new file mode 100644 index 000000000000..91fdac01bfc2 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/src/V2beta3/gapic_metadata.json @@ -0,0 +1,108 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.tasks.v2beta3", + "libraryPackage": "Google\\Cloud\\Tasks\\V2beta3", + "services": { + "CloudTasks": { + "clients": { + "grpc": { + "libraryClient": "CloudTasksGapicClient", + "rpcs": { + "CreateQueue": { + "methods": [ + "createQueue" + ] + }, + "CreateTask": { + "methods": [ + "createTask" + ] + }, + "DeleteQueue": { + "methods": [ + "deleteQueue" + ] + }, + "DeleteTask": { + "methods": [ + "deleteTask" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "GetQueue": { + "methods": [ + "getQueue" + ] + }, + "GetTask": { + "methods": [ + "getTask" + ] + }, + "ListQueues": { + "methods": [ + "listQueues" + ] + }, + "ListTasks": { + "methods": [ + "listTasks" + ] + }, + "PauseQueue": { + "methods": [ + "pauseQueue" + ] + }, + "PurgeQueue": { + "methods": [ + "purgeQueue" + ] + }, + "ResumeQueue": { + "methods": [ + "resumeQueue" + ] + }, + "RunTask": { + "methods": [ + "runTask" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "UpdateQueue": { + "methods": [ + "updateQueue" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/Tasks/v2beta3/src/V2beta3/resources/cloud_tasks_client_config.json b/owl-bot-staging/Tasks/v2beta3/src/V2beta3/resources/cloud_tasks_client_config.json new file mode 100644 index 000000000000..d68dd2e3a24f --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/src/V2beta3/resources/cloud_tasks_client_config.json @@ -0,0 +1,135 @@ +{ + "interfaces": { + "google.cloud.tasks.v2beta3.CloudTasks": { + "retry_codes": { + "no_retry_codes": [], + "no_retry_1_codes": [], + "retry_policy_1_codes": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 20000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 20000, + "total_timeout_millis": 20000 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 20000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 20000, + "total_timeout_millis": 20000 + } + }, + "methods": { + "CreateQueue": { + "timeout_millis": 20000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateTask": { + "timeout_millis": 20000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteQueue": { + "timeout_millis": 20000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteTask": { + "timeout_millis": 20000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetIamPolicy": { + "timeout_millis": 20000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetQueue": { + "timeout_millis": 20000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetTask": { + "timeout_millis": 20000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListQueues": { + "timeout_millis": 20000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListTasks": { + "timeout_millis": 20000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "PauseQueue": { + "timeout_millis": 20000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "PurgeQueue": { + "timeout_millis": 20000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ResumeQueue": { + "timeout_millis": 20000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "RunTask": { + "timeout_millis": 20000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetIamPolicy": { + "timeout_millis": 20000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "timeout_millis": 20000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateQueue": { + "timeout_millis": 20000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/owl-bot-staging/Tasks/v2beta3/src/V2beta3/resources/cloud_tasks_descriptor_config.php b/owl-bot-staging/Tasks/v2beta3/src/V2beta3/resources/cloud_tasks_descriptor_config.php new file mode 100644 index 000000000000..59bc660c1596 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/src/V2beta3/resources/cloud_tasks_descriptor_config.php @@ -0,0 +1,42 @@ + [ + 'google.cloud.tasks.v2beta3.CloudTasks' => [ + 'ListQueues' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getQueues', + ], + ], + 'ListTasks' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getTasks', + ], + ], + 'GetLocation' => [ + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + ], + ], +]; diff --git a/owl-bot-staging/Tasks/v2beta3/src/V2beta3/resources/cloud_tasks_rest_client_config.php b/owl-bot-staging/Tasks/v2beta3/src/V2beta3/resources/cloud_tasks_rest_client_config.php new file mode 100644 index 000000000000..8bcffbc8b257 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/src/V2beta3/resources/cloud_tasks_rest_client_config.php @@ -0,0 +1,220 @@ + [ + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2beta3/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2beta3/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.tasks.v2beta3.CloudTasks' => [ + 'CreateQueue' => [ + 'method' => 'post', + 'uriTemplate' => '/v2beta3/{parent=projects/*/locations/*}/queues', + 'body' => 'queue', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateTask' => [ + 'method' => 'post', + 'uriTemplate' => '/v2beta3/{parent=projects/*/locations/*/queues/*}/tasks', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteQueue' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2beta3/{name=projects/*/locations/*/queues/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteTask' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v2beta3/{resource=projects/*/locations/*/queues/*}:getIamPolicy', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'GetQueue' => [ + 'method' => 'get', + 'uriTemplate' => '/v2beta3/{name=projects/*/locations/*/queues/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetTask' => [ + 'method' => 'get', + 'uriTemplate' => '/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListQueues' => [ + 'method' => 'get', + 'uriTemplate' => '/v2beta3/{parent=projects/*/locations/*}/queues', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListTasks' => [ + 'method' => 'get', + 'uriTemplate' => '/v2beta3/{parent=projects/*/locations/*/queues/*}/tasks', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'PauseQueue' => [ + 'method' => 'post', + 'uriTemplate' => '/v2beta3/{name=projects/*/locations/*/queues/*}:pause', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'PurgeQueue' => [ + 'method' => 'post', + 'uriTemplate' => '/v2beta3/{name=projects/*/locations/*/queues/*}:purge', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ResumeQueue' => [ + 'method' => 'post', + 'uriTemplate' => '/v2beta3/{name=projects/*/locations/*/queues/*}:resume', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'RunTask' => [ + 'method' => 'post', + 'uriTemplate' => '/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}:run', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v2beta3/{resource=projects/*/locations/*/queues/*}:setIamPolicy', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v2beta3/{resource=projects/*/locations/*/queues/*}:testIamPermissions', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'UpdateQueue' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2beta3/{queue.name=projects/*/locations/*/queues/*}', + 'body' => 'queue', + 'placeholders' => [ + 'queue.name' => [ + 'getters' => [ + 'getQueue', + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Tasks/v2beta3/tests/Unit/V2beta3/CloudTasksClientTest.php b/owl-bot-staging/Tasks/v2beta3/tests/Unit/V2beta3/CloudTasksClientTest.php new file mode 100644 index 000000000000..539258bf1eb2 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/tests/Unit/V2beta3/CloudTasksClientTest.php @@ -0,0 +1,1189 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return CloudTasksClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new CloudTasksClient($options); + } + + /** @test */ + public function createQueueTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new Queue(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $queue = new Queue(); + $response = $gapicClient->createQueue($formattedParent, $queue); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/CreateQueue', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getQueue(); + $this->assertProtobufEquals($queue, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createQueueExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $queue = new Queue(); + try { + $gapicClient->createQueue($formattedParent, $queue); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createTaskTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $dispatchCount = 1217252086; + $responseCount = 424727441; + $expectedResponse = new Task(); + $expectedResponse->setName($name); + $expectedResponse->setDispatchCount($dispatchCount); + $expectedResponse->setResponseCount($responseCount); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $task = new Task(); + $response = $gapicClient->createTask($formattedParent, $task); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/CreateTask', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getTask(); + $this->assertProtobufEquals($task, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createTaskExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $task = new Task(); + try { + $gapicClient->createTask($formattedParent, $task); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteQueueTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $gapicClient->deleteQueue($formattedName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/DeleteQueue', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteQueueExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + try { + $gapicClient->deleteQueue($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteTaskTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $gapicClient->deleteTask($formattedName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/DeleteTask', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteTaskExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + try { + $gapicClient->deleteTask($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $response = $gapicClient->getIamPolicy($resource); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + try { + $gapicClient->getIamPolicy($resource); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getQueueTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new Queue(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $response = $gapicClient->getQueue($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/GetQueue', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getQueueExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + try { + $gapicClient->getQueue($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTaskTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $dispatchCount = 1217252086; + $responseCount = 424727441; + $expectedResponse = new Task(); + $expectedResponse->setName($name2); + $expectedResponse->setDispatchCount($dispatchCount); + $expectedResponse->setResponseCount($responseCount); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $response = $gapicClient->getTask($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/GetTask', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTaskExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + try { + $gapicClient->getTask($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listQueuesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $queuesElement = new Queue(); + $queues = [ + $queuesElement, + ]; + $expectedResponse = new ListQueuesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setQueues($queues); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $response = $gapicClient->listQueues($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getQueues()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/ListQueues', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listQueuesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + try { + $gapicClient->listQueues($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listTasksTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $tasksElement = new Task(); + $tasks = [ + $tasksElement, + ]; + $expectedResponse = new ListTasksResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTasks($tasks); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $response = $gapicClient->listTasks($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getTasks()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/ListTasks', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listTasksExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + try { + $gapicClient->listTasks($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function pauseQueueTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new Queue(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $response = $gapicClient->pauseQueue($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/PauseQueue', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function pauseQueueExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + try { + $gapicClient->pauseQueue($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function purgeQueueTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new Queue(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $response = $gapicClient->purgeQueue($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/PurgeQueue', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function purgeQueueExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + try { + $gapicClient->purgeQueue($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function resumeQueueTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new Queue(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $response = $gapicClient->resumeQueue($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/ResumeQueue', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function resumeQueueExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + try { + $gapicClient->resumeQueue($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function runTaskTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $dispatchCount = 1217252086; + $responseCount = 424727441; + $expectedResponse = new Task(); + $expectedResponse->setName($name2); + $expectedResponse->setDispatchCount($dispatchCount); + $expectedResponse->setResponseCount($responseCount); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $response = $gapicClient->runTask($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/RunTask', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function runTaskExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + try { + $gapicClient->runTask($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $response = $gapicClient->setIamPolicy($resource, $policy); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + try { + $gapicClient->setIamPolicy($resource, $policy); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $response = $gapicClient->testIamPermissions($resource, $permissions); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + try { + $gapicClient->testIamPermissions($resource, $permissions); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateQueueTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new Queue(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $queue = new Queue(); + $response = $gapicClient->updateQueue($queue); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/UpdateQueue', $actualFuncCall); + $actualValue = $actualRequestObject->getQueue(); + $this->assertProtobufEquals($queue, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateQueueExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $queue = new Queue(); + try { + $gapicClient->updateQueue($queue); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $response = $gapicClient->getLocation(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->getLocation(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $response = $gapicClient->listLocations(); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->listLocations(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } +} From 0ee16cb8cc225fac7b5b556dc9e5df3c8da3f60f Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 18 Jan 2024 11:49:55 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- Tasks/metadata/V2Beta2/Cloudtasks.php | Bin 8966 -> 8540 bytes Tasks/metadata/V2Beta3/Cloudtasks.php | 17 +- .../V2beta2/Gapic/CloudTasksGapicClient.php | 73 - Tasks/src/V2beta2/gapic_metadata.json | 5 - .../resources/cloud_tasks_client_config.json | 5 - .../cloud_tasks_rest_client_config.php | 17 - .../V2beta3/Gapic/CloudTasksGapicClient.php | 79 +- Tasks/src/V2beta3/gapic_metadata.json | 5 - .../resources/cloud_tasks_client_config.json | 5 - .../cloud_tasks_rest_client_config.php | 17 - .../Unit/V2beta2/CloudTasksClientTest.php | 59 - .../Unit/V2beta3/CloudTasksClientTest.php | 59 - .../Google/Cloud/Tasks/V2/Cloudtasks.php | 114 - .../Google/Cloud/Tasks/V2/Queue.php | Bin 1983 -> 0 bytes .../Google/Cloud/Tasks/V2/Target.php | Bin 1761 -> 0 bytes .../Google/Cloud/Tasks/V2/Task.php | Bin 2022 -> 0 bytes .../Cloud/Tasks/V2/AppEngineHttpRequest.php | 469 ---- .../Cloud/Tasks/V2/AppEngineRouting.php | 373 ---- .../src/Google/Cloud/Tasks/V2/Attempt.php | 229 -- .../Cloud/Tasks/V2/CreateQueueRequest.php | 160 -- .../Cloud/Tasks/V2/CreateTaskRequest.php | 349 --- .../Cloud/Tasks/V2/DeleteQueueRequest.php | 87 - .../Cloud/Tasks/V2/DeleteTaskRequest.php | 87 - .../Google/Cloud/Tasks/V2/GetQueueRequest.php | 86 - .../Google/Cloud/Tasks/V2/GetTaskRequest.php | 157 -- .../src/Google/Cloud/Tasks/V2/HttpMethod.php | 96 - .../src/Google/Cloud/Tasks/V2/HttpRequest.php | 421 ---- .../Cloud/Tasks/V2/ListQueuesRequest.php | 269 --- .../Cloud/Tasks/V2/ListQueuesResponse.php | 122 - .../Cloud/Tasks/V2/ListTasksRequest.php | 269 --- .../Cloud/Tasks/V2/ListTasksResponse.php | 118 - .../src/Google/Cloud/Tasks/V2/OAuthToken.php | 128 -- .../src/Google/Cloud/Tasks/V2/OidcToken.php | 126 -- .../Cloud/Tasks/V2/PauseQueueRequest.php | 87 - .../Cloud/Tasks/V2/PurgeQueueRequest.php | 87 - .../proto/src/Google/Cloud/Tasks/V2/Queue.php | 611 ----- .../src/Google/Cloud/Tasks/V2/Queue/State.php | 89 - .../src/Google/Cloud/Tasks/V2/RateLimits.php | 308 --- .../Cloud/Tasks/V2/ResumeQueueRequest.php | 87 - .../src/Google/Cloud/Tasks/V2/RetryConfig.php | 490 ---- .../Google/Cloud/Tasks/V2/RunTaskRequest.php | 157 -- .../Tasks/V2/StackdriverLoggingConfig.php | 80 - .../proto/src/Google/Cloud/Tasks/V2/Task.php | 684 ------ .../src/Google/Cloud/Tasks/V2/Task/View.php | 79 - .../Cloud/Tasks/V2/UpdateQueueRequest.php | 165 -- .../V2/CloudTasksClient/create_queue.php | 89 - .../V2/CloudTasksClient/create_task.php | 80 - .../V2/CloudTasksClient/delete_queue.php | 82 - .../V2/CloudTasksClient/delete_task.php | 74 - .../V2/CloudTasksClient/get_iam_policy.php | 79 - .../V2/CloudTasksClient/get_location.php | 57 - .../samples/V2/CloudTasksClient/get_queue.php | 72 - .../samples/V2/CloudTasksClient/get_task.php | 72 - .../V2/CloudTasksClient/list_locations.php | 62 - .../V2/CloudTasksClient/list_queues.php | 79 - .../V2/CloudTasksClient/list_tasks.php | 85 - .../V2/CloudTasksClient/pause_queue.php | 79 - .../V2/CloudTasksClient/purge_queue.php | 77 - .../V2/CloudTasksClient/resume_queue.php | 85 - .../samples/V2/CloudTasksClient/run_task.php | 97 - .../V2/CloudTasksClient/set_iam_policy.php | 83 - .../CloudTasksClient/test_iam_permissions.php | 85 - .../V2/CloudTasksClient/update_queue.php | 73 - .../v2/src/V2/Client/CloudTasksClient.php | 887 -------- .../Tasks/v2/src/V2/CloudTasksClient.php | 34 - .../v2/src/V2/Gapic/CloudTasksGapicClient.php | 1466 ------------ .../Tasks/v2/src/V2/gapic_metadata.json | 108 - .../resources/cloud_tasks_client_config.json | 135 -- .../cloud_tasks_descriptor_config.php | 256 --- .../cloud_tasks_rest_client_config.php | 220 -- .../Unit/V2/Client/CloudTasksClientTest.php | 1316 ----------- .../v2/tests/Unit/V2/CloudTasksClientTest.php | 1189 ---------- .../Google/Cloud/Tasks/V2Beta2/Cloudtasks.php | Bin 8540 -> 0 bytes .../Google/Cloud/Tasks/V2Beta2/OldTarget.php | 27 - .../Google/Cloud/Tasks/V2Beta2/Queue.php | Bin 2576 -> 0 bytes .../Google/Cloud/Tasks/V2Beta2/Target.php | Bin 3089 -> 0 bytes .../Google/Cloud/Tasks/V2Beta2/Task.php | Bin 2129 -> 0 bytes .../Tasks/V2beta2/AcknowledgeTaskRequest.php | 132 -- .../Tasks/V2beta2/AppEngineHttpRequest.php | 484 ---- .../Tasks/V2beta2/AppEngineHttpTarget.php | 114 - .../Cloud/Tasks/V2beta2/AppEngineRouting.php | 536 ----- .../Cloud/Tasks/V2beta2/AttemptStatus.php | 229 -- .../Tasks/V2beta2/CancelLeaseRequest.php | 206 -- .../Tasks/V2beta2/CreateQueueRequest.php | 136 -- .../Cloud/Tasks/V2beta2/CreateTaskRequest.php | 302 --- .../Tasks/V2beta2/DeleteQueueRequest.php | 72 - .../Cloud/Tasks/V2beta2/DeleteTaskRequest.php | 72 - .../Cloud/Tasks/V2beta2/GetQueueRequest.php | 128 -- .../Cloud/Tasks/V2beta2/GetTaskRequest.php | 146 -- .../Google/Cloud/Tasks/V2beta2/HttpMethod.php | 96 - .../Cloud/Tasks/V2beta2/HttpRequest.php | 416 ---- .../Google/Cloud/Tasks/V2beta2/HttpTarget.php | 375 ---- .../Cloud/Tasks/V2beta2/HttpTarget/Header.php | 104 - .../V2beta2/HttpTarget/HeaderOverride.php | 80 - .../Cloud/Tasks/V2beta2/LeaseTasksRequest.php | 442 ---- .../Tasks/V2beta2/LeaseTasksResponse.php | 68 - .../Cloud/Tasks/V2beta2/ListQueuesRequest.php | 310 --- .../Tasks/V2beta2/ListQueuesResponse.php | 126 -- .../Cloud/Tasks/V2beta2/ListTasksRequest.php | 258 --- .../Cloud/Tasks/V2beta2/ListTasksResponse.php | 122 - .../Google/Cloud/Tasks/V2beta2/OAuthToken.php | 128 -- .../Google/Cloud/Tasks/V2beta2/OidcToken.php | 126 -- .../Cloud/Tasks/V2beta2/PathOverride.php | 68 - .../Cloud/Tasks/V2beta2/PauseQueueRequest.php | 72 - .../Cloud/Tasks/V2beta2/PullMessage.php | 165 -- .../Google/Cloud/Tasks/V2beta2/PullTarget.php | 33 - .../Cloud/Tasks/V2beta2/PurgeQueueRequest.php | 72 - .../Cloud/Tasks/V2beta2/QueryOverride.php | 72 - .../src/Google/Cloud/Tasks/V2beta2/Queue.php | 771 ------- .../Cloud/Tasks/V2beta2/Queue/State.php | 93 - .../Google/Cloud/Tasks/V2beta2/QueueStats.php | 253 --- .../Google/Cloud/Tasks/V2beta2/RateLimits.php | 349 --- .../Cloud/Tasks/V2beta2/RenewLeaseRequest.php | 258 --- .../Tasks/V2beta2/ResumeQueueRequest.php | 72 - .../Cloud/Tasks/V2beta2/RetryConfig.php | 548 ----- .../Cloud/Tasks/V2beta2/RunTaskRequest.php | 146 -- .../src/Google/Cloud/Tasks/V2beta2/Task.php | 484 ---- .../Google/Cloud/Tasks/V2beta2/Task/View.php | 83 - .../Google/Cloud/Tasks/V2beta2/TaskStatus.php | 241 -- .../Tasks/V2beta2/UpdateQueueRequest.php | 150 -- .../Tasks/V2beta2/UploadQueueYamlRequest.php | 120 - .../Cloud/Tasks/V2beta2/UriOverride.php | 353 --- .../Tasks/V2beta2/UriOverride/Scheme.php | 66 - .../UriOverride/UriOverrideEnforceMode.php | 67 - .../CloudTasksClient/acknowledge_task.php | 82 - .../V2beta2/CloudTasksClient/cancel_lease.php | 76 - .../V2beta2/CloudTasksClient/create_queue.php | 85 - .../V2beta2/CloudTasksClient/create_task.php | 80 - .../V2beta2/CloudTasksClient/delete_queue.php | 77 - .../V2beta2/CloudTasksClient/delete_task.php | 69 - .../CloudTasksClient/get_iam_policy.php | 74 - .../V2beta2/CloudTasksClient/get_location.php | 53 - .../V2beta2/CloudTasksClient/get_queue.php | 67 - .../V2beta2/CloudTasksClient/get_task.php | 67 - .../V2beta2/CloudTasksClient/lease_tasks.php | 93 - .../CloudTasksClient/list_locations.php | 58 - .../V2beta2/CloudTasksClient/list_queues.php | 74 - .../V2beta2/CloudTasksClient/list_tasks.php | 80 - .../V2beta2/CloudTasksClient/pause_queue.php | 74 - .../V2beta2/CloudTasksClient/purge_queue.php | 72 - .../V2beta2/CloudTasksClient/renew_lease.php | 78 - .../V2beta2/CloudTasksClient/resume_queue.php | 81 - .../V2beta2/CloudTasksClient/run_task.php | 96 - .../CloudTasksClient/set_iam_policy.php | 79 - .../CloudTasksClient/test_iam_permissions.php | 81 - .../V2beta2/CloudTasksClient/update_queue.php | 70 - .../CloudTasksClient/upload_queue_yaml.php | 69 - .../v2beta2/src/V2beta2/CloudTasksClient.php | 36 - .../V2beta2/Gapic/CloudTasksGapicClient.php | 1977 ----------------- .../v2beta2/src/V2beta2/gapic_metadata.json | 133 -- .../resources/cloud_tasks_client_config.json | 160 -- .../cloud_tasks_descriptor_config.php | 42 - .../cloud_tasks_rest_client_config.php | 268 --- .../Unit/V2beta2/CloudTasksClientTest.php | 1492 ------------- .../Google/Cloud/Tasks/V2Beta3/Cloudtasks.php | 116 - .../Google/Cloud/Tasks/V2Beta3/Queue.php | Bin 2709 -> 0 bytes .../Google/Cloud/Tasks/V2Beta3/Target.php | Bin 3007 -> 0 bytes .../Google/Cloud/Tasks/V2Beta3/Task.php | Bin 2155 -> 0 bytes .../Tasks/V2beta3/AppEngineHttpQueue.php | 114 - .../Tasks/V2beta3/AppEngineHttpRequest.php | 478 ---- .../Cloud/Tasks/V2beta3/AppEngineRouting.php | 380 ---- .../Google/Cloud/Tasks/V2beta3/Attempt.php | 229 -- .../Tasks/V2beta3/CreateQueueRequest.php | 136 -- .../Cloud/Tasks/V2beta3/CreateTaskRequest.php | 302 --- .../Tasks/V2beta3/DeleteQueueRequest.php | 72 - .../Cloud/Tasks/V2beta3/DeleteTaskRequest.php | 72 - .../Cloud/Tasks/V2beta3/GetQueueRequest.php | 128 -- .../Cloud/Tasks/V2beta3/GetTaskRequest.php | 146 -- .../Google/Cloud/Tasks/V2beta3/HttpMethod.php | 96 - .../Cloud/Tasks/V2beta3/HttpRequest.php | 433 ---- .../Google/Cloud/Tasks/V2beta3/HttpTarget.php | 367 --- .../Cloud/Tasks/V2beta3/HttpTarget/Header.php | 104 - .../V2beta3/HttpTarget/HeaderOverride.php | 80 - .../Cloud/Tasks/V2beta3/ListQueuesRequest.php | 310 --- .../Tasks/V2beta3/ListQueuesResponse.php | 126 -- .../Cloud/Tasks/V2beta3/ListTasksRequest.php | 258 --- .../Cloud/Tasks/V2beta3/ListTasksResponse.php | 122 - .../Google/Cloud/Tasks/V2beta3/OAuthToken.php | 128 -- .../Google/Cloud/Tasks/V2beta3/OidcToken.php | 126 -- .../Cloud/Tasks/V2beta3/PathOverride.php | 68 - .../Cloud/Tasks/V2beta3/PauseQueueRequest.php | 72 - .../Cloud/Tasks/V2beta3/PullMessage.php | 132 -- .../Cloud/Tasks/V2beta3/PurgeQueueRequest.php | 72 - .../Cloud/Tasks/V2beta3/QueryOverride.php | 72 - .../src/Google/Cloud/Tasks/V2beta3/Queue.php | 883 -------- .../Cloud/Tasks/V2beta3/Queue/State.php | 89 - .../Google/Cloud/Tasks/V2beta3/Queue/Type.php | 64 - .../Google/Cloud/Tasks/V2beta3/QueueStats.php | 253 --- .../Google/Cloud/Tasks/V2beta3/RateLimits.php | 317 --- .../Tasks/V2beta3/ResumeQueueRequest.php | 72 - .../Cloud/Tasks/V2beta3/RetryConfig.php | 502 ----- .../Cloud/Tasks/V2beta3/RunTaskRequest.php | 146 -- .../V2beta3/StackdriverLoggingConfig.php | 80 - .../src/Google/Cloud/Tasks/V2beta3/Task.php | 746 ------- .../Google/Cloud/Tasks/V2beta3/Task/View.php | 81 - .../Tasks/V2beta3/UpdateQueueRequest.php | 150 -- .../Cloud/Tasks/V2beta3/UriOverride.php | 353 --- .../Tasks/V2beta3/UriOverride/Scheme.php | 66 - .../UriOverride/UriOverrideEnforceMode.php | 67 - .../V2beta3/CloudTasksClient/create_queue.php | 85 - .../V2beta3/CloudTasksClient/create_task.php | 76 - .../V2beta3/CloudTasksClient/delete_queue.php | 77 - .../V2beta3/CloudTasksClient/delete_task.php | 69 - .../CloudTasksClient/get_iam_policy.php | 74 - .../V2beta3/CloudTasksClient/get_location.php | 53 - .../V2beta3/CloudTasksClient/get_queue.php | 67 - .../V2beta3/CloudTasksClient/get_task.php | 67 - .../CloudTasksClient/list_locations.php | 58 - .../V2beta3/CloudTasksClient/list_queues.php | 74 - .../V2beta3/CloudTasksClient/list_tasks.php | 80 - .../V2beta3/CloudTasksClient/pause_queue.php | 74 - .../V2beta3/CloudTasksClient/purge_queue.php | 72 - .../V2beta3/CloudTasksClient/resume_queue.php | 81 - .../V2beta3/CloudTasksClient/run_task.php | 93 - .../CloudTasksClient/set_iam_policy.php | 79 - .../CloudTasksClient/test_iam_permissions.php | 81 - .../V2beta3/CloudTasksClient/update_queue.php | 70 - .../v2beta3/src/V2beta3/CloudTasksClient.php | 36 - .../V2beta3/Gapic/CloudTasksGapicClient.php | 1542 ------------- .../v2beta3/src/V2beta3/gapic_metadata.json | 108 - .../resources/cloud_tasks_client_config.json | 135 -- .../cloud_tasks_descriptor_config.php | 42 - .../cloud_tasks_rest_client_config.php | 220 -- .../Unit/V2beta3/CloudTasksClientTest.php | 1189 ---------- 224 files changed, 7 insertions(+), 42763 deletions(-) delete mode 100644 owl-bot-staging/Tasks/v2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2/Cloudtasks.php delete mode 100644 owl-bot-staging/Tasks/v2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2/Queue.php delete mode 100644 owl-bot-staging/Tasks/v2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2/Target.php delete mode 100644 owl-bot-staging/Tasks/v2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2/Task.php delete mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/AppEngineHttpRequest.php delete mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/AppEngineRouting.php delete mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Attempt.php delete mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/CreateQueueRequest.php delete mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/CreateTaskRequest.php delete mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/DeleteQueueRequest.php delete mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/DeleteTaskRequest.php delete mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/GetQueueRequest.php delete mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/GetTaskRequest.php delete mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/HttpMethod.php delete mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/HttpRequest.php delete mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ListQueuesRequest.php delete mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ListQueuesResponse.php delete mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ListTasksRequest.php delete mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ListTasksResponse.php delete mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/OAuthToken.php delete mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/OidcToken.php delete mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/PauseQueueRequest.php delete mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/PurgeQueueRequest.php delete mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Queue.php delete mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Queue/State.php delete mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/RateLimits.php delete mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ResumeQueueRequest.php delete mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/RetryConfig.php delete mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/RunTaskRequest.php delete mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/StackdriverLoggingConfig.php delete mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Task.php delete mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Task/View.php delete mode 100644 owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/UpdateQueueRequest.php delete mode 100644 owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/create_queue.php delete mode 100644 owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/create_task.php delete mode 100644 owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/delete_queue.php delete mode 100644 owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/delete_task.php delete mode 100644 owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/get_iam_policy.php delete mode 100644 owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/get_location.php delete mode 100644 owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/get_queue.php delete mode 100644 owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/get_task.php delete mode 100644 owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/list_locations.php delete mode 100644 owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/list_queues.php delete mode 100644 owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/list_tasks.php delete mode 100644 owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/pause_queue.php delete mode 100644 owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/purge_queue.php delete mode 100644 owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/resume_queue.php delete mode 100644 owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/run_task.php delete mode 100644 owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/set_iam_policy.php delete mode 100644 owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/test_iam_permissions.php delete mode 100644 owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/update_queue.php delete mode 100644 owl-bot-staging/Tasks/v2/src/V2/Client/CloudTasksClient.php delete mode 100644 owl-bot-staging/Tasks/v2/src/V2/CloudTasksClient.php delete mode 100644 owl-bot-staging/Tasks/v2/src/V2/Gapic/CloudTasksGapicClient.php delete mode 100644 owl-bot-staging/Tasks/v2/src/V2/gapic_metadata.json delete mode 100644 owl-bot-staging/Tasks/v2/src/V2/resources/cloud_tasks_client_config.json delete mode 100644 owl-bot-staging/Tasks/v2/src/V2/resources/cloud_tasks_descriptor_config.php delete mode 100644 owl-bot-staging/Tasks/v2/src/V2/resources/cloud_tasks_rest_client_config.php delete mode 100644 owl-bot-staging/Tasks/v2/tests/Unit/V2/Client/CloudTasksClientTest.php delete mode 100644 owl-bot-staging/Tasks/v2/tests/Unit/V2/CloudTasksClientTest.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta2/Cloudtasks.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta2/OldTarget.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta2/Queue.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta2/Target.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta2/Task.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AcknowledgeTaskRequest.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AppEngineHttpRequest.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AppEngineHttpTarget.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AppEngineRouting.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AttemptStatus.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/CancelLeaseRequest.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/CreateQueueRequest.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/CreateTaskRequest.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/DeleteQueueRequest.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/DeleteTaskRequest.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/GetQueueRequest.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/GetTaskRequest.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/HttpMethod.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/HttpRequest.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/HttpTarget.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/HttpTarget/Header.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/HttpTarget/HeaderOverride.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/LeaseTasksRequest.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/LeaseTasksResponse.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ListQueuesRequest.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ListQueuesResponse.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ListTasksRequest.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ListTasksResponse.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/OAuthToken.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/OidcToken.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PathOverride.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PauseQueueRequest.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PullMessage.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PullTarget.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PurgeQueueRequest.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/QueryOverride.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Queue.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Queue/State.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/QueueStats.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/RateLimits.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/RenewLeaseRequest.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ResumeQueueRequest.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/RetryConfig.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/RunTaskRequest.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Task.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Task/View.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/TaskStatus.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/UpdateQueueRequest.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/UploadQueueYamlRequest.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/UriOverride.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/UriOverride/Scheme.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/UriOverride/UriOverrideEnforceMode.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/acknowledge_task.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/cancel_lease.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/create_queue.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/create_task.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/delete_queue.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/delete_task.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/get_iam_policy.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/get_location.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/get_queue.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/get_task.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/lease_tasks.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/list_locations.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/list_queues.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/list_tasks.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/pause_queue.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/purge_queue.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/renew_lease.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/resume_queue.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/run_task.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/set_iam_policy.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/test_iam_permissions.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/update_queue.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/upload_queue_yaml.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/src/V2beta2/CloudTasksClient.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/src/V2beta2/Gapic/CloudTasksGapicClient.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/src/V2beta2/gapic_metadata.json delete mode 100644 owl-bot-staging/Tasks/v2beta2/src/V2beta2/resources/cloud_tasks_client_config.json delete mode 100644 owl-bot-staging/Tasks/v2beta2/src/V2beta2/resources/cloud_tasks_descriptor_config.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/src/V2beta2/resources/cloud_tasks_rest_client_config.php delete mode 100644 owl-bot-staging/Tasks/v2beta2/tests/Unit/V2beta2/CloudTasksClientTest.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta3/Cloudtasks.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta3/Queue.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta3/Target.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta3/Task.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/AppEngineHttpQueue.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/AppEngineHttpRequest.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/AppEngineRouting.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Attempt.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/CreateQueueRequest.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/CreateTaskRequest.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/DeleteQueueRequest.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/DeleteTaskRequest.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/GetQueueRequest.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/GetTaskRequest.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/HttpMethod.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/HttpRequest.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/HttpTarget.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/HttpTarget/Header.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/HttpTarget/HeaderOverride.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ListQueuesRequest.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ListQueuesResponse.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ListTasksRequest.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ListTasksResponse.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/OAuthToken.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/OidcToken.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/PathOverride.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/PauseQueueRequest.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/PullMessage.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/PurgeQueueRequest.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/QueryOverride.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Queue.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Queue/State.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Queue/Type.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/QueueStats.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/RateLimits.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ResumeQueueRequest.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/RetryConfig.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/RunTaskRequest.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/StackdriverLoggingConfig.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Task.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Task/View.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/UpdateQueueRequest.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/UriOverride.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/UriOverride/Scheme.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/UriOverride/UriOverrideEnforceMode.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/create_queue.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/create_task.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/delete_queue.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/delete_task.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/get_iam_policy.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/get_location.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/get_queue.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/get_task.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/list_locations.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/list_queues.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/list_tasks.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/pause_queue.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/purge_queue.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/resume_queue.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/run_task.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/set_iam_policy.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/test_iam_permissions.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/update_queue.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/src/V2beta3/CloudTasksClient.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/src/V2beta3/Gapic/CloudTasksGapicClient.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/src/V2beta3/gapic_metadata.json delete mode 100644 owl-bot-staging/Tasks/v2beta3/src/V2beta3/resources/cloud_tasks_client_config.json delete mode 100644 owl-bot-staging/Tasks/v2beta3/src/V2beta3/resources/cloud_tasks_descriptor_config.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/src/V2beta3/resources/cloud_tasks_rest_client_config.php delete mode 100644 owl-bot-staging/Tasks/v2beta3/tests/Unit/V2beta3/CloudTasksClientTest.php diff --git a/Tasks/metadata/V2Beta2/Cloudtasks.php b/Tasks/metadata/V2Beta2/Cloudtasks.php index 69849c057f9c76b903fe27ffaef2b4843e1c502f..0ee8065355d64963cfa3f15bb57910272fb211f1 100644 GIT binary patch delta 45 zcmZp3yW_OsHVexp3oh-+2Uw*y|6=LnVK&+-yE#%QjgM8z_mrdLWCb3{&07?M7y*Ag B4>AA% delta 305 zcmccP)aJI~HVeybYcB1{2Uw*y|6=Lnkyq+u=%wf9r{|>V zB^G4rd6bkCI05CrDwSNggph40F38U-P8HJQVgZ>d!3fr_FgZ|2X0m|*3$sy={N^^n zG(K*jD~w!R5RH=?rInyekSiy9%cyE$8mW}tbot3-CLbkt{W7DZ)RIIa{c4aeCJTxv nO^%ml)6}nq`lHq=3G8JnMy*?pLSUcjK&5m*e%ky-zJL(`#lK=B diff --git a/Tasks/metadata/V2Beta3/Cloudtasks.php b/Tasks/metadata/V2Beta3/Cloudtasks.php index a3891756f310..c492fe303df0 100644 --- a/Tasks/metadata/V2Beta3/Cloudtasks.php +++ b/Tasks/metadata/V2Beta3/Cloudtasks.php @@ -17,7 +17,6 @@ public static function initOnce() { \GPBMetadata\Google\Api\Annotations::initOnce(); \GPBMetadata\Google\Api\Client::initOnce(); \GPBMetadata\Google\Api\FieldBehavior::initOnce(); - \GPBMetadata\Google\Api\Httpbody::initOnce(); \GPBMetadata\Google\Api\Resource::initOnce(); \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Queue::initOnce(); \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Task::initOnce(); @@ -27,8 +26,8 @@ public static function initOnce() { \GPBMetadata\Google\Protobuf\FieldMask::initOnce(); $pool->internalAddGeneratedFile( ' -�+ -+google/cloud/tasks/v2beta3/cloudtasks.protogoogle.cloud.tasks.v2beta3google/api/client.protogoogle/api/field_behavior.protogoogle/api/httpbody.protogoogle/api/resource.proto&google/cloud/tasks/v2beta3/queue.proto%google/cloud/tasks/v2beta3/task.protogoogle/iam/v1/iam_policy.protogoogle/iam/v1/policy.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto"� +�( ++google/cloud/tasks/v2beta3/cloudtasks.protogoogle.cloud.tasks.v2beta3google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto&google/cloud/tasks/v2beta3/queue.proto%google/cloud/tasks/v2beta3/task.protogoogle/iam/v1/iam_policy.protogoogle/iam/v1/policy.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto"� ListQueuesRequest7 parent ( B\'�A�A!cloudtasks.googleapis.com/Queue filter (  @@ -84,13 +83,7 @@ public static function initOnce() { RunTaskRequest4 name ( B&�A�A cloudtasks.googleapis.com/Task< - response_view (2%.google.cloud.tasks.v2beta3.Task.View"� -BufferTaskRequest5 -queue ( B&�A�A cloudtasks.googleapis.com/Task -task_id ( B�A\' -body ( 2.google.api.HttpBodyB�A"D -BufferTaskResponse. -task ( 2 .google.cloud.tasks.v2beta3.Task2� + response_view (2%.google.cloud.tasks.v2beta3.Task.View2� CloudTasks� @@ -113,9 +106,7 @@ public static function initOnce() { CreateTask-.google.cloud.tasks.v2beta3.CreateTaskRequest .google.cloud.tasks.v2beta3.Task"P���<"7/v2beta3/{parent=projects/*/locations/*/queues/*}/tasks:*�A parent,task� DeleteTask-.google.cloud.tasks.v2beta3.DeleteTaskRequest.google.protobuf.Empty"F���9*7/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}�Aname� -RunTask*.google.cloud.tasks.v2beta3.RunTaskRequest .google.cloud.tasks.v2beta3.Task"M���@";/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}:run:*�Aname� - -BufferTask-.google.cloud.tasks.v2beta3.BufferTaskRequest..google.cloud.tasks.v2beta3.BufferTaskResponse"g���L"G/v2beta3/{queue=projects/*/locations/*/queues/*}/tasks/{task_id}:buffer:*�Aqueue,task_id,bodyM�Acloudtasks.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformB� +RunTask*.google.cloud.tasks.v2beta3.RunTaskRequest .google.cloud.tasks.v2beta3.Task"M���@";/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}:run:*�AnameM�Acloudtasks.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformB� com.google.cloud.tasks.v2beta3BCloudTasksProtoPZCcloud.google.com/go/cloudtasks/apiv2beta3/cloudtaskspb;cloudtaskspb�TASKSbproto3' , true); diff --git a/Tasks/src/V2beta2/Gapic/CloudTasksGapicClient.php b/Tasks/src/V2beta2/Gapic/CloudTasksGapicClient.php index 8bd8e07d3209..b6604453f65a 100644 --- a/Tasks/src/V2beta2/Gapic/CloudTasksGapicClient.php +++ b/Tasks/src/V2beta2/Gapic/CloudTasksGapicClient.php @@ -48,8 +48,6 @@ use Google\Cloud\Location\ListLocationsResponse; use Google\Cloud\Location\Location; use Google\Cloud\Tasks\V2beta2\AcknowledgeTaskRequest; -use Google\Cloud\Tasks\V2beta2\BufferTaskRequest; -use Google\Cloud\Tasks\V2beta2\BufferTaskResponse; use Google\Cloud\Tasks\V2beta2\CancelLeaseRequest; use Google\Cloud\Tasks\V2beta2\CreateQueueRequest; use Google\Cloud\Tasks\V2beta2\CreateTaskRequest; @@ -456,77 +454,6 @@ public function acknowledgeTask($name, $scheduleTime, array $optionalArgs = []) return $this->startCall('AcknowledgeTask', GPBEmpty::class, $optionalArgs, $request)->wait(); } - /** - * Creates and buffers a new task without the need to explicitly define a Task - * message. The queue must have [HTTP - * target][google.cloud.tasks.v2beta2.HttpTarget]. To create the task with a - * custom ID, use the following format and set TASK_ID to your desired ID: - * projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID:buffer - * To create the task with an automatically generated ID, use the following - * format: - * projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks:buffer. - * Note: This feature is in its experimental stage. You must request access to - * the API through the [Cloud Tasks BufferTask Experiment Signup - * form](https://forms.gle/X8Zr5hiXH5tTGFqh8). - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $formattedQueue = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - * $response = $cloudTasksClient->bufferTask($formattedQueue); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $queue Required. The parent queue name. For example: - * projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * - * The queue must already exist. - * @param array $optionalArgs { - * Optional. - * - * @type string $taskId - * Optional. Task ID for the task being created. If not provided, a random - * task ID is assigned to the task. - * @type HttpBody $body - * Optional. Body of the HTTP request. - * - * The body can take any generic value. The value is written to the - * [HttpRequest][payload] of the [Task]. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Tasks\V2beta2\BufferTaskResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function bufferTask($queue, array $optionalArgs = []) - { - $request = new BufferTaskRequest(); - $requestParamHeaders = []; - $request->setQueue($queue); - $requestParamHeaders['queue'] = $queue; - if (isset($optionalArgs['taskId'])) { - $request->setTaskId($optionalArgs['taskId']); - $requestParamHeaders['task_id'] = $optionalArgs['taskId']; - } - - if (isset($optionalArgs['body'])) { - $request->setBody($optionalArgs['body']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('BufferTask', BufferTaskResponse::class, $optionalArgs, $request)->wait(); - } - /** * Cancel a pull task's lease. * diff --git a/Tasks/src/V2beta2/gapic_metadata.json b/Tasks/src/V2beta2/gapic_metadata.json index 4f138f7d661e..92458443760a 100644 --- a/Tasks/src/V2beta2/gapic_metadata.json +++ b/Tasks/src/V2beta2/gapic_metadata.json @@ -15,11 +15,6 @@ "acknowledgeTask" ] }, - "BufferTask": { - "methods": [ - "bufferTask" - ] - }, "CancelLease": { "methods": [ "cancelLease" diff --git a/Tasks/src/V2beta2/resources/cloud_tasks_client_config.json b/Tasks/src/V2beta2/resources/cloud_tasks_client_config.json index 474578c40fe2..3e49652fe97e 100644 --- a/Tasks/src/V2beta2/resources/cloud_tasks_client_config.json +++ b/Tasks/src/V2beta2/resources/cloud_tasks_client_config.json @@ -44,11 +44,6 @@ "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, - "BufferTask": { - "timeout_millis": 20000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, "CancelLease": { "timeout_millis": 20000, "retry_codes_name": "no_retry_1_codes", diff --git a/Tasks/src/V2beta2/resources/cloud_tasks_rest_client_config.php b/Tasks/src/V2beta2/resources/cloud_tasks_rest_client_config.php index fb91babcb5ee..d6a4e451cb37 100644 --- a/Tasks/src/V2beta2/resources/cloud_tasks_rest_client_config.php +++ b/Tasks/src/V2beta2/resources/cloud_tasks_rest_client_config.php @@ -39,23 +39,6 @@ ], ], ], - 'BufferTask' => [ - 'method' => 'post', - 'uriTemplate' => '/v2beta2/{queue=projects/*/locations/*/queues/*}/tasks/{task_id}:buffer', - 'body' => '*', - 'placeholders' => [ - 'queue' => [ - 'getters' => [ - 'getQueue', - ], - ], - 'task_id' => [ - 'getters' => [ - 'getTaskId', - ], - ], - ], - ], 'CancelLease' => [ 'method' => 'post', 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:cancelLease', diff --git a/Tasks/src/V2beta3/Gapic/CloudTasksGapicClient.php b/Tasks/src/V2beta3/Gapic/CloudTasksGapicClient.php index 226795b38eb4..25ce83312745 100644 --- a/Tasks/src/V2beta3/Gapic/CloudTasksGapicClient.php +++ b/Tasks/src/V2beta3/Gapic/CloudTasksGapicClient.php @@ -35,7 +35,6 @@ use Google\ApiCore\RetrySettings; use Google\ApiCore\Transport\TransportInterface; use Google\ApiCore\ValidationException; -use Google\Api\HttpBody; use Google\Auth\FetchAuthTokenInterface; use Google\Cloud\Iam\V1\GetIamPolicyRequest; use Google\Cloud\Iam\V1\GetPolicyOptions; @@ -47,8 +46,6 @@ use Google\Cloud\Location\ListLocationsRequest; use Google\Cloud\Location\ListLocationsResponse; use Google\Cloud\Location\Location; -use Google\Cloud\Tasks\V2beta3\BufferTaskRequest; -use Google\Cloud\Tasks\V2beta3\BufferTaskResponse; use Google\Cloud\Tasks\V2beta3\CreateQueueRequest; use Google\Cloud\Tasks\V2beta3\CreateTaskRequest; use Google\Cloud\Tasks\V2beta3\DeleteQueueRequest; @@ -80,8 +77,9 @@ * ``` * $cloudTasksClient = new CloudTasksClient(); * try { - * $formattedQueue = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - * $response = $cloudTasksClient->bufferTask($formattedQueue); + * $formattedParent = $cloudTasksClient->locationName('[PROJECT]', '[LOCATION]'); + * $queue = new Queue(); + * $response = $cloudTasksClient->createQueue($formattedParent, $queue); * } finally { * $cloudTasksClient->close(); * } @@ -387,77 +385,6 @@ public function __construct(array $options = []) $this->setClientOptions($clientOptions); } - /** - * Creates and buffers a new task without the need to explicitly define a Task - * message. The queue must have [HTTP - * target][google.cloud.tasks.v2beta3.HttpTarget]. To create the task with a - * custom ID, use the following format and set TASK_ID to your desired ID: - * projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID:buffer - * To create the task with an automatically generated ID, use the following - * format: - * projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks:buffer. - * Note: This feature is in its experimental stage. You must request access to - * the API through the [Cloud Tasks BufferTask Experiment Signup - * form](https://forms.gle/X8Zr5hiXH5tTGFqh8). - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $formattedQueue = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - * $response = $cloudTasksClient->bufferTask($formattedQueue); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $queue Required. The parent queue name. For example: - * projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * - * The queue must already exist. - * @param array $optionalArgs { - * Optional. - * - * @type string $taskId - * Optional. Task ID for the task being created. If not provided, a random - * task ID is assigned to the task. - * @type HttpBody $body - * Optional. Body of the HTTP request. - * - * The body can take any generic value. The value is written to the - * [HttpRequest][payload] of the [Task]. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Tasks\V2beta3\BufferTaskResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function bufferTask($queue, array $optionalArgs = []) - { - $request = new BufferTaskRequest(); - $requestParamHeaders = []; - $request->setQueue($queue); - $requestParamHeaders['queue'] = $queue; - if (isset($optionalArgs['taskId'])) { - $request->setTaskId($optionalArgs['taskId']); - $requestParamHeaders['task_id'] = $optionalArgs['taskId']; - } - - if (isset($optionalArgs['body'])) { - $request->setBody($optionalArgs['body']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('BufferTask', BufferTaskResponse::class, $optionalArgs, $request)->wait(); - } - /** * Creates a queue. * diff --git a/Tasks/src/V2beta3/gapic_metadata.json b/Tasks/src/V2beta3/gapic_metadata.json index 1ca31a8697ef..91fdac01bfc2 100644 --- a/Tasks/src/V2beta3/gapic_metadata.json +++ b/Tasks/src/V2beta3/gapic_metadata.json @@ -10,11 +10,6 @@ "grpc": { "libraryClient": "CloudTasksGapicClient", "rpcs": { - "BufferTask": { - "methods": [ - "bufferTask" - ] - }, "CreateQueue": { "methods": [ "createQueue" diff --git a/Tasks/src/V2beta3/resources/cloud_tasks_client_config.json b/Tasks/src/V2beta3/resources/cloud_tasks_client_config.json index fe35f305c38b..d68dd2e3a24f 100644 --- a/Tasks/src/V2beta3/resources/cloud_tasks_client_config.json +++ b/Tasks/src/V2beta3/resources/cloud_tasks_client_config.json @@ -39,11 +39,6 @@ } }, "methods": { - "BufferTask": { - "timeout_millis": 20000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, "CreateQueue": { "timeout_millis": 20000, "retry_codes_name": "no_retry_1_codes", diff --git a/Tasks/src/V2beta3/resources/cloud_tasks_rest_client_config.php b/Tasks/src/V2beta3/resources/cloud_tasks_rest_client_config.php index 73f0644e4160..8bcffbc8b257 100644 --- a/Tasks/src/V2beta3/resources/cloud_tasks_rest_client_config.php +++ b/Tasks/src/V2beta3/resources/cloud_tasks_rest_client_config.php @@ -27,23 +27,6 @@ ], ], 'google.cloud.tasks.v2beta3.CloudTasks' => [ - 'BufferTask' => [ - 'method' => 'post', - 'uriTemplate' => '/v2beta3/{queue=projects/*/locations/*/queues/*}/tasks/{task_id}:buffer', - 'body' => '*', - 'placeholders' => [ - 'queue' => [ - 'getters' => [ - 'getQueue', - ], - ], - 'task_id' => [ - 'getters' => [ - 'getTaskId', - ], - ], - ], - ], 'CreateQueue' => [ 'method' => 'post', 'uriTemplate' => '/v2beta3/{parent=projects/*/locations/*}/queues', diff --git a/Tasks/tests/Unit/V2beta2/CloudTasksClientTest.php b/Tasks/tests/Unit/V2beta2/CloudTasksClientTest.php index ef6b948f41c3..a35c5a4d9ef9 100644 --- a/Tasks/tests/Unit/V2beta2/CloudTasksClientTest.php +++ b/Tasks/tests/Unit/V2beta2/CloudTasksClientTest.php @@ -30,7 +30,6 @@ use Google\Cloud\Iam\V1\TestIamPermissionsResponse; use Google\Cloud\Location\ListLocationsResponse; use Google\Cloud\Location\Location; -use Google\Cloud\Tasks\V2beta2\BufferTaskResponse; use Google\Cloud\Tasks\V2beta2\CloudTasksClient; use Google\Cloud\Tasks\V2beta2\LeaseTasksResponse; use Google\Cloud\Tasks\V2beta2\ListQueuesResponse; @@ -132,64 +131,6 @@ public function acknowledgeTaskExceptionTest() $this->assertTrue($transport->isExhausted()); } - /** @test */ - public function bufferTaskTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new BufferTaskResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedQueue = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $response = $gapicClient->bufferTask($formattedQueue); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/BufferTask', $actualFuncCall); - $actualValue = $actualRequestObject->getQueue(); - $this->assertProtobufEquals($formattedQueue, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function bufferTaskExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedQueue = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - try { - $gapicClient->bufferTask($formattedQueue); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - /** @test */ public function cancelLeaseTest() { diff --git a/Tasks/tests/Unit/V2beta3/CloudTasksClientTest.php b/Tasks/tests/Unit/V2beta3/CloudTasksClientTest.php index ecd4f91ad239..2e06c858c79f 100644 --- a/Tasks/tests/Unit/V2beta3/CloudTasksClientTest.php +++ b/Tasks/tests/Unit/V2beta3/CloudTasksClientTest.php @@ -30,7 +30,6 @@ use Google\Cloud\Iam\V1\TestIamPermissionsResponse; use Google\Cloud\Location\ListLocationsResponse; use Google\Cloud\Location\Location; -use Google\Cloud\Tasks\V2beta3\BufferTaskResponse; use Google\Cloud\Tasks\V2beta3\CloudTasksClient; use Google\Cloud\Tasks\V2beta3\ListQueuesResponse; use Google\Cloud\Tasks\V2beta3\ListTasksResponse; @@ -68,64 +67,6 @@ private function createClient(array $options = []) return new CloudTasksClient($options); } - /** @test */ - public function bufferTaskTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new BufferTaskResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedQueue = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $response = $gapicClient->bufferTask($formattedQueue); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/BufferTask', $actualFuncCall); - $actualValue = $actualRequestObject->getQueue(); - $this->assertProtobufEquals($formattedQueue, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function bufferTaskExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedQueue = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - try { - $gapicClient->bufferTask($formattedQueue); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - /** @test */ public function createQueueTest() { diff --git a/owl-bot-staging/Tasks/v2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2/Cloudtasks.php b/owl-bot-staging/Tasks/v2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2/Cloudtasks.php deleted file mode 100644 index 00f7218c1d4a..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2/Cloudtasks.php +++ /dev/null @@ -1,114 +0,0 @@ -internalAddGeneratedFile( - ' -�% -&google/cloud/tasks/v2/cloudtasks.protogoogle.cloud.tasks.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto!google/cloud/tasks/v2/queue.proto google/cloud/tasks/v2/task.protogoogle/iam/v1/iam_policy.protogoogle/iam/v1/policy.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto"� -ListQueuesRequest7 -parent ( B\'�A�A!cloudtasks.googleapis.com/Queue -filter (  - page_size ( - -page_token ( "[ -ListQueuesResponse, -queues ( 2.google.cloud.tasks.v2.Queue -next_page_token ( "H -GetQueueRequest5 -name ( B\'�A�A! -cloudtasks.googleapis.com/Queue" -CreateQueueRequest7 -parent ( B\'�A�A!cloudtasks.googleapis.com/Queue0 -queue ( 2.google.cloud.tasks.v2.QueueB�A"w -UpdateQueueRequest0 -queue ( 2.google.cloud.tasks.v2.QueueB�A/ - update_mask ( 2.google.protobuf.FieldMask"K -DeleteQueueRequest5 -name ( B\'�A�A! -cloudtasks.googleapis.com/Queue"J -PurgeQueueRequest5 -name ( B\'�A�A! -cloudtasks.googleapis.com/Queue"J -PauseQueueRequest5 -name ( B\'�A�A! -cloudtasks.googleapis.com/Queue"K -ResumeQueueRequest5 -name ( B\'�A�A! -cloudtasks.googleapis.com/Queue"� -ListTasksRequest6 -parent ( B&�A�A cloudtasks.googleapis.com/Task7 - response_view (2 .google.cloud.tasks.v2.Task.View - page_size ( - -page_token ( "X -ListTasksResponse* -tasks ( 2.google.cloud.tasks.v2.Task -next_page_token ( " -GetTaskRequest4 -name ( B&�A�A -cloudtasks.googleapis.com/Task7 - response_view (2 .google.cloud.tasks.v2.Task.View"� -CreateTaskRequest6 -parent ( B&�A�A cloudtasks.googleapis.com/Task. -task ( 2.google.cloud.tasks.v2.TaskB�A7 - response_view (2 .google.cloud.tasks.v2.Task.View"I -DeleteTaskRequest4 -name ( B&�A�A -cloudtasks.googleapis.com/Task" -RunTaskRequest4 -name ( B&�A�A -cloudtasks.googleapis.com/Task7 - response_view (2 .google.cloud.tasks.v2.Task.View2� - -CloudTasks� - -ListQueues(.google.cloud.tasks.v2.ListQueuesRequest).google.cloud.tasks.v2.ListQueuesResponse";���,*/v2/{parent=projects/*/locations/*}/queues�Aparent� -GetQueue&.google.cloud.tasks.v2.GetQueueRequest.google.cloud.tasks.v2.Queue"9���,*/v2/{name=projects/*/locations/*/queues/*}�Aname� - CreateQueue).google.cloud.tasks.v2.CreateQueueRequest.google.cloud.tasks.v2.Queue"H���3"*/v2/{parent=projects/*/locations/*}/queues:queue�A parent,queue� - UpdateQueue).google.cloud.tasks.v2.UpdateQueueRequest.google.cloud.tasks.v2.Queue"S���920/v2/{queue.name=projects/*/locations/*/queues/*}:queue�Aqueue,update_mask� - DeleteQueue).google.cloud.tasks.v2.DeleteQueueRequest.google.protobuf.Empty"9���,**/v2/{name=projects/*/locations/*/queues/*}�Aname� - -PurgeQueue(.google.cloud.tasks.v2.PurgeQueueRequest.google.cloud.tasks.v2.Queue"B���5"0/v2/{name=projects/*/locations/*/queues/*}:purge:*�Aname� - -PauseQueue(.google.cloud.tasks.v2.PauseQueueRequest.google.cloud.tasks.v2.Queue"B���5"0/v2/{name=projects/*/locations/*/queues/*}:pause:*�Aname� - ResumeQueue).google.cloud.tasks.v2.ResumeQueueRequest.google.cloud.tasks.v2.Queue"C���6"1/v2/{name=projects/*/locations/*/queues/*}:resume:*�Aname� - GetIamPolicy".google.iam.v1.GetIamPolicyRequest.google.iam.v1.Policy"Q���@";/v2/{resource=projects/*/locations/*/queues/*}:getIamPolicy:*�Aresource� - SetIamPolicy".google.iam.v1.SetIamPolicyRequest.google.iam.v1.Policy"X���@";/v2/{resource=projects/*/locations/*/queues/*}:setIamPolicy:*�Aresource,policy� -TestIamPermissions(.google.iam.v1.TestIamPermissionsRequest).google.iam.v1.TestIamPermissionsResponse"c���F"A/v2/{resource=projects/*/locations/*/queues/*}:testIamPermissions:*�Aresource,permissions� - ListTasks\'.google.cloud.tasks.v2.ListTasksRequest(.google.cloud.tasks.v2.ListTasksResponse"C���42/v2/{parent=projects/*/locations/*/queues/*}/tasks�Aparent� -GetTask%.google.cloud.tasks.v2.GetTaskRequest.google.cloud.tasks.v2.Task"A���42/v2/{name=projects/*/locations/*/queues/*/tasks/*}�Aname� - -CreateTask(.google.cloud.tasks.v2.CreateTaskRequest.google.cloud.tasks.v2.Task"K���7"2/v2/{parent=projects/*/locations/*/queues/*}/tasks:*�A parent,task� - -DeleteTask(.google.cloud.tasks.v2.DeleteTaskRequest.google.protobuf.Empty"A���4*2/v2/{name=projects/*/locations/*/queues/*/tasks/*}�Aname� -RunTask%.google.cloud.tasks.v2.RunTaskRequest.google.cloud.tasks.v2.Task"H���;"6/v2/{name=projects/*/locations/*/queues/*/tasks/*}:run:*�AnameM�Acloudtasks.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformBv -com.google.cloud.tasks.v2BCloudTasksProtoPZ>cloud.google.com/go/cloudtasks/apiv2/cloudtaskspb;cloudtaskspb�TASKSbproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Tasks/v2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2/Queue.php b/owl-bot-staging/Tasks/v2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2/Queue.php deleted file mode 100644 index 7934457c1550ea983a9692c5f7e75c7193348064..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1983 zcmbVN;cgp65XNmB$T(ExM356Cx-pgFN^llNRLCJkPV7dOLSk$O33Srwe7C-Ad%oN5 z?nRW!FU4P;g4f_FnBBc|9O_Vn|M+h2`*vr(`F7^J@A(yn&&erGsR$H}$n-T)SCnv( zsVvMAGRDuZK@_OKJ2gb_L=(MHT1uu@noo*j^>%DVnl{Ex=dB=*h!QznJ)ICi zRW8y)6Sv-Av3&B@2-W4x8_`1c&P_r${B^9`@}kZHbLjkM`cjf!jy^#p{|9x#u>2~R z^YvU)g)g76Li27EEhT=A)@v?B(GnfNA6u~hPR}_z7UCLPy2h67b$hR|o~eu~)~ z6&Pb)bVDmDQZK$g`sa65=4Szo-#4IY?CWg9hW38FLMqKI=L|j#IQMB9vy}QG%N0vw zKf9(vu!z?0A*j~&4&1e&yIs!vhB>lC=PA_m)%6oLXG+%Z8~Xko>=7c*4AA)&w$XUv zwI62bjK%d0Lu}kd)X)=ybiRVB_BX9pk@BE@7scf6jy2M80eFs<^R-CzO>@*ILby7);JqgZhn>XzZRO8)KQ>Jv-indRBI8-1wSXm;SE@uWNH`$!L{;nVS6O5ywa_1(Rcx{Ql)*^od>`A z5yQr*!Ye9$j(SLnMT?A|D$XbHKtravkjj_X3yp=UPC-Rvmw4LEw$x~04Yg->_OA}otob_lF_ZO&4Eiq*(wv%;9~!0S8; zy!GS1;CJ9dBTc5qLK;hB$7-Vu^}8IPrIOfyG~73R%u0C7U>6HlrgGa)$6)F?)I(ud z`Q@4YT3${pcbwU&XNMlT0O#I~Ir#K&^<}zgg!=km+0MSO6Jce5p!0FStr;E$Y5V*F H765+(Bg%xr diff --git a/owl-bot-staging/Tasks/v2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2/Target.php b/owl-bot-staging/Tasks/v2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2/Target.php deleted file mode 100644 index 54926fb36dd67b638443466bc250c6cb509b8833..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1761 zcmb7F|8Cnh5UzhDu20@72&d~eJWj3mhpfL(1Ni=M0!EQvaly`dXe_lefh!{ zM3{LvfEcexn&5z-Q)l#w2pnR8z0=&&J64{at3188{X>8t!fA@!JOX?GB%dUkMKnOE zz(W2!qp440DkzTVd&&I>&2f|x>3S18&*DH(79-_g#{ua+M@3A9eU>m;>k<0M#Zl$U z(!FUc2#;~(jY%4Cnh3@n2^|b%RhyC`Zx-U%g9I3i2Dri>2;*Hv8y$&32#B`r%BhT(?siPW;Y$)Pgt!*5OK z+%KZ>xWJgX&}J^Qx$bxVtb#TXB6&@I%}6Q?9cmem+7(pkHb=EThE?MS(3TS5uZUQ( zuw9j3KJ7m>Zw+UvP;x*d(D(@&OM*kf({>Hjx>~>YFFs{@b5eL%vEY|R3+gi#UbgEp zWy?4Kjp0lzeZekB+}@E!?M@!{P$FFgoIH>f0Ha}0I_~C<=ngWr1eShZn9%wg9}Q|3 zp~A3ccnEcT1~JHJ<9Z?hcuRFSZ<24AUQ=#mWq6e znw0;Pj;)_9*V1>4ChRyv_jsc38X7cg$DP_|=XzuG3w$oGfZG)uX~mAtm!?yB_p(?G z9}hNL^%ktS7m8~ECsf`HIVd+Iv%~E_v)%l*_6BjelxbnI%r6LMG zPq_?v!WAbm{}bN5g(oDI41kwyCwW2@PZO*G`w3<3=h*txwogS0ac<%AB_ka=gdGeM z#j=FNL7z#QaiP*|1g5?}WvU`f@3fy6*J^isg4_0uzJKYFTUcc|yLdas8B=+dY?^m# z2lHwbT)|UU@Zf+Ir2FRqo#U@UEwT$VXApybYj{OTKL?cnlm7#H#3B2NoQT_F4+ISk zA>FyW8e=l|?Q34-sT)OAT6RFJ?TScE>ofFM1Kp@n=L@T2*XY#ghLt%+dC0*OlO`pt`Q2W)0Wc4QCHM zB0_{Lnev2%Go?hBvEOr`xp@~1mOC$8>+yqV+^!G<19}6P0}FX`$MMn1f|E~-lh!p( z7O^kULrG^W%3~JlxSDkXUN6BVDQ=|$$3x3BW6*UhVChD{EA&~!p@S$o3nNCN7{YGe zGqA^(?kT0}e2G>o6ixF)HSYstN$+RSkJ3c4(C$Al``@F76P`&G5~bLQP|b$9VWYfZ zQ5kO6S~;)K3UsV<6uK44MfFq8{%9_P^=b!SbBE5odkl81m#D74&gW?DcsTeue7AQv z8f*`DhJ*gv9jAeodfmg}_FBz(fa*K%-o9PC>(Bn}GPGe{ZRKn=K?IjBv~|x2Ya8hI%vf7$_?b7M0Lz zXeLK`dW>qnytapB{Q=L@)DB0J1P|zk@pzsUG2XoRXME2T%y-YK9`=nL9Tz5zel4e0 OOc`To2f`f95&94G5|j!6 diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/AppEngineHttpRequest.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/AppEngineHttpRequest.php deleted file mode 100644 index ad547996af2e..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/AppEngineHttpRequest.php +++ /dev/null @@ -1,469 +0,0 @@ -google.cloud.tasks.v2.AppEngineHttpRequest - */ -class AppEngineHttpRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The HTTP method to use for the request. The default is POST. - * The app's request handler for the task's target URL must be able to handle - * HTTP requests with this http_method, otherwise the task attempt fails with - * error code 405 (Method Not Allowed). See [Writing a push task request - * handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) - * and the App Engine documentation for your runtime on [How Requests are - * Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). - * - * Generated from protobuf field .google.cloud.tasks.v2.HttpMethod http_method = 1; - */ - protected $http_method = 0; - /** - * Task-level setting for App Engine routing. - * * If [app_engine_routing_override is set on the - * queue][google.cloud.tasks.v2.Queue.app_engine_routing_override], this - * value is used for all tasks in the queue, no matter what the setting is - * for the [task-level - * app_engine_routing][google.cloud.tasks.v2.AppEngineHttpRequest.app_engine_routing]. - * - * Generated from protobuf field .google.cloud.tasks.v2.AppEngineRouting app_engine_routing = 2; - */ - protected $app_engine_routing = null; - /** - * The relative URI. - * The relative URI must begin with "/" and must be a valid HTTP relative URI. - * It can contain a path and query string arguments. - * If the relative URI is empty, then the root path "/" will be used. - * No spaces are allowed, and the maximum length allowed is 2083 characters. - * - * Generated from protobuf field string relative_uri = 3; - */ - protected $relative_uri = ''; - /** - * HTTP request headers. - * This map contains the header field names and values. - * Headers can be set when the - * [task is created][google.cloud.tasks.v2.CloudTasks.CreateTask]. - * Repeated headers are not supported but a header value can contain commas. - * Cloud Tasks sets some headers to default values: - * * `User-Agent`: By default, this header is - * `"AppEngine-Google; (+http://code.google.com/appengine)"`. - * This header can be modified, but Cloud Tasks will append - * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the - * modified `User-Agent`. - * If the task has a [body][google.cloud.tasks.v2.AppEngineHttpRequest.body], - * Cloud Tasks sets the following headers: - * * `Content-Type`: By default, the `Content-Type` header is set to - * `"application/octet-stream"`. The default can be overridden by explicitly - * setting `Content-Type` to a particular media type when the - * [task is created][google.cloud.tasks.v2.CloudTasks.CreateTask]. - * For example, `Content-Type` can be set to `"application/json"`. - * * `Content-Length`: This is computed by Cloud Tasks. This value is - * output only. It cannot be changed. - * The headers below cannot be set or overridden: - * * `Host` - * * `X-Google-*` - * * `X-AppEngine-*` - * In addition, Cloud Tasks sets some headers when the task is dispatched, - * such as headers containing information about the task; see - * [request - * headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers). - * These headers are set only when the task is dispatched, so they are not - * visible when the task is returned in a Cloud Tasks response. - * Although there is no specific limit for the maximum number of headers or - * the size, there is a limit on the maximum size of the - * [Task][google.cloud.tasks.v2.Task]. For more information, see the - * [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask] documentation. - * - * Generated from protobuf field map headers = 4; - */ - private $headers; - /** - * HTTP request body. - * A request body is allowed only if the HTTP method is POST or PUT. It is - * an error to set a body on a task with an incompatible - * [HttpMethod][google.cloud.tasks.v2.HttpMethod]. - * - * Generated from protobuf field bytes body = 5; - */ - protected $body = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $http_method - * The HTTP method to use for the request. The default is POST. - * The app's request handler for the task's target URL must be able to handle - * HTTP requests with this http_method, otherwise the task attempt fails with - * error code 405 (Method Not Allowed). See [Writing a push task request - * handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) - * and the App Engine documentation for your runtime on [How Requests are - * Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). - * @type \Google\Cloud\Tasks\V2\AppEngineRouting $app_engine_routing - * Task-level setting for App Engine routing. - * * If [app_engine_routing_override is set on the - * queue][google.cloud.tasks.v2.Queue.app_engine_routing_override], this - * value is used for all tasks in the queue, no matter what the setting is - * for the [task-level - * app_engine_routing][google.cloud.tasks.v2.AppEngineHttpRequest.app_engine_routing]. - * @type string $relative_uri - * The relative URI. - * The relative URI must begin with "/" and must be a valid HTTP relative URI. - * It can contain a path and query string arguments. - * If the relative URI is empty, then the root path "/" will be used. - * No spaces are allowed, and the maximum length allowed is 2083 characters. - * @type array|\Google\Protobuf\Internal\MapField $headers - * HTTP request headers. - * This map contains the header field names and values. - * Headers can be set when the - * [task is created][google.cloud.tasks.v2.CloudTasks.CreateTask]. - * Repeated headers are not supported but a header value can contain commas. - * Cloud Tasks sets some headers to default values: - * * `User-Agent`: By default, this header is - * `"AppEngine-Google; (+http://code.google.com/appengine)"`. - * This header can be modified, but Cloud Tasks will append - * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the - * modified `User-Agent`. - * If the task has a [body][google.cloud.tasks.v2.AppEngineHttpRequest.body], - * Cloud Tasks sets the following headers: - * * `Content-Type`: By default, the `Content-Type` header is set to - * `"application/octet-stream"`. The default can be overridden by explicitly - * setting `Content-Type` to a particular media type when the - * [task is created][google.cloud.tasks.v2.CloudTasks.CreateTask]. - * For example, `Content-Type` can be set to `"application/json"`. - * * `Content-Length`: This is computed by Cloud Tasks. This value is - * output only. It cannot be changed. - * The headers below cannot be set or overridden: - * * `Host` - * * `X-Google-*` - * * `X-AppEngine-*` - * In addition, Cloud Tasks sets some headers when the task is dispatched, - * such as headers containing information about the task; see - * [request - * headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers). - * These headers are set only when the task is dispatched, so they are not - * visible when the task is returned in a Cloud Tasks response. - * Although there is no specific limit for the maximum number of headers or - * the size, there is a limit on the maximum size of the - * [Task][google.cloud.tasks.v2.Task]. For more information, see the - * [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask] documentation. - * @type string $body - * HTTP request body. - * A request body is allowed only if the HTTP method is POST or PUT. It is - * an error to set a body on a task with an incompatible - * [HttpMethod][google.cloud.tasks.v2.HttpMethod]. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2\Target::initOnce(); - parent::__construct($data); - } - - /** - * The HTTP method to use for the request. The default is POST. - * The app's request handler for the task's target URL must be able to handle - * HTTP requests with this http_method, otherwise the task attempt fails with - * error code 405 (Method Not Allowed). See [Writing a push task request - * handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) - * and the App Engine documentation for your runtime on [How Requests are - * Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). - * - * Generated from protobuf field .google.cloud.tasks.v2.HttpMethod http_method = 1; - * @return int - */ - public function getHttpMethod() - { - return $this->http_method; - } - - /** - * The HTTP method to use for the request. The default is POST. - * The app's request handler for the task's target URL must be able to handle - * HTTP requests with this http_method, otherwise the task attempt fails with - * error code 405 (Method Not Allowed). See [Writing a push task request - * handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) - * and the App Engine documentation for your runtime on [How Requests are - * Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). - * - * Generated from protobuf field .google.cloud.tasks.v2.HttpMethod http_method = 1; - * @param int $var - * @return $this - */ - public function setHttpMethod($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2\HttpMethod::class); - $this->http_method = $var; - - return $this; - } - - /** - * Task-level setting for App Engine routing. - * * If [app_engine_routing_override is set on the - * queue][google.cloud.tasks.v2.Queue.app_engine_routing_override], this - * value is used for all tasks in the queue, no matter what the setting is - * for the [task-level - * app_engine_routing][google.cloud.tasks.v2.AppEngineHttpRequest.app_engine_routing]. - * - * Generated from protobuf field .google.cloud.tasks.v2.AppEngineRouting app_engine_routing = 2; - * @return \Google\Cloud\Tasks\V2\AppEngineRouting|null - */ - public function getAppEngineRouting() - { - return $this->app_engine_routing; - } - - public function hasAppEngineRouting() - { - return isset($this->app_engine_routing); - } - - public function clearAppEngineRouting() - { - unset($this->app_engine_routing); - } - - /** - * Task-level setting for App Engine routing. - * * If [app_engine_routing_override is set on the - * queue][google.cloud.tasks.v2.Queue.app_engine_routing_override], this - * value is used for all tasks in the queue, no matter what the setting is - * for the [task-level - * app_engine_routing][google.cloud.tasks.v2.AppEngineHttpRequest.app_engine_routing]. - * - * Generated from protobuf field .google.cloud.tasks.v2.AppEngineRouting app_engine_routing = 2; - * @param \Google\Cloud\Tasks\V2\AppEngineRouting $var - * @return $this - */ - public function setAppEngineRouting($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2\AppEngineRouting::class); - $this->app_engine_routing = $var; - - return $this; - } - - /** - * The relative URI. - * The relative URI must begin with "/" and must be a valid HTTP relative URI. - * It can contain a path and query string arguments. - * If the relative URI is empty, then the root path "/" will be used. - * No spaces are allowed, and the maximum length allowed is 2083 characters. - * - * Generated from protobuf field string relative_uri = 3; - * @return string - */ - public function getRelativeUri() - { - return $this->relative_uri; - } - - /** - * The relative URI. - * The relative URI must begin with "/" and must be a valid HTTP relative URI. - * It can contain a path and query string arguments. - * If the relative URI is empty, then the root path "/" will be used. - * No spaces are allowed, and the maximum length allowed is 2083 characters. - * - * Generated from protobuf field string relative_uri = 3; - * @param string $var - * @return $this - */ - public function setRelativeUri($var) - { - GPBUtil::checkString($var, True); - $this->relative_uri = $var; - - return $this; - } - - /** - * HTTP request headers. - * This map contains the header field names and values. - * Headers can be set when the - * [task is created][google.cloud.tasks.v2.CloudTasks.CreateTask]. - * Repeated headers are not supported but a header value can contain commas. - * Cloud Tasks sets some headers to default values: - * * `User-Agent`: By default, this header is - * `"AppEngine-Google; (+http://code.google.com/appengine)"`. - * This header can be modified, but Cloud Tasks will append - * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the - * modified `User-Agent`. - * If the task has a [body][google.cloud.tasks.v2.AppEngineHttpRequest.body], - * Cloud Tasks sets the following headers: - * * `Content-Type`: By default, the `Content-Type` header is set to - * `"application/octet-stream"`. The default can be overridden by explicitly - * setting `Content-Type` to a particular media type when the - * [task is created][google.cloud.tasks.v2.CloudTasks.CreateTask]. - * For example, `Content-Type` can be set to `"application/json"`. - * * `Content-Length`: This is computed by Cloud Tasks. This value is - * output only. It cannot be changed. - * The headers below cannot be set or overridden: - * * `Host` - * * `X-Google-*` - * * `X-AppEngine-*` - * In addition, Cloud Tasks sets some headers when the task is dispatched, - * such as headers containing information about the task; see - * [request - * headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers). - * These headers are set only when the task is dispatched, so they are not - * visible when the task is returned in a Cloud Tasks response. - * Although there is no specific limit for the maximum number of headers or - * the size, there is a limit on the maximum size of the - * [Task][google.cloud.tasks.v2.Task]. For more information, see the - * [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask] documentation. - * - * Generated from protobuf field map headers = 4; - * @return \Google\Protobuf\Internal\MapField - */ - public function getHeaders() - { - return $this->headers; - } - - /** - * HTTP request headers. - * This map contains the header field names and values. - * Headers can be set when the - * [task is created][google.cloud.tasks.v2.CloudTasks.CreateTask]. - * Repeated headers are not supported but a header value can contain commas. - * Cloud Tasks sets some headers to default values: - * * `User-Agent`: By default, this header is - * `"AppEngine-Google; (+http://code.google.com/appengine)"`. - * This header can be modified, but Cloud Tasks will append - * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the - * modified `User-Agent`. - * If the task has a [body][google.cloud.tasks.v2.AppEngineHttpRequest.body], - * Cloud Tasks sets the following headers: - * * `Content-Type`: By default, the `Content-Type` header is set to - * `"application/octet-stream"`. The default can be overridden by explicitly - * setting `Content-Type` to a particular media type when the - * [task is created][google.cloud.tasks.v2.CloudTasks.CreateTask]. - * For example, `Content-Type` can be set to `"application/json"`. - * * `Content-Length`: This is computed by Cloud Tasks. This value is - * output only. It cannot be changed. - * The headers below cannot be set or overridden: - * * `Host` - * * `X-Google-*` - * * `X-AppEngine-*` - * In addition, Cloud Tasks sets some headers when the task is dispatched, - * such as headers containing information about the task; see - * [request - * headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers). - * These headers are set only when the task is dispatched, so they are not - * visible when the task is returned in a Cloud Tasks response. - * Although there is no specific limit for the maximum number of headers or - * the size, there is a limit on the maximum size of the - * [Task][google.cloud.tasks.v2.Task]. For more information, see the - * [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask] documentation. - * - * Generated from protobuf field map headers = 4; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setHeaders($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->headers = $arr; - - return $this; - } - - /** - * HTTP request body. - * A request body is allowed only if the HTTP method is POST or PUT. It is - * an error to set a body on a task with an incompatible - * [HttpMethod][google.cloud.tasks.v2.HttpMethod]. - * - * Generated from protobuf field bytes body = 5; - * @return string - */ - public function getBody() - { - return $this->body; - } - - /** - * HTTP request body. - * A request body is allowed only if the HTTP method is POST or PUT. It is - * an error to set a body on a task with an incompatible - * [HttpMethod][google.cloud.tasks.v2.HttpMethod]. - * - * Generated from protobuf field bytes body = 5; - * @param string $var - * @return $this - */ - public function setBody($var) - { - GPBUtil::checkString($var, False); - $this->body = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/AppEngineRouting.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/AppEngineRouting.php deleted file mode 100644 index 265cf9515609..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/AppEngineRouting.php +++ /dev/null @@ -1,373 +0,0 @@ -google.cloud.tasks.v2.AppEngineRouting - */ -class AppEngineRouting extends \Google\Protobuf\Internal\Message -{ - /** - * App service. - * By default, the task is sent to the service which is the default - * service when the task is attempted. - * For some queues or tasks which were created using the App Engine - * Task Queue API, [host][google.cloud.tasks.v2.AppEngineRouting.host] is not - * parsable into [service][google.cloud.tasks.v2.AppEngineRouting.service], - * [version][google.cloud.tasks.v2.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2.AppEngineRouting.instance]. For example, - * some tasks which were created using the App Engine SDK use a custom domain - * name; custom domains are not parsed by Cloud Tasks. If - * [host][google.cloud.tasks.v2.AppEngineRouting.host] is not parsable, then - * [service][google.cloud.tasks.v2.AppEngineRouting.service], - * [version][google.cloud.tasks.v2.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2.AppEngineRouting.instance] are the empty - * string. - * - * Generated from protobuf field string service = 1; - */ - protected $service = ''; - /** - * App version. - * By default, the task is sent to the version which is the default - * version when the task is attempted. - * For some queues or tasks which were created using the App Engine - * Task Queue API, [host][google.cloud.tasks.v2.AppEngineRouting.host] is not - * parsable into [service][google.cloud.tasks.v2.AppEngineRouting.service], - * [version][google.cloud.tasks.v2.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2.AppEngineRouting.instance]. For example, - * some tasks which were created using the App Engine SDK use a custom domain - * name; custom domains are not parsed by Cloud Tasks. If - * [host][google.cloud.tasks.v2.AppEngineRouting.host] is not parsable, then - * [service][google.cloud.tasks.v2.AppEngineRouting.service], - * [version][google.cloud.tasks.v2.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2.AppEngineRouting.instance] are the empty - * string. - * - * Generated from protobuf field string version = 2; - */ - protected $version = ''; - /** - * App instance. - * By default, the task is sent to an instance which is available when - * the task is attempted. - * Requests can only be sent to a specific instance if - * [manual scaling is used in App Engine - * Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). - * App Engine Flex does not support instances. For more information, see - * [App Engine Standard request - * routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) - * and [App Engine Flex request - * routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). - * - * Generated from protobuf field string instance = 3; - */ - protected $instance = ''; - /** - * Output only. The host that the task is sent to. - * The host is constructed from the domain name of the app associated with - * the queue's project ID (for example .appspot.com), and the - * [service][google.cloud.tasks.v2.AppEngineRouting.service], - * [version][google.cloud.tasks.v2.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2.AppEngineRouting.instance]. Tasks which - * were created using the App Engine SDK might have a custom domain name. - * For more information, see - * [How Requests are - * Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). - * - * Generated from protobuf field string host = 4; - */ - protected $host = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $service - * App service. - * By default, the task is sent to the service which is the default - * service when the task is attempted. - * For some queues or tasks which were created using the App Engine - * Task Queue API, [host][google.cloud.tasks.v2.AppEngineRouting.host] is not - * parsable into [service][google.cloud.tasks.v2.AppEngineRouting.service], - * [version][google.cloud.tasks.v2.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2.AppEngineRouting.instance]. For example, - * some tasks which were created using the App Engine SDK use a custom domain - * name; custom domains are not parsed by Cloud Tasks. If - * [host][google.cloud.tasks.v2.AppEngineRouting.host] is not parsable, then - * [service][google.cloud.tasks.v2.AppEngineRouting.service], - * [version][google.cloud.tasks.v2.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2.AppEngineRouting.instance] are the empty - * string. - * @type string $version - * App version. - * By default, the task is sent to the version which is the default - * version when the task is attempted. - * For some queues or tasks which were created using the App Engine - * Task Queue API, [host][google.cloud.tasks.v2.AppEngineRouting.host] is not - * parsable into [service][google.cloud.tasks.v2.AppEngineRouting.service], - * [version][google.cloud.tasks.v2.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2.AppEngineRouting.instance]. For example, - * some tasks which were created using the App Engine SDK use a custom domain - * name; custom domains are not parsed by Cloud Tasks. If - * [host][google.cloud.tasks.v2.AppEngineRouting.host] is not parsable, then - * [service][google.cloud.tasks.v2.AppEngineRouting.service], - * [version][google.cloud.tasks.v2.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2.AppEngineRouting.instance] are the empty - * string. - * @type string $instance - * App instance. - * By default, the task is sent to an instance which is available when - * the task is attempted. - * Requests can only be sent to a specific instance if - * [manual scaling is used in App Engine - * Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). - * App Engine Flex does not support instances. For more information, see - * [App Engine Standard request - * routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) - * and [App Engine Flex request - * routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). - * @type string $host - * Output only. The host that the task is sent to. - * The host is constructed from the domain name of the app associated with - * the queue's project ID (for example .appspot.com), and the - * [service][google.cloud.tasks.v2.AppEngineRouting.service], - * [version][google.cloud.tasks.v2.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2.AppEngineRouting.instance]. Tasks which - * were created using the App Engine SDK might have a custom domain name. - * For more information, see - * [How Requests are - * Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2\Target::initOnce(); - parent::__construct($data); - } - - /** - * App service. - * By default, the task is sent to the service which is the default - * service when the task is attempted. - * For some queues or tasks which were created using the App Engine - * Task Queue API, [host][google.cloud.tasks.v2.AppEngineRouting.host] is not - * parsable into [service][google.cloud.tasks.v2.AppEngineRouting.service], - * [version][google.cloud.tasks.v2.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2.AppEngineRouting.instance]. For example, - * some tasks which were created using the App Engine SDK use a custom domain - * name; custom domains are not parsed by Cloud Tasks. If - * [host][google.cloud.tasks.v2.AppEngineRouting.host] is not parsable, then - * [service][google.cloud.tasks.v2.AppEngineRouting.service], - * [version][google.cloud.tasks.v2.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2.AppEngineRouting.instance] are the empty - * string. - * - * Generated from protobuf field string service = 1; - * @return string - */ - public function getService() - { - return $this->service; - } - - /** - * App service. - * By default, the task is sent to the service which is the default - * service when the task is attempted. - * For some queues or tasks which were created using the App Engine - * Task Queue API, [host][google.cloud.tasks.v2.AppEngineRouting.host] is not - * parsable into [service][google.cloud.tasks.v2.AppEngineRouting.service], - * [version][google.cloud.tasks.v2.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2.AppEngineRouting.instance]. For example, - * some tasks which were created using the App Engine SDK use a custom domain - * name; custom domains are not parsed by Cloud Tasks. If - * [host][google.cloud.tasks.v2.AppEngineRouting.host] is not parsable, then - * [service][google.cloud.tasks.v2.AppEngineRouting.service], - * [version][google.cloud.tasks.v2.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2.AppEngineRouting.instance] are the empty - * string. - * - * Generated from protobuf field string service = 1; - * @param string $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkString($var, True); - $this->service = $var; - - return $this; - } - - /** - * App version. - * By default, the task is sent to the version which is the default - * version when the task is attempted. - * For some queues or tasks which were created using the App Engine - * Task Queue API, [host][google.cloud.tasks.v2.AppEngineRouting.host] is not - * parsable into [service][google.cloud.tasks.v2.AppEngineRouting.service], - * [version][google.cloud.tasks.v2.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2.AppEngineRouting.instance]. For example, - * some tasks which were created using the App Engine SDK use a custom domain - * name; custom domains are not parsed by Cloud Tasks. If - * [host][google.cloud.tasks.v2.AppEngineRouting.host] is not parsable, then - * [service][google.cloud.tasks.v2.AppEngineRouting.service], - * [version][google.cloud.tasks.v2.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2.AppEngineRouting.instance] are the empty - * string. - * - * Generated from protobuf field string version = 2; - * @return string - */ - public function getVersion() - { - return $this->version; - } - - /** - * App version. - * By default, the task is sent to the version which is the default - * version when the task is attempted. - * For some queues or tasks which were created using the App Engine - * Task Queue API, [host][google.cloud.tasks.v2.AppEngineRouting.host] is not - * parsable into [service][google.cloud.tasks.v2.AppEngineRouting.service], - * [version][google.cloud.tasks.v2.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2.AppEngineRouting.instance]. For example, - * some tasks which were created using the App Engine SDK use a custom domain - * name; custom domains are not parsed by Cloud Tasks. If - * [host][google.cloud.tasks.v2.AppEngineRouting.host] is not parsable, then - * [service][google.cloud.tasks.v2.AppEngineRouting.service], - * [version][google.cloud.tasks.v2.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2.AppEngineRouting.instance] are the empty - * string. - * - * Generated from protobuf field string version = 2; - * @param string $var - * @return $this - */ - public function setVersion($var) - { - GPBUtil::checkString($var, True); - $this->version = $var; - - return $this; - } - - /** - * App instance. - * By default, the task is sent to an instance which is available when - * the task is attempted. - * Requests can only be sent to a specific instance if - * [manual scaling is used in App Engine - * Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). - * App Engine Flex does not support instances. For more information, see - * [App Engine Standard request - * routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) - * and [App Engine Flex request - * routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). - * - * Generated from protobuf field string instance = 3; - * @return string - */ - public function getInstance() - { - return $this->instance; - } - - /** - * App instance. - * By default, the task is sent to an instance which is available when - * the task is attempted. - * Requests can only be sent to a specific instance if - * [manual scaling is used in App Engine - * Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). - * App Engine Flex does not support instances. For more information, see - * [App Engine Standard request - * routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) - * and [App Engine Flex request - * routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). - * - * Generated from protobuf field string instance = 3; - * @param string $var - * @return $this - */ - public function setInstance($var) - { - GPBUtil::checkString($var, True); - $this->instance = $var; - - return $this; - } - - /** - * Output only. The host that the task is sent to. - * The host is constructed from the domain name of the app associated with - * the queue's project ID (for example .appspot.com), and the - * [service][google.cloud.tasks.v2.AppEngineRouting.service], - * [version][google.cloud.tasks.v2.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2.AppEngineRouting.instance]. Tasks which - * were created using the App Engine SDK might have a custom domain name. - * For more information, see - * [How Requests are - * Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). - * - * Generated from protobuf field string host = 4; - * @return string - */ - public function getHost() - { - return $this->host; - } - - /** - * Output only. The host that the task is sent to. - * The host is constructed from the domain name of the app associated with - * the queue's project ID (for example .appspot.com), and the - * [service][google.cloud.tasks.v2.AppEngineRouting.service], - * [version][google.cloud.tasks.v2.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2.AppEngineRouting.instance]. Tasks which - * were created using the App Engine SDK might have a custom domain name. - * For more information, see - * [How Requests are - * Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). - * - * Generated from protobuf field string host = 4; - * @param string $var - * @return $this - */ - public function setHost($var) - { - GPBUtil::checkString($var, True); - $this->host = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Attempt.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Attempt.php deleted file mode 100644 index 880d0b5b6f34..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Attempt.php +++ /dev/null @@ -1,229 +0,0 @@ -google.cloud.tasks.v2.Attempt - */ -class Attempt extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The time that this attempt was scheduled. - * `schedule_time` will be truncated to the nearest microsecond. - * - * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 1; - */ - protected $schedule_time = null; - /** - * Output only. The time that this attempt was dispatched. - * `dispatch_time` will be truncated to the nearest microsecond. - * - * Generated from protobuf field .google.protobuf.Timestamp dispatch_time = 2; - */ - protected $dispatch_time = null; - /** - * Output only. The time that this attempt response was received. - * `response_time` will be truncated to the nearest microsecond. - * - * Generated from protobuf field .google.protobuf.Timestamp response_time = 3; - */ - protected $response_time = null; - /** - * Output only. The response from the worker for this attempt. - * If `response_time` is unset, then the task has not been attempted or is - * currently running and the `response_status` field is meaningless. - * - * Generated from protobuf field .google.rpc.Status response_status = 4; - */ - protected $response_status = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $schedule_time - * Output only. The time that this attempt was scheduled. - * `schedule_time` will be truncated to the nearest microsecond. - * @type \Google\Protobuf\Timestamp $dispatch_time - * Output only. The time that this attempt was dispatched. - * `dispatch_time` will be truncated to the nearest microsecond. - * @type \Google\Protobuf\Timestamp $response_time - * Output only. The time that this attempt response was received. - * `response_time` will be truncated to the nearest microsecond. - * @type \Google\Rpc\Status $response_status - * Output only. The response from the worker for this attempt. - * If `response_time` is unset, then the task has not been attempted or is - * currently running and the `response_status` field is meaningless. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2\Task::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The time that this attempt was scheduled. - * `schedule_time` will be truncated to the nearest microsecond. - * - * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 1; - * @return \Google\Protobuf\Timestamp|null - */ - public function getScheduleTime() - { - return $this->schedule_time; - } - - public function hasScheduleTime() - { - return isset($this->schedule_time); - } - - public function clearScheduleTime() - { - unset($this->schedule_time); - } - - /** - * Output only. The time that this attempt was scheduled. - * `schedule_time` will be truncated to the nearest microsecond. - * - * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 1; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setScheduleTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->schedule_time = $var; - - return $this; - } - - /** - * Output only. The time that this attempt was dispatched. - * `dispatch_time` will be truncated to the nearest microsecond. - * - * Generated from protobuf field .google.protobuf.Timestamp dispatch_time = 2; - * @return \Google\Protobuf\Timestamp|null - */ - public function getDispatchTime() - { - return $this->dispatch_time; - } - - public function hasDispatchTime() - { - return isset($this->dispatch_time); - } - - public function clearDispatchTime() - { - unset($this->dispatch_time); - } - - /** - * Output only. The time that this attempt was dispatched. - * `dispatch_time` will be truncated to the nearest microsecond. - * - * Generated from protobuf field .google.protobuf.Timestamp dispatch_time = 2; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setDispatchTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->dispatch_time = $var; - - return $this; - } - - /** - * Output only. The time that this attempt response was received. - * `response_time` will be truncated to the nearest microsecond. - * - * Generated from protobuf field .google.protobuf.Timestamp response_time = 3; - * @return \Google\Protobuf\Timestamp|null - */ - public function getResponseTime() - { - return $this->response_time; - } - - public function hasResponseTime() - { - return isset($this->response_time); - } - - public function clearResponseTime() - { - unset($this->response_time); - } - - /** - * Output only. The time that this attempt response was received. - * `response_time` will be truncated to the nearest microsecond. - * - * Generated from protobuf field .google.protobuf.Timestamp response_time = 3; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setResponseTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->response_time = $var; - - return $this; - } - - /** - * Output only. The response from the worker for this attempt. - * If `response_time` is unset, then the task has not been attempted or is - * currently running and the `response_status` field is meaningless. - * - * Generated from protobuf field .google.rpc.Status response_status = 4; - * @return \Google\Rpc\Status|null - */ - public function getResponseStatus() - { - return $this->response_status; - } - - public function hasResponseStatus() - { - return isset($this->response_status); - } - - public function clearResponseStatus() - { - unset($this->response_status); - } - - /** - * Output only. The response from the worker for this attempt. - * If `response_time` is unset, then the task has not been attempted or is - * currently running and the `response_status` field is meaningless. - * - * Generated from protobuf field .google.rpc.Status response_status = 4; - * @param \Google\Rpc\Status $var - * @return $this - */ - public function setResponseStatus($var) - { - GPBUtil::checkMessage($var, \Google\Rpc\Status::class); - $this->response_status = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/CreateQueueRequest.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/CreateQueueRequest.php deleted file mode 100644 index 0efd1e6fd83c..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/CreateQueueRequest.php +++ /dev/null @@ -1,160 +0,0 @@ -google.cloud.tasks.v2.CreateQueueRequest - */ -class CreateQueueRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The location name in which the queue will be created. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * The list of allowed locations can be obtained by calling Cloud - * Tasks' implementation of - * [ListLocations][google.cloud.location.Locations.ListLocations]. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The queue to create. - * [Queue's name][google.cloud.tasks.v2.Queue.name] cannot be the same as an - * existing queue. - * - * Generated from protobuf field .google.cloud.tasks.v2.Queue queue = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $queue = null; - - /** - * @param string $parent Required. The location name in which the queue will be created. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * - * The list of allowed locations can be obtained by calling Cloud - * Tasks' implementation of - * [ListLocations][google.cloud.location.Locations.ListLocations]. Please see - * {@see CloudTasksClient::locationName()} for help formatting this field. - * @param \Google\Cloud\Tasks\V2\Queue $queue Required. The queue to create. - * - * [Queue's name][google.cloud.tasks.v2.Queue.name] cannot be the same as an - * existing queue. - * - * @return \Google\Cloud\Tasks\V2\CreateQueueRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\Tasks\V2\Queue $queue): self - { - return (new self()) - ->setParent($parent) - ->setQueue($queue); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The location name in which the queue will be created. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * The list of allowed locations can be obtained by calling Cloud - * Tasks' implementation of - * [ListLocations][google.cloud.location.Locations.ListLocations]. - * @type \Google\Cloud\Tasks\V2\Queue $queue - * Required. The queue to create. - * [Queue's name][google.cloud.tasks.v2.Queue.name] cannot be the same as an - * existing queue. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * Required. The location name in which the queue will be created. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * The list of allowed locations can be obtained by calling Cloud - * Tasks' implementation of - * [ListLocations][google.cloud.location.Locations.ListLocations]. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The location name in which the queue will be created. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * The list of allowed locations can be obtained by calling Cloud - * Tasks' implementation of - * [ListLocations][google.cloud.location.Locations.ListLocations]. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The queue to create. - * [Queue's name][google.cloud.tasks.v2.Queue.name] cannot be the same as an - * existing queue. - * - * Generated from protobuf field .google.cloud.tasks.v2.Queue queue = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Tasks\V2\Queue|null - */ - public function getQueue() - { - return $this->queue; - } - - public function hasQueue() - { - return isset($this->queue); - } - - public function clearQueue() - { - unset($this->queue); - } - - /** - * Required. The queue to create. - * [Queue's name][google.cloud.tasks.v2.Queue.name] cannot be the same as an - * existing queue. - * - * Generated from protobuf field .google.cloud.tasks.v2.Queue queue = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Tasks\V2\Queue $var - * @return $this - */ - public function setQueue($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2\Queue::class); - $this->queue = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/CreateTaskRequest.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/CreateTaskRequest.php deleted file mode 100644 index 5b1c36712fe2..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/CreateTaskRequest.php +++ /dev/null @@ -1,349 +0,0 @@ -google.cloud.tasks.v2.CreateTaskRequest - */ -class CreateTaskRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * The queue must already exist. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The task to add. - * Task names have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. - * The user can optionally specify a task - * [name][google.cloud.tasks.v2.Task.name]. If a name is not specified then - * the system will generate a random unique task id, which will be set in the - * task returned in the [response][google.cloud.tasks.v2.Task.name]. - * If [schedule_time][google.cloud.tasks.v2.Task.schedule_time] is not set or - * is in the past then Cloud Tasks will set it to the current time. - * Task De-duplication: - * Explicitly specifying a task ID enables task de-duplication. If - * a task's ID is identical to that of an existing task or a task - * that was deleted or executed recently then the call will fail - * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. - * If the task's queue was created using Cloud Tasks, then another task with - * the same name can't be created for ~1hour after the original task was - * deleted or executed. If the task's queue was created using queue.yaml or - * queue.xml, then another task with the same name can't be created - * for ~9days after the original task was deleted or executed. - * Because there is an extra lookup cost to identify duplicate task - * names, these [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask] - * calls have significantly increased latency. Using hashed strings for the - * task id or for the prefix of the task id is recommended. Choosing task ids - * that are sequential or have sequential prefixes, for example using a - * timestamp, causes an increase in latency and error rates in all - * task commands. The infrastructure relies on an approximately - * uniform distribution of task ids to store and serve tasks - * efficiently. - * - * Generated from protobuf field .google.cloud.tasks.v2.Task task = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $task = null; - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2.Task] will be returned. - * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; - * not all information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the [Task][google.cloud.tasks.v2.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2.Task.View response_view = 3; - */ - protected $response_view = 0; - - /** - * @param string $parent Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * - * The queue must already exist. Please see - * {@see CloudTasksClient::queueName()} for help formatting this field. - * @param \Google\Cloud\Tasks\V2\Task $task Required. The task to add. - * - * Task names have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. - * The user can optionally specify a task - * [name][google.cloud.tasks.v2.Task.name]. If a name is not specified then - * the system will generate a random unique task id, which will be set in the - * task returned in the [response][google.cloud.tasks.v2.Task.name]. - * - * If [schedule_time][google.cloud.tasks.v2.Task.schedule_time] is not set or - * is in the past then Cloud Tasks will set it to the current time. - * - * Task De-duplication: - * - * Explicitly specifying a task ID enables task de-duplication. If - * a task's ID is identical to that of an existing task or a task - * that was deleted or executed recently then the call will fail - * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. - * If the task's queue was created using Cloud Tasks, then another task with - * the same name can't be created for ~1hour after the original task was - * deleted or executed. If the task's queue was created using queue.yaml or - * queue.xml, then another task with the same name can't be created - * for ~9days after the original task was deleted or executed. - * - * Because there is an extra lookup cost to identify duplicate task - * names, these [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask] - * calls have significantly increased latency. Using hashed strings for the - * task id or for the prefix of the task id is recommended. Choosing task ids - * that are sequential or have sequential prefixes, for example using a - * timestamp, causes an increase in latency and error rates in all - * task commands. The infrastructure relies on an approximately - * uniform distribution of task ids to store and serve tasks - * efficiently. - * - * @return \Google\Cloud\Tasks\V2\CreateTaskRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\Tasks\V2\Task $task): self - { - return (new self()) - ->setParent($parent) - ->setTask($task); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * The queue must already exist. - * @type \Google\Cloud\Tasks\V2\Task $task - * Required. The task to add. - * Task names have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. - * The user can optionally specify a task - * [name][google.cloud.tasks.v2.Task.name]. If a name is not specified then - * the system will generate a random unique task id, which will be set in the - * task returned in the [response][google.cloud.tasks.v2.Task.name]. - * If [schedule_time][google.cloud.tasks.v2.Task.schedule_time] is not set or - * is in the past then Cloud Tasks will set it to the current time. - * Task De-duplication: - * Explicitly specifying a task ID enables task de-duplication. If - * a task's ID is identical to that of an existing task or a task - * that was deleted or executed recently then the call will fail - * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. - * If the task's queue was created using Cloud Tasks, then another task with - * the same name can't be created for ~1hour after the original task was - * deleted or executed. If the task's queue was created using queue.yaml or - * queue.xml, then another task with the same name can't be created - * for ~9days after the original task was deleted or executed. - * Because there is an extra lookup cost to identify duplicate task - * names, these [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask] - * calls have significantly increased latency. Using hashed strings for the - * task id or for the prefix of the task id is recommended. Choosing task ids - * that are sequential or have sequential prefixes, for example using a - * timestamp, causes an increase in latency and error rates in all - * task commands. The infrastructure relies on an approximately - * uniform distribution of task ids to store and serve tasks - * efficiently. - * @type int $response_view - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2.Task] will be returned. - * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; - * not all information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the [Task][google.cloud.tasks.v2.Task] resource. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * The queue must already exist. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * The queue must already exist. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The task to add. - * Task names have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. - * The user can optionally specify a task - * [name][google.cloud.tasks.v2.Task.name]. If a name is not specified then - * the system will generate a random unique task id, which will be set in the - * task returned in the [response][google.cloud.tasks.v2.Task.name]. - * If [schedule_time][google.cloud.tasks.v2.Task.schedule_time] is not set or - * is in the past then Cloud Tasks will set it to the current time. - * Task De-duplication: - * Explicitly specifying a task ID enables task de-duplication. If - * a task's ID is identical to that of an existing task or a task - * that was deleted or executed recently then the call will fail - * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. - * If the task's queue was created using Cloud Tasks, then another task with - * the same name can't be created for ~1hour after the original task was - * deleted or executed. If the task's queue was created using queue.yaml or - * queue.xml, then another task with the same name can't be created - * for ~9days after the original task was deleted or executed. - * Because there is an extra lookup cost to identify duplicate task - * names, these [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask] - * calls have significantly increased latency. Using hashed strings for the - * task id or for the prefix of the task id is recommended. Choosing task ids - * that are sequential or have sequential prefixes, for example using a - * timestamp, causes an increase in latency and error rates in all - * task commands. The infrastructure relies on an approximately - * uniform distribution of task ids to store and serve tasks - * efficiently. - * - * Generated from protobuf field .google.cloud.tasks.v2.Task task = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Tasks\V2\Task|null - */ - public function getTask() - { - return $this->task; - } - - public function hasTask() - { - return isset($this->task); - } - - public function clearTask() - { - unset($this->task); - } - - /** - * Required. The task to add. - * Task names have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. - * The user can optionally specify a task - * [name][google.cloud.tasks.v2.Task.name]. If a name is not specified then - * the system will generate a random unique task id, which will be set in the - * task returned in the [response][google.cloud.tasks.v2.Task.name]. - * If [schedule_time][google.cloud.tasks.v2.Task.schedule_time] is not set or - * is in the past then Cloud Tasks will set it to the current time. - * Task De-duplication: - * Explicitly specifying a task ID enables task de-duplication. If - * a task's ID is identical to that of an existing task or a task - * that was deleted or executed recently then the call will fail - * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. - * If the task's queue was created using Cloud Tasks, then another task with - * the same name can't be created for ~1hour after the original task was - * deleted or executed. If the task's queue was created using queue.yaml or - * queue.xml, then another task with the same name can't be created - * for ~9days after the original task was deleted or executed. - * Because there is an extra lookup cost to identify duplicate task - * names, these [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask] - * calls have significantly increased latency. Using hashed strings for the - * task id or for the prefix of the task id is recommended. Choosing task ids - * that are sequential or have sequential prefixes, for example using a - * timestamp, causes an increase in latency and error rates in all - * task commands. The infrastructure relies on an approximately - * uniform distribution of task ids to store and serve tasks - * efficiently. - * - * Generated from protobuf field .google.cloud.tasks.v2.Task task = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Tasks\V2\Task $var - * @return $this - */ - public function setTask($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2\Task::class); - $this->task = $var; - - return $this; - } - - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2.Task] will be returned. - * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; - * not all information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the [Task][google.cloud.tasks.v2.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2.Task.View response_view = 3; - * @return int - */ - public function getResponseView() - { - return $this->response_view; - } - - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2.Task] will be returned. - * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; - * not all information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the [Task][google.cloud.tasks.v2.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2.Task.View response_view = 3; - * @param int $var - * @return $this - */ - public function setResponseView($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2\Task\View::class); - $this->response_view = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/DeleteQueueRequest.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/DeleteQueueRequest.php deleted file mode 100644 index 9d6a391711c7..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/DeleteQueueRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -google.cloud.tasks.v2.DeleteQueueRequest - */ -class DeleteQueueRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * Please see {@see CloudTasksClient::queueName()} for help formatting this field. - * - * @return \Google\Cloud\Tasks\V2\DeleteQueueRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/DeleteTaskRequest.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/DeleteTaskRequest.php deleted file mode 100644 index 8b4e795d4dcf..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/DeleteTaskRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -google.cloud.tasks.v2.DeleteTaskRequest - */ -class DeleteTaskRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * Please see {@see CloudTasksClient::taskName()} for help formatting this field. - * - * @return \Google\Cloud\Tasks\V2\DeleteTaskRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/GetQueueRequest.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/GetQueueRequest.php deleted file mode 100644 index bf492cc9817b..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/GetQueueRequest.php +++ /dev/null @@ -1,86 +0,0 @@ -google.cloud.tasks.v2.GetQueueRequest - */ -class GetQueueRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the queue. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The resource name of the queue. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * Please see {@see CloudTasksClient::queueName()} for help formatting this field. - * - * @return \Google\Cloud\Tasks\V2\GetQueueRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the queue. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the queue. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The resource name of the queue. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/GetTaskRequest.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/GetTaskRequest.php deleted file mode 100644 index 7ec071973327..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/GetTaskRequest.php +++ /dev/null @@ -1,157 +0,0 @@ -google.cloud.tasks.v2.GetTaskRequest - */ -class GetTaskRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2.Task] will be returned. - * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; - * not all information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the [Task][google.cloud.tasks.v2.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2.Task.View response_view = 2; - */ - protected $response_view = 0; - - /** - * @param string $name Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * Please see {@see CloudTasksClient::taskName()} for help formatting this field. - * - * @return \Google\Cloud\Tasks\V2\GetTaskRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * @type int $response_view - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2.Task] will be returned. - * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; - * not all information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the [Task][google.cloud.tasks.v2.Task] resource. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2.Task] will be returned. - * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; - * not all information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the [Task][google.cloud.tasks.v2.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2.Task.View response_view = 2; - * @return int - */ - public function getResponseView() - { - return $this->response_view; - } - - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2.Task] will be returned. - * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; - * not all information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the [Task][google.cloud.tasks.v2.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2.Task.View response_view = 2; - * @param int $var - * @return $this - */ - public function setResponseView($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2\Task\View::class); - $this->response_view = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/HttpMethod.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/HttpMethod.php deleted file mode 100644 index f545f185d4a0..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/HttpMethod.php +++ /dev/null @@ -1,96 +0,0 @@ -google.cloud.tasks.v2.HttpMethod - */ -class HttpMethod -{ - /** - * HTTP method unspecified - * - * Generated from protobuf enum HTTP_METHOD_UNSPECIFIED = 0; - */ - const HTTP_METHOD_UNSPECIFIED = 0; - /** - * HTTP POST - * - * Generated from protobuf enum POST = 1; - */ - const POST = 1; - /** - * HTTP GET - * - * Generated from protobuf enum GET = 2; - */ - const GET = 2; - /** - * HTTP HEAD - * - * Generated from protobuf enum HEAD = 3; - */ - const HEAD = 3; - /** - * HTTP PUT - * - * Generated from protobuf enum PUT = 4; - */ - const PUT = 4; - /** - * HTTP DELETE - * - * Generated from protobuf enum DELETE = 5; - */ - const DELETE = 5; - /** - * HTTP PATCH - * - * Generated from protobuf enum PATCH = 6; - */ - const PATCH = 6; - /** - * HTTP OPTIONS - * - * Generated from protobuf enum OPTIONS = 7; - */ - const OPTIONS = 7; - - private static $valueToName = [ - self::HTTP_METHOD_UNSPECIFIED => 'HTTP_METHOD_UNSPECIFIED', - self::POST => 'POST', - self::GET => 'GET', - self::HEAD => 'HEAD', - self::PUT => 'PUT', - self::DELETE => 'DELETE', - self::PATCH => 'PATCH', - self::OPTIONS => 'OPTIONS', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/HttpRequest.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/HttpRequest.php deleted file mode 100644 index 5d4f5a2be77e..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/HttpRequest.php +++ /dev/null @@ -1,421 +0,0 @@ -google.cloud.tasks.v2.HttpRequest - */ -class HttpRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The full url path that the request will be sent to. - * This string must begin with either "http://" or "https://". Some examples - * are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will - * encode some characters for safety and compatibility. The maximum allowed - * URL length is 2083 characters after encoding. - * The `Location` header response from a redirect response [`300` - `399`] - * may be followed. The redirect is not counted as a separate attempt. - * - * Generated from protobuf field string url = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $url = ''; - /** - * The HTTP method to use for the request. The default is POST. - * - * Generated from protobuf field .google.cloud.tasks.v2.HttpMethod http_method = 2; - */ - protected $http_method = 0; - /** - * HTTP request headers. - * This map contains the header field names and values. - * Headers can be set when the - * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - * These headers represent a subset of the headers that will accompany the - * task's HTTP request. Some HTTP request headers will be ignored or replaced. - * A partial list of headers that will be ignored or replaced is: - * * Host: This will be computed by Cloud Tasks and derived from - * [HttpRequest.url][google.cloud.tasks.v2.HttpRequest.url]. - * * Content-Length: This will be computed by Cloud Tasks. - * * User-Agent: This will be set to `"Google-Cloud-Tasks"`. - * * `X-Google-*`: Google use only. - * * `X-AppEngine-*`: Google use only. - * `Content-Type` won't be set by Cloud Tasks. You can explicitly set - * `Content-Type` to a media type when the - * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - * For example, `Content-Type` can be set to `"application/octet-stream"` or - * `"application/json"`. - * Headers which can have multiple values (according to RFC2616) can be - * specified using comma-separated values. - * The size of the headers must be less than 80KB. - * - * Generated from protobuf field map headers = 3; - */ - private $headers; - /** - * HTTP request body. - * A request body is allowed only if the - * [HTTP method][google.cloud.tasks.v2.HttpRequest.http_method] is POST, PUT, - * or PATCH. It is an error to set body on a task with an incompatible - * [HttpMethod][google.cloud.tasks.v2.HttpMethod]. - * - * Generated from protobuf field bytes body = 4; - */ - protected $body = ''; - protected $authorization_header; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $url - * Required. The full url path that the request will be sent to. - * This string must begin with either "http://" or "https://". Some examples - * are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will - * encode some characters for safety and compatibility. The maximum allowed - * URL length is 2083 characters after encoding. - * The `Location` header response from a redirect response [`300` - `399`] - * may be followed. The redirect is not counted as a separate attempt. - * @type int $http_method - * The HTTP method to use for the request. The default is POST. - * @type array|\Google\Protobuf\Internal\MapField $headers - * HTTP request headers. - * This map contains the header field names and values. - * Headers can be set when the - * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - * These headers represent a subset of the headers that will accompany the - * task's HTTP request. Some HTTP request headers will be ignored or replaced. - * A partial list of headers that will be ignored or replaced is: - * * Host: This will be computed by Cloud Tasks and derived from - * [HttpRequest.url][google.cloud.tasks.v2.HttpRequest.url]. - * * Content-Length: This will be computed by Cloud Tasks. - * * User-Agent: This will be set to `"Google-Cloud-Tasks"`. - * * `X-Google-*`: Google use only. - * * `X-AppEngine-*`: Google use only. - * `Content-Type` won't be set by Cloud Tasks. You can explicitly set - * `Content-Type` to a media type when the - * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - * For example, `Content-Type` can be set to `"application/octet-stream"` or - * `"application/json"`. - * Headers which can have multiple values (according to RFC2616) can be - * specified using comma-separated values. - * The size of the headers must be less than 80KB. - * @type string $body - * HTTP request body. - * A request body is allowed only if the - * [HTTP method][google.cloud.tasks.v2.HttpRequest.http_method] is POST, PUT, - * or PATCH. It is an error to set body on a task with an incompatible - * [HttpMethod][google.cloud.tasks.v2.HttpMethod]. - * @type \Google\Cloud\Tasks\V2\OAuthToken $oauth_token - * If specified, an - * [OAuth token](https://developers.google.com/identity/protocols/OAuth2) - * will be generated and attached as an `Authorization` header in the HTTP - * request. - * This type of authorization should generally only be used when calling - * Google APIs hosted on *.googleapis.com. - * @type \Google\Cloud\Tasks\V2\OidcToken $oidc_token - * If specified, an - * [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) - * token will be generated and attached as an `Authorization` header in the - * HTTP request. - * This type of authorization can be used for many scenarios, including - * calling Cloud Run, or endpoints where you intend to validate the token - * yourself. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2\Target::initOnce(); - parent::__construct($data); - } - - /** - * Required. The full url path that the request will be sent to. - * This string must begin with either "http://" or "https://". Some examples - * are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will - * encode some characters for safety and compatibility. The maximum allowed - * URL length is 2083 characters after encoding. - * The `Location` header response from a redirect response [`300` - `399`] - * may be followed. The redirect is not counted as a separate attempt. - * - * Generated from protobuf field string url = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getUrl() - { - return $this->url; - } - - /** - * Required. The full url path that the request will be sent to. - * This string must begin with either "http://" or "https://". Some examples - * are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will - * encode some characters for safety and compatibility. The maximum allowed - * URL length is 2083 characters after encoding. - * The `Location` header response from a redirect response [`300` - `399`] - * may be followed. The redirect is not counted as a separate attempt. - * - * Generated from protobuf field string url = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setUrl($var) - { - GPBUtil::checkString($var, True); - $this->url = $var; - - return $this; - } - - /** - * The HTTP method to use for the request. The default is POST. - * - * Generated from protobuf field .google.cloud.tasks.v2.HttpMethod http_method = 2; - * @return int - */ - public function getHttpMethod() - { - return $this->http_method; - } - - /** - * The HTTP method to use for the request. The default is POST. - * - * Generated from protobuf field .google.cloud.tasks.v2.HttpMethod http_method = 2; - * @param int $var - * @return $this - */ - public function setHttpMethod($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2\HttpMethod::class); - $this->http_method = $var; - - return $this; - } - - /** - * HTTP request headers. - * This map contains the header field names and values. - * Headers can be set when the - * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - * These headers represent a subset of the headers that will accompany the - * task's HTTP request. Some HTTP request headers will be ignored or replaced. - * A partial list of headers that will be ignored or replaced is: - * * Host: This will be computed by Cloud Tasks and derived from - * [HttpRequest.url][google.cloud.tasks.v2.HttpRequest.url]. - * * Content-Length: This will be computed by Cloud Tasks. - * * User-Agent: This will be set to `"Google-Cloud-Tasks"`. - * * `X-Google-*`: Google use only. - * * `X-AppEngine-*`: Google use only. - * `Content-Type` won't be set by Cloud Tasks. You can explicitly set - * `Content-Type` to a media type when the - * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - * For example, `Content-Type` can be set to `"application/octet-stream"` or - * `"application/json"`. - * Headers which can have multiple values (according to RFC2616) can be - * specified using comma-separated values. - * The size of the headers must be less than 80KB. - * - * Generated from protobuf field map headers = 3; - * @return \Google\Protobuf\Internal\MapField - */ - public function getHeaders() - { - return $this->headers; - } - - /** - * HTTP request headers. - * This map contains the header field names and values. - * Headers can be set when the - * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - * These headers represent a subset of the headers that will accompany the - * task's HTTP request. Some HTTP request headers will be ignored or replaced. - * A partial list of headers that will be ignored or replaced is: - * * Host: This will be computed by Cloud Tasks and derived from - * [HttpRequest.url][google.cloud.tasks.v2.HttpRequest.url]. - * * Content-Length: This will be computed by Cloud Tasks. - * * User-Agent: This will be set to `"Google-Cloud-Tasks"`. - * * `X-Google-*`: Google use only. - * * `X-AppEngine-*`: Google use only. - * `Content-Type` won't be set by Cloud Tasks. You can explicitly set - * `Content-Type` to a media type when the - * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - * For example, `Content-Type` can be set to `"application/octet-stream"` or - * `"application/json"`. - * Headers which can have multiple values (according to RFC2616) can be - * specified using comma-separated values. - * The size of the headers must be less than 80KB. - * - * Generated from protobuf field map headers = 3; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setHeaders($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->headers = $arr; - - return $this; - } - - /** - * HTTP request body. - * A request body is allowed only if the - * [HTTP method][google.cloud.tasks.v2.HttpRequest.http_method] is POST, PUT, - * or PATCH. It is an error to set body on a task with an incompatible - * [HttpMethod][google.cloud.tasks.v2.HttpMethod]. - * - * Generated from protobuf field bytes body = 4; - * @return string - */ - public function getBody() - { - return $this->body; - } - - /** - * HTTP request body. - * A request body is allowed only if the - * [HTTP method][google.cloud.tasks.v2.HttpRequest.http_method] is POST, PUT, - * or PATCH. It is an error to set body on a task with an incompatible - * [HttpMethod][google.cloud.tasks.v2.HttpMethod]. - * - * Generated from protobuf field bytes body = 4; - * @param string $var - * @return $this - */ - public function setBody($var) - { - GPBUtil::checkString($var, False); - $this->body = $var; - - return $this; - } - - /** - * If specified, an - * [OAuth token](https://developers.google.com/identity/protocols/OAuth2) - * will be generated and attached as an `Authorization` header in the HTTP - * request. - * This type of authorization should generally only be used when calling - * Google APIs hosted on *.googleapis.com. - * - * Generated from protobuf field .google.cloud.tasks.v2.OAuthToken oauth_token = 5; - * @return \Google\Cloud\Tasks\V2\OAuthToken|null - */ - public function getOauthToken() - { - return $this->readOneof(5); - } - - public function hasOauthToken() - { - return $this->hasOneof(5); - } - - /** - * If specified, an - * [OAuth token](https://developers.google.com/identity/protocols/OAuth2) - * will be generated and attached as an `Authorization` header in the HTTP - * request. - * This type of authorization should generally only be used when calling - * Google APIs hosted on *.googleapis.com. - * - * Generated from protobuf field .google.cloud.tasks.v2.OAuthToken oauth_token = 5; - * @param \Google\Cloud\Tasks\V2\OAuthToken $var - * @return $this - */ - public function setOauthToken($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2\OAuthToken::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * If specified, an - * [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) - * token will be generated and attached as an `Authorization` header in the - * HTTP request. - * This type of authorization can be used for many scenarios, including - * calling Cloud Run, or endpoints where you intend to validate the token - * yourself. - * - * Generated from protobuf field .google.cloud.tasks.v2.OidcToken oidc_token = 6; - * @return \Google\Cloud\Tasks\V2\OidcToken|null - */ - public function getOidcToken() - { - return $this->readOneof(6); - } - - public function hasOidcToken() - { - return $this->hasOneof(6); - } - - /** - * If specified, an - * [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) - * token will be generated and attached as an `Authorization` header in the - * HTTP request. - * This type of authorization can be used for many scenarios, including - * calling Cloud Run, or endpoints where you intend to validate the token - * yourself. - * - * Generated from protobuf field .google.cloud.tasks.v2.OidcToken oidc_token = 6; - * @param \Google\Cloud\Tasks\V2\OidcToken $var - * @return $this - */ - public function setOidcToken($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2\OidcToken::class); - $this->writeOneof(6, $var); - - return $this; - } - - /** - * @return string - */ - public function getAuthorizationHeader() - { - return $this->whichOneof("authorization_header"); - } - -} - diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ListQueuesRequest.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ListQueuesRequest.php deleted file mode 100644 index 74ace2efa6b0..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ListQueuesRequest.php +++ /dev/null @@ -1,269 +0,0 @@ -google.cloud.tasks.v2.ListQueuesRequest - */ -class ListQueuesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The location name. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * `filter` can be used to specify a subset of queues. Any - * [Queue][google.cloud.tasks.v2.Queue] field can be used as a filter and - * several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The - * filter syntax is the same as described in [Stackdriver's Advanced Logs - * Filters](https://cloud.google.com/logging/docs/view/advanced_filters). - * Sample filter "state: PAUSED". - * Note that using filters might cause fewer queues than the - * requested page_size to be returned. - * - * Generated from protobuf field string filter = 2; - */ - protected $filter = ''; - /** - * Requested page size. - * The maximum page size is 9800. If unspecified, the page size will - * be the maximum. Fewer queues than requested might be returned, - * even if more queues exist; use the - * [next_page_token][google.cloud.tasks.v2.ListQueuesResponse.next_page_token] - * in the response to determine if more queues exist. - * - * Generated from protobuf field int32 page_size = 3; - */ - protected $page_size = 0; - /** - * A token identifying the page of results to return. - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * [next_page_token][google.cloud.tasks.v2.ListQueuesResponse.next_page_token] - * returned from the previous call to - * [ListQueues][google.cloud.tasks.v2.CloudTasks.ListQueues] method. It is an - * error to switch the value of the - * [filter][google.cloud.tasks.v2.ListQueuesRequest.filter] while iterating - * through pages. - * - * Generated from protobuf field string page_token = 4; - */ - protected $page_token = ''; - - /** - * @param string $parent Required. The location name. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * Please see {@see CloudTasksClient::locationName()} for help formatting this field. - * - * @return \Google\Cloud\Tasks\V2\ListQueuesRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The location name. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * @type string $filter - * `filter` can be used to specify a subset of queues. Any - * [Queue][google.cloud.tasks.v2.Queue] field can be used as a filter and - * several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The - * filter syntax is the same as described in [Stackdriver's Advanced Logs - * Filters](https://cloud.google.com/logging/docs/view/advanced_filters). - * Sample filter "state: PAUSED". - * Note that using filters might cause fewer queues than the - * requested page_size to be returned. - * @type int $page_size - * Requested page size. - * The maximum page size is 9800. If unspecified, the page size will - * be the maximum. Fewer queues than requested might be returned, - * even if more queues exist; use the - * [next_page_token][google.cloud.tasks.v2.ListQueuesResponse.next_page_token] - * in the response to determine if more queues exist. - * @type string $page_token - * A token identifying the page of results to return. - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * [next_page_token][google.cloud.tasks.v2.ListQueuesResponse.next_page_token] - * returned from the previous call to - * [ListQueues][google.cloud.tasks.v2.CloudTasks.ListQueues] method. It is an - * error to switch the value of the - * [filter][google.cloud.tasks.v2.ListQueuesRequest.filter] while iterating - * through pages. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * Required. The location name. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The location name. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * `filter` can be used to specify a subset of queues. Any - * [Queue][google.cloud.tasks.v2.Queue] field can be used as a filter and - * several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The - * filter syntax is the same as described in [Stackdriver's Advanced Logs - * Filters](https://cloud.google.com/logging/docs/view/advanced_filters). - * Sample filter "state: PAUSED". - * Note that using filters might cause fewer queues than the - * requested page_size to be returned. - * - * Generated from protobuf field string filter = 2; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * `filter` can be used to specify a subset of queues. Any - * [Queue][google.cloud.tasks.v2.Queue] field can be used as a filter and - * several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The - * filter syntax is the same as described in [Stackdriver's Advanced Logs - * Filters](https://cloud.google.com/logging/docs/view/advanced_filters). - * Sample filter "state: PAUSED". - * Note that using filters might cause fewer queues than the - * requested page_size to be returned. - * - * Generated from protobuf field string filter = 2; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Requested page size. - * The maximum page size is 9800. If unspecified, the page size will - * be the maximum. Fewer queues than requested might be returned, - * even if more queues exist; use the - * [next_page_token][google.cloud.tasks.v2.ListQueuesResponse.next_page_token] - * in the response to determine if more queues exist. - * - * Generated from protobuf field int32 page_size = 3; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Requested page size. - * The maximum page size is 9800. If unspecified, the page size will - * be the maximum. Fewer queues than requested might be returned, - * even if more queues exist; use the - * [next_page_token][google.cloud.tasks.v2.ListQueuesResponse.next_page_token] - * in the response to determine if more queues exist. - * - * Generated from protobuf field int32 page_size = 3; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * A token identifying the page of results to return. - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * [next_page_token][google.cloud.tasks.v2.ListQueuesResponse.next_page_token] - * returned from the previous call to - * [ListQueues][google.cloud.tasks.v2.CloudTasks.ListQueues] method. It is an - * error to switch the value of the - * [filter][google.cloud.tasks.v2.ListQueuesRequest.filter] while iterating - * through pages. - * - * Generated from protobuf field string page_token = 4; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A token identifying the page of results to return. - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * [next_page_token][google.cloud.tasks.v2.ListQueuesResponse.next_page_token] - * returned from the previous call to - * [ListQueues][google.cloud.tasks.v2.CloudTasks.ListQueues] method. It is an - * error to switch the value of the - * [filter][google.cloud.tasks.v2.ListQueuesRequest.filter] while iterating - * through pages. - * - * Generated from protobuf field string page_token = 4; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ListQueuesResponse.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ListQueuesResponse.php deleted file mode 100644 index 35df0c08229f..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ListQueuesResponse.php +++ /dev/null @@ -1,122 +0,0 @@ -google.cloud.tasks.v2.ListQueuesResponse - */ -class ListQueuesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of queues. - * - * Generated from protobuf field repeated .google.cloud.tasks.v2.Queue queues = 1; - */ - private $queues; - /** - * A token to retrieve next page of results. - * To return the next page of results, call - * [ListQueues][google.cloud.tasks.v2.CloudTasks.ListQueues] with this value - * as the [page_token][google.cloud.tasks.v2.ListQueuesRequest.page_token]. - * If the next_page_token is empty, there are no more results. - * The page token is valid for only 2 hours. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Tasks\V2\Queue>|\Google\Protobuf\Internal\RepeatedField $queues - * The list of queues. - * @type string $next_page_token - * A token to retrieve next page of results. - * To return the next page of results, call - * [ListQueues][google.cloud.tasks.v2.CloudTasks.ListQueues] with this value - * as the [page_token][google.cloud.tasks.v2.ListQueuesRequest.page_token]. - * If the next_page_token is empty, there are no more results. - * The page token is valid for only 2 hours. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * The list of queues. - * - * Generated from protobuf field repeated .google.cloud.tasks.v2.Queue queues = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getQueues() - { - return $this->queues; - } - - /** - * The list of queues. - * - * Generated from protobuf field repeated .google.cloud.tasks.v2.Queue queues = 1; - * @param array<\Google\Cloud\Tasks\V2\Queue>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setQueues($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Tasks\V2\Queue::class); - $this->queues = $arr; - - return $this; - } - - /** - * A token to retrieve next page of results. - * To return the next page of results, call - * [ListQueues][google.cloud.tasks.v2.CloudTasks.ListQueues] with this value - * as the [page_token][google.cloud.tasks.v2.ListQueuesRequest.page_token]. - * If the next_page_token is empty, there are no more results. - * The page token is valid for only 2 hours. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token to retrieve next page of results. - * To return the next page of results, call - * [ListQueues][google.cloud.tasks.v2.CloudTasks.ListQueues] with this value - * as the [page_token][google.cloud.tasks.v2.ListQueuesRequest.page_token]. - * If the next_page_token is empty, there are no more results. - * The page token is valid for only 2 hours. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ListTasksRequest.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ListTasksRequest.php deleted file mode 100644 index 1919c39be9d2..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ListTasksRequest.php +++ /dev/null @@ -1,269 +0,0 @@ -google.cloud.tasks.v2.ListTasksRequest - */ -class ListTasksRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2.Task] will be returned. - * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; - * not all information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the [Task][google.cloud.tasks.v2.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2.Task.View response_view = 2; - */ - protected $response_view = 0; - /** - * Maximum page size. - * Fewer tasks than requested might be returned, even if more tasks exist; use - * [next_page_token][google.cloud.tasks.v2.ListTasksResponse.next_page_token] - * in the response to determine if more tasks exist. - * The maximum page size is 1000. If unspecified, the page size will be the - * maximum. - * - * Generated from protobuf field int32 page_size = 3; - */ - protected $page_size = 0; - /** - * A token identifying the page of results to return. - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * [next_page_token][google.cloud.tasks.v2.ListTasksResponse.next_page_token] - * returned from the previous call to - * [ListTasks][google.cloud.tasks.v2.CloudTasks.ListTasks] method. - * The page token is valid for only 2 hours. - * - * Generated from protobuf field string page_token = 4; - */ - protected $page_token = ''; - - /** - * @param string $parent Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * Please see {@see CloudTasksClient::queueName()} for help formatting this field. - * - * @return \Google\Cloud\Tasks\V2\ListTasksRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * @type int $response_view - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2.Task] will be returned. - * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; - * not all information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the [Task][google.cloud.tasks.v2.Task] resource. - * @type int $page_size - * Maximum page size. - * Fewer tasks than requested might be returned, even if more tasks exist; use - * [next_page_token][google.cloud.tasks.v2.ListTasksResponse.next_page_token] - * in the response to determine if more tasks exist. - * The maximum page size is 1000. If unspecified, the page size will be the - * maximum. - * @type string $page_token - * A token identifying the page of results to return. - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * [next_page_token][google.cloud.tasks.v2.ListTasksResponse.next_page_token] - * returned from the previous call to - * [ListTasks][google.cloud.tasks.v2.CloudTasks.ListTasks] method. - * The page token is valid for only 2 hours. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2.Task] will be returned. - * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; - * not all information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the [Task][google.cloud.tasks.v2.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2.Task.View response_view = 2; - * @return int - */ - public function getResponseView() - { - return $this->response_view; - } - - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2.Task] will be returned. - * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; - * not all information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the [Task][google.cloud.tasks.v2.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2.Task.View response_view = 2; - * @param int $var - * @return $this - */ - public function setResponseView($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2\Task\View::class); - $this->response_view = $var; - - return $this; - } - - /** - * Maximum page size. - * Fewer tasks than requested might be returned, even if more tasks exist; use - * [next_page_token][google.cloud.tasks.v2.ListTasksResponse.next_page_token] - * in the response to determine if more tasks exist. - * The maximum page size is 1000. If unspecified, the page size will be the - * maximum. - * - * Generated from protobuf field int32 page_size = 3; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Maximum page size. - * Fewer tasks than requested might be returned, even if more tasks exist; use - * [next_page_token][google.cloud.tasks.v2.ListTasksResponse.next_page_token] - * in the response to determine if more tasks exist. - * The maximum page size is 1000. If unspecified, the page size will be the - * maximum. - * - * Generated from protobuf field int32 page_size = 3; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * A token identifying the page of results to return. - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * [next_page_token][google.cloud.tasks.v2.ListTasksResponse.next_page_token] - * returned from the previous call to - * [ListTasks][google.cloud.tasks.v2.CloudTasks.ListTasks] method. - * The page token is valid for only 2 hours. - * - * Generated from protobuf field string page_token = 4; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A token identifying the page of results to return. - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * [next_page_token][google.cloud.tasks.v2.ListTasksResponse.next_page_token] - * returned from the previous call to - * [ListTasks][google.cloud.tasks.v2.CloudTasks.ListTasks] method. - * The page token is valid for only 2 hours. - * - * Generated from protobuf field string page_token = 4; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ListTasksResponse.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ListTasksResponse.php deleted file mode 100644 index 4aa25374a944..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ListTasksResponse.php +++ /dev/null @@ -1,118 +0,0 @@ -google.cloud.tasks.v2.ListTasksResponse - */ -class ListTasksResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of tasks. - * - * Generated from protobuf field repeated .google.cloud.tasks.v2.Task tasks = 1; - */ - private $tasks; - /** - * A token to retrieve next page of results. - * To return the next page of results, call - * [ListTasks][google.cloud.tasks.v2.CloudTasks.ListTasks] with this value as - * the [page_token][google.cloud.tasks.v2.ListTasksRequest.page_token]. - * If the next_page_token is empty, there are no more results. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Tasks\V2\Task>|\Google\Protobuf\Internal\RepeatedField $tasks - * The list of tasks. - * @type string $next_page_token - * A token to retrieve next page of results. - * To return the next page of results, call - * [ListTasks][google.cloud.tasks.v2.CloudTasks.ListTasks] with this value as - * the [page_token][google.cloud.tasks.v2.ListTasksRequest.page_token]. - * If the next_page_token is empty, there are no more results. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * The list of tasks. - * - * Generated from protobuf field repeated .google.cloud.tasks.v2.Task tasks = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTasks() - { - return $this->tasks; - } - - /** - * The list of tasks. - * - * Generated from protobuf field repeated .google.cloud.tasks.v2.Task tasks = 1; - * @param array<\Google\Cloud\Tasks\V2\Task>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTasks($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Tasks\V2\Task::class); - $this->tasks = $arr; - - return $this; - } - - /** - * A token to retrieve next page of results. - * To return the next page of results, call - * [ListTasks][google.cloud.tasks.v2.CloudTasks.ListTasks] with this value as - * the [page_token][google.cloud.tasks.v2.ListTasksRequest.page_token]. - * If the next_page_token is empty, there are no more results. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token to retrieve next page of results. - * To return the next page of results, call - * [ListTasks][google.cloud.tasks.v2.CloudTasks.ListTasks] with this value as - * the [page_token][google.cloud.tasks.v2.ListTasksRequest.page_token]. - * If the next_page_token is empty, there are no more results. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/OAuthToken.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/OAuthToken.php deleted file mode 100644 index a4533a9aaf28..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/OAuthToken.php +++ /dev/null @@ -1,128 +0,0 @@ -google.cloud.tasks.v2.OAuthToken - */ -class OAuthToken extends \Google\Protobuf\Internal\Message -{ - /** - * [Service account email](https://cloud.google.com/iam/docs/service-accounts) - * to be used for generating OAuth token. - * The service account must be within the same project as the queue. The - * caller must have iam.serviceAccounts.actAs permission for the service - * account. - * - * Generated from protobuf field string service_account_email = 1; - */ - protected $service_account_email = ''; - /** - * OAuth scope to be used for generating OAuth access token. - * If not specified, "https://www.googleapis.com/auth/cloud-platform" - * will be used. - * - * Generated from protobuf field string scope = 2; - */ - protected $scope = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $service_account_email - * [Service account email](https://cloud.google.com/iam/docs/service-accounts) - * to be used for generating OAuth token. - * The service account must be within the same project as the queue. The - * caller must have iam.serviceAccounts.actAs permission for the service - * account. - * @type string $scope - * OAuth scope to be used for generating OAuth access token. - * If not specified, "https://www.googleapis.com/auth/cloud-platform" - * will be used. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2\Target::initOnce(); - parent::__construct($data); - } - - /** - * [Service account email](https://cloud.google.com/iam/docs/service-accounts) - * to be used for generating OAuth token. - * The service account must be within the same project as the queue. The - * caller must have iam.serviceAccounts.actAs permission for the service - * account. - * - * Generated from protobuf field string service_account_email = 1; - * @return string - */ - public function getServiceAccountEmail() - { - return $this->service_account_email; - } - - /** - * [Service account email](https://cloud.google.com/iam/docs/service-accounts) - * to be used for generating OAuth token. - * The service account must be within the same project as the queue. The - * caller must have iam.serviceAccounts.actAs permission for the service - * account. - * - * Generated from protobuf field string service_account_email = 1; - * @param string $var - * @return $this - */ - public function setServiceAccountEmail($var) - { - GPBUtil::checkString($var, True); - $this->service_account_email = $var; - - return $this; - } - - /** - * OAuth scope to be used for generating OAuth access token. - * If not specified, "https://www.googleapis.com/auth/cloud-platform" - * will be used. - * - * Generated from protobuf field string scope = 2; - * @return string - */ - public function getScope() - { - return $this->scope; - } - - /** - * OAuth scope to be used for generating OAuth access token. - * If not specified, "https://www.googleapis.com/auth/cloud-platform" - * will be used. - * - * Generated from protobuf field string scope = 2; - * @param string $var - * @return $this - */ - public function setScope($var) - { - GPBUtil::checkString($var, True); - $this->scope = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/OidcToken.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/OidcToken.php deleted file mode 100644 index 5754271fc809..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/OidcToken.php +++ /dev/null @@ -1,126 +0,0 @@ -google.cloud.tasks.v2.OidcToken - */ -class OidcToken extends \Google\Protobuf\Internal\Message -{ - /** - * [Service account email](https://cloud.google.com/iam/docs/service-accounts) - * to be used for generating OIDC token. - * The service account must be within the same project as the queue. The - * caller must have iam.serviceAccounts.actAs permission for the service - * account. - * - * Generated from protobuf field string service_account_email = 1; - */ - protected $service_account_email = ''; - /** - * Audience to be used when generating OIDC token. If not specified, the URI - * specified in target will be used. - * - * Generated from protobuf field string audience = 2; - */ - protected $audience = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $service_account_email - * [Service account email](https://cloud.google.com/iam/docs/service-accounts) - * to be used for generating OIDC token. - * The service account must be within the same project as the queue. The - * caller must have iam.serviceAccounts.actAs permission for the service - * account. - * @type string $audience - * Audience to be used when generating OIDC token. If not specified, the URI - * specified in target will be used. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2\Target::initOnce(); - parent::__construct($data); - } - - /** - * [Service account email](https://cloud.google.com/iam/docs/service-accounts) - * to be used for generating OIDC token. - * The service account must be within the same project as the queue. The - * caller must have iam.serviceAccounts.actAs permission for the service - * account. - * - * Generated from protobuf field string service_account_email = 1; - * @return string - */ - public function getServiceAccountEmail() - { - return $this->service_account_email; - } - - /** - * [Service account email](https://cloud.google.com/iam/docs/service-accounts) - * to be used for generating OIDC token. - * The service account must be within the same project as the queue. The - * caller must have iam.serviceAccounts.actAs permission for the service - * account. - * - * Generated from protobuf field string service_account_email = 1; - * @param string $var - * @return $this - */ - public function setServiceAccountEmail($var) - { - GPBUtil::checkString($var, True); - $this->service_account_email = $var; - - return $this; - } - - /** - * Audience to be used when generating OIDC token. If not specified, the URI - * specified in target will be used. - * - * Generated from protobuf field string audience = 2; - * @return string - */ - public function getAudience() - { - return $this->audience; - } - - /** - * Audience to be used when generating OIDC token. If not specified, the URI - * specified in target will be used. - * - * Generated from protobuf field string audience = 2; - * @param string $var - * @return $this - */ - public function setAudience($var) - { - GPBUtil::checkString($var, True); - $this->audience = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/PauseQueueRequest.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/PauseQueueRequest.php deleted file mode 100644 index 64db439c96ab..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/PauseQueueRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -google.cloud.tasks.v2.PauseQueueRequest - */ -class PauseQueueRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * Please see {@see CloudTasksClient::queueName()} for help formatting this field. - * - * @return \Google\Cloud\Tasks\V2\PauseQueueRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/PurgeQueueRequest.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/PurgeQueueRequest.php deleted file mode 100644 index 2e24c8a7f5c3..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/PurgeQueueRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -google.cloud.tasks.v2.PurgeQueueRequest - */ -class PurgeQueueRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * Please see {@see CloudTasksClient::queueName()} for help formatting this field. - * - * @return \Google\Cloud\Tasks\V2\PurgeQueueRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Queue.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Queue.php deleted file mode 100644 index d620fdefd4b3..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Queue.php +++ /dev/null @@ -1,611 +0,0 @@ -google.cloud.tasks.v2.Queue - */ -class Queue extends \Google\Protobuf\Internal\Message -{ - /** - * Caller-specified and required in - * [CreateQueue][google.cloud.tasks.v2.CloudTasks.CreateQueue], after which it - * becomes output only. - * The queue name. - * The queue name must have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - * hyphens (-), colons (:), or periods (.). - * For more information, see - * [Identifying - * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) - * * `LOCATION_ID` is the canonical ID for the queue's location. - * The list of available locations can be obtained by calling - * [ListLocations][google.cloud.location.Locations.ListLocations]. - * For more information, see https://cloud.google.com/about/locations/. - * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or - * hyphens (-). The maximum length is 100 characters. - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * Overrides for - * [task-level - * app_engine_routing][google.cloud.tasks.v2.AppEngineHttpRequest.app_engine_routing]. - * These settings apply only to - * [App Engine tasks][google.cloud.tasks.v2.AppEngineHttpRequest] in this - * queue. [Http tasks][google.cloud.tasks.v2.HttpRequest] are not affected. - * If set, `app_engine_routing_override` is used for all - * [App Engine tasks][google.cloud.tasks.v2.AppEngineHttpRequest] in the - * queue, no matter what the setting is for the [task-level - * app_engine_routing][google.cloud.tasks.v2.AppEngineHttpRequest.app_engine_routing]. - * - * Generated from protobuf field .google.cloud.tasks.v2.AppEngineRouting app_engine_routing_override = 2; - */ - protected $app_engine_routing_override = null; - /** - * Rate limits for task dispatches. - * [rate_limits][google.cloud.tasks.v2.Queue.rate_limits] and - * [retry_config][google.cloud.tasks.v2.Queue.retry_config] are related - * because they both control task attempts. However they control task attempts - * in different ways: - * * [rate_limits][google.cloud.tasks.v2.Queue.rate_limits] controls the total - * rate of - * dispatches from a queue (i.e. all traffic dispatched from the - * queue, regardless of whether the dispatch is from a first - * attempt or a retry). - * * [retry_config][google.cloud.tasks.v2.Queue.retry_config] controls what - * happens to - * particular a task after its first attempt fails. That is, - * [retry_config][google.cloud.tasks.v2.Queue.retry_config] controls task - * retries (the second attempt, third attempt, etc). - * The queue's actual dispatch rate is the result of: - * * Number of tasks in the queue - * * User-specified throttling: - * [rate_limits][google.cloud.tasks.v2.Queue.rate_limits], - * [retry_config][google.cloud.tasks.v2.Queue.retry_config], and the - * [queue's state][google.cloud.tasks.v2.Queue.state]. - * * System throttling due to `429` (Too Many Requests) or `503` (Service - * Unavailable) responses from the worker, high error rates, or to smooth - * sudden large traffic spikes. - * - * Generated from protobuf field .google.cloud.tasks.v2.RateLimits rate_limits = 3; - */ - protected $rate_limits = null; - /** - * Settings that determine the retry behavior. - * * For tasks created using Cloud Tasks: the queue-level retry settings - * apply to all tasks in the queue that were created using Cloud Tasks. - * Retry settings cannot be set on individual tasks. - * * For tasks created using the App Engine SDK: the queue-level retry - * settings apply to all tasks in the queue which do not have retry settings - * explicitly set on the task and were created by the App Engine SDK. See - * [App Engine - * documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks). - * - * Generated from protobuf field .google.cloud.tasks.v2.RetryConfig retry_config = 4; - */ - protected $retry_config = null; - /** - * Output only. The state of the queue. - * `state` can only be changed by calling - * [PauseQueue][google.cloud.tasks.v2.CloudTasks.PauseQueue], - * [ResumeQueue][google.cloud.tasks.v2.CloudTasks.ResumeQueue], or uploading - * [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref). - * [UpdateQueue][google.cloud.tasks.v2.CloudTasks.UpdateQueue] cannot be used - * to change `state`. - * - * Generated from protobuf field .google.cloud.tasks.v2.Queue.State state = 5; - */ - protected $state = 0; - /** - * Output only. The last time this queue was purged. - * All tasks that were [created][google.cloud.tasks.v2.Task.create_time] - * before this time were purged. - * A queue can be purged using - * [PurgeQueue][google.cloud.tasks.v2.CloudTasks.PurgeQueue], the [App Engine - * Task Queue SDK, or the Cloud - * Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue). - * Purge time will be truncated to the nearest microsecond. Purge - * time will be unset if the queue has never been purged. - * - * Generated from protobuf field .google.protobuf.Timestamp purge_time = 6; - */ - protected $purge_time = null; - /** - * Configuration options for writing logs to - * [Stackdriver Logging](https://cloud.google.com/logging/docs/). If this - * field is unset, then no logs are written. - * - * Generated from protobuf field .google.cloud.tasks.v2.StackdriverLoggingConfig stackdriver_logging_config = 9; - */ - protected $stackdriver_logging_config = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Caller-specified and required in - * [CreateQueue][google.cloud.tasks.v2.CloudTasks.CreateQueue], after which it - * becomes output only. - * The queue name. - * The queue name must have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - * hyphens (-), colons (:), or periods (.). - * For more information, see - * [Identifying - * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) - * * `LOCATION_ID` is the canonical ID for the queue's location. - * The list of available locations can be obtained by calling - * [ListLocations][google.cloud.location.Locations.ListLocations]. - * For more information, see https://cloud.google.com/about/locations/. - * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or - * hyphens (-). The maximum length is 100 characters. - * @type \Google\Cloud\Tasks\V2\AppEngineRouting $app_engine_routing_override - * Overrides for - * [task-level - * app_engine_routing][google.cloud.tasks.v2.AppEngineHttpRequest.app_engine_routing]. - * These settings apply only to - * [App Engine tasks][google.cloud.tasks.v2.AppEngineHttpRequest] in this - * queue. [Http tasks][google.cloud.tasks.v2.HttpRequest] are not affected. - * If set, `app_engine_routing_override` is used for all - * [App Engine tasks][google.cloud.tasks.v2.AppEngineHttpRequest] in the - * queue, no matter what the setting is for the [task-level - * app_engine_routing][google.cloud.tasks.v2.AppEngineHttpRequest.app_engine_routing]. - * @type \Google\Cloud\Tasks\V2\RateLimits $rate_limits - * Rate limits for task dispatches. - * [rate_limits][google.cloud.tasks.v2.Queue.rate_limits] and - * [retry_config][google.cloud.tasks.v2.Queue.retry_config] are related - * because they both control task attempts. However they control task attempts - * in different ways: - * * [rate_limits][google.cloud.tasks.v2.Queue.rate_limits] controls the total - * rate of - * dispatches from a queue (i.e. all traffic dispatched from the - * queue, regardless of whether the dispatch is from a first - * attempt or a retry). - * * [retry_config][google.cloud.tasks.v2.Queue.retry_config] controls what - * happens to - * particular a task after its first attempt fails. That is, - * [retry_config][google.cloud.tasks.v2.Queue.retry_config] controls task - * retries (the second attempt, third attempt, etc). - * The queue's actual dispatch rate is the result of: - * * Number of tasks in the queue - * * User-specified throttling: - * [rate_limits][google.cloud.tasks.v2.Queue.rate_limits], - * [retry_config][google.cloud.tasks.v2.Queue.retry_config], and the - * [queue's state][google.cloud.tasks.v2.Queue.state]. - * * System throttling due to `429` (Too Many Requests) or `503` (Service - * Unavailable) responses from the worker, high error rates, or to smooth - * sudden large traffic spikes. - * @type \Google\Cloud\Tasks\V2\RetryConfig $retry_config - * Settings that determine the retry behavior. - * * For tasks created using Cloud Tasks: the queue-level retry settings - * apply to all tasks in the queue that were created using Cloud Tasks. - * Retry settings cannot be set on individual tasks. - * * For tasks created using the App Engine SDK: the queue-level retry - * settings apply to all tasks in the queue which do not have retry settings - * explicitly set on the task and were created by the App Engine SDK. See - * [App Engine - * documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks). - * @type int $state - * Output only. The state of the queue. - * `state` can only be changed by calling - * [PauseQueue][google.cloud.tasks.v2.CloudTasks.PauseQueue], - * [ResumeQueue][google.cloud.tasks.v2.CloudTasks.ResumeQueue], or uploading - * [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref). - * [UpdateQueue][google.cloud.tasks.v2.CloudTasks.UpdateQueue] cannot be used - * to change `state`. - * @type \Google\Protobuf\Timestamp $purge_time - * Output only. The last time this queue was purged. - * All tasks that were [created][google.cloud.tasks.v2.Task.create_time] - * before this time were purged. - * A queue can be purged using - * [PurgeQueue][google.cloud.tasks.v2.CloudTasks.PurgeQueue], the [App Engine - * Task Queue SDK, or the Cloud - * Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue). - * Purge time will be truncated to the nearest microsecond. Purge - * time will be unset if the queue has never been purged. - * @type \Google\Cloud\Tasks\V2\StackdriverLoggingConfig $stackdriver_logging_config - * Configuration options for writing logs to - * [Stackdriver Logging](https://cloud.google.com/logging/docs/). If this - * field is unset, then no logs are written. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2\Queue::initOnce(); - parent::__construct($data); - } - - /** - * Caller-specified and required in - * [CreateQueue][google.cloud.tasks.v2.CloudTasks.CreateQueue], after which it - * becomes output only. - * The queue name. - * The queue name must have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - * hyphens (-), colons (:), or periods (.). - * For more information, see - * [Identifying - * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) - * * `LOCATION_ID` is the canonical ID for the queue's location. - * The list of available locations can be obtained by calling - * [ListLocations][google.cloud.location.Locations.ListLocations]. - * For more information, see https://cloud.google.com/about/locations/. - * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or - * hyphens (-). The maximum length is 100 characters. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Caller-specified and required in - * [CreateQueue][google.cloud.tasks.v2.CloudTasks.CreateQueue], after which it - * becomes output only. - * The queue name. - * The queue name must have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - * hyphens (-), colons (:), or periods (.). - * For more information, see - * [Identifying - * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) - * * `LOCATION_ID` is the canonical ID for the queue's location. - * The list of available locations can be obtained by calling - * [ListLocations][google.cloud.location.Locations.ListLocations]. - * For more information, see https://cloud.google.com/about/locations/. - * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or - * hyphens (-). The maximum length is 100 characters. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Overrides for - * [task-level - * app_engine_routing][google.cloud.tasks.v2.AppEngineHttpRequest.app_engine_routing]. - * These settings apply only to - * [App Engine tasks][google.cloud.tasks.v2.AppEngineHttpRequest] in this - * queue. [Http tasks][google.cloud.tasks.v2.HttpRequest] are not affected. - * If set, `app_engine_routing_override` is used for all - * [App Engine tasks][google.cloud.tasks.v2.AppEngineHttpRequest] in the - * queue, no matter what the setting is for the [task-level - * app_engine_routing][google.cloud.tasks.v2.AppEngineHttpRequest.app_engine_routing]. - * - * Generated from protobuf field .google.cloud.tasks.v2.AppEngineRouting app_engine_routing_override = 2; - * @return \Google\Cloud\Tasks\V2\AppEngineRouting|null - */ - public function getAppEngineRoutingOverride() - { - return $this->app_engine_routing_override; - } - - public function hasAppEngineRoutingOverride() - { - return isset($this->app_engine_routing_override); - } - - public function clearAppEngineRoutingOverride() - { - unset($this->app_engine_routing_override); - } - - /** - * Overrides for - * [task-level - * app_engine_routing][google.cloud.tasks.v2.AppEngineHttpRequest.app_engine_routing]. - * These settings apply only to - * [App Engine tasks][google.cloud.tasks.v2.AppEngineHttpRequest] in this - * queue. [Http tasks][google.cloud.tasks.v2.HttpRequest] are not affected. - * If set, `app_engine_routing_override` is used for all - * [App Engine tasks][google.cloud.tasks.v2.AppEngineHttpRequest] in the - * queue, no matter what the setting is for the [task-level - * app_engine_routing][google.cloud.tasks.v2.AppEngineHttpRequest.app_engine_routing]. - * - * Generated from protobuf field .google.cloud.tasks.v2.AppEngineRouting app_engine_routing_override = 2; - * @param \Google\Cloud\Tasks\V2\AppEngineRouting $var - * @return $this - */ - public function setAppEngineRoutingOverride($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2\AppEngineRouting::class); - $this->app_engine_routing_override = $var; - - return $this; - } - - /** - * Rate limits for task dispatches. - * [rate_limits][google.cloud.tasks.v2.Queue.rate_limits] and - * [retry_config][google.cloud.tasks.v2.Queue.retry_config] are related - * because they both control task attempts. However they control task attempts - * in different ways: - * * [rate_limits][google.cloud.tasks.v2.Queue.rate_limits] controls the total - * rate of - * dispatches from a queue (i.e. all traffic dispatched from the - * queue, regardless of whether the dispatch is from a first - * attempt or a retry). - * * [retry_config][google.cloud.tasks.v2.Queue.retry_config] controls what - * happens to - * particular a task after its first attempt fails. That is, - * [retry_config][google.cloud.tasks.v2.Queue.retry_config] controls task - * retries (the second attempt, third attempt, etc). - * The queue's actual dispatch rate is the result of: - * * Number of tasks in the queue - * * User-specified throttling: - * [rate_limits][google.cloud.tasks.v2.Queue.rate_limits], - * [retry_config][google.cloud.tasks.v2.Queue.retry_config], and the - * [queue's state][google.cloud.tasks.v2.Queue.state]. - * * System throttling due to `429` (Too Many Requests) or `503` (Service - * Unavailable) responses from the worker, high error rates, or to smooth - * sudden large traffic spikes. - * - * Generated from protobuf field .google.cloud.tasks.v2.RateLimits rate_limits = 3; - * @return \Google\Cloud\Tasks\V2\RateLimits|null - */ - public function getRateLimits() - { - return $this->rate_limits; - } - - public function hasRateLimits() - { - return isset($this->rate_limits); - } - - public function clearRateLimits() - { - unset($this->rate_limits); - } - - /** - * Rate limits for task dispatches. - * [rate_limits][google.cloud.tasks.v2.Queue.rate_limits] and - * [retry_config][google.cloud.tasks.v2.Queue.retry_config] are related - * because they both control task attempts. However they control task attempts - * in different ways: - * * [rate_limits][google.cloud.tasks.v2.Queue.rate_limits] controls the total - * rate of - * dispatches from a queue (i.e. all traffic dispatched from the - * queue, regardless of whether the dispatch is from a first - * attempt or a retry). - * * [retry_config][google.cloud.tasks.v2.Queue.retry_config] controls what - * happens to - * particular a task after its first attempt fails. That is, - * [retry_config][google.cloud.tasks.v2.Queue.retry_config] controls task - * retries (the second attempt, third attempt, etc). - * The queue's actual dispatch rate is the result of: - * * Number of tasks in the queue - * * User-specified throttling: - * [rate_limits][google.cloud.tasks.v2.Queue.rate_limits], - * [retry_config][google.cloud.tasks.v2.Queue.retry_config], and the - * [queue's state][google.cloud.tasks.v2.Queue.state]. - * * System throttling due to `429` (Too Many Requests) or `503` (Service - * Unavailable) responses from the worker, high error rates, or to smooth - * sudden large traffic spikes. - * - * Generated from protobuf field .google.cloud.tasks.v2.RateLimits rate_limits = 3; - * @param \Google\Cloud\Tasks\V2\RateLimits $var - * @return $this - */ - public function setRateLimits($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2\RateLimits::class); - $this->rate_limits = $var; - - return $this; - } - - /** - * Settings that determine the retry behavior. - * * For tasks created using Cloud Tasks: the queue-level retry settings - * apply to all tasks in the queue that were created using Cloud Tasks. - * Retry settings cannot be set on individual tasks. - * * For tasks created using the App Engine SDK: the queue-level retry - * settings apply to all tasks in the queue which do not have retry settings - * explicitly set on the task and were created by the App Engine SDK. See - * [App Engine - * documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks). - * - * Generated from protobuf field .google.cloud.tasks.v2.RetryConfig retry_config = 4; - * @return \Google\Cloud\Tasks\V2\RetryConfig|null - */ - public function getRetryConfig() - { - return $this->retry_config; - } - - public function hasRetryConfig() - { - return isset($this->retry_config); - } - - public function clearRetryConfig() - { - unset($this->retry_config); - } - - /** - * Settings that determine the retry behavior. - * * For tasks created using Cloud Tasks: the queue-level retry settings - * apply to all tasks in the queue that were created using Cloud Tasks. - * Retry settings cannot be set on individual tasks. - * * For tasks created using the App Engine SDK: the queue-level retry - * settings apply to all tasks in the queue which do not have retry settings - * explicitly set on the task and were created by the App Engine SDK. See - * [App Engine - * documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks). - * - * Generated from protobuf field .google.cloud.tasks.v2.RetryConfig retry_config = 4; - * @param \Google\Cloud\Tasks\V2\RetryConfig $var - * @return $this - */ - public function setRetryConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2\RetryConfig::class); - $this->retry_config = $var; - - return $this; - } - - /** - * Output only. The state of the queue. - * `state` can only be changed by calling - * [PauseQueue][google.cloud.tasks.v2.CloudTasks.PauseQueue], - * [ResumeQueue][google.cloud.tasks.v2.CloudTasks.ResumeQueue], or uploading - * [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref). - * [UpdateQueue][google.cloud.tasks.v2.CloudTasks.UpdateQueue] cannot be used - * to change `state`. - * - * Generated from protobuf field .google.cloud.tasks.v2.Queue.State state = 5; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The state of the queue. - * `state` can only be changed by calling - * [PauseQueue][google.cloud.tasks.v2.CloudTasks.PauseQueue], - * [ResumeQueue][google.cloud.tasks.v2.CloudTasks.ResumeQueue], or uploading - * [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref). - * [UpdateQueue][google.cloud.tasks.v2.CloudTasks.UpdateQueue] cannot be used - * to change `state`. - * - * Generated from protobuf field .google.cloud.tasks.v2.Queue.State state = 5; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2\Queue\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. The last time this queue was purged. - * All tasks that were [created][google.cloud.tasks.v2.Task.create_time] - * before this time were purged. - * A queue can be purged using - * [PurgeQueue][google.cloud.tasks.v2.CloudTasks.PurgeQueue], the [App Engine - * Task Queue SDK, or the Cloud - * Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue). - * Purge time will be truncated to the nearest microsecond. Purge - * time will be unset if the queue has never been purged. - * - * Generated from protobuf field .google.protobuf.Timestamp purge_time = 6; - * @return \Google\Protobuf\Timestamp|null - */ - public function getPurgeTime() - { - return $this->purge_time; - } - - public function hasPurgeTime() - { - return isset($this->purge_time); - } - - public function clearPurgeTime() - { - unset($this->purge_time); - } - - /** - * Output only. The last time this queue was purged. - * All tasks that were [created][google.cloud.tasks.v2.Task.create_time] - * before this time were purged. - * A queue can be purged using - * [PurgeQueue][google.cloud.tasks.v2.CloudTasks.PurgeQueue], the [App Engine - * Task Queue SDK, or the Cloud - * Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue). - * Purge time will be truncated to the nearest microsecond. Purge - * time will be unset if the queue has never been purged. - * - * Generated from protobuf field .google.protobuf.Timestamp purge_time = 6; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setPurgeTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->purge_time = $var; - - return $this; - } - - /** - * Configuration options for writing logs to - * [Stackdriver Logging](https://cloud.google.com/logging/docs/). If this - * field is unset, then no logs are written. - * - * Generated from protobuf field .google.cloud.tasks.v2.StackdriverLoggingConfig stackdriver_logging_config = 9; - * @return \Google\Cloud\Tasks\V2\StackdriverLoggingConfig|null - */ - public function getStackdriverLoggingConfig() - { - return $this->stackdriver_logging_config; - } - - public function hasStackdriverLoggingConfig() - { - return isset($this->stackdriver_logging_config); - } - - public function clearStackdriverLoggingConfig() - { - unset($this->stackdriver_logging_config); - } - - /** - * Configuration options for writing logs to - * [Stackdriver Logging](https://cloud.google.com/logging/docs/). If this - * field is unset, then no logs are written. - * - * Generated from protobuf field .google.cloud.tasks.v2.StackdriverLoggingConfig stackdriver_logging_config = 9; - * @param \Google\Cloud\Tasks\V2\StackdriverLoggingConfig $var - * @return $this - */ - public function setStackdriverLoggingConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2\StackdriverLoggingConfig::class); - $this->stackdriver_logging_config = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Queue/State.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Queue/State.php deleted file mode 100644 index 2c4722b35ec5..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Queue/State.php +++ /dev/null @@ -1,89 +0,0 @@ -google.cloud.tasks.v2.Queue.State - */ -class State -{ - /** - * Unspecified state. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The queue is running. Tasks can be dispatched. - * If the queue was created using Cloud Tasks and the queue has - * had no activity (method calls or task dispatches) for 30 days, - * the queue may take a few minutes to re-activate. Some method - * calls may return [NOT_FOUND][google.rpc.Code.NOT_FOUND] and - * tasks may not be dispatched for a few minutes until the queue - * has been re-activated. - * - * Generated from protobuf enum RUNNING = 1; - */ - const RUNNING = 1; - /** - * Tasks are paused by the user. If the queue is paused then Cloud - * Tasks will stop delivering tasks from it, but more tasks can - * still be added to it by the user. - * - * Generated from protobuf enum PAUSED = 2; - */ - const PAUSED = 2; - /** - * The queue is disabled. - * A queue becomes `DISABLED` when - * [queue.yaml](https://cloud.google.com/appengine/docs/python/config/queueref) - * or - * [queue.xml](https://cloud.google.com/appengine/docs/standard/java/config/queueref) - * is uploaded which does not contain the queue. You cannot directly disable - * a queue. - * When a queue is disabled, tasks can still be added to a queue - * but the tasks are not dispatched. - * To permanently delete this queue and all of its tasks, call - * [DeleteQueue][google.cloud.tasks.v2.CloudTasks.DeleteQueue]. - * - * Generated from protobuf enum DISABLED = 3; - */ - const DISABLED = 3; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::RUNNING => 'RUNNING', - self::PAUSED => 'PAUSED', - self::DISABLED => 'DISABLED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Tasks\V2\Queue_State::class); - diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/RateLimits.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/RateLimits.php deleted file mode 100644 index 27f254540e19..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/RateLimits.php +++ /dev/null @@ -1,308 +0,0 @@ -google.cloud.tasks.v2.RateLimits - */ -class RateLimits extends \Google\Protobuf\Internal\Message -{ - /** - * The maximum rate at which tasks are dispatched from this queue. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * * The maximum allowed value is 500. - * This field has the same meaning as - * [rate in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate). - * - * Generated from protobuf field double max_dispatches_per_second = 1; - */ - protected $max_dispatches_per_second = 0.0; - /** - * Output only. The max burst size. - * Max burst size limits how fast tasks in queue are processed when - * many tasks are in the queue and the rate is high. This field - * allows the queue to have a high rate so processing starts shortly - * after a task is enqueued, but still limits resource usage when - * many tasks are enqueued in a short period of time. - * The [token bucket](https://wikipedia.org/wiki/Token_Bucket) - * algorithm is used to control the rate of task dispatches. Each - * queue has a token bucket that holds tokens, up to the maximum - * specified by `max_burst_size`. Each time a task is dispatched, a - * token is removed from the bucket. Tasks will be dispatched until - * the queue's bucket runs out of tokens. The bucket will be - * continuously refilled with new tokens based on - * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second]. - * Cloud Tasks will pick the value of `max_burst_size` based on the - * value of - * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second]. - * For queues that were created or updated using - * `queue.yaml/xml`, `max_burst_size` is equal to - * [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size). - * Since `max_burst_size` is output only, if - * [UpdateQueue][google.cloud.tasks.v2.CloudTasks.UpdateQueue] is called on a - * queue created by `queue.yaml/xml`, `max_burst_size` will be reset based on - * the value of - * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second], - * regardless of whether - * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second] - * is updated. - * - * Generated from protobuf field int32 max_burst_size = 2; - */ - protected $max_burst_size = 0; - /** - * The maximum number of concurrent tasks that Cloud Tasks allows - * to be dispatched for this queue. After this threshold has been - * reached, Cloud Tasks stops dispatching tasks until the number of - * concurrent requests decreases. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * The maximum allowed value is 5,000. - * This field has the same meaning as - * [max_concurrent_requests in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests). - * - * Generated from protobuf field int32 max_concurrent_dispatches = 3; - */ - protected $max_concurrent_dispatches = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type float $max_dispatches_per_second - * The maximum rate at which tasks are dispatched from this queue. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * * The maximum allowed value is 500. - * This field has the same meaning as - * [rate in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate). - * @type int $max_burst_size - * Output only. The max burst size. - * Max burst size limits how fast tasks in queue are processed when - * many tasks are in the queue and the rate is high. This field - * allows the queue to have a high rate so processing starts shortly - * after a task is enqueued, but still limits resource usage when - * many tasks are enqueued in a short period of time. - * The [token bucket](https://wikipedia.org/wiki/Token_Bucket) - * algorithm is used to control the rate of task dispatches. Each - * queue has a token bucket that holds tokens, up to the maximum - * specified by `max_burst_size`. Each time a task is dispatched, a - * token is removed from the bucket. Tasks will be dispatched until - * the queue's bucket runs out of tokens. The bucket will be - * continuously refilled with new tokens based on - * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second]. - * Cloud Tasks will pick the value of `max_burst_size` based on the - * value of - * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second]. - * For queues that were created or updated using - * `queue.yaml/xml`, `max_burst_size` is equal to - * [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size). - * Since `max_burst_size` is output only, if - * [UpdateQueue][google.cloud.tasks.v2.CloudTasks.UpdateQueue] is called on a - * queue created by `queue.yaml/xml`, `max_burst_size` will be reset based on - * the value of - * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second], - * regardless of whether - * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second] - * is updated. - * @type int $max_concurrent_dispatches - * The maximum number of concurrent tasks that Cloud Tasks allows - * to be dispatched for this queue. After this threshold has been - * reached, Cloud Tasks stops dispatching tasks until the number of - * concurrent requests decreases. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * The maximum allowed value is 5,000. - * This field has the same meaning as - * [max_concurrent_requests in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2\Queue::initOnce(); - parent::__construct($data); - } - - /** - * The maximum rate at which tasks are dispatched from this queue. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * * The maximum allowed value is 500. - * This field has the same meaning as - * [rate in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate). - * - * Generated from protobuf field double max_dispatches_per_second = 1; - * @return float - */ - public function getMaxDispatchesPerSecond() - { - return $this->max_dispatches_per_second; - } - - /** - * The maximum rate at which tasks are dispatched from this queue. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * * The maximum allowed value is 500. - * This field has the same meaning as - * [rate in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate). - * - * Generated from protobuf field double max_dispatches_per_second = 1; - * @param float $var - * @return $this - */ - public function setMaxDispatchesPerSecond($var) - { - GPBUtil::checkDouble($var); - $this->max_dispatches_per_second = $var; - - return $this; - } - - /** - * Output only. The max burst size. - * Max burst size limits how fast tasks in queue are processed when - * many tasks are in the queue and the rate is high. This field - * allows the queue to have a high rate so processing starts shortly - * after a task is enqueued, but still limits resource usage when - * many tasks are enqueued in a short period of time. - * The [token bucket](https://wikipedia.org/wiki/Token_Bucket) - * algorithm is used to control the rate of task dispatches. Each - * queue has a token bucket that holds tokens, up to the maximum - * specified by `max_burst_size`. Each time a task is dispatched, a - * token is removed from the bucket. Tasks will be dispatched until - * the queue's bucket runs out of tokens. The bucket will be - * continuously refilled with new tokens based on - * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second]. - * Cloud Tasks will pick the value of `max_burst_size` based on the - * value of - * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second]. - * For queues that were created or updated using - * `queue.yaml/xml`, `max_burst_size` is equal to - * [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size). - * Since `max_burst_size` is output only, if - * [UpdateQueue][google.cloud.tasks.v2.CloudTasks.UpdateQueue] is called on a - * queue created by `queue.yaml/xml`, `max_burst_size` will be reset based on - * the value of - * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second], - * regardless of whether - * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second] - * is updated. - * - * Generated from protobuf field int32 max_burst_size = 2; - * @return int - */ - public function getMaxBurstSize() - { - return $this->max_burst_size; - } - - /** - * Output only. The max burst size. - * Max burst size limits how fast tasks in queue are processed when - * many tasks are in the queue and the rate is high. This field - * allows the queue to have a high rate so processing starts shortly - * after a task is enqueued, but still limits resource usage when - * many tasks are enqueued in a short period of time. - * The [token bucket](https://wikipedia.org/wiki/Token_Bucket) - * algorithm is used to control the rate of task dispatches. Each - * queue has a token bucket that holds tokens, up to the maximum - * specified by `max_burst_size`. Each time a task is dispatched, a - * token is removed from the bucket. Tasks will be dispatched until - * the queue's bucket runs out of tokens. The bucket will be - * continuously refilled with new tokens based on - * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second]. - * Cloud Tasks will pick the value of `max_burst_size` based on the - * value of - * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second]. - * For queues that were created or updated using - * `queue.yaml/xml`, `max_burst_size` is equal to - * [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size). - * Since `max_burst_size` is output only, if - * [UpdateQueue][google.cloud.tasks.v2.CloudTasks.UpdateQueue] is called on a - * queue created by `queue.yaml/xml`, `max_burst_size` will be reset based on - * the value of - * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second], - * regardless of whether - * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second] - * is updated. - * - * Generated from protobuf field int32 max_burst_size = 2; - * @param int $var - * @return $this - */ - public function setMaxBurstSize($var) - { - GPBUtil::checkInt32($var); - $this->max_burst_size = $var; - - return $this; - } - - /** - * The maximum number of concurrent tasks that Cloud Tasks allows - * to be dispatched for this queue. After this threshold has been - * reached, Cloud Tasks stops dispatching tasks until the number of - * concurrent requests decreases. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * The maximum allowed value is 5,000. - * This field has the same meaning as - * [max_concurrent_requests in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests). - * - * Generated from protobuf field int32 max_concurrent_dispatches = 3; - * @return int - */ - public function getMaxConcurrentDispatches() - { - return $this->max_concurrent_dispatches; - } - - /** - * The maximum number of concurrent tasks that Cloud Tasks allows - * to be dispatched for this queue. After this threshold has been - * reached, Cloud Tasks stops dispatching tasks until the number of - * concurrent requests decreases. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * The maximum allowed value is 5,000. - * This field has the same meaning as - * [max_concurrent_requests in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests). - * - * Generated from protobuf field int32 max_concurrent_dispatches = 3; - * @param int $var - * @return $this - */ - public function setMaxConcurrentDispatches($var) - { - GPBUtil::checkInt32($var); - $this->max_concurrent_dispatches = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ResumeQueueRequest.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ResumeQueueRequest.php deleted file mode 100644 index 9d16294a8e1e..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ResumeQueueRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -google.cloud.tasks.v2.ResumeQueueRequest - */ -class ResumeQueueRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * Please see {@see CloudTasksClient::queueName()} for help formatting this field. - * - * @return \Google\Cloud\Tasks\V2\ResumeQueueRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/RetryConfig.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/RetryConfig.php deleted file mode 100644 index 64252afa351d..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/RetryConfig.php +++ /dev/null @@ -1,490 +0,0 @@ -google.cloud.tasks.v2.RetryConfig - */ -class RetryConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Number of attempts per task. - * Cloud Tasks will attempt the task `max_attempts` times (that is, if the - * first attempt fails, then there will be `max_attempts - 1` retries). Must - * be >= -1. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * -1 indicates unlimited attempts. - * This field has the same meaning as - * [task_retry_limit in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * - * Generated from protobuf field int32 max_attempts = 1; - */ - protected $max_attempts = 0; - /** - * If positive, `max_retry_duration` specifies the time limit for - * retrying a failed task, measured from when the task was first - * attempted. Once `max_retry_duration` time has passed *and* the - * task has been attempted - * [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times, no - * further attempts will be made and the task will be deleted. - * If zero, then the task age is unlimited. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * `max_retry_duration` will be truncated to the nearest second. - * This field has the same meaning as - * [task_age_limit in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * - * Generated from protobuf field .google.protobuf.Duration max_retry_duration = 2; - */ - protected $max_retry_duration = null; - /** - * A task will be [scheduled][google.cloud.tasks.v2.Task.schedule_time] for - * retry between [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff] - * and [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] duration - * after it fails, if the queue's - * [RetryConfig][google.cloud.tasks.v2.RetryConfig] specifies that the task - * should be retried. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * `min_backoff` will be truncated to the nearest second. - * This field has the same meaning as - * [min_backoff_seconds in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * - * Generated from protobuf field .google.protobuf.Duration min_backoff = 3; - */ - protected $min_backoff = null; - /** - * A task will be [scheduled][google.cloud.tasks.v2.Task.schedule_time] for - * retry between [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff] - * and [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] duration - * after it fails, if the queue's - * [RetryConfig][google.cloud.tasks.v2.RetryConfig] specifies that the task - * should be retried. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * `max_backoff` will be truncated to the nearest second. - * This field has the same meaning as - * [max_backoff_seconds in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * - * Generated from protobuf field .google.protobuf.Duration max_backoff = 4; - */ - protected $max_backoff = null; - /** - * The time between retries will double `max_doublings` times. - * A task's retry interval starts at - * [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff], then doubles - * `max_doublings` times, then increases linearly, and finally - * retries at intervals of - * [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] up to - * [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times. - * For example, if - * [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff] is 10s, - * [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] is 300s, and - * `max_doublings` is 3, then the a task will first be retried in - * 10s. The retry interval will double three times, and then - * increase linearly by 2^3 * 10s. Finally, the task will retry at - * intervals of [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] - * until the task has been attempted - * [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times. Thus, - * the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, 300s, .... - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * This field has the same meaning as - * [max_doublings in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * - * Generated from protobuf field int32 max_doublings = 5; - */ - protected $max_doublings = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $max_attempts - * Number of attempts per task. - * Cloud Tasks will attempt the task `max_attempts` times (that is, if the - * first attempt fails, then there will be `max_attempts - 1` retries). Must - * be >= -1. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * -1 indicates unlimited attempts. - * This field has the same meaning as - * [task_retry_limit in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * @type \Google\Protobuf\Duration $max_retry_duration - * If positive, `max_retry_duration` specifies the time limit for - * retrying a failed task, measured from when the task was first - * attempted. Once `max_retry_duration` time has passed *and* the - * task has been attempted - * [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times, no - * further attempts will be made and the task will be deleted. - * If zero, then the task age is unlimited. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * `max_retry_duration` will be truncated to the nearest second. - * This field has the same meaning as - * [task_age_limit in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * @type \Google\Protobuf\Duration $min_backoff - * A task will be [scheduled][google.cloud.tasks.v2.Task.schedule_time] for - * retry between [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff] - * and [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] duration - * after it fails, if the queue's - * [RetryConfig][google.cloud.tasks.v2.RetryConfig] specifies that the task - * should be retried. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * `min_backoff` will be truncated to the nearest second. - * This field has the same meaning as - * [min_backoff_seconds in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * @type \Google\Protobuf\Duration $max_backoff - * A task will be [scheduled][google.cloud.tasks.v2.Task.schedule_time] for - * retry between [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff] - * and [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] duration - * after it fails, if the queue's - * [RetryConfig][google.cloud.tasks.v2.RetryConfig] specifies that the task - * should be retried. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * `max_backoff` will be truncated to the nearest second. - * This field has the same meaning as - * [max_backoff_seconds in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * @type int $max_doublings - * The time between retries will double `max_doublings` times. - * A task's retry interval starts at - * [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff], then doubles - * `max_doublings` times, then increases linearly, and finally - * retries at intervals of - * [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] up to - * [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times. - * For example, if - * [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff] is 10s, - * [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] is 300s, and - * `max_doublings` is 3, then the a task will first be retried in - * 10s. The retry interval will double three times, and then - * increase linearly by 2^3 * 10s. Finally, the task will retry at - * intervals of [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] - * until the task has been attempted - * [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times. Thus, - * the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, 300s, .... - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * This field has the same meaning as - * [max_doublings in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2\Queue::initOnce(); - parent::__construct($data); - } - - /** - * Number of attempts per task. - * Cloud Tasks will attempt the task `max_attempts` times (that is, if the - * first attempt fails, then there will be `max_attempts - 1` retries). Must - * be >= -1. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * -1 indicates unlimited attempts. - * This field has the same meaning as - * [task_retry_limit in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * - * Generated from protobuf field int32 max_attempts = 1; - * @return int - */ - public function getMaxAttempts() - { - return $this->max_attempts; - } - - /** - * Number of attempts per task. - * Cloud Tasks will attempt the task `max_attempts` times (that is, if the - * first attempt fails, then there will be `max_attempts - 1` retries). Must - * be >= -1. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * -1 indicates unlimited attempts. - * This field has the same meaning as - * [task_retry_limit in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * - * Generated from protobuf field int32 max_attempts = 1; - * @param int $var - * @return $this - */ - public function setMaxAttempts($var) - { - GPBUtil::checkInt32($var); - $this->max_attempts = $var; - - return $this; - } - - /** - * If positive, `max_retry_duration` specifies the time limit for - * retrying a failed task, measured from when the task was first - * attempted. Once `max_retry_duration` time has passed *and* the - * task has been attempted - * [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times, no - * further attempts will be made and the task will be deleted. - * If zero, then the task age is unlimited. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * `max_retry_duration` will be truncated to the nearest second. - * This field has the same meaning as - * [task_age_limit in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * - * Generated from protobuf field .google.protobuf.Duration max_retry_duration = 2; - * @return \Google\Protobuf\Duration|null - */ - public function getMaxRetryDuration() - { - return $this->max_retry_duration; - } - - public function hasMaxRetryDuration() - { - return isset($this->max_retry_duration); - } - - public function clearMaxRetryDuration() - { - unset($this->max_retry_duration); - } - - /** - * If positive, `max_retry_duration` specifies the time limit for - * retrying a failed task, measured from when the task was first - * attempted. Once `max_retry_duration` time has passed *and* the - * task has been attempted - * [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times, no - * further attempts will be made and the task will be deleted. - * If zero, then the task age is unlimited. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * `max_retry_duration` will be truncated to the nearest second. - * This field has the same meaning as - * [task_age_limit in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * - * Generated from protobuf field .google.protobuf.Duration max_retry_duration = 2; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setMaxRetryDuration($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->max_retry_duration = $var; - - return $this; - } - - /** - * A task will be [scheduled][google.cloud.tasks.v2.Task.schedule_time] for - * retry between [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff] - * and [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] duration - * after it fails, if the queue's - * [RetryConfig][google.cloud.tasks.v2.RetryConfig] specifies that the task - * should be retried. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * `min_backoff` will be truncated to the nearest second. - * This field has the same meaning as - * [min_backoff_seconds in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * - * Generated from protobuf field .google.protobuf.Duration min_backoff = 3; - * @return \Google\Protobuf\Duration|null - */ - public function getMinBackoff() - { - return $this->min_backoff; - } - - public function hasMinBackoff() - { - return isset($this->min_backoff); - } - - public function clearMinBackoff() - { - unset($this->min_backoff); - } - - /** - * A task will be [scheduled][google.cloud.tasks.v2.Task.schedule_time] for - * retry between [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff] - * and [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] duration - * after it fails, if the queue's - * [RetryConfig][google.cloud.tasks.v2.RetryConfig] specifies that the task - * should be retried. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * `min_backoff` will be truncated to the nearest second. - * This field has the same meaning as - * [min_backoff_seconds in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * - * Generated from protobuf field .google.protobuf.Duration min_backoff = 3; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setMinBackoff($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->min_backoff = $var; - - return $this; - } - - /** - * A task will be [scheduled][google.cloud.tasks.v2.Task.schedule_time] for - * retry between [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff] - * and [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] duration - * after it fails, if the queue's - * [RetryConfig][google.cloud.tasks.v2.RetryConfig] specifies that the task - * should be retried. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * `max_backoff` will be truncated to the nearest second. - * This field has the same meaning as - * [max_backoff_seconds in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * - * Generated from protobuf field .google.protobuf.Duration max_backoff = 4; - * @return \Google\Protobuf\Duration|null - */ - public function getMaxBackoff() - { - return $this->max_backoff; - } - - public function hasMaxBackoff() - { - return isset($this->max_backoff); - } - - public function clearMaxBackoff() - { - unset($this->max_backoff); - } - - /** - * A task will be [scheduled][google.cloud.tasks.v2.Task.schedule_time] for - * retry between [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff] - * and [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] duration - * after it fails, if the queue's - * [RetryConfig][google.cloud.tasks.v2.RetryConfig] specifies that the task - * should be retried. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * `max_backoff` will be truncated to the nearest second. - * This field has the same meaning as - * [max_backoff_seconds in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * - * Generated from protobuf field .google.protobuf.Duration max_backoff = 4; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setMaxBackoff($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->max_backoff = $var; - - return $this; - } - - /** - * The time between retries will double `max_doublings` times. - * A task's retry interval starts at - * [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff], then doubles - * `max_doublings` times, then increases linearly, and finally - * retries at intervals of - * [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] up to - * [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times. - * For example, if - * [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff] is 10s, - * [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] is 300s, and - * `max_doublings` is 3, then the a task will first be retried in - * 10s. The retry interval will double three times, and then - * increase linearly by 2^3 * 10s. Finally, the task will retry at - * intervals of [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] - * until the task has been attempted - * [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times. Thus, - * the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, 300s, .... - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * This field has the same meaning as - * [max_doublings in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * - * Generated from protobuf field int32 max_doublings = 5; - * @return int - */ - public function getMaxDoublings() - { - return $this->max_doublings; - } - - /** - * The time between retries will double `max_doublings` times. - * A task's retry interval starts at - * [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff], then doubles - * `max_doublings` times, then increases linearly, and finally - * retries at intervals of - * [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] up to - * [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times. - * For example, if - * [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff] is 10s, - * [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] is 300s, and - * `max_doublings` is 3, then the a task will first be retried in - * 10s. The retry interval will double three times, and then - * increase linearly by 2^3 * 10s. Finally, the task will retry at - * intervals of [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] - * until the task has been attempted - * [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times. Thus, - * the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, 300s, .... - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * This field has the same meaning as - * [max_doublings in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * - * Generated from protobuf field int32 max_doublings = 5; - * @param int $var - * @return $this - */ - public function setMaxDoublings($var) - { - GPBUtil::checkInt32($var); - $this->max_doublings = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/RunTaskRequest.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/RunTaskRequest.php deleted file mode 100644 index bcdf65c9a418..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/RunTaskRequest.php +++ /dev/null @@ -1,157 +0,0 @@ -google.cloud.tasks.v2.RunTaskRequest - */ -class RunTaskRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2.Task] will be returned. - * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; - * not all information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the [Task][google.cloud.tasks.v2.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2.Task.View response_view = 2; - */ - protected $response_view = 0; - - /** - * @param string $name Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * Please see {@see CloudTasksClient::taskName()} for help formatting this field. - * - * @return \Google\Cloud\Tasks\V2\RunTaskRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * @type int $response_view - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2.Task] will be returned. - * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; - * not all information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the [Task][google.cloud.tasks.v2.Task] resource. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2.Task] will be returned. - * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; - * not all information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the [Task][google.cloud.tasks.v2.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2.Task.View response_view = 2; - * @return int - */ - public function getResponseView() - { - return $this->response_view; - } - - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2.Task] will be returned. - * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; - * not all information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the [Task][google.cloud.tasks.v2.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2.Task.View response_view = 2; - * @param int $var - * @return $this - */ - public function setResponseView($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2\Task\View::class); - $this->response_view = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/StackdriverLoggingConfig.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/StackdriverLoggingConfig.php deleted file mode 100644 index 67e03f8a8ae6..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/StackdriverLoggingConfig.php +++ /dev/null @@ -1,80 +0,0 @@ -google.cloud.tasks.v2.StackdriverLoggingConfig - */ -class StackdriverLoggingConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Specifies the fraction of operations to write to - * [Stackdriver Logging](https://cloud.google.com/logging/docs/). - * This field may contain any value between 0.0 and 1.0, inclusive. - * 0.0 is the default and means that no operations are logged. - * - * Generated from protobuf field double sampling_ratio = 1; - */ - protected $sampling_ratio = 0.0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type float $sampling_ratio - * Specifies the fraction of operations to write to - * [Stackdriver Logging](https://cloud.google.com/logging/docs/). - * This field may contain any value between 0.0 and 1.0, inclusive. - * 0.0 is the default and means that no operations are logged. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2\Queue::initOnce(); - parent::__construct($data); - } - - /** - * Specifies the fraction of operations to write to - * [Stackdriver Logging](https://cloud.google.com/logging/docs/). - * This field may contain any value between 0.0 and 1.0, inclusive. - * 0.0 is the default and means that no operations are logged. - * - * Generated from protobuf field double sampling_ratio = 1; - * @return float - */ - public function getSamplingRatio() - { - return $this->sampling_ratio; - } - - /** - * Specifies the fraction of operations to write to - * [Stackdriver Logging](https://cloud.google.com/logging/docs/). - * This field may contain any value between 0.0 and 1.0, inclusive. - * 0.0 is the default and means that no operations are logged. - * - * Generated from protobuf field double sampling_ratio = 1; - * @param float $var - * @return $this - */ - public function setSamplingRatio($var) - { - GPBUtil::checkDouble($var); - $this->sampling_ratio = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Task.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Task.php deleted file mode 100644 index 6606b429e387..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Task.php +++ /dev/null @@ -1,684 +0,0 @@ -google.cloud.tasks.v2.Task - */ -class Task extends \Google\Protobuf\Internal\Message -{ - /** - * Optionally caller-specified in - * [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask]. - * The task name. - * The task name must have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - * hyphens (-), colons (:), or periods (.). - * For more information, see - * [Identifying - * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) - * * `LOCATION_ID` is the canonical ID for the task's location. - * The list of available locations can be obtained by calling - * [ListLocations][google.cloud.location.Locations.ListLocations]. - * For more information, see https://cloud.google.com/about/locations/. - * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or - * hyphens (-). The maximum length is 100 characters. - * * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), - * hyphens (-), or underscores (_). The maximum length is 500 characters. - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * The time when the task is scheduled to be attempted or retried. - * `schedule_time` will be truncated to the nearest microsecond. - * - * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 4; - */ - protected $schedule_time = null; - /** - * Output only. The time that the task was created. - * `create_time` will be truncated to the nearest second. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; - */ - protected $create_time = null; - /** - * The deadline for requests sent to the worker. If the worker does not - * respond by this deadline then the request is cancelled and the attempt - * is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the - * task according to the [RetryConfig][google.cloud.tasks.v2.RetryConfig]. - * Note that when the request is cancelled, Cloud Tasks will stop listening - * for the response, but whether the worker stops processing depends on the - * worker. For example, if the worker is stuck, it may not react to cancelled - * requests. - * The default and maximum values depend on the type of request: - * * For [HTTP tasks][google.cloud.tasks.v2.HttpRequest], the default is 10 - * minutes. The deadline - * must be in the interval [15 seconds, 30 minutes]. - * * For [App Engine tasks][google.cloud.tasks.v2.AppEngineHttpRequest], 0 - * indicates that the - * request has the default deadline. The default deadline depends on the - * [scaling - * type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling) - * of the service: 10 minutes for standard apps with automatic scaling, 24 - * hours for standard apps with manual and basic scaling, and 60 minutes for - * flex apps. If the request deadline is set, it must be in the interval [15 - * seconds, 24 hours 15 seconds]. Regardless of the task's - * `dispatch_deadline`, the app handler will not run for longer than than - * the service's timeout. We recommend setting the `dispatch_deadline` to - * at most a few seconds more than the app handler's timeout. For more - * information see - * [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts). - * `dispatch_deadline` will be truncated to the nearest millisecond. The - * deadline is an approximate deadline. - * - * Generated from protobuf field .google.protobuf.Duration dispatch_deadline = 6; - */ - protected $dispatch_deadline = null; - /** - * Output only. The number of attempts dispatched. - * This count includes attempts which have been dispatched but haven't - * received a response. - * - * Generated from protobuf field int32 dispatch_count = 7; - */ - protected $dispatch_count = 0; - /** - * Output only. The number of attempts which have received a response. - * - * Generated from protobuf field int32 response_count = 8; - */ - protected $response_count = 0; - /** - * Output only. The status of the task's first attempt. - * Only [dispatch_time][google.cloud.tasks.v2.Attempt.dispatch_time] will be - * set. The other [Attempt][google.cloud.tasks.v2.Attempt] information is not - * retained by Cloud Tasks. - * - * Generated from protobuf field .google.cloud.tasks.v2.Attempt first_attempt = 9; - */ - protected $first_attempt = null; - /** - * Output only. The status of the task's last attempt. - * - * Generated from protobuf field .google.cloud.tasks.v2.Attempt last_attempt = 10; - */ - protected $last_attempt = null; - /** - * Output only. The view specifies which subset of the - * [Task][google.cloud.tasks.v2.Task] has been returned. - * - * Generated from protobuf field .google.cloud.tasks.v2.Task.View view = 11; - */ - protected $view = 0; - protected $message_type; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Optionally caller-specified in - * [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask]. - * The task name. - * The task name must have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - * hyphens (-), colons (:), or periods (.). - * For more information, see - * [Identifying - * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) - * * `LOCATION_ID` is the canonical ID for the task's location. - * The list of available locations can be obtained by calling - * [ListLocations][google.cloud.location.Locations.ListLocations]. - * For more information, see https://cloud.google.com/about/locations/. - * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or - * hyphens (-). The maximum length is 100 characters. - * * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), - * hyphens (-), or underscores (_). The maximum length is 500 characters. - * @type \Google\Cloud\Tasks\V2\AppEngineHttpRequest $app_engine_http_request - * HTTP request that is sent to the App Engine app handler. - * An App Engine task is a task that has - * [AppEngineHttpRequest][google.cloud.tasks.v2.AppEngineHttpRequest] set. - * @type \Google\Cloud\Tasks\V2\HttpRequest $http_request - * HTTP request that is sent to the worker. - * An HTTP task is a task that has - * [HttpRequest][google.cloud.tasks.v2.HttpRequest] set. - * @type \Google\Protobuf\Timestamp $schedule_time - * The time when the task is scheduled to be attempted or retried. - * `schedule_time` will be truncated to the nearest microsecond. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time that the task was created. - * `create_time` will be truncated to the nearest second. - * @type \Google\Protobuf\Duration $dispatch_deadline - * The deadline for requests sent to the worker. If the worker does not - * respond by this deadline then the request is cancelled and the attempt - * is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the - * task according to the [RetryConfig][google.cloud.tasks.v2.RetryConfig]. - * Note that when the request is cancelled, Cloud Tasks will stop listening - * for the response, but whether the worker stops processing depends on the - * worker. For example, if the worker is stuck, it may not react to cancelled - * requests. - * The default and maximum values depend on the type of request: - * * For [HTTP tasks][google.cloud.tasks.v2.HttpRequest], the default is 10 - * minutes. The deadline - * must be in the interval [15 seconds, 30 minutes]. - * * For [App Engine tasks][google.cloud.tasks.v2.AppEngineHttpRequest], 0 - * indicates that the - * request has the default deadline. The default deadline depends on the - * [scaling - * type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling) - * of the service: 10 minutes for standard apps with automatic scaling, 24 - * hours for standard apps with manual and basic scaling, and 60 minutes for - * flex apps. If the request deadline is set, it must be in the interval [15 - * seconds, 24 hours 15 seconds]. Regardless of the task's - * `dispatch_deadline`, the app handler will not run for longer than than - * the service's timeout. We recommend setting the `dispatch_deadline` to - * at most a few seconds more than the app handler's timeout. For more - * information see - * [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts). - * `dispatch_deadline` will be truncated to the nearest millisecond. The - * deadline is an approximate deadline. - * @type int $dispatch_count - * Output only. The number of attempts dispatched. - * This count includes attempts which have been dispatched but haven't - * received a response. - * @type int $response_count - * Output only. The number of attempts which have received a response. - * @type \Google\Cloud\Tasks\V2\Attempt $first_attempt - * Output only. The status of the task's first attempt. - * Only [dispatch_time][google.cloud.tasks.v2.Attempt.dispatch_time] will be - * set. The other [Attempt][google.cloud.tasks.v2.Attempt] information is not - * retained by Cloud Tasks. - * @type \Google\Cloud\Tasks\V2\Attempt $last_attempt - * Output only. The status of the task's last attempt. - * @type int $view - * Output only. The view specifies which subset of the - * [Task][google.cloud.tasks.v2.Task] has been returned. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2\Task::initOnce(); - parent::__construct($data); - } - - /** - * Optionally caller-specified in - * [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask]. - * The task name. - * The task name must have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - * hyphens (-), colons (:), or periods (.). - * For more information, see - * [Identifying - * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) - * * `LOCATION_ID` is the canonical ID for the task's location. - * The list of available locations can be obtained by calling - * [ListLocations][google.cloud.location.Locations.ListLocations]. - * For more information, see https://cloud.google.com/about/locations/. - * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or - * hyphens (-). The maximum length is 100 characters. - * * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), - * hyphens (-), or underscores (_). The maximum length is 500 characters. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Optionally caller-specified in - * [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask]. - * The task name. - * The task name must have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - * hyphens (-), colons (:), or periods (.). - * For more information, see - * [Identifying - * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) - * * `LOCATION_ID` is the canonical ID for the task's location. - * The list of available locations can be obtained by calling - * [ListLocations][google.cloud.location.Locations.ListLocations]. - * For more information, see https://cloud.google.com/about/locations/. - * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or - * hyphens (-). The maximum length is 100 characters. - * * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), - * hyphens (-), or underscores (_). The maximum length is 500 characters. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * HTTP request that is sent to the App Engine app handler. - * An App Engine task is a task that has - * [AppEngineHttpRequest][google.cloud.tasks.v2.AppEngineHttpRequest] set. - * - * Generated from protobuf field .google.cloud.tasks.v2.AppEngineHttpRequest app_engine_http_request = 2; - * @return \Google\Cloud\Tasks\V2\AppEngineHttpRequest|null - */ - public function getAppEngineHttpRequest() - { - return $this->readOneof(2); - } - - public function hasAppEngineHttpRequest() - { - return $this->hasOneof(2); - } - - /** - * HTTP request that is sent to the App Engine app handler. - * An App Engine task is a task that has - * [AppEngineHttpRequest][google.cloud.tasks.v2.AppEngineHttpRequest] set. - * - * Generated from protobuf field .google.cloud.tasks.v2.AppEngineHttpRequest app_engine_http_request = 2; - * @param \Google\Cloud\Tasks\V2\AppEngineHttpRequest $var - * @return $this - */ - public function setAppEngineHttpRequest($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2\AppEngineHttpRequest::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * HTTP request that is sent to the worker. - * An HTTP task is a task that has - * [HttpRequest][google.cloud.tasks.v2.HttpRequest] set. - * - * Generated from protobuf field .google.cloud.tasks.v2.HttpRequest http_request = 3; - * @return \Google\Cloud\Tasks\V2\HttpRequest|null - */ - public function getHttpRequest() - { - return $this->readOneof(3); - } - - public function hasHttpRequest() - { - return $this->hasOneof(3); - } - - /** - * HTTP request that is sent to the worker. - * An HTTP task is a task that has - * [HttpRequest][google.cloud.tasks.v2.HttpRequest] set. - * - * Generated from protobuf field .google.cloud.tasks.v2.HttpRequest http_request = 3; - * @param \Google\Cloud\Tasks\V2\HttpRequest $var - * @return $this - */ - public function setHttpRequest($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2\HttpRequest::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * The time when the task is scheduled to be attempted or retried. - * `schedule_time` will be truncated to the nearest microsecond. - * - * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 4; - * @return \Google\Protobuf\Timestamp|null - */ - public function getScheduleTime() - { - return $this->schedule_time; - } - - public function hasScheduleTime() - { - return isset($this->schedule_time); - } - - public function clearScheduleTime() - { - unset($this->schedule_time); - } - - /** - * The time when the task is scheduled to be attempted or retried. - * `schedule_time` will be truncated to the nearest microsecond. - * - * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 4; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setScheduleTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->schedule_time = $var; - - return $this; - } - - /** - * Output only. The time that the task was created. - * `create_time` will be truncated to the nearest second. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The time that the task was created. - * `create_time` will be truncated to the nearest second. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * The deadline for requests sent to the worker. If the worker does not - * respond by this deadline then the request is cancelled and the attempt - * is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the - * task according to the [RetryConfig][google.cloud.tasks.v2.RetryConfig]. - * Note that when the request is cancelled, Cloud Tasks will stop listening - * for the response, but whether the worker stops processing depends on the - * worker. For example, if the worker is stuck, it may not react to cancelled - * requests. - * The default and maximum values depend on the type of request: - * * For [HTTP tasks][google.cloud.tasks.v2.HttpRequest], the default is 10 - * minutes. The deadline - * must be in the interval [15 seconds, 30 minutes]. - * * For [App Engine tasks][google.cloud.tasks.v2.AppEngineHttpRequest], 0 - * indicates that the - * request has the default deadline. The default deadline depends on the - * [scaling - * type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling) - * of the service: 10 minutes for standard apps with automatic scaling, 24 - * hours for standard apps with manual and basic scaling, and 60 minutes for - * flex apps. If the request deadline is set, it must be in the interval [15 - * seconds, 24 hours 15 seconds]. Regardless of the task's - * `dispatch_deadline`, the app handler will not run for longer than than - * the service's timeout. We recommend setting the `dispatch_deadline` to - * at most a few seconds more than the app handler's timeout. For more - * information see - * [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts). - * `dispatch_deadline` will be truncated to the nearest millisecond. The - * deadline is an approximate deadline. - * - * Generated from protobuf field .google.protobuf.Duration dispatch_deadline = 6; - * @return \Google\Protobuf\Duration|null - */ - public function getDispatchDeadline() - { - return $this->dispatch_deadline; - } - - public function hasDispatchDeadline() - { - return isset($this->dispatch_deadline); - } - - public function clearDispatchDeadline() - { - unset($this->dispatch_deadline); - } - - /** - * The deadline for requests sent to the worker. If the worker does not - * respond by this deadline then the request is cancelled and the attempt - * is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the - * task according to the [RetryConfig][google.cloud.tasks.v2.RetryConfig]. - * Note that when the request is cancelled, Cloud Tasks will stop listening - * for the response, but whether the worker stops processing depends on the - * worker. For example, if the worker is stuck, it may not react to cancelled - * requests. - * The default and maximum values depend on the type of request: - * * For [HTTP tasks][google.cloud.tasks.v2.HttpRequest], the default is 10 - * minutes. The deadline - * must be in the interval [15 seconds, 30 minutes]. - * * For [App Engine tasks][google.cloud.tasks.v2.AppEngineHttpRequest], 0 - * indicates that the - * request has the default deadline. The default deadline depends on the - * [scaling - * type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling) - * of the service: 10 minutes for standard apps with automatic scaling, 24 - * hours for standard apps with manual and basic scaling, and 60 minutes for - * flex apps. If the request deadline is set, it must be in the interval [15 - * seconds, 24 hours 15 seconds]. Regardless of the task's - * `dispatch_deadline`, the app handler will not run for longer than than - * the service's timeout. We recommend setting the `dispatch_deadline` to - * at most a few seconds more than the app handler's timeout. For more - * information see - * [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts). - * `dispatch_deadline` will be truncated to the nearest millisecond. The - * deadline is an approximate deadline. - * - * Generated from protobuf field .google.protobuf.Duration dispatch_deadline = 6; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setDispatchDeadline($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->dispatch_deadline = $var; - - return $this; - } - - /** - * Output only. The number of attempts dispatched. - * This count includes attempts which have been dispatched but haven't - * received a response. - * - * Generated from protobuf field int32 dispatch_count = 7; - * @return int - */ - public function getDispatchCount() - { - return $this->dispatch_count; - } - - /** - * Output only. The number of attempts dispatched. - * This count includes attempts which have been dispatched but haven't - * received a response. - * - * Generated from protobuf field int32 dispatch_count = 7; - * @param int $var - * @return $this - */ - public function setDispatchCount($var) - { - GPBUtil::checkInt32($var); - $this->dispatch_count = $var; - - return $this; - } - - /** - * Output only. The number of attempts which have received a response. - * - * Generated from protobuf field int32 response_count = 8; - * @return int - */ - public function getResponseCount() - { - return $this->response_count; - } - - /** - * Output only. The number of attempts which have received a response. - * - * Generated from protobuf field int32 response_count = 8; - * @param int $var - * @return $this - */ - public function setResponseCount($var) - { - GPBUtil::checkInt32($var); - $this->response_count = $var; - - return $this; - } - - /** - * Output only. The status of the task's first attempt. - * Only [dispatch_time][google.cloud.tasks.v2.Attempt.dispatch_time] will be - * set. The other [Attempt][google.cloud.tasks.v2.Attempt] information is not - * retained by Cloud Tasks. - * - * Generated from protobuf field .google.cloud.tasks.v2.Attempt first_attempt = 9; - * @return \Google\Cloud\Tasks\V2\Attempt|null - */ - public function getFirstAttempt() - { - return $this->first_attempt; - } - - public function hasFirstAttempt() - { - return isset($this->first_attempt); - } - - public function clearFirstAttempt() - { - unset($this->first_attempt); - } - - /** - * Output only. The status of the task's first attempt. - * Only [dispatch_time][google.cloud.tasks.v2.Attempt.dispatch_time] will be - * set. The other [Attempt][google.cloud.tasks.v2.Attempt] information is not - * retained by Cloud Tasks. - * - * Generated from protobuf field .google.cloud.tasks.v2.Attempt first_attempt = 9; - * @param \Google\Cloud\Tasks\V2\Attempt $var - * @return $this - */ - public function setFirstAttempt($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2\Attempt::class); - $this->first_attempt = $var; - - return $this; - } - - /** - * Output only. The status of the task's last attempt. - * - * Generated from protobuf field .google.cloud.tasks.v2.Attempt last_attempt = 10; - * @return \Google\Cloud\Tasks\V2\Attempt|null - */ - public function getLastAttempt() - { - return $this->last_attempt; - } - - public function hasLastAttempt() - { - return isset($this->last_attempt); - } - - public function clearLastAttempt() - { - unset($this->last_attempt); - } - - /** - * Output only. The status of the task's last attempt. - * - * Generated from protobuf field .google.cloud.tasks.v2.Attempt last_attempt = 10; - * @param \Google\Cloud\Tasks\V2\Attempt $var - * @return $this - */ - public function setLastAttempt($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2\Attempt::class); - $this->last_attempt = $var; - - return $this; - } - - /** - * Output only. The view specifies which subset of the - * [Task][google.cloud.tasks.v2.Task] has been returned. - * - * Generated from protobuf field .google.cloud.tasks.v2.Task.View view = 11; - * @return int - */ - public function getView() - { - return $this->view; - } - - /** - * Output only. The view specifies which subset of the - * [Task][google.cloud.tasks.v2.Task] has been returned. - * - * Generated from protobuf field .google.cloud.tasks.v2.Task.View view = 11; - * @param int $var - * @return $this - */ - public function setView($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2\Task\View::class); - $this->view = $var; - - return $this; - } - - /** - * @return string - */ - public function getMessageType() - { - return $this->whichOneof("message_type"); - } - -} - diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Task/View.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Task/View.php deleted file mode 100644 index 14abd3e680ee..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Task/View.php +++ /dev/null @@ -1,79 +0,0 @@ -google.cloud.tasks.v2.Task.View - */ -class View -{ - /** - * Unspecified. Defaults to BASIC. - * - * Generated from protobuf enum VIEW_UNSPECIFIED = 0; - */ - const VIEW_UNSPECIFIED = 0; - /** - * The basic view omits fields which can be large or can contain - * sensitive data. - * This view does not include the - * [body in - * AppEngineHttpRequest][google.cloud.tasks.v2.AppEngineHttpRequest.body]. - * Bodies are desirable to return only when needed, because they - * can be large and because of the sensitivity of the data that you - * choose to store in it. - * - * Generated from protobuf enum BASIC = 1; - */ - const BASIC = 1; - /** - * All information is returned. - * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the [Queue][google.cloud.tasks.v2.Queue] resource. - * - * Generated from protobuf enum FULL = 2; - */ - const FULL = 2; - - private static $valueToName = [ - self::VIEW_UNSPECIFIED => 'VIEW_UNSPECIFIED', - self::BASIC => 'BASIC', - self::FULL => 'FULL', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(View::class, \Google\Cloud\Tasks\V2\Task_View::class); - diff --git a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/UpdateQueueRequest.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/UpdateQueueRequest.php deleted file mode 100644 index 7a609a96f605..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/UpdateQueueRequest.php +++ /dev/null @@ -1,165 +0,0 @@ -google.cloud.tasks.v2.UpdateQueueRequest - */ -class UpdateQueueRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The queue to create or update. - * The queue's [name][google.cloud.tasks.v2.Queue.name] must be specified. - * Output only fields cannot be modified using UpdateQueue. - * Any value specified for an output only field will be ignored. - * The queue's [name][google.cloud.tasks.v2.Queue.name] cannot be changed. - * - * Generated from protobuf field .google.cloud.tasks.v2.Queue queue = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $queue = null; - /** - * A mask used to specify which fields of the queue are being updated. - * If empty, then all fields will be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - */ - protected $update_mask = null; - - /** - * @param \Google\Cloud\Tasks\V2\Queue $queue Required. The queue to create or update. - * - * The queue's [name][google.cloud.tasks.v2.Queue.name] must be specified. - * - * Output only fields cannot be modified using UpdateQueue. - * Any value specified for an output only field will be ignored. - * The queue's [name][google.cloud.tasks.v2.Queue.name] cannot be changed. - * @param \Google\Protobuf\FieldMask $updateMask A mask used to specify which fields of the queue are being updated. - * - * If empty, then all fields will be updated. - * - * @return \Google\Cloud\Tasks\V2\UpdateQueueRequest - * - * @experimental - */ - public static function build(\Google\Cloud\Tasks\V2\Queue $queue, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setQueue($queue) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Tasks\V2\Queue $queue - * Required. The queue to create or update. - * The queue's [name][google.cloud.tasks.v2.Queue.name] must be specified. - * Output only fields cannot be modified using UpdateQueue. - * Any value specified for an output only field will be ignored. - * The queue's [name][google.cloud.tasks.v2.Queue.name] cannot be changed. - * @type \Google\Protobuf\FieldMask $update_mask - * A mask used to specify which fields of the queue are being updated. - * If empty, then all fields will be updated. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * Required. The queue to create or update. - * The queue's [name][google.cloud.tasks.v2.Queue.name] must be specified. - * Output only fields cannot be modified using UpdateQueue. - * Any value specified for an output only field will be ignored. - * The queue's [name][google.cloud.tasks.v2.Queue.name] cannot be changed. - * - * Generated from protobuf field .google.cloud.tasks.v2.Queue queue = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Tasks\V2\Queue|null - */ - public function getQueue() - { - return $this->queue; - } - - public function hasQueue() - { - return isset($this->queue); - } - - public function clearQueue() - { - unset($this->queue); - } - - /** - * Required. The queue to create or update. - * The queue's [name][google.cloud.tasks.v2.Queue.name] must be specified. - * Output only fields cannot be modified using UpdateQueue. - * Any value specified for an output only field will be ignored. - * The queue's [name][google.cloud.tasks.v2.Queue.name] cannot be changed. - * - * Generated from protobuf field .google.cloud.tasks.v2.Queue queue = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Tasks\V2\Queue $var - * @return $this - */ - public function setQueue($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2\Queue::class); - $this->queue = $var; - - return $this; - } - - /** - * A mask used to specify which fields of the queue are being updated. - * If empty, then all fields will be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * A mask used to specify which fields of the queue are being updated. - * If empty, then all fields will be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/create_queue.php b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/create_queue.php deleted file mode 100644 index 80a4a56b620e..000000000000 --- a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/create_queue.php +++ /dev/null @@ -1,89 +0,0 @@ -setParent($formattedParent) - ->setQueue($queue); - - // Call the API and handle any network failures. - try { - /** @var Queue $response */ - $response = $cloudTasksClient->createQueue($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = CloudTasksClient::locationName('[PROJECT]', '[LOCATION]'); - - create_queue_sample($formattedParent); -} -// [END cloudtasks_v2_generated_CloudTasks_CreateQueue_sync] diff --git a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/create_task.php b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/create_task.php deleted file mode 100644 index aa2e0fce0bdb..000000000000 --- a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/create_task.php +++ /dev/null @@ -1,80 +0,0 @@ -setParent($formattedParent) - ->setTask($task); - - // Call the API and handle any network failures. - try { - /** @var Task $response */ - $response = $cloudTasksClient->createTask($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = CloudTasksClient::queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - - create_task_sample($formattedParent); -} -// [END cloudtasks_v2_generated_CloudTasks_CreateTask_sync] diff --git a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/delete_queue.php b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/delete_queue.php deleted file mode 100644 index 74fe50d44f70..000000000000 --- a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/delete_queue.php +++ /dev/null @@ -1,82 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - $cloudTasksClient->deleteQueue($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudTasksClient::queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - - delete_queue_sample($formattedName); -} -// [END cloudtasks_v2_generated_CloudTasks_DeleteQueue_sync] diff --git a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/delete_task.php b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/delete_task.php deleted file mode 100644 index b61653507f6b..000000000000 --- a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/delete_task.php +++ /dev/null @@ -1,74 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - $cloudTasksClient->deleteTask($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudTasksClient::taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - - delete_task_sample($formattedName); -} -// [END cloudtasks_v2_generated_CloudTasks_DeleteTask_sync] diff --git a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/get_iam_policy.php b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/get_iam_policy.php deleted file mode 100644 index 4dc02aa93c2a..000000000000 --- a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/get_iam_policy.php +++ /dev/null @@ -1,79 +0,0 @@ -setResource($resource); - - // Call the API and handle any network failures. - try { - /** @var Policy $response */ - $response = $cloudTasksClient->getIamPolicy($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - - get_iam_policy_sample($resource); -} -// [END cloudtasks_v2_generated_CloudTasks_GetIamPolicy_sync] diff --git a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/get_location.php b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/get_location.php deleted file mode 100644 index 195480970c8c..000000000000 --- a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/get_location.php +++ /dev/null @@ -1,57 +0,0 @@ -getLocation($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END cloudtasks_v2_generated_CloudTasks_GetLocation_sync] diff --git a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/get_queue.php b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/get_queue.php deleted file mode 100644 index 4d61129ad1a5..000000000000 --- a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/get_queue.php +++ /dev/null @@ -1,72 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Queue $response */ - $response = $cloudTasksClient->getQueue($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudTasksClient::queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - - get_queue_sample($formattedName); -} -// [END cloudtasks_v2_generated_CloudTasks_GetQueue_sync] diff --git a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/get_task.php b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/get_task.php deleted file mode 100644 index da3d8cf9ba56..000000000000 --- a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/get_task.php +++ /dev/null @@ -1,72 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Task $response */ - $response = $cloudTasksClient->getTask($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudTasksClient::taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - - get_task_sample($formattedName); -} -// [END cloudtasks_v2_generated_CloudTasks_GetTask_sync] diff --git a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/list_locations.php b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/list_locations.php deleted file mode 100644 index 469efba56cde..000000000000 --- a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/list_locations.php +++ /dev/null @@ -1,62 +0,0 @@ -listLocations($request); - - /** @var Location $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END cloudtasks_v2_generated_CloudTasks_ListLocations_sync] diff --git a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/list_queues.php b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/list_queues.php deleted file mode 100644 index c542b08e9048..000000000000 --- a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/list_queues.php +++ /dev/null @@ -1,79 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $cloudTasksClient->listQueues($request); - - /** @var Queue $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = CloudTasksClient::locationName('[PROJECT]', '[LOCATION]'); - - list_queues_sample($formattedParent); -} -// [END cloudtasks_v2_generated_CloudTasks_ListQueues_sync] diff --git a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/list_tasks.php b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/list_tasks.php deleted file mode 100644 index 860cd25ca38a..000000000000 --- a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/list_tasks.php +++ /dev/null @@ -1,85 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $cloudTasksClient->listTasks($request); - - /** @var Task $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = CloudTasksClient::queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - - list_tasks_sample($formattedParent); -} -// [END cloudtasks_v2_generated_CloudTasks_ListTasks_sync] diff --git a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/pause_queue.php b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/pause_queue.php deleted file mode 100644 index e83e2a958bd3..000000000000 --- a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/pause_queue.php +++ /dev/null @@ -1,79 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Queue $response */ - $response = $cloudTasksClient->pauseQueue($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudTasksClient::queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - - pause_queue_sample($formattedName); -} -// [END cloudtasks_v2_generated_CloudTasks_PauseQueue_sync] diff --git a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/purge_queue.php b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/purge_queue.php deleted file mode 100644 index 592b7e9758d8..000000000000 --- a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/purge_queue.php +++ /dev/null @@ -1,77 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Queue $response */ - $response = $cloudTasksClient->purgeQueue($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudTasksClient::queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - - purge_queue_sample($formattedName); -} -// [END cloudtasks_v2_generated_CloudTasks_PurgeQueue_sync] diff --git a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/resume_queue.php b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/resume_queue.php deleted file mode 100644 index 17f2fa3b1e61..000000000000 --- a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/resume_queue.php +++ /dev/null @@ -1,85 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Queue $response */ - $response = $cloudTasksClient->resumeQueue($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudTasksClient::queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - - resume_queue_sample($formattedName); -} -// [END cloudtasks_v2_generated_CloudTasks_ResumeQueue_sync] diff --git a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/run_task.php b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/run_task.php deleted file mode 100644 index 59e8bfc56383..000000000000 --- a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/run_task.php +++ /dev/null @@ -1,97 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Task $response */ - $response = $cloudTasksClient->runTask($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudTasksClient::taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - - run_task_sample($formattedName); -} -// [END cloudtasks_v2_generated_CloudTasks_RunTask_sync] diff --git a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/set_iam_policy.php b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/set_iam_policy.php deleted file mode 100644 index dcc4a9703774..000000000000 --- a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/set_iam_policy.php +++ /dev/null @@ -1,83 +0,0 @@ -setResource($resource) - ->setPolicy($policy); - - // Call the API and handle any network failures. - try { - /** @var Policy $response */ - $response = $cloudTasksClient->setIamPolicy($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - - set_iam_policy_sample($resource); -} -// [END cloudtasks_v2_generated_CloudTasks_SetIamPolicy_sync] diff --git a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/test_iam_permissions.php b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/test_iam_permissions.php deleted file mode 100644 index 9f07c46f31ae..000000000000 --- a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/test_iam_permissions.php +++ /dev/null @@ -1,85 +0,0 @@ -setResource($resource) - ->setPermissions($permissions); - - // Call the API and handle any network failures. - try { - /** @var TestIamPermissionsResponse $response */ - $response = $cloudTasksClient->testIamPermissions($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - $permissionsElement = '[PERMISSIONS]'; - - test_iam_permissions_sample($resource, $permissionsElement); -} -// [END cloudtasks_v2_generated_CloudTasks_TestIamPermissions_sync] diff --git a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/update_queue.php b/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/update_queue.php deleted file mode 100644 index 0fb29ecda689..000000000000 --- a/owl-bot-staging/Tasks/v2/samples/V2/CloudTasksClient/update_queue.php +++ /dev/null @@ -1,73 +0,0 @@ -setQueue($queue); - - // Call the API and handle any network failures. - try { - /** @var Queue $response */ - $response = $cloudTasksClient->updateQueue($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END cloudtasks_v2_generated_CloudTasks_UpdateQueue_sync] diff --git a/owl-bot-staging/Tasks/v2/src/V2/Client/CloudTasksClient.php b/owl-bot-staging/Tasks/v2/src/V2/Client/CloudTasksClient.php deleted file mode 100644 index 33e5b6ace4d6..000000000000 --- a/owl-bot-staging/Tasks/v2/src/V2/Client/CloudTasksClient.php +++ /dev/null @@ -1,887 +0,0 @@ - self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/cloud_tasks_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/cloud_tasks_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/cloud_tasks_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/cloud_tasks_rest_client_config.php', - ], - ], - ]; - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName(string $project, string $location): string - { - return self::getPathTemplate('location')->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a queue - * resource. - * - * @param string $project - * @param string $location - * @param string $queue - * - * @return string The formatted queue resource. - */ - public static function queueName(string $project, string $location, string $queue): string - { - return self::getPathTemplate('queue')->render([ - 'project' => $project, - 'location' => $location, - 'queue' => $queue, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a task - * resource. - * - * @param string $project - * @param string $location - * @param string $queue - * @param string $task - * - * @return string The formatted task resource. - */ - public static function taskName(string $project, string $location, string $queue, string $task): string - { - return self::getPathTemplate('task')->render([ - 'project' => $project, - 'location' => $location, - 'queue' => $queue, - 'task' => $task, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - location: projects/{project}/locations/{location} - * - queue: projects/{project}/locations/{location}/queues/{queue} - * - task: projects/{project}/locations/{location}/queues/{queue}/tasks/{task} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName(string $formattedName, string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'cloudtasks.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Creates a queue. - * - * Queues created with this method allow tasks to live for a maximum of 31 - * days. After a task is 31 days old, the task will be deleted regardless of - * whether it was dispatched or not. - * - * WARNING: Using this method may have unintended side effects if you are - * using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - * Read - * [Overview of Queue Management and - * queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - * this method. - * - * The async variant is {@see CloudTasksClient::createQueueAsync()} . - * - * @example samples/V2/CloudTasksClient/create_queue.php - * - * @param CreateQueueRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Queue - * - * @throws ApiException Thrown if the API call fails. - */ - public function createQueue(CreateQueueRequest $request, array $callOptions = []): Queue - { - return $this->startApiCall('CreateQueue', $request, $callOptions)->wait(); - } - - /** - * Creates a task and adds it to a queue. - * - * Tasks cannot be updated after creation; there is no UpdateTask command. - * - * * The maximum task size is 100KB. - * - * The async variant is {@see CloudTasksClient::createTaskAsync()} . - * - * @example samples/V2/CloudTasksClient/create_task.php - * - * @param CreateTaskRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Task - * - * @throws ApiException Thrown if the API call fails. - */ - public function createTask(CreateTaskRequest $request, array $callOptions = []): Task - { - return $this->startApiCall('CreateTask', $request, $callOptions)->wait(); - } - - /** - * Deletes a queue. - * - * This command will delete the queue even if it has tasks in it. - * - * Note: If you delete a queue, a queue with the same name can't be created - * for 7 days. - * - * WARNING: Using this method may have unintended side effects if you are - * using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - * Read - * [Overview of Queue Management and - * queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - * this method. - * - * The async variant is {@see CloudTasksClient::deleteQueueAsync()} . - * - * @example samples/V2/CloudTasksClient/delete_queue.php - * - * @param DeleteQueueRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteQueue(DeleteQueueRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteQueue', $request, $callOptions)->wait(); - } - - /** - * Deletes a task. - * - * A task can be deleted if it is scheduled or dispatched. A task - * cannot be deleted if it has executed successfully or permanently - * failed. - * - * The async variant is {@see CloudTasksClient::deleteTaskAsync()} . - * - * @example samples/V2/CloudTasksClient/delete_task.php - * - * @param DeleteTaskRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteTask(DeleteTaskRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteTask', $request, $callOptions)->wait(); - } - - /** - * Gets the access control policy for a [Queue][google.cloud.tasks.v2.Queue]. - * Returns an empty policy if the resource exists and does not have a policy - * set. - * - * Authorization requires the following - * [Google IAM](https://cloud.google.com/iam) permission on the specified - * resource parent: - * - * * `cloudtasks.queues.getIamPolicy` - * - * The async variant is {@see CloudTasksClient::getIamPolicyAsync()} . - * - * @example samples/V2/CloudTasksClient/get_iam_policy.php - * - * @param GetIamPolicyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Policy - * - * @throws ApiException Thrown if the API call fails. - */ - public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy - { - return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); - } - - /** - * Gets a queue. - * - * The async variant is {@see CloudTasksClient::getQueueAsync()} . - * - * @example samples/V2/CloudTasksClient/get_queue.php - * - * @param GetQueueRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Queue - * - * @throws ApiException Thrown if the API call fails. - */ - public function getQueue(GetQueueRequest $request, array $callOptions = []): Queue - { - return $this->startApiCall('GetQueue', $request, $callOptions)->wait(); - } - - /** - * Gets a task. - * - * The async variant is {@see CloudTasksClient::getTaskAsync()} . - * - * @example samples/V2/CloudTasksClient/get_task.php - * - * @param GetTaskRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Task - * - * @throws ApiException Thrown if the API call fails. - */ - public function getTask(GetTaskRequest $request, array $callOptions = []): Task - { - return $this->startApiCall('GetTask', $request, $callOptions)->wait(); - } - - /** - * Lists queues. - * - * Queues are returned in lexicographical order. - * - * The async variant is {@see CloudTasksClient::listQueuesAsync()} . - * - * @example samples/V2/CloudTasksClient/list_queues.php - * - * @param ListQueuesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listQueues(ListQueuesRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListQueues', $request, $callOptions); - } - - /** - * Lists the tasks in a queue. - * - * By default, only the [BASIC][google.cloud.tasks.v2.Task.View.BASIC] view is - * retrieved due to performance considerations; - * [response_view][google.cloud.tasks.v2.ListTasksRequest.response_view] - * controls the subset of information which is returned. - * - * The tasks may be returned in any order. The ordering may change at any - * time. - * - * The async variant is {@see CloudTasksClient::listTasksAsync()} . - * - * @example samples/V2/CloudTasksClient/list_tasks.php - * - * @param ListTasksRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listTasks(ListTasksRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListTasks', $request, $callOptions); - } - - /** - * Pauses the queue. - * - * If a queue is paused then the system will stop dispatching tasks - * until the queue is resumed via - * [ResumeQueue][google.cloud.tasks.v2.CloudTasks.ResumeQueue]. Tasks can - * still be added when the queue is paused. A queue is paused if its - * [state][google.cloud.tasks.v2.Queue.state] is - * [PAUSED][google.cloud.tasks.v2.Queue.State.PAUSED]. - * - * The async variant is {@see CloudTasksClient::pauseQueueAsync()} . - * - * @example samples/V2/CloudTasksClient/pause_queue.php - * - * @param PauseQueueRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Queue - * - * @throws ApiException Thrown if the API call fails. - */ - public function pauseQueue(PauseQueueRequest $request, array $callOptions = []): Queue - { - return $this->startApiCall('PauseQueue', $request, $callOptions)->wait(); - } - - /** - * Purges a queue by deleting all of its tasks. - * - * All tasks created before this method is called are permanently deleted. - * - * Purge operations can take up to one minute to take effect. Tasks - * might be dispatched before the purge takes effect. A purge is irreversible. - * - * The async variant is {@see CloudTasksClient::purgeQueueAsync()} . - * - * @example samples/V2/CloudTasksClient/purge_queue.php - * - * @param PurgeQueueRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Queue - * - * @throws ApiException Thrown if the API call fails. - */ - public function purgeQueue(PurgeQueueRequest $request, array $callOptions = []): Queue - { - return $this->startApiCall('PurgeQueue', $request, $callOptions)->wait(); - } - - /** - * Resume a queue. - * - * This method resumes a queue after it has been - * [PAUSED][google.cloud.tasks.v2.Queue.State.PAUSED] or - * [DISABLED][google.cloud.tasks.v2.Queue.State.DISABLED]. The state of a - * queue is stored in the queue's [state][google.cloud.tasks.v2.Queue.state]; - * after calling this method it will be set to - * [RUNNING][google.cloud.tasks.v2.Queue.State.RUNNING]. - * - * WARNING: Resuming many high-QPS queues at the same time can - * lead to target overloading. If you are resuming high-QPS - * queues, follow the 500/50/5 pattern described in - * [Managing Cloud Tasks Scaling - * Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling). - * - * The async variant is {@see CloudTasksClient::resumeQueueAsync()} . - * - * @example samples/V2/CloudTasksClient/resume_queue.php - * - * @param ResumeQueueRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Queue - * - * @throws ApiException Thrown if the API call fails. - */ - public function resumeQueue(ResumeQueueRequest $request, array $callOptions = []): Queue - { - return $this->startApiCall('ResumeQueue', $request, $callOptions)->wait(); - } - - /** - * Forces a task to run now. - * - * When this method is called, Cloud Tasks will dispatch the task, even if - * the task is already running, the queue has reached its - * [RateLimits][google.cloud.tasks.v2.RateLimits] or is - * [PAUSED][google.cloud.tasks.v2.Queue.State.PAUSED]. - * - * This command is meant to be used for manual debugging. For - * example, [RunTask][google.cloud.tasks.v2.CloudTasks.RunTask] can be used to - * retry a failed task after a fix has been made or to manually force a task - * to be dispatched now. - * - * The dispatched task is returned. That is, the task that is returned - * contains the [status][Task.status] after the task is dispatched but - * before the task is received by its target. - * - * If Cloud Tasks receives a successful response from the task's - * target, then the task will be deleted; otherwise the task's - * [schedule_time][google.cloud.tasks.v2.Task.schedule_time] will be reset to - * the time that [RunTask][google.cloud.tasks.v2.CloudTasks.RunTask] was - * called plus the retry delay specified in the queue's - * [RetryConfig][google.cloud.tasks.v2.RetryConfig]. - * - * [RunTask][google.cloud.tasks.v2.CloudTasks.RunTask] returns - * [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a - * task that has already succeeded or permanently failed. - * - * The async variant is {@see CloudTasksClient::runTaskAsync()} . - * - * @example samples/V2/CloudTasksClient/run_task.php - * - * @param RunTaskRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Task - * - * @throws ApiException Thrown if the API call fails. - */ - public function runTask(RunTaskRequest $request, array $callOptions = []): Task - { - return $this->startApiCall('RunTask', $request, $callOptions)->wait(); - } - - /** - * Sets the access control policy for a [Queue][google.cloud.tasks.v2.Queue]. - * Replaces any existing policy. - * - * Note: The Cloud Console does not check queue-level IAM permissions yet. - * Project-level permissions are required to use the Cloud Console. - * - * Authorization requires the following - * [Google IAM](https://cloud.google.com/iam) permission on the specified - * resource parent: - * - * * `cloudtasks.queues.setIamPolicy` - * - * The async variant is {@see CloudTasksClient::setIamPolicyAsync()} . - * - * @example samples/V2/CloudTasksClient/set_iam_policy.php - * - * @param SetIamPolicyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Policy - * - * @throws ApiException Thrown if the API call fails. - */ - public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy - { - return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); - } - - /** - * Returns permissions that a caller has on a - * [Queue][google.cloud.tasks.v2.Queue]. If the resource does not exist, this - * will return an empty set of permissions, not a - * [NOT_FOUND][google.rpc.Code.NOT_FOUND] error. - * - * Note: This operation is designed to be used for building permission-aware - * UIs and command-line tools, not for authorization checking. This operation - * may "fail open" without warning. - * - * The async variant is {@see CloudTasksClient::testIamPermissionsAsync()} . - * - * @example samples/V2/CloudTasksClient/test_iam_permissions.php - * - * @param TestIamPermissionsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return TestIamPermissionsResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { - return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); - } - - /** - * Updates a queue. - * - * This method creates the queue if it does not exist and updates - * the queue if it does exist. - * - * Queues created with this method allow tasks to live for a maximum of 31 - * days. After a task is 31 days old, the task will be deleted regardless of - * whether it was dispatched or not. - * - * WARNING: Using this method may have unintended side effects if you are - * using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - * Read - * [Overview of Queue Management and - * queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - * this method. - * - * The async variant is {@see CloudTasksClient::updateQueueAsync()} . - * - * @example samples/V2/CloudTasksClient/update_queue.php - * - * @param UpdateQueueRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Queue - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateQueue(UpdateQueueRequest $request, array $callOptions = []): Queue - { - return $this->startApiCall('UpdateQueue', $request, $callOptions)->wait(); - } - - /** - * Gets information about a location. - * - * The async variant is {@see CloudTasksClient::getLocationAsync()} . - * - * @example samples/V2/CloudTasksClient/get_location.php - * - * @param GetLocationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Location - * - * @throws ApiException Thrown if the API call fails. - */ - public function getLocation(GetLocationRequest $request, array $callOptions = []): Location - { - return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * The async variant is {@see CloudTasksClient::listLocationsAsync()} . - * - * @example samples/V2/CloudTasksClient/list_locations.php - * - * @param ListLocationsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListLocations', $request, $callOptions); - } -} diff --git a/owl-bot-staging/Tasks/v2/src/V2/CloudTasksClient.php b/owl-bot-staging/Tasks/v2/src/V2/CloudTasksClient.php deleted file mode 100644 index e34ca4466502..000000000000 --- a/owl-bot-staging/Tasks/v2/src/V2/CloudTasksClient.php +++ /dev/null @@ -1,34 +0,0 @@ -locationName('[PROJECT]', '[LOCATION]'); - * $queue = new Queue(); - * $response = $cloudTasksClient->createQueue($formattedParent, $queue); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Tasks\V2\Client\CloudTasksClient}. - */ -class CloudTasksGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.tasks.v2.CloudTasks'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'cloudtasks.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'cloudtasks.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $locationNameTemplate; - - private static $queueNameTemplate; - - private static $taskNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/cloud_tasks_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/cloud_tasks_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/cloud_tasks_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/cloud_tasks_rest_client_config.php', - ], - ], - ]; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getQueueNameTemplate() - { - if (self::$queueNameTemplate == null) { - self::$queueNameTemplate = new PathTemplate('projects/{project}/locations/{location}/queues/{queue}'); - } - - return self::$queueNameTemplate; - } - - private static function getTaskNameTemplate() - { - if (self::$taskNameTemplate == null) { - self::$taskNameTemplate = new PathTemplate('projects/{project}/locations/{location}/queues/{queue}/tasks/{task}'); - } - - return self::$taskNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'location' => self::getLocationNameTemplate(), - 'queue' => self::getQueueNameTemplate(), - 'task' => self::getTaskNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a queue - * resource. - * - * @param string $project - * @param string $location - * @param string $queue - * - * @return string The formatted queue resource. - */ - public static function queueName($project, $location, $queue) - { - return self::getQueueNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'queue' => $queue, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a task - * resource. - * - * @param string $project - * @param string $location - * @param string $queue - * @param string $task - * - * @return string The formatted task resource. - */ - public static function taskName($project, $location, $queue, $task) - { - return self::getTaskNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'queue' => $queue, - 'task' => $task, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - location: projects/{project}/locations/{location} - * - queue: projects/{project}/locations/{location}/queues/{queue} - * - task: projects/{project}/locations/{location}/queues/{queue}/tasks/{task} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'cloudtasks.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Creates a queue. - * - * Queues created with this method allow tasks to live for a maximum of 31 - * days. After a task is 31 days old, the task will be deleted regardless of - * whether it was dispatched or not. - * - * WARNING: Using this method may have unintended side effects if you are - * using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - * Read - * [Overview of Queue Management and - * queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - * this method. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $formattedParent = $cloudTasksClient->locationName('[PROJECT]', '[LOCATION]'); - * $queue = new Queue(); - * $response = $cloudTasksClient->createQueue($formattedParent, $queue); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $parent Required. The location name in which the queue will be created. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * - * The list of allowed locations can be obtained by calling Cloud - * Tasks' implementation of - * [ListLocations][google.cloud.location.Locations.ListLocations]. - * @param Queue $queue Required. The queue to create. - * - * [Queue's name][google.cloud.tasks.v2.Queue.name] cannot be the same as an - * existing queue. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Tasks\V2\Queue - * - * @throws ApiException if the remote call fails - */ - public function createQueue($parent, $queue, array $optionalArgs = []) - { - $request = new CreateQueueRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setQueue($queue); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateQueue', Queue::class, $optionalArgs, $request)->wait(); - } - - /** - * Creates a task and adds it to a queue. - * - * Tasks cannot be updated after creation; there is no UpdateTask command. - * - * * The maximum task size is 100KB. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $formattedParent = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - * $task = new Task(); - * $response = $cloudTasksClient->createTask($formattedParent, $task); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $parent Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * - * The queue must already exist. - * @param Task $task Required. The task to add. - * - * Task names have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. - * The user can optionally specify a task - * [name][google.cloud.tasks.v2.Task.name]. If a name is not specified then - * the system will generate a random unique task id, which will be set in the - * task returned in the [response][google.cloud.tasks.v2.Task.name]. - * - * If [schedule_time][google.cloud.tasks.v2.Task.schedule_time] is not set or - * is in the past then Cloud Tasks will set it to the current time. - * - * Task De-duplication: - * - * Explicitly specifying a task ID enables task de-duplication. If - * a task's ID is identical to that of an existing task or a task - * that was deleted or executed recently then the call will fail - * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. - * If the task's queue was created using Cloud Tasks, then another task with - * the same name can't be created for ~1hour after the original task was - * deleted or executed. If the task's queue was created using queue.yaml or - * queue.xml, then another task with the same name can't be created - * for ~9days after the original task was deleted or executed. - * - * Because there is an extra lookup cost to identify duplicate task - * names, these [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask] - * calls have significantly increased latency. Using hashed strings for the - * task id or for the prefix of the task id is recommended. Choosing task ids - * that are sequential or have sequential prefixes, for example using a - * timestamp, causes an increase in latency and error rates in all - * task commands. The infrastructure relies on an approximately - * uniform distribution of task ids to store and serve tasks - * efficiently. - * @param array $optionalArgs { - * Optional. - * - * @type int $responseView - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2.Task] will be returned. - * - * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; - * not all information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * - * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the [Task][google.cloud.tasks.v2.Task] resource. - * For allowed values, use constants defined on {@see \Google\Cloud\Tasks\V2\Task\View} - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Tasks\V2\Task - * - * @throws ApiException if the remote call fails - */ - public function createTask($parent, $task, array $optionalArgs = []) - { - $request = new CreateTaskRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setTask($task); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['responseView'])) { - $request->setResponseView($optionalArgs['responseView']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateTask', Task::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes a queue. - * - * This command will delete the queue even if it has tasks in it. - * - * Note: If you delete a queue, a queue with the same name can't be created - * for 7 days. - * - * WARNING: Using this method may have unintended side effects if you are - * using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - * Read - * [Overview of Queue Management and - * queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - * this method. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - * $cloudTasksClient->deleteQueue($formattedName); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $name Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function deleteQueue($name, array $optionalArgs = []) - { - $request = new DeleteQueueRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteQueue', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes a task. - * - * A task can be deleted if it is scheduled or dispatched. A task - * cannot be deleted if it has executed successfully or permanently - * failed. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $formattedName = $cloudTasksClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - * $cloudTasksClient->deleteTask($formattedName); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $name Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function deleteTask($name, array $optionalArgs = []) - { - $request = new DeleteTaskRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteTask', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets the access control policy for a [Queue][google.cloud.tasks.v2.Queue]. - * Returns an empty policy if the resource exists and does not have a policy - * set. - * - * Authorization requires the following - * [Google IAM](https://cloud.google.com/iam) permission on the specified - * resource parent: - * - * * `cloudtasks.queues.getIamPolicy` - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $resource = 'resource'; - * $response = $cloudTasksClient->getIamPolicy($resource); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets a queue. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - * $response = $cloudTasksClient->getQueue($formattedName); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the queue. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Tasks\V2\Queue - * - * @throws ApiException if the remote call fails - */ - public function getQueue($name, array $optionalArgs = []) - { - $request = new GetQueueRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetQueue', Queue::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets a task. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $formattedName = $cloudTasksClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - * $response = $cloudTasksClient->getTask($formattedName); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $name Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * @param array $optionalArgs { - * Optional. - * - * @type int $responseView - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2.Task] will be returned. - * - * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; - * not all information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * - * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the [Task][google.cloud.tasks.v2.Task] resource. - * For allowed values, use constants defined on {@see \Google\Cloud\Tasks\V2\Task\View} - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Tasks\V2\Task - * - * @throws ApiException if the remote call fails - */ - public function getTask($name, array $optionalArgs = []) - { - $request = new GetTaskRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['responseView'])) { - $request->setResponseView($optionalArgs['responseView']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetTask', Task::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists queues. - * - * Queues are returned in lexicographical order. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $formattedParent = $cloudTasksClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $cloudTasksClient->listQueues($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $cloudTasksClient->listQueues($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $parent Required. The location name. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * `filter` can be used to specify a subset of queues. Any - * [Queue][google.cloud.tasks.v2.Queue] field can be used as a filter and - * several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The - * filter syntax is the same as described in [Stackdriver's Advanced Logs - * Filters](https://cloud.google.com/logging/docs/view/advanced_filters). - * - * Sample filter "state: PAUSED". - * - * Note that using filters might cause fewer queues than the - * requested page_size to be returned. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listQueues($parent, array $optionalArgs = []) - { - $request = new ListQueuesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListQueues', $optionalArgs, ListQueuesResponse::class, $request); - } - - /** - * Lists the tasks in a queue. - * - * By default, only the [BASIC][google.cloud.tasks.v2.Task.View.BASIC] view is - * retrieved due to performance considerations; - * [response_view][google.cloud.tasks.v2.ListTasksRequest.response_view] - * controls the subset of information which is returned. - * - * The tasks may be returned in any order. The ordering may change at any - * time. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $formattedParent = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - * // Iterate over pages of elements - * $pagedResponse = $cloudTasksClient->listTasks($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $cloudTasksClient->listTasks($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $parent Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * @param array $optionalArgs { - * Optional. - * - * @type int $responseView - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2.Task] will be returned. - * - * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; - * not all information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * - * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the [Task][google.cloud.tasks.v2.Task] resource. - * For allowed values, use constants defined on {@see \Google\Cloud\Tasks\V2\Task\View} - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listTasks($parent, array $optionalArgs = []) - { - $request = new ListTasksRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['responseView'])) { - $request->setResponseView($optionalArgs['responseView']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListTasks', $optionalArgs, ListTasksResponse::class, $request); - } - - /** - * Pauses the queue. - * - * If a queue is paused then the system will stop dispatching tasks - * until the queue is resumed via - * [ResumeQueue][google.cloud.tasks.v2.CloudTasks.ResumeQueue]. Tasks can - * still be added when the queue is paused. A queue is paused if its - * [state][google.cloud.tasks.v2.Queue.state] is - * [PAUSED][google.cloud.tasks.v2.Queue.State.PAUSED]. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - * $response = $cloudTasksClient->pauseQueue($formattedName); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $name Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Tasks\V2\Queue - * - * @throws ApiException if the remote call fails - */ - public function pauseQueue($name, array $optionalArgs = []) - { - $request = new PauseQueueRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('PauseQueue', Queue::class, $optionalArgs, $request)->wait(); - } - - /** - * Purges a queue by deleting all of its tasks. - * - * All tasks created before this method is called are permanently deleted. - * - * Purge operations can take up to one minute to take effect. Tasks - * might be dispatched before the purge takes effect. A purge is irreversible. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - * $response = $cloudTasksClient->purgeQueue($formattedName); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $name Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Tasks\V2\Queue - * - * @throws ApiException if the remote call fails - */ - public function purgeQueue($name, array $optionalArgs = []) - { - $request = new PurgeQueueRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('PurgeQueue', Queue::class, $optionalArgs, $request)->wait(); - } - - /** - * Resume a queue. - * - * This method resumes a queue after it has been - * [PAUSED][google.cloud.tasks.v2.Queue.State.PAUSED] or - * [DISABLED][google.cloud.tasks.v2.Queue.State.DISABLED]. The state of a - * queue is stored in the queue's [state][google.cloud.tasks.v2.Queue.state]; - * after calling this method it will be set to - * [RUNNING][google.cloud.tasks.v2.Queue.State.RUNNING]. - * - * WARNING: Resuming many high-QPS queues at the same time can - * lead to target overloading. If you are resuming high-QPS - * queues, follow the 500/50/5 pattern described in - * [Managing Cloud Tasks Scaling - * Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling). - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - * $response = $cloudTasksClient->resumeQueue($formattedName); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $name Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Tasks\V2\Queue - * - * @throws ApiException if the remote call fails - */ - public function resumeQueue($name, array $optionalArgs = []) - { - $request = new ResumeQueueRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('ResumeQueue', Queue::class, $optionalArgs, $request)->wait(); - } - - /** - * Forces a task to run now. - * - * When this method is called, Cloud Tasks will dispatch the task, even if - * the task is already running, the queue has reached its - * [RateLimits][google.cloud.tasks.v2.RateLimits] or is - * [PAUSED][google.cloud.tasks.v2.Queue.State.PAUSED]. - * - * This command is meant to be used for manual debugging. For - * example, [RunTask][google.cloud.tasks.v2.CloudTasks.RunTask] can be used to - * retry a failed task after a fix has been made or to manually force a task - * to be dispatched now. - * - * The dispatched task is returned. That is, the task that is returned - * contains the [status][Task.status] after the task is dispatched but - * before the task is received by its target. - * - * If Cloud Tasks receives a successful response from the task's - * target, then the task will be deleted; otherwise the task's - * [schedule_time][google.cloud.tasks.v2.Task.schedule_time] will be reset to - * the time that [RunTask][google.cloud.tasks.v2.CloudTasks.RunTask] was - * called plus the retry delay specified in the queue's - * [RetryConfig][google.cloud.tasks.v2.RetryConfig]. - * - * [RunTask][google.cloud.tasks.v2.CloudTasks.RunTask] returns - * [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a - * task that has already succeeded or permanently failed. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $formattedName = $cloudTasksClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - * $response = $cloudTasksClient->runTask($formattedName); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $name Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * @param array $optionalArgs { - * Optional. - * - * @type int $responseView - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2.Task] will be returned. - * - * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; - * not all information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * - * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the [Task][google.cloud.tasks.v2.Task] resource. - * For allowed values, use constants defined on {@see \Google\Cloud\Tasks\V2\Task\View} - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Tasks\V2\Task - * - * @throws ApiException if the remote call fails - */ - public function runTask($name, array $optionalArgs = []) - { - $request = new RunTaskRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['responseView'])) { - $request->setResponseView($optionalArgs['responseView']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('RunTask', Task::class, $optionalArgs, $request)->wait(); - } - - /** - * Sets the access control policy for a [Queue][google.cloud.tasks.v2.Queue]. - * Replaces any existing policy. - * - * Note: The Cloud Console does not check queue-level IAM permissions yet. - * Project-level permissions are required to use the Cloud Console. - * - * Authorization requires the following - * [Google IAM](https://cloud.google.com/iam) permission on the specified - * resource parent: - * - * * `cloudtasks.queues.setIamPolicy` - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $cloudTasksClient->setIamPolicy($resource, $policy); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); - } - - /** - * Returns permissions that a caller has on a - * [Queue][google.cloud.tasks.v2.Queue]. If the resource does not exist, this - * will return an empty set of permissions, not a - * [NOT_FOUND][google.rpc.Code.NOT_FOUND] error. - * - * Note: This operation is designed to be used for building permission-aware - * UIs and command-line tools, not for authorization checking. This operation - * may "fail open" without warning. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $cloudTasksClient->testIamPermissions($resource, $permissions); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - public function testIamPermissions($resource, $permissions, array $optionalArgs = []) - { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('TestIamPermissions', TestIamPermissionsResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Updates a queue. - * - * This method creates the queue if it does not exist and updates - * the queue if it does exist. - * - * Queues created with this method allow tasks to live for a maximum of 31 - * days. After a task is 31 days old, the task will be deleted regardless of - * whether it was dispatched or not. - * - * WARNING: Using this method may have unintended side effects if you are - * using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - * Read - * [Overview of Queue Management and - * queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - * this method. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $queue = new Queue(); - * $response = $cloudTasksClient->updateQueue($queue); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param Queue $queue Required. The queue to create or update. - * - * The queue's [name][google.cloud.tasks.v2.Queue.name] must be specified. - * - * Output only fields cannot be modified using UpdateQueue. - * Any value specified for an output only field will be ignored. - * The queue's [name][google.cloud.tasks.v2.Queue.name] cannot be changed. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * A mask used to specify which fields of the queue are being updated. - * - * If empty, then all fields will be updated. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Tasks\V2\Queue - * - * @throws ApiException if the remote call fails - */ - public function updateQueue($queue, array $optionalArgs = []) - { - $request = new UpdateQueueRequest(); - $requestParamHeaders = []; - $request->setQueue($queue); - $requestParamHeaders['queue.name'] = $queue->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateQueue', Queue::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $response = $cloudTasksClient->getLocation(); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $cloudTasksClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $cloudTasksClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); - } -} diff --git a/owl-bot-staging/Tasks/v2/src/V2/gapic_metadata.json b/owl-bot-staging/Tasks/v2/src/V2/gapic_metadata.json deleted file mode 100644 index 1081b788279a..000000000000 --- a/owl-bot-staging/Tasks/v2/src/V2/gapic_metadata.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.cloud.tasks.v2", - "libraryPackage": "Google\\Cloud\\Tasks\\V2", - "services": { - "CloudTasks": { - "clients": { - "grpc": { - "libraryClient": "CloudTasksGapicClient", - "rpcs": { - "CreateQueue": { - "methods": [ - "createQueue" - ] - }, - "CreateTask": { - "methods": [ - "createTask" - ] - }, - "DeleteQueue": { - "methods": [ - "deleteQueue" - ] - }, - "DeleteTask": { - "methods": [ - "deleteTask" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "GetQueue": { - "methods": [ - "getQueue" - ] - }, - "GetTask": { - "methods": [ - "getTask" - ] - }, - "ListQueues": { - "methods": [ - "listQueues" - ] - }, - "ListTasks": { - "methods": [ - "listTasks" - ] - }, - "PauseQueue": { - "methods": [ - "pauseQueue" - ] - }, - "PurgeQueue": { - "methods": [ - "purgeQueue" - ] - }, - "ResumeQueue": { - "methods": [ - "resumeQueue" - ] - }, - "RunTask": { - "methods": [ - "runTask" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - }, - "UpdateQueue": { - "methods": [ - "updateQueue" - ] - }, - "GetLocation": { - "methods": [ - "getLocation" - ] - }, - "ListLocations": { - "methods": [ - "listLocations" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/Tasks/v2/src/V2/resources/cloud_tasks_client_config.json b/owl-bot-staging/Tasks/v2/src/V2/resources/cloud_tasks_client_config.json deleted file mode 100644 index 8f9b26e3639f..000000000000 --- a/owl-bot-staging/Tasks/v2/src/V2/resources/cloud_tasks_client_config.json +++ /dev/null @@ -1,135 +0,0 @@ -{ - "interfaces": { - "google.cloud.tasks.v2.CloudTasks": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "no_retry_1_codes": [] - }, - "retry_params": { - "no_retry_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 0, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 0, - "total_timeout_millis": 0 - }, - "retry_policy_1_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 10000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 20000 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 20000 - } - }, - "methods": { - "CreateQueue": { - "timeout_millis": 20000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "CreateTask": { - "timeout_millis": 20000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteQueue": { - "timeout_millis": 20000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "DeleteTask": { - "timeout_millis": 20000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetIamPolicy": { - "timeout_millis": 20000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetQueue": { - "timeout_millis": 20000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetTask": { - "timeout_millis": 20000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListQueues": { - "timeout_millis": 20000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListTasks": { - "timeout_millis": 20000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "PauseQueue": { - "timeout_millis": 20000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "PurgeQueue": { - "timeout_millis": 20000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "ResumeQueue": { - "timeout_millis": 20000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "RunTask": { - "timeout_millis": 20000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "SetIamPolicy": { - "timeout_millis": 20000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "TestIamPermissions": { - "timeout_millis": 20000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "UpdateQueue": { - "timeout_millis": 20000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GetLocation": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListLocations": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - } - } - } - } -} diff --git a/owl-bot-staging/Tasks/v2/src/V2/resources/cloud_tasks_descriptor_config.php b/owl-bot-staging/Tasks/v2/src/V2/resources/cloud_tasks_descriptor_config.php deleted file mode 100644 index 56a0adfd3e31..000000000000 --- a/owl-bot-staging/Tasks/v2/src/V2/resources/cloud_tasks_descriptor_config.php +++ /dev/null @@ -1,256 +0,0 @@ - [ - 'google.cloud.tasks.v2.CloudTasks' => [ - 'CreateQueue' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Tasks\V2\Queue', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'CreateTask' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Tasks\V2\Task', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteQueue' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'DeleteTask' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetIamPolicy' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\Policy', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - ], - 'GetQueue' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Tasks\V2\Queue', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetTask' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Tasks\V2\Task', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListQueues' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getQueues', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Tasks\V2\ListQueuesResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'ListTasks' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getTasks', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Tasks\V2\ListTasksResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'PauseQueue' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Tasks\V2\Queue', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'PurgeQueue' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Tasks\V2\Queue', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ResumeQueue' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Tasks\V2\Queue', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'RunTask' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Tasks\V2\Task', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'SetIamPolicy' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\Policy', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', - 'headerParams' => [ - [ - 'keyName' => 'resource', - 'fieldAccessors' => [ - 'getResource', - ], - ], - ], - ], - 'UpdateQueue' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Tasks\V2\Queue', - 'headerParams' => [ - [ - 'keyName' => 'queue.name', - 'fieldAccessors' => [ - 'getQueue', - 'getName', - ], - ], - ], - ], - 'GetLocation' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Location\Location', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'ListLocations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getLocations', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'templateMap' => [ - 'location' => 'projects/{project}/locations/{location}', - 'queue' => 'projects/{project}/locations/{location}/queues/{queue}', - 'task' => 'projects/{project}/locations/{location}/queues/{queue}/tasks/{task}', - ], - ], - ], -]; diff --git a/owl-bot-staging/Tasks/v2/src/V2/resources/cloud_tasks_rest_client_config.php b/owl-bot-staging/Tasks/v2/src/V2/resources/cloud_tasks_rest_client_config.php deleted file mode 100644 index 88db041fc255..000000000000 --- a/owl-bot-staging/Tasks/v2/src/V2/resources/cloud_tasks_rest_client_config.php +++ /dev/null @@ -1,220 +0,0 @@ - [ - 'google.cloud.location.Locations' => [ - 'GetLocation' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListLocations' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*}/locations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.cloud.tasks.v2.CloudTasks' => [ - 'CreateQueue' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/queues', - 'body' => 'queue', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'CreateTask' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*/queues/*}/tasks', - 'body' => '*', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteQueue' => [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/queues/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteTask' => [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/queues/*/tasks/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{resource=projects/*/locations/*/queues/*}:getIamPolicy', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'GetQueue' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/queues/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetTask' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/queues/*/tasks/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListQueues' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/queues', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListTasks' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*/queues/*}/tasks', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'PauseQueue' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/queues/*}:pause', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'PurgeQueue' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/queues/*}:purge', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ResumeQueue' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/queues/*}:resume', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'RunTask' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/queues/*/tasks/*}:run', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'SetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{resource=projects/*/locations/*/queues/*}:setIamPolicy', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{resource=projects/*/locations/*/queues/*}:testIamPermissions', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'UpdateQueue' => [ - 'method' => 'patch', - 'uriTemplate' => '/v2/{queue.name=projects/*/locations/*/queues/*}', - 'body' => 'queue', - 'placeholders' => [ - 'queue.name' => [ - 'getters' => [ - 'getQueue', - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Tasks/v2/tests/Unit/V2/Client/CloudTasksClientTest.php b/owl-bot-staging/Tasks/v2/tests/Unit/V2/Client/CloudTasksClientTest.php deleted file mode 100644 index 71034c96e057..000000000000 --- a/owl-bot-staging/Tasks/v2/tests/Unit/V2/Client/CloudTasksClientTest.php +++ /dev/null @@ -1,1316 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return CloudTasksClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new CloudTasksClient($options); - } - - /** @test */ - public function createQueueTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new Queue(); - $expectedResponse->setName($name); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $queue = new Queue(); - $request = (new CreateQueueRequest()) - ->setParent($formattedParent) - ->setQueue($queue); - $response = $gapicClient->createQueue($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2.CloudTasks/CreateQueue', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getQueue(); - $this->assertProtobufEquals($queue, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createQueueExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $queue = new Queue(); - $request = (new CreateQueueRequest()) - ->setParent($formattedParent) - ->setQueue($queue); - try { - $gapicClient->createQueue($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createTaskTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $dispatchCount = 1217252086; - $responseCount = 424727441; - $expectedResponse = new Task(); - $expectedResponse->setName($name); - $expectedResponse->setDispatchCount($dispatchCount); - $expectedResponse->setResponseCount($responseCount); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $task = new Task(); - $request = (new CreateTaskRequest()) - ->setParent($formattedParent) - ->setTask($task); - $response = $gapicClient->createTask($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2.CloudTasks/CreateTask', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getTask(); - $this->assertProtobufEquals($task, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createTaskExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $task = new Task(); - $request = (new CreateTaskRequest()) - ->setParent($formattedParent) - ->setTask($task); - try { - $gapicClient->createTask($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteQueueTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $request = (new DeleteQueueRequest()) - ->setName($formattedName); - $gapicClient->deleteQueue($request); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2.CloudTasks/DeleteQueue', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteQueueExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $request = (new DeleteQueueRequest()) - ->setName($formattedName); - try { - $gapicClient->deleteQueue($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteTaskTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - $request = (new DeleteTaskRequest()) - ->setName($formattedName); - $gapicClient->deleteTask($request); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2.CloudTasks/DeleteTask', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteTaskExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - $request = (new DeleteTaskRequest()) - ->setName($formattedName); - try { - $gapicClient->deleteTask($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); - $response = $gapicClient->getIamPolicy($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2.CloudTasks/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); - try { - $gapicClient->getIamPolicy($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getQueueTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new Queue(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $request = (new GetQueueRequest()) - ->setName($formattedName); - $response = $gapicClient->getQueue($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2.CloudTasks/GetQueue', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getQueueExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $request = (new GetQueueRequest()) - ->setName($formattedName); - try { - $gapicClient->getQueue($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getTaskTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $dispatchCount = 1217252086; - $responseCount = 424727441; - $expectedResponse = new Task(); - $expectedResponse->setName($name2); - $expectedResponse->setDispatchCount($dispatchCount); - $expectedResponse->setResponseCount($responseCount); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - $request = (new GetTaskRequest()) - ->setName($formattedName); - $response = $gapicClient->getTask($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2.CloudTasks/GetTask', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getTaskExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - $request = (new GetTaskRequest()) - ->setName($formattedName); - try { - $gapicClient->getTask($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listQueuesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $queuesElement = new Queue(); - $queues = [ - $queuesElement, - ]; - $expectedResponse = new ListQueuesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setQueues($queues); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListQueuesRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listQueues($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getQueues()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2.CloudTasks/ListQueues', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listQueuesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListQueuesRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listQueues($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTasksTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $tasksElement = new Task(); - $tasks = [ - $tasksElement, - ]; - $expectedResponse = new ListTasksResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTasks($tasks); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $request = (new ListTasksRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listTasks($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getTasks()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2.CloudTasks/ListTasks', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTasksExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $request = (new ListTasksRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listTasks($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function pauseQueueTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new Queue(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $request = (new PauseQueueRequest()) - ->setName($formattedName); - $response = $gapicClient->pauseQueue($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2.CloudTasks/PauseQueue', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function pauseQueueExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $request = (new PauseQueueRequest()) - ->setName($formattedName); - try { - $gapicClient->pauseQueue($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function purgeQueueTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new Queue(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $request = (new PurgeQueueRequest()) - ->setName($formattedName); - $response = $gapicClient->purgeQueue($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2.CloudTasks/PurgeQueue', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function purgeQueueExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $request = (new PurgeQueueRequest()) - ->setName($formattedName); - try { - $gapicClient->purgeQueue($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function resumeQueueTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new Queue(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $request = (new ResumeQueueRequest()) - ->setName($formattedName); - $response = $gapicClient->resumeQueue($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2.CloudTasks/ResumeQueue', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function resumeQueueExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $request = (new ResumeQueueRequest()) - ->setName($formattedName); - try { - $gapicClient->resumeQueue($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function runTaskTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $dispatchCount = 1217252086; - $responseCount = 424727441; - $expectedResponse = new Task(); - $expectedResponse->setName($name2); - $expectedResponse->setDispatchCount($dispatchCount); - $expectedResponse->setResponseCount($responseCount); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - $request = (new RunTaskRequest()) - ->setName($formattedName); - $response = $gapicClient->runTask($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2.CloudTasks/RunTask', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function runTaskExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - $request = (new RunTaskRequest()) - ->setName($formattedName); - try { - $gapicClient->runTask($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); - $response = $gapicClient->setIamPolicy($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2.CloudTasks/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); - try { - $gapicClient->setIamPolicy($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); - $response = $gapicClient->testIamPermissions($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2.CloudTasks/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); - try { - $gapicClient->testIamPermissions($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateQueueTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new Queue(); - $expectedResponse->setName($name); - $transport->addResponse($expectedResponse); - // Mock request - $queue = new Queue(); - $request = (new UpdateQueueRequest()) - ->setQueue($queue); - $response = $gapicClient->updateQueue($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2.CloudTasks/UpdateQueue', $actualFuncCall); - $actualValue = $actualRequestObject->getQueue(); - $this->assertProtobufEquals($queue, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateQueueExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $queue = new Queue(); - $request = (new UpdateQueueRequest()) - ->setQueue($queue); - try { - $gapicClient->updateQueue($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $request = new GetLocationRequest(); - $response = $gapicClient->getLocation($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - $request = new GetLocationRequest(); - try { - $gapicClient->getLocation($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $request = new ListLocationsRequest(); - $response = $gapicClient->listLocations($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - $request = new ListLocationsRequest(); - try { - $gapicClient->listLocations($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createQueueAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new Queue(); - $expectedResponse->setName($name); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $queue = new Queue(); - $request = (new CreateQueueRequest()) - ->setParent($formattedParent) - ->setQueue($queue); - $response = $gapicClient->createQueueAsync($request)->wait(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2.CloudTasks/CreateQueue', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getQueue(); - $this->assertProtobufEquals($queue, $actualValue); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/Tasks/v2/tests/Unit/V2/CloudTasksClientTest.php b/owl-bot-staging/Tasks/v2/tests/Unit/V2/CloudTasksClientTest.php deleted file mode 100644 index a662ec4fc05f..000000000000 --- a/owl-bot-staging/Tasks/v2/tests/Unit/V2/CloudTasksClientTest.php +++ /dev/null @@ -1,1189 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return CloudTasksClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new CloudTasksClient($options); - } - - /** @test */ - public function createQueueTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new Queue(); - $expectedResponse->setName($name); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $queue = new Queue(); - $response = $gapicClient->createQueue($formattedParent, $queue); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2.CloudTasks/CreateQueue', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getQueue(); - $this->assertProtobufEquals($queue, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createQueueExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $queue = new Queue(); - try { - $gapicClient->createQueue($formattedParent, $queue); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createTaskTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $dispatchCount = 1217252086; - $responseCount = 424727441; - $expectedResponse = new Task(); - $expectedResponse->setName($name); - $expectedResponse->setDispatchCount($dispatchCount); - $expectedResponse->setResponseCount($responseCount); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $task = new Task(); - $response = $gapicClient->createTask($formattedParent, $task); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2.CloudTasks/CreateTask', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getTask(); - $this->assertProtobufEquals($task, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createTaskExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $task = new Task(); - try { - $gapicClient->createTask($formattedParent, $task); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteQueueTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $gapicClient->deleteQueue($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2.CloudTasks/DeleteQueue', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteQueueExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - try { - $gapicClient->deleteQueue($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteTaskTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - $gapicClient->deleteTask($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2.CloudTasks/DeleteTask', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteTaskExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - try { - $gapicClient->deleteTask($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2.CloudTasks/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getQueueTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new Queue(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $response = $gapicClient->getQueue($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2.CloudTasks/GetQueue', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getQueueExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - try { - $gapicClient->getQueue($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getTaskTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $dispatchCount = 1217252086; - $responseCount = 424727441; - $expectedResponse = new Task(); - $expectedResponse->setName($name2); - $expectedResponse->setDispatchCount($dispatchCount); - $expectedResponse->setResponseCount($responseCount); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - $response = $gapicClient->getTask($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2.CloudTasks/GetTask', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getTaskExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - try { - $gapicClient->getTask($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listQueuesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $queuesElement = new Queue(); - $queues = [ - $queuesElement, - ]; - $expectedResponse = new ListQueuesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setQueues($queues); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listQueues($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getQueues()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2.CloudTasks/ListQueues', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listQueuesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listQueues($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTasksTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $tasksElement = new Task(); - $tasks = [ - $tasksElement, - ]; - $expectedResponse = new ListTasksResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTasks($tasks); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $response = $gapicClient->listTasks($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getTasks()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2.CloudTasks/ListTasks', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTasksExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - try { - $gapicClient->listTasks($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function pauseQueueTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new Queue(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $response = $gapicClient->pauseQueue($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2.CloudTasks/PauseQueue', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function pauseQueueExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - try { - $gapicClient->pauseQueue($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function purgeQueueTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new Queue(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $response = $gapicClient->purgeQueue($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2.CloudTasks/PurgeQueue', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function purgeQueueExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - try { - $gapicClient->purgeQueue($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function resumeQueueTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new Queue(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $response = $gapicClient->resumeQueue($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2.CloudTasks/ResumeQueue', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function resumeQueueExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - try { - $gapicClient->resumeQueue($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function runTaskTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $dispatchCount = 1217252086; - $responseCount = 424727441; - $expectedResponse = new Task(); - $expectedResponse->setName($name2); - $expectedResponse->setDispatchCount($dispatchCount); - $expectedResponse->setResponseCount($responseCount); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - $response = $gapicClient->runTask($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2.CloudTasks/RunTask', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function runTaskExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - try { - $gapicClient->runTask($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2.CloudTasks/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2.CloudTasks/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateQueueTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new Queue(); - $expectedResponse->setName($name); - $transport->addResponse($expectedResponse); - // Mock request - $queue = new Queue(); - $response = $gapicClient->updateQueue($queue); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2.CloudTasks/UpdateQueue', $actualFuncCall); - $actualValue = $actualRequestObject->getQueue(); - $this->assertProtobufEquals($queue, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateQueueExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $queue = new Queue(); - try { - $gapicClient->updateQueue($queue); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta2/Cloudtasks.php b/owl-bot-staging/Tasks/v2beta2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta2/Cloudtasks.php deleted file mode 100644 index 0ee8065355d64963cfa3f15bb57910272fb211f1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8540 zcmc&)&u<)89q%}?sh`srKibqWBApCvGCLgIj`s;5dwh~9GQp(p+UBu;$aubH>MW@p!h_+o3` z_kHK{{k-qbH@^CfU_U@#)i;SpLMtXMz4@LV?-M-;{n)pCS8pb}yCl?Yza2O(2}`=Z zaaaG=-5veL#_gT+ur>0N&?Xgq&-eFSV%n~sw9MFw9!BOtxk+NH%%8DGC8if4&uWt> zuxz4lZr8RzsAa`geUquEuTvHE9jc=Kpj@LWRuQsYD~fcs##Et4NQa*wX}XTBN3j*d zuNR%D;doB$Sg!K}ux3r)wcLon_FmcD#Is|^_jJ19u4j|Qi#pdyWnT<@uzpRKptdO? zKt}zx7n9Jl-1-KI?9d5fKime&N+ ziIdPL&6w-b_(;xF!}g8F4~4Y#d!{lQ8der@~Urz03Gc8vLtP9iW z0$uM|lY0Y^|IC)~E3x;>LU+1OsON}9SrpPm&QUvqCJ9U>V(A22h4B{+&As77F^k;j z9s%>C7{7+50xN`bnAdb|ak^H&@M(48Kh^X21x6V^J&p{{EGj|yGMNT^8cppwE~N1J z3Az){q3OWdBaH~^#rz3)G>I`n>{0ALB;Ncio46pH?;FZG=_iQ2?2l;1x8*jxYk~CqT`4siu$Pl{n_-(X2<_jT;Io2HyA~n%yLv z8p+IMbdna=E?&@3UOEh<+6x%?V-4YTpd}^@r-U&6;aoX)x zP8g{&>LP`eVH3?HOc_7xp;Q=m5Z)jz>3RED=U{vj&21;)UbiXZE3=a5^HBzNLJ>~d zpN}>Noq02GeXGS>=et(hmG1K;G-U-r!)Xa0rbmpI(KJn;4ca&e?|4=Q4n%l~HWf8k zyY&4( zF25wf^owG;vGf3hJF^YVEZy0Lrj}{rEuQlPV39aXG#OJ1MBdPcy%7&g8xXgrA#YIi zlJu{2qzyp^`k#_v{0&k&Pai6haS!HIbdu5|oMR|EEOYdpCanNPPt&-K=6K|*_{U<> z_>7i0Vnu|iI<}KSQEOZ8HYgtvBV-a^L8o1+zai^4D|R#Gv(k-Z1un_PaR5WqYl||Z zR9o)YH=racR*vb}#!obKrfNU*{6m+t_84c!bL1=NnaJKJt;8h_+JOi!>MikUkIF00 zzv0;K!R&m6Cp3KP_AJE!w!PM+NLDPGZ@krrI)8M_tJ9hB)W)a#n6pfMcpTC08 zIvqM#=;J?X2xV;}z9i$bUt!7QgzGJoii-2lGp_&Wlh1xOv4YL?vgQ$Qtk)nPe4p5H zWG z6Nb`1qjab^mmWoM1c+M<;_Jq!3|4rn`?z|F6TZxd#eW6FN;8{}SP>in@pl;FYvs$? znX`A73Q?Qlo@1Mqm1Y_L9Kb8Ra6WiNP=Y@r-6t(Z>>fh8!IHvpA*|93eg`p?b=CPX zmB~p|1^jfAQCcw+N(%w31hm($XiFVP)0TY*(p2vMf|R~ZLHY+cYh@nDKWjyB1gy6h ztEC?D zI#?;Gi&EWlT{3*D@qn3q!?>QA4F<7m_MwT7-a@A!7y(bqz4-Tl@xHR$gHc@^g7K~6 zV2l(H4CAcCxXkaK@F&n+?7&42HHCz2CyMB`HeT!^tXD+BzF0s~l)!yv${pk8ICRH7 zAelkWW(Fzn-`CJ|I*8(B39+98ree~dp?!cD9E4FkbiR&X%Z$pc>sjgK*Ns_y|CNTm z0M1L*vLP!E0I)NEC8Sxz$i-fnh5A7)OD4Qemb7m%29OpK}dDR$~OXd+XqRPjV z$6rD{$|lEr#F?B#JSYnZK9>}nWAXWS+JUB1T0Xi=PNK_gu~c#4sc$oOYsT7`o?3A! zRL1dhf@Ah19dz-B8k+5z7W1=zm$0;K5brj#;FhtTSuhgs6)PKMnH`vJU+x%4@ju{D zvPm=lP%=3QeRwdw!;IK8YU3IKxA9^OW;UGfwPCsITt1@Bc{W1kcMytTaiflXGIj=U z;K}?J5~LU-^Alv}thq4!O!#PV-B=y_OcIa5X2a0J*2mSetk%#R6p2(WKac#gTB0|m zQN=V54-dN*O)H7_`Dgq~fosLPe%P*oN1lW4Dmf*gHoKnAwcGUj(YE%zbzbenrxW^J zX3tmtLBIq&z5g~4G*>g=LGw2glRMS>ckchIx`m8vp&RrYVr<3r3+XWXNc?rA47HEs je0$WKVuQ!47t(Ku%ly;4@+E)ZS9~VPzqTKtBZU47xL;}5 diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta2/OldTarget.php b/owl-bot-staging/Tasks/v2beta2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta2/OldTarget.php deleted file mode 100644 index e407dce1a21c..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta2/OldTarget.php +++ /dev/null @@ -1,27 +0,0 @@ -internalAddGeneratedFile( - ' -� -+google/cloud/tasks/v2beta2/old_target.protogoogle.cloud.tasks.v2beta2Bw -com.google.cloud.tasks.v2beta2BOldTargetProtoPZCcloud.google.com/go/cloudtasks/apiv2beta2/cloudtaskspb;cloudtaskspbbproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta2/Queue.php b/owl-bot-staging/Tasks/v2beta2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta2/Queue.php deleted file mode 100644 index 2bcab1231d847ca2cc6823db1ba869ce269cec23..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2576 zcmbVOVNcse7;Z{K=^H@QT9M1Ta${XdwauO~tslbJl#oCpb&x`sw8@g?*q3m_v9Ie#PFqvqLtrfQA%d`<~~0@80)$?(UoK_!);!$N`OL;t3j%{v{D- zl<*`Lu^)$|pA7~yA$~mKEToA=Nb86k9`#7O)#-hV)HKc#pVrARj)x(&{V>h~TX^Yt zYG2g)RCqP}ZALR{sgMAXH=-%`d`b?w&F^tM@Py|aD7LdF*-lTgogZpV$=(6*LoZFq z8yN-O1HnI@^+V>9RCogaJ!7fMA|{v@vR`lwyJX;nDMjXW>>!JL!QzNW!cpYY>I7{^WNQ> zHKRS)tORRt`^=M)wlY*4cH)0fdki%syb+(xRbBkzTbB2%5d@PK?W2gRlcLHJZ^Q2^ z@cee_H8wQPQYyEU%B@`G8;|oC9%puvmsX2@!`Yq_U#J4+$fr3_nFWPs2YHq9@y&ma zi=q@7u=U#_l$BGAWwmKJWjfO0u?wJtW)rrjo9Iw=DOGloyG^@dR zTM=I&PdEJ49b*?NJPX4j&OH_9`Mfw?giq6_r}6M+`aiPoKt=9YZpcPVq-ObM`Z2;^ zD>P1h8LgIFx_%rD*w9>5Y-fAk$TsWMlH(0riKkFTK%BN<=9iik)3RK(a~$$*;}b-j+%TvN!o z%~Q*et4Ny*e>4`h+ECVOdIS$odW~M&Jv}_>w)Z;wopx*Oj!}X8$ESyfox_8*k^!*T zZJeIqz+DvPQmb>)Xuig`g}USX)%X!Mm7}zwv=GrosfEXmt=0Szi}N$}MQXp#pT>3= z`)UWlZ^h$SA2#^qtvoKq%@wF0~m1)_m!?Hws zLeLRM(MoHU(MeCh$RZ_V%sm;E8J2MLYcM2B3%1w~a@)>Pg9Vili`>5FpT~oNsqJ|K zUM?}mYeUV!KY|rGtss_XaWqVoiOS7YSdOyMWEER~mH@7#W0Mh_Hss4IW){?7DEe^G54Uu{oLwa@j%V(K0u_bTSkxPvI9 KzA21h4DdHY0Ydfw diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta2/Target.php b/owl-bot-staging/Tasks/v2beta2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta2/Target.php deleted file mode 100644 index ebd1a9fff9ae2f8e4d134e88d0f56c536425c5a9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3089 zcmc&$-EP}96t3;Wu8*BeRkJQ@w?Xro#o1a1@K#`Onil?1VgpU&#!B}C0|G5GHc?sB zC@O$E^nP!!_t-P+L3XiM*!@URRh+i*TI^!EvB;d??|kR*JbWBX1Ng!?#6D(-KUWx>&{kc#LX~bOIFea2vJiP0AG#c-6 z6h04k&+8-1QC*za1oK*K6Tn9^90th6#$ms8Bm~BYqv2t!K5R?%p)J*i&+09yz6aoX zC=3ldHUqzaA^w7BCvhvyku#&J zVr(?t2y)-xEW(T44TE7GF@Gh^kgoAJXGC{C*RL+wWLU{k9UU#f7iMg|8)ruap7$k>{zxRlbIjJRRXM zL=&uk0EGa}J&MMg86#6I>m|r>G}+9GL$NZ2o6R6F{R#1Lm-9f`(4WE`6a)^A?;S=X zPW*{O&oN_UjAKKk`n}rKG1XG5CrY{UM;12HOX=za{~Y0v>w8d|ilZ~bd`eZ2>-8^} z*_PUZ(L!49g8pWpac=J!pS}TQhCM;^bL>RS+ssLP^kXPYF&bkQZmt-)YN@`zEU>rb zSL-T$)8}lySdCR#joURSUlI`2d5-5X!bN=zR?m?aVO6X~_Pb2Q1}*iHKr4-gn4J?> zRi-E}M5#j2eM(c;;5zX|gNQav5-Y>Xl!jbnC283L^~gAZ!HVU64HtC`&O-W3pQk^l#v&LVbpgNsVbj9xsUkNN*YTS83y94fUj)9 z+S3TLdHQd`QPDGO?gWUTS(u3ZwgRP7MpCIZqQpvim*B>pjwur#Ox2en=2`iNckXP8~w?H4XyXKMUoE{JQX1jOL zGdtQf{W`34ZM&~!^dhXvuYs1WjNsPW4eC3vb$ZfstY_xQNv~r%=JA1b(l(tVOB^m+ zz5#2!14pa^j`>4xU=M@~fPC}G_st)Lk5&;1j;eO60IQDd>G(rds`6J3Kz36y)%T&i zh*V6UQhm7nj_CZi8DN2?NS{_J6ikvM^}#a#7vU$fAf@^L+5dMTuco$qO|P2Qw=Gy# zQVTKX6$lCT_unh^E5}F!;9|DvpTdX9bKoG?rIF7aJVPWI=kierT^b~hO64IG)5-R4 zs^S?z(U@TQjKqWCt56Xvd5!PDN0R%_k!g3W&TB*#Ez-9Jw%~68a)+j^W#g_fn;k7D zullF9wj#ORF`t;WsjbRZ>No9nSIY~S3s&FmS;qsd(Bkl!Sd^DQ*D5K-$6IAT^HW=G zO|RA!I@_I4wL+^68U^Il5*kp+hx0}js&I6QB(4R{YB8WW|k`HC(PhD&6F zm{Y7Y(QtdlRm2mnIf?lnaDsh2BC%osycs*n5~_KcU;{W#D68*c$7y1pi4;z}kBfBr zMg$Nb>?NAXgv8+iQ&e)HQ`v{mW^>GRDV_OJ-_5r*bbN&CF2`o`Mw0tj%Z$zMjT<@Rn3_z*-LWTvhNn=t zOfAOP8hraB&lPVCho!)WV8D7Qi4kZA{fW@?J2}tWa$&wTsBaDG=LX#hcb0M(b)0{< zKFT+3zS4h+|Gc!4$)ov>jRv&e{4Td@>dMGl36erX~vK z3NG`fSrDfbdRv;nx8iXYfGfZk!KJ;=@*aC>h-d9bP;qh*r(_uE3&FPkt{^mb;HT&_ zqBWZe9Su3OUri?wO|wK>7p{17>k`^CY|QfY`ykPZcZ42~xKuhSSaR8&MR%78*mC>k z${(Unp_|{}aR$9R&-Pyxv~ivJhTqKpwcc3fH-MCCSc{s&-U=xNvJj`hvR%GLpOlbX zHg{aFkPUi;@APR)uuD2E78cmJy=KbVH4Gt4Bi+QAp&3H|0e@Y)`2YX_ diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AcknowledgeTaskRequest.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AcknowledgeTaskRequest.php deleted file mode 100644 index 5bc989f652e1..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AcknowledgeTaskRequest.php +++ /dev/null @@ -1,132 +0,0 @@ -google.cloud.tasks.v2beta2.AcknowledgeTaskRequest - */ -class AcknowledgeTaskRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Required. The task's current schedule time, available in the - * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] returned by - * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] response or - * [RenewLease][google.cloud.tasks.v2beta2.CloudTasks.RenewLease] response. - * This restriction is to ensure that your worker currently holds the lease. - * - * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $schedule_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * @type \Google\Protobuf\Timestamp $schedule_time - * Required. The task's current schedule time, available in the - * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] returned by - * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] response or - * [RenewLease][google.cloud.tasks.v2beta2.CloudTasks.RenewLease] response. - * This restriction is to ensure that your worker currently holds the lease. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Required. The task's current schedule time, available in the - * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] returned by - * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] response or - * [RenewLease][google.cloud.tasks.v2beta2.CloudTasks.RenewLease] response. - * This restriction is to ensure that your worker currently holds the lease. - * - * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getScheduleTime() - { - return $this->schedule_time; - } - - public function hasScheduleTime() - { - return isset($this->schedule_time); - } - - public function clearScheduleTime() - { - unset($this->schedule_time); - } - - /** - * Required. The task's current schedule time, available in the - * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] returned by - * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] response or - * [RenewLease][google.cloud.tasks.v2beta2.CloudTasks.RenewLease] response. - * This restriction is to ensure that your worker currently holds the lease. - * - * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setScheduleTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->schedule_time = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AppEngineHttpRequest.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AppEngineHttpRequest.php deleted file mode 100644 index b6c1deb04396..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AppEngineHttpRequest.php +++ /dev/null @@ -1,484 +0,0 @@ -google.cloud.tasks.v2beta2.AppEngineHttpRequest - */ -class AppEngineHttpRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The HTTP method to use for the request. The default is POST. - * The app's request handler for the task's target URL must be able to handle - * HTTP requests with this http_method, otherwise the task attempt fails with - * error code 405 (Method Not Allowed). See [Writing a push task request - * handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) - * and the App Engine documentation for your runtime on [How Requests are - * Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.HttpMethod http_method = 1; - */ - protected $http_method = 0; - /** - * Task-level setting for App Engine routing. - * If set, - * [app_engine_routing_override][google.cloud.tasks.v2beta2.AppEngineHttpTarget.app_engine_routing_override] - * is used for all tasks in the queue, no matter what the setting is for the - * [task-level - * app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.AppEngineRouting app_engine_routing = 2; - */ - protected $app_engine_routing = null; - /** - * The relative URL. - * The relative URL must begin with "/" and must be a valid HTTP relative URL. - * It can contain a path and query string arguments. - * If the relative URL is empty, then the root path "/" will be used. - * No spaces are allowed, and the maximum length allowed is 2083 characters. - * - * Generated from protobuf field string relative_url = 3; - */ - protected $relative_url = ''; - /** - * HTTP request headers. - * This map contains the header field names and values. - * Headers can be set when the - * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. - * Repeated headers are not supported but a header value can contain commas. - * Cloud Tasks sets some headers to default values: - * * `User-Agent`: By default, this header is - * `"AppEngine-Google; (+http://code.google.com/appengine)"`. - * This header can be modified, but Cloud Tasks will append - * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the - * modified `User-Agent`. - * If the task has a - * [payload][google.cloud.tasks.v2beta2.AppEngineHttpRequest.payload], Cloud - * Tasks sets the following headers: - * * `Content-Type`: By default, the `Content-Type` header is set to - * `"application/octet-stream"`. The default can be overridden by explicitly - * setting `Content-Type` to a particular media type when the - * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. - * For example, `Content-Type` can be set to `"application/json"`. - * * `Content-Length`: This is computed by Cloud Tasks. This value is - * output only. It cannot be changed. - * The headers below cannot be set or overridden: - * * `Host` - * * `X-Google-*` - * * `X-AppEngine-*` - * In addition, Cloud Tasks sets some headers when the task is dispatched, - * such as headers containing information about the task; see - * [request - * headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers). - * These headers are set only when the task is dispatched, so they are not - * visible when the task is returned in a Cloud Tasks response. - * Although there is no specific limit for the maximum number of headers or - * the size, there is a limit on the maximum size of the - * [Task][google.cloud.tasks.v2beta2.Task]. For more information, see the - * [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] - * documentation. - * - * Generated from protobuf field map headers = 4; - */ - private $headers; - /** - * Payload. - * The payload will be sent as the HTTP message body. A message - * body, and thus a payload, is allowed only if the HTTP method is - * POST or PUT. It is an error to set a data payload on a task with - * an incompatible [HttpMethod][google.cloud.tasks.v2beta2.HttpMethod]. - * - * Generated from protobuf field bytes payload = 5; - */ - protected $payload = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $http_method - * The HTTP method to use for the request. The default is POST. - * The app's request handler for the task's target URL must be able to handle - * HTTP requests with this http_method, otherwise the task attempt fails with - * error code 405 (Method Not Allowed). See [Writing a push task request - * handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) - * and the App Engine documentation for your runtime on [How Requests are - * Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). - * @type \Google\Cloud\Tasks\V2beta2\AppEngineRouting $app_engine_routing - * Task-level setting for App Engine routing. - * If set, - * [app_engine_routing_override][google.cloud.tasks.v2beta2.AppEngineHttpTarget.app_engine_routing_override] - * is used for all tasks in the queue, no matter what the setting is for the - * [task-level - * app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. - * @type string $relative_url - * The relative URL. - * The relative URL must begin with "/" and must be a valid HTTP relative URL. - * It can contain a path and query string arguments. - * If the relative URL is empty, then the root path "/" will be used. - * No spaces are allowed, and the maximum length allowed is 2083 characters. - * @type array|\Google\Protobuf\Internal\MapField $headers - * HTTP request headers. - * This map contains the header field names and values. - * Headers can be set when the - * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. - * Repeated headers are not supported but a header value can contain commas. - * Cloud Tasks sets some headers to default values: - * * `User-Agent`: By default, this header is - * `"AppEngine-Google; (+http://code.google.com/appengine)"`. - * This header can be modified, but Cloud Tasks will append - * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the - * modified `User-Agent`. - * If the task has a - * [payload][google.cloud.tasks.v2beta2.AppEngineHttpRequest.payload], Cloud - * Tasks sets the following headers: - * * `Content-Type`: By default, the `Content-Type` header is set to - * `"application/octet-stream"`. The default can be overridden by explicitly - * setting `Content-Type` to a particular media type when the - * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. - * For example, `Content-Type` can be set to `"application/json"`. - * * `Content-Length`: This is computed by Cloud Tasks. This value is - * output only. It cannot be changed. - * The headers below cannot be set or overridden: - * * `Host` - * * `X-Google-*` - * * `X-AppEngine-*` - * In addition, Cloud Tasks sets some headers when the task is dispatched, - * such as headers containing information about the task; see - * [request - * headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers). - * These headers are set only when the task is dispatched, so they are not - * visible when the task is returned in a Cloud Tasks response. - * Although there is no specific limit for the maximum number of headers or - * the size, there is a limit on the maximum size of the - * [Task][google.cloud.tasks.v2beta2.Task]. For more information, see the - * [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] - * documentation. - * @type string $payload - * Payload. - * The payload will be sent as the HTTP message body. A message - * body, and thus a payload, is allowed only if the HTTP method is - * POST or PUT. It is an error to set a data payload on a task with - * an incompatible [HttpMethod][google.cloud.tasks.v2beta2.HttpMethod]. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Target::initOnce(); - parent::__construct($data); - } - - /** - * The HTTP method to use for the request. The default is POST. - * The app's request handler for the task's target URL must be able to handle - * HTTP requests with this http_method, otherwise the task attempt fails with - * error code 405 (Method Not Allowed). See [Writing a push task request - * handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) - * and the App Engine documentation for your runtime on [How Requests are - * Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.HttpMethod http_method = 1; - * @return int - */ - public function getHttpMethod() - { - return $this->http_method; - } - - /** - * The HTTP method to use for the request. The default is POST. - * The app's request handler for the task's target URL must be able to handle - * HTTP requests with this http_method, otherwise the task attempt fails with - * error code 405 (Method Not Allowed). See [Writing a push task request - * handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) - * and the App Engine documentation for your runtime on [How Requests are - * Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.HttpMethod http_method = 1; - * @param int $var - * @return $this - */ - public function setHttpMethod($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta2\HttpMethod::class); - $this->http_method = $var; - - return $this; - } - - /** - * Task-level setting for App Engine routing. - * If set, - * [app_engine_routing_override][google.cloud.tasks.v2beta2.AppEngineHttpTarget.app_engine_routing_override] - * is used for all tasks in the queue, no matter what the setting is for the - * [task-level - * app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.AppEngineRouting app_engine_routing = 2; - * @return \Google\Cloud\Tasks\V2beta2\AppEngineRouting|null - */ - public function getAppEngineRouting() - { - return $this->app_engine_routing; - } - - public function hasAppEngineRouting() - { - return isset($this->app_engine_routing); - } - - public function clearAppEngineRouting() - { - unset($this->app_engine_routing); - } - - /** - * Task-level setting for App Engine routing. - * If set, - * [app_engine_routing_override][google.cloud.tasks.v2beta2.AppEngineHttpTarget.app_engine_routing_override] - * is used for all tasks in the queue, no matter what the setting is for the - * [task-level - * app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.AppEngineRouting app_engine_routing = 2; - * @param \Google\Cloud\Tasks\V2beta2\AppEngineRouting $var - * @return $this - */ - public function setAppEngineRouting($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\AppEngineRouting::class); - $this->app_engine_routing = $var; - - return $this; - } - - /** - * The relative URL. - * The relative URL must begin with "/" and must be a valid HTTP relative URL. - * It can contain a path and query string arguments. - * If the relative URL is empty, then the root path "/" will be used. - * No spaces are allowed, and the maximum length allowed is 2083 characters. - * - * Generated from protobuf field string relative_url = 3; - * @return string - */ - public function getRelativeUrl() - { - return $this->relative_url; - } - - /** - * The relative URL. - * The relative URL must begin with "/" and must be a valid HTTP relative URL. - * It can contain a path and query string arguments. - * If the relative URL is empty, then the root path "/" will be used. - * No spaces are allowed, and the maximum length allowed is 2083 characters. - * - * Generated from protobuf field string relative_url = 3; - * @param string $var - * @return $this - */ - public function setRelativeUrl($var) - { - GPBUtil::checkString($var, True); - $this->relative_url = $var; - - return $this; - } - - /** - * HTTP request headers. - * This map contains the header field names and values. - * Headers can be set when the - * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. - * Repeated headers are not supported but a header value can contain commas. - * Cloud Tasks sets some headers to default values: - * * `User-Agent`: By default, this header is - * `"AppEngine-Google; (+http://code.google.com/appengine)"`. - * This header can be modified, but Cloud Tasks will append - * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the - * modified `User-Agent`. - * If the task has a - * [payload][google.cloud.tasks.v2beta2.AppEngineHttpRequest.payload], Cloud - * Tasks sets the following headers: - * * `Content-Type`: By default, the `Content-Type` header is set to - * `"application/octet-stream"`. The default can be overridden by explicitly - * setting `Content-Type` to a particular media type when the - * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. - * For example, `Content-Type` can be set to `"application/json"`. - * * `Content-Length`: This is computed by Cloud Tasks. This value is - * output only. It cannot be changed. - * The headers below cannot be set or overridden: - * * `Host` - * * `X-Google-*` - * * `X-AppEngine-*` - * In addition, Cloud Tasks sets some headers when the task is dispatched, - * such as headers containing information about the task; see - * [request - * headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers). - * These headers are set only when the task is dispatched, so they are not - * visible when the task is returned in a Cloud Tasks response. - * Although there is no specific limit for the maximum number of headers or - * the size, there is a limit on the maximum size of the - * [Task][google.cloud.tasks.v2beta2.Task]. For more information, see the - * [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] - * documentation. - * - * Generated from protobuf field map headers = 4; - * @return \Google\Protobuf\Internal\MapField - */ - public function getHeaders() - { - return $this->headers; - } - - /** - * HTTP request headers. - * This map contains the header field names and values. - * Headers can be set when the - * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. - * Repeated headers are not supported but a header value can contain commas. - * Cloud Tasks sets some headers to default values: - * * `User-Agent`: By default, this header is - * `"AppEngine-Google; (+http://code.google.com/appengine)"`. - * This header can be modified, but Cloud Tasks will append - * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the - * modified `User-Agent`. - * If the task has a - * [payload][google.cloud.tasks.v2beta2.AppEngineHttpRequest.payload], Cloud - * Tasks sets the following headers: - * * `Content-Type`: By default, the `Content-Type` header is set to - * `"application/octet-stream"`. The default can be overridden by explicitly - * setting `Content-Type` to a particular media type when the - * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. - * For example, `Content-Type` can be set to `"application/json"`. - * * `Content-Length`: This is computed by Cloud Tasks. This value is - * output only. It cannot be changed. - * The headers below cannot be set or overridden: - * * `Host` - * * `X-Google-*` - * * `X-AppEngine-*` - * In addition, Cloud Tasks sets some headers when the task is dispatched, - * such as headers containing information about the task; see - * [request - * headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers). - * These headers are set only when the task is dispatched, so they are not - * visible when the task is returned in a Cloud Tasks response. - * Although there is no specific limit for the maximum number of headers or - * the size, there is a limit on the maximum size of the - * [Task][google.cloud.tasks.v2beta2.Task]. For more information, see the - * [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] - * documentation. - * - * Generated from protobuf field map headers = 4; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setHeaders($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->headers = $arr; - - return $this; - } - - /** - * Payload. - * The payload will be sent as the HTTP message body. A message - * body, and thus a payload, is allowed only if the HTTP method is - * POST or PUT. It is an error to set a data payload on a task with - * an incompatible [HttpMethod][google.cloud.tasks.v2beta2.HttpMethod]. - * - * Generated from protobuf field bytes payload = 5; - * @return string - */ - public function getPayload() - { - return $this->payload; - } - - /** - * Payload. - * The payload will be sent as the HTTP message body. A message - * body, and thus a payload, is allowed only if the HTTP method is - * POST or PUT. It is an error to set a data payload on a task with - * an incompatible [HttpMethod][google.cloud.tasks.v2beta2.HttpMethod]. - * - * Generated from protobuf field bytes payload = 5; - * @param string $var - * @return $this - */ - public function setPayload($var) - { - GPBUtil::checkString($var, False); - $this->payload = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AppEngineHttpTarget.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AppEngineHttpTarget.php deleted file mode 100644 index 17f72796c02a..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AppEngineHttpTarget.php +++ /dev/null @@ -1,114 +0,0 @@ -google.cloud.tasks.v2beta2.AppEngineHttpTarget - */ -class AppEngineHttpTarget extends \Google\Protobuf\Internal\Message -{ - /** - * Overrides for the - * [task-level - * app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. - * If set, `app_engine_routing_override` is used for all tasks in - * the queue, no matter what the setting is for the - * [task-level - * app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.AppEngineRouting app_engine_routing_override = 1; - */ - protected $app_engine_routing_override = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Tasks\V2beta2\AppEngineRouting $app_engine_routing_override - * Overrides for the - * [task-level - * app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. - * If set, `app_engine_routing_override` is used for all tasks in - * the queue, no matter what the setting is for the - * [task-level - * app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Target::initOnce(); - parent::__construct($data); - } - - /** - * Overrides for the - * [task-level - * app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. - * If set, `app_engine_routing_override` is used for all tasks in - * the queue, no matter what the setting is for the - * [task-level - * app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.AppEngineRouting app_engine_routing_override = 1; - * @return \Google\Cloud\Tasks\V2beta2\AppEngineRouting|null - */ - public function getAppEngineRoutingOverride() - { - return $this->app_engine_routing_override; - } - - public function hasAppEngineRoutingOverride() - { - return isset($this->app_engine_routing_override); - } - - public function clearAppEngineRoutingOverride() - { - unset($this->app_engine_routing_override); - } - - /** - * Overrides for the - * [task-level - * app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. - * If set, `app_engine_routing_override` is used for all tasks in - * the queue, no matter what the setting is for the - * [task-level - * app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.AppEngineRouting app_engine_routing_override = 1; - * @param \Google\Cloud\Tasks\V2beta2\AppEngineRouting $var - * @return $this - */ - public function setAppEngineRoutingOverride($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\AppEngineRouting::class); - $this->app_engine_routing_override = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AppEngineRouting.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AppEngineRouting.php deleted file mode 100644 index cb35bc64c659..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AppEngineRouting.php +++ /dev/null @@ -1,536 +0,0 @@ -google.cloud.tasks.v2beta2.AppEngineRouting - */ -class AppEngineRouting extends \Google\Protobuf\Internal\Message -{ - /** - * App service. - * By default, the task is sent to the service which is the default - * service when the task is attempted. - * For some queues or tasks which were created using the App Engine - * Task Queue API, [host][google.cloud.tasks.v2beta2.AppEngineRouting.host] is - * not parsable into - * [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], - * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance]. For - * example, some tasks which were created using the App Engine SDK use a - * custom domain name; custom domains are not parsed by Cloud Tasks. If - * [host][google.cloud.tasks.v2beta2.AppEngineRouting.host] is not parsable, - * then [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], - * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] are the - * empty string. - * - * Generated from protobuf field string service = 1; - */ - protected $service = ''; - /** - * App version. - * By default, the task is sent to the version which is the default - * version when the task is attempted. - * For some queues or tasks which were created using the App Engine - * Task Queue API, [host][google.cloud.tasks.v2beta2.AppEngineRouting.host] is - * not parsable into - * [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], - * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance]. For - * example, some tasks which were created using the App Engine SDK use a - * custom domain name; custom domains are not parsed by Cloud Tasks. If - * [host][google.cloud.tasks.v2beta2.AppEngineRouting.host] is not parsable, - * then [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], - * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] are the - * empty string. - * - * Generated from protobuf field string version = 2; - */ - protected $version = ''; - /** - * App instance. - * By default, the task is sent to an instance which is available when - * the task is attempted. - * Requests can only be sent to a specific instance if - * [manual scaling is used in App Engine - * Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). - * App Engine Flex does not support instances. For more information, see - * [App Engine Standard request - * routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) - * and [App Engine Flex request - * routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). - * - * Generated from protobuf field string instance = 3; - */ - protected $instance = ''; - /** - * Output only. The host that the task is sent to. - * For more information, see - * [How Requests are - * Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). - * The host is constructed as: - * * `host = [application_domain_name]`
- * `| [service] + '.' + [application_domain_name]`
- * `| [version] + '.' + [application_domain_name]`
- * `| [version_dot_service]+ '.' + [application_domain_name]`
- * `| [instance] + '.' + [application_domain_name]`
- * `| [instance_dot_service] + '.' + [application_domain_name]`
- * `| [instance_dot_version] + '.' + [application_domain_name]`
- * `| [instance_dot_version_dot_service] + '.' + [application_domain_name]` - * * `application_domain_name` = The domain name of the app, for - * example .appspot.com, which is associated with the - * queue's project ID. Some tasks which were created using the App Engine - * SDK use a custom domain name. - * * `service =` - * [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] - * * `version =` - * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] - * * `version_dot_service =` - * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] `+ '.' +` - * [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] - * * `instance =` - * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] - * * `instance_dot_service =` - * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] `+ '.' - * +` [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] - * * `instance_dot_version =` - * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] `+ '.' - * +` [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] - * * `instance_dot_version_dot_service =` - * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] `+ '.' - * +` [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] `+ '.' - * +` [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] - * If [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] is empty, - * then the task will be sent to the service which is the default service when - * the task is attempted. - * If [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] is empty, - * then the task will be sent to the version which is the default version when - * the task is attempted. - * If [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] is - * empty, then the task will be sent to an instance which is available when - * the task is attempted. - * If [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], - * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], or - * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] is - * invalid, then the task will be sent to the default version of the default - * service when the task is attempted. - * - * Generated from protobuf field string host = 4; - */ - protected $host = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $service - * App service. - * By default, the task is sent to the service which is the default - * service when the task is attempted. - * For some queues or tasks which were created using the App Engine - * Task Queue API, [host][google.cloud.tasks.v2beta2.AppEngineRouting.host] is - * not parsable into - * [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], - * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance]. For - * example, some tasks which were created using the App Engine SDK use a - * custom domain name; custom domains are not parsed by Cloud Tasks. If - * [host][google.cloud.tasks.v2beta2.AppEngineRouting.host] is not parsable, - * then [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], - * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] are the - * empty string. - * @type string $version - * App version. - * By default, the task is sent to the version which is the default - * version when the task is attempted. - * For some queues or tasks which were created using the App Engine - * Task Queue API, [host][google.cloud.tasks.v2beta2.AppEngineRouting.host] is - * not parsable into - * [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], - * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance]. For - * example, some tasks which were created using the App Engine SDK use a - * custom domain name; custom domains are not parsed by Cloud Tasks. If - * [host][google.cloud.tasks.v2beta2.AppEngineRouting.host] is not parsable, - * then [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], - * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] are the - * empty string. - * @type string $instance - * App instance. - * By default, the task is sent to an instance which is available when - * the task is attempted. - * Requests can only be sent to a specific instance if - * [manual scaling is used in App Engine - * Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). - * App Engine Flex does not support instances. For more information, see - * [App Engine Standard request - * routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) - * and [App Engine Flex request - * routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). - * @type string $host - * Output only. The host that the task is sent to. - * For more information, see - * [How Requests are - * Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). - * The host is constructed as: - * * `host = [application_domain_name]`
- * `| [service] + '.' + [application_domain_name]`
- * `| [version] + '.' + [application_domain_name]`
- * `| [version_dot_service]+ '.' + [application_domain_name]`
- * `| [instance] + '.' + [application_domain_name]`
- * `| [instance_dot_service] + '.' + [application_domain_name]`
- * `| [instance_dot_version] + '.' + [application_domain_name]`
- * `| [instance_dot_version_dot_service] + '.' + [application_domain_name]` - * * `application_domain_name` = The domain name of the app, for - * example .appspot.com, which is associated with the - * queue's project ID. Some tasks which were created using the App Engine - * SDK use a custom domain name. - * * `service =` - * [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] - * * `version =` - * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] - * * `version_dot_service =` - * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] `+ '.' +` - * [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] - * * `instance =` - * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] - * * `instance_dot_service =` - * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] `+ '.' - * +` [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] - * * `instance_dot_version =` - * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] `+ '.' - * +` [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] - * * `instance_dot_version_dot_service =` - * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] `+ '.' - * +` [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] `+ '.' - * +` [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] - * If [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] is empty, - * then the task will be sent to the service which is the default service when - * the task is attempted. - * If [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] is empty, - * then the task will be sent to the version which is the default version when - * the task is attempted. - * If [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] is - * empty, then the task will be sent to an instance which is available when - * the task is attempted. - * If [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], - * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], or - * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] is - * invalid, then the task will be sent to the default version of the default - * service when the task is attempted. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Target::initOnce(); - parent::__construct($data); - } - - /** - * App service. - * By default, the task is sent to the service which is the default - * service when the task is attempted. - * For some queues or tasks which were created using the App Engine - * Task Queue API, [host][google.cloud.tasks.v2beta2.AppEngineRouting.host] is - * not parsable into - * [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], - * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance]. For - * example, some tasks which were created using the App Engine SDK use a - * custom domain name; custom domains are not parsed by Cloud Tasks. If - * [host][google.cloud.tasks.v2beta2.AppEngineRouting.host] is not parsable, - * then [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], - * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] are the - * empty string. - * - * Generated from protobuf field string service = 1; - * @return string - */ - public function getService() - { - return $this->service; - } - - /** - * App service. - * By default, the task is sent to the service which is the default - * service when the task is attempted. - * For some queues or tasks which were created using the App Engine - * Task Queue API, [host][google.cloud.tasks.v2beta2.AppEngineRouting.host] is - * not parsable into - * [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], - * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance]. For - * example, some tasks which were created using the App Engine SDK use a - * custom domain name; custom domains are not parsed by Cloud Tasks. If - * [host][google.cloud.tasks.v2beta2.AppEngineRouting.host] is not parsable, - * then [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], - * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] are the - * empty string. - * - * Generated from protobuf field string service = 1; - * @param string $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkString($var, True); - $this->service = $var; - - return $this; - } - - /** - * App version. - * By default, the task is sent to the version which is the default - * version when the task is attempted. - * For some queues or tasks which were created using the App Engine - * Task Queue API, [host][google.cloud.tasks.v2beta2.AppEngineRouting.host] is - * not parsable into - * [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], - * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance]. For - * example, some tasks which were created using the App Engine SDK use a - * custom domain name; custom domains are not parsed by Cloud Tasks. If - * [host][google.cloud.tasks.v2beta2.AppEngineRouting.host] is not parsable, - * then [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], - * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] are the - * empty string. - * - * Generated from protobuf field string version = 2; - * @return string - */ - public function getVersion() - { - return $this->version; - } - - /** - * App version. - * By default, the task is sent to the version which is the default - * version when the task is attempted. - * For some queues or tasks which were created using the App Engine - * Task Queue API, [host][google.cloud.tasks.v2beta2.AppEngineRouting.host] is - * not parsable into - * [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], - * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance]. For - * example, some tasks which were created using the App Engine SDK use a - * custom domain name; custom domains are not parsed by Cloud Tasks. If - * [host][google.cloud.tasks.v2beta2.AppEngineRouting.host] is not parsable, - * then [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], - * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] are the - * empty string. - * - * Generated from protobuf field string version = 2; - * @param string $var - * @return $this - */ - public function setVersion($var) - { - GPBUtil::checkString($var, True); - $this->version = $var; - - return $this; - } - - /** - * App instance. - * By default, the task is sent to an instance which is available when - * the task is attempted. - * Requests can only be sent to a specific instance if - * [manual scaling is used in App Engine - * Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). - * App Engine Flex does not support instances. For more information, see - * [App Engine Standard request - * routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) - * and [App Engine Flex request - * routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). - * - * Generated from protobuf field string instance = 3; - * @return string - */ - public function getInstance() - { - return $this->instance; - } - - /** - * App instance. - * By default, the task is sent to an instance which is available when - * the task is attempted. - * Requests can only be sent to a specific instance if - * [manual scaling is used in App Engine - * Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). - * App Engine Flex does not support instances. For more information, see - * [App Engine Standard request - * routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) - * and [App Engine Flex request - * routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). - * - * Generated from protobuf field string instance = 3; - * @param string $var - * @return $this - */ - public function setInstance($var) - { - GPBUtil::checkString($var, True); - $this->instance = $var; - - return $this; - } - - /** - * Output only. The host that the task is sent to. - * For more information, see - * [How Requests are - * Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). - * The host is constructed as: - * * `host = [application_domain_name]`
- * `| [service] + '.' + [application_domain_name]`
- * `| [version] + '.' + [application_domain_name]`
- * `| [version_dot_service]+ '.' + [application_domain_name]`
- * `| [instance] + '.' + [application_domain_name]`
- * `| [instance_dot_service] + '.' + [application_domain_name]`
- * `| [instance_dot_version] + '.' + [application_domain_name]`
- * `| [instance_dot_version_dot_service] + '.' + [application_domain_name]` - * * `application_domain_name` = The domain name of the app, for - * example .appspot.com, which is associated with the - * queue's project ID. Some tasks which were created using the App Engine - * SDK use a custom domain name. - * * `service =` - * [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] - * * `version =` - * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] - * * `version_dot_service =` - * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] `+ '.' +` - * [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] - * * `instance =` - * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] - * * `instance_dot_service =` - * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] `+ '.' - * +` [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] - * * `instance_dot_version =` - * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] `+ '.' - * +` [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] - * * `instance_dot_version_dot_service =` - * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] `+ '.' - * +` [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] `+ '.' - * +` [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] - * If [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] is empty, - * then the task will be sent to the service which is the default service when - * the task is attempted. - * If [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] is empty, - * then the task will be sent to the version which is the default version when - * the task is attempted. - * If [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] is - * empty, then the task will be sent to an instance which is available when - * the task is attempted. - * If [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], - * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], or - * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] is - * invalid, then the task will be sent to the default version of the default - * service when the task is attempted. - * - * Generated from protobuf field string host = 4; - * @return string - */ - public function getHost() - { - return $this->host; - } - - /** - * Output only. The host that the task is sent to. - * For more information, see - * [How Requests are - * Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). - * The host is constructed as: - * * `host = [application_domain_name]`
- * `| [service] + '.' + [application_domain_name]`
- * `| [version] + '.' + [application_domain_name]`
- * `| [version_dot_service]+ '.' + [application_domain_name]`
- * `| [instance] + '.' + [application_domain_name]`
- * `| [instance_dot_service] + '.' + [application_domain_name]`
- * `| [instance_dot_version] + '.' + [application_domain_name]`
- * `| [instance_dot_version_dot_service] + '.' + [application_domain_name]` - * * `application_domain_name` = The domain name of the app, for - * example .appspot.com, which is associated with the - * queue's project ID. Some tasks which were created using the App Engine - * SDK use a custom domain name. - * * `service =` - * [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] - * * `version =` - * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] - * * `version_dot_service =` - * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] `+ '.' +` - * [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] - * * `instance =` - * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] - * * `instance_dot_service =` - * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] `+ '.' - * +` [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] - * * `instance_dot_version =` - * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] `+ '.' - * +` [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] - * * `instance_dot_version_dot_service =` - * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] `+ '.' - * +` [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] `+ '.' - * +` [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] - * If [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] is empty, - * then the task will be sent to the service which is the default service when - * the task is attempted. - * If [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] is empty, - * then the task will be sent to the version which is the default version when - * the task is attempted. - * If [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] is - * empty, then the task will be sent to an instance which is available when - * the task is attempted. - * If [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], - * [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], or - * [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] is - * invalid, then the task will be sent to the default version of the default - * service when the task is attempted. - * - * Generated from protobuf field string host = 4; - * @param string $var - * @return $this - */ - public function setHost($var) - { - GPBUtil::checkString($var, True); - $this->host = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AttemptStatus.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AttemptStatus.php deleted file mode 100644 index f249c75a16f2..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AttemptStatus.php +++ /dev/null @@ -1,229 +0,0 @@ -google.cloud.tasks.v2beta2.AttemptStatus - */ -class AttemptStatus extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The time that this attempt was scheduled. - * `schedule_time` will be truncated to the nearest microsecond. - * - * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 1; - */ - protected $schedule_time = null; - /** - * Output only. The time that this attempt was dispatched. - * `dispatch_time` will be truncated to the nearest microsecond. - * - * Generated from protobuf field .google.protobuf.Timestamp dispatch_time = 2; - */ - protected $dispatch_time = null; - /** - * Output only. The time that this attempt response was received. - * `response_time` will be truncated to the nearest microsecond. - * - * Generated from protobuf field .google.protobuf.Timestamp response_time = 3; - */ - protected $response_time = null; - /** - * Output only. The response from the target for this attempt. - * If the task has not been attempted or the task is currently running - * then the response status is unset. - * - * Generated from protobuf field .google.rpc.Status response_status = 4; - */ - protected $response_status = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $schedule_time - * Output only. The time that this attempt was scheduled. - * `schedule_time` will be truncated to the nearest microsecond. - * @type \Google\Protobuf\Timestamp $dispatch_time - * Output only. The time that this attempt was dispatched. - * `dispatch_time` will be truncated to the nearest microsecond. - * @type \Google\Protobuf\Timestamp $response_time - * Output only. The time that this attempt response was received. - * `response_time` will be truncated to the nearest microsecond. - * @type \Google\Rpc\Status $response_status - * Output only. The response from the target for this attempt. - * If the task has not been attempted or the task is currently running - * then the response status is unset. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Task::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The time that this attempt was scheduled. - * `schedule_time` will be truncated to the nearest microsecond. - * - * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 1; - * @return \Google\Protobuf\Timestamp|null - */ - public function getScheduleTime() - { - return $this->schedule_time; - } - - public function hasScheduleTime() - { - return isset($this->schedule_time); - } - - public function clearScheduleTime() - { - unset($this->schedule_time); - } - - /** - * Output only. The time that this attempt was scheduled. - * `schedule_time` will be truncated to the nearest microsecond. - * - * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 1; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setScheduleTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->schedule_time = $var; - - return $this; - } - - /** - * Output only. The time that this attempt was dispatched. - * `dispatch_time` will be truncated to the nearest microsecond. - * - * Generated from protobuf field .google.protobuf.Timestamp dispatch_time = 2; - * @return \Google\Protobuf\Timestamp|null - */ - public function getDispatchTime() - { - return $this->dispatch_time; - } - - public function hasDispatchTime() - { - return isset($this->dispatch_time); - } - - public function clearDispatchTime() - { - unset($this->dispatch_time); - } - - /** - * Output only. The time that this attempt was dispatched. - * `dispatch_time` will be truncated to the nearest microsecond. - * - * Generated from protobuf field .google.protobuf.Timestamp dispatch_time = 2; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setDispatchTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->dispatch_time = $var; - - return $this; - } - - /** - * Output only. The time that this attempt response was received. - * `response_time` will be truncated to the nearest microsecond. - * - * Generated from protobuf field .google.protobuf.Timestamp response_time = 3; - * @return \Google\Protobuf\Timestamp|null - */ - public function getResponseTime() - { - return $this->response_time; - } - - public function hasResponseTime() - { - return isset($this->response_time); - } - - public function clearResponseTime() - { - unset($this->response_time); - } - - /** - * Output only. The time that this attempt response was received. - * `response_time` will be truncated to the nearest microsecond. - * - * Generated from protobuf field .google.protobuf.Timestamp response_time = 3; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setResponseTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->response_time = $var; - - return $this; - } - - /** - * Output only. The response from the target for this attempt. - * If the task has not been attempted or the task is currently running - * then the response status is unset. - * - * Generated from protobuf field .google.rpc.Status response_status = 4; - * @return \Google\Rpc\Status|null - */ - public function getResponseStatus() - { - return $this->response_status; - } - - public function hasResponseStatus() - { - return isset($this->response_status); - } - - public function clearResponseStatus() - { - unset($this->response_status); - } - - /** - * Output only. The response from the target for this attempt. - * If the task has not been attempted or the task is currently running - * then the response status is unset. - * - * Generated from protobuf field .google.rpc.Status response_status = 4; - * @param \Google\Rpc\Status $var - * @return $this - */ - public function setResponseStatus($var) - { - GPBUtil::checkMessage($var, \Google\Rpc\Status::class); - $this->response_status = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/CancelLeaseRequest.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/CancelLeaseRequest.php deleted file mode 100644 index a07ba30cb995..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/CancelLeaseRequest.php +++ /dev/null @@ -1,206 +0,0 @@ -google.cloud.tasks.v2beta2.CancelLeaseRequest - */ -class CancelLeaseRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Required. The task's current schedule time, available in the - * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] returned by - * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] response or - * [RenewLease][google.cloud.tasks.v2beta2.CloudTasks.RenewLease] response. - * This restriction is to ensure that your worker currently holds the lease. - * - * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $schedule_time = null; - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta2.Task] will be returned. - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta2.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View response_view = 3; - */ - protected $response_view = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * @type \Google\Protobuf\Timestamp $schedule_time - * Required. The task's current schedule time, available in the - * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] returned by - * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] response or - * [RenewLease][google.cloud.tasks.v2beta2.CloudTasks.RenewLease] response. - * This restriction is to ensure that your worker currently holds the lease. - * @type int $response_view - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta2.Task] will be returned. - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta2.Task] resource. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Required. The task's current schedule time, available in the - * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] returned by - * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] response or - * [RenewLease][google.cloud.tasks.v2beta2.CloudTasks.RenewLease] response. - * This restriction is to ensure that your worker currently holds the lease. - * - * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getScheduleTime() - { - return $this->schedule_time; - } - - public function hasScheduleTime() - { - return isset($this->schedule_time); - } - - public function clearScheduleTime() - { - unset($this->schedule_time); - } - - /** - * Required. The task's current schedule time, available in the - * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] returned by - * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] response or - * [RenewLease][google.cloud.tasks.v2beta2.CloudTasks.RenewLease] response. - * This restriction is to ensure that your worker currently holds the lease. - * - * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setScheduleTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->schedule_time = $var; - - return $this; - } - - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta2.Task] will be returned. - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta2.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View response_view = 3; - * @return int - */ - public function getResponseView() - { - return $this->response_view; - } - - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta2.Task] will be returned. - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta2.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View response_view = 3; - * @param int $var - * @return $this - */ - public function setResponseView($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta2\Task\View::class); - $this->response_view = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/CreateQueueRequest.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/CreateQueueRequest.php deleted file mode 100644 index 0eeb5944f56e..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/CreateQueueRequest.php +++ /dev/null @@ -1,136 +0,0 @@ -google.cloud.tasks.v2beta2.CreateQueueRequest - */ -class CreateQueueRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The location name in which the queue will be created. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * The list of allowed locations can be obtained by calling Cloud - * Tasks' implementation of - * [ListLocations][google.cloud.location.Locations.ListLocations]. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The queue to create. - * [Queue's name][google.cloud.tasks.v2beta2.Queue.name] cannot be the same as - * an existing queue. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.Queue queue = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $queue = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The location name in which the queue will be created. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * The list of allowed locations can be obtained by calling Cloud - * Tasks' implementation of - * [ListLocations][google.cloud.location.Locations.ListLocations]. - * @type \Google\Cloud\Tasks\V2beta2\Queue $queue - * Required. The queue to create. - * [Queue's name][google.cloud.tasks.v2beta2.Queue.name] cannot be the same as - * an existing queue. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * Required. The location name in which the queue will be created. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * The list of allowed locations can be obtained by calling Cloud - * Tasks' implementation of - * [ListLocations][google.cloud.location.Locations.ListLocations]. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The location name in which the queue will be created. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * The list of allowed locations can be obtained by calling Cloud - * Tasks' implementation of - * [ListLocations][google.cloud.location.Locations.ListLocations]. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The queue to create. - * [Queue's name][google.cloud.tasks.v2beta2.Queue.name] cannot be the same as - * an existing queue. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.Queue queue = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Tasks\V2beta2\Queue|null - */ - public function getQueue() - { - return $this->queue; - } - - public function hasQueue() - { - return isset($this->queue); - } - - public function clearQueue() - { - unset($this->queue); - } - - /** - * Required. The queue to create. - * [Queue's name][google.cloud.tasks.v2beta2.Queue.name] cannot be the same as - * an existing queue. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.Queue queue = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Tasks\V2beta2\Queue $var - * @return $this - */ - public function setQueue($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\Queue::class); - $this->queue = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/CreateTaskRequest.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/CreateTaskRequest.php deleted file mode 100644 index ccf05e0c56db..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/CreateTaskRequest.php +++ /dev/null @@ -1,302 +0,0 @@ -google.cloud.tasks.v2beta2.CreateTaskRequest - */ -class CreateTaskRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * The queue must already exist. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The task to add. - * Task names have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. - * The user can optionally specify a task - * [name][google.cloud.tasks.v2beta2.Task.name]. If a name is not specified - * then the system will generate a random unique task id, which will be set in - * the task returned in the [response][google.cloud.tasks.v2beta2.Task.name]. - * If [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] is not - * set or is in the past then Cloud Tasks will set it to the current time. - * Task De-duplication: - * Explicitly specifying a task ID enables task de-duplication. If - * a task's ID is identical to that of an existing task or a task - * that was deleted or completed recently then the call will fail - * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. - * If the task's queue was created using Cloud Tasks, then another task with - * the same name can't be created for ~1 hour after the original task was - * deleted or completed. If the task's queue was created using queue.yaml or - * queue.xml, then another task with the same name can't be created - * for ~9 days after the original task was deleted or completed. - * Because there is an extra lookup cost to identify duplicate task - * names, these [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] - * calls have significantly increased latency. Using hashed strings for the - * task id or for the prefix of the task id is recommended. Choosing task ids - * that are sequential or have sequential prefixes, for example using a - * timestamp, causes an increase in latency and error rates in all - * task commands. The infrastructure relies on an approximately - * uniform distribution of task ids to store and serve tasks - * efficiently. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.Task task = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $task = null; - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta2.Task] will be returned. - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta2.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View response_view = 3; - */ - protected $response_view = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * The queue must already exist. - * @type \Google\Cloud\Tasks\V2beta2\Task $task - * Required. The task to add. - * Task names have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. - * The user can optionally specify a task - * [name][google.cloud.tasks.v2beta2.Task.name]. If a name is not specified - * then the system will generate a random unique task id, which will be set in - * the task returned in the [response][google.cloud.tasks.v2beta2.Task.name]. - * If [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] is not - * set or is in the past then Cloud Tasks will set it to the current time. - * Task De-duplication: - * Explicitly specifying a task ID enables task de-duplication. If - * a task's ID is identical to that of an existing task or a task - * that was deleted or completed recently then the call will fail - * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. - * If the task's queue was created using Cloud Tasks, then another task with - * the same name can't be created for ~1 hour after the original task was - * deleted or completed. If the task's queue was created using queue.yaml or - * queue.xml, then another task with the same name can't be created - * for ~9 days after the original task was deleted or completed. - * Because there is an extra lookup cost to identify duplicate task - * names, these [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] - * calls have significantly increased latency. Using hashed strings for the - * task id or for the prefix of the task id is recommended. Choosing task ids - * that are sequential or have sequential prefixes, for example using a - * timestamp, causes an increase in latency and error rates in all - * task commands. The infrastructure relies on an approximately - * uniform distribution of task ids to store and serve tasks - * efficiently. - * @type int $response_view - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta2.Task] will be returned. - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta2.Task] resource. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * The queue must already exist. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * The queue must already exist. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The task to add. - * Task names have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. - * The user can optionally specify a task - * [name][google.cloud.tasks.v2beta2.Task.name]. If a name is not specified - * then the system will generate a random unique task id, which will be set in - * the task returned in the [response][google.cloud.tasks.v2beta2.Task.name]. - * If [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] is not - * set or is in the past then Cloud Tasks will set it to the current time. - * Task De-duplication: - * Explicitly specifying a task ID enables task de-duplication. If - * a task's ID is identical to that of an existing task or a task - * that was deleted or completed recently then the call will fail - * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. - * If the task's queue was created using Cloud Tasks, then another task with - * the same name can't be created for ~1 hour after the original task was - * deleted or completed. If the task's queue was created using queue.yaml or - * queue.xml, then another task with the same name can't be created - * for ~9 days after the original task was deleted or completed. - * Because there is an extra lookup cost to identify duplicate task - * names, these [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] - * calls have significantly increased latency. Using hashed strings for the - * task id or for the prefix of the task id is recommended. Choosing task ids - * that are sequential or have sequential prefixes, for example using a - * timestamp, causes an increase in latency and error rates in all - * task commands. The infrastructure relies on an approximately - * uniform distribution of task ids to store and serve tasks - * efficiently. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.Task task = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Tasks\V2beta2\Task|null - */ - public function getTask() - { - return $this->task; - } - - public function hasTask() - { - return isset($this->task); - } - - public function clearTask() - { - unset($this->task); - } - - /** - * Required. The task to add. - * Task names have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. - * The user can optionally specify a task - * [name][google.cloud.tasks.v2beta2.Task.name]. If a name is not specified - * then the system will generate a random unique task id, which will be set in - * the task returned in the [response][google.cloud.tasks.v2beta2.Task.name]. - * If [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] is not - * set or is in the past then Cloud Tasks will set it to the current time. - * Task De-duplication: - * Explicitly specifying a task ID enables task de-duplication. If - * a task's ID is identical to that of an existing task or a task - * that was deleted or completed recently then the call will fail - * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. - * If the task's queue was created using Cloud Tasks, then another task with - * the same name can't be created for ~1 hour after the original task was - * deleted or completed. If the task's queue was created using queue.yaml or - * queue.xml, then another task with the same name can't be created - * for ~9 days after the original task was deleted or completed. - * Because there is an extra lookup cost to identify duplicate task - * names, these [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] - * calls have significantly increased latency. Using hashed strings for the - * task id or for the prefix of the task id is recommended. Choosing task ids - * that are sequential or have sequential prefixes, for example using a - * timestamp, causes an increase in latency and error rates in all - * task commands. The infrastructure relies on an approximately - * uniform distribution of task ids to store and serve tasks - * efficiently. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.Task task = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Tasks\V2beta2\Task $var - * @return $this - */ - public function setTask($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\Task::class); - $this->task = $var; - - return $this; - } - - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta2.Task] will be returned. - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta2.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View response_view = 3; - * @return int - */ - public function getResponseView() - { - return $this->response_view; - } - - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta2.Task] will be returned. - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta2.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View response_view = 3; - * @param int $var - * @return $this - */ - public function setResponseView($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta2\Task\View::class); - $this->response_view = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/DeleteQueueRequest.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/DeleteQueueRequest.php deleted file mode 100644 index 204cb50c0a33..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/DeleteQueueRequest.php +++ /dev/null @@ -1,72 +0,0 @@ -google.cloud.tasks.v2beta2.DeleteQueueRequest - */ -class DeleteQueueRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/DeleteTaskRequest.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/DeleteTaskRequest.php deleted file mode 100644 index 90e1ae6db930..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/DeleteTaskRequest.php +++ /dev/null @@ -1,72 +0,0 @@ -google.cloud.tasks.v2beta2.DeleteTaskRequest - */ -class DeleteTaskRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/GetQueueRequest.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/GetQueueRequest.php deleted file mode 100644 index 06c2a0ecd5ce..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/GetQueueRequest.php +++ /dev/null @@ -1,128 +0,0 @@ -google.cloud.tasks.v2beta2.GetQueueRequest - */ -class GetQueueRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the queue. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Optional. Read mask is used for a more granular control over what the API - * returns. If the mask is not present all fields will be returned except - * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - * specified in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask read_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $read_mask = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the queue. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * @type \Google\Protobuf\FieldMask $read_mask - * Optional. Read mask is used for a more granular control over what the API - * returns. If the mask is not present all fields will be returned except - * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - * specified in the mask. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the queue. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The resource name of the queue. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. Read mask is used for a more granular control over what the API - * returns. If the mask is not present all fields will be returned except - * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - * specified in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask read_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\FieldMask|null - */ - public function getReadMask() - { - return $this->read_mask; - } - - public function hasReadMask() - { - return isset($this->read_mask); - } - - public function clearReadMask() - { - unset($this->read_mask); - } - - /** - * Optional. Read mask is used for a more granular control over what the API - * returns. If the mask is not present all fields will be returned except - * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - * specified in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask read_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setReadMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->read_mask = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/GetTaskRequest.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/GetTaskRequest.php deleted file mode 100644 index e1c29520dd88..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/GetTaskRequest.php +++ /dev/null @@ -1,146 +0,0 @@ -google.cloud.tasks.v2beta2.GetTaskRequest - */ -class GetTaskRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta2.Task] will be returned. - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta2.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View response_view = 2; - */ - protected $response_view = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * @type int $response_view - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta2.Task] will be returned. - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta2.Task] resource. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta2.Task] will be returned. - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta2.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View response_view = 2; - * @return int - */ - public function getResponseView() - { - return $this->response_view; - } - - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta2.Task] will be returned. - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta2.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View response_view = 2; - * @param int $var - * @return $this - */ - public function setResponseView($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta2\Task\View::class); - $this->response_view = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/HttpMethod.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/HttpMethod.php deleted file mode 100644 index b70a89dc91d7..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/HttpMethod.php +++ /dev/null @@ -1,96 +0,0 @@ -google.cloud.tasks.v2beta2.HttpMethod - */ -class HttpMethod -{ - /** - * HTTP method unspecified - * - * Generated from protobuf enum HTTP_METHOD_UNSPECIFIED = 0; - */ - const HTTP_METHOD_UNSPECIFIED = 0; - /** - * HTTP POST - * - * Generated from protobuf enum POST = 1; - */ - const POST = 1; - /** - * HTTP GET - * - * Generated from protobuf enum GET = 2; - */ - const GET = 2; - /** - * HTTP HEAD - * - * Generated from protobuf enum HEAD = 3; - */ - const HEAD = 3; - /** - * HTTP PUT - * - * Generated from protobuf enum PUT = 4; - */ - const PUT = 4; - /** - * HTTP DELETE - * - * Generated from protobuf enum DELETE = 5; - */ - const DELETE = 5; - /** - * HTTP PATCH - * - * Generated from protobuf enum PATCH = 6; - */ - const PATCH = 6; - /** - * HTTP OPTIONS - * - * Generated from protobuf enum OPTIONS = 7; - */ - const OPTIONS = 7; - - private static $valueToName = [ - self::HTTP_METHOD_UNSPECIFIED => 'HTTP_METHOD_UNSPECIFIED', - self::POST => 'POST', - self::GET => 'GET', - self::HEAD => 'HEAD', - self::PUT => 'PUT', - self::DELETE => 'DELETE', - self::PATCH => 'PATCH', - self::OPTIONS => 'OPTIONS', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/HttpRequest.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/HttpRequest.php deleted file mode 100644 index 28eb2b523d6d..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/HttpRequest.php +++ /dev/null @@ -1,416 +0,0 @@ -google.cloud.tasks.v2beta2.HttpRequest - */ -class HttpRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The full url path that the request will be sent to. - * This string must begin with either "http://" or "https://". Some examples - * are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will - * encode some characters for safety and compatibility. The maximum allowed - * URL length is 2083 characters after encoding. - * The `Location` header response from a redirect response [`300` - `399`] - * may be followed. The redirect is not counted as a separate attempt. - * - * Generated from protobuf field string url = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $url = ''; - /** - * The HTTP method to use for the request. The default is POST. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.HttpMethod http_method = 2; - */ - protected $http_method = 0; - /** - * HTTP request headers. - * This map contains the header field names and values. - * Headers can be set when running the - * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] or - * [task is created][google.cloud.tasks.v2beta2.CloudTasks.BufferTask]. - * These headers represent a subset of the headers that will accompany the - * task's HTTP request. Some HTTP request headers will be ignored or replaced. - * A partial list of headers that will be ignored or replaced is: - * * Any header that is prefixed with "X-CloudTasks-" will be treated - * as service header. Service headers define properties of the task and are - * predefined in CloudTask. - * * Host: This will be computed by Cloud Tasks and derived from - * [HttpRequest.url][google.cloud.tasks.v2beta2.HttpRequest.url]. - * * Content-Length: This will be computed by Cloud Tasks. - * * User-Agent: This will be set to `"Google-Cloud-Tasks"`. - * * `X-Google-*`: Google use only. - * * `X-AppEngine-*`: Google use only. - * `Content-Type` won't be set by Cloud Tasks. You can explicitly set - * `Content-Type` to a media type when the - * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - * For example, `Content-Type` can be set to `"application/octet-stream"` or - * `"application/json"`. - * Headers which can have multiple values (according to RFC2616) can be - * specified using comma-separated values. - * The size of the headers must be less than 80KB. - * - * Generated from protobuf field map headers = 3; - */ - private $headers; - /** - * HTTP request body. - * A request body is allowed only if the - * [HTTP method][google.cloud.tasks.v2beta2.HttpRequest.http_method] is POST, - * PUT, or PATCH. It is an error to set body on a task with an incompatible - * [HttpMethod][google.cloud.tasks.v2beta2.HttpMethod]. - * - * Generated from protobuf field bytes body = 4; - */ - protected $body = ''; - protected $authorization_header; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $url - * Required. The full url path that the request will be sent to. - * This string must begin with either "http://" or "https://". Some examples - * are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will - * encode some characters for safety and compatibility. The maximum allowed - * URL length is 2083 characters after encoding. - * The `Location` header response from a redirect response [`300` - `399`] - * may be followed. The redirect is not counted as a separate attempt. - * @type int $http_method - * The HTTP method to use for the request. The default is POST. - * @type array|\Google\Protobuf\Internal\MapField $headers - * HTTP request headers. - * This map contains the header field names and values. - * Headers can be set when running the - * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] or - * [task is created][google.cloud.tasks.v2beta2.CloudTasks.BufferTask]. - * These headers represent a subset of the headers that will accompany the - * task's HTTP request. Some HTTP request headers will be ignored or replaced. - * A partial list of headers that will be ignored or replaced is: - * * Any header that is prefixed with "X-CloudTasks-" will be treated - * as service header. Service headers define properties of the task and are - * predefined in CloudTask. - * * Host: This will be computed by Cloud Tasks and derived from - * [HttpRequest.url][google.cloud.tasks.v2beta2.HttpRequest.url]. - * * Content-Length: This will be computed by Cloud Tasks. - * * User-Agent: This will be set to `"Google-Cloud-Tasks"`. - * * `X-Google-*`: Google use only. - * * `X-AppEngine-*`: Google use only. - * `Content-Type` won't be set by Cloud Tasks. You can explicitly set - * `Content-Type` to a media type when the - * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - * For example, `Content-Type` can be set to `"application/octet-stream"` or - * `"application/json"`. - * Headers which can have multiple values (according to RFC2616) can be - * specified using comma-separated values. - * The size of the headers must be less than 80KB. - * @type string $body - * HTTP request body. - * A request body is allowed only if the - * [HTTP method][google.cloud.tasks.v2beta2.HttpRequest.http_method] is POST, - * PUT, or PATCH. It is an error to set body on a task with an incompatible - * [HttpMethod][google.cloud.tasks.v2beta2.HttpMethod]. - * @type \Google\Cloud\Tasks\V2beta2\OAuthToken $oauth_token - * If specified, an - * [OAuth token](https://developers.google.com/identity/protocols/OAuth2) - * will be generated and attached as an `Authorization` header in the HTTP - * request. - * This type of authorization should generally only be used when calling - * Google APIs hosted on *.googleapis.com. - * @type \Google\Cloud\Tasks\V2beta2\OidcToken $oidc_token - * If specified, an - * [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) - * token will be generated and attached as an `Authorization` header in the - * HTTP request. - * This type of authorization can be used for many scenarios, including - * calling Cloud Run, or endpoints where you intend to validate the token - * yourself. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Target::initOnce(); - parent::__construct($data); - } - - /** - * Required. The full url path that the request will be sent to. - * This string must begin with either "http://" or "https://". Some examples - * are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will - * encode some characters for safety and compatibility. The maximum allowed - * URL length is 2083 characters after encoding. - * The `Location` header response from a redirect response [`300` - `399`] - * may be followed. The redirect is not counted as a separate attempt. - * - * Generated from protobuf field string url = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getUrl() - { - return $this->url; - } - - /** - * Required. The full url path that the request will be sent to. - * This string must begin with either "http://" or "https://". Some examples - * are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will - * encode some characters for safety and compatibility. The maximum allowed - * URL length is 2083 characters after encoding. - * The `Location` header response from a redirect response [`300` - `399`] - * may be followed. The redirect is not counted as a separate attempt. - * - * Generated from protobuf field string url = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setUrl($var) - { - GPBUtil::checkString($var, True); - $this->url = $var; - - return $this; - } - - /** - * The HTTP method to use for the request. The default is POST. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.HttpMethod http_method = 2; - * @return int - */ - public function getHttpMethod() - { - return $this->http_method; - } - - /** - * The HTTP method to use for the request. The default is POST. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.HttpMethod http_method = 2; - * @param int $var - * @return $this - */ - public function setHttpMethod($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta2\HttpMethod::class); - $this->http_method = $var; - - return $this; - } - - /** - * HTTP request headers. - * This map contains the header field names and values. - * Headers can be set when running the - * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] or - * [task is created][google.cloud.tasks.v2beta2.CloudTasks.BufferTask]. - * These headers represent a subset of the headers that will accompany the - * task's HTTP request. Some HTTP request headers will be ignored or replaced. - * A partial list of headers that will be ignored or replaced is: - * * Any header that is prefixed with "X-CloudTasks-" will be treated - * as service header. Service headers define properties of the task and are - * predefined in CloudTask. - * * Host: This will be computed by Cloud Tasks and derived from - * [HttpRequest.url][google.cloud.tasks.v2beta2.HttpRequest.url]. - * * Content-Length: This will be computed by Cloud Tasks. - * * User-Agent: This will be set to `"Google-Cloud-Tasks"`. - * * `X-Google-*`: Google use only. - * * `X-AppEngine-*`: Google use only. - * `Content-Type` won't be set by Cloud Tasks. You can explicitly set - * `Content-Type` to a media type when the - * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - * For example, `Content-Type` can be set to `"application/octet-stream"` or - * `"application/json"`. - * Headers which can have multiple values (according to RFC2616) can be - * specified using comma-separated values. - * The size of the headers must be less than 80KB. - * - * Generated from protobuf field map headers = 3; - * @return \Google\Protobuf\Internal\MapField - */ - public function getHeaders() - { - return $this->headers; - } - - /** - * HTTP request headers. - * This map contains the header field names and values. - * Headers can be set when running the - * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] or - * [task is created][google.cloud.tasks.v2beta2.CloudTasks.BufferTask]. - * These headers represent a subset of the headers that will accompany the - * task's HTTP request. Some HTTP request headers will be ignored or replaced. - * A partial list of headers that will be ignored or replaced is: - * * Any header that is prefixed with "X-CloudTasks-" will be treated - * as service header. Service headers define properties of the task and are - * predefined in CloudTask. - * * Host: This will be computed by Cloud Tasks and derived from - * [HttpRequest.url][google.cloud.tasks.v2beta2.HttpRequest.url]. - * * Content-Length: This will be computed by Cloud Tasks. - * * User-Agent: This will be set to `"Google-Cloud-Tasks"`. - * * `X-Google-*`: Google use only. - * * `X-AppEngine-*`: Google use only. - * `Content-Type` won't be set by Cloud Tasks. You can explicitly set - * `Content-Type` to a media type when the - * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - * For example, `Content-Type` can be set to `"application/octet-stream"` or - * `"application/json"`. - * Headers which can have multiple values (according to RFC2616) can be - * specified using comma-separated values. - * The size of the headers must be less than 80KB. - * - * Generated from protobuf field map headers = 3; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setHeaders($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->headers = $arr; - - return $this; - } - - /** - * HTTP request body. - * A request body is allowed only if the - * [HTTP method][google.cloud.tasks.v2beta2.HttpRequest.http_method] is POST, - * PUT, or PATCH. It is an error to set body on a task with an incompatible - * [HttpMethod][google.cloud.tasks.v2beta2.HttpMethod]. - * - * Generated from protobuf field bytes body = 4; - * @return string - */ - public function getBody() - { - return $this->body; - } - - /** - * HTTP request body. - * A request body is allowed only if the - * [HTTP method][google.cloud.tasks.v2beta2.HttpRequest.http_method] is POST, - * PUT, or PATCH. It is an error to set body on a task with an incompatible - * [HttpMethod][google.cloud.tasks.v2beta2.HttpMethod]. - * - * Generated from protobuf field bytes body = 4; - * @param string $var - * @return $this - */ - public function setBody($var) - { - GPBUtil::checkString($var, False); - $this->body = $var; - - return $this; - } - - /** - * If specified, an - * [OAuth token](https://developers.google.com/identity/protocols/OAuth2) - * will be generated and attached as an `Authorization` header in the HTTP - * request. - * This type of authorization should generally only be used when calling - * Google APIs hosted on *.googleapis.com. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.OAuthToken oauth_token = 5; - * @return \Google\Cloud\Tasks\V2beta2\OAuthToken|null - */ - public function getOauthToken() - { - return $this->readOneof(5); - } - - public function hasOauthToken() - { - return $this->hasOneof(5); - } - - /** - * If specified, an - * [OAuth token](https://developers.google.com/identity/protocols/OAuth2) - * will be generated and attached as an `Authorization` header in the HTTP - * request. - * This type of authorization should generally only be used when calling - * Google APIs hosted on *.googleapis.com. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.OAuthToken oauth_token = 5; - * @param \Google\Cloud\Tasks\V2beta2\OAuthToken $var - * @return $this - */ - public function setOauthToken($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\OAuthToken::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * If specified, an - * [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) - * token will be generated and attached as an `Authorization` header in the - * HTTP request. - * This type of authorization can be used for many scenarios, including - * calling Cloud Run, or endpoints where you intend to validate the token - * yourself. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.OidcToken oidc_token = 6; - * @return \Google\Cloud\Tasks\V2beta2\OidcToken|null - */ - public function getOidcToken() - { - return $this->readOneof(6); - } - - public function hasOidcToken() - { - return $this->hasOneof(6); - } - - /** - * If specified, an - * [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) - * token will be generated and attached as an `Authorization` header in the - * HTTP request. - * This type of authorization can be used for many scenarios, including - * calling Cloud Run, or endpoints where you intend to validate the token - * yourself. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.OidcToken oidc_token = 6; - * @param \Google\Cloud\Tasks\V2beta2\OidcToken $var - * @return $this - */ - public function setOidcToken($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\OidcToken::class); - $this->writeOneof(6, $var); - - return $this; - } - - /** - * @return string - */ - public function getAuthorizationHeader() - { - return $this->whichOneof("authorization_header"); - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/HttpTarget.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/HttpTarget.php deleted file mode 100644 index 7b156261f564..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/HttpTarget.php +++ /dev/null @@ -1,375 +0,0 @@ -google.cloud.tasks.v2beta2.HttpTarget - */ -class HttpTarget extends \Google\Protobuf\Internal\Message -{ - /** - * Uri override. - * When specified, overrides the execution Uri for all the tasks in the queue. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.UriOverride uri_override = 1; - */ - protected $uri_override = null; - /** - * The HTTP method to use for the request. - * When specified, it overrides - * [HttpRequest][google.cloud.tasks.v2beta2.HttpTarget.http_method] for the - * task. Note that if the value is set to [HttpMethod][GET] the - * [HttpRequest][body] of the task will be ignored at execution time. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.HttpMethod http_method = 2; - */ - protected $http_method = 0; - /** - * HTTP target headers. - * This map contains the header field names and values. - * Headers will be set when running the - * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] and/or - * [task is created][google.cloud.tasks.v2beta2.CloudTasks.BufferTask]. - * These headers represent a subset of the headers that will accompany the - * task's HTTP request. Some HTTP request headers will be ignored or replaced. - * A partial list of headers that will be ignored or replaced is: - * * Any header that is prefixed with "X-CloudTasks-" will be treated - * as service header. Service headers define properties of the task and are - * predefined in CloudTask. - * * Host: This will be computed by Cloud Tasks and derived from - * [HttpRequest.url][google.cloud.tasks.v2beta2.HttpRequest.url]. - * * Content-Length: This will be computed by Cloud Tasks. - * * User-Agent: This will be set to `"Google-CloudTasks"`. - * * `X-Google-*`: Google use only. - * * `X-AppEngine-*`: Google use only. - * `Content-Type` won't be set by Cloud Tasks. You can explicitly set - * `Content-Type` to a media type when the - * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - * For example, `Content-Type` can be set to `"application/octet-stream"` or - * `"application/json"`. - * Headers which can have multiple values (according to RFC2616) can be - * specified using comma-separated values. - * The size of the headers must be less than 80KB. - * Queue-level headers to override headers of all the tasks in the queue. - * - * Generated from protobuf field repeated .google.cloud.tasks.v2beta2.HttpTarget.HeaderOverride header_overrides = 3; - */ - private $header_overrides; - protected $authorization_header; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Tasks\V2beta2\UriOverride $uri_override - * Uri override. - * When specified, overrides the execution Uri for all the tasks in the queue. - * @type int $http_method - * The HTTP method to use for the request. - * When specified, it overrides - * [HttpRequest][google.cloud.tasks.v2beta2.HttpTarget.http_method] for the - * task. Note that if the value is set to [HttpMethod][GET] the - * [HttpRequest][body] of the task will be ignored at execution time. - * @type array<\Google\Cloud\Tasks\V2beta2\HttpTarget\HeaderOverride>|\Google\Protobuf\Internal\RepeatedField $header_overrides - * HTTP target headers. - * This map contains the header field names and values. - * Headers will be set when running the - * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] and/or - * [task is created][google.cloud.tasks.v2beta2.CloudTasks.BufferTask]. - * These headers represent a subset of the headers that will accompany the - * task's HTTP request. Some HTTP request headers will be ignored or replaced. - * A partial list of headers that will be ignored or replaced is: - * * Any header that is prefixed with "X-CloudTasks-" will be treated - * as service header. Service headers define properties of the task and are - * predefined in CloudTask. - * * Host: This will be computed by Cloud Tasks and derived from - * [HttpRequest.url][google.cloud.tasks.v2beta2.HttpRequest.url]. - * * Content-Length: This will be computed by Cloud Tasks. - * * User-Agent: This will be set to `"Google-CloudTasks"`. - * * `X-Google-*`: Google use only. - * * `X-AppEngine-*`: Google use only. - * `Content-Type` won't be set by Cloud Tasks. You can explicitly set - * `Content-Type` to a media type when the - * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - * For example, `Content-Type` can be set to `"application/octet-stream"` or - * `"application/json"`. - * Headers which can have multiple values (according to RFC2616) can be - * specified using comma-separated values. - * The size of the headers must be less than 80KB. - * Queue-level headers to override headers of all the tasks in the queue. - * @type \Google\Cloud\Tasks\V2beta2\OAuthToken $oauth_token - * If specified, an - * [OAuth token](https://developers.google.com/identity/protocols/OAuth2) - * will be generated and attached as an `Authorization` header in the HTTP - * request. - * This type of authorization should generally only be used when calling - * Google APIs hosted on *.googleapis.com. - * @type \Google\Cloud\Tasks\V2beta2\OidcToken $oidc_token - * If specified, an - * [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) - * token will be generated and attached as an `Authorization` header in the - * HTTP request. - * This type of authorization can be used for many scenarios, including - * calling Cloud Run, or endpoints where you intend to validate the token - * yourself. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Target::initOnce(); - parent::__construct($data); - } - - /** - * Uri override. - * When specified, overrides the execution Uri for all the tasks in the queue. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.UriOverride uri_override = 1; - * @return \Google\Cloud\Tasks\V2beta2\UriOverride|null - */ - public function getUriOverride() - { - return $this->uri_override; - } - - public function hasUriOverride() - { - return isset($this->uri_override); - } - - public function clearUriOverride() - { - unset($this->uri_override); - } - - /** - * Uri override. - * When specified, overrides the execution Uri for all the tasks in the queue. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.UriOverride uri_override = 1; - * @param \Google\Cloud\Tasks\V2beta2\UriOverride $var - * @return $this - */ - public function setUriOverride($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\UriOverride::class); - $this->uri_override = $var; - - return $this; - } - - /** - * The HTTP method to use for the request. - * When specified, it overrides - * [HttpRequest][google.cloud.tasks.v2beta2.HttpTarget.http_method] for the - * task. Note that if the value is set to [HttpMethod][GET] the - * [HttpRequest][body] of the task will be ignored at execution time. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.HttpMethod http_method = 2; - * @return int - */ - public function getHttpMethod() - { - return $this->http_method; - } - - /** - * The HTTP method to use for the request. - * When specified, it overrides - * [HttpRequest][google.cloud.tasks.v2beta2.HttpTarget.http_method] for the - * task. Note that if the value is set to [HttpMethod][GET] the - * [HttpRequest][body] of the task will be ignored at execution time. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.HttpMethod http_method = 2; - * @param int $var - * @return $this - */ - public function setHttpMethod($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta2\HttpMethod::class); - $this->http_method = $var; - - return $this; - } - - /** - * HTTP target headers. - * This map contains the header field names and values. - * Headers will be set when running the - * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] and/or - * [task is created][google.cloud.tasks.v2beta2.CloudTasks.BufferTask]. - * These headers represent a subset of the headers that will accompany the - * task's HTTP request. Some HTTP request headers will be ignored or replaced. - * A partial list of headers that will be ignored or replaced is: - * * Any header that is prefixed with "X-CloudTasks-" will be treated - * as service header. Service headers define properties of the task and are - * predefined in CloudTask. - * * Host: This will be computed by Cloud Tasks and derived from - * [HttpRequest.url][google.cloud.tasks.v2beta2.HttpRequest.url]. - * * Content-Length: This will be computed by Cloud Tasks. - * * User-Agent: This will be set to `"Google-CloudTasks"`. - * * `X-Google-*`: Google use only. - * * `X-AppEngine-*`: Google use only. - * `Content-Type` won't be set by Cloud Tasks. You can explicitly set - * `Content-Type` to a media type when the - * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - * For example, `Content-Type` can be set to `"application/octet-stream"` or - * `"application/json"`. - * Headers which can have multiple values (according to RFC2616) can be - * specified using comma-separated values. - * The size of the headers must be less than 80KB. - * Queue-level headers to override headers of all the tasks in the queue. - * - * Generated from protobuf field repeated .google.cloud.tasks.v2beta2.HttpTarget.HeaderOverride header_overrides = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getHeaderOverrides() - { - return $this->header_overrides; - } - - /** - * HTTP target headers. - * This map contains the header field names and values. - * Headers will be set when running the - * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] and/or - * [task is created][google.cloud.tasks.v2beta2.CloudTasks.BufferTask]. - * These headers represent a subset of the headers that will accompany the - * task's HTTP request. Some HTTP request headers will be ignored or replaced. - * A partial list of headers that will be ignored or replaced is: - * * Any header that is prefixed with "X-CloudTasks-" will be treated - * as service header. Service headers define properties of the task and are - * predefined in CloudTask. - * * Host: This will be computed by Cloud Tasks and derived from - * [HttpRequest.url][google.cloud.tasks.v2beta2.HttpRequest.url]. - * * Content-Length: This will be computed by Cloud Tasks. - * * User-Agent: This will be set to `"Google-CloudTasks"`. - * * `X-Google-*`: Google use only. - * * `X-AppEngine-*`: Google use only. - * `Content-Type` won't be set by Cloud Tasks. You can explicitly set - * `Content-Type` to a media type when the - * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - * For example, `Content-Type` can be set to `"application/octet-stream"` or - * `"application/json"`. - * Headers which can have multiple values (according to RFC2616) can be - * specified using comma-separated values. - * The size of the headers must be less than 80KB. - * Queue-level headers to override headers of all the tasks in the queue. - * - * Generated from protobuf field repeated .google.cloud.tasks.v2beta2.HttpTarget.HeaderOverride header_overrides = 3; - * @param array<\Google\Cloud\Tasks\V2beta2\HttpTarget\HeaderOverride>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setHeaderOverrides($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Tasks\V2beta2\HttpTarget\HeaderOverride::class); - $this->header_overrides = $arr; - - return $this; - } - - /** - * If specified, an - * [OAuth token](https://developers.google.com/identity/protocols/OAuth2) - * will be generated and attached as an `Authorization` header in the HTTP - * request. - * This type of authorization should generally only be used when calling - * Google APIs hosted on *.googleapis.com. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.OAuthToken oauth_token = 5; - * @return \Google\Cloud\Tasks\V2beta2\OAuthToken|null - */ - public function getOauthToken() - { - return $this->readOneof(5); - } - - public function hasOauthToken() - { - return $this->hasOneof(5); - } - - /** - * If specified, an - * [OAuth token](https://developers.google.com/identity/protocols/OAuth2) - * will be generated and attached as an `Authorization` header in the HTTP - * request. - * This type of authorization should generally only be used when calling - * Google APIs hosted on *.googleapis.com. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.OAuthToken oauth_token = 5; - * @param \Google\Cloud\Tasks\V2beta2\OAuthToken $var - * @return $this - */ - public function setOauthToken($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\OAuthToken::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * If specified, an - * [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) - * token will be generated and attached as an `Authorization` header in the - * HTTP request. - * This type of authorization can be used for many scenarios, including - * calling Cloud Run, or endpoints where you intend to validate the token - * yourself. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.OidcToken oidc_token = 6; - * @return \Google\Cloud\Tasks\V2beta2\OidcToken|null - */ - public function getOidcToken() - { - return $this->readOneof(6); - } - - public function hasOidcToken() - { - return $this->hasOneof(6); - } - - /** - * If specified, an - * [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) - * token will be generated and attached as an `Authorization` header in the - * HTTP request. - * This type of authorization can be used for many scenarios, including - * calling Cloud Run, or endpoints where you intend to validate the token - * yourself. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.OidcToken oidc_token = 6; - * @param \Google\Cloud\Tasks\V2beta2\OidcToken $var - * @return $this - */ - public function setOidcToken($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\OidcToken::class); - $this->writeOneof(6, $var); - - return $this; - } - - /** - * @return string - */ - public function getAuthorizationHeader() - { - return $this->whichOneof("authorization_header"); - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/HttpTarget/Header.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/HttpTarget/Header.php deleted file mode 100644 index 9ef84f7b4c64..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/HttpTarget/Header.php +++ /dev/null @@ -1,104 +0,0 @@ -google.cloud.tasks.v2beta2.HttpTarget.Header - */ -class Header extends \Google\Protobuf\Internal\Message -{ - /** - * The key of the header. - * - * Generated from protobuf field string key = 1; - */ - protected $key = ''; - /** - * The value of the header. - * - * Generated from protobuf field string value = 2; - */ - protected $value = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $key - * The key of the header. - * @type string $value - * The value of the header. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Target::initOnce(); - parent::__construct($data); - } - - /** - * The key of the header. - * - * Generated from protobuf field string key = 1; - * @return string - */ - public function getKey() - { - return $this->key; - } - - /** - * The key of the header. - * - * Generated from protobuf field string key = 1; - * @param string $var - * @return $this - */ - public function setKey($var) - { - GPBUtil::checkString($var, True); - $this->key = $var; - - return $this; - } - - /** - * The value of the header. - * - * Generated from protobuf field string value = 2; - * @return string - */ - public function getValue() - { - return $this->value; - } - - /** - * The value of the header. - * - * Generated from protobuf field string value = 2; - * @param string $var - * @return $this - */ - public function setValue($var) - { - GPBUtil::checkString($var, True); - $this->value = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Header::class, \Google\Cloud\Tasks\V2beta2\HttpTarget_Header::class); - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/HttpTarget/HeaderOverride.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/HttpTarget/HeaderOverride.php deleted file mode 100644 index 1581e46bffbb..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/HttpTarget/HeaderOverride.php +++ /dev/null @@ -1,80 +0,0 @@ -google.cloud.tasks.v2beta2.HttpTarget.HeaderOverride - */ -class HeaderOverride extends \Google\Protobuf\Internal\Message -{ - /** - * header embodying a key and a value. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.HttpTarget.Header header = 1; - */ - protected $header = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Tasks\V2beta2\HttpTarget\Header $header - * header embodying a key and a value. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Target::initOnce(); - parent::__construct($data); - } - - /** - * header embodying a key and a value. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.HttpTarget.Header header = 1; - * @return \Google\Cloud\Tasks\V2beta2\HttpTarget\Header|null - */ - public function getHeader() - { - return $this->header; - } - - public function hasHeader() - { - return isset($this->header); - } - - public function clearHeader() - { - unset($this->header); - } - - /** - * header embodying a key and a value. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.HttpTarget.Header header = 1; - * @param \Google\Cloud\Tasks\V2beta2\HttpTarget\Header $var - * @return $this - */ - public function setHeader($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\HttpTarget\Header::class); - $this->header = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(HeaderOverride::class, \Google\Cloud\Tasks\V2beta2\HttpTarget_HeaderOverride::class); - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/LeaseTasksRequest.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/LeaseTasksRequest.php deleted file mode 100644 index 2d91df19985e..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/LeaseTasksRequest.php +++ /dev/null @@ -1,442 +0,0 @@ -google.cloud.tasks.v2beta2.LeaseTasksRequest - */ -class LeaseTasksRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * The maximum number of tasks to lease. - * The system will make a best effort to return as close to as - * `max_tasks` as possible. - * The largest that `max_tasks` can be is 1000. - * The maximum total size of a [lease tasks - * response][google.cloud.tasks.v2beta2.LeaseTasksResponse] is 32 MB. If the - * sum of all task sizes requested reaches this limit, fewer tasks than - * requested are returned. - * - * Generated from protobuf field int32 max_tasks = 2; - */ - protected $max_tasks = 0; - /** - * Required. The duration of the lease. - * Each task returned in the - * [response][google.cloud.tasks.v2beta2.LeaseTasksResponse] will have its - * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] set to the - * current time plus the `lease_duration`. The task is leased until its - * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]; thus, the - * task will not be returned to another - * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] call before - * its [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]. - * After the worker has successfully finished the work associated - * with the task, the worker must call via - * [AcknowledgeTask][google.cloud.tasks.v2beta2.CloudTasks.AcknowledgeTask] - * before the [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]. - * Otherwise the task will be returned to a later - * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] call so that - * another worker can retry it. - * The maximum lease duration is 1 week. - * `lease_duration` will be truncated to the nearest second. - * - * Generated from protobuf field .google.protobuf.Duration lease_duration = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $lease_duration = null; - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta2.Task] will be returned. - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta2.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View response_view = 4; - */ - protected $response_view = 0; - /** - * `filter` can be used to specify a subset of tasks to lease. - * When `filter` is set to `tag=` then the - * [response][google.cloud.tasks.v2beta2.LeaseTasksResponse] will contain only - * tasks whose [tag][google.cloud.tasks.v2beta2.PullMessage.tag] is equal to - * ``. `` must be less than 500 characters. - * When `filter` is set to `tag_function=oldest_tag()`, only tasks which have - * the same tag as the task with the oldest - * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] will be - * returned. - * Grammar Syntax: - * * `filter = "tag=" tag | "tag_function=" function` - * * `tag = string` - * * `function = "oldest_tag()"` - * The `oldest_tag()` function returns tasks which have the same tag as the - * oldest task (ordered by schedule time). - * SDK compatibility: Although the SDK allows tags to be either - * string or - * [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), - * only UTF-8 encoded tags can be used in Cloud Tasks. Tag which - * aren't UTF-8 encoded can't be used in the - * [filter][google.cloud.tasks.v2beta2.LeaseTasksRequest.filter] and the - * task's [tag][google.cloud.tasks.v2beta2.PullMessage.tag] will be displayed - * as empty in Cloud Tasks. - * - * Generated from protobuf field string filter = 5; - */ - protected $filter = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * @type int $max_tasks - * The maximum number of tasks to lease. - * The system will make a best effort to return as close to as - * `max_tasks` as possible. - * The largest that `max_tasks` can be is 1000. - * The maximum total size of a [lease tasks - * response][google.cloud.tasks.v2beta2.LeaseTasksResponse] is 32 MB. If the - * sum of all task sizes requested reaches this limit, fewer tasks than - * requested are returned. - * @type \Google\Protobuf\Duration $lease_duration - * Required. The duration of the lease. - * Each task returned in the - * [response][google.cloud.tasks.v2beta2.LeaseTasksResponse] will have its - * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] set to the - * current time plus the `lease_duration`. The task is leased until its - * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]; thus, the - * task will not be returned to another - * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] call before - * its [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]. - * After the worker has successfully finished the work associated - * with the task, the worker must call via - * [AcknowledgeTask][google.cloud.tasks.v2beta2.CloudTasks.AcknowledgeTask] - * before the [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]. - * Otherwise the task will be returned to a later - * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] call so that - * another worker can retry it. - * The maximum lease duration is 1 week. - * `lease_duration` will be truncated to the nearest second. - * @type int $response_view - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta2.Task] will be returned. - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta2.Task] resource. - * @type string $filter - * `filter` can be used to specify a subset of tasks to lease. - * When `filter` is set to `tag=` then the - * [response][google.cloud.tasks.v2beta2.LeaseTasksResponse] will contain only - * tasks whose [tag][google.cloud.tasks.v2beta2.PullMessage.tag] is equal to - * ``. `` must be less than 500 characters. - * When `filter` is set to `tag_function=oldest_tag()`, only tasks which have - * the same tag as the task with the oldest - * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] will be - * returned. - * Grammar Syntax: - * * `filter = "tag=" tag | "tag_function=" function` - * * `tag = string` - * * `function = "oldest_tag()"` - * The `oldest_tag()` function returns tasks which have the same tag as the - * oldest task (ordered by schedule time). - * SDK compatibility: Although the SDK allows tags to be either - * string or - * [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), - * only UTF-8 encoded tags can be used in Cloud Tasks. Tag which - * aren't UTF-8 encoded can't be used in the - * [filter][google.cloud.tasks.v2beta2.LeaseTasksRequest.filter] and the - * task's [tag][google.cloud.tasks.v2beta2.PullMessage.tag] will be displayed - * as empty in Cloud Tasks. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * The maximum number of tasks to lease. - * The system will make a best effort to return as close to as - * `max_tasks` as possible. - * The largest that `max_tasks` can be is 1000. - * The maximum total size of a [lease tasks - * response][google.cloud.tasks.v2beta2.LeaseTasksResponse] is 32 MB. If the - * sum of all task sizes requested reaches this limit, fewer tasks than - * requested are returned. - * - * Generated from protobuf field int32 max_tasks = 2; - * @return int - */ - public function getMaxTasks() - { - return $this->max_tasks; - } - - /** - * The maximum number of tasks to lease. - * The system will make a best effort to return as close to as - * `max_tasks` as possible. - * The largest that `max_tasks` can be is 1000. - * The maximum total size of a [lease tasks - * response][google.cloud.tasks.v2beta2.LeaseTasksResponse] is 32 MB. If the - * sum of all task sizes requested reaches this limit, fewer tasks than - * requested are returned. - * - * Generated from protobuf field int32 max_tasks = 2; - * @param int $var - * @return $this - */ - public function setMaxTasks($var) - { - GPBUtil::checkInt32($var); - $this->max_tasks = $var; - - return $this; - } - - /** - * Required. The duration of the lease. - * Each task returned in the - * [response][google.cloud.tasks.v2beta2.LeaseTasksResponse] will have its - * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] set to the - * current time plus the `lease_duration`. The task is leased until its - * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]; thus, the - * task will not be returned to another - * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] call before - * its [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]. - * After the worker has successfully finished the work associated - * with the task, the worker must call via - * [AcknowledgeTask][google.cloud.tasks.v2beta2.CloudTasks.AcknowledgeTask] - * before the [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]. - * Otherwise the task will be returned to a later - * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] call so that - * another worker can retry it. - * The maximum lease duration is 1 week. - * `lease_duration` will be truncated to the nearest second. - * - * Generated from protobuf field .google.protobuf.Duration lease_duration = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Duration|null - */ - public function getLeaseDuration() - { - return $this->lease_duration; - } - - public function hasLeaseDuration() - { - return isset($this->lease_duration); - } - - public function clearLeaseDuration() - { - unset($this->lease_duration); - } - - /** - * Required. The duration of the lease. - * Each task returned in the - * [response][google.cloud.tasks.v2beta2.LeaseTasksResponse] will have its - * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] set to the - * current time plus the `lease_duration`. The task is leased until its - * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]; thus, the - * task will not be returned to another - * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] call before - * its [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]. - * After the worker has successfully finished the work associated - * with the task, the worker must call via - * [AcknowledgeTask][google.cloud.tasks.v2beta2.CloudTasks.AcknowledgeTask] - * before the [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]. - * Otherwise the task will be returned to a later - * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] call so that - * another worker can retry it. - * The maximum lease duration is 1 week. - * `lease_duration` will be truncated to the nearest second. - * - * Generated from protobuf field .google.protobuf.Duration lease_duration = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setLeaseDuration($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->lease_duration = $var; - - return $this; - } - - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta2.Task] will be returned. - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta2.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View response_view = 4; - * @return int - */ - public function getResponseView() - { - return $this->response_view; - } - - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta2.Task] will be returned. - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta2.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View response_view = 4; - * @param int $var - * @return $this - */ - public function setResponseView($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta2\Task\View::class); - $this->response_view = $var; - - return $this; - } - - /** - * `filter` can be used to specify a subset of tasks to lease. - * When `filter` is set to `tag=` then the - * [response][google.cloud.tasks.v2beta2.LeaseTasksResponse] will contain only - * tasks whose [tag][google.cloud.tasks.v2beta2.PullMessage.tag] is equal to - * ``. `` must be less than 500 characters. - * When `filter` is set to `tag_function=oldest_tag()`, only tasks which have - * the same tag as the task with the oldest - * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] will be - * returned. - * Grammar Syntax: - * * `filter = "tag=" tag | "tag_function=" function` - * * `tag = string` - * * `function = "oldest_tag()"` - * The `oldest_tag()` function returns tasks which have the same tag as the - * oldest task (ordered by schedule time). - * SDK compatibility: Although the SDK allows tags to be either - * string or - * [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), - * only UTF-8 encoded tags can be used in Cloud Tasks. Tag which - * aren't UTF-8 encoded can't be used in the - * [filter][google.cloud.tasks.v2beta2.LeaseTasksRequest.filter] and the - * task's [tag][google.cloud.tasks.v2beta2.PullMessage.tag] will be displayed - * as empty in Cloud Tasks. - * - * Generated from protobuf field string filter = 5; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * `filter` can be used to specify a subset of tasks to lease. - * When `filter` is set to `tag=` then the - * [response][google.cloud.tasks.v2beta2.LeaseTasksResponse] will contain only - * tasks whose [tag][google.cloud.tasks.v2beta2.PullMessage.tag] is equal to - * ``. `` must be less than 500 characters. - * When `filter` is set to `tag_function=oldest_tag()`, only tasks which have - * the same tag as the task with the oldest - * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] will be - * returned. - * Grammar Syntax: - * * `filter = "tag=" tag | "tag_function=" function` - * * `tag = string` - * * `function = "oldest_tag()"` - * The `oldest_tag()` function returns tasks which have the same tag as the - * oldest task (ordered by schedule time). - * SDK compatibility: Although the SDK allows tags to be either - * string or - * [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), - * only UTF-8 encoded tags can be used in Cloud Tasks. Tag which - * aren't UTF-8 encoded can't be used in the - * [filter][google.cloud.tasks.v2beta2.LeaseTasksRequest.filter] and the - * task's [tag][google.cloud.tasks.v2beta2.PullMessage.tag] will be displayed - * as empty in Cloud Tasks. - * - * Generated from protobuf field string filter = 5; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/LeaseTasksResponse.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/LeaseTasksResponse.php deleted file mode 100644 index fabd60efa760..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/LeaseTasksResponse.php +++ /dev/null @@ -1,68 +0,0 @@ -google.cloud.tasks.v2beta2.LeaseTasksResponse - */ -class LeaseTasksResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The leased tasks. - * - * Generated from protobuf field repeated .google.cloud.tasks.v2beta2.Task tasks = 1; - */ - private $tasks; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Tasks\V2beta2\Task>|\Google\Protobuf\Internal\RepeatedField $tasks - * The leased tasks. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * The leased tasks. - * - * Generated from protobuf field repeated .google.cloud.tasks.v2beta2.Task tasks = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTasks() - { - return $this->tasks; - } - - /** - * The leased tasks. - * - * Generated from protobuf field repeated .google.cloud.tasks.v2beta2.Task tasks = 1; - * @param array<\Google\Cloud\Tasks\V2beta2\Task>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTasks($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Tasks\V2beta2\Task::class); - $this->tasks = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ListQueuesRequest.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ListQueuesRequest.php deleted file mode 100644 index 4122c329b917..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ListQueuesRequest.php +++ /dev/null @@ -1,310 +0,0 @@ -google.cloud.tasks.v2beta2.ListQueuesRequest - */ -class ListQueuesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The location name. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * `filter` can be used to specify a subset of queues. Any - * [Queue][google.cloud.tasks.v2beta2.Queue] field can be used as a filter and - * several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The - * filter syntax is the same as described in [Stackdriver's Advanced Logs - * Filters](https://cloud.google.com/logging/docs/view/advanced_filters). - * Sample filter "app_engine_http_target: *". - * Note that using filters might cause fewer queues than the - * requested_page size to be returned. - * - * Generated from protobuf field string filter = 2; - */ - protected $filter = ''; - /** - * Requested page size. - * The maximum page size is 9800. If unspecified, the page size will - * be the maximum. Fewer queues than requested might be returned, - * even if more queues exist; use the - * [next_page_token][google.cloud.tasks.v2beta2.ListQueuesResponse.next_page_token] - * in the response to determine if more queues exist. - * - * Generated from protobuf field int32 page_size = 3; - */ - protected $page_size = 0; - /** - * A token identifying the page of results to return. - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * [next_page_token][google.cloud.tasks.v2beta2.ListQueuesResponse.next_page_token] - * returned from the previous call to - * [ListQueues][google.cloud.tasks.v2beta2.CloudTasks.ListQueues] method. It - * is an error to switch the value of the - * [filter][google.cloud.tasks.v2beta2.ListQueuesRequest.filter] while - * iterating through pages. - * - * Generated from protobuf field string page_token = 4; - */ - protected $page_token = ''; - /** - * Optional. Read mask is used for a more granular control over what the API - * returns. If the mask is not present all fields will be returned except - * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - * specified in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask read_mask = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $read_mask = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The location name. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * @type string $filter - * `filter` can be used to specify a subset of queues. Any - * [Queue][google.cloud.tasks.v2beta2.Queue] field can be used as a filter and - * several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The - * filter syntax is the same as described in [Stackdriver's Advanced Logs - * Filters](https://cloud.google.com/logging/docs/view/advanced_filters). - * Sample filter "app_engine_http_target: *". - * Note that using filters might cause fewer queues than the - * requested_page size to be returned. - * @type int $page_size - * Requested page size. - * The maximum page size is 9800. If unspecified, the page size will - * be the maximum. Fewer queues than requested might be returned, - * even if more queues exist; use the - * [next_page_token][google.cloud.tasks.v2beta2.ListQueuesResponse.next_page_token] - * in the response to determine if more queues exist. - * @type string $page_token - * A token identifying the page of results to return. - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * [next_page_token][google.cloud.tasks.v2beta2.ListQueuesResponse.next_page_token] - * returned from the previous call to - * [ListQueues][google.cloud.tasks.v2beta2.CloudTasks.ListQueues] method. It - * is an error to switch the value of the - * [filter][google.cloud.tasks.v2beta2.ListQueuesRequest.filter] while - * iterating through pages. - * @type \Google\Protobuf\FieldMask $read_mask - * Optional. Read mask is used for a more granular control over what the API - * returns. If the mask is not present all fields will be returned except - * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - * specified in the mask. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * Required. The location name. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The location name. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * `filter` can be used to specify a subset of queues. Any - * [Queue][google.cloud.tasks.v2beta2.Queue] field can be used as a filter and - * several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The - * filter syntax is the same as described in [Stackdriver's Advanced Logs - * Filters](https://cloud.google.com/logging/docs/view/advanced_filters). - * Sample filter "app_engine_http_target: *". - * Note that using filters might cause fewer queues than the - * requested_page size to be returned. - * - * Generated from protobuf field string filter = 2; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * `filter` can be used to specify a subset of queues. Any - * [Queue][google.cloud.tasks.v2beta2.Queue] field can be used as a filter and - * several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The - * filter syntax is the same as described in [Stackdriver's Advanced Logs - * Filters](https://cloud.google.com/logging/docs/view/advanced_filters). - * Sample filter "app_engine_http_target: *". - * Note that using filters might cause fewer queues than the - * requested_page size to be returned. - * - * Generated from protobuf field string filter = 2; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Requested page size. - * The maximum page size is 9800. If unspecified, the page size will - * be the maximum. Fewer queues than requested might be returned, - * even if more queues exist; use the - * [next_page_token][google.cloud.tasks.v2beta2.ListQueuesResponse.next_page_token] - * in the response to determine if more queues exist. - * - * Generated from protobuf field int32 page_size = 3; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Requested page size. - * The maximum page size is 9800. If unspecified, the page size will - * be the maximum. Fewer queues than requested might be returned, - * even if more queues exist; use the - * [next_page_token][google.cloud.tasks.v2beta2.ListQueuesResponse.next_page_token] - * in the response to determine if more queues exist. - * - * Generated from protobuf field int32 page_size = 3; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * A token identifying the page of results to return. - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * [next_page_token][google.cloud.tasks.v2beta2.ListQueuesResponse.next_page_token] - * returned from the previous call to - * [ListQueues][google.cloud.tasks.v2beta2.CloudTasks.ListQueues] method. It - * is an error to switch the value of the - * [filter][google.cloud.tasks.v2beta2.ListQueuesRequest.filter] while - * iterating through pages. - * - * Generated from protobuf field string page_token = 4; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A token identifying the page of results to return. - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * [next_page_token][google.cloud.tasks.v2beta2.ListQueuesResponse.next_page_token] - * returned from the previous call to - * [ListQueues][google.cloud.tasks.v2beta2.CloudTasks.ListQueues] method. It - * is an error to switch the value of the - * [filter][google.cloud.tasks.v2beta2.ListQueuesRequest.filter] while - * iterating through pages. - * - * Generated from protobuf field string page_token = 4; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * Optional. Read mask is used for a more granular control over what the API - * returns. If the mask is not present all fields will be returned except - * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - * specified in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask read_mask = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\FieldMask|null - */ - public function getReadMask() - { - return $this->read_mask; - } - - public function hasReadMask() - { - return isset($this->read_mask); - } - - public function clearReadMask() - { - unset($this->read_mask); - } - - /** - * Optional. Read mask is used for a more granular control over what the API - * returns. If the mask is not present all fields will be returned except - * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - * specified in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask read_mask = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setReadMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->read_mask = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ListQueuesResponse.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ListQueuesResponse.php deleted file mode 100644 index 921cdffddec0..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ListQueuesResponse.php +++ /dev/null @@ -1,126 +0,0 @@ -google.cloud.tasks.v2beta2.ListQueuesResponse - */ -class ListQueuesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of queues. - * - * Generated from protobuf field repeated .google.cloud.tasks.v2beta2.Queue queues = 1; - */ - private $queues; - /** - * A token to retrieve next page of results. - * To return the next page of results, call - * [ListQueues][google.cloud.tasks.v2beta2.CloudTasks.ListQueues] with this - * value as the - * [page_token][google.cloud.tasks.v2beta2.ListQueuesRequest.page_token]. - * If the next_page_token is empty, there are no more results. - * The page token is valid for only 2 hours. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Tasks\V2beta2\Queue>|\Google\Protobuf\Internal\RepeatedField $queues - * The list of queues. - * @type string $next_page_token - * A token to retrieve next page of results. - * To return the next page of results, call - * [ListQueues][google.cloud.tasks.v2beta2.CloudTasks.ListQueues] with this - * value as the - * [page_token][google.cloud.tasks.v2beta2.ListQueuesRequest.page_token]. - * If the next_page_token is empty, there are no more results. - * The page token is valid for only 2 hours. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * The list of queues. - * - * Generated from protobuf field repeated .google.cloud.tasks.v2beta2.Queue queues = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getQueues() - { - return $this->queues; - } - - /** - * The list of queues. - * - * Generated from protobuf field repeated .google.cloud.tasks.v2beta2.Queue queues = 1; - * @param array<\Google\Cloud\Tasks\V2beta2\Queue>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setQueues($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Tasks\V2beta2\Queue::class); - $this->queues = $arr; - - return $this; - } - - /** - * A token to retrieve next page of results. - * To return the next page of results, call - * [ListQueues][google.cloud.tasks.v2beta2.CloudTasks.ListQueues] with this - * value as the - * [page_token][google.cloud.tasks.v2beta2.ListQueuesRequest.page_token]. - * If the next_page_token is empty, there are no more results. - * The page token is valid for only 2 hours. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token to retrieve next page of results. - * To return the next page of results, call - * [ListQueues][google.cloud.tasks.v2beta2.CloudTasks.ListQueues] with this - * value as the - * [page_token][google.cloud.tasks.v2beta2.ListQueuesRequest.page_token]. - * If the next_page_token is empty, there are no more results. - * The page token is valid for only 2 hours. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ListTasksRequest.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ListTasksRequest.php deleted file mode 100644 index 493471606cf7..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ListTasksRequest.php +++ /dev/null @@ -1,258 +0,0 @@ -google.cloud.tasks.v2beta2.ListTasksRequest - */ -class ListTasksRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta2.Task] will be returned. - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta2.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View response_view = 2; - */ - protected $response_view = 0; - /** - * Maximum page size. - * Fewer tasks than requested might be returned, even if more tasks exist; use - * [next_page_token][google.cloud.tasks.v2beta2.ListTasksResponse.next_page_token] - * in the response to determine if more tasks exist. - * The maximum page size is 1000. If unspecified, the page size will be the - * maximum. - * - * Generated from protobuf field int32 page_size = 4; - */ - protected $page_size = 0; - /** - * A token identifying the page of results to return. - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * [next_page_token][google.cloud.tasks.v2beta2.ListTasksResponse.next_page_token] - * returned from the previous call to - * [ListTasks][google.cloud.tasks.v2beta2.CloudTasks.ListTasks] method. - * The page token is valid for only 2 hours. - * - * Generated from protobuf field string page_token = 5; - */ - protected $page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * @type int $response_view - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta2.Task] will be returned. - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta2.Task] resource. - * @type int $page_size - * Maximum page size. - * Fewer tasks than requested might be returned, even if more tasks exist; use - * [next_page_token][google.cloud.tasks.v2beta2.ListTasksResponse.next_page_token] - * in the response to determine if more tasks exist. - * The maximum page size is 1000. If unspecified, the page size will be the - * maximum. - * @type string $page_token - * A token identifying the page of results to return. - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * [next_page_token][google.cloud.tasks.v2beta2.ListTasksResponse.next_page_token] - * returned from the previous call to - * [ListTasks][google.cloud.tasks.v2beta2.CloudTasks.ListTasks] method. - * The page token is valid for only 2 hours. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta2.Task] will be returned. - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta2.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View response_view = 2; - * @return int - */ - public function getResponseView() - { - return $this->response_view; - } - - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta2.Task] will be returned. - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta2.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View response_view = 2; - * @param int $var - * @return $this - */ - public function setResponseView($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta2\Task\View::class); - $this->response_view = $var; - - return $this; - } - - /** - * Maximum page size. - * Fewer tasks than requested might be returned, even if more tasks exist; use - * [next_page_token][google.cloud.tasks.v2beta2.ListTasksResponse.next_page_token] - * in the response to determine if more tasks exist. - * The maximum page size is 1000. If unspecified, the page size will be the - * maximum. - * - * Generated from protobuf field int32 page_size = 4; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Maximum page size. - * Fewer tasks than requested might be returned, even if more tasks exist; use - * [next_page_token][google.cloud.tasks.v2beta2.ListTasksResponse.next_page_token] - * in the response to determine if more tasks exist. - * The maximum page size is 1000. If unspecified, the page size will be the - * maximum. - * - * Generated from protobuf field int32 page_size = 4; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * A token identifying the page of results to return. - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * [next_page_token][google.cloud.tasks.v2beta2.ListTasksResponse.next_page_token] - * returned from the previous call to - * [ListTasks][google.cloud.tasks.v2beta2.CloudTasks.ListTasks] method. - * The page token is valid for only 2 hours. - * - * Generated from protobuf field string page_token = 5; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A token identifying the page of results to return. - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * [next_page_token][google.cloud.tasks.v2beta2.ListTasksResponse.next_page_token] - * returned from the previous call to - * [ListTasks][google.cloud.tasks.v2beta2.CloudTasks.ListTasks] method. - * The page token is valid for only 2 hours. - * - * Generated from protobuf field string page_token = 5; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ListTasksResponse.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ListTasksResponse.php deleted file mode 100644 index 1b085c352083..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ListTasksResponse.php +++ /dev/null @@ -1,122 +0,0 @@ -google.cloud.tasks.v2beta2.ListTasksResponse - */ -class ListTasksResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of tasks. - * - * Generated from protobuf field repeated .google.cloud.tasks.v2beta2.Task tasks = 1; - */ - private $tasks; - /** - * A token to retrieve next page of results. - * To return the next page of results, call - * [ListTasks][google.cloud.tasks.v2beta2.CloudTasks.ListTasks] with this - * value as the - * [page_token][google.cloud.tasks.v2beta2.ListTasksRequest.page_token]. - * If the next_page_token is empty, there are no more results. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Tasks\V2beta2\Task>|\Google\Protobuf\Internal\RepeatedField $tasks - * The list of tasks. - * @type string $next_page_token - * A token to retrieve next page of results. - * To return the next page of results, call - * [ListTasks][google.cloud.tasks.v2beta2.CloudTasks.ListTasks] with this - * value as the - * [page_token][google.cloud.tasks.v2beta2.ListTasksRequest.page_token]. - * If the next_page_token is empty, there are no more results. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * The list of tasks. - * - * Generated from protobuf field repeated .google.cloud.tasks.v2beta2.Task tasks = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTasks() - { - return $this->tasks; - } - - /** - * The list of tasks. - * - * Generated from protobuf field repeated .google.cloud.tasks.v2beta2.Task tasks = 1; - * @param array<\Google\Cloud\Tasks\V2beta2\Task>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTasks($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Tasks\V2beta2\Task::class); - $this->tasks = $arr; - - return $this; - } - - /** - * A token to retrieve next page of results. - * To return the next page of results, call - * [ListTasks][google.cloud.tasks.v2beta2.CloudTasks.ListTasks] with this - * value as the - * [page_token][google.cloud.tasks.v2beta2.ListTasksRequest.page_token]. - * If the next_page_token is empty, there are no more results. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token to retrieve next page of results. - * To return the next page of results, call - * [ListTasks][google.cloud.tasks.v2beta2.CloudTasks.ListTasks] with this - * value as the - * [page_token][google.cloud.tasks.v2beta2.ListTasksRequest.page_token]. - * If the next_page_token is empty, there are no more results. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/OAuthToken.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/OAuthToken.php deleted file mode 100644 index 2753f9fc25ca..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/OAuthToken.php +++ /dev/null @@ -1,128 +0,0 @@ -google.cloud.tasks.v2beta2.OAuthToken - */ -class OAuthToken extends \Google\Protobuf\Internal\Message -{ - /** - * [Service account email](https://cloud.google.com/iam/docs/service-accounts) - * to be used for generating OAuth token. - * The service account must be within the same project as the queue. The - * caller must have iam.serviceAccounts.actAs permission for the service - * account. - * - * Generated from protobuf field string service_account_email = 1; - */ - protected $service_account_email = ''; - /** - * OAuth scope to be used for generating OAuth access token. - * If not specified, "https://www.googleapis.com/auth/cloud-platform" - * will be used. - * - * Generated from protobuf field string scope = 2; - */ - protected $scope = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $service_account_email - * [Service account email](https://cloud.google.com/iam/docs/service-accounts) - * to be used for generating OAuth token. - * The service account must be within the same project as the queue. The - * caller must have iam.serviceAccounts.actAs permission for the service - * account. - * @type string $scope - * OAuth scope to be used for generating OAuth access token. - * If not specified, "https://www.googleapis.com/auth/cloud-platform" - * will be used. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Target::initOnce(); - parent::__construct($data); - } - - /** - * [Service account email](https://cloud.google.com/iam/docs/service-accounts) - * to be used for generating OAuth token. - * The service account must be within the same project as the queue. The - * caller must have iam.serviceAccounts.actAs permission for the service - * account. - * - * Generated from protobuf field string service_account_email = 1; - * @return string - */ - public function getServiceAccountEmail() - { - return $this->service_account_email; - } - - /** - * [Service account email](https://cloud.google.com/iam/docs/service-accounts) - * to be used for generating OAuth token. - * The service account must be within the same project as the queue. The - * caller must have iam.serviceAccounts.actAs permission for the service - * account. - * - * Generated from protobuf field string service_account_email = 1; - * @param string $var - * @return $this - */ - public function setServiceAccountEmail($var) - { - GPBUtil::checkString($var, True); - $this->service_account_email = $var; - - return $this; - } - - /** - * OAuth scope to be used for generating OAuth access token. - * If not specified, "https://www.googleapis.com/auth/cloud-platform" - * will be used. - * - * Generated from protobuf field string scope = 2; - * @return string - */ - public function getScope() - { - return $this->scope; - } - - /** - * OAuth scope to be used for generating OAuth access token. - * If not specified, "https://www.googleapis.com/auth/cloud-platform" - * will be used. - * - * Generated from protobuf field string scope = 2; - * @param string $var - * @return $this - */ - public function setScope($var) - { - GPBUtil::checkString($var, True); - $this->scope = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/OidcToken.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/OidcToken.php deleted file mode 100644 index 91cdd96f6482..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/OidcToken.php +++ /dev/null @@ -1,126 +0,0 @@ -google.cloud.tasks.v2beta2.OidcToken - */ -class OidcToken extends \Google\Protobuf\Internal\Message -{ - /** - * [Service account email](https://cloud.google.com/iam/docs/service-accounts) - * to be used for generating OIDC token. - * The service account must be within the same project as the queue. The - * caller must have iam.serviceAccounts.actAs permission for the service - * account. - * - * Generated from protobuf field string service_account_email = 1; - */ - protected $service_account_email = ''; - /** - * Audience to be used when generating OIDC token. If not specified, the URI - * specified in target will be used. - * - * Generated from protobuf field string audience = 2; - */ - protected $audience = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $service_account_email - * [Service account email](https://cloud.google.com/iam/docs/service-accounts) - * to be used for generating OIDC token. - * The service account must be within the same project as the queue. The - * caller must have iam.serviceAccounts.actAs permission for the service - * account. - * @type string $audience - * Audience to be used when generating OIDC token. If not specified, the URI - * specified in target will be used. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Target::initOnce(); - parent::__construct($data); - } - - /** - * [Service account email](https://cloud.google.com/iam/docs/service-accounts) - * to be used for generating OIDC token. - * The service account must be within the same project as the queue. The - * caller must have iam.serviceAccounts.actAs permission for the service - * account. - * - * Generated from protobuf field string service_account_email = 1; - * @return string - */ - public function getServiceAccountEmail() - { - return $this->service_account_email; - } - - /** - * [Service account email](https://cloud.google.com/iam/docs/service-accounts) - * to be used for generating OIDC token. - * The service account must be within the same project as the queue. The - * caller must have iam.serviceAccounts.actAs permission for the service - * account. - * - * Generated from protobuf field string service_account_email = 1; - * @param string $var - * @return $this - */ - public function setServiceAccountEmail($var) - { - GPBUtil::checkString($var, True); - $this->service_account_email = $var; - - return $this; - } - - /** - * Audience to be used when generating OIDC token. If not specified, the URI - * specified in target will be used. - * - * Generated from protobuf field string audience = 2; - * @return string - */ - public function getAudience() - { - return $this->audience; - } - - /** - * Audience to be used when generating OIDC token. If not specified, the URI - * specified in target will be used. - * - * Generated from protobuf field string audience = 2; - * @param string $var - * @return $this - */ - public function setAudience($var) - { - GPBUtil::checkString($var, True); - $this->audience = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PathOverride.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PathOverride.php deleted file mode 100644 index 28b7445fa458..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PathOverride.php +++ /dev/null @@ -1,68 +0,0 @@ -google.cloud.tasks.v2beta2.PathOverride - */ -class PathOverride extends \Google\Protobuf\Internal\Message -{ - /** - * The URI path (e.g., /users/1234). Default is an empty string. - * - * Generated from protobuf field string path = 1; - */ - protected $path = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $path - * The URI path (e.g., /users/1234). Default is an empty string. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Target::initOnce(); - parent::__construct($data); - } - - /** - * The URI path (e.g., /users/1234). Default is an empty string. - * - * Generated from protobuf field string path = 1; - * @return string - */ - public function getPath() - { - return $this->path; - } - - /** - * The URI path (e.g., /users/1234). Default is an empty string. - * - * Generated from protobuf field string path = 1; - * @param string $var - * @return $this - */ - public function setPath($var) - { - GPBUtil::checkString($var, True); - $this->path = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PauseQueueRequest.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PauseQueueRequest.php deleted file mode 100644 index 564bea2de0a6..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PauseQueueRequest.php +++ /dev/null @@ -1,72 +0,0 @@ -google.cloud.tasks.v2beta2.PauseQueueRequest - */ -class PauseQueueRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PullMessage.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PullMessage.php deleted file mode 100644 index 06bfe1eb2054..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PullMessage.php +++ /dev/null @@ -1,165 +0,0 @@ -google.cloud.tasks.v2beta2.PullMessage - */ -class PullMessage extends \Google\Protobuf\Internal\Message -{ - /** - * A data payload consumed by the worker to execute the task. - * - * Generated from protobuf field bytes payload = 1; - */ - protected $payload = ''; - /** - * The task's tag. - * Tags allow similar tasks to be processed in a batch. If you label - * tasks with a tag, your worker can - * [lease tasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] with the - * same tag using - * [filter][google.cloud.tasks.v2beta2.LeaseTasksRequest.filter]. For example, - * if you want to aggregate the events associated with a specific user once a - * day, you could tag tasks with the user ID. - * The task's tag can only be set when the - * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. - * The tag must be less than 500 characters. - * SDK compatibility: Although the SDK allows tags to be either - * string or - * [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), - * only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8 - * encoded, the tag will be empty when the task is returned by Cloud Tasks. - * - * Generated from protobuf field string tag = 2; - */ - protected $tag = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $payload - * A data payload consumed by the worker to execute the task. - * @type string $tag - * The task's tag. - * Tags allow similar tasks to be processed in a batch. If you label - * tasks with a tag, your worker can - * [lease tasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] with the - * same tag using - * [filter][google.cloud.tasks.v2beta2.LeaseTasksRequest.filter]. For example, - * if you want to aggregate the events associated with a specific user once a - * day, you could tag tasks with the user ID. - * The task's tag can only be set when the - * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. - * The tag must be less than 500 characters. - * SDK compatibility: Although the SDK allows tags to be either - * string or - * [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), - * only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8 - * encoded, the tag will be empty when the task is returned by Cloud Tasks. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Target::initOnce(); - parent::__construct($data); - } - - /** - * A data payload consumed by the worker to execute the task. - * - * Generated from protobuf field bytes payload = 1; - * @return string - */ - public function getPayload() - { - return $this->payload; - } - - /** - * A data payload consumed by the worker to execute the task. - * - * Generated from protobuf field bytes payload = 1; - * @param string $var - * @return $this - */ - public function setPayload($var) - { - GPBUtil::checkString($var, False); - $this->payload = $var; - - return $this; - } - - /** - * The task's tag. - * Tags allow similar tasks to be processed in a batch. If you label - * tasks with a tag, your worker can - * [lease tasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] with the - * same tag using - * [filter][google.cloud.tasks.v2beta2.LeaseTasksRequest.filter]. For example, - * if you want to aggregate the events associated with a specific user once a - * day, you could tag tasks with the user ID. - * The task's tag can only be set when the - * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. - * The tag must be less than 500 characters. - * SDK compatibility: Although the SDK allows tags to be either - * string or - * [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), - * only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8 - * encoded, the tag will be empty when the task is returned by Cloud Tasks. - * - * Generated from protobuf field string tag = 2; - * @return string - */ - public function getTag() - { - return $this->tag; - } - - /** - * The task's tag. - * Tags allow similar tasks to be processed in a batch. If you label - * tasks with a tag, your worker can - * [lease tasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] with the - * same tag using - * [filter][google.cloud.tasks.v2beta2.LeaseTasksRequest.filter]. For example, - * if you want to aggregate the events associated with a specific user once a - * day, you could tag tasks with the user ID. - * The task's tag can only be set when the - * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. - * The tag must be less than 500 characters. - * SDK compatibility: Although the SDK allows tags to be either - * string or - * [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), - * only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8 - * encoded, the tag will be empty when the task is returned by Cloud Tasks. - * - * Generated from protobuf field string tag = 2; - * @param string $var - * @return $this - */ - public function setTag($var) - { - GPBUtil::checkString($var, True); - $this->tag = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PullTarget.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PullTarget.php deleted file mode 100644 index 32baa5104df5..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PullTarget.php +++ /dev/null @@ -1,33 +0,0 @@ -google.cloud.tasks.v2beta2.PullTarget - */ -class PullTarget extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Target::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PurgeQueueRequest.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PurgeQueueRequest.php deleted file mode 100644 index 0b46a038df4b..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PurgeQueueRequest.php +++ /dev/null @@ -1,72 +0,0 @@ -google.cloud.tasks.v2beta2.PurgeQueueRequest - */ -class PurgeQueueRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/QueryOverride.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/QueryOverride.php deleted file mode 100644 index 2bbe1049c6e7..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/QueryOverride.php +++ /dev/null @@ -1,72 +0,0 @@ -google.cloud.tasks.v2beta2.QueryOverride - */ -class QueryOverride extends \Google\Protobuf\Internal\Message -{ - /** - * The query parameters (e.g., qparam1=123&qparam2=456). Default is an empty - * string. - * - * Generated from protobuf field string query_params = 1; - */ - protected $query_params = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $query_params - * The query parameters (e.g., qparam1=123&qparam2=456). Default is an empty - * string. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Target::initOnce(); - parent::__construct($data); - } - - /** - * The query parameters (e.g., qparam1=123&qparam2=456). Default is an empty - * string. - * - * Generated from protobuf field string query_params = 1; - * @return string - */ - public function getQueryParams() - { - return $this->query_params; - } - - /** - * The query parameters (e.g., qparam1=123&qparam2=456). Default is an empty - * string. - * - * Generated from protobuf field string query_params = 1; - * @param string $var - * @return $this - */ - public function setQueryParams($var) - { - GPBUtil::checkString($var, True); - $this->query_params = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Queue.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Queue.php deleted file mode 100644 index 405393e6f812..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Queue.php +++ /dev/null @@ -1,771 +0,0 @@ -google.cloud.tasks.v2beta2.Queue - */ -class Queue extends \Google\Protobuf\Internal\Message -{ - /** - * Caller-specified and required in - * [CreateQueue][google.cloud.tasks.v2beta2.CloudTasks.CreateQueue], after - * which it becomes output only. - * The queue name. - * The queue name must have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - * hyphens (-), colons (:), or periods (.). - * For more information, see - * [Identifying - * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) - * * `LOCATION_ID` is the canonical ID for the queue's location. - * The list of available locations can be obtained by calling - * [ListLocations][google.cloud.location.Locations.ListLocations]. - * For more information, see https://cloud.google.com/about/locations/. - * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or - * hyphens (-). The maximum length is 100 characters. - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * Rate limits for task dispatches. - * [rate_limits][google.cloud.tasks.v2beta2.Queue.rate_limits] and - * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] are related - * because they both control task attempts however they control how tasks are - * attempted in different ways: - * * [rate_limits][google.cloud.tasks.v2beta2.Queue.rate_limits] controls the - * total rate of - * dispatches from a queue (i.e. all traffic dispatched from the - * queue, regardless of whether the dispatch is from a first - * attempt or a retry). - * * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] controls - * what happens to - * particular a task after its first attempt fails. That is, - * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] controls - * task retries (the second attempt, third attempt, etc). - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.RateLimits rate_limits = 5; - */ - protected $rate_limits = null; - /** - * Settings that determine the retry behavior. - * * For tasks created using Cloud Tasks: the queue-level retry settings - * apply to all tasks in the queue that were created using Cloud Tasks. - * Retry settings cannot be set on individual tasks. - * * For tasks created using the App Engine SDK: the queue-level retry - * settings apply to all tasks in the queue which do not have retry settings - * explicitly set on the task and were created by the App Engine SDK. See - * [App Engine - * documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks). - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.RetryConfig retry_config = 6; - */ - protected $retry_config = null; - /** - * Output only. The state of the queue. - * `state` can only be changed by called - * [PauseQueue][google.cloud.tasks.v2beta2.CloudTasks.PauseQueue], - * [ResumeQueue][google.cloud.tasks.v2beta2.CloudTasks.ResumeQueue], or - * uploading - * [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref). - * [UpdateQueue][google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue] cannot be - * used to change `state`. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.Queue.State state = 7; - */ - protected $state = 0; - /** - * Output only. The last time this queue was purged. - * All tasks that were [created][google.cloud.tasks.v2beta2.Task.create_time] - * before this time were purged. - * A queue can be purged using - * [PurgeQueue][google.cloud.tasks.v2beta2.CloudTasks.PurgeQueue], the [App - * Engine Task Queue SDK, or the Cloud - * Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue). - * Purge time will be truncated to the nearest microsecond. Purge - * time will be unset if the queue has never been purged. - * - * Generated from protobuf field .google.protobuf.Timestamp purge_time = 8; - */ - protected $purge_time = null; - /** - * The maximum amount of time that a task will be retained in - * this queue. - * Queues created by Cloud Tasks have a default `task_ttl` of 31 days. - * After a task has lived for `task_ttl`, the task will be deleted - * regardless of whether it was dispatched or not. - * The `task_ttl` for queues created via queue.yaml/xml is equal to the - * maximum duration because there is a - * [storage quota](https://cloud.google.com/appengine/quotas#Task_Queue) for - * these queues. To view the maximum valid duration, see the documentation for - * [Duration][google.protobuf.Duration]. - * - * Generated from protobuf field .google.protobuf.Duration task_ttl = 9; - */ - protected $task_ttl = null; - /** - * The task tombstone time to live (TTL). - * After a task is deleted or completed, the task's tombstone is - * retained for the length of time specified by `tombstone_ttl`. - * The tombstone is used by task de-duplication; another task with the same - * name can't be created until the tombstone has expired. For more information - * about task de-duplication, see the documentation for - * [CreateTaskRequest][google.cloud.tasks.v2beta2.CreateTaskRequest.task]. - * Queues created by Cloud Tasks have a default `tombstone_ttl` of 1 hour. - * - * Generated from protobuf field .google.protobuf.Duration tombstone_ttl = 10; - */ - protected $tombstone_ttl = null; - /** - * Output only. The realtime, informational statistics for a queue. In order - * to receive the statistics the caller should include this field in the - * FieldMask. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.QueueStats stats = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $stats = null; - protected $target_type; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Caller-specified and required in - * [CreateQueue][google.cloud.tasks.v2beta2.CloudTasks.CreateQueue], after - * which it becomes output only. - * The queue name. - * The queue name must have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - * hyphens (-), colons (:), or periods (.). - * For more information, see - * [Identifying - * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) - * * `LOCATION_ID` is the canonical ID for the queue's location. - * The list of available locations can be obtained by calling - * [ListLocations][google.cloud.location.Locations.ListLocations]. - * For more information, see https://cloud.google.com/about/locations/. - * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or - * hyphens (-). The maximum length is 100 characters. - * @type \Google\Cloud\Tasks\V2beta2\AppEngineHttpTarget $app_engine_http_target - * App Engine HTTP target. - * An App Engine queue is a queue that has an - * [AppEngineHttpTarget][google.cloud.tasks.v2beta2.AppEngineHttpTarget]. - * @type \Google\Cloud\Tasks\V2beta2\PullTarget $pull_target - * Pull target. - * A pull queue is a queue that has a - * [PullTarget][google.cloud.tasks.v2beta2.PullTarget]. - * @type \Google\Cloud\Tasks\V2beta2\HttpTarget $http_target - * An http_target is used to override the target values for HTTP tasks. - * @type \Google\Cloud\Tasks\V2beta2\RateLimits $rate_limits - * Rate limits for task dispatches. - * [rate_limits][google.cloud.tasks.v2beta2.Queue.rate_limits] and - * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] are related - * because they both control task attempts however they control how tasks are - * attempted in different ways: - * * [rate_limits][google.cloud.tasks.v2beta2.Queue.rate_limits] controls the - * total rate of - * dispatches from a queue (i.e. all traffic dispatched from the - * queue, regardless of whether the dispatch is from a first - * attempt or a retry). - * * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] controls - * what happens to - * particular a task after its first attempt fails. That is, - * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] controls - * task retries (the second attempt, third attempt, etc). - * @type \Google\Cloud\Tasks\V2beta2\RetryConfig $retry_config - * Settings that determine the retry behavior. - * * For tasks created using Cloud Tasks: the queue-level retry settings - * apply to all tasks in the queue that were created using Cloud Tasks. - * Retry settings cannot be set on individual tasks. - * * For tasks created using the App Engine SDK: the queue-level retry - * settings apply to all tasks in the queue which do not have retry settings - * explicitly set on the task and were created by the App Engine SDK. See - * [App Engine - * documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks). - * @type int $state - * Output only. The state of the queue. - * `state` can only be changed by called - * [PauseQueue][google.cloud.tasks.v2beta2.CloudTasks.PauseQueue], - * [ResumeQueue][google.cloud.tasks.v2beta2.CloudTasks.ResumeQueue], or - * uploading - * [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref). - * [UpdateQueue][google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue] cannot be - * used to change `state`. - * @type \Google\Protobuf\Timestamp $purge_time - * Output only. The last time this queue was purged. - * All tasks that were [created][google.cloud.tasks.v2beta2.Task.create_time] - * before this time were purged. - * A queue can be purged using - * [PurgeQueue][google.cloud.tasks.v2beta2.CloudTasks.PurgeQueue], the [App - * Engine Task Queue SDK, or the Cloud - * Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue). - * Purge time will be truncated to the nearest microsecond. Purge - * time will be unset if the queue has never been purged. - * @type \Google\Protobuf\Duration $task_ttl - * The maximum amount of time that a task will be retained in - * this queue. - * Queues created by Cloud Tasks have a default `task_ttl` of 31 days. - * After a task has lived for `task_ttl`, the task will be deleted - * regardless of whether it was dispatched or not. - * The `task_ttl` for queues created via queue.yaml/xml is equal to the - * maximum duration because there is a - * [storage quota](https://cloud.google.com/appengine/quotas#Task_Queue) for - * these queues. To view the maximum valid duration, see the documentation for - * [Duration][google.protobuf.Duration]. - * @type \Google\Protobuf\Duration $tombstone_ttl - * The task tombstone time to live (TTL). - * After a task is deleted or completed, the task's tombstone is - * retained for the length of time specified by `tombstone_ttl`. - * The tombstone is used by task de-duplication; another task with the same - * name can't be created until the tombstone has expired. For more information - * about task de-duplication, see the documentation for - * [CreateTaskRequest][google.cloud.tasks.v2beta2.CreateTaskRequest.task]. - * Queues created by Cloud Tasks have a default `tombstone_ttl` of 1 hour. - * @type \Google\Cloud\Tasks\V2beta2\QueueStats $stats - * Output only. The realtime, informational statistics for a queue. In order - * to receive the statistics the caller should include this field in the - * FieldMask. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Queue::initOnce(); - parent::__construct($data); - } - - /** - * Caller-specified and required in - * [CreateQueue][google.cloud.tasks.v2beta2.CloudTasks.CreateQueue], after - * which it becomes output only. - * The queue name. - * The queue name must have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - * hyphens (-), colons (:), or periods (.). - * For more information, see - * [Identifying - * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) - * * `LOCATION_ID` is the canonical ID for the queue's location. - * The list of available locations can be obtained by calling - * [ListLocations][google.cloud.location.Locations.ListLocations]. - * For more information, see https://cloud.google.com/about/locations/. - * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or - * hyphens (-). The maximum length is 100 characters. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Caller-specified and required in - * [CreateQueue][google.cloud.tasks.v2beta2.CloudTasks.CreateQueue], after - * which it becomes output only. - * The queue name. - * The queue name must have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - * hyphens (-), colons (:), or periods (.). - * For more information, see - * [Identifying - * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) - * * `LOCATION_ID` is the canonical ID for the queue's location. - * The list of available locations can be obtained by calling - * [ListLocations][google.cloud.location.Locations.ListLocations]. - * For more information, see https://cloud.google.com/about/locations/. - * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or - * hyphens (-). The maximum length is 100 characters. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * App Engine HTTP target. - * An App Engine queue is a queue that has an - * [AppEngineHttpTarget][google.cloud.tasks.v2beta2.AppEngineHttpTarget]. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.AppEngineHttpTarget app_engine_http_target = 3; - * @return \Google\Cloud\Tasks\V2beta2\AppEngineHttpTarget|null - */ - public function getAppEngineHttpTarget() - { - return $this->readOneof(3); - } - - public function hasAppEngineHttpTarget() - { - return $this->hasOneof(3); - } - - /** - * App Engine HTTP target. - * An App Engine queue is a queue that has an - * [AppEngineHttpTarget][google.cloud.tasks.v2beta2.AppEngineHttpTarget]. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.AppEngineHttpTarget app_engine_http_target = 3; - * @param \Google\Cloud\Tasks\V2beta2\AppEngineHttpTarget $var - * @return $this - */ - public function setAppEngineHttpTarget($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\AppEngineHttpTarget::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Pull target. - * A pull queue is a queue that has a - * [PullTarget][google.cloud.tasks.v2beta2.PullTarget]. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.PullTarget pull_target = 4; - * @return \Google\Cloud\Tasks\V2beta2\PullTarget|null - */ - public function getPullTarget() - { - return $this->readOneof(4); - } - - public function hasPullTarget() - { - return $this->hasOneof(4); - } - - /** - * Pull target. - * A pull queue is a queue that has a - * [PullTarget][google.cloud.tasks.v2beta2.PullTarget]. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.PullTarget pull_target = 4; - * @param \Google\Cloud\Tasks\V2beta2\PullTarget $var - * @return $this - */ - public function setPullTarget($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\PullTarget::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * An http_target is used to override the target values for HTTP tasks. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.HttpTarget http_target = 17; - * @return \Google\Cloud\Tasks\V2beta2\HttpTarget|null - */ - public function getHttpTarget() - { - return $this->readOneof(17); - } - - public function hasHttpTarget() - { - return $this->hasOneof(17); - } - - /** - * An http_target is used to override the target values for HTTP tasks. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.HttpTarget http_target = 17; - * @param \Google\Cloud\Tasks\V2beta2\HttpTarget $var - * @return $this - */ - public function setHttpTarget($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\HttpTarget::class); - $this->writeOneof(17, $var); - - return $this; - } - - /** - * Rate limits for task dispatches. - * [rate_limits][google.cloud.tasks.v2beta2.Queue.rate_limits] and - * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] are related - * because they both control task attempts however they control how tasks are - * attempted in different ways: - * * [rate_limits][google.cloud.tasks.v2beta2.Queue.rate_limits] controls the - * total rate of - * dispatches from a queue (i.e. all traffic dispatched from the - * queue, regardless of whether the dispatch is from a first - * attempt or a retry). - * * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] controls - * what happens to - * particular a task after its first attempt fails. That is, - * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] controls - * task retries (the second attempt, third attempt, etc). - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.RateLimits rate_limits = 5; - * @return \Google\Cloud\Tasks\V2beta2\RateLimits|null - */ - public function getRateLimits() - { - return $this->rate_limits; - } - - public function hasRateLimits() - { - return isset($this->rate_limits); - } - - public function clearRateLimits() - { - unset($this->rate_limits); - } - - /** - * Rate limits for task dispatches. - * [rate_limits][google.cloud.tasks.v2beta2.Queue.rate_limits] and - * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] are related - * because they both control task attempts however they control how tasks are - * attempted in different ways: - * * [rate_limits][google.cloud.tasks.v2beta2.Queue.rate_limits] controls the - * total rate of - * dispatches from a queue (i.e. all traffic dispatched from the - * queue, regardless of whether the dispatch is from a first - * attempt or a retry). - * * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] controls - * what happens to - * particular a task after its first attempt fails. That is, - * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] controls - * task retries (the second attempt, third attempt, etc). - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.RateLimits rate_limits = 5; - * @param \Google\Cloud\Tasks\V2beta2\RateLimits $var - * @return $this - */ - public function setRateLimits($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\RateLimits::class); - $this->rate_limits = $var; - - return $this; - } - - /** - * Settings that determine the retry behavior. - * * For tasks created using Cloud Tasks: the queue-level retry settings - * apply to all tasks in the queue that were created using Cloud Tasks. - * Retry settings cannot be set on individual tasks. - * * For tasks created using the App Engine SDK: the queue-level retry - * settings apply to all tasks in the queue which do not have retry settings - * explicitly set on the task and were created by the App Engine SDK. See - * [App Engine - * documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks). - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.RetryConfig retry_config = 6; - * @return \Google\Cloud\Tasks\V2beta2\RetryConfig|null - */ - public function getRetryConfig() - { - return $this->retry_config; - } - - public function hasRetryConfig() - { - return isset($this->retry_config); - } - - public function clearRetryConfig() - { - unset($this->retry_config); - } - - /** - * Settings that determine the retry behavior. - * * For tasks created using Cloud Tasks: the queue-level retry settings - * apply to all tasks in the queue that were created using Cloud Tasks. - * Retry settings cannot be set on individual tasks. - * * For tasks created using the App Engine SDK: the queue-level retry - * settings apply to all tasks in the queue which do not have retry settings - * explicitly set on the task and were created by the App Engine SDK. See - * [App Engine - * documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks). - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.RetryConfig retry_config = 6; - * @param \Google\Cloud\Tasks\V2beta2\RetryConfig $var - * @return $this - */ - public function setRetryConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\RetryConfig::class); - $this->retry_config = $var; - - return $this; - } - - /** - * Output only. The state of the queue. - * `state` can only be changed by called - * [PauseQueue][google.cloud.tasks.v2beta2.CloudTasks.PauseQueue], - * [ResumeQueue][google.cloud.tasks.v2beta2.CloudTasks.ResumeQueue], or - * uploading - * [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref). - * [UpdateQueue][google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue] cannot be - * used to change `state`. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.Queue.State state = 7; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The state of the queue. - * `state` can only be changed by called - * [PauseQueue][google.cloud.tasks.v2beta2.CloudTasks.PauseQueue], - * [ResumeQueue][google.cloud.tasks.v2beta2.CloudTasks.ResumeQueue], or - * uploading - * [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref). - * [UpdateQueue][google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue] cannot be - * used to change `state`. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.Queue.State state = 7; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta2\Queue\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. The last time this queue was purged. - * All tasks that were [created][google.cloud.tasks.v2beta2.Task.create_time] - * before this time were purged. - * A queue can be purged using - * [PurgeQueue][google.cloud.tasks.v2beta2.CloudTasks.PurgeQueue], the [App - * Engine Task Queue SDK, or the Cloud - * Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue). - * Purge time will be truncated to the nearest microsecond. Purge - * time will be unset if the queue has never been purged. - * - * Generated from protobuf field .google.protobuf.Timestamp purge_time = 8; - * @return \Google\Protobuf\Timestamp|null - */ - public function getPurgeTime() - { - return $this->purge_time; - } - - public function hasPurgeTime() - { - return isset($this->purge_time); - } - - public function clearPurgeTime() - { - unset($this->purge_time); - } - - /** - * Output only. The last time this queue was purged. - * All tasks that were [created][google.cloud.tasks.v2beta2.Task.create_time] - * before this time were purged. - * A queue can be purged using - * [PurgeQueue][google.cloud.tasks.v2beta2.CloudTasks.PurgeQueue], the [App - * Engine Task Queue SDK, or the Cloud - * Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue). - * Purge time will be truncated to the nearest microsecond. Purge - * time will be unset if the queue has never been purged. - * - * Generated from protobuf field .google.protobuf.Timestamp purge_time = 8; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setPurgeTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->purge_time = $var; - - return $this; - } - - /** - * The maximum amount of time that a task will be retained in - * this queue. - * Queues created by Cloud Tasks have a default `task_ttl` of 31 days. - * After a task has lived for `task_ttl`, the task will be deleted - * regardless of whether it was dispatched or not. - * The `task_ttl` for queues created via queue.yaml/xml is equal to the - * maximum duration because there is a - * [storage quota](https://cloud.google.com/appengine/quotas#Task_Queue) for - * these queues. To view the maximum valid duration, see the documentation for - * [Duration][google.protobuf.Duration]. - * - * Generated from protobuf field .google.protobuf.Duration task_ttl = 9; - * @return \Google\Protobuf\Duration|null - */ - public function getTaskTtl() - { - return $this->task_ttl; - } - - public function hasTaskTtl() - { - return isset($this->task_ttl); - } - - public function clearTaskTtl() - { - unset($this->task_ttl); - } - - /** - * The maximum amount of time that a task will be retained in - * this queue. - * Queues created by Cloud Tasks have a default `task_ttl` of 31 days. - * After a task has lived for `task_ttl`, the task will be deleted - * regardless of whether it was dispatched or not. - * The `task_ttl` for queues created via queue.yaml/xml is equal to the - * maximum duration because there is a - * [storage quota](https://cloud.google.com/appengine/quotas#Task_Queue) for - * these queues. To view the maximum valid duration, see the documentation for - * [Duration][google.protobuf.Duration]. - * - * Generated from protobuf field .google.protobuf.Duration task_ttl = 9; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setTaskTtl($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->task_ttl = $var; - - return $this; - } - - /** - * The task tombstone time to live (TTL). - * After a task is deleted or completed, the task's tombstone is - * retained for the length of time specified by `tombstone_ttl`. - * The tombstone is used by task de-duplication; another task with the same - * name can't be created until the tombstone has expired. For more information - * about task de-duplication, see the documentation for - * [CreateTaskRequest][google.cloud.tasks.v2beta2.CreateTaskRequest.task]. - * Queues created by Cloud Tasks have a default `tombstone_ttl` of 1 hour. - * - * Generated from protobuf field .google.protobuf.Duration tombstone_ttl = 10; - * @return \Google\Protobuf\Duration|null - */ - public function getTombstoneTtl() - { - return $this->tombstone_ttl; - } - - public function hasTombstoneTtl() - { - return isset($this->tombstone_ttl); - } - - public function clearTombstoneTtl() - { - unset($this->tombstone_ttl); - } - - /** - * The task tombstone time to live (TTL). - * After a task is deleted or completed, the task's tombstone is - * retained for the length of time specified by `tombstone_ttl`. - * The tombstone is used by task de-duplication; another task with the same - * name can't be created until the tombstone has expired. For more information - * about task de-duplication, see the documentation for - * [CreateTaskRequest][google.cloud.tasks.v2beta2.CreateTaskRequest.task]. - * Queues created by Cloud Tasks have a default `tombstone_ttl` of 1 hour. - * - * Generated from protobuf field .google.protobuf.Duration tombstone_ttl = 10; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setTombstoneTtl($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->tombstone_ttl = $var; - - return $this; - } - - /** - * Output only. The realtime, informational statistics for a queue. In order - * to receive the statistics the caller should include this field in the - * FieldMask. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.QueueStats stats = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Tasks\V2beta2\QueueStats|null - */ - public function getStats() - { - return $this->stats; - } - - public function hasStats() - { - return isset($this->stats); - } - - public function clearStats() - { - unset($this->stats); - } - - /** - * Output only. The realtime, informational statistics for a queue. In order - * to receive the statistics the caller should include this field in the - * FieldMask. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.QueueStats stats = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Tasks\V2beta2\QueueStats $var - * @return $this - */ - public function setStats($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\QueueStats::class); - $this->stats = $var; - - return $this; - } - - /** - * @return string - */ - public function getTargetType() - { - return $this->whichOneof("target_type"); - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Queue/State.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Queue/State.php deleted file mode 100644 index f7bded4c9833..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Queue/State.php +++ /dev/null @@ -1,93 +0,0 @@ -google.cloud.tasks.v2beta2.Queue.State - */ -class State -{ - /** - * Unspecified state. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The queue is running. Tasks can be dispatched. - * If the queue was created using Cloud Tasks and the queue has - * had no activity (method calls or task dispatches) for 30 days, - * the queue may take a few minutes to re-activate. Some method - * calls may return [NOT_FOUND][google.rpc.Code.NOT_FOUND] and - * tasks may not be dispatched for a few minutes until the queue - * has been re-activated. - * - * Generated from protobuf enum RUNNING = 1; - */ - const RUNNING = 1; - /** - * Tasks are paused by the user. If the queue is paused then Cloud - * Tasks will stop delivering tasks from it, but more tasks can - * still be added to it by the user. When a pull queue is paused, - * all [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] calls - * will return a [FAILED_PRECONDITION][google.rpc.Code.FAILED_PRECONDITION]. - * - * Generated from protobuf enum PAUSED = 2; - */ - const PAUSED = 2; - /** - * The queue is disabled. - * A queue becomes `DISABLED` when - * [queue.yaml](https://cloud.google.com/appengine/docs/python/config/queueref) - * or - * [queue.xml](https://cloud.google.com/appengine/docs/standard/java/config/queueref) - * is uploaded which does not contain the queue. You cannot directly disable - * a queue. - * When a queue is disabled, tasks can still be added to a queue - * but the tasks are not dispatched and - * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] calls - * return a `FAILED_PRECONDITION` error. - * To permanently delete this queue and all of its tasks, call - * [DeleteQueue][google.cloud.tasks.v2beta2.CloudTasks.DeleteQueue]. - * - * Generated from protobuf enum DISABLED = 3; - */ - const DISABLED = 3; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::RUNNING => 'RUNNING', - self::PAUSED => 'PAUSED', - self::DISABLED => 'DISABLED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Tasks\V2beta2\Queue_State::class); - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/QueueStats.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/QueueStats.php deleted file mode 100644 index 2088ee83cf4e..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/QueueStats.php +++ /dev/null @@ -1,253 +0,0 @@ -google.cloud.tasks.v2beta2.QueueStats - */ -class QueueStats extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. An estimation of the number of tasks in the queue, that is, - * the tasks in the queue that haven't been executed, the tasks in the queue - * which the queue has dispatched but has not yet received a reply for, and - * the failed tasks that the queue is retrying. - * - * Generated from protobuf field int64 tasks_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $tasks_count = 0; - /** - * Output only. An estimation of the nearest time in the future where a task - * in the queue is scheduled to be executed. - * - * Generated from protobuf field .google.protobuf.Timestamp oldest_estimated_arrival_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $oldest_estimated_arrival_time = null; - /** - * Output only. The number of tasks that the queue has dispatched and received - * a reply for during the last minute. This variable counts both successful - * and non-successful executions. - * - * Generated from protobuf field int64 executed_last_minute_count = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $executed_last_minute_count = 0; - /** - * Output only. The number of requests that the queue has dispatched but has - * not received a reply for yet. - * - * Generated from protobuf field int64 concurrent_dispatches_count = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $concurrent_dispatches_count = 0; - /** - * Output only. The current maximum number of tasks per second executed by the - * queue. The maximum value of this variable is controlled by the RateLimits - * of the Queue. However, this value could be less to avoid overloading the - * endpoints tasks in the queue are targeting. - * - * Generated from protobuf field double effective_execution_rate = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $effective_execution_rate = 0.0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int|string $tasks_count - * Output only. An estimation of the number of tasks in the queue, that is, - * the tasks in the queue that haven't been executed, the tasks in the queue - * which the queue has dispatched but has not yet received a reply for, and - * the failed tasks that the queue is retrying. - * @type \Google\Protobuf\Timestamp $oldest_estimated_arrival_time - * Output only. An estimation of the nearest time in the future where a task - * in the queue is scheduled to be executed. - * @type int|string $executed_last_minute_count - * Output only. The number of tasks that the queue has dispatched and received - * a reply for during the last minute. This variable counts both successful - * and non-successful executions. - * @type int|string $concurrent_dispatches_count - * Output only. The number of requests that the queue has dispatched but has - * not received a reply for yet. - * @type float $effective_execution_rate - * Output only. The current maximum number of tasks per second executed by the - * queue. The maximum value of this variable is controlled by the RateLimits - * of the Queue. However, this value could be less to avoid overloading the - * endpoints tasks in the queue are targeting. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Queue::initOnce(); - parent::__construct($data); - } - - /** - * Output only. An estimation of the number of tasks in the queue, that is, - * the tasks in the queue that haven't been executed, the tasks in the queue - * which the queue has dispatched but has not yet received a reply for, and - * the failed tasks that the queue is retrying. - * - * Generated from protobuf field int64 tasks_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int|string - */ - public function getTasksCount() - { - return $this->tasks_count; - } - - /** - * Output only. An estimation of the number of tasks in the queue, that is, - * the tasks in the queue that haven't been executed, the tasks in the queue - * which the queue has dispatched but has not yet received a reply for, and - * the failed tasks that the queue is retrying. - * - * Generated from protobuf field int64 tasks_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int|string $var - * @return $this - */ - public function setTasksCount($var) - { - GPBUtil::checkInt64($var); - $this->tasks_count = $var; - - return $this; - } - - /** - * Output only. An estimation of the nearest time in the future where a task - * in the queue is scheduled to be executed. - * - * Generated from protobuf field .google.protobuf.Timestamp oldest_estimated_arrival_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getOldestEstimatedArrivalTime() - { - return $this->oldest_estimated_arrival_time; - } - - public function hasOldestEstimatedArrivalTime() - { - return isset($this->oldest_estimated_arrival_time); - } - - public function clearOldestEstimatedArrivalTime() - { - unset($this->oldest_estimated_arrival_time); - } - - /** - * Output only. An estimation of the nearest time in the future where a task - * in the queue is scheduled to be executed. - * - * Generated from protobuf field .google.protobuf.Timestamp oldest_estimated_arrival_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setOldestEstimatedArrivalTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->oldest_estimated_arrival_time = $var; - - return $this; - } - - /** - * Output only. The number of tasks that the queue has dispatched and received - * a reply for during the last minute. This variable counts both successful - * and non-successful executions. - * - * Generated from protobuf field int64 executed_last_minute_count = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int|string - */ - public function getExecutedLastMinuteCount() - { - return $this->executed_last_minute_count; - } - - /** - * Output only. The number of tasks that the queue has dispatched and received - * a reply for during the last minute. This variable counts both successful - * and non-successful executions. - * - * Generated from protobuf field int64 executed_last_minute_count = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int|string $var - * @return $this - */ - public function setExecutedLastMinuteCount($var) - { - GPBUtil::checkInt64($var); - $this->executed_last_minute_count = $var; - - return $this; - } - - /** - * Output only. The number of requests that the queue has dispatched but has - * not received a reply for yet. - * - * Generated from protobuf field int64 concurrent_dispatches_count = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int|string - */ - public function getConcurrentDispatchesCount() - { - return $this->concurrent_dispatches_count; - } - - /** - * Output only. The number of requests that the queue has dispatched but has - * not received a reply for yet. - * - * Generated from protobuf field int64 concurrent_dispatches_count = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int|string $var - * @return $this - */ - public function setConcurrentDispatchesCount($var) - { - GPBUtil::checkInt64($var); - $this->concurrent_dispatches_count = $var; - - return $this; - } - - /** - * Output only. The current maximum number of tasks per second executed by the - * queue. The maximum value of this variable is controlled by the RateLimits - * of the Queue. However, this value could be less to avoid overloading the - * endpoints tasks in the queue are targeting. - * - * Generated from protobuf field double effective_execution_rate = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return float - */ - public function getEffectiveExecutionRate() - { - return $this->effective_execution_rate; - } - - /** - * Output only. The current maximum number of tasks per second executed by the - * queue. The maximum value of this variable is controlled by the RateLimits - * of the Queue. However, this value could be less to avoid overloading the - * endpoints tasks in the queue are targeting. - * - * Generated from protobuf field double effective_execution_rate = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param float $var - * @return $this - */ - public function setEffectiveExecutionRate($var) - { - GPBUtil::checkDouble($var); - $this->effective_execution_rate = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/RateLimits.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/RateLimits.php deleted file mode 100644 index 1607a1fb59c4..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/RateLimits.php +++ /dev/null @@ -1,349 +0,0 @@ -google.cloud.tasks.v2beta2.RateLimits - */ -class RateLimits extends \Google\Protobuf\Internal\Message -{ - /** - * The maximum rate at which tasks are dispatched from this queue. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * * For [App Engine queues][google.cloud.tasks.v2beta2.AppEngineHttpTarget], - * the maximum allowed value - * is 500. - * * This field is output only for [pull - * queues][google.cloud.tasks.v2beta2.PullTarget]. In addition to the - * `max_tasks_dispatched_per_second` limit, a maximum of 10 QPS of - * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] requests - * are allowed per pull queue. - * This field has the same meaning as - * [rate in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate). - * - * Generated from protobuf field double max_tasks_dispatched_per_second = 1; - */ - protected $max_tasks_dispatched_per_second = 0.0; - /** - * The max burst size. - * Max burst size limits how fast tasks in queue are processed when - * many tasks are in the queue and the rate is high. This field - * allows the queue to have a high rate so processing starts shortly - * after a task is enqueued, but still limits resource usage when - * many tasks are enqueued in a short period of time. - * The [token bucket](https://wikipedia.org/wiki/Token_Bucket) - * algorithm is used to control the rate of task dispatches. Each - * queue has a token bucket that holds tokens, up to the maximum - * specified by `max_burst_size`. Each time a task is dispatched, a - * token is removed from the bucket. Tasks will be dispatched until - * the queue's bucket runs out of tokens. The bucket will be - * continuously refilled with new tokens based on - * [max_dispatches_per_second][RateLimits.max_dispatches_per_second]. - * The default value of `max_burst_size` is picked by Cloud Tasks - * based on the value of - * [max_dispatches_per_second][RateLimits.max_dispatches_per_second]. - * The maximum value of `max_burst_size` is 500. - * For App Engine queues that were created or updated using - * `queue.yaml/xml`, `max_burst_size` is equal to - * [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size). - * If - * [UpdateQueue][google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue] is called - * on a queue without explicitly setting a value for `max_burst_size`, - * `max_burst_size` value will get updated if - * [UpdateQueue][google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue] is - * updating [max_dispatches_per_second][RateLimits.max_dispatches_per_second]. - * - * Generated from protobuf field int32 max_burst_size = 2; - */ - protected $max_burst_size = 0; - /** - * The maximum number of concurrent tasks that Cloud Tasks allows - * to be dispatched for this queue. After this threshold has been - * reached, Cloud Tasks stops dispatching tasks until the number of - * concurrent requests decreases. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * The maximum allowed value is 5,000. - * This field is output only for - * [pull queues][google.cloud.tasks.v2beta2.PullTarget] and always -1, which - * indicates no limit. No other queue types can have `max_concurrent_tasks` - * set to -1. - * This field has the same meaning as - * [max_concurrent_requests in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests). - * - * Generated from protobuf field int32 max_concurrent_tasks = 3; - */ - protected $max_concurrent_tasks = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type float $max_tasks_dispatched_per_second - * The maximum rate at which tasks are dispatched from this queue. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * * For [App Engine queues][google.cloud.tasks.v2beta2.AppEngineHttpTarget], - * the maximum allowed value - * is 500. - * * This field is output only for [pull - * queues][google.cloud.tasks.v2beta2.PullTarget]. In addition to the - * `max_tasks_dispatched_per_second` limit, a maximum of 10 QPS of - * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] requests - * are allowed per pull queue. - * This field has the same meaning as - * [rate in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate). - * @type int $max_burst_size - * The max burst size. - * Max burst size limits how fast tasks in queue are processed when - * many tasks are in the queue and the rate is high. This field - * allows the queue to have a high rate so processing starts shortly - * after a task is enqueued, but still limits resource usage when - * many tasks are enqueued in a short period of time. - * The [token bucket](https://wikipedia.org/wiki/Token_Bucket) - * algorithm is used to control the rate of task dispatches. Each - * queue has a token bucket that holds tokens, up to the maximum - * specified by `max_burst_size`. Each time a task is dispatched, a - * token is removed from the bucket. Tasks will be dispatched until - * the queue's bucket runs out of tokens. The bucket will be - * continuously refilled with new tokens based on - * [max_dispatches_per_second][RateLimits.max_dispatches_per_second]. - * The default value of `max_burst_size` is picked by Cloud Tasks - * based on the value of - * [max_dispatches_per_second][RateLimits.max_dispatches_per_second]. - * The maximum value of `max_burst_size` is 500. - * For App Engine queues that were created or updated using - * `queue.yaml/xml`, `max_burst_size` is equal to - * [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size). - * If - * [UpdateQueue][google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue] is called - * on a queue without explicitly setting a value for `max_burst_size`, - * `max_burst_size` value will get updated if - * [UpdateQueue][google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue] is - * updating [max_dispatches_per_second][RateLimits.max_dispatches_per_second]. - * @type int $max_concurrent_tasks - * The maximum number of concurrent tasks that Cloud Tasks allows - * to be dispatched for this queue. After this threshold has been - * reached, Cloud Tasks stops dispatching tasks until the number of - * concurrent requests decreases. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * The maximum allowed value is 5,000. - * This field is output only for - * [pull queues][google.cloud.tasks.v2beta2.PullTarget] and always -1, which - * indicates no limit. No other queue types can have `max_concurrent_tasks` - * set to -1. - * This field has the same meaning as - * [max_concurrent_requests in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Queue::initOnce(); - parent::__construct($data); - } - - /** - * The maximum rate at which tasks are dispatched from this queue. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * * For [App Engine queues][google.cloud.tasks.v2beta2.AppEngineHttpTarget], - * the maximum allowed value - * is 500. - * * This field is output only for [pull - * queues][google.cloud.tasks.v2beta2.PullTarget]. In addition to the - * `max_tasks_dispatched_per_second` limit, a maximum of 10 QPS of - * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] requests - * are allowed per pull queue. - * This field has the same meaning as - * [rate in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate). - * - * Generated from protobuf field double max_tasks_dispatched_per_second = 1; - * @return float - */ - public function getMaxTasksDispatchedPerSecond() - { - return $this->max_tasks_dispatched_per_second; - } - - /** - * The maximum rate at which tasks are dispatched from this queue. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * * For [App Engine queues][google.cloud.tasks.v2beta2.AppEngineHttpTarget], - * the maximum allowed value - * is 500. - * * This field is output only for [pull - * queues][google.cloud.tasks.v2beta2.PullTarget]. In addition to the - * `max_tasks_dispatched_per_second` limit, a maximum of 10 QPS of - * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] requests - * are allowed per pull queue. - * This field has the same meaning as - * [rate in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate). - * - * Generated from protobuf field double max_tasks_dispatched_per_second = 1; - * @param float $var - * @return $this - */ - public function setMaxTasksDispatchedPerSecond($var) - { - GPBUtil::checkDouble($var); - $this->max_tasks_dispatched_per_second = $var; - - return $this; - } - - /** - * The max burst size. - * Max burst size limits how fast tasks in queue are processed when - * many tasks are in the queue and the rate is high. This field - * allows the queue to have a high rate so processing starts shortly - * after a task is enqueued, but still limits resource usage when - * many tasks are enqueued in a short period of time. - * The [token bucket](https://wikipedia.org/wiki/Token_Bucket) - * algorithm is used to control the rate of task dispatches. Each - * queue has a token bucket that holds tokens, up to the maximum - * specified by `max_burst_size`. Each time a task is dispatched, a - * token is removed from the bucket. Tasks will be dispatched until - * the queue's bucket runs out of tokens. The bucket will be - * continuously refilled with new tokens based on - * [max_dispatches_per_second][RateLimits.max_dispatches_per_second]. - * The default value of `max_burst_size` is picked by Cloud Tasks - * based on the value of - * [max_dispatches_per_second][RateLimits.max_dispatches_per_second]. - * The maximum value of `max_burst_size` is 500. - * For App Engine queues that were created or updated using - * `queue.yaml/xml`, `max_burst_size` is equal to - * [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size). - * If - * [UpdateQueue][google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue] is called - * on a queue without explicitly setting a value for `max_burst_size`, - * `max_burst_size` value will get updated if - * [UpdateQueue][google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue] is - * updating [max_dispatches_per_second][RateLimits.max_dispatches_per_second]. - * - * Generated from protobuf field int32 max_burst_size = 2; - * @return int - */ - public function getMaxBurstSize() - { - return $this->max_burst_size; - } - - /** - * The max burst size. - * Max burst size limits how fast tasks in queue are processed when - * many tasks are in the queue and the rate is high. This field - * allows the queue to have a high rate so processing starts shortly - * after a task is enqueued, but still limits resource usage when - * many tasks are enqueued in a short period of time. - * The [token bucket](https://wikipedia.org/wiki/Token_Bucket) - * algorithm is used to control the rate of task dispatches. Each - * queue has a token bucket that holds tokens, up to the maximum - * specified by `max_burst_size`. Each time a task is dispatched, a - * token is removed from the bucket. Tasks will be dispatched until - * the queue's bucket runs out of tokens. The bucket will be - * continuously refilled with new tokens based on - * [max_dispatches_per_second][RateLimits.max_dispatches_per_second]. - * The default value of `max_burst_size` is picked by Cloud Tasks - * based on the value of - * [max_dispatches_per_second][RateLimits.max_dispatches_per_second]. - * The maximum value of `max_burst_size` is 500. - * For App Engine queues that were created or updated using - * `queue.yaml/xml`, `max_burst_size` is equal to - * [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size). - * If - * [UpdateQueue][google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue] is called - * on a queue without explicitly setting a value for `max_burst_size`, - * `max_burst_size` value will get updated if - * [UpdateQueue][google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue] is - * updating [max_dispatches_per_second][RateLimits.max_dispatches_per_second]. - * - * Generated from protobuf field int32 max_burst_size = 2; - * @param int $var - * @return $this - */ - public function setMaxBurstSize($var) - { - GPBUtil::checkInt32($var); - $this->max_burst_size = $var; - - return $this; - } - - /** - * The maximum number of concurrent tasks that Cloud Tasks allows - * to be dispatched for this queue. After this threshold has been - * reached, Cloud Tasks stops dispatching tasks until the number of - * concurrent requests decreases. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * The maximum allowed value is 5,000. - * This field is output only for - * [pull queues][google.cloud.tasks.v2beta2.PullTarget] and always -1, which - * indicates no limit. No other queue types can have `max_concurrent_tasks` - * set to -1. - * This field has the same meaning as - * [max_concurrent_requests in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests). - * - * Generated from protobuf field int32 max_concurrent_tasks = 3; - * @return int - */ - public function getMaxConcurrentTasks() - { - return $this->max_concurrent_tasks; - } - - /** - * The maximum number of concurrent tasks that Cloud Tasks allows - * to be dispatched for this queue. After this threshold has been - * reached, Cloud Tasks stops dispatching tasks until the number of - * concurrent requests decreases. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * The maximum allowed value is 5,000. - * This field is output only for - * [pull queues][google.cloud.tasks.v2beta2.PullTarget] and always -1, which - * indicates no limit. No other queue types can have `max_concurrent_tasks` - * set to -1. - * This field has the same meaning as - * [max_concurrent_requests in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests). - * - * Generated from protobuf field int32 max_concurrent_tasks = 3; - * @param int $var - * @return $this - */ - public function setMaxConcurrentTasks($var) - { - GPBUtil::checkInt32($var); - $this->max_concurrent_tasks = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/RenewLeaseRequest.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/RenewLeaseRequest.php deleted file mode 100644 index dd4bae70caa0..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/RenewLeaseRequest.php +++ /dev/null @@ -1,258 +0,0 @@ -google.cloud.tasks.v2beta2.RenewLeaseRequest - */ -class RenewLeaseRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Required. The task's current schedule time, available in the - * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] returned by - * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] response or - * [RenewLease][google.cloud.tasks.v2beta2.CloudTasks.RenewLease] response. - * This restriction is to ensure that your worker currently holds the lease. - * - * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $schedule_time = null; - /** - * Required. The desired new lease duration, starting from now. - * The maximum lease duration is 1 week. - * `lease_duration` will be truncated to the nearest second. - * - * Generated from protobuf field .google.protobuf.Duration lease_duration = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $lease_duration = null; - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta2.Task] will be returned. - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta2.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View response_view = 4; - */ - protected $response_view = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * @type \Google\Protobuf\Timestamp $schedule_time - * Required. The task's current schedule time, available in the - * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] returned by - * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] response or - * [RenewLease][google.cloud.tasks.v2beta2.CloudTasks.RenewLease] response. - * This restriction is to ensure that your worker currently holds the lease. - * @type \Google\Protobuf\Duration $lease_duration - * Required. The desired new lease duration, starting from now. - * The maximum lease duration is 1 week. - * `lease_duration` will be truncated to the nearest second. - * @type int $response_view - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta2.Task] will be returned. - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta2.Task] resource. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Required. The task's current schedule time, available in the - * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] returned by - * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] response or - * [RenewLease][google.cloud.tasks.v2beta2.CloudTasks.RenewLease] response. - * This restriction is to ensure that your worker currently holds the lease. - * - * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getScheduleTime() - { - return $this->schedule_time; - } - - public function hasScheduleTime() - { - return isset($this->schedule_time); - } - - public function clearScheduleTime() - { - unset($this->schedule_time); - } - - /** - * Required. The task's current schedule time, available in the - * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] returned by - * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] response or - * [RenewLease][google.cloud.tasks.v2beta2.CloudTasks.RenewLease] response. - * This restriction is to ensure that your worker currently holds the lease. - * - * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setScheduleTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->schedule_time = $var; - - return $this; - } - - /** - * Required. The desired new lease duration, starting from now. - * The maximum lease duration is 1 week. - * `lease_duration` will be truncated to the nearest second. - * - * Generated from protobuf field .google.protobuf.Duration lease_duration = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Duration|null - */ - public function getLeaseDuration() - { - return $this->lease_duration; - } - - public function hasLeaseDuration() - { - return isset($this->lease_duration); - } - - public function clearLeaseDuration() - { - unset($this->lease_duration); - } - - /** - * Required. The desired new lease duration, starting from now. - * The maximum lease duration is 1 week. - * `lease_duration` will be truncated to the nearest second. - * - * Generated from protobuf field .google.protobuf.Duration lease_duration = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setLeaseDuration($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->lease_duration = $var; - - return $this; - } - - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta2.Task] will be returned. - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta2.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View response_view = 4; - * @return int - */ - public function getResponseView() - { - return $this->response_view; - } - - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta2.Task] will be returned. - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta2.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View response_view = 4; - * @param int $var - * @return $this - */ - public function setResponseView($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta2\Task\View::class); - $this->response_view = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ResumeQueueRequest.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ResumeQueueRequest.php deleted file mode 100644 index 2313b11ba861..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ResumeQueueRequest.php +++ /dev/null @@ -1,72 +0,0 @@ -google.cloud.tasks.v2beta2.ResumeQueueRequest - */ -class ResumeQueueRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/RetryConfig.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/RetryConfig.php deleted file mode 100644 index 72adfcb1e3c1..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/RetryConfig.php +++ /dev/null @@ -1,548 +0,0 @@ -google.cloud.tasks.v2beta2.RetryConfig - */ -class RetryConfig extends \Google\Protobuf\Internal\Message -{ - /** - * If positive, `max_retry_duration` specifies the time limit for - * retrying a failed task, measured from when the task was first - * attempted. Once `max_retry_duration` time has passed *and* the - * task has been attempted - * [max_attempts][google.cloud.tasks.v2beta2.RetryConfig.max_attempts] times, - * no further attempts will be made and the task will be deleted. - * If zero, then the task age is unlimited. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * This field is output only for [pull - * queues][google.cloud.tasks.v2beta2.PullTarget]. - * `max_retry_duration` will be truncated to the nearest second. - * This field has the same meaning as - * [task_age_limit in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * - * Generated from protobuf field .google.protobuf.Duration max_retry_duration = 3; - */ - protected $max_retry_duration = null; - /** - * A task will be [scheduled][google.cloud.tasks.v2beta2.Task.schedule_time] - * for retry between - * [min_backoff][google.cloud.tasks.v2beta2.RetryConfig.min_backoff] and - * [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] duration - * after it fails, if the queue's - * [RetryConfig][google.cloud.tasks.v2beta2.RetryConfig] specifies that the - * task should be retried. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * This field is output only for [pull - * queues][google.cloud.tasks.v2beta2.PullTarget]. - * `min_backoff` will be truncated to the nearest second. - * This field has the same meaning as - * [min_backoff_seconds in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * - * Generated from protobuf field .google.protobuf.Duration min_backoff = 4; - */ - protected $min_backoff = null; - /** - * A task will be [scheduled][google.cloud.tasks.v2beta2.Task.schedule_time] - * for retry between - * [min_backoff][google.cloud.tasks.v2beta2.RetryConfig.min_backoff] and - * [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] duration - * after it fails, if the queue's - * [RetryConfig][google.cloud.tasks.v2beta2.RetryConfig] specifies that the - * task should be retried. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * This field is output only for [pull - * queues][google.cloud.tasks.v2beta2.PullTarget]. - * `max_backoff` will be truncated to the nearest second. - * This field has the same meaning as - * [max_backoff_seconds in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * - * Generated from protobuf field .google.protobuf.Duration max_backoff = 5; - */ - protected $max_backoff = null; - /** - * The time between retries will double `max_doublings` times. - * A task's retry interval starts at - * [min_backoff][google.cloud.tasks.v2beta2.RetryConfig.min_backoff], then - * doubles `max_doublings` times, then increases linearly, and finally retries - * at intervals of - * [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] up to - * [max_attempts][google.cloud.tasks.v2beta2.RetryConfig.max_attempts] times. - * For example, if - * [min_backoff][google.cloud.tasks.v2beta2.RetryConfig.min_backoff] is 10s, - * [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] is 300s, - * and `max_doublings` is 3, then the a task will first be retried in 10s. The - * retry interval will double three times, and then increase linearly by 2^3 * - * 10s. Finally, the task will retry at intervals of - * [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] until the - * task has been attempted - * [max_attempts][google.cloud.tasks.v2beta2.RetryConfig.max_attempts] times. - * Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, - * 300s, .... - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * This field is output only for [pull - * queues][google.cloud.tasks.v2beta2.PullTarget]. - * This field has the same meaning as - * [max_doublings in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * - * Generated from protobuf field int32 max_doublings = 6; - */ - protected $max_doublings = 0; - protected $num_attempts; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $max_attempts - * The maximum number of attempts for a task. - * Cloud Tasks will attempt the task `max_attempts` times (that - * is, if the first attempt fails, then there will be - * `max_attempts - 1` retries). Must be > 0. - * @type bool $unlimited_attempts - * If true, then the number of attempts is unlimited. - * @type \Google\Protobuf\Duration $max_retry_duration - * If positive, `max_retry_duration` specifies the time limit for - * retrying a failed task, measured from when the task was first - * attempted. Once `max_retry_duration` time has passed *and* the - * task has been attempted - * [max_attempts][google.cloud.tasks.v2beta2.RetryConfig.max_attempts] times, - * no further attempts will be made and the task will be deleted. - * If zero, then the task age is unlimited. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * This field is output only for [pull - * queues][google.cloud.tasks.v2beta2.PullTarget]. - * `max_retry_duration` will be truncated to the nearest second. - * This field has the same meaning as - * [task_age_limit in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * @type \Google\Protobuf\Duration $min_backoff - * A task will be [scheduled][google.cloud.tasks.v2beta2.Task.schedule_time] - * for retry between - * [min_backoff][google.cloud.tasks.v2beta2.RetryConfig.min_backoff] and - * [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] duration - * after it fails, if the queue's - * [RetryConfig][google.cloud.tasks.v2beta2.RetryConfig] specifies that the - * task should be retried. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * This field is output only for [pull - * queues][google.cloud.tasks.v2beta2.PullTarget]. - * `min_backoff` will be truncated to the nearest second. - * This field has the same meaning as - * [min_backoff_seconds in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * @type \Google\Protobuf\Duration $max_backoff - * A task will be [scheduled][google.cloud.tasks.v2beta2.Task.schedule_time] - * for retry between - * [min_backoff][google.cloud.tasks.v2beta2.RetryConfig.min_backoff] and - * [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] duration - * after it fails, if the queue's - * [RetryConfig][google.cloud.tasks.v2beta2.RetryConfig] specifies that the - * task should be retried. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * This field is output only for [pull - * queues][google.cloud.tasks.v2beta2.PullTarget]. - * `max_backoff` will be truncated to the nearest second. - * This field has the same meaning as - * [max_backoff_seconds in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * @type int $max_doublings - * The time between retries will double `max_doublings` times. - * A task's retry interval starts at - * [min_backoff][google.cloud.tasks.v2beta2.RetryConfig.min_backoff], then - * doubles `max_doublings` times, then increases linearly, and finally retries - * at intervals of - * [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] up to - * [max_attempts][google.cloud.tasks.v2beta2.RetryConfig.max_attempts] times. - * For example, if - * [min_backoff][google.cloud.tasks.v2beta2.RetryConfig.min_backoff] is 10s, - * [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] is 300s, - * and `max_doublings` is 3, then the a task will first be retried in 10s. The - * retry interval will double three times, and then increase linearly by 2^3 * - * 10s. Finally, the task will retry at intervals of - * [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] until the - * task has been attempted - * [max_attempts][google.cloud.tasks.v2beta2.RetryConfig.max_attempts] times. - * Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, - * 300s, .... - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * This field is output only for [pull - * queues][google.cloud.tasks.v2beta2.PullTarget]. - * This field has the same meaning as - * [max_doublings in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Queue::initOnce(); - parent::__construct($data); - } - - /** - * The maximum number of attempts for a task. - * Cloud Tasks will attempt the task `max_attempts` times (that - * is, if the first attempt fails, then there will be - * `max_attempts - 1` retries). Must be > 0. - * - * Generated from protobuf field int32 max_attempts = 1; - * @return int - */ - public function getMaxAttempts() - { - return $this->readOneof(1); - } - - public function hasMaxAttempts() - { - return $this->hasOneof(1); - } - - /** - * The maximum number of attempts for a task. - * Cloud Tasks will attempt the task `max_attempts` times (that - * is, if the first attempt fails, then there will be - * `max_attempts - 1` retries). Must be > 0. - * - * Generated from protobuf field int32 max_attempts = 1; - * @param int $var - * @return $this - */ - public function setMaxAttempts($var) - { - GPBUtil::checkInt32($var); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * If true, then the number of attempts is unlimited. - * - * Generated from protobuf field bool unlimited_attempts = 2; - * @return bool - */ - public function getUnlimitedAttempts() - { - return $this->readOneof(2); - } - - public function hasUnlimitedAttempts() - { - return $this->hasOneof(2); - } - - /** - * If true, then the number of attempts is unlimited. - * - * Generated from protobuf field bool unlimited_attempts = 2; - * @param bool $var - * @return $this - */ - public function setUnlimitedAttempts($var) - { - GPBUtil::checkBool($var); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * If positive, `max_retry_duration` specifies the time limit for - * retrying a failed task, measured from when the task was first - * attempted. Once `max_retry_duration` time has passed *and* the - * task has been attempted - * [max_attempts][google.cloud.tasks.v2beta2.RetryConfig.max_attempts] times, - * no further attempts will be made and the task will be deleted. - * If zero, then the task age is unlimited. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * This field is output only for [pull - * queues][google.cloud.tasks.v2beta2.PullTarget]. - * `max_retry_duration` will be truncated to the nearest second. - * This field has the same meaning as - * [task_age_limit in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * - * Generated from protobuf field .google.protobuf.Duration max_retry_duration = 3; - * @return \Google\Protobuf\Duration|null - */ - public function getMaxRetryDuration() - { - return $this->max_retry_duration; - } - - public function hasMaxRetryDuration() - { - return isset($this->max_retry_duration); - } - - public function clearMaxRetryDuration() - { - unset($this->max_retry_duration); - } - - /** - * If positive, `max_retry_duration` specifies the time limit for - * retrying a failed task, measured from when the task was first - * attempted. Once `max_retry_duration` time has passed *and* the - * task has been attempted - * [max_attempts][google.cloud.tasks.v2beta2.RetryConfig.max_attempts] times, - * no further attempts will be made and the task will be deleted. - * If zero, then the task age is unlimited. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * This field is output only for [pull - * queues][google.cloud.tasks.v2beta2.PullTarget]. - * `max_retry_duration` will be truncated to the nearest second. - * This field has the same meaning as - * [task_age_limit in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * - * Generated from protobuf field .google.protobuf.Duration max_retry_duration = 3; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setMaxRetryDuration($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->max_retry_duration = $var; - - return $this; - } - - /** - * A task will be [scheduled][google.cloud.tasks.v2beta2.Task.schedule_time] - * for retry between - * [min_backoff][google.cloud.tasks.v2beta2.RetryConfig.min_backoff] and - * [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] duration - * after it fails, if the queue's - * [RetryConfig][google.cloud.tasks.v2beta2.RetryConfig] specifies that the - * task should be retried. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * This field is output only for [pull - * queues][google.cloud.tasks.v2beta2.PullTarget]. - * `min_backoff` will be truncated to the nearest second. - * This field has the same meaning as - * [min_backoff_seconds in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * - * Generated from protobuf field .google.protobuf.Duration min_backoff = 4; - * @return \Google\Protobuf\Duration|null - */ - public function getMinBackoff() - { - return $this->min_backoff; - } - - public function hasMinBackoff() - { - return isset($this->min_backoff); - } - - public function clearMinBackoff() - { - unset($this->min_backoff); - } - - /** - * A task will be [scheduled][google.cloud.tasks.v2beta2.Task.schedule_time] - * for retry between - * [min_backoff][google.cloud.tasks.v2beta2.RetryConfig.min_backoff] and - * [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] duration - * after it fails, if the queue's - * [RetryConfig][google.cloud.tasks.v2beta2.RetryConfig] specifies that the - * task should be retried. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * This field is output only for [pull - * queues][google.cloud.tasks.v2beta2.PullTarget]. - * `min_backoff` will be truncated to the nearest second. - * This field has the same meaning as - * [min_backoff_seconds in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * - * Generated from protobuf field .google.protobuf.Duration min_backoff = 4; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setMinBackoff($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->min_backoff = $var; - - return $this; - } - - /** - * A task will be [scheduled][google.cloud.tasks.v2beta2.Task.schedule_time] - * for retry between - * [min_backoff][google.cloud.tasks.v2beta2.RetryConfig.min_backoff] and - * [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] duration - * after it fails, if the queue's - * [RetryConfig][google.cloud.tasks.v2beta2.RetryConfig] specifies that the - * task should be retried. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * This field is output only for [pull - * queues][google.cloud.tasks.v2beta2.PullTarget]. - * `max_backoff` will be truncated to the nearest second. - * This field has the same meaning as - * [max_backoff_seconds in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * - * Generated from protobuf field .google.protobuf.Duration max_backoff = 5; - * @return \Google\Protobuf\Duration|null - */ - public function getMaxBackoff() - { - return $this->max_backoff; - } - - public function hasMaxBackoff() - { - return isset($this->max_backoff); - } - - public function clearMaxBackoff() - { - unset($this->max_backoff); - } - - /** - * A task will be [scheduled][google.cloud.tasks.v2beta2.Task.schedule_time] - * for retry between - * [min_backoff][google.cloud.tasks.v2beta2.RetryConfig.min_backoff] and - * [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] duration - * after it fails, if the queue's - * [RetryConfig][google.cloud.tasks.v2beta2.RetryConfig] specifies that the - * task should be retried. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * This field is output only for [pull - * queues][google.cloud.tasks.v2beta2.PullTarget]. - * `max_backoff` will be truncated to the nearest second. - * This field has the same meaning as - * [max_backoff_seconds in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * - * Generated from protobuf field .google.protobuf.Duration max_backoff = 5; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setMaxBackoff($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->max_backoff = $var; - - return $this; - } - - /** - * The time between retries will double `max_doublings` times. - * A task's retry interval starts at - * [min_backoff][google.cloud.tasks.v2beta2.RetryConfig.min_backoff], then - * doubles `max_doublings` times, then increases linearly, and finally retries - * at intervals of - * [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] up to - * [max_attempts][google.cloud.tasks.v2beta2.RetryConfig.max_attempts] times. - * For example, if - * [min_backoff][google.cloud.tasks.v2beta2.RetryConfig.min_backoff] is 10s, - * [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] is 300s, - * and `max_doublings` is 3, then the a task will first be retried in 10s. The - * retry interval will double three times, and then increase linearly by 2^3 * - * 10s. Finally, the task will retry at intervals of - * [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] until the - * task has been attempted - * [max_attempts][google.cloud.tasks.v2beta2.RetryConfig.max_attempts] times. - * Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, - * 300s, .... - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * This field is output only for [pull - * queues][google.cloud.tasks.v2beta2.PullTarget]. - * This field has the same meaning as - * [max_doublings in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * - * Generated from protobuf field int32 max_doublings = 6; - * @return int - */ - public function getMaxDoublings() - { - return $this->max_doublings; - } - - /** - * The time between retries will double `max_doublings` times. - * A task's retry interval starts at - * [min_backoff][google.cloud.tasks.v2beta2.RetryConfig.min_backoff], then - * doubles `max_doublings` times, then increases linearly, and finally retries - * at intervals of - * [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] up to - * [max_attempts][google.cloud.tasks.v2beta2.RetryConfig.max_attempts] times. - * For example, if - * [min_backoff][google.cloud.tasks.v2beta2.RetryConfig.min_backoff] is 10s, - * [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] is 300s, - * and `max_doublings` is 3, then the a task will first be retried in 10s. The - * retry interval will double three times, and then increase linearly by 2^3 * - * 10s. Finally, the task will retry at intervals of - * [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] until the - * task has been attempted - * [max_attempts][google.cloud.tasks.v2beta2.RetryConfig.max_attempts] times. - * Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, - * 300s, .... - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * This field is output only for [pull - * queues][google.cloud.tasks.v2beta2.PullTarget]. - * This field has the same meaning as - * [max_doublings in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * - * Generated from protobuf field int32 max_doublings = 6; - * @param int $var - * @return $this - */ - public function setMaxDoublings($var) - { - GPBUtil::checkInt32($var); - $this->max_doublings = $var; - - return $this; - } - - /** - * @return string - */ - public function getNumAttempts() - { - return $this->whichOneof("num_attempts"); - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/RunTaskRequest.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/RunTaskRequest.php deleted file mode 100644 index 43840ad89f47..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/RunTaskRequest.php +++ /dev/null @@ -1,146 +0,0 @@ -google.cloud.tasks.v2beta2.RunTaskRequest - */ -class RunTaskRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta2.Task] will be returned. - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta2.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View response_view = 2; - */ - protected $response_view = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * @type int $response_view - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta2.Task] will be returned. - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta2.Task] resource. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta2.Task] will be returned. - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta2.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View response_view = 2; - * @return int - */ - public function getResponseView() - { - return $this->response_view; - } - - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta2.Task] will be returned. - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta2.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View response_view = 2; - * @param int $var - * @return $this - */ - public function setResponseView($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta2\Task\View::class); - $this->response_view = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Task.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Task.php deleted file mode 100644 index 820e2333cf67..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Task.php +++ /dev/null @@ -1,484 +0,0 @@ -google.cloud.tasks.v2beta2.Task - */ -class Task extends \Google\Protobuf\Internal\Message -{ - /** - * Optionally caller-specified in - * [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. - * The task name. - * The task name must have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - * hyphens (-), colons (:), or periods (.). - * For more information, see - * [Identifying - * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) - * * `LOCATION_ID` is the canonical ID for the task's location. - * The list of available locations can be obtained by calling - * [ListLocations][google.cloud.location.Locations.ListLocations]. - * For more information, see https://cloud.google.com/about/locations/. - * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or - * hyphens (-). The maximum length is 100 characters. - * * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), - * hyphens (-), or underscores (_). The maximum length is 500 characters. - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * The time when the task is scheduled to be attempted. - * For App Engine queues, this is when the task will be attempted or retried. - * For pull queues, this is the time when the task is available to - * be leased; if a task is currently leased, this is the time when - * the current lease expires, that is, the time that the task was - * leased plus the - * [lease_duration][google.cloud.tasks.v2beta2.LeaseTasksRequest.lease_duration]. - * `schedule_time` will be truncated to the nearest microsecond. - * - * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 5; - */ - protected $schedule_time = null; - /** - * Output only. The time that the task was created. - * `create_time` will be truncated to the nearest second. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6; - */ - protected $create_time = null; - /** - * Output only. The task status. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.TaskStatus status = 7; - */ - protected $status = null; - /** - * Output only. The view specifies which subset of the - * [Task][google.cloud.tasks.v2beta2.Task] has been returned. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View view = 8; - */ - protected $view = 0; - protected $payload_type; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Optionally caller-specified in - * [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. - * The task name. - * The task name must have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - * hyphens (-), colons (:), or periods (.). - * For more information, see - * [Identifying - * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) - * * `LOCATION_ID` is the canonical ID for the task's location. - * The list of available locations can be obtained by calling - * [ListLocations][google.cloud.location.Locations.ListLocations]. - * For more information, see https://cloud.google.com/about/locations/. - * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or - * hyphens (-). The maximum length is 100 characters. - * * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), - * hyphens (-), or underscores (_). The maximum length is 500 characters. - * @type \Google\Cloud\Tasks\V2beta2\AppEngineHttpRequest $app_engine_http_request - * App Engine HTTP request that is sent to the task's target. Can - * be set only if - * [app_engine_http_target][google.cloud.tasks.v2beta2.Queue.app_engine_http_target] - * is set on the queue. - * An App Engine task is a task that has - * [AppEngineHttpRequest][google.cloud.tasks.v2beta2.AppEngineHttpRequest] - * set. - * @type \Google\Cloud\Tasks\V2beta2\PullMessage $pull_message - * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] to process - * the task. Can be set only if - * [pull_target][google.cloud.tasks.v2beta2.Queue.pull_target] is set on the - * queue. - * A pull task is a task that has - * [PullMessage][google.cloud.tasks.v2beta2.PullMessage] set. - * @type \Google\Cloud\Tasks\V2beta2\HttpRequest $http_request - * HTTP request that is sent to the task's target. - * An HTTP task is a task that has - * [HttpRequest][google.cloud.tasks.v2beta2.HttpRequest] set. - * @type \Google\Protobuf\Timestamp $schedule_time - * The time when the task is scheduled to be attempted. - * For App Engine queues, this is when the task will be attempted or retried. - * For pull queues, this is the time when the task is available to - * be leased; if a task is currently leased, this is the time when - * the current lease expires, that is, the time that the task was - * leased plus the - * [lease_duration][google.cloud.tasks.v2beta2.LeaseTasksRequest.lease_duration]. - * `schedule_time` will be truncated to the nearest microsecond. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time that the task was created. - * `create_time` will be truncated to the nearest second. - * @type \Google\Cloud\Tasks\V2beta2\TaskStatus $status - * Output only. The task status. - * @type int $view - * Output only. The view specifies which subset of the - * [Task][google.cloud.tasks.v2beta2.Task] has been returned. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Task::initOnce(); - parent::__construct($data); - } - - /** - * Optionally caller-specified in - * [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. - * The task name. - * The task name must have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - * hyphens (-), colons (:), or periods (.). - * For more information, see - * [Identifying - * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) - * * `LOCATION_ID` is the canonical ID for the task's location. - * The list of available locations can be obtained by calling - * [ListLocations][google.cloud.location.Locations.ListLocations]. - * For more information, see https://cloud.google.com/about/locations/. - * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or - * hyphens (-). The maximum length is 100 characters. - * * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), - * hyphens (-), or underscores (_). The maximum length is 500 characters. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Optionally caller-specified in - * [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. - * The task name. - * The task name must have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - * hyphens (-), colons (:), or periods (.). - * For more information, see - * [Identifying - * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) - * * `LOCATION_ID` is the canonical ID for the task's location. - * The list of available locations can be obtained by calling - * [ListLocations][google.cloud.location.Locations.ListLocations]. - * For more information, see https://cloud.google.com/about/locations/. - * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or - * hyphens (-). The maximum length is 100 characters. - * * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), - * hyphens (-), or underscores (_). The maximum length is 500 characters. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * App Engine HTTP request that is sent to the task's target. Can - * be set only if - * [app_engine_http_target][google.cloud.tasks.v2beta2.Queue.app_engine_http_target] - * is set on the queue. - * An App Engine task is a task that has - * [AppEngineHttpRequest][google.cloud.tasks.v2beta2.AppEngineHttpRequest] - * set. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.AppEngineHttpRequest app_engine_http_request = 3; - * @return \Google\Cloud\Tasks\V2beta2\AppEngineHttpRequest|null - */ - public function getAppEngineHttpRequest() - { - return $this->readOneof(3); - } - - public function hasAppEngineHttpRequest() - { - return $this->hasOneof(3); - } - - /** - * App Engine HTTP request that is sent to the task's target. Can - * be set only if - * [app_engine_http_target][google.cloud.tasks.v2beta2.Queue.app_engine_http_target] - * is set on the queue. - * An App Engine task is a task that has - * [AppEngineHttpRequest][google.cloud.tasks.v2beta2.AppEngineHttpRequest] - * set. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.AppEngineHttpRequest app_engine_http_request = 3; - * @param \Google\Cloud\Tasks\V2beta2\AppEngineHttpRequest $var - * @return $this - */ - public function setAppEngineHttpRequest($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\AppEngineHttpRequest::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] to process - * the task. Can be set only if - * [pull_target][google.cloud.tasks.v2beta2.Queue.pull_target] is set on the - * queue. - * A pull task is a task that has - * [PullMessage][google.cloud.tasks.v2beta2.PullMessage] set. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.PullMessage pull_message = 4; - * @return \Google\Cloud\Tasks\V2beta2\PullMessage|null - */ - public function getPullMessage() - { - return $this->readOneof(4); - } - - public function hasPullMessage() - { - return $this->hasOneof(4); - } - - /** - * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] to process - * the task. Can be set only if - * [pull_target][google.cloud.tasks.v2beta2.Queue.pull_target] is set on the - * queue. - * A pull task is a task that has - * [PullMessage][google.cloud.tasks.v2beta2.PullMessage] set. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.PullMessage pull_message = 4; - * @param \Google\Cloud\Tasks\V2beta2\PullMessage $var - * @return $this - */ - public function setPullMessage($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\PullMessage::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * HTTP request that is sent to the task's target. - * An HTTP task is a task that has - * [HttpRequest][google.cloud.tasks.v2beta2.HttpRequest] set. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.HttpRequest http_request = 13; - * @return \Google\Cloud\Tasks\V2beta2\HttpRequest|null - */ - public function getHttpRequest() - { - return $this->readOneof(13); - } - - public function hasHttpRequest() - { - return $this->hasOneof(13); - } - - /** - * HTTP request that is sent to the task's target. - * An HTTP task is a task that has - * [HttpRequest][google.cloud.tasks.v2beta2.HttpRequest] set. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.HttpRequest http_request = 13; - * @param \Google\Cloud\Tasks\V2beta2\HttpRequest $var - * @return $this - */ - public function setHttpRequest($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\HttpRequest::class); - $this->writeOneof(13, $var); - - return $this; - } - - /** - * The time when the task is scheduled to be attempted. - * For App Engine queues, this is when the task will be attempted or retried. - * For pull queues, this is the time when the task is available to - * be leased; if a task is currently leased, this is the time when - * the current lease expires, that is, the time that the task was - * leased plus the - * [lease_duration][google.cloud.tasks.v2beta2.LeaseTasksRequest.lease_duration]. - * `schedule_time` will be truncated to the nearest microsecond. - * - * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 5; - * @return \Google\Protobuf\Timestamp|null - */ - public function getScheduleTime() - { - return $this->schedule_time; - } - - public function hasScheduleTime() - { - return isset($this->schedule_time); - } - - public function clearScheduleTime() - { - unset($this->schedule_time); - } - - /** - * The time when the task is scheduled to be attempted. - * For App Engine queues, this is when the task will be attempted or retried. - * For pull queues, this is the time when the task is available to - * be leased; if a task is currently leased, this is the time when - * the current lease expires, that is, the time that the task was - * leased plus the - * [lease_duration][google.cloud.tasks.v2beta2.LeaseTasksRequest.lease_duration]. - * `schedule_time` will be truncated to the nearest microsecond. - * - * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 5; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setScheduleTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->schedule_time = $var; - - return $this; - } - - /** - * Output only. The time that the task was created. - * `create_time` will be truncated to the nearest second. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The time that the task was created. - * `create_time` will be truncated to the nearest second. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The task status. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.TaskStatus status = 7; - * @return \Google\Cloud\Tasks\V2beta2\TaskStatus|null - */ - public function getStatus() - { - return $this->status; - } - - public function hasStatus() - { - return isset($this->status); - } - - public function clearStatus() - { - unset($this->status); - } - - /** - * Output only. The task status. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.TaskStatus status = 7; - * @param \Google\Cloud\Tasks\V2beta2\TaskStatus $var - * @return $this - */ - public function setStatus($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\TaskStatus::class); - $this->status = $var; - - return $this; - } - - /** - * Output only. The view specifies which subset of the - * [Task][google.cloud.tasks.v2beta2.Task] has been returned. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View view = 8; - * @return int - */ - public function getView() - { - return $this->view; - } - - /** - * Output only. The view specifies which subset of the - * [Task][google.cloud.tasks.v2beta2.Task] has been returned. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.Task.View view = 8; - * @param int $var - * @return $this - */ - public function setView($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta2\Task\View::class); - $this->view = $var; - - return $this; - } - - /** - * @return string - */ - public function getPayloadType() - { - return $this->whichOneof("payload_type"); - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Task/View.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Task/View.php deleted file mode 100644 index d3d0db2c9c71..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Task/View.php +++ /dev/null @@ -1,83 +0,0 @@ -google.cloud.tasks.v2beta2.Task.View - */ -class View -{ - /** - * Unspecified. Defaults to BASIC. - * - * Generated from protobuf enum VIEW_UNSPECIFIED = 0; - */ - const VIEW_UNSPECIFIED = 0; - /** - * The basic view omits fields which can be large or can contain - * sensitive data. - * This view does not include the - * ([payload in - * AppEngineHttpRequest][google.cloud.tasks.v2beta2.AppEngineHttpRequest] - * and [payload in - * PullMessage][google.cloud.tasks.v2beta2.PullMessage.payload]). These - * payloads are desirable to return only when needed, because they can be - * large and because of the sensitivity of the data that you choose to store - * in it. - * - * Generated from protobuf enum BASIC = 1; - */ - const BASIC = 1; - /** - * All information is returned. - * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Queue][google.cloud.tasks.v2beta2.Queue] resource. - * - * Generated from protobuf enum FULL = 2; - */ - const FULL = 2; - - private static $valueToName = [ - self::VIEW_UNSPECIFIED => 'VIEW_UNSPECIFIED', - self::BASIC => 'BASIC', - self::FULL => 'FULL', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(View::class, \Google\Cloud\Tasks\V2beta2\Task_View::class); - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/TaskStatus.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/TaskStatus.php deleted file mode 100644 index 9b7ced73522f..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/TaskStatus.php +++ /dev/null @@ -1,241 +0,0 @@ -google.cloud.tasks.v2beta2.TaskStatus - */ -class TaskStatus extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The number of attempts dispatched. - * This count includes attempts which have been dispatched but haven't - * received a response. - * - * Generated from protobuf field int32 attempt_dispatch_count = 1; - */ - protected $attempt_dispatch_count = 0; - /** - * Output only. The number of attempts which have received a response. - * This field is not calculated for [pull - * tasks][google.cloud.tasks.v2beta2.PullMessage]. - * - * Generated from protobuf field int32 attempt_response_count = 2; - */ - protected $attempt_response_count = 0; - /** - * Output only. The status of the task's first attempt. - * Only - * [dispatch_time][google.cloud.tasks.v2beta2.AttemptStatus.dispatch_time] - * will be set. The other - * [AttemptStatus][google.cloud.tasks.v2beta2.AttemptStatus] information is - * not retained by Cloud Tasks. - * This field is not calculated for [pull - * tasks][google.cloud.tasks.v2beta2.PullMessage]. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.AttemptStatus first_attempt_status = 3; - */ - protected $first_attempt_status = null; - /** - * Output only. The status of the task's last attempt. - * This field is not calculated for [pull - * tasks][google.cloud.tasks.v2beta2.PullMessage]. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.AttemptStatus last_attempt_status = 4; - */ - protected $last_attempt_status = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $attempt_dispatch_count - * Output only. The number of attempts dispatched. - * This count includes attempts which have been dispatched but haven't - * received a response. - * @type int $attempt_response_count - * Output only. The number of attempts which have received a response. - * This field is not calculated for [pull - * tasks][google.cloud.tasks.v2beta2.PullMessage]. - * @type \Google\Cloud\Tasks\V2beta2\AttemptStatus $first_attempt_status - * Output only. The status of the task's first attempt. - * Only - * [dispatch_time][google.cloud.tasks.v2beta2.AttemptStatus.dispatch_time] - * will be set. The other - * [AttemptStatus][google.cloud.tasks.v2beta2.AttemptStatus] information is - * not retained by Cloud Tasks. - * This field is not calculated for [pull - * tasks][google.cloud.tasks.v2beta2.PullMessage]. - * @type \Google\Cloud\Tasks\V2beta2\AttemptStatus $last_attempt_status - * Output only. The status of the task's last attempt. - * This field is not calculated for [pull - * tasks][google.cloud.tasks.v2beta2.PullMessage]. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Task::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The number of attempts dispatched. - * This count includes attempts which have been dispatched but haven't - * received a response. - * - * Generated from protobuf field int32 attempt_dispatch_count = 1; - * @return int - */ - public function getAttemptDispatchCount() - { - return $this->attempt_dispatch_count; - } - - /** - * Output only. The number of attempts dispatched. - * This count includes attempts which have been dispatched but haven't - * received a response. - * - * Generated from protobuf field int32 attempt_dispatch_count = 1; - * @param int $var - * @return $this - */ - public function setAttemptDispatchCount($var) - { - GPBUtil::checkInt32($var); - $this->attempt_dispatch_count = $var; - - return $this; - } - - /** - * Output only. The number of attempts which have received a response. - * This field is not calculated for [pull - * tasks][google.cloud.tasks.v2beta2.PullMessage]. - * - * Generated from protobuf field int32 attempt_response_count = 2; - * @return int - */ - public function getAttemptResponseCount() - { - return $this->attempt_response_count; - } - - /** - * Output only. The number of attempts which have received a response. - * This field is not calculated for [pull - * tasks][google.cloud.tasks.v2beta2.PullMessage]. - * - * Generated from protobuf field int32 attempt_response_count = 2; - * @param int $var - * @return $this - */ - public function setAttemptResponseCount($var) - { - GPBUtil::checkInt32($var); - $this->attempt_response_count = $var; - - return $this; - } - - /** - * Output only. The status of the task's first attempt. - * Only - * [dispatch_time][google.cloud.tasks.v2beta2.AttemptStatus.dispatch_time] - * will be set. The other - * [AttemptStatus][google.cloud.tasks.v2beta2.AttemptStatus] information is - * not retained by Cloud Tasks. - * This field is not calculated for [pull - * tasks][google.cloud.tasks.v2beta2.PullMessage]. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.AttemptStatus first_attempt_status = 3; - * @return \Google\Cloud\Tasks\V2beta2\AttemptStatus|null - */ - public function getFirstAttemptStatus() - { - return $this->first_attempt_status; - } - - public function hasFirstAttemptStatus() - { - return isset($this->first_attempt_status); - } - - public function clearFirstAttemptStatus() - { - unset($this->first_attempt_status); - } - - /** - * Output only. The status of the task's first attempt. - * Only - * [dispatch_time][google.cloud.tasks.v2beta2.AttemptStatus.dispatch_time] - * will be set. The other - * [AttemptStatus][google.cloud.tasks.v2beta2.AttemptStatus] information is - * not retained by Cloud Tasks. - * This field is not calculated for [pull - * tasks][google.cloud.tasks.v2beta2.PullMessage]. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.AttemptStatus first_attempt_status = 3; - * @param \Google\Cloud\Tasks\V2beta2\AttemptStatus $var - * @return $this - */ - public function setFirstAttemptStatus($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\AttemptStatus::class); - $this->first_attempt_status = $var; - - return $this; - } - - /** - * Output only. The status of the task's last attempt. - * This field is not calculated for [pull - * tasks][google.cloud.tasks.v2beta2.PullMessage]. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.AttemptStatus last_attempt_status = 4; - * @return \Google\Cloud\Tasks\V2beta2\AttemptStatus|null - */ - public function getLastAttemptStatus() - { - return $this->last_attempt_status; - } - - public function hasLastAttemptStatus() - { - return isset($this->last_attempt_status); - } - - public function clearLastAttemptStatus() - { - unset($this->last_attempt_status); - } - - /** - * Output only. The status of the task's last attempt. - * This field is not calculated for [pull - * tasks][google.cloud.tasks.v2beta2.PullMessage]. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.AttemptStatus last_attempt_status = 4; - * @param \Google\Cloud\Tasks\V2beta2\AttemptStatus $var - * @return $this - */ - public function setLastAttemptStatus($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\AttemptStatus::class); - $this->last_attempt_status = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/UpdateQueueRequest.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/UpdateQueueRequest.php deleted file mode 100644 index c32717481e98..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/UpdateQueueRequest.php +++ /dev/null @@ -1,150 +0,0 @@ -google.cloud.tasks.v2beta2.UpdateQueueRequest - */ -class UpdateQueueRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The queue to create or update. - * The queue's [name][google.cloud.tasks.v2beta2.Queue.name] must be - * specified. - * Output only fields cannot be modified using UpdateQueue. - * Any value specified for an output only field will be ignored. - * The queue's [name][google.cloud.tasks.v2beta2.Queue.name] cannot be - * changed. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.Queue queue = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $queue = null; - /** - * A mask used to specify which fields of the queue are being updated. - * If empty, then all fields will be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - */ - protected $update_mask = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Tasks\V2beta2\Queue $queue - * Required. The queue to create or update. - * The queue's [name][google.cloud.tasks.v2beta2.Queue.name] must be - * specified. - * Output only fields cannot be modified using UpdateQueue. - * Any value specified for an output only field will be ignored. - * The queue's [name][google.cloud.tasks.v2beta2.Queue.name] cannot be - * changed. - * @type \Google\Protobuf\FieldMask $update_mask - * A mask used to specify which fields of the queue are being updated. - * If empty, then all fields will be updated. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * Required. The queue to create or update. - * The queue's [name][google.cloud.tasks.v2beta2.Queue.name] must be - * specified. - * Output only fields cannot be modified using UpdateQueue. - * Any value specified for an output only field will be ignored. - * The queue's [name][google.cloud.tasks.v2beta2.Queue.name] cannot be - * changed. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.Queue queue = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Tasks\V2beta2\Queue|null - */ - public function getQueue() - { - return $this->queue; - } - - public function hasQueue() - { - return isset($this->queue); - } - - public function clearQueue() - { - unset($this->queue); - } - - /** - * Required. The queue to create or update. - * The queue's [name][google.cloud.tasks.v2beta2.Queue.name] must be - * specified. - * Output only fields cannot be modified using UpdateQueue. - * Any value specified for an output only field will be ignored. - * The queue's [name][google.cloud.tasks.v2beta2.Queue.name] cannot be - * changed. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.Queue queue = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Tasks\V2beta2\Queue $var - * @return $this - */ - public function setQueue($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\Queue::class); - $this->queue = $var; - - return $this; - } - - /** - * A mask used to specify which fields of the queue are being updated. - * If empty, then all fields will be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * A mask used to specify which fields of the queue are being updated. - * If empty, then all fields will be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/UploadQueueYamlRequest.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/UploadQueueYamlRequest.php deleted file mode 100644 index 1d8bc2fa466d..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/UploadQueueYamlRequest.php +++ /dev/null @@ -1,120 +0,0 @@ -google.cloud.tasks.v2beta2.UploadQueueYamlRequest - */ -class UploadQueueYamlRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The App ID is supplied as an HTTP parameter. Unlike internal - * usage of App ID, it does not include a region prefix. Rather, the App ID - * represents the Project ID against which to make the request. - * - * Generated from protobuf field string app_id = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $app_id = ''; - /** - * The http body contains the queue.yaml file which used to update queue lists - * - * Generated from protobuf field optional .google.api.HttpBody http_body = 2; - */ - protected $http_body = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $app_id - * Required. The App ID is supplied as an HTTP parameter. Unlike internal - * usage of App ID, it does not include a region prefix. Rather, the App ID - * represents the Project ID against which to make the request. - * @type \Google\Api\HttpBody $http_body - * The http body contains the queue.yaml file which used to update queue lists - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * Required. The App ID is supplied as an HTTP parameter. Unlike internal - * usage of App ID, it does not include a region prefix. Rather, the App ID - * represents the Project ID against which to make the request. - * - * Generated from protobuf field string app_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getAppId() - { - return $this->app_id; - } - - /** - * Required. The App ID is supplied as an HTTP parameter. Unlike internal - * usage of App ID, it does not include a region prefix. Rather, the App ID - * represents the Project ID against which to make the request. - * - * Generated from protobuf field string app_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setAppId($var) - { - GPBUtil::checkString($var, True); - $this->app_id = $var; - - return $this; - } - - /** - * The http body contains the queue.yaml file which used to update queue lists - * - * Generated from protobuf field optional .google.api.HttpBody http_body = 2; - * @return \Google\Api\HttpBody|null - */ - public function getHttpBody() - { - return $this->http_body; - } - - public function hasHttpBody() - { - return isset($this->http_body); - } - - public function clearHttpBody() - { - unset($this->http_body); - } - - /** - * The http body contains the queue.yaml file which used to update queue lists - * - * Generated from protobuf field optional .google.api.HttpBody http_body = 2; - * @param \Google\Api\HttpBody $var - * @return $this - */ - public function setHttpBody($var) - { - GPBUtil::checkMessage($var, \Google\Api\HttpBody::class); - $this->http_body = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/UriOverride.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/UriOverride.php deleted file mode 100644 index 7d21cb8e089e..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/UriOverride.php +++ /dev/null @@ -1,353 +0,0 @@ -google.cloud.tasks.v2beta2.UriOverride - */ -class UriOverride extends \Google\Protobuf\Internal\Message -{ - /** - * Scheme override. - * When specified, the task URI scheme is replaced by the provided value (HTTP - * or HTTPS). - * - * Generated from protobuf field optional .google.cloud.tasks.v2beta2.UriOverride.Scheme scheme = 1; - */ - protected $scheme = null; - /** - * Host override. - * When specified, replaces the host part of the task URL. For example, - * if the task URL is "https://www.google.com," and host value is set to - * "example.net", the overridden URI will be changed to "https://example.net." - * Host value cannot be an empty string (INVALID_ARGUMENT). - * - * Generated from protobuf field optional string host = 2; - */ - protected $host = null; - /** - * Port override. - * When specified, replaces the port part of the task URI. For instance, - * for a URI http://www.google.com/foo and port=123, the overridden URI - * becomes http://www.google.com:123/foo. Note that the port value must be a - * positive integer. Setting the port to 0 (Zero) clears the URI port. - * - * Generated from protobuf field optional int64 port = 3; - */ - protected $port = null; - /** - * URI path. - * When specified, replaces the existing path of the task URL. Setting the - * path value to an empty string clears the URI path segment. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.PathOverride path_override = 4; - */ - protected $path_override = null; - /** - * URI Query. - * When specified, replaces the query part of the task URI. Setting the - * query value to an empty string clears the URI query segment. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.QueryOverride query_override = 5; - */ - protected $query_override = null; - /** - * URI Override Enforce Mode - * When specified, determines the Target UriOverride mode. If not specified, - * it defaults to ALWAYS. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.UriOverride.UriOverrideEnforceMode uri_override_enforce_mode = 6; - */ - protected $uri_override_enforce_mode = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $scheme - * Scheme override. - * When specified, the task URI scheme is replaced by the provided value (HTTP - * or HTTPS). - * @type string $host - * Host override. - * When specified, replaces the host part of the task URL. For example, - * if the task URL is "https://www.google.com," and host value is set to - * "example.net", the overridden URI will be changed to "https://example.net." - * Host value cannot be an empty string (INVALID_ARGUMENT). - * @type int|string $port - * Port override. - * When specified, replaces the port part of the task URI. For instance, - * for a URI http://www.google.com/foo and port=123, the overridden URI - * becomes http://www.google.com:123/foo. Note that the port value must be a - * positive integer. Setting the port to 0 (Zero) clears the URI port. - * @type \Google\Cloud\Tasks\V2beta2\PathOverride $path_override - * URI path. - * When specified, replaces the existing path of the task URL. Setting the - * path value to an empty string clears the URI path segment. - * @type \Google\Cloud\Tasks\V2beta2\QueryOverride $query_override - * URI Query. - * When specified, replaces the query part of the task URI. Setting the - * query value to an empty string clears the URI query segment. - * @type int $uri_override_enforce_mode - * URI Override Enforce Mode - * When specified, determines the Target UriOverride mode. If not specified, - * it defaults to ALWAYS. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Target::initOnce(); - parent::__construct($data); - } - - /** - * Scheme override. - * When specified, the task URI scheme is replaced by the provided value (HTTP - * or HTTPS). - * - * Generated from protobuf field optional .google.cloud.tasks.v2beta2.UriOverride.Scheme scheme = 1; - * @return int - */ - public function getScheme() - { - return isset($this->scheme) ? $this->scheme : 0; - } - - public function hasScheme() - { - return isset($this->scheme); - } - - public function clearScheme() - { - unset($this->scheme); - } - - /** - * Scheme override. - * When specified, the task URI scheme is replaced by the provided value (HTTP - * or HTTPS). - * - * Generated from protobuf field optional .google.cloud.tasks.v2beta2.UriOverride.Scheme scheme = 1; - * @param int $var - * @return $this - */ - public function setScheme($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta2\UriOverride\Scheme::class); - $this->scheme = $var; - - return $this; - } - - /** - * Host override. - * When specified, replaces the host part of the task URL. For example, - * if the task URL is "https://www.google.com," and host value is set to - * "example.net", the overridden URI will be changed to "https://example.net." - * Host value cannot be an empty string (INVALID_ARGUMENT). - * - * Generated from protobuf field optional string host = 2; - * @return string - */ - public function getHost() - { - return isset($this->host) ? $this->host : ''; - } - - public function hasHost() - { - return isset($this->host); - } - - public function clearHost() - { - unset($this->host); - } - - /** - * Host override. - * When specified, replaces the host part of the task URL. For example, - * if the task URL is "https://www.google.com," and host value is set to - * "example.net", the overridden URI will be changed to "https://example.net." - * Host value cannot be an empty string (INVALID_ARGUMENT). - * - * Generated from protobuf field optional string host = 2; - * @param string $var - * @return $this - */ - public function setHost($var) - { - GPBUtil::checkString($var, True); - $this->host = $var; - - return $this; - } - - /** - * Port override. - * When specified, replaces the port part of the task URI. For instance, - * for a URI http://www.google.com/foo and port=123, the overridden URI - * becomes http://www.google.com:123/foo. Note that the port value must be a - * positive integer. Setting the port to 0 (Zero) clears the URI port. - * - * Generated from protobuf field optional int64 port = 3; - * @return int|string - */ - public function getPort() - { - return isset($this->port) ? $this->port : 0; - } - - public function hasPort() - { - return isset($this->port); - } - - public function clearPort() - { - unset($this->port); - } - - /** - * Port override. - * When specified, replaces the port part of the task URI. For instance, - * for a URI http://www.google.com/foo and port=123, the overridden URI - * becomes http://www.google.com:123/foo. Note that the port value must be a - * positive integer. Setting the port to 0 (Zero) clears the URI port. - * - * Generated from protobuf field optional int64 port = 3; - * @param int|string $var - * @return $this - */ - public function setPort($var) - { - GPBUtil::checkInt64($var); - $this->port = $var; - - return $this; - } - - /** - * URI path. - * When specified, replaces the existing path of the task URL. Setting the - * path value to an empty string clears the URI path segment. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.PathOverride path_override = 4; - * @return \Google\Cloud\Tasks\V2beta2\PathOverride|null - */ - public function getPathOverride() - { - return $this->path_override; - } - - public function hasPathOverride() - { - return isset($this->path_override); - } - - public function clearPathOverride() - { - unset($this->path_override); - } - - /** - * URI path. - * When specified, replaces the existing path of the task URL. Setting the - * path value to an empty string clears the URI path segment. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.PathOverride path_override = 4; - * @param \Google\Cloud\Tasks\V2beta2\PathOverride $var - * @return $this - */ - public function setPathOverride($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\PathOverride::class); - $this->path_override = $var; - - return $this; - } - - /** - * URI Query. - * When specified, replaces the query part of the task URI. Setting the - * query value to an empty string clears the URI query segment. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.QueryOverride query_override = 5; - * @return \Google\Cloud\Tasks\V2beta2\QueryOverride|null - */ - public function getQueryOverride() - { - return $this->query_override; - } - - public function hasQueryOverride() - { - return isset($this->query_override); - } - - public function clearQueryOverride() - { - unset($this->query_override); - } - - /** - * URI Query. - * When specified, replaces the query part of the task URI. Setting the - * query value to an empty string clears the URI query segment. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.QueryOverride query_override = 5; - * @param \Google\Cloud\Tasks\V2beta2\QueryOverride $var - * @return $this - */ - public function setQueryOverride($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\QueryOverride::class); - $this->query_override = $var; - - return $this; - } - - /** - * URI Override Enforce Mode - * When specified, determines the Target UriOverride mode. If not specified, - * it defaults to ALWAYS. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.UriOverride.UriOverrideEnforceMode uri_override_enforce_mode = 6; - * @return int - */ - public function getUriOverrideEnforceMode() - { - return $this->uri_override_enforce_mode; - } - - /** - * URI Override Enforce Mode - * When specified, determines the Target UriOverride mode. If not specified, - * it defaults to ALWAYS. - * - * Generated from protobuf field .google.cloud.tasks.v2beta2.UriOverride.UriOverrideEnforceMode uri_override_enforce_mode = 6; - * @param int $var - * @return $this - */ - public function setUriOverrideEnforceMode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta2\UriOverride\UriOverrideEnforceMode::class); - $this->uri_override_enforce_mode = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/UriOverride/Scheme.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/UriOverride/Scheme.php deleted file mode 100644 index d27231a2038d..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/UriOverride/Scheme.php +++ /dev/null @@ -1,66 +0,0 @@ -google.cloud.tasks.v2beta2.UriOverride.Scheme - */ -class Scheme -{ - /** - * Scheme unspecified. Defaults to HTTPS. - * - * Generated from protobuf enum SCHEME_UNSPECIFIED = 0; - */ - const SCHEME_UNSPECIFIED = 0; - /** - * Convert the scheme to HTTP, e.g., https://www.google.ca will change to - * http://www.google.ca. - * - * Generated from protobuf enum HTTP = 1; - */ - const HTTP = 1; - /** - * Convert the scheme to HTTPS, e.g., http://www.google.ca will change to - * https://www.google.ca. - * - * Generated from protobuf enum HTTPS = 2; - */ - const HTTPS = 2; - - private static $valueToName = [ - self::SCHEME_UNSPECIFIED => 'SCHEME_UNSPECIFIED', - self::HTTP => 'HTTP', - self::HTTPS => 'HTTPS', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Scheme::class, \Google\Cloud\Tasks\V2beta2\UriOverride_Scheme::class); - diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/UriOverride/UriOverrideEnforceMode.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/UriOverride/UriOverrideEnforceMode.php deleted file mode 100644 index 16736bffe052..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/UriOverride/UriOverrideEnforceMode.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.tasks.v2beta2.UriOverride.UriOverrideEnforceMode - */ -class UriOverrideEnforceMode -{ - /** - * OverrideMode Unspecified. Defaults to ALWAYS. - * - * Generated from protobuf enum URI_OVERRIDE_ENFORCE_MODE_UNSPECIFIED = 0; - */ - const URI_OVERRIDE_ENFORCE_MODE_UNSPECIFIED = 0; - /** - * In the IF_NOT_EXISTS mode, queue-level configuration is only - * applied where task-level configuration does not exist. - * - * Generated from protobuf enum IF_NOT_EXISTS = 1; - */ - const IF_NOT_EXISTS = 1; - /** - * In the ALWAYS mode, queue-level configuration overrides all - * task-level configuration - * - * Generated from protobuf enum ALWAYS = 2; - */ - const ALWAYS = 2; - - private static $valueToName = [ - self::URI_OVERRIDE_ENFORCE_MODE_UNSPECIFIED => 'URI_OVERRIDE_ENFORCE_MODE_UNSPECIFIED', - self::IF_NOT_EXISTS => 'IF_NOT_EXISTS', - self::ALWAYS => 'ALWAYS', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(UriOverrideEnforceMode::class, \Google\Cloud\Tasks\V2beta2\UriOverride_UriOverrideEnforceMode::class); - diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/acknowledge_task.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/acknowledge_task.php deleted file mode 100644 index dfa44bea000a..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/acknowledge_task.php +++ /dev/null @@ -1,82 +0,0 @@ -acknowledgeTask($formattedName, $scheduleTime); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudTasksClient::taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - - acknowledge_task_sample($formattedName); -} -// [END cloudtasks_v2beta2_generated_CloudTasks_AcknowledgeTask_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/cancel_lease.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/cancel_lease.php deleted file mode 100644 index fa0956fddef3..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/cancel_lease.php +++ /dev/null @@ -1,76 +0,0 @@ -cancelLease($formattedName, $scheduleTime); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudTasksClient::taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - - cancel_lease_sample($formattedName); -} -// [END cloudtasks_v2beta2_generated_CloudTasks_CancelLease_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/create_queue.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/create_queue.php deleted file mode 100644 index b427abdbd306..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/create_queue.php +++ /dev/null @@ -1,85 +0,0 @@ -createQueue($formattedParent, $queue); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = CloudTasksClient::locationName('[PROJECT]', '[LOCATION]'); - - create_queue_sample($formattedParent); -} -// [END cloudtasks_v2beta2_generated_CloudTasks_CreateQueue_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/create_task.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/create_task.php deleted file mode 100644 index e5e238114b44..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/create_task.php +++ /dev/null @@ -1,80 +0,0 @@ -createTask($formattedParent, $task); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = CloudTasksClient::queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - - create_task_sample($formattedParent); -} -// [END cloudtasks_v2beta2_generated_CloudTasks_CreateTask_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/delete_queue.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/delete_queue.php deleted file mode 100644 index 84fb02ab903b..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/delete_queue.php +++ /dev/null @@ -1,77 +0,0 @@ -deleteQueue($formattedName); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudTasksClient::queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - - delete_queue_sample($formattedName); -} -// [END cloudtasks_v2beta2_generated_CloudTasks_DeleteQueue_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/delete_task.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/delete_task.php deleted file mode 100644 index 06124f19250e..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/delete_task.php +++ /dev/null @@ -1,69 +0,0 @@ -deleteTask($formattedName); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudTasksClient::taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - - delete_task_sample($formattedName); -} -// [END cloudtasks_v2beta2_generated_CloudTasks_DeleteTask_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/get_iam_policy.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/get_iam_policy.php deleted file mode 100644 index 1e41025e96ff..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/get_iam_policy.php +++ /dev/null @@ -1,74 +0,0 @@ -getIamPolicy($resource); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - - get_iam_policy_sample($resource); -} -// [END cloudtasks_v2beta2_generated_CloudTasks_GetIamPolicy_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/get_location.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/get_location.php deleted file mode 100644 index 4aaddcc22a3d..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/get_location.php +++ /dev/null @@ -1,53 +0,0 @@ -getLocation(); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END cloudtasks_v2beta2_generated_CloudTasks_GetLocation_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/get_queue.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/get_queue.php deleted file mode 100644 index 5fb478085e54..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/get_queue.php +++ /dev/null @@ -1,67 +0,0 @@ -getQueue($formattedName); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudTasksClient::queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - - get_queue_sample($formattedName); -} -// [END cloudtasks_v2beta2_generated_CloudTasks_GetQueue_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/get_task.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/get_task.php deleted file mode 100644 index 780914b39107..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/get_task.php +++ /dev/null @@ -1,67 +0,0 @@ -getTask($formattedName); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudTasksClient::taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - - get_task_sample($formattedName); -} -// [END cloudtasks_v2beta2_generated_CloudTasks_GetTask_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/lease_tasks.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/lease_tasks.php deleted file mode 100644 index ff53bf1ceb01..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/lease_tasks.php +++ /dev/null @@ -1,93 +0,0 @@ -leaseTasks($formattedParent, $leaseDuration); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = CloudTasksClient::queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - - lease_tasks_sample($formattedParent); -} -// [END cloudtasks_v2beta2_generated_CloudTasks_LeaseTasks_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/list_locations.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/list_locations.php deleted file mode 100644 index 4b8b6f73d3fe..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/list_locations.php +++ /dev/null @@ -1,58 +0,0 @@ -listLocations(); - - /** @var Location $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END cloudtasks_v2beta2_generated_CloudTasks_ListLocations_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/list_queues.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/list_queues.php deleted file mode 100644 index e0d3bf4d4cff..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/list_queues.php +++ /dev/null @@ -1,74 +0,0 @@ -listQueues($formattedParent); - - /** @var Queue $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = CloudTasksClient::locationName('[PROJECT]', '[LOCATION]'); - - list_queues_sample($formattedParent); -} -// [END cloudtasks_v2beta2_generated_CloudTasks_ListQueues_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/list_tasks.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/list_tasks.php deleted file mode 100644 index 47ab73268ce6..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/list_tasks.php +++ /dev/null @@ -1,80 +0,0 @@ -listTasks($formattedParent); - - /** @var Task $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = CloudTasksClient::queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - - list_tasks_sample($formattedParent); -} -// [END cloudtasks_v2beta2_generated_CloudTasks_ListTasks_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/pause_queue.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/pause_queue.php deleted file mode 100644 index dd98a7e55fc3..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/pause_queue.php +++ /dev/null @@ -1,74 +0,0 @@ -pauseQueue($formattedName); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudTasksClient::queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - - pause_queue_sample($formattedName); -} -// [END cloudtasks_v2beta2_generated_CloudTasks_PauseQueue_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/purge_queue.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/purge_queue.php deleted file mode 100644 index 3a1827680371..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/purge_queue.php +++ /dev/null @@ -1,72 +0,0 @@ -purgeQueue($formattedName); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudTasksClient::queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - - purge_queue_sample($formattedName); -} -// [END cloudtasks_v2beta2_generated_CloudTasks_PurgeQueue_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/renew_lease.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/renew_lease.php deleted file mode 100644 index 59ff5f7d8ba2..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/renew_lease.php +++ /dev/null @@ -1,78 +0,0 @@ -renewLease($formattedName, $scheduleTime, $leaseDuration); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudTasksClient::taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - - renew_lease_sample($formattedName); -} -// [END cloudtasks_v2beta2_generated_CloudTasks_RenewLease_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/resume_queue.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/resume_queue.php deleted file mode 100644 index d787c841efa8..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/resume_queue.php +++ /dev/null @@ -1,81 +0,0 @@ -resumeQueue($formattedName); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudTasksClient::queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - - resume_queue_sample($formattedName); -} -// [END cloudtasks_v2beta2_generated_CloudTasks_ResumeQueue_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/run_task.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/run_task.php deleted file mode 100644 index 10dddc23c693..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/run_task.php +++ /dev/null @@ -1,96 +0,0 @@ -runTask($formattedName); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudTasksClient::taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - - run_task_sample($formattedName); -} -// [END cloudtasks_v2beta2_generated_CloudTasks_RunTask_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/set_iam_policy.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/set_iam_policy.php deleted file mode 100644 index cb9b2123bea6..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/set_iam_policy.php +++ /dev/null @@ -1,79 +0,0 @@ -setIamPolicy($resource, $policy); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - - set_iam_policy_sample($resource); -} -// [END cloudtasks_v2beta2_generated_CloudTasks_SetIamPolicy_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/test_iam_permissions.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/test_iam_permissions.php deleted file mode 100644 index a5e276e15c38..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/test_iam_permissions.php +++ /dev/null @@ -1,81 +0,0 @@ -testIamPermissions($resource, $permissions); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - $permissionsElement = '[PERMISSIONS]'; - - test_iam_permissions_sample($resource, $permissionsElement); -} -// [END cloudtasks_v2beta2_generated_CloudTasks_TestIamPermissions_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/update_queue.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/update_queue.php deleted file mode 100644 index 4e20bc98ab2c..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/update_queue.php +++ /dev/null @@ -1,70 +0,0 @@ -updateQueue($queue); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END cloudtasks_v2beta2_generated_CloudTasks_UpdateQueue_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/upload_queue_yaml.php b/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/upload_queue_yaml.php deleted file mode 100644 index 270900884e50..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/samples/V2beta2/CloudTasksClient/upload_queue_yaml.php +++ /dev/null @@ -1,69 +0,0 @@ -uploadQueueYaml($appId); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $appId = '[APP_ID]'; - - upload_queue_yaml_sample($appId); -} -// [END cloudtasks_v2beta2_generated_CloudTasks_UploadQueueYaml_sync] diff --git a/owl-bot-staging/Tasks/v2beta2/src/V2beta2/CloudTasksClient.php b/owl-bot-staging/Tasks/v2beta2/src/V2beta2/CloudTasksClient.php deleted file mode 100644 index f2e76ac1bacc..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/src/V2beta2/CloudTasksClient.php +++ /dev/null @@ -1,36 +0,0 @@ -taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - * $scheduleTime = new Timestamp(); - * $cloudTasksClient->acknowledgeTask($formattedName, $scheduleTime); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @experimental - * - * @deprecated This class will be removed in the next major version update. - */ -class CloudTasksGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.tasks.v2beta2.CloudTasks'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'cloudtasks.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'cloudtasks.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $locationNameTemplate; - - private static $queueNameTemplate; - - private static $taskNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/cloud_tasks_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/cloud_tasks_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/cloud_tasks_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/cloud_tasks_rest_client_config.php', - ], - ], - ]; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getQueueNameTemplate() - { - if (self::$queueNameTemplate == null) { - self::$queueNameTemplate = new PathTemplate('projects/{project}/locations/{location}/queues/{queue}'); - } - - return self::$queueNameTemplate; - } - - private static function getTaskNameTemplate() - { - if (self::$taskNameTemplate == null) { - self::$taskNameTemplate = new PathTemplate('projects/{project}/locations/{location}/queues/{queue}/tasks/{task}'); - } - - return self::$taskNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'location' => self::getLocationNameTemplate(), - 'queue' => self::getQueueNameTemplate(), - 'task' => self::getTaskNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - * - * @experimental - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a queue - * resource. - * - * @param string $project - * @param string $location - * @param string $queue - * - * @return string The formatted queue resource. - * - * @experimental - */ - public static function queueName($project, $location, $queue) - { - return self::getQueueNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'queue' => $queue, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a task - * resource. - * - * @param string $project - * @param string $location - * @param string $queue - * @param string $task - * - * @return string The formatted task resource. - * - * @experimental - */ - public static function taskName($project, $location, $queue, $task) - { - return self::getTaskNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'queue' => $queue, - 'task' => $task, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - location: projects/{project}/locations/{location} - * - queue: projects/{project}/locations/{location}/queues/{queue} - * - task: projects/{project}/locations/{location}/queues/{queue}/tasks/{task} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - * - * @experimental - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'cloudtasks.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - * - * @experimental - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Acknowledges a pull task. - * - * The worker, that is, the entity that - * [leased][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] this task must - * call this method to indicate that the work associated with the task has - * finished. - * - * The worker must acknowledge a task within the - * [lease_duration][google.cloud.tasks.v2beta2.LeaseTasksRequest.lease_duration] - * or the lease will expire and the task will become available to be leased - * again. After the task is acknowledged, it will not be returned - * by a later [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks], - * [GetTask][google.cloud.tasks.v2beta2.CloudTasks.GetTask], or - * [ListTasks][google.cloud.tasks.v2beta2.CloudTasks.ListTasks]. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $formattedName = $cloudTasksClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - * $scheduleTime = new Timestamp(); - * $cloudTasksClient->acknowledgeTask($formattedName, $scheduleTime); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $name Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * @param Timestamp $scheduleTime Required. The task's current schedule time, available in the - * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] returned by - * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] response or - * [RenewLease][google.cloud.tasks.v2beta2.CloudTasks.RenewLease] response. - * This restriction is to ensure that your worker currently holds the lease. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function acknowledgeTask($name, $scheduleTime, array $optionalArgs = []) - { - $request = new AcknowledgeTaskRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setScheduleTime($scheduleTime); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('AcknowledgeTask', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Cancel a pull task's lease. - * - * The worker can use this method to cancel a task's lease by - * setting its [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] - * to now. This will make the task available to be leased to the next caller - * of [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks]. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $formattedName = $cloudTasksClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - * $scheduleTime = new Timestamp(); - * $response = $cloudTasksClient->cancelLease($formattedName, $scheduleTime); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $name Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * @param Timestamp $scheduleTime Required. The task's current schedule time, available in the - * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] returned by - * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] response or - * [RenewLease][google.cloud.tasks.v2beta2.CloudTasks.RenewLease] response. - * This restriction is to ensure that your worker currently holds the lease. - * @param array $optionalArgs { - * Optional. - * - * @type int $responseView - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta2.Task] will be returned. - * - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * - * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta2.Task] resource. - * For allowed values, use constants defined on {@see \Google\Cloud\Tasks\V2beta2\Task\View} - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Tasks\V2beta2\Task - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function cancelLease($name, $scheduleTime, array $optionalArgs = []) - { - $request = new CancelLeaseRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setScheduleTime($scheduleTime); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['responseView'])) { - $request->setResponseView($optionalArgs['responseView']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CancelLease', Task::class, $optionalArgs, $request)->wait(); - } - - /** - * Creates a queue. - * - * Queues created with this method allow tasks to live for a maximum of 31 - * days. After a task is 31 days old, the task will be deleted regardless of - * whether it was dispatched or not. - * - * WARNING: Using this method may have unintended side effects if you are - * using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - * Read - * [Overview of Queue Management and - * queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - * this method. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $formattedParent = $cloudTasksClient->locationName('[PROJECT]', '[LOCATION]'); - * $queue = new Queue(); - * $response = $cloudTasksClient->createQueue($formattedParent, $queue); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $parent Required. The location name in which the queue will be created. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * - * The list of allowed locations can be obtained by calling Cloud - * Tasks' implementation of - * [ListLocations][google.cloud.location.Locations.ListLocations]. - * @param Queue $queue Required. The queue to create. - * - * [Queue's name][google.cloud.tasks.v2beta2.Queue.name] cannot be the same as - * an existing queue. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Tasks\V2beta2\Queue - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createQueue($parent, $queue, array $optionalArgs = []) - { - $request = new CreateQueueRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setQueue($queue); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateQueue', Queue::class, $optionalArgs, $request)->wait(); - } - - /** - * Creates a task and adds it to a queue. - * - * Tasks cannot be updated after creation; there is no UpdateTask command. - * - * * For [App Engine queues][google.cloud.tasks.v2beta2.AppEngineHttpTarget], - * the maximum task size is - * 100KB. - * * For [pull queues][google.cloud.tasks.v2beta2.PullTarget], the maximum - * task size is 1MB. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $formattedParent = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - * $task = new Task(); - * $response = $cloudTasksClient->createTask($formattedParent, $task); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $parent Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * - * The queue must already exist. - * @param Task $task Required. The task to add. - * - * Task names have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. - * The user can optionally specify a task - * [name][google.cloud.tasks.v2beta2.Task.name]. If a name is not specified - * then the system will generate a random unique task id, which will be set in - * the task returned in the [response][google.cloud.tasks.v2beta2.Task.name]. - * - * If [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] is not - * set or is in the past then Cloud Tasks will set it to the current time. - * - * Task De-duplication: - * - * Explicitly specifying a task ID enables task de-duplication. If - * a task's ID is identical to that of an existing task or a task - * that was deleted or completed recently then the call will fail - * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. - * If the task's queue was created using Cloud Tasks, then another task with - * the same name can't be created for ~1 hour after the original task was - * deleted or completed. If the task's queue was created using queue.yaml or - * queue.xml, then another task with the same name can't be created - * for ~9 days after the original task was deleted or completed. - * - * Because there is an extra lookup cost to identify duplicate task - * names, these [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] - * calls have significantly increased latency. Using hashed strings for the - * task id or for the prefix of the task id is recommended. Choosing task ids - * that are sequential or have sequential prefixes, for example using a - * timestamp, causes an increase in latency and error rates in all - * task commands. The infrastructure relies on an approximately - * uniform distribution of task ids to store and serve tasks - * efficiently. - * @param array $optionalArgs { - * Optional. - * - * @type int $responseView - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta2.Task] will be returned. - * - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * - * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta2.Task] resource. - * For allowed values, use constants defined on {@see \Google\Cloud\Tasks\V2beta2\Task\View} - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Tasks\V2beta2\Task - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createTask($parent, $task, array $optionalArgs = []) - { - $request = new CreateTaskRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setTask($task); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['responseView'])) { - $request->setResponseView($optionalArgs['responseView']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateTask', Task::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes a queue. - * - * This command will delete the queue even if it has tasks in it. - * - * Note: If you delete a queue, a queue with the same name can't be created - * for 7 days. - * - * WARNING: Using this method may have unintended side effects if you are - * using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - * Read - * [Overview of Queue Management and - * queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - * this method. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - * $cloudTasksClient->deleteQueue($formattedName); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $name Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteQueue($name, array $optionalArgs = []) - { - $request = new DeleteQueueRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteQueue', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes a task. - * - * A task can be deleted if it is scheduled or dispatched. A task - * cannot be deleted if it has completed successfully or permanently - * failed. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $formattedName = $cloudTasksClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - * $cloudTasksClient->deleteTask($formattedName); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $name Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteTask($name, array $optionalArgs = []) - { - $request = new DeleteTaskRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteTask', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets the access control policy for a - * [Queue][google.cloud.tasks.v2beta2.Queue]. Returns an empty policy if the - * resource exists and does not have a policy set. - * - * Authorization requires the following - * [Google IAM](https://cloud.google.com/iam) permission on the specified - * resource parent: - * - * * `cloudtasks.queues.getIamPolicy` - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $resource = 'resource'; - * $response = $cloudTasksClient->getIamPolicy($resource); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets a queue. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - * $response = $cloudTasksClient->getQueue($formattedName); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the queue. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $readMask - * Optional. Read mask is used for a more granular control over what the API - * returns. If the mask is not present all fields will be returned except - * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - * specified in the mask. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Tasks\V2beta2\Queue - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getQueue($name, array $optionalArgs = []) - { - $request = new GetQueueRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['readMask'])) { - $request->setReadMask($optionalArgs['readMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetQueue', Queue::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets a task. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $formattedName = $cloudTasksClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - * $response = $cloudTasksClient->getTask($formattedName); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $name Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * @param array $optionalArgs { - * Optional. - * - * @type int $responseView - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta2.Task] will be returned. - * - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * - * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta2.Task] resource. - * For allowed values, use constants defined on {@see \Google\Cloud\Tasks\V2beta2\Task\View} - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Tasks\V2beta2\Task - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getTask($name, array $optionalArgs = []) - { - $request = new GetTaskRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['responseView'])) { - $request->setResponseView($optionalArgs['responseView']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetTask', Task::class, $optionalArgs, $request)->wait(); - } - - /** - * Leases tasks from a pull queue for - * [lease_duration][google.cloud.tasks.v2beta2.LeaseTasksRequest.lease_duration]. - * - * This method is invoked by the worker to obtain a lease. The - * worker must acknowledge the task via - * [AcknowledgeTask][google.cloud.tasks.v2beta2.CloudTasks.AcknowledgeTask] - * after they have performed the work associated with the task. - * - * The [payload][google.cloud.tasks.v2beta2.PullMessage.payload] is intended - * to store data that the worker needs to perform the work associated with the - * task. To return the payloads in the - * [response][google.cloud.tasks.v2beta2.LeaseTasksResponse], set - * [response_view][google.cloud.tasks.v2beta2.LeaseTasksRequest.response_view] - * to [FULL][google.cloud.tasks.v2beta2.Task.View.FULL]. - * - * A maximum of 10 qps of - * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] requests are - * allowed per queue. [RESOURCE_EXHAUSTED][google.rpc.Code.RESOURCE_EXHAUSTED] - * is returned when this limit is - * exceeded. [RESOURCE_EXHAUSTED][google.rpc.Code.RESOURCE_EXHAUSTED] - * is also returned when - * [max_tasks_dispatched_per_second][google.cloud.tasks.v2beta2.RateLimits.max_tasks_dispatched_per_second] - * is exceeded. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $formattedParent = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - * $leaseDuration = new Duration(); - * $response = $cloudTasksClient->leaseTasks($formattedParent, $leaseDuration); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $parent Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * @param Duration $leaseDuration Required. The duration of the lease. - * - * Each task returned in the - * [response][google.cloud.tasks.v2beta2.LeaseTasksResponse] will have its - * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] set to the - * current time plus the `lease_duration`. The task is leased until its - * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]; thus, the - * task will not be returned to another - * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] call before - * its [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]. - * - * - * After the worker has successfully finished the work associated - * with the task, the worker must call via - * [AcknowledgeTask][google.cloud.tasks.v2beta2.CloudTasks.AcknowledgeTask] - * before the [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]. - * Otherwise the task will be returned to a later - * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] call so that - * another worker can retry it. - * - * The maximum lease duration is 1 week. - * `lease_duration` will be truncated to the nearest second. - * @param array $optionalArgs { - * Optional. - * - * @type int $maxTasks - * The maximum number of tasks to lease. - * - * The system will make a best effort to return as close to as - * `max_tasks` as possible. - * - * The largest that `max_tasks` can be is 1000. - * - * The maximum total size of a [lease tasks - * response][google.cloud.tasks.v2beta2.LeaseTasksResponse] is 32 MB. If the - * sum of all task sizes requested reaches this limit, fewer tasks than - * requested are returned. - * @type int $responseView - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta2.Task] will be returned. - * - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * - * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta2.Task] resource. - * For allowed values, use constants defined on {@see \Google\Cloud\Tasks\V2beta2\Task\View} - * @type string $filter - * `filter` can be used to specify a subset of tasks to lease. - * - * When `filter` is set to `tag=` then the - * [response][google.cloud.tasks.v2beta2.LeaseTasksResponse] will contain only - * tasks whose [tag][google.cloud.tasks.v2beta2.PullMessage.tag] is equal to - * ``. `` must be less than 500 characters. - * - * When `filter` is set to `tag_function=oldest_tag()`, only tasks which have - * the same tag as the task with the oldest - * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] will be - * returned. - * - * Grammar Syntax: - * - * * `filter = "tag=" tag | "tag_function=" function` - * - * * `tag = string` - * - * * `function = "oldest_tag()"` - * - * The `oldest_tag()` function returns tasks which have the same tag as the - * oldest task (ordered by schedule time). - * - * SDK compatibility: Although the SDK allows tags to be either - * string or - * [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), - * only UTF-8 encoded tags can be used in Cloud Tasks. Tag which - * aren't UTF-8 encoded can't be used in the - * [filter][google.cloud.tasks.v2beta2.LeaseTasksRequest.filter] and the - * task's [tag][google.cloud.tasks.v2beta2.PullMessage.tag] will be displayed - * as empty in Cloud Tasks. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Tasks\V2beta2\LeaseTasksResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function leaseTasks($parent, $leaseDuration, array $optionalArgs = []) - { - $request = new LeaseTasksRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setLeaseDuration($leaseDuration); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['maxTasks'])) { - $request->setMaxTasks($optionalArgs['maxTasks']); - } - - if (isset($optionalArgs['responseView'])) { - $request->setResponseView($optionalArgs['responseView']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('LeaseTasks', LeaseTasksResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists queues. - * - * Queues are returned in lexicographical order. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $formattedParent = $cloudTasksClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $cloudTasksClient->listQueues($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $cloudTasksClient->listQueues($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $parent Required. The location name. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * `filter` can be used to specify a subset of queues. Any - * [Queue][google.cloud.tasks.v2beta2.Queue] field can be used as a filter and - * several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The - * filter syntax is the same as described in [Stackdriver's Advanced Logs - * Filters](https://cloud.google.com/logging/docs/view/advanced_filters). - * - * Sample filter "app_engine_http_target: *". - * - * Note that using filters might cause fewer queues than the - * requested_page size to be returned. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type FieldMask $readMask - * Optional. Read mask is used for a more granular control over what the API - * returns. If the mask is not present all fields will be returned except - * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - * specified in the mask. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listQueues($parent, array $optionalArgs = []) - { - $request = new ListQueuesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['readMask'])) { - $request->setReadMask($optionalArgs['readMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListQueues', $optionalArgs, ListQueuesResponse::class, $request); - } - - /** - * Lists the tasks in a queue. - * - * By default, only the [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC] - * view is retrieved due to performance considerations; - * [response_view][google.cloud.tasks.v2beta2.ListTasksRequest.response_view] - * controls the subset of information which is returned. - * - * The tasks may be returned in any order. The ordering may change at any - * time. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $formattedParent = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - * // Iterate over pages of elements - * $pagedResponse = $cloudTasksClient->listTasks($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $cloudTasksClient->listTasks($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $parent Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * @param array $optionalArgs { - * Optional. - * - * @type int $responseView - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta2.Task] will be returned. - * - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * - * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta2.Task] resource. - * For allowed values, use constants defined on {@see \Google\Cloud\Tasks\V2beta2\Task\View} - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listTasks($parent, array $optionalArgs = []) - { - $request = new ListTasksRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['responseView'])) { - $request->setResponseView($optionalArgs['responseView']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListTasks', $optionalArgs, ListTasksResponse::class, $request); - } - - /** - * Pauses the queue. - * - * If a queue is paused then the system will stop dispatching tasks - * until the queue is resumed via - * [ResumeQueue][google.cloud.tasks.v2beta2.CloudTasks.ResumeQueue]. Tasks can - * still be added when the queue is paused. A queue is paused if its - * [state][google.cloud.tasks.v2beta2.Queue.state] is - * [PAUSED][google.cloud.tasks.v2beta2.Queue.State.PAUSED]. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - * $response = $cloudTasksClient->pauseQueue($formattedName); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $name Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Tasks\V2beta2\Queue - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function pauseQueue($name, array $optionalArgs = []) - { - $request = new PauseQueueRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('PauseQueue', Queue::class, $optionalArgs, $request)->wait(); - } - - /** - * Purges a queue by deleting all of its tasks. - * - * All tasks created before this method is called are permanently deleted. - * - * Purge operations can take up to one minute to take effect. Tasks - * might be dispatched before the purge takes effect. A purge is irreversible. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - * $response = $cloudTasksClient->purgeQueue($formattedName); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $name Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Tasks\V2beta2\Queue - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function purgeQueue($name, array $optionalArgs = []) - { - $request = new PurgeQueueRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('PurgeQueue', Queue::class, $optionalArgs, $request)->wait(); - } - - /** - * Renew the current lease of a pull task. - * - * The worker can use this method to extend the lease by a new - * duration, starting from now. The new task lease will be - * returned in the task's - * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $formattedName = $cloudTasksClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - * $scheduleTime = new Timestamp(); - * $leaseDuration = new Duration(); - * $response = $cloudTasksClient->renewLease($formattedName, $scheduleTime, $leaseDuration); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $name Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * @param Timestamp $scheduleTime Required. The task's current schedule time, available in the - * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] returned by - * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] response or - * [RenewLease][google.cloud.tasks.v2beta2.CloudTasks.RenewLease] response. - * This restriction is to ensure that your worker currently holds the lease. - * @param Duration $leaseDuration Required. The desired new lease duration, starting from now. - * - * - * The maximum lease duration is 1 week. - * `lease_duration` will be truncated to the nearest second. - * @param array $optionalArgs { - * Optional. - * - * @type int $responseView - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta2.Task] will be returned. - * - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * - * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta2.Task] resource. - * For allowed values, use constants defined on {@see \Google\Cloud\Tasks\V2beta2\Task\View} - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Tasks\V2beta2\Task - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function renewLease($name, $scheduleTime, $leaseDuration, array $optionalArgs = []) - { - $request = new RenewLeaseRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setScheduleTime($scheduleTime); - $request->setLeaseDuration($leaseDuration); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['responseView'])) { - $request->setResponseView($optionalArgs['responseView']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('RenewLease', Task::class, $optionalArgs, $request)->wait(); - } - - /** - * Resume a queue. - * - * This method resumes a queue after it has been - * [PAUSED][google.cloud.tasks.v2beta2.Queue.State.PAUSED] or - * [DISABLED][google.cloud.tasks.v2beta2.Queue.State.DISABLED]. The state of a - * queue is stored in the queue's - * [state][google.cloud.tasks.v2beta2.Queue.state]; after calling this method - * it will be set to - * [RUNNING][google.cloud.tasks.v2beta2.Queue.State.RUNNING]. - * - * WARNING: Resuming many high-QPS queues at the same time can - * lead to target overloading. If you are resuming high-QPS - * queues, follow the 500/50/5 pattern described in - * [Managing Cloud Tasks Scaling - * Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling). - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - * $response = $cloudTasksClient->resumeQueue($formattedName); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $name Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Tasks\V2beta2\Queue - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function resumeQueue($name, array $optionalArgs = []) - { - $request = new ResumeQueueRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('ResumeQueue', Queue::class, $optionalArgs, $request)->wait(); - } - - /** - * Forces a task to run now. - * - * When this method is called, Cloud Tasks will dispatch the task, even if - * the task is already running, the queue has reached its - * [RateLimits][google.cloud.tasks.v2beta2.RateLimits] or is - * [PAUSED][google.cloud.tasks.v2beta2.Queue.State.PAUSED]. - * - * This command is meant to be used for manual debugging. For - * example, [RunTask][google.cloud.tasks.v2beta2.CloudTasks.RunTask] can be - * used to retry a failed task after a fix has been made or to manually force - * a task to be dispatched now. - * - * The dispatched task is returned. That is, the task that is returned - * contains the [status][google.cloud.tasks.v2beta2.Task.status] after the - * task is dispatched but before the task is received by its target. - * - * If Cloud Tasks receives a successful response from the task's - * target, then the task will be deleted; otherwise the task's - * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] will be - * reset to the time that - * [RunTask][google.cloud.tasks.v2beta2.CloudTasks.RunTask] was called plus - * the retry delay specified in the queue's - * [RetryConfig][google.cloud.tasks.v2beta2.RetryConfig]. - * - * [RunTask][google.cloud.tasks.v2beta2.CloudTasks.RunTask] returns - * [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a - * task that has already succeeded or permanently failed. - * - * [RunTask][google.cloud.tasks.v2beta2.CloudTasks.RunTask] cannot be called - * on a [pull task][google.cloud.tasks.v2beta2.PullMessage]. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $formattedName = $cloudTasksClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - * $response = $cloudTasksClient->runTask($formattedName); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $name Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * @param array $optionalArgs { - * Optional. - * - * @type int $responseView - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta2.Task] will be returned. - * - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * - * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta2.Task] resource. - * For allowed values, use constants defined on {@see \Google\Cloud\Tasks\V2beta2\Task\View} - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Tasks\V2beta2\Task - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function runTask($name, array $optionalArgs = []) - { - $request = new RunTaskRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['responseView'])) { - $request->setResponseView($optionalArgs['responseView']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('RunTask', Task::class, $optionalArgs, $request)->wait(); - } - - /** - * Sets the access control policy for a - * [Queue][google.cloud.tasks.v2beta2.Queue]. Replaces any existing policy. - * - * Note: The Cloud Console does not check queue-level IAM permissions yet. - * Project-level permissions are required to use the Cloud Console. - * - * Authorization requires the following - * [Google IAM](https://cloud.google.com/iam) permission on the specified - * resource parent: - * - * * `cloudtasks.queues.setIamPolicy` - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $cloudTasksClient->setIamPolicy($resource, $policy); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); - } - - /** - * Returns permissions that a caller has on a - * [Queue][google.cloud.tasks.v2beta2.Queue]. If the resource does not exist, - * this will return an empty set of permissions, not a - * [NOT_FOUND][google.rpc.Code.NOT_FOUND] error. - * - * Note: This operation is designed to be used for building permission-aware - * UIs and command-line tools, not for authorization checking. This operation - * may "fail open" without warning. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $cloudTasksClient->testIamPermissions($resource, $permissions); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function testIamPermissions($resource, $permissions, array $optionalArgs = []) - { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('TestIamPermissions', TestIamPermissionsResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Updates a queue. - * - * This method creates the queue if it does not exist and updates - * the queue if it does exist. - * - * Queues created with this method allow tasks to live for a maximum of 31 - * days. After a task is 31 days old, the task will be deleted regardless of - * whether it was dispatched or not. - * - * WARNING: Using this method may have unintended side effects if you are - * using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - * Read - * [Overview of Queue Management and - * queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - * this method. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $queue = new Queue(); - * $response = $cloudTasksClient->updateQueue($queue); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param Queue $queue Required. The queue to create or update. - * - * The queue's [name][google.cloud.tasks.v2beta2.Queue.name] must be - * specified. - * - * Output only fields cannot be modified using UpdateQueue. - * Any value specified for an output only field will be ignored. - * The queue's [name][google.cloud.tasks.v2beta2.Queue.name] cannot be - * changed. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * A mask used to specify which fields of the queue are being updated. - * - * If empty, then all fields will be updated. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Tasks\V2beta2\Queue - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function updateQueue($queue, array $optionalArgs = []) - { - $request = new UpdateQueueRequest(); - $requestParamHeaders = []; - $request->setQueue($queue); - $requestParamHeaders['queue.name'] = $queue->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateQueue', Queue::class, $optionalArgs, $request)->wait(); - } - - /** - * Update queue list by uploading a queue.yaml file. - * - * The queue.yaml file is supplied in the request body as a YAML encoded - * string. This method was added to support gcloud clients versions before - * 322.0.0. New clients should use CreateQueue instead of this method. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $appId = 'app_id'; - * $cloudTasksClient->uploadQueueYaml($appId); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $appId Required. The App ID is supplied as an HTTP parameter. Unlike internal - * usage of App ID, it does not include a region prefix. Rather, the App ID - * represents the Project ID against which to make the request. - * @param array $optionalArgs { - * Optional. - * - * @type HttpBody $httpBody - * The http body contains the queue.yaml file which used to update queue lists - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function uploadQueueYaml($appId, array $optionalArgs = []) - { - $request = new UploadQueueYamlRequest(); - $request->setAppId($appId); - if (isset($optionalArgs['httpBody'])) { - $request->setHttpBody($optionalArgs['httpBody']); - } - - return $this->startCall('UploadQueueYaml', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $response = $cloudTasksClient->getLocation(); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $cloudTasksClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $cloudTasksClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); - } -} diff --git a/owl-bot-staging/Tasks/v2beta2/src/V2beta2/gapic_metadata.json b/owl-bot-staging/Tasks/v2beta2/src/V2beta2/gapic_metadata.json deleted file mode 100644 index 92458443760a..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/src/V2beta2/gapic_metadata.json +++ /dev/null @@ -1,133 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.cloud.tasks.v2beta2", - "libraryPackage": "Google\\Cloud\\Tasks\\V2beta2", - "services": { - "CloudTasks": { - "clients": { - "grpc": { - "libraryClient": "CloudTasksGapicClient", - "rpcs": { - "AcknowledgeTask": { - "methods": [ - "acknowledgeTask" - ] - }, - "CancelLease": { - "methods": [ - "cancelLease" - ] - }, - "CreateQueue": { - "methods": [ - "createQueue" - ] - }, - "CreateTask": { - "methods": [ - "createTask" - ] - }, - "DeleteQueue": { - "methods": [ - "deleteQueue" - ] - }, - "DeleteTask": { - "methods": [ - "deleteTask" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "GetQueue": { - "methods": [ - "getQueue" - ] - }, - "GetTask": { - "methods": [ - "getTask" - ] - }, - "LeaseTasks": { - "methods": [ - "leaseTasks" - ] - }, - "ListQueues": { - "methods": [ - "listQueues" - ] - }, - "ListTasks": { - "methods": [ - "listTasks" - ] - }, - "PauseQueue": { - "methods": [ - "pauseQueue" - ] - }, - "PurgeQueue": { - "methods": [ - "purgeQueue" - ] - }, - "RenewLease": { - "methods": [ - "renewLease" - ] - }, - "ResumeQueue": { - "methods": [ - "resumeQueue" - ] - }, - "RunTask": { - "methods": [ - "runTask" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - }, - "UpdateQueue": { - "methods": [ - "updateQueue" - ] - }, - "UploadQueueYaml": { - "methods": [ - "uploadQueueYaml" - ] - }, - "GetLocation": { - "methods": [ - "getLocation" - ] - }, - "ListLocations": { - "methods": [ - "listLocations" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/Tasks/v2beta2/src/V2beta2/resources/cloud_tasks_client_config.json b/owl-bot-staging/Tasks/v2beta2/src/V2beta2/resources/cloud_tasks_client_config.json deleted file mode 100644 index 3e49652fe97e..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/src/V2beta2/resources/cloud_tasks_client_config.json +++ /dev/null @@ -1,160 +0,0 @@ -{ - "interfaces": { - "google.cloud.tasks.v2beta2.CloudTasks": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "UNAVAILABLE", - "DEADLINE_EXCEEDED" - ], - "no_retry_1_codes": [] - }, - "retry_params": { - "no_retry_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 0, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 0, - "total_timeout_millis": 0 - }, - "retry_policy_1_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 10000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 20000 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 20000 - } - }, - "methods": { - "AcknowledgeTask": { - "timeout_millis": 20000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "CancelLease": { - "timeout_millis": 20000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "CreateQueue": { - "timeout_millis": 20000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "CreateTask": { - "timeout_millis": 20000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteQueue": { - "timeout_millis": 20000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "DeleteTask": { - "timeout_millis": 20000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetIamPolicy": { - "timeout_millis": 20000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetQueue": { - "timeout_millis": 20000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetTask": { - "timeout_millis": 20000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "LeaseTasks": { - "timeout_millis": 20000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "ListQueues": { - "timeout_millis": 20000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListTasks": { - "timeout_millis": 20000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "PauseQueue": { - "timeout_millis": 20000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "PurgeQueue": { - "timeout_millis": 20000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "RenewLease": { - "timeout_millis": 20000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "ResumeQueue": { - "timeout_millis": 20000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "RunTask": { - "timeout_millis": 20000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "SetIamPolicy": { - "timeout_millis": 20000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "TestIamPermissions": { - "timeout_millis": 20000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "UpdateQueue": { - "timeout_millis": 20000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UploadQueueYaml": { - "timeout_millis": 20000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GetLocation": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListLocations": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - } - } - } - } -} diff --git a/owl-bot-staging/Tasks/v2beta2/src/V2beta2/resources/cloud_tasks_descriptor_config.php b/owl-bot-staging/Tasks/v2beta2/src/V2beta2/resources/cloud_tasks_descriptor_config.php deleted file mode 100644 index 5ba5625faa2d..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/src/V2beta2/resources/cloud_tasks_descriptor_config.php +++ /dev/null @@ -1,42 +0,0 @@ - [ - 'google.cloud.tasks.v2beta2.CloudTasks' => [ - 'ListQueues' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getQueues', - ], - ], - 'ListTasks' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getTasks', - ], - ], - 'GetLocation' => [ - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'ListLocations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getLocations', - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - ], - ], -]; diff --git a/owl-bot-staging/Tasks/v2beta2/src/V2beta2/resources/cloud_tasks_rest_client_config.php b/owl-bot-staging/Tasks/v2beta2/src/V2beta2/resources/cloud_tasks_rest_client_config.php deleted file mode 100644 index d6a4e451cb37..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/src/V2beta2/resources/cloud_tasks_rest_client_config.php +++ /dev/null @@ -1,268 +0,0 @@ - [ - 'google.cloud.location.Locations' => [ - 'GetLocation' => [ - 'method' => 'get', - 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListLocations' => [ - 'method' => 'get', - 'uriTemplate' => '/v2beta2/{name=projects/*}/locations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.cloud.tasks.v2beta2.CloudTasks' => [ - 'AcknowledgeTask' => [ - 'method' => 'post', - 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:acknowledge', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'CancelLease' => [ - 'method' => 'post', - 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:cancelLease', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'CreateQueue' => [ - 'method' => 'post', - 'uriTemplate' => '/v2beta2/{parent=projects/*/locations/*}/queues', - 'body' => 'queue', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'CreateTask' => [ - 'method' => 'post', - 'uriTemplate' => '/v2beta2/{parent=projects/*/locations/*/queues/*}/tasks', - 'body' => '*', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteQueue' => [ - 'method' => 'delete', - 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*/queues/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteTask' => [ - 'method' => 'delete', - 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v2beta2/{resource=projects/*/locations/*/queues/*}:getIamPolicy', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'GetQueue' => [ - 'method' => 'get', - 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*/queues/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetTask' => [ - 'method' => 'get', - 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'LeaseTasks' => [ - 'method' => 'post', - 'uriTemplate' => '/v2beta2/{parent=projects/*/locations/*/queues/*}/tasks:lease', - 'body' => '*', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListQueues' => [ - 'method' => 'get', - 'uriTemplate' => '/v2beta2/{parent=projects/*/locations/*}/queues', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListTasks' => [ - 'method' => 'get', - 'uriTemplate' => '/v2beta2/{parent=projects/*/locations/*/queues/*}/tasks', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'PauseQueue' => [ - 'method' => 'post', - 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*/queues/*}:pause', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'PurgeQueue' => [ - 'method' => 'post', - 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*/queues/*}:purge', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'RenewLease' => [ - 'method' => 'post', - 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:renewLease', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ResumeQueue' => [ - 'method' => 'post', - 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*/queues/*}:resume', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'RunTask' => [ - 'method' => 'post', - 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:run', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'SetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v2beta2/{resource=projects/*/locations/*/queues/*}:setIamPolicy', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'method' => 'post', - 'uriTemplate' => '/v2beta2/{resource=projects/*/locations/*/queues/*}:testIamPermissions', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'UpdateQueue' => [ - 'method' => 'patch', - 'uriTemplate' => '/v2beta2/{queue.name=projects/*/locations/*/queues/*}', - 'body' => 'queue', - 'placeholders' => [ - 'queue.name' => [ - 'getters' => [ - 'getQueue', - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Tasks/v2beta2/tests/Unit/V2beta2/CloudTasksClientTest.php b/owl-bot-staging/Tasks/v2beta2/tests/Unit/V2beta2/CloudTasksClientTest.php deleted file mode 100644 index e3fffafd8ee9..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/tests/Unit/V2beta2/CloudTasksClientTest.php +++ /dev/null @@ -1,1492 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return CloudTasksClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new CloudTasksClient($options); - } - - /** @test */ - public function acknowledgeTaskTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - $scheduleTime = new Timestamp(); - $gapicClient->acknowledgeTask($formattedName, $scheduleTime); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/AcknowledgeTask', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getScheduleTime(); - $this->assertProtobufEquals($scheduleTime, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function acknowledgeTaskExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - $scheduleTime = new Timestamp(); - try { - $gapicClient->acknowledgeTask($formattedName, $scheduleTime); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function cancelLeaseTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new Task(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - $scheduleTime = new Timestamp(); - $response = $gapicClient->cancelLease($formattedName, $scheduleTime); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/CancelLease', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getScheduleTime(); - $this->assertProtobufEquals($scheduleTime, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function cancelLeaseExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - $scheduleTime = new Timestamp(); - try { - $gapicClient->cancelLease($formattedName, $scheduleTime); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createQueueTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new Queue(); - $expectedResponse->setName($name); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $queue = new Queue(); - $response = $gapicClient->createQueue($formattedParent, $queue); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/CreateQueue', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getQueue(); - $this->assertProtobufEquals($queue, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createQueueExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $queue = new Queue(); - try { - $gapicClient->createQueue($formattedParent, $queue); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createTaskTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new Task(); - $expectedResponse->setName($name); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $task = new Task(); - $response = $gapicClient->createTask($formattedParent, $task); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/CreateTask', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getTask(); - $this->assertProtobufEquals($task, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createTaskExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $task = new Task(); - try { - $gapicClient->createTask($formattedParent, $task); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteQueueTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $gapicClient->deleteQueue($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/DeleteQueue', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteQueueExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - try { - $gapicClient->deleteQueue($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteTaskTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - $gapicClient->deleteTask($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/DeleteTask', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteTaskExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - try { - $gapicClient->deleteTask($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getQueueTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new Queue(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $response = $gapicClient->getQueue($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/GetQueue', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getQueueExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - try { - $gapicClient->getQueue($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getTaskTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new Task(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - $response = $gapicClient->getTask($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/GetTask', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getTaskExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - try { - $gapicClient->getTask($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function leaseTasksTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new LeaseTasksResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $leaseDuration = new Duration(); - $response = $gapicClient->leaseTasks($formattedParent, $leaseDuration); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/LeaseTasks', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getLeaseDuration(); - $this->assertProtobufEquals($leaseDuration, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function leaseTasksExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $leaseDuration = new Duration(); - try { - $gapicClient->leaseTasks($formattedParent, $leaseDuration); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listQueuesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $queuesElement = new Queue(); - $queues = [ - $queuesElement, - ]; - $expectedResponse = new ListQueuesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setQueues($queues); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listQueues($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getQueues()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/ListQueues', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listQueuesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listQueues($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTasksTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $tasksElement = new Task(); - $tasks = [ - $tasksElement, - ]; - $expectedResponse = new ListTasksResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTasks($tasks); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $response = $gapicClient->listTasks($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getTasks()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/ListTasks', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTasksExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - try { - $gapicClient->listTasks($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function pauseQueueTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new Queue(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $response = $gapicClient->pauseQueue($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/PauseQueue', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function pauseQueueExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - try { - $gapicClient->pauseQueue($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function purgeQueueTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new Queue(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $response = $gapicClient->purgeQueue($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/PurgeQueue', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function purgeQueueExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - try { - $gapicClient->purgeQueue($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function renewLeaseTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new Task(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - $scheduleTime = new Timestamp(); - $leaseDuration = new Duration(); - $response = $gapicClient->renewLease($formattedName, $scheduleTime, $leaseDuration); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/RenewLease', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getScheduleTime(); - $this->assertProtobufEquals($scheduleTime, $actualValue); - $actualValue = $actualRequestObject->getLeaseDuration(); - $this->assertProtobufEquals($leaseDuration, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function renewLeaseExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - $scheduleTime = new Timestamp(); - $leaseDuration = new Duration(); - try { - $gapicClient->renewLease($formattedName, $scheduleTime, $leaseDuration); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function resumeQueueTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new Queue(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $response = $gapicClient->resumeQueue($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/ResumeQueue', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function resumeQueueExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - try { - $gapicClient->resumeQueue($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function runTaskTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new Task(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - $response = $gapicClient->runTask($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/RunTask', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function runTaskExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - try { - $gapicClient->runTask($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateQueueTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new Queue(); - $expectedResponse->setName($name); - $transport->addResponse($expectedResponse); - // Mock request - $queue = new Queue(); - $response = $gapicClient->updateQueue($queue); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/UpdateQueue', $actualFuncCall); - $actualValue = $actualRequestObject->getQueue(); - $this->assertProtobufEquals($queue, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateQueueExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $queue = new Queue(); - try { - $gapicClient->updateQueue($queue); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function uploadQueueYamlTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $appId = 'appId-1411074055'; - $gapicClient->uploadQueueYaml($appId); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/UploadQueueYaml', $actualFuncCall); - $actualValue = $actualRequestObject->getAppId(); - $this->assertProtobufEquals($appId, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function uploadQueueYamlExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $appId = 'appId-1411074055'; - try { - $gapicClient->uploadQueueYaml($appId); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta3/Cloudtasks.php b/owl-bot-staging/Tasks/v2beta3/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta3/Cloudtasks.php deleted file mode 100644 index c492fe303df0..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta3/Cloudtasks.php +++ /dev/null @@ -1,116 +0,0 @@ -internalAddGeneratedFile( - ' -�( -+google/cloud/tasks/v2beta3/cloudtasks.protogoogle.cloud.tasks.v2beta3google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto&google/cloud/tasks/v2beta3/queue.proto%google/cloud/tasks/v2beta3/task.protogoogle/iam/v1/iam_policy.protogoogle/iam/v1/policy.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto"� -ListQueuesRequest7 -parent ( B\'�A�A!cloudtasks.googleapis.com/Queue -filter (  - page_size ( - -page_token ( 2 - read_mask ( 2.google.protobuf.FieldMaskB�A"` -ListQueuesResponse1 -queues ( 2!.google.cloud.tasks.v2beta3.Queue -next_page_token ( "| -GetQueueRequest5 -name ( B\'�A�A! -cloudtasks.googleapis.com/Queue2 - read_mask ( 2.google.protobuf.FieldMaskB�A"� -CreateQueueRequest7 -parent ( B\'�A�A!cloudtasks.googleapis.com/Queue5 -queue ( 2!.google.cloud.tasks.v2beta3.QueueB�A"| -UpdateQueueRequest5 -queue ( 2!.google.cloud.tasks.v2beta3.QueueB�A/ - update_mask ( 2.google.protobuf.FieldMask"K -DeleteQueueRequest5 -name ( B\'�A�A! -cloudtasks.googleapis.com/Queue"J -PurgeQueueRequest5 -name ( B\'�A�A! -cloudtasks.googleapis.com/Queue"J -PauseQueueRequest5 -name ( B\'�A�A! -cloudtasks.googleapis.com/Queue"K -ResumeQueueRequest5 -name ( B\'�A�A! -cloudtasks.googleapis.com/Queue"� -ListTasksRequest6 -parent ( B&�A�A cloudtasks.googleapis.com/Task< - response_view (2%.google.cloud.tasks.v2beta3.Task.View - page_size ( - -page_token ( "] -ListTasksResponse/ -tasks ( 2 .google.cloud.tasks.v2beta3.Task -next_page_token ( "� -GetTaskRequest4 -name ( B&�A�A -cloudtasks.googleapis.com/Task< - response_view (2%.google.cloud.tasks.v2beta3.Task.View"� -CreateTaskRequest6 -parent ( B&�A�A cloudtasks.googleapis.com/Task3 -task ( 2 .google.cloud.tasks.v2beta3.TaskB�A< - response_view (2%.google.cloud.tasks.v2beta3.Task.View"I -DeleteTaskRequest4 -name ( B&�A�A -cloudtasks.googleapis.com/Task"� -RunTaskRequest4 -name ( B&�A�A -cloudtasks.googleapis.com/Task< - response_view (2%.google.cloud.tasks.v2beta3.Task.View2� - -CloudTasks� - -ListQueues-.google.cloud.tasks.v2beta3.ListQueuesRequest..google.cloud.tasks.v2beta3.ListQueuesResponse"@���1//v2beta3/{parent=projects/*/locations/*}/queues�Aparent� -GetQueue+.google.cloud.tasks.v2beta3.GetQueueRequest!.google.cloud.tasks.v2beta3.Queue">���1//v2beta3/{name=projects/*/locations/*/queues/*}�Aname� - CreateQueue..google.cloud.tasks.v2beta3.CreateQueueRequest!.google.cloud.tasks.v2beta3.Queue"M���8"//v2beta3/{parent=projects/*/locations/*}/queues:queue�A parent,queue� - UpdateQueue..google.cloud.tasks.v2beta3.UpdateQueueRequest!.google.cloud.tasks.v2beta3.Queue"X���>25/v2beta3/{queue.name=projects/*/locations/*/queues/*}:queue�Aqueue,update_mask� - DeleteQueue..google.cloud.tasks.v2beta3.DeleteQueueRequest.google.protobuf.Empty">���1*//v2beta3/{name=projects/*/locations/*/queues/*}�Aname� - -PurgeQueue-.google.cloud.tasks.v2beta3.PurgeQueueRequest!.google.cloud.tasks.v2beta3.Queue"G���:"5/v2beta3/{name=projects/*/locations/*/queues/*}:purge:*�Aname� - -PauseQueue-.google.cloud.tasks.v2beta3.PauseQueueRequest!.google.cloud.tasks.v2beta3.Queue"G���:"5/v2beta3/{name=projects/*/locations/*/queues/*}:pause:*�Aname� - ResumeQueue..google.cloud.tasks.v2beta3.ResumeQueueRequest!.google.cloud.tasks.v2beta3.Queue"H���;"6/v2beta3/{name=projects/*/locations/*/queues/*}:resume:*�Aname� - GetIamPolicy".google.iam.v1.GetIamPolicyRequest.google.iam.v1.Policy"V���E"@/v2beta3/{resource=projects/*/locations/*/queues/*}:getIamPolicy:*�Aresource� - SetIamPolicy".google.iam.v1.SetIamPolicyRequest.google.iam.v1.Policy"]���E"@/v2beta3/{resource=projects/*/locations/*/queues/*}:setIamPolicy:*�Aresource,policy� -TestIamPermissions(.google.iam.v1.TestIamPermissionsRequest).google.iam.v1.TestIamPermissionsResponse"h���K"F/v2beta3/{resource=projects/*/locations/*/queues/*}:testIamPermissions:*�Aresource,permissions� - ListTasks,.google.cloud.tasks.v2beta3.ListTasksRequest-.google.cloud.tasks.v2beta3.ListTasksResponse"H���97/v2beta3/{parent=projects/*/locations/*/queues/*}/tasks�Aparent� -GetTask*.google.cloud.tasks.v2beta3.GetTaskRequest .google.cloud.tasks.v2beta3.Task"F���97/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}�Aname� - -CreateTask-.google.cloud.tasks.v2beta3.CreateTaskRequest .google.cloud.tasks.v2beta3.Task"P���<"7/v2beta3/{parent=projects/*/locations/*/queues/*}/tasks:*�A parent,task� - -DeleteTask-.google.cloud.tasks.v2beta3.DeleteTaskRequest.google.protobuf.Empty"F���9*7/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}�Aname� -RunTask*.google.cloud.tasks.v2beta3.RunTaskRequest .google.cloud.tasks.v2beta3.Task"M���@";/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}:run:*�AnameM�Acloudtasks.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformB� -com.google.cloud.tasks.v2beta3BCloudTasksProtoPZCcloud.google.com/go/cloudtasks/apiv2beta3/cloudtaskspb;cloudtaskspb�TASKSbproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta3/Queue.php b/owl-bot-staging/Tasks/v2beta3/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta3/Queue.php deleted file mode 100644 index bb64862a08116894b48971470b8d8d6688147eef..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2709 zcmbVOe^1*+7;b<7eFKPDWipx8Uem6m+U8X0R%u~uN=Sf63^Ed?b+TkR_9a~F*sgs> zWmUe(KF+?tzQO*S_9^z>ogJb!4QNOa{_#BT`JVTA?(X{^!;26ekwfa!$mY}~{VT#R zC<&v02TtITeli%)h&aJ0WFCzSLYk-K@M3g6yzbn666c|sg%o%FcLuMW@>bVViVPCQ!s@1M%bzS6R)H9m) z?$)ds?ZIY6sKM<=o=DnE&~ey_|3U3B^bog4;cTw#;@3a0v}bkKowVoxO4 zKR4jX?cA#s70!?@H>Asr)aAwPw1yqBN|Z{gOkXs2=G5m>z!Z5u1T0-B|p)p4Vzh+*n_elc3S)GgLbRAc}FY2%GvqJN&Dn*Gp7M8ck1U|e6fI5 zUv0L#^~N#YEta0alK39&9&GkrcHS?t3QL{y<72EKuewK@3pLaHxBe0yNR3peRT?nL zv4LA(Mb1)tfjxdj9UfQSrB~yM7dUbi!)Mv$SZ#Rt*W7qM zBZ@^g9kC3b&Fo-`6e^|2FF>bw7{lYsCACy>+&;xTsgx!shi=4hA1ym4_YEaQN1Sas zx!?BH(vYqH==Nctj&V|>3Wgv%$Xy2{?C(zB^q1xG_k3rvwSJ{eH&ch9SRU499E2oN K9aqLM2KW!{ENd(P diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta3/Target.php b/owl-bot-staging/Tasks/v2beta3/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta3/Target.php deleted file mode 100644 index 60a36d89fa8ad8943c2ca79a34d02d289b79584f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3007 zcmc&$+iu%N5RERDqLJ(>ted({Td-iDShKQb-d==QCzxN1aV>fok6A!Op?9mglJyTefQ zBHB4?j4?wG_#2&IR+lyb0yM)>h#agR4BCfWz(ov=4y5|1Bh*KhP#-;Sw1xUEfa9Ym z(k*EQegmEV!g%a^jvg_@_}^VGvc14#9`e1H+>1T^6!{V6s+VO?plGf&_D!&2Vv9?7^VU8M_n8_)C(D*11{QZa@W%EiIc7ElCw?2D=isFz_mUlF05q_7WT|*G;e8=hSSafVf5gnFq|2MUoh#WO6w zuQclQtKrt?6zfB&)w}U~CZpYg{FFpY;p}CSqmWRxmgCTKy{tHT0?PugO%eyz^88!5 zv9;*NHym!kit;G6up}*PFS77vP!N0;Q!j;JK-#cKs_ZKd&ek+t~<%sm^* z%ptc@dk6&;8|^k|!%ojQH0+b3;lSwh_xnb-dPBPj`JQDBsu`^WOX6u*&DO?n``re$ zZP++D?%U>b-B%G6kC ze6vVfT+VwIm)1#CgpgxJba%81;5^t>S>zqL7AYKCm$m(aImKGW+580 z#lsUC^Vv+U*L09iP|zOogqKQs%q9vSh<9` zpn{OZ{{Es1Uo)4u-o6d1!ec_cm%NXYz*fd;|74*oq>nK#rickpG4&Hr|A{pNit3IF zvc7*G;siqiIWhu9&qZGw6Zc%UhYHWb|BtykR1_x(vIYD#vp;064EY4KRu~$=#0#(p zJ?}{|)}Fx~6o$M7iDR3Rn0dh@P56ZLdy7Jt8a-CZwZF2knjX%R{1&fbx?H~+d!Stg zD$};y_#k{5pGg$^JRQ%l&AW@74khjAb>8GE9)OfV$FhT8p0&5 zVlYRTo_UTMlO=J$r&z?xN|moxg_~Z$w-LVcBwq0}mP1iYxl*kO@VcXDU%)4cJsUX= zi34Wi8S*Zwkhg}&Az{)QYLB3l_LKLiavUgjJuGm@wc*=Hwe_U4-hofW#IX+zt7mrK z8XtTx4a}j%r$!NS2ZmM6%2{Q!y49RG8k|_wyqG9m{&1}&@8s}^`4DVhVT zZypV+#WsU4`C7Yx#&%gXYPkarGQV`xdUUaTklD_JsD)SUyD0Q7R$eJ7Ps8!<{L8o? c*Wd@6>AH4LZGm%3R5U)EYZ5SuZgrW8Fq2tmPaj{KWoqnmZtnk022HM6*(hL{`2sB08++>NB zs18}+SJ+$ZdG;QAiXBNw$!5bdrZ1An``wYh``z95uf#;4$M}RrEFqEwczA{7gkh1y zGNy5ehuLVv5=`T%;2}$FjJv1!-RTAHb^8}z0W^)XgfbV8<9Hl0hlX($IFh8lq|V3Y zkV$f&|7`6Mp@>XbDhOrxWYB&K+X0cpJJDdTqrl#U0(+OuwgMj_L_?CMSgoRKgy9j{ zFys`cl1O+x;i=CfE;$MLZ*YSnJR)Jr061?u$|5Rx9AO1GjVNn8!^WqweIjDG@ewYL zGf*S|0bW0nEQv_yby-RiE@Yexz|?ieOqSHCmBzC?ta8UkxM9xdx^ss-!ZOL&?dTXM zOlC=RsL!n&%*ros0a-14@Inz{_dmPP!|HI$_aAz^8GLWy)O%ja)XDtK_aN5bd{xMWAFEMR8{3+)lgN{ zSG|HOjScG@JtRW-EE@BO`4cIHpRf-Z&|d!p3^tqJ*~a6di`gw9dK&o}fM*8x`i}Jq z)&AjWQ+x9Em${nrAhIy@A^#~Ev-;Kw9tHq-YwY0+&(T&&CoIT9<|~rwRqbN8I77j( zU5dj)s*&8N$vDP7r@V7&JnRn^=29PM28dq4W`-<=P7o&IsZ*WI~eZJ@Pw>%8CDsaW?> z_4xgpH#>LT$zLso9_dS%sxf*af~Pi26i17;1L^viQJFf|`Pa+|W2zeqtQDU#2c!$) zb*}Y$md}`L<#^WKMm0gM!k7fUyb^5h&kDL%5H%+kRUVtoWpV*XnMbX#yQ@IT6l;j7 zv1L)dMxT}tQ_#7Rts)~(>b7Zl?F5L7r^UtsVYD|CodY$q29=*W#-b>2AbT8};jA;^ sKn{xWe3KtBJiPrgT-TL!uwQo0Z_L!XHRRN}IbAT|w56FvGc-f!Zvwo*j{pDw diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/AppEngineHttpQueue.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/AppEngineHttpQueue.php deleted file mode 100644 index 685601b84245..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/AppEngineHttpQueue.php +++ /dev/null @@ -1,114 +0,0 @@ -google.cloud.tasks.v2beta3.AppEngineHttpQueue - */ -class AppEngineHttpQueue extends \Google\Protobuf\Internal\Message -{ - /** - * Overrides for the - * [task-level - * app_engine_routing][google.cloud.tasks.v2beta3.AppEngineHttpRequest.app_engine_routing]. - * If set, `app_engine_routing_override` is used for all tasks in - * the queue, no matter what the setting is for the - * [task-level - * app_engine_routing][google.cloud.tasks.v2beta3.AppEngineHttpRequest.app_engine_routing]. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.AppEngineRouting app_engine_routing_override = 1; - */ - protected $app_engine_routing_override = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Tasks\V2beta3\AppEngineRouting $app_engine_routing_override - * Overrides for the - * [task-level - * app_engine_routing][google.cloud.tasks.v2beta3.AppEngineHttpRequest.app_engine_routing]. - * If set, `app_engine_routing_override` is used for all tasks in - * the queue, no matter what the setting is for the - * [task-level - * app_engine_routing][google.cloud.tasks.v2beta3.AppEngineHttpRequest.app_engine_routing]. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Target::initOnce(); - parent::__construct($data); - } - - /** - * Overrides for the - * [task-level - * app_engine_routing][google.cloud.tasks.v2beta3.AppEngineHttpRequest.app_engine_routing]. - * If set, `app_engine_routing_override` is used for all tasks in - * the queue, no matter what the setting is for the - * [task-level - * app_engine_routing][google.cloud.tasks.v2beta3.AppEngineHttpRequest.app_engine_routing]. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.AppEngineRouting app_engine_routing_override = 1; - * @return \Google\Cloud\Tasks\V2beta3\AppEngineRouting|null - */ - public function getAppEngineRoutingOverride() - { - return $this->app_engine_routing_override; - } - - public function hasAppEngineRoutingOverride() - { - return isset($this->app_engine_routing_override); - } - - public function clearAppEngineRoutingOverride() - { - unset($this->app_engine_routing_override); - } - - /** - * Overrides for the - * [task-level - * app_engine_routing][google.cloud.tasks.v2beta3.AppEngineHttpRequest.app_engine_routing]. - * If set, `app_engine_routing_override` is used for all tasks in - * the queue, no matter what the setting is for the - * [task-level - * app_engine_routing][google.cloud.tasks.v2beta3.AppEngineHttpRequest.app_engine_routing]. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.AppEngineRouting app_engine_routing_override = 1; - * @param \Google\Cloud\Tasks\V2beta3\AppEngineRouting $var - * @return $this - */ - public function setAppEngineRoutingOverride($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\AppEngineRouting::class); - $this->app_engine_routing_override = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/AppEngineHttpRequest.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/AppEngineHttpRequest.php deleted file mode 100644 index 7257325270f2..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/AppEngineHttpRequest.php +++ /dev/null @@ -1,478 +0,0 @@ -google.cloud.tasks.v2beta3.AppEngineHttpRequest - */ -class AppEngineHttpRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The HTTP method to use for the request. The default is POST. - * The app's request handler for the task's target URL must be able to handle - * HTTP requests with this http_method, otherwise the task attempt fails with - * error code 405 (Method Not Allowed). See [Writing a push task request - * handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) - * and the App Engine documentation for your runtime on [How Requests are - * Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.HttpMethod http_method = 1; - */ - protected $http_method = 0; - /** - * Task-level setting for App Engine routing. - * If set, - * [app_engine_routing_override][google.cloud.tasks.v2beta3.AppEngineHttpQueue.app_engine_routing_override] - * is used for all tasks in the queue, no matter what the setting is for the - * [task-level - * app_engine_routing][google.cloud.tasks.v2beta3.AppEngineHttpRequest.app_engine_routing]. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.AppEngineRouting app_engine_routing = 2; - */ - protected $app_engine_routing = null; - /** - * The relative URI. - * The relative URI must begin with "/" and must be a valid HTTP relative URI. - * It can contain a path and query string arguments. - * If the relative URI is empty, then the root path "/" will be used. - * No spaces are allowed, and the maximum length allowed is 2083 characters. - * - * Generated from protobuf field string relative_uri = 3; - */ - protected $relative_uri = ''; - /** - * HTTP request headers. - * This map contains the header field names and values. - * Headers can be set when the - * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - * Repeated headers are not supported but a header value can contain commas. - * Cloud Tasks sets some headers to default values: - * * `User-Agent`: By default, this header is - * `"AppEngine-Google; (+http://code.google.com/appengine)"`. - * This header can be modified, but Cloud Tasks will append - * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the - * modified `User-Agent`. - * If the task has a - * [body][google.cloud.tasks.v2beta3.AppEngineHttpRequest.body], Cloud Tasks - * sets the following headers: - * * `Content-Type`: By default, the `Content-Type` header is set to - * `"application/octet-stream"`. The default can be overridden by explicitly - * setting `Content-Type` to a particular media type when the - * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - * For example, `Content-Type` can be set to `"application/json"`. - * * `Content-Length`: This is computed by Cloud Tasks. This value is - * output only. It cannot be changed. - * The headers below cannot be set or overridden: - * * `Host` - * * `X-Google-*` - * * `X-AppEngine-*` - * In addition, Cloud Tasks sets some headers when the task is dispatched, - * such as headers containing information about the task; see - * [request - * headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers). - * These headers are set only when the task is dispatched, so they are not - * visible when the task is returned in a Cloud Tasks response. - * Although there is no specific limit for the maximum number of headers or - * the size, there is a limit on the maximum size of the - * [Task][google.cloud.tasks.v2beta3.Task]. For more information, see the - * [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask] - * documentation. - * - * Generated from protobuf field map headers = 4; - */ - private $headers; - /** - * HTTP request body. - * A request body is allowed only if the HTTP method is POST or PUT. It is - * an error to set a body on a task with an incompatible - * [HttpMethod][google.cloud.tasks.v2beta3.HttpMethod]. - * - * Generated from protobuf field bytes body = 5; - */ - protected $body = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $http_method - * The HTTP method to use for the request. The default is POST. - * The app's request handler for the task's target URL must be able to handle - * HTTP requests with this http_method, otherwise the task attempt fails with - * error code 405 (Method Not Allowed). See [Writing a push task request - * handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) - * and the App Engine documentation for your runtime on [How Requests are - * Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). - * @type \Google\Cloud\Tasks\V2beta3\AppEngineRouting $app_engine_routing - * Task-level setting for App Engine routing. - * If set, - * [app_engine_routing_override][google.cloud.tasks.v2beta3.AppEngineHttpQueue.app_engine_routing_override] - * is used for all tasks in the queue, no matter what the setting is for the - * [task-level - * app_engine_routing][google.cloud.tasks.v2beta3.AppEngineHttpRequest.app_engine_routing]. - * @type string $relative_uri - * The relative URI. - * The relative URI must begin with "/" and must be a valid HTTP relative URI. - * It can contain a path and query string arguments. - * If the relative URI is empty, then the root path "/" will be used. - * No spaces are allowed, and the maximum length allowed is 2083 characters. - * @type array|\Google\Protobuf\Internal\MapField $headers - * HTTP request headers. - * This map contains the header field names and values. - * Headers can be set when the - * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - * Repeated headers are not supported but a header value can contain commas. - * Cloud Tasks sets some headers to default values: - * * `User-Agent`: By default, this header is - * `"AppEngine-Google; (+http://code.google.com/appengine)"`. - * This header can be modified, but Cloud Tasks will append - * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the - * modified `User-Agent`. - * If the task has a - * [body][google.cloud.tasks.v2beta3.AppEngineHttpRequest.body], Cloud Tasks - * sets the following headers: - * * `Content-Type`: By default, the `Content-Type` header is set to - * `"application/octet-stream"`. The default can be overridden by explicitly - * setting `Content-Type` to a particular media type when the - * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - * For example, `Content-Type` can be set to `"application/json"`. - * * `Content-Length`: This is computed by Cloud Tasks. This value is - * output only. It cannot be changed. - * The headers below cannot be set or overridden: - * * `Host` - * * `X-Google-*` - * * `X-AppEngine-*` - * In addition, Cloud Tasks sets some headers when the task is dispatched, - * such as headers containing information about the task; see - * [request - * headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers). - * These headers are set only when the task is dispatched, so they are not - * visible when the task is returned in a Cloud Tasks response. - * Although there is no specific limit for the maximum number of headers or - * the size, there is a limit on the maximum size of the - * [Task][google.cloud.tasks.v2beta3.Task]. For more information, see the - * [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask] - * documentation. - * @type string $body - * HTTP request body. - * A request body is allowed only if the HTTP method is POST or PUT. It is - * an error to set a body on a task with an incompatible - * [HttpMethod][google.cloud.tasks.v2beta3.HttpMethod]. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Target::initOnce(); - parent::__construct($data); - } - - /** - * The HTTP method to use for the request. The default is POST. - * The app's request handler for the task's target URL must be able to handle - * HTTP requests with this http_method, otherwise the task attempt fails with - * error code 405 (Method Not Allowed). See [Writing a push task request - * handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) - * and the App Engine documentation for your runtime on [How Requests are - * Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.HttpMethod http_method = 1; - * @return int - */ - public function getHttpMethod() - { - return $this->http_method; - } - - /** - * The HTTP method to use for the request. The default is POST. - * The app's request handler for the task's target URL must be able to handle - * HTTP requests with this http_method, otherwise the task attempt fails with - * error code 405 (Method Not Allowed). See [Writing a push task request - * handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) - * and the App Engine documentation for your runtime on [How Requests are - * Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.HttpMethod http_method = 1; - * @param int $var - * @return $this - */ - public function setHttpMethod($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta3\HttpMethod::class); - $this->http_method = $var; - - return $this; - } - - /** - * Task-level setting for App Engine routing. - * If set, - * [app_engine_routing_override][google.cloud.tasks.v2beta3.AppEngineHttpQueue.app_engine_routing_override] - * is used for all tasks in the queue, no matter what the setting is for the - * [task-level - * app_engine_routing][google.cloud.tasks.v2beta3.AppEngineHttpRequest.app_engine_routing]. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.AppEngineRouting app_engine_routing = 2; - * @return \Google\Cloud\Tasks\V2beta3\AppEngineRouting|null - */ - public function getAppEngineRouting() - { - return $this->app_engine_routing; - } - - public function hasAppEngineRouting() - { - return isset($this->app_engine_routing); - } - - public function clearAppEngineRouting() - { - unset($this->app_engine_routing); - } - - /** - * Task-level setting for App Engine routing. - * If set, - * [app_engine_routing_override][google.cloud.tasks.v2beta3.AppEngineHttpQueue.app_engine_routing_override] - * is used for all tasks in the queue, no matter what the setting is for the - * [task-level - * app_engine_routing][google.cloud.tasks.v2beta3.AppEngineHttpRequest.app_engine_routing]. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.AppEngineRouting app_engine_routing = 2; - * @param \Google\Cloud\Tasks\V2beta3\AppEngineRouting $var - * @return $this - */ - public function setAppEngineRouting($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\AppEngineRouting::class); - $this->app_engine_routing = $var; - - return $this; - } - - /** - * The relative URI. - * The relative URI must begin with "/" and must be a valid HTTP relative URI. - * It can contain a path and query string arguments. - * If the relative URI is empty, then the root path "/" will be used. - * No spaces are allowed, and the maximum length allowed is 2083 characters. - * - * Generated from protobuf field string relative_uri = 3; - * @return string - */ - public function getRelativeUri() - { - return $this->relative_uri; - } - - /** - * The relative URI. - * The relative URI must begin with "/" and must be a valid HTTP relative URI. - * It can contain a path and query string arguments. - * If the relative URI is empty, then the root path "/" will be used. - * No spaces are allowed, and the maximum length allowed is 2083 characters. - * - * Generated from protobuf field string relative_uri = 3; - * @param string $var - * @return $this - */ - public function setRelativeUri($var) - { - GPBUtil::checkString($var, True); - $this->relative_uri = $var; - - return $this; - } - - /** - * HTTP request headers. - * This map contains the header field names and values. - * Headers can be set when the - * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - * Repeated headers are not supported but a header value can contain commas. - * Cloud Tasks sets some headers to default values: - * * `User-Agent`: By default, this header is - * `"AppEngine-Google; (+http://code.google.com/appengine)"`. - * This header can be modified, but Cloud Tasks will append - * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the - * modified `User-Agent`. - * If the task has a - * [body][google.cloud.tasks.v2beta3.AppEngineHttpRequest.body], Cloud Tasks - * sets the following headers: - * * `Content-Type`: By default, the `Content-Type` header is set to - * `"application/octet-stream"`. The default can be overridden by explicitly - * setting `Content-Type` to a particular media type when the - * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - * For example, `Content-Type` can be set to `"application/json"`. - * * `Content-Length`: This is computed by Cloud Tasks. This value is - * output only. It cannot be changed. - * The headers below cannot be set or overridden: - * * `Host` - * * `X-Google-*` - * * `X-AppEngine-*` - * In addition, Cloud Tasks sets some headers when the task is dispatched, - * such as headers containing information about the task; see - * [request - * headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers). - * These headers are set only when the task is dispatched, so they are not - * visible when the task is returned in a Cloud Tasks response. - * Although there is no specific limit for the maximum number of headers or - * the size, there is a limit on the maximum size of the - * [Task][google.cloud.tasks.v2beta3.Task]. For more information, see the - * [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask] - * documentation. - * - * Generated from protobuf field map headers = 4; - * @return \Google\Protobuf\Internal\MapField - */ - public function getHeaders() - { - return $this->headers; - } - - /** - * HTTP request headers. - * This map contains the header field names and values. - * Headers can be set when the - * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - * Repeated headers are not supported but a header value can contain commas. - * Cloud Tasks sets some headers to default values: - * * `User-Agent`: By default, this header is - * `"AppEngine-Google; (+http://code.google.com/appengine)"`. - * This header can be modified, but Cloud Tasks will append - * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the - * modified `User-Agent`. - * If the task has a - * [body][google.cloud.tasks.v2beta3.AppEngineHttpRequest.body], Cloud Tasks - * sets the following headers: - * * `Content-Type`: By default, the `Content-Type` header is set to - * `"application/octet-stream"`. The default can be overridden by explicitly - * setting `Content-Type` to a particular media type when the - * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - * For example, `Content-Type` can be set to `"application/json"`. - * * `Content-Length`: This is computed by Cloud Tasks. This value is - * output only. It cannot be changed. - * The headers below cannot be set or overridden: - * * `Host` - * * `X-Google-*` - * * `X-AppEngine-*` - * In addition, Cloud Tasks sets some headers when the task is dispatched, - * such as headers containing information about the task; see - * [request - * headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers). - * These headers are set only when the task is dispatched, so they are not - * visible when the task is returned in a Cloud Tasks response. - * Although there is no specific limit for the maximum number of headers or - * the size, there is a limit on the maximum size of the - * [Task][google.cloud.tasks.v2beta3.Task]. For more information, see the - * [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask] - * documentation. - * - * Generated from protobuf field map headers = 4; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setHeaders($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->headers = $arr; - - return $this; - } - - /** - * HTTP request body. - * A request body is allowed only if the HTTP method is POST or PUT. It is - * an error to set a body on a task with an incompatible - * [HttpMethod][google.cloud.tasks.v2beta3.HttpMethod]. - * - * Generated from protobuf field bytes body = 5; - * @return string - */ - public function getBody() - { - return $this->body; - } - - /** - * HTTP request body. - * A request body is allowed only if the HTTP method is POST or PUT. It is - * an error to set a body on a task with an incompatible - * [HttpMethod][google.cloud.tasks.v2beta3.HttpMethod]. - * - * Generated from protobuf field bytes body = 5; - * @param string $var - * @return $this - */ - public function setBody($var) - { - GPBUtil::checkString($var, False); - $this->body = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/AppEngineRouting.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/AppEngineRouting.php deleted file mode 100644 index 2546c50f732f..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/AppEngineRouting.php +++ /dev/null @@ -1,380 +0,0 @@ -google.cloud.tasks.v2beta3.AppEngineRouting - */ -class AppEngineRouting extends \Google\Protobuf\Internal\Message -{ - /** - * App service. - * By default, the task is sent to the service which is the default - * service when the task is attempted. - * For some queues or tasks which were created using the App Engine - * Task Queue API, [host][google.cloud.tasks.v2beta3.AppEngineRouting.host] is - * not parsable into - * [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], - * [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance]. For - * example, some tasks which were created using the App Engine SDK use a - * custom domain name; custom domains are not parsed by Cloud Tasks. If - * [host][google.cloud.tasks.v2beta3.AppEngineRouting.host] is not parsable, - * then [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], - * [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance] are the - * empty string. - * - * Generated from protobuf field string service = 1; - */ - protected $service = ''; - /** - * App version. - * By default, the task is sent to the version which is the default - * version when the task is attempted. - * For some queues or tasks which were created using the App Engine - * Task Queue API, [host][google.cloud.tasks.v2beta3.AppEngineRouting.host] is - * not parsable into - * [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], - * [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance]. For - * example, some tasks which were created using the App Engine SDK use a - * custom domain name; custom domains are not parsed by Cloud Tasks. If - * [host][google.cloud.tasks.v2beta3.AppEngineRouting.host] is not parsable, - * then [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], - * [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance] are the - * empty string. - * - * Generated from protobuf field string version = 2; - */ - protected $version = ''; - /** - * App instance. - * By default, the task is sent to an instance which is available when - * the task is attempted. - * Requests can only be sent to a specific instance if - * [manual scaling is used in App Engine - * Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). - * App Engine Flex does not support instances. For more information, see - * [App Engine Standard request - * routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) - * and [App Engine Flex request - * routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). - * - * Generated from protobuf field string instance = 3; - */ - protected $instance = ''; - /** - * Output only. The host that the task is sent to. - * The host is constructed from the domain name of the app associated with - * the queue's project ID (for example .appspot.com), and the - * [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], - * [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance]. Tasks - * which were created using the App Engine SDK might have a custom domain - * name. - * For more information, see - * [How Requests are - * Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). - * - * Generated from protobuf field string host = 4; - */ - protected $host = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $service - * App service. - * By default, the task is sent to the service which is the default - * service when the task is attempted. - * For some queues or tasks which were created using the App Engine - * Task Queue API, [host][google.cloud.tasks.v2beta3.AppEngineRouting.host] is - * not parsable into - * [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], - * [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance]. For - * example, some tasks which were created using the App Engine SDK use a - * custom domain name; custom domains are not parsed by Cloud Tasks. If - * [host][google.cloud.tasks.v2beta3.AppEngineRouting.host] is not parsable, - * then [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], - * [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance] are the - * empty string. - * @type string $version - * App version. - * By default, the task is sent to the version which is the default - * version when the task is attempted. - * For some queues or tasks which were created using the App Engine - * Task Queue API, [host][google.cloud.tasks.v2beta3.AppEngineRouting.host] is - * not parsable into - * [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], - * [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance]. For - * example, some tasks which were created using the App Engine SDK use a - * custom domain name; custom domains are not parsed by Cloud Tasks. If - * [host][google.cloud.tasks.v2beta3.AppEngineRouting.host] is not parsable, - * then [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], - * [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance] are the - * empty string. - * @type string $instance - * App instance. - * By default, the task is sent to an instance which is available when - * the task is attempted. - * Requests can only be sent to a specific instance if - * [manual scaling is used in App Engine - * Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). - * App Engine Flex does not support instances. For more information, see - * [App Engine Standard request - * routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) - * and [App Engine Flex request - * routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). - * @type string $host - * Output only. The host that the task is sent to. - * The host is constructed from the domain name of the app associated with - * the queue's project ID (for example .appspot.com), and the - * [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], - * [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance]. Tasks - * which were created using the App Engine SDK might have a custom domain - * name. - * For more information, see - * [How Requests are - * Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Target::initOnce(); - parent::__construct($data); - } - - /** - * App service. - * By default, the task is sent to the service which is the default - * service when the task is attempted. - * For some queues or tasks which were created using the App Engine - * Task Queue API, [host][google.cloud.tasks.v2beta3.AppEngineRouting.host] is - * not parsable into - * [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], - * [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance]. For - * example, some tasks which were created using the App Engine SDK use a - * custom domain name; custom domains are not parsed by Cloud Tasks. If - * [host][google.cloud.tasks.v2beta3.AppEngineRouting.host] is not parsable, - * then [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], - * [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance] are the - * empty string. - * - * Generated from protobuf field string service = 1; - * @return string - */ - public function getService() - { - return $this->service; - } - - /** - * App service. - * By default, the task is sent to the service which is the default - * service when the task is attempted. - * For some queues or tasks which were created using the App Engine - * Task Queue API, [host][google.cloud.tasks.v2beta3.AppEngineRouting.host] is - * not parsable into - * [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], - * [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance]. For - * example, some tasks which were created using the App Engine SDK use a - * custom domain name; custom domains are not parsed by Cloud Tasks. If - * [host][google.cloud.tasks.v2beta3.AppEngineRouting.host] is not parsable, - * then [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], - * [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance] are the - * empty string. - * - * Generated from protobuf field string service = 1; - * @param string $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkString($var, True); - $this->service = $var; - - return $this; - } - - /** - * App version. - * By default, the task is sent to the version which is the default - * version when the task is attempted. - * For some queues or tasks which were created using the App Engine - * Task Queue API, [host][google.cloud.tasks.v2beta3.AppEngineRouting.host] is - * not parsable into - * [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], - * [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance]. For - * example, some tasks which were created using the App Engine SDK use a - * custom domain name; custom domains are not parsed by Cloud Tasks. If - * [host][google.cloud.tasks.v2beta3.AppEngineRouting.host] is not parsable, - * then [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], - * [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance] are the - * empty string. - * - * Generated from protobuf field string version = 2; - * @return string - */ - public function getVersion() - { - return $this->version; - } - - /** - * App version. - * By default, the task is sent to the version which is the default - * version when the task is attempted. - * For some queues or tasks which were created using the App Engine - * Task Queue API, [host][google.cloud.tasks.v2beta3.AppEngineRouting.host] is - * not parsable into - * [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], - * [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance]. For - * example, some tasks which were created using the App Engine SDK use a - * custom domain name; custom domains are not parsed by Cloud Tasks. If - * [host][google.cloud.tasks.v2beta3.AppEngineRouting.host] is not parsable, - * then [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], - * [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance] are the - * empty string. - * - * Generated from protobuf field string version = 2; - * @param string $var - * @return $this - */ - public function setVersion($var) - { - GPBUtil::checkString($var, True); - $this->version = $var; - - return $this; - } - - /** - * App instance. - * By default, the task is sent to an instance which is available when - * the task is attempted. - * Requests can only be sent to a specific instance if - * [manual scaling is used in App Engine - * Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). - * App Engine Flex does not support instances. For more information, see - * [App Engine Standard request - * routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) - * and [App Engine Flex request - * routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). - * - * Generated from protobuf field string instance = 3; - * @return string - */ - public function getInstance() - { - return $this->instance; - } - - /** - * App instance. - * By default, the task is sent to an instance which is available when - * the task is attempted. - * Requests can only be sent to a specific instance if - * [manual scaling is used in App Engine - * Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). - * App Engine Flex does not support instances. For more information, see - * [App Engine Standard request - * routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) - * and [App Engine Flex request - * routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). - * - * Generated from protobuf field string instance = 3; - * @param string $var - * @return $this - */ - public function setInstance($var) - { - GPBUtil::checkString($var, True); - $this->instance = $var; - - return $this; - } - - /** - * Output only. The host that the task is sent to. - * The host is constructed from the domain name of the app associated with - * the queue's project ID (for example .appspot.com), and the - * [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], - * [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance]. Tasks - * which were created using the App Engine SDK might have a custom domain - * name. - * For more information, see - * [How Requests are - * Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). - * - * Generated from protobuf field string host = 4; - * @return string - */ - public function getHost() - { - return $this->host; - } - - /** - * Output only. The host that the task is sent to. - * The host is constructed from the domain name of the app associated with - * the queue's project ID (for example .appspot.com), and the - * [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], - * [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and - * [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance]. Tasks - * which were created using the App Engine SDK might have a custom domain - * name. - * For more information, see - * [How Requests are - * Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). - * - * Generated from protobuf field string host = 4; - * @param string $var - * @return $this - */ - public function setHost($var) - { - GPBUtil::checkString($var, True); - $this->host = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Attempt.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Attempt.php deleted file mode 100644 index e9dc7a0cad3a..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Attempt.php +++ /dev/null @@ -1,229 +0,0 @@ -google.cloud.tasks.v2beta3.Attempt - */ -class Attempt extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The time that this attempt was scheduled. - * `schedule_time` will be truncated to the nearest microsecond. - * - * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 1; - */ - protected $schedule_time = null; - /** - * Output only. The time that this attempt was dispatched. - * `dispatch_time` will be truncated to the nearest microsecond. - * - * Generated from protobuf field .google.protobuf.Timestamp dispatch_time = 2; - */ - protected $dispatch_time = null; - /** - * Output only. The time that this attempt response was received. - * `response_time` will be truncated to the nearest microsecond. - * - * Generated from protobuf field .google.protobuf.Timestamp response_time = 3; - */ - protected $response_time = null; - /** - * Output only. The response from the worker for this attempt. - * If `response_time` is unset, then the task has not been attempted or is - * currently running and the `response_status` field is meaningless. - * - * Generated from protobuf field .google.rpc.Status response_status = 4; - */ - protected $response_status = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $schedule_time - * Output only. The time that this attempt was scheduled. - * `schedule_time` will be truncated to the nearest microsecond. - * @type \Google\Protobuf\Timestamp $dispatch_time - * Output only. The time that this attempt was dispatched. - * `dispatch_time` will be truncated to the nearest microsecond. - * @type \Google\Protobuf\Timestamp $response_time - * Output only. The time that this attempt response was received. - * `response_time` will be truncated to the nearest microsecond. - * @type \Google\Rpc\Status $response_status - * Output only. The response from the worker for this attempt. - * If `response_time` is unset, then the task has not been attempted or is - * currently running and the `response_status` field is meaningless. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Task::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The time that this attempt was scheduled. - * `schedule_time` will be truncated to the nearest microsecond. - * - * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 1; - * @return \Google\Protobuf\Timestamp|null - */ - public function getScheduleTime() - { - return $this->schedule_time; - } - - public function hasScheduleTime() - { - return isset($this->schedule_time); - } - - public function clearScheduleTime() - { - unset($this->schedule_time); - } - - /** - * Output only. The time that this attempt was scheduled. - * `schedule_time` will be truncated to the nearest microsecond. - * - * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 1; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setScheduleTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->schedule_time = $var; - - return $this; - } - - /** - * Output only. The time that this attempt was dispatched. - * `dispatch_time` will be truncated to the nearest microsecond. - * - * Generated from protobuf field .google.protobuf.Timestamp dispatch_time = 2; - * @return \Google\Protobuf\Timestamp|null - */ - public function getDispatchTime() - { - return $this->dispatch_time; - } - - public function hasDispatchTime() - { - return isset($this->dispatch_time); - } - - public function clearDispatchTime() - { - unset($this->dispatch_time); - } - - /** - * Output only. The time that this attempt was dispatched. - * `dispatch_time` will be truncated to the nearest microsecond. - * - * Generated from protobuf field .google.protobuf.Timestamp dispatch_time = 2; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setDispatchTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->dispatch_time = $var; - - return $this; - } - - /** - * Output only. The time that this attempt response was received. - * `response_time` will be truncated to the nearest microsecond. - * - * Generated from protobuf field .google.protobuf.Timestamp response_time = 3; - * @return \Google\Protobuf\Timestamp|null - */ - public function getResponseTime() - { - return $this->response_time; - } - - public function hasResponseTime() - { - return isset($this->response_time); - } - - public function clearResponseTime() - { - unset($this->response_time); - } - - /** - * Output only. The time that this attempt response was received. - * `response_time` will be truncated to the nearest microsecond. - * - * Generated from protobuf field .google.protobuf.Timestamp response_time = 3; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setResponseTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->response_time = $var; - - return $this; - } - - /** - * Output only. The response from the worker for this attempt. - * If `response_time` is unset, then the task has not been attempted or is - * currently running and the `response_status` field is meaningless. - * - * Generated from protobuf field .google.rpc.Status response_status = 4; - * @return \Google\Rpc\Status|null - */ - public function getResponseStatus() - { - return $this->response_status; - } - - public function hasResponseStatus() - { - return isset($this->response_status); - } - - public function clearResponseStatus() - { - unset($this->response_status); - } - - /** - * Output only. The response from the worker for this attempt. - * If `response_time` is unset, then the task has not been attempted or is - * currently running and the `response_status` field is meaningless. - * - * Generated from protobuf field .google.rpc.Status response_status = 4; - * @param \Google\Rpc\Status $var - * @return $this - */ - public function setResponseStatus($var) - { - GPBUtil::checkMessage($var, \Google\Rpc\Status::class); - $this->response_status = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/CreateQueueRequest.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/CreateQueueRequest.php deleted file mode 100644 index 55733073e210..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/CreateQueueRequest.php +++ /dev/null @@ -1,136 +0,0 @@ -google.cloud.tasks.v2beta3.CreateQueueRequest - */ -class CreateQueueRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The location name in which the queue will be created. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * The list of allowed locations can be obtained by calling Cloud - * Tasks' implementation of - * [ListLocations][google.cloud.location.Locations.ListLocations]. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The queue to create. - * [Queue's name][google.cloud.tasks.v2beta3.Queue.name] cannot be the same as - * an existing queue. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.Queue queue = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $queue = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The location name in which the queue will be created. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * The list of allowed locations can be obtained by calling Cloud - * Tasks' implementation of - * [ListLocations][google.cloud.location.Locations.ListLocations]. - * @type \Google\Cloud\Tasks\V2beta3\Queue $queue - * Required. The queue to create. - * [Queue's name][google.cloud.tasks.v2beta3.Queue.name] cannot be the same as - * an existing queue. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * Required. The location name in which the queue will be created. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * The list of allowed locations can be obtained by calling Cloud - * Tasks' implementation of - * [ListLocations][google.cloud.location.Locations.ListLocations]. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The location name in which the queue will be created. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * The list of allowed locations can be obtained by calling Cloud - * Tasks' implementation of - * [ListLocations][google.cloud.location.Locations.ListLocations]. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The queue to create. - * [Queue's name][google.cloud.tasks.v2beta3.Queue.name] cannot be the same as - * an existing queue. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.Queue queue = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Tasks\V2beta3\Queue|null - */ - public function getQueue() - { - return $this->queue; - } - - public function hasQueue() - { - return isset($this->queue); - } - - public function clearQueue() - { - unset($this->queue); - } - - /** - * Required. The queue to create. - * [Queue's name][google.cloud.tasks.v2beta3.Queue.name] cannot be the same as - * an existing queue. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.Queue queue = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Tasks\V2beta3\Queue $var - * @return $this - */ - public function setQueue($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\Queue::class); - $this->queue = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/CreateTaskRequest.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/CreateTaskRequest.php deleted file mode 100644 index 2639a9271c86..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/CreateTaskRequest.php +++ /dev/null @@ -1,302 +0,0 @@ -google.cloud.tasks.v2beta3.CreateTaskRequest - */ -class CreateTaskRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * The queue must already exist. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The task to add. - * Task names have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. - * The user can optionally specify a task - * [name][google.cloud.tasks.v2beta3.Task.name]. If a name is not specified - * then the system will generate a random unique task id, which will be set in - * the task returned in the [response][google.cloud.tasks.v2beta3.Task.name]. - * If [schedule_time][google.cloud.tasks.v2beta3.Task.schedule_time] is not - * set or is in the past then Cloud Tasks will set it to the current time. - * Task De-duplication: - * Explicitly specifying a task ID enables task de-duplication. If - * a task's ID is identical to that of an existing task or a task - * that was deleted or executed recently then the call will fail - * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. - * If the task's queue was created using Cloud Tasks, then another task with - * the same name can't be created for ~1 hour after the original task was - * deleted or executed. If the task's queue was created using queue.yaml or - * queue.xml, then another task with the same name can't be created - * for ~9 days after the original task was deleted or executed. - * Because there is an extra lookup cost to identify duplicate task - * names, these [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask] - * calls have significantly increased latency. Using hashed strings for the - * task id or for the prefix of the task id is recommended. Choosing task ids - * that are sequential or have sequential prefixes, for example using a - * timestamp, causes an increase in latency and error rates in all - * task commands. The infrastructure relies on an approximately - * uniform distribution of task ids to store and serve tasks - * efficiently. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.Task task = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $task = null; - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta3.Task] will be returned. - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta3.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.Task.View response_view = 3; - */ - protected $response_view = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * The queue must already exist. - * @type \Google\Cloud\Tasks\V2beta3\Task $task - * Required. The task to add. - * Task names have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. - * The user can optionally specify a task - * [name][google.cloud.tasks.v2beta3.Task.name]. If a name is not specified - * then the system will generate a random unique task id, which will be set in - * the task returned in the [response][google.cloud.tasks.v2beta3.Task.name]. - * If [schedule_time][google.cloud.tasks.v2beta3.Task.schedule_time] is not - * set or is in the past then Cloud Tasks will set it to the current time. - * Task De-duplication: - * Explicitly specifying a task ID enables task de-duplication. If - * a task's ID is identical to that of an existing task or a task - * that was deleted or executed recently then the call will fail - * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. - * If the task's queue was created using Cloud Tasks, then another task with - * the same name can't be created for ~1 hour after the original task was - * deleted or executed. If the task's queue was created using queue.yaml or - * queue.xml, then another task with the same name can't be created - * for ~9 days after the original task was deleted or executed. - * Because there is an extra lookup cost to identify duplicate task - * names, these [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask] - * calls have significantly increased latency. Using hashed strings for the - * task id or for the prefix of the task id is recommended. Choosing task ids - * that are sequential or have sequential prefixes, for example using a - * timestamp, causes an increase in latency and error rates in all - * task commands. The infrastructure relies on an approximately - * uniform distribution of task ids to store and serve tasks - * efficiently. - * @type int $response_view - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta3.Task] will be returned. - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta3.Task] resource. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * The queue must already exist. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * The queue must already exist. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The task to add. - * Task names have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. - * The user can optionally specify a task - * [name][google.cloud.tasks.v2beta3.Task.name]. If a name is not specified - * then the system will generate a random unique task id, which will be set in - * the task returned in the [response][google.cloud.tasks.v2beta3.Task.name]. - * If [schedule_time][google.cloud.tasks.v2beta3.Task.schedule_time] is not - * set or is in the past then Cloud Tasks will set it to the current time. - * Task De-duplication: - * Explicitly specifying a task ID enables task de-duplication. If - * a task's ID is identical to that of an existing task or a task - * that was deleted or executed recently then the call will fail - * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. - * If the task's queue was created using Cloud Tasks, then another task with - * the same name can't be created for ~1 hour after the original task was - * deleted or executed. If the task's queue was created using queue.yaml or - * queue.xml, then another task with the same name can't be created - * for ~9 days after the original task was deleted or executed. - * Because there is an extra lookup cost to identify duplicate task - * names, these [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask] - * calls have significantly increased latency. Using hashed strings for the - * task id or for the prefix of the task id is recommended. Choosing task ids - * that are sequential or have sequential prefixes, for example using a - * timestamp, causes an increase in latency and error rates in all - * task commands. The infrastructure relies on an approximately - * uniform distribution of task ids to store and serve tasks - * efficiently. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.Task task = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Tasks\V2beta3\Task|null - */ - public function getTask() - { - return $this->task; - } - - public function hasTask() - { - return isset($this->task); - } - - public function clearTask() - { - unset($this->task); - } - - /** - * Required. The task to add. - * Task names have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. - * The user can optionally specify a task - * [name][google.cloud.tasks.v2beta3.Task.name]. If a name is not specified - * then the system will generate a random unique task id, which will be set in - * the task returned in the [response][google.cloud.tasks.v2beta3.Task.name]. - * If [schedule_time][google.cloud.tasks.v2beta3.Task.schedule_time] is not - * set or is in the past then Cloud Tasks will set it to the current time. - * Task De-duplication: - * Explicitly specifying a task ID enables task de-duplication. If - * a task's ID is identical to that of an existing task or a task - * that was deleted or executed recently then the call will fail - * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. - * If the task's queue was created using Cloud Tasks, then another task with - * the same name can't be created for ~1 hour after the original task was - * deleted or executed. If the task's queue was created using queue.yaml or - * queue.xml, then another task with the same name can't be created - * for ~9 days after the original task was deleted or executed. - * Because there is an extra lookup cost to identify duplicate task - * names, these [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask] - * calls have significantly increased latency. Using hashed strings for the - * task id or for the prefix of the task id is recommended. Choosing task ids - * that are sequential or have sequential prefixes, for example using a - * timestamp, causes an increase in latency and error rates in all - * task commands. The infrastructure relies on an approximately - * uniform distribution of task ids to store and serve tasks - * efficiently. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.Task task = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Tasks\V2beta3\Task $var - * @return $this - */ - public function setTask($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\Task::class); - $this->task = $var; - - return $this; - } - - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta3.Task] will be returned. - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta3.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.Task.View response_view = 3; - * @return int - */ - public function getResponseView() - { - return $this->response_view; - } - - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta3.Task] will be returned. - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta3.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.Task.View response_view = 3; - * @param int $var - * @return $this - */ - public function setResponseView($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta3\Task\View::class); - $this->response_view = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/DeleteQueueRequest.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/DeleteQueueRequest.php deleted file mode 100644 index 0eebfa9c696d..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/DeleteQueueRequest.php +++ /dev/null @@ -1,72 +0,0 @@ -google.cloud.tasks.v2beta3.DeleteQueueRequest - */ -class DeleteQueueRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/DeleteTaskRequest.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/DeleteTaskRequest.php deleted file mode 100644 index d9576067cf94..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/DeleteTaskRequest.php +++ /dev/null @@ -1,72 +0,0 @@ -google.cloud.tasks.v2beta3.DeleteTaskRequest - */ -class DeleteTaskRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/GetQueueRequest.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/GetQueueRequest.php deleted file mode 100644 index 2d6609e8a7f1..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/GetQueueRequest.php +++ /dev/null @@ -1,128 +0,0 @@ -google.cloud.tasks.v2beta3.GetQueueRequest - */ -class GetQueueRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the queue. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Optional. Read mask is used for a more granular control over what the API - * returns. If the mask is not present all fields will be returned except - * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - * specified in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask read_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $read_mask = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the queue. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * @type \Google\Protobuf\FieldMask $read_mask - * Optional. Read mask is used for a more granular control over what the API - * returns. If the mask is not present all fields will be returned except - * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - * specified in the mask. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the queue. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The resource name of the queue. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. Read mask is used for a more granular control over what the API - * returns. If the mask is not present all fields will be returned except - * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - * specified in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask read_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\FieldMask|null - */ - public function getReadMask() - { - return $this->read_mask; - } - - public function hasReadMask() - { - return isset($this->read_mask); - } - - public function clearReadMask() - { - unset($this->read_mask); - } - - /** - * Optional. Read mask is used for a more granular control over what the API - * returns. If the mask is not present all fields will be returned except - * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - * specified in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask read_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setReadMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->read_mask = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/GetTaskRequest.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/GetTaskRequest.php deleted file mode 100644 index 1f16efccdc25..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/GetTaskRequest.php +++ /dev/null @@ -1,146 +0,0 @@ -google.cloud.tasks.v2beta3.GetTaskRequest - */ -class GetTaskRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta3.Task] will be returned. - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta3.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.Task.View response_view = 2; - */ - protected $response_view = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * @type int $response_view - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta3.Task] will be returned. - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta3.Task] resource. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta3.Task] will be returned. - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta3.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.Task.View response_view = 2; - * @return int - */ - public function getResponseView() - { - return $this->response_view; - } - - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta3.Task] will be returned. - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta3.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.Task.View response_view = 2; - * @param int $var - * @return $this - */ - public function setResponseView($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta3\Task\View::class); - $this->response_view = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/HttpMethod.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/HttpMethod.php deleted file mode 100644 index 0c8164234fca..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/HttpMethod.php +++ /dev/null @@ -1,96 +0,0 @@ -google.cloud.tasks.v2beta3.HttpMethod - */ -class HttpMethod -{ - /** - * HTTP method unspecified - * - * Generated from protobuf enum HTTP_METHOD_UNSPECIFIED = 0; - */ - const HTTP_METHOD_UNSPECIFIED = 0; - /** - * HTTP POST - * - * Generated from protobuf enum POST = 1; - */ - const POST = 1; - /** - * HTTP GET - * - * Generated from protobuf enum GET = 2; - */ - const GET = 2; - /** - * HTTP HEAD - * - * Generated from protobuf enum HEAD = 3; - */ - const HEAD = 3; - /** - * HTTP PUT - * - * Generated from protobuf enum PUT = 4; - */ - const PUT = 4; - /** - * HTTP DELETE - * - * Generated from protobuf enum DELETE = 5; - */ - const DELETE = 5; - /** - * HTTP PATCH - * - * Generated from protobuf enum PATCH = 6; - */ - const PATCH = 6; - /** - * HTTP OPTIONS - * - * Generated from protobuf enum OPTIONS = 7; - */ - const OPTIONS = 7; - - private static $valueToName = [ - self::HTTP_METHOD_UNSPECIFIED => 'HTTP_METHOD_UNSPECIFIED', - self::POST => 'POST', - self::GET => 'GET', - self::HEAD => 'HEAD', - self::PUT => 'PUT', - self::DELETE => 'DELETE', - self::PATCH => 'PATCH', - self::OPTIONS => 'OPTIONS', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/HttpRequest.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/HttpRequest.php deleted file mode 100644 index 2177366bab53..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/HttpRequest.php +++ /dev/null @@ -1,433 +0,0 @@ -google.cloud.tasks.v2beta3.HttpRequest - */ -class HttpRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The full url path that the request will be sent to. - * This string must begin with either "http://" or "https://". Some examples - * are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will - * encode some characters for safety and compatibility. The maximum allowed - * URL length is 2083 characters after encoding. - * The `Location` header response from a redirect response [`300` - `399`] - * may be followed. The redirect is not counted as a separate attempt. - * - * Generated from protobuf field string url = 1; - */ - protected $url = ''; - /** - * The HTTP method to use for the request. The default is POST. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.HttpMethod http_method = 2; - */ - protected $http_method = 0; - /** - * HTTP request headers. - * This map contains the header field names and values. - * Headers can be set when the - * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - * These headers represent a subset of the headers that will accompany the - * task's HTTP request. Some HTTP request headers will be ignored or replaced. - * A partial list of headers that will be ignored or replaced is: - * * Any header that is prefixed with "X-CloudTasks-" will be treated - * as service header. Service headers define properties of the task and are - * predefined in CloudTask. - * * Host: This will be computed by Cloud Tasks and derived from - * [HttpRequest.url][google.cloud.tasks.v2beta3.HttpRequest.url]. - * * Content-Length: This will be computed by Cloud Tasks. - * * User-Agent: This will be set to `"Google-Cloud-Tasks"`. - * * `X-Google-*`: Google use only. - * * `X-AppEngine-*`: Google use only. - * `Content-Type` won't be set by Cloud Tasks. You can explicitly set - * `Content-Type` to a media type when the - * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - * For example, `Content-Type` can be set to `"application/octet-stream"` or - * `"application/json"`. - * Headers which can have multiple values (according to RFC2616) can be - * specified using comma-separated values. - * The size of the headers must be less than 80KB. - * - * Generated from protobuf field map headers = 3; - */ - private $headers; - /** - * HTTP request body. - * A request body is allowed only if the - * [HTTP method][google.cloud.tasks.v2beta3.HttpRequest.http_method] is POST, - * PUT, or PATCH. It is an error to set body on a task with an incompatible - * [HttpMethod][google.cloud.tasks.v2beta3.HttpMethod]. - * - * Generated from protobuf field bytes body = 4; - */ - protected $body = ''; - protected $authorization_header; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $url - * Required. The full url path that the request will be sent to. - * This string must begin with either "http://" or "https://". Some examples - * are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will - * encode some characters for safety and compatibility. The maximum allowed - * URL length is 2083 characters after encoding. - * The `Location` header response from a redirect response [`300` - `399`] - * may be followed. The redirect is not counted as a separate attempt. - * @type int $http_method - * The HTTP method to use for the request. The default is POST. - * @type array|\Google\Protobuf\Internal\MapField $headers - * HTTP request headers. - * This map contains the header field names and values. - * Headers can be set when the - * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - * These headers represent a subset of the headers that will accompany the - * task's HTTP request. Some HTTP request headers will be ignored or replaced. - * A partial list of headers that will be ignored or replaced is: - * * Any header that is prefixed with "X-CloudTasks-" will be treated - * as service header. Service headers define properties of the task and are - * predefined in CloudTask. - * * Host: This will be computed by Cloud Tasks and derived from - * [HttpRequest.url][google.cloud.tasks.v2beta3.HttpRequest.url]. - * * Content-Length: This will be computed by Cloud Tasks. - * * User-Agent: This will be set to `"Google-Cloud-Tasks"`. - * * `X-Google-*`: Google use only. - * * `X-AppEngine-*`: Google use only. - * `Content-Type` won't be set by Cloud Tasks. You can explicitly set - * `Content-Type` to a media type when the - * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - * For example, `Content-Type` can be set to `"application/octet-stream"` or - * `"application/json"`. - * Headers which can have multiple values (according to RFC2616) can be - * specified using comma-separated values. - * The size of the headers must be less than 80KB. - * @type string $body - * HTTP request body. - * A request body is allowed only if the - * [HTTP method][google.cloud.tasks.v2beta3.HttpRequest.http_method] is POST, - * PUT, or PATCH. It is an error to set body on a task with an incompatible - * [HttpMethod][google.cloud.tasks.v2beta3.HttpMethod]. - * @type \Google\Cloud\Tasks\V2beta3\OAuthToken $oauth_token - * If specified, an - * [OAuth token](https://developers.google.com/identity/protocols/OAuth2) - * will be generated and attached as an `Authorization` header in the HTTP - * request. - * This type of authorization should generally only be used when calling - * Google APIs hosted on *.googleapis.com. - * @type \Google\Cloud\Tasks\V2beta3\OidcToken $oidc_token - * If specified, an - * [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) - * token will be generated and attached as an `Authorization` header in the - * HTTP request. - * This type of authorization can be used for many scenarios, including - * calling Cloud Run, or endpoints where you intend to validate the token - * yourself. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Target::initOnce(); - parent::__construct($data); - } - - /** - * Required. The full url path that the request will be sent to. - * This string must begin with either "http://" or "https://". Some examples - * are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will - * encode some characters for safety and compatibility. The maximum allowed - * URL length is 2083 characters after encoding. - * The `Location` header response from a redirect response [`300` - `399`] - * may be followed. The redirect is not counted as a separate attempt. - * - * Generated from protobuf field string url = 1; - * @return string - */ - public function getUrl() - { - return $this->url; - } - - /** - * Required. The full url path that the request will be sent to. - * This string must begin with either "http://" or "https://". Some examples - * are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will - * encode some characters for safety and compatibility. The maximum allowed - * URL length is 2083 characters after encoding. - * The `Location` header response from a redirect response [`300` - `399`] - * may be followed. The redirect is not counted as a separate attempt. - * - * Generated from protobuf field string url = 1; - * @param string $var - * @return $this - */ - public function setUrl($var) - { - GPBUtil::checkString($var, True); - $this->url = $var; - - return $this; - } - - /** - * The HTTP method to use for the request. The default is POST. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.HttpMethod http_method = 2; - * @return int - */ - public function getHttpMethod() - { - return $this->http_method; - } - - /** - * The HTTP method to use for the request. The default is POST. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.HttpMethod http_method = 2; - * @param int $var - * @return $this - */ - public function setHttpMethod($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta3\HttpMethod::class); - $this->http_method = $var; - - return $this; - } - - /** - * HTTP request headers. - * This map contains the header field names and values. - * Headers can be set when the - * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - * These headers represent a subset of the headers that will accompany the - * task's HTTP request. Some HTTP request headers will be ignored or replaced. - * A partial list of headers that will be ignored or replaced is: - * * Any header that is prefixed with "X-CloudTasks-" will be treated - * as service header. Service headers define properties of the task and are - * predefined in CloudTask. - * * Host: This will be computed by Cloud Tasks and derived from - * [HttpRequest.url][google.cloud.tasks.v2beta3.HttpRequest.url]. - * * Content-Length: This will be computed by Cloud Tasks. - * * User-Agent: This will be set to `"Google-Cloud-Tasks"`. - * * `X-Google-*`: Google use only. - * * `X-AppEngine-*`: Google use only. - * `Content-Type` won't be set by Cloud Tasks. You can explicitly set - * `Content-Type` to a media type when the - * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - * For example, `Content-Type` can be set to `"application/octet-stream"` or - * `"application/json"`. - * Headers which can have multiple values (according to RFC2616) can be - * specified using comma-separated values. - * The size of the headers must be less than 80KB. - * - * Generated from protobuf field map headers = 3; - * @return \Google\Protobuf\Internal\MapField - */ - public function getHeaders() - { - return $this->headers; - } - - /** - * HTTP request headers. - * This map contains the header field names and values. - * Headers can be set when the - * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - * These headers represent a subset of the headers that will accompany the - * task's HTTP request. Some HTTP request headers will be ignored or replaced. - * A partial list of headers that will be ignored or replaced is: - * * Any header that is prefixed with "X-CloudTasks-" will be treated - * as service header. Service headers define properties of the task and are - * predefined in CloudTask. - * * Host: This will be computed by Cloud Tasks and derived from - * [HttpRequest.url][google.cloud.tasks.v2beta3.HttpRequest.url]. - * * Content-Length: This will be computed by Cloud Tasks. - * * User-Agent: This will be set to `"Google-Cloud-Tasks"`. - * * `X-Google-*`: Google use only. - * * `X-AppEngine-*`: Google use only. - * `Content-Type` won't be set by Cloud Tasks. You can explicitly set - * `Content-Type` to a media type when the - * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - * For example, `Content-Type` can be set to `"application/octet-stream"` or - * `"application/json"`. - * Headers which can have multiple values (according to RFC2616) can be - * specified using comma-separated values. - * The size of the headers must be less than 80KB. - * - * Generated from protobuf field map headers = 3; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setHeaders($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->headers = $arr; - - return $this; - } - - /** - * HTTP request body. - * A request body is allowed only if the - * [HTTP method][google.cloud.tasks.v2beta3.HttpRequest.http_method] is POST, - * PUT, or PATCH. It is an error to set body on a task with an incompatible - * [HttpMethod][google.cloud.tasks.v2beta3.HttpMethod]. - * - * Generated from protobuf field bytes body = 4; - * @return string - */ - public function getBody() - { - return $this->body; - } - - /** - * HTTP request body. - * A request body is allowed only if the - * [HTTP method][google.cloud.tasks.v2beta3.HttpRequest.http_method] is POST, - * PUT, or PATCH. It is an error to set body on a task with an incompatible - * [HttpMethod][google.cloud.tasks.v2beta3.HttpMethod]. - * - * Generated from protobuf field bytes body = 4; - * @param string $var - * @return $this - */ - public function setBody($var) - { - GPBUtil::checkString($var, False); - $this->body = $var; - - return $this; - } - - /** - * If specified, an - * [OAuth token](https://developers.google.com/identity/protocols/OAuth2) - * will be generated and attached as an `Authorization` header in the HTTP - * request. - * This type of authorization should generally only be used when calling - * Google APIs hosted on *.googleapis.com. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.OAuthToken oauth_token = 5; - * @return \Google\Cloud\Tasks\V2beta3\OAuthToken|null - */ - public function getOauthToken() - { - return $this->readOneof(5); - } - - public function hasOauthToken() - { - return $this->hasOneof(5); - } - - /** - * If specified, an - * [OAuth token](https://developers.google.com/identity/protocols/OAuth2) - * will be generated and attached as an `Authorization` header in the HTTP - * request. - * This type of authorization should generally only be used when calling - * Google APIs hosted on *.googleapis.com. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.OAuthToken oauth_token = 5; - * @param \Google\Cloud\Tasks\V2beta3\OAuthToken $var - * @return $this - */ - public function setOauthToken($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\OAuthToken::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * If specified, an - * [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) - * token will be generated and attached as an `Authorization` header in the - * HTTP request. - * This type of authorization can be used for many scenarios, including - * calling Cloud Run, or endpoints where you intend to validate the token - * yourself. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.OidcToken oidc_token = 6; - * @return \Google\Cloud\Tasks\V2beta3\OidcToken|null - */ - public function getOidcToken() - { - return $this->readOneof(6); - } - - public function hasOidcToken() - { - return $this->hasOneof(6); - } - - /** - * If specified, an - * [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) - * token will be generated and attached as an `Authorization` header in the - * HTTP request. - * This type of authorization can be used for many scenarios, including - * calling Cloud Run, or endpoints where you intend to validate the token - * yourself. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.OidcToken oidc_token = 6; - * @param \Google\Cloud\Tasks\V2beta3\OidcToken $var - * @return $this - */ - public function setOidcToken($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\OidcToken::class); - $this->writeOneof(6, $var); - - return $this; - } - - /** - * @return string - */ - public function getAuthorizationHeader() - { - return $this->whichOneof("authorization_header"); - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/HttpTarget.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/HttpTarget.php deleted file mode 100644 index 4f15822f4ebc..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/HttpTarget.php +++ /dev/null @@ -1,367 +0,0 @@ -google.cloud.tasks.v2beta3.HttpTarget - */ -class HttpTarget extends \Google\Protobuf\Internal\Message -{ - /** - * URI override. - * When specified, overrides the execution URI for all the tasks in the queue. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.UriOverride uri_override = 1; - */ - protected $uri_override = null; - /** - * The HTTP method to use for the request. - * When specified, it overrides - * [HttpRequest][google.cloud.tasks.v2beta3.HttpTarget.http_method] for the - * task. Note that if the value is set to [HttpMethod][GET] the - * [HttpRequest][body] of the task will be ignored at execution time. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.HttpMethod http_method = 2; - */ - protected $http_method = 0; - /** - * HTTP target headers. - * This map contains the header field names and values. - * Headers will be set when running the - * [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask] and/or - * [BufferTask][google.cloud.tasks.v2beta3.CloudTasks.BufferTask]. - * These headers represent a subset of the headers that will be configured for - * the task's HTTP request. Some HTTP request headers will be ignored or - * replaced. - * A partial list of headers that will be ignored or replaced is: - * * Several predefined headers, prefixed with "X-CloudTasks-", can - * be used to define properties of the task. - * * Host: This will be computed by Cloud Tasks and derived from - * [HttpRequest.url][google.cloud.tasks.v2beta3.Target.HttpRequest.url]. - * * Content-Length: This will be computed by Cloud Tasks. - * `Content-Type` won't be set by Cloud Tasks. You can explicitly set - * `Content-Type` to a media type when the - * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - * For example,`Content-Type` can be set to `"application/octet-stream"` or - * `"application/json"`. The default value is set to `"application/json"`. - * * User-Agent: This will be set to `"Google-Cloud-Tasks"`. - * Headers which can have multiple values (according to RFC2616) can be - * specified using comma-separated values. - * The size of the headers must be less than 80KB. - * Queue-level headers to override headers of all the tasks in the queue. - * - * Generated from protobuf field repeated .google.cloud.tasks.v2beta3.HttpTarget.HeaderOverride header_overrides = 3; - */ - private $header_overrides; - protected $authorization_header; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Tasks\V2beta3\UriOverride $uri_override - * URI override. - * When specified, overrides the execution URI for all the tasks in the queue. - * @type int $http_method - * The HTTP method to use for the request. - * When specified, it overrides - * [HttpRequest][google.cloud.tasks.v2beta3.HttpTarget.http_method] for the - * task. Note that if the value is set to [HttpMethod][GET] the - * [HttpRequest][body] of the task will be ignored at execution time. - * @type array<\Google\Cloud\Tasks\V2beta3\HttpTarget\HeaderOverride>|\Google\Protobuf\Internal\RepeatedField $header_overrides - * HTTP target headers. - * This map contains the header field names and values. - * Headers will be set when running the - * [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask] and/or - * [BufferTask][google.cloud.tasks.v2beta3.CloudTasks.BufferTask]. - * These headers represent a subset of the headers that will be configured for - * the task's HTTP request. Some HTTP request headers will be ignored or - * replaced. - * A partial list of headers that will be ignored or replaced is: - * * Several predefined headers, prefixed with "X-CloudTasks-", can - * be used to define properties of the task. - * * Host: This will be computed by Cloud Tasks and derived from - * [HttpRequest.url][google.cloud.tasks.v2beta3.Target.HttpRequest.url]. - * * Content-Length: This will be computed by Cloud Tasks. - * `Content-Type` won't be set by Cloud Tasks. You can explicitly set - * `Content-Type` to a media type when the - * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - * For example,`Content-Type` can be set to `"application/octet-stream"` or - * `"application/json"`. The default value is set to `"application/json"`. - * * User-Agent: This will be set to `"Google-Cloud-Tasks"`. - * Headers which can have multiple values (according to RFC2616) can be - * specified using comma-separated values. - * The size of the headers must be less than 80KB. - * Queue-level headers to override headers of all the tasks in the queue. - * @type \Google\Cloud\Tasks\V2beta3\OAuthToken $oauth_token - * If specified, an - * [OAuth token](https://developers.google.com/identity/protocols/OAuth2) - * will be generated and attached as the `Authorization` header in the HTTP - * request. - * This type of authorization should generally only be used when calling - * Google APIs hosted on *.googleapis.com. - * @type \Google\Cloud\Tasks\V2beta3\OidcToken $oidc_token - * If specified, an - * [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) - * token will be generated and attached as an `Authorization` header in the - * HTTP request. - * This type of authorization can be used for many scenarios, including - * calling Cloud Run, or endpoints where you intend to validate the token - * yourself. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Target::initOnce(); - parent::__construct($data); - } - - /** - * URI override. - * When specified, overrides the execution URI for all the tasks in the queue. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.UriOverride uri_override = 1; - * @return \Google\Cloud\Tasks\V2beta3\UriOverride|null - */ - public function getUriOverride() - { - return $this->uri_override; - } - - public function hasUriOverride() - { - return isset($this->uri_override); - } - - public function clearUriOverride() - { - unset($this->uri_override); - } - - /** - * URI override. - * When specified, overrides the execution URI for all the tasks in the queue. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.UriOverride uri_override = 1; - * @param \Google\Cloud\Tasks\V2beta3\UriOverride $var - * @return $this - */ - public function setUriOverride($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\UriOverride::class); - $this->uri_override = $var; - - return $this; - } - - /** - * The HTTP method to use for the request. - * When specified, it overrides - * [HttpRequest][google.cloud.tasks.v2beta3.HttpTarget.http_method] for the - * task. Note that if the value is set to [HttpMethod][GET] the - * [HttpRequest][body] of the task will be ignored at execution time. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.HttpMethod http_method = 2; - * @return int - */ - public function getHttpMethod() - { - return $this->http_method; - } - - /** - * The HTTP method to use for the request. - * When specified, it overrides - * [HttpRequest][google.cloud.tasks.v2beta3.HttpTarget.http_method] for the - * task. Note that if the value is set to [HttpMethod][GET] the - * [HttpRequest][body] of the task will be ignored at execution time. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.HttpMethod http_method = 2; - * @param int $var - * @return $this - */ - public function setHttpMethod($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta3\HttpMethod::class); - $this->http_method = $var; - - return $this; - } - - /** - * HTTP target headers. - * This map contains the header field names and values. - * Headers will be set when running the - * [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask] and/or - * [BufferTask][google.cloud.tasks.v2beta3.CloudTasks.BufferTask]. - * These headers represent a subset of the headers that will be configured for - * the task's HTTP request. Some HTTP request headers will be ignored or - * replaced. - * A partial list of headers that will be ignored or replaced is: - * * Several predefined headers, prefixed with "X-CloudTasks-", can - * be used to define properties of the task. - * * Host: This will be computed by Cloud Tasks and derived from - * [HttpRequest.url][google.cloud.tasks.v2beta3.Target.HttpRequest.url]. - * * Content-Length: This will be computed by Cloud Tasks. - * `Content-Type` won't be set by Cloud Tasks. You can explicitly set - * `Content-Type` to a media type when the - * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - * For example,`Content-Type` can be set to `"application/octet-stream"` or - * `"application/json"`. The default value is set to `"application/json"`. - * * User-Agent: This will be set to `"Google-Cloud-Tasks"`. - * Headers which can have multiple values (according to RFC2616) can be - * specified using comma-separated values. - * The size of the headers must be less than 80KB. - * Queue-level headers to override headers of all the tasks in the queue. - * - * Generated from protobuf field repeated .google.cloud.tasks.v2beta3.HttpTarget.HeaderOverride header_overrides = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getHeaderOverrides() - { - return $this->header_overrides; - } - - /** - * HTTP target headers. - * This map contains the header field names and values. - * Headers will be set when running the - * [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask] and/or - * [BufferTask][google.cloud.tasks.v2beta3.CloudTasks.BufferTask]. - * These headers represent a subset of the headers that will be configured for - * the task's HTTP request. Some HTTP request headers will be ignored or - * replaced. - * A partial list of headers that will be ignored or replaced is: - * * Several predefined headers, prefixed with "X-CloudTasks-", can - * be used to define properties of the task. - * * Host: This will be computed by Cloud Tasks and derived from - * [HttpRequest.url][google.cloud.tasks.v2beta3.Target.HttpRequest.url]. - * * Content-Length: This will be computed by Cloud Tasks. - * `Content-Type` won't be set by Cloud Tasks. You can explicitly set - * `Content-Type` to a media type when the - * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - * For example,`Content-Type` can be set to `"application/octet-stream"` or - * `"application/json"`. The default value is set to `"application/json"`. - * * User-Agent: This will be set to `"Google-Cloud-Tasks"`. - * Headers which can have multiple values (according to RFC2616) can be - * specified using comma-separated values. - * The size of the headers must be less than 80KB. - * Queue-level headers to override headers of all the tasks in the queue. - * - * Generated from protobuf field repeated .google.cloud.tasks.v2beta3.HttpTarget.HeaderOverride header_overrides = 3; - * @param array<\Google\Cloud\Tasks\V2beta3\HttpTarget\HeaderOverride>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setHeaderOverrides($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Tasks\V2beta3\HttpTarget\HeaderOverride::class); - $this->header_overrides = $arr; - - return $this; - } - - /** - * If specified, an - * [OAuth token](https://developers.google.com/identity/protocols/OAuth2) - * will be generated and attached as the `Authorization` header in the HTTP - * request. - * This type of authorization should generally only be used when calling - * Google APIs hosted on *.googleapis.com. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.OAuthToken oauth_token = 5; - * @return \Google\Cloud\Tasks\V2beta3\OAuthToken|null - */ - public function getOauthToken() - { - return $this->readOneof(5); - } - - public function hasOauthToken() - { - return $this->hasOneof(5); - } - - /** - * If specified, an - * [OAuth token](https://developers.google.com/identity/protocols/OAuth2) - * will be generated and attached as the `Authorization` header in the HTTP - * request. - * This type of authorization should generally only be used when calling - * Google APIs hosted on *.googleapis.com. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.OAuthToken oauth_token = 5; - * @param \Google\Cloud\Tasks\V2beta3\OAuthToken $var - * @return $this - */ - public function setOauthToken($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\OAuthToken::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * If specified, an - * [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) - * token will be generated and attached as an `Authorization` header in the - * HTTP request. - * This type of authorization can be used for many scenarios, including - * calling Cloud Run, or endpoints where you intend to validate the token - * yourself. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.OidcToken oidc_token = 6; - * @return \Google\Cloud\Tasks\V2beta3\OidcToken|null - */ - public function getOidcToken() - { - return $this->readOneof(6); - } - - public function hasOidcToken() - { - return $this->hasOneof(6); - } - - /** - * If specified, an - * [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) - * token will be generated and attached as an `Authorization` header in the - * HTTP request. - * This type of authorization can be used for many scenarios, including - * calling Cloud Run, or endpoints where you intend to validate the token - * yourself. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.OidcToken oidc_token = 6; - * @param \Google\Cloud\Tasks\V2beta3\OidcToken $var - * @return $this - */ - public function setOidcToken($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\OidcToken::class); - $this->writeOneof(6, $var); - - return $this; - } - - /** - * @return string - */ - public function getAuthorizationHeader() - { - return $this->whichOneof("authorization_header"); - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/HttpTarget/Header.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/HttpTarget/Header.php deleted file mode 100644 index ad3499f31d87..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/HttpTarget/Header.php +++ /dev/null @@ -1,104 +0,0 @@ -google.cloud.tasks.v2beta3.HttpTarget.Header - */ -class Header extends \Google\Protobuf\Internal\Message -{ - /** - * The Key of the header. - * - * Generated from protobuf field string key = 1; - */ - protected $key = ''; - /** - * The Value of the header. - * - * Generated from protobuf field string value = 2; - */ - protected $value = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $key - * The Key of the header. - * @type string $value - * The Value of the header. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Target::initOnce(); - parent::__construct($data); - } - - /** - * The Key of the header. - * - * Generated from protobuf field string key = 1; - * @return string - */ - public function getKey() - { - return $this->key; - } - - /** - * The Key of the header. - * - * Generated from protobuf field string key = 1; - * @param string $var - * @return $this - */ - public function setKey($var) - { - GPBUtil::checkString($var, True); - $this->key = $var; - - return $this; - } - - /** - * The Value of the header. - * - * Generated from protobuf field string value = 2; - * @return string - */ - public function getValue() - { - return $this->value; - } - - /** - * The Value of the header. - * - * Generated from protobuf field string value = 2; - * @param string $var - * @return $this - */ - public function setValue($var) - { - GPBUtil::checkString($var, True); - $this->value = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Header::class, \Google\Cloud\Tasks\V2beta3\HttpTarget_Header::class); - diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/HttpTarget/HeaderOverride.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/HttpTarget/HeaderOverride.php deleted file mode 100644 index 4f9f1eea5497..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/HttpTarget/HeaderOverride.php +++ /dev/null @@ -1,80 +0,0 @@ -google.cloud.tasks.v2beta3.HttpTarget.HeaderOverride - */ -class HeaderOverride extends \Google\Protobuf\Internal\Message -{ - /** - * header embodying a key and a value. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.HttpTarget.Header header = 1; - */ - protected $header = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Tasks\V2beta3\HttpTarget\Header $header - * header embodying a key and a value. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Target::initOnce(); - parent::__construct($data); - } - - /** - * header embodying a key and a value. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.HttpTarget.Header header = 1; - * @return \Google\Cloud\Tasks\V2beta3\HttpTarget\Header|null - */ - public function getHeader() - { - return $this->header; - } - - public function hasHeader() - { - return isset($this->header); - } - - public function clearHeader() - { - unset($this->header); - } - - /** - * header embodying a key and a value. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.HttpTarget.Header header = 1; - * @param \Google\Cloud\Tasks\V2beta3\HttpTarget\Header $var - * @return $this - */ - public function setHeader($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\HttpTarget\Header::class); - $this->header = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(HeaderOverride::class, \Google\Cloud\Tasks\V2beta3\HttpTarget_HeaderOverride::class); - diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ListQueuesRequest.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ListQueuesRequest.php deleted file mode 100644 index 4bd825aa7a6d..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ListQueuesRequest.php +++ /dev/null @@ -1,310 +0,0 @@ -google.cloud.tasks.v2beta3.ListQueuesRequest - */ -class ListQueuesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The location name. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * `filter` can be used to specify a subset of queues. Any - * [Queue][google.cloud.tasks.v2beta3.Queue] field can be used as a filter and - * several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The - * filter syntax is the same as described in [Stackdriver's Advanced Logs - * Filters](https://cloud.google.com/logging/docs/view/advanced_filters). - * Sample filter "state: PAUSED". - * Note that using filters might cause fewer queues than the - * requested page_size to be returned. - * - * Generated from protobuf field string filter = 2; - */ - protected $filter = ''; - /** - * Requested page size. - * The maximum page size is 9800. If unspecified, the page size will - * be the maximum. Fewer queues than requested might be returned, - * even if more queues exist; use the - * [next_page_token][google.cloud.tasks.v2beta3.ListQueuesResponse.next_page_token] - * in the response to determine if more queues exist. - * - * Generated from protobuf field int32 page_size = 3; - */ - protected $page_size = 0; - /** - * A token identifying the page of results to return. - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * [next_page_token][google.cloud.tasks.v2beta3.ListQueuesResponse.next_page_token] - * returned from the previous call to - * [ListQueues][google.cloud.tasks.v2beta3.CloudTasks.ListQueues] method. It - * is an error to switch the value of the - * [filter][google.cloud.tasks.v2beta3.ListQueuesRequest.filter] while - * iterating through pages. - * - * Generated from protobuf field string page_token = 4; - */ - protected $page_token = ''; - /** - * Optional. Read mask is used for a more granular control over what the API - * returns. If the mask is not present all fields will be returned except - * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - * specified in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask read_mask = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $read_mask = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The location name. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * @type string $filter - * `filter` can be used to specify a subset of queues. Any - * [Queue][google.cloud.tasks.v2beta3.Queue] field can be used as a filter and - * several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The - * filter syntax is the same as described in [Stackdriver's Advanced Logs - * Filters](https://cloud.google.com/logging/docs/view/advanced_filters). - * Sample filter "state: PAUSED". - * Note that using filters might cause fewer queues than the - * requested page_size to be returned. - * @type int $page_size - * Requested page size. - * The maximum page size is 9800. If unspecified, the page size will - * be the maximum. Fewer queues than requested might be returned, - * even if more queues exist; use the - * [next_page_token][google.cloud.tasks.v2beta3.ListQueuesResponse.next_page_token] - * in the response to determine if more queues exist. - * @type string $page_token - * A token identifying the page of results to return. - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * [next_page_token][google.cloud.tasks.v2beta3.ListQueuesResponse.next_page_token] - * returned from the previous call to - * [ListQueues][google.cloud.tasks.v2beta3.CloudTasks.ListQueues] method. It - * is an error to switch the value of the - * [filter][google.cloud.tasks.v2beta3.ListQueuesRequest.filter] while - * iterating through pages. - * @type \Google\Protobuf\FieldMask $read_mask - * Optional. Read mask is used for a more granular control over what the API - * returns. If the mask is not present all fields will be returned except - * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - * specified in the mask. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * Required. The location name. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The location name. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * `filter` can be used to specify a subset of queues. Any - * [Queue][google.cloud.tasks.v2beta3.Queue] field can be used as a filter and - * several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The - * filter syntax is the same as described in [Stackdriver's Advanced Logs - * Filters](https://cloud.google.com/logging/docs/view/advanced_filters). - * Sample filter "state: PAUSED". - * Note that using filters might cause fewer queues than the - * requested page_size to be returned. - * - * Generated from protobuf field string filter = 2; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * `filter` can be used to specify a subset of queues. Any - * [Queue][google.cloud.tasks.v2beta3.Queue] field can be used as a filter and - * several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The - * filter syntax is the same as described in [Stackdriver's Advanced Logs - * Filters](https://cloud.google.com/logging/docs/view/advanced_filters). - * Sample filter "state: PAUSED". - * Note that using filters might cause fewer queues than the - * requested page_size to be returned. - * - * Generated from protobuf field string filter = 2; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Requested page size. - * The maximum page size is 9800. If unspecified, the page size will - * be the maximum. Fewer queues than requested might be returned, - * even if more queues exist; use the - * [next_page_token][google.cloud.tasks.v2beta3.ListQueuesResponse.next_page_token] - * in the response to determine if more queues exist. - * - * Generated from protobuf field int32 page_size = 3; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Requested page size. - * The maximum page size is 9800. If unspecified, the page size will - * be the maximum. Fewer queues than requested might be returned, - * even if more queues exist; use the - * [next_page_token][google.cloud.tasks.v2beta3.ListQueuesResponse.next_page_token] - * in the response to determine if more queues exist. - * - * Generated from protobuf field int32 page_size = 3; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * A token identifying the page of results to return. - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * [next_page_token][google.cloud.tasks.v2beta3.ListQueuesResponse.next_page_token] - * returned from the previous call to - * [ListQueues][google.cloud.tasks.v2beta3.CloudTasks.ListQueues] method. It - * is an error to switch the value of the - * [filter][google.cloud.tasks.v2beta3.ListQueuesRequest.filter] while - * iterating through pages. - * - * Generated from protobuf field string page_token = 4; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A token identifying the page of results to return. - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * [next_page_token][google.cloud.tasks.v2beta3.ListQueuesResponse.next_page_token] - * returned from the previous call to - * [ListQueues][google.cloud.tasks.v2beta3.CloudTasks.ListQueues] method. It - * is an error to switch the value of the - * [filter][google.cloud.tasks.v2beta3.ListQueuesRequest.filter] while - * iterating through pages. - * - * Generated from protobuf field string page_token = 4; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * Optional. Read mask is used for a more granular control over what the API - * returns. If the mask is not present all fields will be returned except - * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - * specified in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask read_mask = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\FieldMask|null - */ - public function getReadMask() - { - return $this->read_mask; - } - - public function hasReadMask() - { - return isset($this->read_mask); - } - - public function clearReadMask() - { - unset($this->read_mask); - } - - /** - * Optional. Read mask is used for a more granular control over what the API - * returns. If the mask is not present all fields will be returned except - * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - * specified in the mask. - * - * Generated from protobuf field .google.protobuf.FieldMask read_mask = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setReadMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->read_mask = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ListQueuesResponse.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ListQueuesResponse.php deleted file mode 100644 index cf56f8b14ac2..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ListQueuesResponse.php +++ /dev/null @@ -1,126 +0,0 @@ -google.cloud.tasks.v2beta3.ListQueuesResponse - */ -class ListQueuesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of queues. - * - * Generated from protobuf field repeated .google.cloud.tasks.v2beta3.Queue queues = 1; - */ - private $queues; - /** - * A token to retrieve next page of results. - * To return the next page of results, call - * [ListQueues][google.cloud.tasks.v2beta3.CloudTasks.ListQueues] with this - * value as the - * [page_token][google.cloud.tasks.v2beta3.ListQueuesRequest.page_token]. - * If the next_page_token is empty, there are no more results. - * The page token is valid for only 2 hours. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Tasks\V2beta3\Queue>|\Google\Protobuf\Internal\RepeatedField $queues - * The list of queues. - * @type string $next_page_token - * A token to retrieve next page of results. - * To return the next page of results, call - * [ListQueues][google.cloud.tasks.v2beta3.CloudTasks.ListQueues] with this - * value as the - * [page_token][google.cloud.tasks.v2beta3.ListQueuesRequest.page_token]. - * If the next_page_token is empty, there are no more results. - * The page token is valid for only 2 hours. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * The list of queues. - * - * Generated from protobuf field repeated .google.cloud.tasks.v2beta3.Queue queues = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getQueues() - { - return $this->queues; - } - - /** - * The list of queues. - * - * Generated from protobuf field repeated .google.cloud.tasks.v2beta3.Queue queues = 1; - * @param array<\Google\Cloud\Tasks\V2beta3\Queue>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setQueues($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Tasks\V2beta3\Queue::class); - $this->queues = $arr; - - return $this; - } - - /** - * A token to retrieve next page of results. - * To return the next page of results, call - * [ListQueues][google.cloud.tasks.v2beta3.CloudTasks.ListQueues] with this - * value as the - * [page_token][google.cloud.tasks.v2beta3.ListQueuesRequest.page_token]. - * If the next_page_token is empty, there are no more results. - * The page token is valid for only 2 hours. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token to retrieve next page of results. - * To return the next page of results, call - * [ListQueues][google.cloud.tasks.v2beta3.CloudTasks.ListQueues] with this - * value as the - * [page_token][google.cloud.tasks.v2beta3.ListQueuesRequest.page_token]. - * If the next_page_token is empty, there are no more results. - * The page token is valid for only 2 hours. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ListTasksRequest.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ListTasksRequest.php deleted file mode 100644 index c3e901881b52..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ListTasksRequest.php +++ /dev/null @@ -1,258 +0,0 @@ -google.cloud.tasks.v2beta3.ListTasksRequest - */ -class ListTasksRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta3.Task] will be returned. - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta3.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.Task.View response_view = 2; - */ - protected $response_view = 0; - /** - * Maximum page size. - * Fewer tasks than requested might be returned, even if more tasks exist; use - * [next_page_token][google.cloud.tasks.v2beta3.ListTasksResponse.next_page_token] - * in the response to determine if more tasks exist. - * The maximum page size is 1000. If unspecified, the page size will be the - * maximum. - * - * Generated from protobuf field int32 page_size = 3; - */ - protected $page_size = 0; - /** - * A token identifying the page of results to return. - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * [next_page_token][google.cloud.tasks.v2beta3.ListTasksResponse.next_page_token] - * returned from the previous call to - * [ListTasks][google.cloud.tasks.v2beta3.CloudTasks.ListTasks] method. - * The page token is valid for only 2 hours. - * - * Generated from protobuf field string page_token = 4; - */ - protected $page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * @type int $response_view - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta3.Task] will be returned. - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta3.Task] resource. - * @type int $page_size - * Maximum page size. - * Fewer tasks than requested might be returned, even if more tasks exist; use - * [next_page_token][google.cloud.tasks.v2beta3.ListTasksResponse.next_page_token] - * in the response to determine if more tasks exist. - * The maximum page size is 1000. If unspecified, the page size will be the - * maximum. - * @type string $page_token - * A token identifying the page of results to return. - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * [next_page_token][google.cloud.tasks.v2beta3.ListTasksResponse.next_page_token] - * returned from the previous call to - * [ListTasks][google.cloud.tasks.v2beta3.CloudTasks.ListTasks] method. - * The page token is valid for only 2 hours. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta3.Task] will be returned. - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta3.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.Task.View response_view = 2; - * @return int - */ - public function getResponseView() - { - return $this->response_view; - } - - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta3.Task] will be returned. - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta3.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.Task.View response_view = 2; - * @param int $var - * @return $this - */ - public function setResponseView($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta3\Task\View::class); - $this->response_view = $var; - - return $this; - } - - /** - * Maximum page size. - * Fewer tasks than requested might be returned, even if more tasks exist; use - * [next_page_token][google.cloud.tasks.v2beta3.ListTasksResponse.next_page_token] - * in the response to determine if more tasks exist. - * The maximum page size is 1000. If unspecified, the page size will be the - * maximum. - * - * Generated from protobuf field int32 page_size = 3; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Maximum page size. - * Fewer tasks than requested might be returned, even if more tasks exist; use - * [next_page_token][google.cloud.tasks.v2beta3.ListTasksResponse.next_page_token] - * in the response to determine if more tasks exist. - * The maximum page size is 1000. If unspecified, the page size will be the - * maximum. - * - * Generated from protobuf field int32 page_size = 3; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * A token identifying the page of results to return. - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * [next_page_token][google.cloud.tasks.v2beta3.ListTasksResponse.next_page_token] - * returned from the previous call to - * [ListTasks][google.cloud.tasks.v2beta3.CloudTasks.ListTasks] method. - * The page token is valid for only 2 hours. - * - * Generated from protobuf field string page_token = 4; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A token identifying the page of results to return. - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * [next_page_token][google.cloud.tasks.v2beta3.ListTasksResponse.next_page_token] - * returned from the previous call to - * [ListTasks][google.cloud.tasks.v2beta3.CloudTasks.ListTasks] method. - * The page token is valid for only 2 hours. - * - * Generated from protobuf field string page_token = 4; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ListTasksResponse.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ListTasksResponse.php deleted file mode 100644 index f304ef62c9fa..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ListTasksResponse.php +++ /dev/null @@ -1,122 +0,0 @@ -google.cloud.tasks.v2beta3.ListTasksResponse - */ -class ListTasksResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of tasks. - * - * Generated from protobuf field repeated .google.cloud.tasks.v2beta3.Task tasks = 1; - */ - private $tasks; - /** - * A token to retrieve next page of results. - * To return the next page of results, call - * [ListTasks][google.cloud.tasks.v2beta3.CloudTasks.ListTasks] with this - * value as the - * [page_token][google.cloud.tasks.v2beta3.ListTasksRequest.page_token]. - * If the next_page_token is empty, there are no more results. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Tasks\V2beta3\Task>|\Google\Protobuf\Internal\RepeatedField $tasks - * The list of tasks. - * @type string $next_page_token - * A token to retrieve next page of results. - * To return the next page of results, call - * [ListTasks][google.cloud.tasks.v2beta3.CloudTasks.ListTasks] with this - * value as the - * [page_token][google.cloud.tasks.v2beta3.ListTasksRequest.page_token]. - * If the next_page_token is empty, there are no more results. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * The list of tasks. - * - * Generated from protobuf field repeated .google.cloud.tasks.v2beta3.Task tasks = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTasks() - { - return $this->tasks; - } - - /** - * The list of tasks. - * - * Generated from protobuf field repeated .google.cloud.tasks.v2beta3.Task tasks = 1; - * @param array<\Google\Cloud\Tasks\V2beta3\Task>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTasks($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Tasks\V2beta3\Task::class); - $this->tasks = $arr; - - return $this; - } - - /** - * A token to retrieve next page of results. - * To return the next page of results, call - * [ListTasks][google.cloud.tasks.v2beta3.CloudTasks.ListTasks] with this - * value as the - * [page_token][google.cloud.tasks.v2beta3.ListTasksRequest.page_token]. - * If the next_page_token is empty, there are no more results. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token to retrieve next page of results. - * To return the next page of results, call - * [ListTasks][google.cloud.tasks.v2beta3.CloudTasks.ListTasks] with this - * value as the - * [page_token][google.cloud.tasks.v2beta3.ListTasksRequest.page_token]. - * If the next_page_token is empty, there are no more results. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/OAuthToken.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/OAuthToken.php deleted file mode 100644 index 792276e9814c..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/OAuthToken.php +++ /dev/null @@ -1,128 +0,0 @@ -google.cloud.tasks.v2beta3.OAuthToken - */ -class OAuthToken extends \Google\Protobuf\Internal\Message -{ - /** - * [Service account email](https://cloud.google.com/iam/docs/service-accounts) - * to be used for generating OAuth token. - * The service account must be within the same project as the queue. The - * caller must have iam.serviceAccounts.actAs permission for the service - * account. - * - * Generated from protobuf field string service_account_email = 1; - */ - protected $service_account_email = ''; - /** - * OAuth scope to be used for generating OAuth access token. - * If not specified, "https://www.googleapis.com/auth/cloud-platform" - * will be used. - * - * Generated from protobuf field string scope = 2; - */ - protected $scope = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $service_account_email - * [Service account email](https://cloud.google.com/iam/docs/service-accounts) - * to be used for generating OAuth token. - * The service account must be within the same project as the queue. The - * caller must have iam.serviceAccounts.actAs permission for the service - * account. - * @type string $scope - * OAuth scope to be used for generating OAuth access token. - * If not specified, "https://www.googleapis.com/auth/cloud-platform" - * will be used. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Target::initOnce(); - parent::__construct($data); - } - - /** - * [Service account email](https://cloud.google.com/iam/docs/service-accounts) - * to be used for generating OAuth token. - * The service account must be within the same project as the queue. The - * caller must have iam.serviceAccounts.actAs permission for the service - * account. - * - * Generated from protobuf field string service_account_email = 1; - * @return string - */ - public function getServiceAccountEmail() - { - return $this->service_account_email; - } - - /** - * [Service account email](https://cloud.google.com/iam/docs/service-accounts) - * to be used for generating OAuth token. - * The service account must be within the same project as the queue. The - * caller must have iam.serviceAccounts.actAs permission for the service - * account. - * - * Generated from protobuf field string service_account_email = 1; - * @param string $var - * @return $this - */ - public function setServiceAccountEmail($var) - { - GPBUtil::checkString($var, True); - $this->service_account_email = $var; - - return $this; - } - - /** - * OAuth scope to be used for generating OAuth access token. - * If not specified, "https://www.googleapis.com/auth/cloud-platform" - * will be used. - * - * Generated from protobuf field string scope = 2; - * @return string - */ - public function getScope() - { - return $this->scope; - } - - /** - * OAuth scope to be used for generating OAuth access token. - * If not specified, "https://www.googleapis.com/auth/cloud-platform" - * will be used. - * - * Generated from protobuf field string scope = 2; - * @param string $var - * @return $this - */ - public function setScope($var) - { - GPBUtil::checkString($var, True); - $this->scope = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/OidcToken.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/OidcToken.php deleted file mode 100644 index 3a02f601f855..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/OidcToken.php +++ /dev/null @@ -1,126 +0,0 @@ -google.cloud.tasks.v2beta3.OidcToken - */ -class OidcToken extends \Google\Protobuf\Internal\Message -{ - /** - * [Service account email](https://cloud.google.com/iam/docs/service-accounts) - * to be used for generating OIDC token. - * The service account must be within the same project as the queue. The - * caller must have iam.serviceAccounts.actAs permission for the service - * account. - * - * Generated from protobuf field string service_account_email = 1; - */ - protected $service_account_email = ''; - /** - * Audience to be used when generating OIDC token. If not specified, the URI - * specified in target will be used. - * - * Generated from protobuf field string audience = 2; - */ - protected $audience = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $service_account_email - * [Service account email](https://cloud.google.com/iam/docs/service-accounts) - * to be used for generating OIDC token. - * The service account must be within the same project as the queue. The - * caller must have iam.serviceAccounts.actAs permission for the service - * account. - * @type string $audience - * Audience to be used when generating OIDC token. If not specified, the URI - * specified in target will be used. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Target::initOnce(); - parent::__construct($data); - } - - /** - * [Service account email](https://cloud.google.com/iam/docs/service-accounts) - * to be used for generating OIDC token. - * The service account must be within the same project as the queue. The - * caller must have iam.serviceAccounts.actAs permission for the service - * account. - * - * Generated from protobuf field string service_account_email = 1; - * @return string - */ - public function getServiceAccountEmail() - { - return $this->service_account_email; - } - - /** - * [Service account email](https://cloud.google.com/iam/docs/service-accounts) - * to be used for generating OIDC token. - * The service account must be within the same project as the queue. The - * caller must have iam.serviceAccounts.actAs permission for the service - * account. - * - * Generated from protobuf field string service_account_email = 1; - * @param string $var - * @return $this - */ - public function setServiceAccountEmail($var) - { - GPBUtil::checkString($var, True); - $this->service_account_email = $var; - - return $this; - } - - /** - * Audience to be used when generating OIDC token. If not specified, the URI - * specified in target will be used. - * - * Generated from protobuf field string audience = 2; - * @return string - */ - public function getAudience() - { - return $this->audience; - } - - /** - * Audience to be used when generating OIDC token. If not specified, the URI - * specified in target will be used. - * - * Generated from protobuf field string audience = 2; - * @param string $var - * @return $this - */ - public function setAudience($var) - { - GPBUtil::checkString($var, True); - $this->audience = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/PathOverride.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/PathOverride.php deleted file mode 100644 index 152a9f931481..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/PathOverride.php +++ /dev/null @@ -1,68 +0,0 @@ -google.cloud.tasks.v2beta3.PathOverride - */ -class PathOverride extends \Google\Protobuf\Internal\Message -{ - /** - * The URI path (e.g., /users/1234). Default is an empty string. - * - * Generated from protobuf field string path = 1; - */ - protected $path = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $path - * The URI path (e.g., /users/1234). Default is an empty string. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Target::initOnce(); - parent::__construct($data); - } - - /** - * The URI path (e.g., /users/1234). Default is an empty string. - * - * Generated from protobuf field string path = 1; - * @return string - */ - public function getPath() - { - return $this->path; - } - - /** - * The URI path (e.g., /users/1234). Default is an empty string. - * - * Generated from protobuf field string path = 1; - * @param string $var - * @return $this - */ - public function setPath($var) - { - GPBUtil::checkString($var, True); - $this->path = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/PauseQueueRequest.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/PauseQueueRequest.php deleted file mode 100644 index 574132cc393e..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/PauseQueueRequest.php +++ /dev/null @@ -1,72 +0,0 @@ -google.cloud.tasks.v2beta3.PauseQueueRequest - */ -class PauseQueueRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/PullMessage.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/PullMessage.php deleted file mode 100644 index b6d4df5107a3..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/PullMessage.php +++ /dev/null @@ -1,132 +0,0 @@ -google.cloud.tasks.v2beta3.PullMessage - */ -class PullMessage extends \Google\Protobuf\Internal\Message -{ - /** - * A data payload consumed by the worker to execute the task. - * - * Generated from protobuf field bytes payload = 1; - */ - protected $payload = ''; - /** - * The tasks's tag. - * The tag is less than 500 characters. - * SDK compatibility: Although the SDK allows tags to be either - * string or - * [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), - * only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8 - * encoded, the tag will be empty when the task is returned by Cloud Tasks. - * - * Generated from protobuf field string tag = 2; - */ - protected $tag = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $payload - * A data payload consumed by the worker to execute the task. - * @type string $tag - * The tasks's tag. - * The tag is less than 500 characters. - * SDK compatibility: Although the SDK allows tags to be either - * string or - * [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), - * only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8 - * encoded, the tag will be empty when the task is returned by Cloud Tasks. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Target::initOnce(); - parent::__construct($data); - } - - /** - * A data payload consumed by the worker to execute the task. - * - * Generated from protobuf field bytes payload = 1; - * @return string - */ - public function getPayload() - { - return $this->payload; - } - - /** - * A data payload consumed by the worker to execute the task. - * - * Generated from protobuf field bytes payload = 1; - * @param string $var - * @return $this - */ - public function setPayload($var) - { - GPBUtil::checkString($var, False); - $this->payload = $var; - - return $this; - } - - /** - * The tasks's tag. - * The tag is less than 500 characters. - * SDK compatibility: Although the SDK allows tags to be either - * string or - * [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), - * only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8 - * encoded, the tag will be empty when the task is returned by Cloud Tasks. - * - * Generated from protobuf field string tag = 2; - * @return string - */ - public function getTag() - { - return $this->tag; - } - - /** - * The tasks's tag. - * The tag is less than 500 characters. - * SDK compatibility: Although the SDK allows tags to be either - * string or - * [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), - * only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8 - * encoded, the tag will be empty when the task is returned by Cloud Tasks. - * - * Generated from protobuf field string tag = 2; - * @param string $var - * @return $this - */ - public function setTag($var) - { - GPBUtil::checkString($var, True); - $this->tag = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/PurgeQueueRequest.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/PurgeQueueRequest.php deleted file mode 100644 index 6ab84bcbdaa0..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/PurgeQueueRequest.php +++ /dev/null @@ -1,72 +0,0 @@ -google.cloud.tasks.v2beta3.PurgeQueueRequest - */ -class PurgeQueueRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/QueryOverride.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/QueryOverride.php deleted file mode 100644 index 7614b5722bbb..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/QueryOverride.php +++ /dev/null @@ -1,72 +0,0 @@ -google.cloud.tasks.v2beta3.QueryOverride - */ -class QueryOverride extends \Google\Protobuf\Internal\Message -{ - /** - * The query parameters (e.g., qparam1=123&qparam2=456). Default is an empty - * string. - * - * Generated from protobuf field string query_params = 1; - */ - protected $query_params = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $query_params - * The query parameters (e.g., qparam1=123&qparam2=456). Default is an empty - * string. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Target::initOnce(); - parent::__construct($data); - } - - /** - * The query parameters (e.g., qparam1=123&qparam2=456). Default is an empty - * string. - * - * Generated from protobuf field string query_params = 1; - * @return string - */ - public function getQueryParams() - { - return $this->query_params; - } - - /** - * The query parameters (e.g., qparam1=123&qparam2=456). Default is an empty - * string. - * - * Generated from protobuf field string query_params = 1; - * @param string $var - * @return $this - */ - public function setQueryParams($var) - { - GPBUtil::checkString($var, True); - $this->query_params = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Queue.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Queue.php deleted file mode 100644 index f670e0985645..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Queue.php +++ /dev/null @@ -1,883 +0,0 @@ -google.cloud.tasks.v2beta3.Queue - */ -class Queue extends \Google\Protobuf\Internal\Message -{ - /** - * Caller-specified and required in - * [CreateQueue][google.cloud.tasks.v2beta3.CloudTasks.CreateQueue], after - * which it becomes output only. - * The queue name. - * The queue name must have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - * hyphens (-), colons (:), or periods (.). - * For more information, see - * [Identifying - * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) - * * `LOCATION_ID` is the canonical ID for the queue's location. - * The list of available locations can be obtained by calling - * [ListLocations][google.cloud.location.Locations.ListLocations]. - * For more information, see https://cloud.google.com/about/locations/. - * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or - * hyphens (-). The maximum length is 100 characters. - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * Modifies HTTP target for HTTP tasks. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.HttpTarget http_target = 13; - */ - protected $http_target = null; - /** - * Rate limits for task dispatches. - * [rate_limits][google.cloud.tasks.v2beta3.Queue.rate_limits] and - * [retry_config][google.cloud.tasks.v2beta3.Queue.retry_config] are related - * because they both control task attempts. However they control task attempts - * in different ways: - * * [rate_limits][google.cloud.tasks.v2beta3.Queue.rate_limits] controls the - * total rate of - * dispatches from a queue (i.e. all traffic dispatched from the - * queue, regardless of whether the dispatch is from a first - * attempt or a retry). - * * [retry_config][google.cloud.tasks.v2beta3.Queue.retry_config] controls - * what happens to - * particular a task after its first attempt fails. That is, - * [retry_config][google.cloud.tasks.v2beta3.Queue.retry_config] controls - * task retries (the second attempt, third attempt, etc). - * The queue's actual dispatch rate is the result of: - * * Number of tasks in the queue - * * User-specified throttling: - * [rate_limits][google.cloud.tasks.v2beta3.Queue.rate_limits], - * [retry_config][google.cloud.tasks.v2beta3.Queue.retry_config], and the - * [queue's state][google.cloud.tasks.v2beta3.Queue.state]. - * * System throttling due to `429` (Too Many Requests) or `503` (Service - * Unavailable) responses from the worker, high error rates, or to smooth - * sudden large traffic spikes. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.RateLimits rate_limits = 4; - */ - protected $rate_limits = null; - /** - * Settings that determine the retry behavior. - * * For tasks created using Cloud Tasks: the queue-level retry settings - * apply to all tasks in the queue that were created using Cloud Tasks. - * Retry settings cannot be set on individual tasks. - * * For tasks created using the App Engine SDK: the queue-level retry - * settings apply to all tasks in the queue which do not have retry settings - * explicitly set on the task and were created by the App Engine SDK. See - * [App Engine - * documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks). - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.RetryConfig retry_config = 5; - */ - protected $retry_config = null; - /** - * Output only. The state of the queue. - * `state` can only be changed by called - * [PauseQueue][google.cloud.tasks.v2beta3.CloudTasks.PauseQueue], - * [ResumeQueue][google.cloud.tasks.v2beta3.CloudTasks.ResumeQueue], or - * uploading - * [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref). - * [UpdateQueue][google.cloud.tasks.v2beta3.CloudTasks.UpdateQueue] cannot be - * used to change `state`. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.Queue.State state = 6; - */ - protected $state = 0; - /** - * Output only. The last time this queue was purged. - * All tasks that were [created][google.cloud.tasks.v2beta3.Task.create_time] - * before this time were purged. - * A queue can be purged using - * [PurgeQueue][google.cloud.tasks.v2beta3.CloudTasks.PurgeQueue], the [App - * Engine Task Queue SDK, or the Cloud - * Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue). - * Purge time will be truncated to the nearest microsecond. Purge - * time will be unset if the queue has never been purged. - * - * Generated from protobuf field .google.protobuf.Timestamp purge_time = 7; - */ - protected $purge_time = null; - /** - * The maximum amount of time that a task will be retained in - * this queue. - * Queues created by Cloud Tasks have a default `task_ttl` of 31 days. - * After a task has lived for `task_ttl`, the task will be deleted - * regardless of whether it was dispatched or not. - * The `task_ttl` for queues created via queue.yaml/xml is equal to the - * maximum duration because there is a - * [storage quota](https://cloud.google.com/appengine/quotas#Task_Queue) for - * these queues. To view the maximum valid duration, see the documentation for - * [Duration][google.protobuf.Duration]. - * - * Generated from protobuf field .google.protobuf.Duration task_ttl = 8; - */ - protected $task_ttl = null; - /** - * The task tombstone time to live (TTL). - * After a task is deleted or executed, the task's tombstone is - * retained for the length of time specified by `tombstone_ttl`. - * The tombstone is used by task de-duplication; another task with the same - * name can't be created until the tombstone has expired. For more information - * about task de-duplication, see the documentation for - * [CreateTaskRequest][google.cloud.tasks.v2beta3.CreateTaskRequest.task]. - * Queues created by Cloud Tasks have a default `tombstone_ttl` of 1 hour. - * - * Generated from protobuf field .google.protobuf.Duration tombstone_ttl = 9; - */ - protected $tombstone_ttl = null; - /** - * Configuration options for writing logs to - * [Stackdriver Logging](https://cloud.google.com/logging/docs/). If this - * field is unset, then no logs are written. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.StackdriverLoggingConfig stackdriver_logging_config = 10; - */ - protected $stackdriver_logging_config = null; - /** - * Immutable. The type of a queue (push or pull). - * `Queue.type` is an immutable property of the queue that is set at the queue - * creation time. When left unspecified, the default value of `PUSH` is - * selected. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.Queue.Type type = 11 [(.google.api.field_behavior) = IMMUTABLE]; - */ - protected $type = 0; - /** - * Output only. The realtime, informational statistics for a queue. In order - * to receive the statistics the caller should include this field in the - * FieldMask. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.QueueStats stats = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $stats = null; - protected $queue_type; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Caller-specified and required in - * [CreateQueue][google.cloud.tasks.v2beta3.CloudTasks.CreateQueue], after - * which it becomes output only. - * The queue name. - * The queue name must have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - * hyphens (-), colons (:), or periods (.). - * For more information, see - * [Identifying - * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) - * * `LOCATION_ID` is the canonical ID for the queue's location. - * The list of available locations can be obtained by calling - * [ListLocations][google.cloud.location.Locations.ListLocations]. - * For more information, see https://cloud.google.com/about/locations/. - * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or - * hyphens (-). The maximum length is 100 characters. - * @type \Google\Cloud\Tasks\V2beta3\AppEngineHttpQueue $app_engine_http_queue - * [AppEngineHttpQueue][google.cloud.tasks.v2beta3.AppEngineHttpQueue] - * settings apply only to [App Engine - * tasks][google.cloud.tasks.v2beta3.AppEngineHttpRequest] in this queue. - * [Http tasks][google.cloud.tasks.v2beta3.HttpRequest] are not affected by - * this proto. - * @type \Google\Cloud\Tasks\V2beta3\HttpTarget $http_target - * Modifies HTTP target for HTTP tasks. - * @type \Google\Cloud\Tasks\V2beta3\RateLimits $rate_limits - * Rate limits for task dispatches. - * [rate_limits][google.cloud.tasks.v2beta3.Queue.rate_limits] and - * [retry_config][google.cloud.tasks.v2beta3.Queue.retry_config] are related - * because they both control task attempts. However they control task attempts - * in different ways: - * * [rate_limits][google.cloud.tasks.v2beta3.Queue.rate_limits] controls the - * total rate of - * dispatches from a queue (i.e. all traffic dispatched from the - * queue, regardless of whether the dispatch is from a first - * attempt or a retry). - * * [retry_config][google.cloud.tasks.v2beta3.Queue.retry_config] controls - * what happens to - * particular a task after its first attempt fails. That is, - * [retry_config][google.cloud.tasks.v2beta3.Queue.retry_config] controls - * task retries (the second attempt, third attempt, etc). - * The queue's actual dispatch rate is the result of: - * * Number of tasks in the queue - * * User-specified throttling: - * [rate_limits][google.cloud.tasks.v2beta3.Queue.rate_limits], - * [retry_config][google.cloud.tasks.v2beta3.Queue.retry_config], and the - * [queue's state][google.cloud.tasks.v2beta3.Queue.state]. - * * System throttling due to `429` (Too Many Requests) or `503` (Service - * Unavailable) responses from the worker, high error rates, or to smooth - * sudden large traffic spikes. - * @type \Google\Cloud\Tasks\V2beta3\RetryConfig $retry_config - * Settings that determine the retry behavior. - * * For tasks created using Cloud Tasks: the queue-level retry settings - * apply to all tasks in the queue that were created using Cloud Tasks. - * Retry settings cannot be set on individual tasks. - * * For tasks created using the App Engine SDK: the queue-level retry - * settings apply to all tasks in the queue which do not have retry settings - * explicitly set on the task and were created by the App Engine SDK. See - * [App Engine - * documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks). - * @type int $state - * Output only. The state of the queue. - * `state` can only be changed by called - * [PauseQueue][google.cloud.tasks.v2beta3.CloudTasks.PauseQueue], - * [ResumeQueue][google.cloud.tasks.v2beta3.CloudTasks.ResumeQueue], or - * uploading - * [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref). - * [UpdateQueue][google.cloud.tasks.v2beta3.CloudTasks.UpdateQueue] cannot be - * used to change `state`. - * @type \Google\Protobuf\Timestamp $purge_time - * Output only. The last time this queue was purged. - * All tasks that were [created][google.cloud.tasks.v2beta3.Task.create_time] - * before this time were purged. - * A queue can be purged using - * [PurgeQueue][google.cloud.tasks.v2beta3.CloudTasks.PurgeQueue], the [App - * Engine Task Queue SDK, or the Cloud - * Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue). - * Purge time will be truncated to the nearest microsecond. Purge - * time will be unset if the queue has never been purged. - * @type \Google\Protobuf\Duration $task_ttl - * The maximum amount of time that a task will be retained in - * this queue. - * Queues created by Cloud Tasks have a default `task_ttl` of 31 days. - * After a task has lived for `task_ttl`, the task will be deleted - * regardless of whether it was dispatched or not. - * The `task_ttl` for queues created via queue.yaml/xml is equal to the - * maximum duration because there is a - * [storage quota](https://cloud.google.com/appengine/quotas#Task_Queue) for - * these queues. To view the maximum valid duration, see the documentation for - * [Duration][google.protobuf.Duration]. - * @type \Google\Protobuf\Duration $tombstone_ttl - * The task tombstone time to live (TTL). - * After a task is deleted or executed, the task's tombstone is - * retained for the length of time specified by `tombstone_ttl`. - * The tombstone is used by task de-duplication; another task with the same - * name can't be created until the tombstone has expired. For more information - * about task de-duplication, see the documentation for - * [CreateTaskRequest][google.cloud.tasks.v2beta3.CreateTaskRequest.task]. - * Queues created by Cloud Tasks have a default `tombstone_ttl` of 1 hour. - * @type \Google\Cloud\Tasks\V2beta3\StackdriverLoggingConfig $stackdriver_logging_config - * Configuration options for writing logs to - * [Stackdriver Logging](https://cloud.google.com/logging/docs/). If this - * field is unset, then no logs are written. - * @type int $type - * Immutable. The type of a queue (push or pull). - * `Queue.type` is an immutable property of the queue that is set at the queue - * creation time. When left unspecified, the default value of `PUSH` is - * selected. - * @type \Google\Cloud\Tasks\V2beta3\QueueStats $stats - * Output only. The realtime, informational statistics for a queue. In order - * to receive the statistics the caller should include this field in the - * FieldMask. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Queue::initOnce(); - parent::__construct($data); - } - - /** - * Caller-specified and required in - * [CreateQueue][google.cloud.tasks.v2beta3.CloudTasks.CreateQueue], after - * which it becomes output only. - * The queue name. - * The queue name must have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - * hyphens (-), colons (:), or periods (.). - * For more information, see - * [Identifying - * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) - * * `LOCATION_ID` is the canonical ID for the queue's location. - * The list of available locations can be obtained by calling - * [ListLocations][google.cloud.location.Locations.ListLocations]. - * For more information, see https://cloud.google.com/about/locations/. - * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or - * hyphens (-). The maximum length is 100 characters. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Caller-specified and required in - * [CreateQueue][google.cloud.tasks.v2beta3.CloudTasks.CreateQueue], after - * which it becomes output only. - * The queue name. - * The queue name must have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - * hyphens (-), colons (:), or periods (.). - * For more information, see - * [Identifying - * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) - * * `LOCATION_ID` is the canonical ID for the queue's location. - * The list of available locations can be obtained by calling - * [ListLocations][google.cloud.location.Locations.ListLocations]. - * For more information, see https://cloud.google.com/about/locations/. - * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or - * hyphens (-). The maximum length is 100 characters. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * [AppEngineHttpQueue][google.cloud.tasks.v2beta3.AppEngineHttpQueue] - * settings apply only to [App Engine - * tasks][google.cloud.tasks.v2beta3.AppEngineHttpRequest] in this queue. - * [Http tasks][google.cloud.tasks.v2beta3.HttpRequest] are not affected by - * this proto. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.AppEngineHttpQueue app_engine_http_queue = 3; - * @return \Google\Cloud\Tasks\V2beta3\AppEngineHttpQueue|null - */ - public function getAppEngineHttpQueue() - { - return $this->readOneof(3); - } - - public function hasAppEngineHttpQueue() - { - return $this->hasOneof(3); - } - - /** - * [AppEngineHttpQueue][google.cloud.tasks.v2beta3.AppEngineHttpQueue] - * settings apply only to [App Engine - * tasks][google.cloud.tasks.v2beta3.AppEngineHttpRequest] in this queue. - * [Http tasks][google.cloud.tasks.v2beta3.HttpRequest] are not affected by - * this proto. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.AppEngineHttpQueue app_engine_http_queue = 3; - * @param \Google\Cloud\Tasks\V2beta3\AppEngineHttpQueue $var - * @return $this - */ - public function setAppEngineHttpQueue($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\AppEngineHttpQueue::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Modifies HTTP target for HTTP tasks. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.HttpTarget http_target = 13; - * @return \Google\Cloud\Tasks\V2beta3\HttpTarget|null - */ - public function getHttpTarget() - { - return $this->http_target; - } - - public function hasHttpTarget() - { - return isset($this->http_target); - } - - public function clearHttpTarget() - { - unset($this->http_target); - } - - /** - * Modifies HTTP target for HTTP tasks. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.HttpTarget http_target = 13; - * @param \Google\Cloud\Tasks\V2beta3\HttpTarget $var - * @return $this - */ - public function setHttpTarget($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\HttpTarget::class); - $this->http_target = $var; - - return $this; - } - - /** - * Rate limits for task dispatches. - * [rate_limits][google.cloud.tasks.v2beta3.Queue.rate_limits] and - * [retry_config][google.cloud.tasks.v2beta3.Queue.retry_config] are related - * because they both control task attempts. However they control task attempts - * in different ways: - * * [rate_limits][google.cloud.tasks.v2beta3.Queue.rate_limits] controls the - * total rate of - * dispatches from a queue (i.e. all traffic dispatched from the - * queue, regardless of whether the dispatch is from a first - * attempt or a retry). - * * [retry_config][google.cloud.tasks.v2beta3.Queue.retry_config] controls - * what happens to - * particular a task after its first attempt fails. That is, - * [retry_config][google.cloud.tasks.v2beta3.Queue.retry_config] controls - * task retries (the second attempt, third attempt, etc). - * The queue's actual dispatch rate is the result of: - * * Number of tasks in the queue - * * User-specified throttling: - * [rate_limits][google.cloud.tasks.v2beta3.Queue.rate_limits], - * [retry_config][google.cloud.tasks.v2beta3.Queue.retry_config], and the - * [queue's state][google.cloud.tasks.v2beta3.Queue.state]. - * * System throttling due to `429` (Too Many Requests) or `503` (Service - * Unavailable) responses from the worker, high error rates, or to smooth - * sudden large traffic spikes. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.RateLimits rate_limits = 4; - * @return \Google\Cloud\Tasks\V2beta3\RateLimits|null - */ - public function getRateLimits() - { - return $this->rate_limits; - } - - public function hasRateLimits() - { - return isset($this->rate_limits); - } - - public function clearRateLimits() - { - unset($this->rate_limits); - } - - /** - * Rate limits for task dispatches. - * [rate_limits][google.cloud.tasks.v2beta3.Queue.rate_limits] and - * [retry_config][google.cloud.tasks.v2beta3.Queue.retry_config] are related - * because they both control task attempts. However they control task attempts - * in different ways: - * * [rate_limits][google.cloud.tasks.v2beta3.Queue.rate_limits] controls the - * total rate of - * dispatches from a queue (i.e. all traffic dispatched from the - * queue, regardless of whether the dispatch is from a first - * attempt or a retry). - * * [retry_config][google.cloud.tasks.v2beta3.Queue.retry_config] controls - * what happens to - * particular a task after its first attempt fails. That is, - * [retry_config][google.cloud.tasks.v2beta3.Queue.retry_config] controls - * task retries (the second attempt, third attempt, etc). - * The queue's actual dispatch rate is the result of: - * * Number of tasks in the queue - * * User-specified throttling: - * [rate_limits][google.cloud.tasks.v2beta3.Queue.rate_limits], - * [retry_config][google.cloud.tasks.v2beta3.Queue.retry_config], and the - * [queue's state][google.cloud.tasks.v2beta3.Queue.state]. - * * System throttling due to `429` (Too Many Requests) or `503` (Service - * Unavailable) responses from the worker, high error rates, or to smooth - * sudden large traffic spikes. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.RateLimits rate_limits = 4; - * @param \Google\Cloud\Tasks\V2beta3\RateLimits $var - * @return $this - */ - public function setRateLimits($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\RateLimits::class); - $this->rate_limits = $var; - - return $this; - } - - /** - * Settings that determine the retry behavior. - * * For tasks created using Cloud Tasks: the queue-level retry settings - * apply to all tasks in the queue that were created using Cloud Tasks. - * Retry settings cannot be set on individual tasks. - * * For tasks created using the App Engine SDK: the queue-level retry - * settings apply to all tasks in the queue which do not have retry settings - * explicitly set on the task and were created by the App Engine SDK. See - * [App Engine - * documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks). - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.RetryConfig retry_config = 5; - * @return \Google\Cloud\Tasks\V2beta3\RetryConfig|null - */ - public function getRetryConfig() - { - return $this->retry_config; - } - - public function hasRetryConfig() - { - return isset($this->retry_config); - } - - public function clearRetryConfig() - { - unset($this->retry_config); - } - - /** - * Settings that determine the retry behavior. - * * For tasks created using Cloud Tasks: the queue-level retry settings - * apply to all tasks in the queue that were created using Cloud Tasks. - * Retry settings cannot be set on individual tasks. - * * For tasks created using the App Engine SDK: the queue-level retry - * settings apply to all tasks in the queue which do not have retry settings - * explicitly set on the task and were created by the App Engine SDK. See - * [App Engine - * documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks). - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.RetryConfig retry_config = 5; - * @param \Google\Cloud\Tasks\V2beta3\RetryConfig $var - * @return $this - */ - public function setRetryConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\RetryConfig::class); - $this->retry_config = $var; - - return $this; - } - - /** - * Output only. The state of the queue. - * `state` can only be changed by called - * [PauseQueue][google.cloud.tasks.v2beta3.CloudTasks.PauseQueue], - * [ResumeQueue][google.cloud.tasks.v2beta3.CloudTasks.ResumeQueue], or - * uploading - * [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref). - * [UpdateQueue][google.cloud.tasks.v2beta3.CloudTasks.UpdateQueue] cannot be - * used to change `state`. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.Queue.State state = 6; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The state of the queue. - * `state` can only be changed by called - * [PauseQueue][google.cloud.tasks.v2beta3.CloudTasks.PauseQueue], - * [ResumeQueue][google.cloud.tasks.v2beta3.CloudTasks.ResumeQueue], or - * uploading - * [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref). - * [UpdateQueue][google.cloud.tasks.v2beta3.CloudTasks.UpdateQueue] cannot be - * used to change `state`. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.Queue.State state = 6; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta3\Queue\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. The last time this queue was purged. - * All tasks that were [created][google.cloud.tasks.v2beta3.Task.create_time] - * before this time were purged. - * A queue can be purged using - * [PurgeQueue][google.cloud.tasks.v2beta3.CloudTasks.PurgeQueue], the [App - * Engine Task Queue SDK, or the Cloud - * Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue). - * Purge time will be truncated to the nearest microsecond. Purge - * time will be unset if the queue has never been purged. - * - * Generated from protobuf field .google.protobuf.Timestamp purge_time = 7; - * @return \Google\Protobuf\Timestamp|null - */ - public function getPurgeTime() - { - return $this->purge_time; - } - - public function hasPurgeTime() - { - return isset($this->purge_time); - } - - public function clearPurgeTime() - { - unset($this->purge_time); - } - - /** - * Output only. The last time this queue was purged. - * All tasks that were [created][google.cloud.tasks.v2beta3.Task.create_time] - * before this time were purged. - * A queue can be purged using - * [PurgeQueue][google.cloud.tasks.v2beta3.CloudTasks.PurgeQueue], the [App - * Engine Task Queue SDK, or the Cloud - * Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue). - * Purge time will be truncated to the nearest microsecond. Purge - * time will be unset if the queue has never been purged. - * - * Generated from protobuf field .google.protobuf.Timestamp purge_time = 7; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setPurgeTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->purge_time = $var; - - return $this; - } - - /** - * The maximum amount of time that a task will be retained in - * this queue. - * Queues created by Cloud Tasks have a default `task_ttl` of 31 days. - * After a task has lived for `task_ttl`, the task will be deleted - * regardless of whether it was dispatched or not. - * The `task_ttl` for queues created via queue.yaml/xml is equal to the - * maximum duration because there is a - * [storage quota](https://cloud.google.com/appengine/quotas#Task_Queue) for - * these queues. To view the maximum valid duration, see the documentation for - * [Duration][google.protobuf.Duration]. - * - * Generated from protobuf field .google.protobuf.Duration task_ttl = 8; - * @return \Google\Protobuf\Duration|null - */ - public function getTaskTtl() - { - return $this->task_ttl; - } - - public function hasTaskTtl() - { - return isset($this->task_ttl); - } - - public function clearTaskTtl() - { - unset($this->task_ttl); - } - - /** - * The maximum amount of time that a task will be retained in - * this queue. - * Queues created by Cloud Tasks have a default `task_ttl` of 31 days. - * After a task has lived for `task_ttl`, the task will be deleted - * regardless of whether it was dispatched or not. - * The `task_ttl` for queues created via queue.yaml/xml is equal to the - * maximum duration because there is a - * [storage quota](https://cloud.google.com/appengine/quotas#Task_Queue) for - * these queues. To view the maximum valid duration, see the documentation for - * [Duration][google.protobuf.Duration]. - * - * Generated from protobuf field .google.protobuf.Duration task_ttl = 8; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setTaskTtl($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->task_ttl = $var; - - return $this; - } - - /** - * The task tombstone time to live (TTL). - * After a task is deleted or executed, the task's tombstone is - * retained for the length of time specified by `tombstone_ttl`. - * The tombstone is used by task de-duplication; another task with the same - * name can't be created until the tombstone has expired. For more information - * about task de-duplication, see the documentation for - * [CreateTaskRequest][google.cloud.tasks.v2beta3.CreateTaskRequest.task]. - * Queues created by Cloud Tasks have a default `tombstone_ttl` of 1 hour. - * - * Generated from protobuf field .google.protobuf.Duration tombstone_ttl = 9; - * @return \Google\Protobuf\Duration|null - */ - public function getTombstoneTtl() - { - return $this->tombstone_ttl; - } - - public function hasTombstoneTtl() - { - return isset($this->tombstone_ttl); - } - - public function clearTombstoneTtl() - { - unset($this->tombstone_ttl); - } - - /** - * The task tombstone time to live (TTL). - * After a task is deleted or executed, the task's tombstone is - * retained for the length of time specified by `tombstone_ttl`. - * The tombstone is used by task de-duplication; another task with the same - * name can't be created until the tombstone has expired. For more information - * about task de-duplication, see the documentation for - * [CreateTaskRequest][google.cloud.tasks.v2beta3.CreateTaskRequest.task]. - * Queues created by Cloud Tasks have a default `tombstone_ttl` of 1 hour. - * - * Generated from protobuf field .google.protobuf.Duration tombstone_ttl = 9; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setTombstoneTtl($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->tombstone_ttl = $var; - - return $this; - } - - /** - * Configuration options for writing logs to - * [Stackdriver Logging](https://cloud.google.com/logging/docs/). If this - * field is unset, then no logs are written. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.StackdriverLoggingConfig stackdriver_logging_config = 10; - * @return \Google\Cloud\Tasks\V2beta3\StackdriverLoggingConfig|null - */ - public function getStackdriverLoggingConfig() - { - return $this->stackdriver_logging_config; - } - - public function hasStackdriverLoggingConfig() - { - return isset($this->stackdriver_logging_config); - } - - public function clearStackdriverLoggingConfig() - { - unset($this->stackdriver_logging_config); - } - - /** - * Configuration options for writing logs to - * [Stackdriver Logging](https://cloud.google.com/logging/docs/). If this - * field is unset, then no logs are written. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.StackdriverLoggingConfig stackdriver_logging_config = 10; - * @param \Google\Cloud\Tasks\V2beta3\StackdriverLoggingConfig $var - * @return $this - */ - public function setStackdriverLoggingConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\StackdriverLoggingConfig::class); - $this->stackdriver_logging_config = $var; - - return $this; - } - - /** - * Immutable. The type of a queue (push or pull). - * `Queue.type` is an immutable property of the queue that is set at the queue - * creation time. When left unspecified, the default value of `PUSH` is - * selected. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.Queue.Type type = 11 [(.google.api.field_behavior) = IMMUTABLE]; - * @return int - */ - public function getType() - { - return $this->type; - } - - /** - * Immutable. The type of a queue (push or pull). - * `Queue.type` is an immutable property of the queue that is set at the queue - * creation time. When left unspecified, the default value of `PUSH` is - * selected. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.Queue.Type type = 11 [(.google.api.field_behavior) = IMMUTABLE]; - * @param int $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta3\Queue\Type::class); - $this->type = $var; - - return $this; - } - - /** - * Output only. The realtime, informational statistics for a queue. In order - * to receive the statistics the caller should include this field in the - * FieldMask. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.QueueStats stats = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Tasks\V2beta3\QueueStats|null - */ - public function getStats() - { - return $this->stats; - } - - public function hasStats() - { - return isset($this->stats); - } - - public function clearStats() - { - unset($this->stats); - } - - /** - * Output only. The realtime, informational statistics for a queue. In order - * to receive the statistics the caller should include this field in the - * FieldMask. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.QueueStats stats = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Tasks\V2beta3\QueueStats $var - * @return $this - */ - public function setStats($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\QueueStats::class); - $this->stats = $var; - - return $this; - } - - /** - * @return string - */ - public function getQueueType() - { - return $this->whichOneof("queue_type"); - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Queue/State.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Queue/State.php deleted file mode 100644 index 74d486e2a300..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Queue/State.php +++ /dev/null @@ -1,89 +0,0 @@ -google.cloud.tasks.v2beta3.Queue.State - */ -class State -{ - /** - * Unspecified state. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The queue is running. Tasks can be dispatched. - * If the queue was created using Cloud Tasks and the queue has - * had no activity (method calls or task dispatches) for 30 days, - * the queue may take a few minutes to re-activate. Some method - * calls may return [NOT_FOUND][google.rpc.Code.NOT_FOUND] and - * tasks may not be dispatched for a few minutes until the queue - * has been re-activated. - * - * Generated from protobuf enum RUNNING = 1; - */ - const RUNNING = 1; - /** - * Tasks are paused by the user. If the queue is paused then Cloud - * Tasks will stop delivering tasks from it, but more tasks can - * still be added to it by the user. - * - * Generated from protobuf enum PAUSED = 2; - */ - const PAUSED = 2; - /** - * The queue is disabled. - * A queue becomes `DISABLED` when - * [queue.yaml](https://cloud.google.com/appengine/docs/python/config/queueref) - * or - * [queue.xml](https://cloud.google.com/appengine/docs/standard/java/config/queueref) - * is uploaded which does not contain the queue. You cannot directly disable - * a queue. - * When a queue is disabled, tasks can still be added to a queue - * but the tasks are not dispatched. - * To permanently delete this queue and all of its tasks, call - * [DeleteQueue][google.cloud.tasks.v2beta3.CloudTasks.DeleteQueue]. - * - * Generated from protobuf enum DISABLED = 3; - */ - const DISABLED = 3; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::RUNNING => 'RUNNING', - self::PAUSED => 'PAUSED', - self::DISABLED => 'DISABLED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Tasks\V2beta3\Queue_State::class); - diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Queue/Type.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Queue/Type.php deleted file mode 100644 index 289c58b4f926..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Queue/Type.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.tasks.v2beta3.Queue.Type - */ -class Type -{ - /** - * Default value. - * - * Generated from protobuf enum TYPE_UNSPECIFIED = 0; - */ - const TYPE_UNSPECIFIED = 0; - /** - * A pull queue. - * - * Generated from protobuf enum PULL = 1; - */ - const PULL = 1; - /** - * A push queue. - * - * Generated from protobuf enum PUSH = 2; - */ - const PUSH = 2; - - private static $valueToName = [ - self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', - self::PULL => 'PULL', - self::PUSH => 'PUSH', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Type::class, \Google\Cloud\Tasks\V2beta3\Queue_Type::class); - diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/QueueStats.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/QueueStats.php deleted file mode 100644 index a02919639558..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/QueueStats.php +++ /dev/null @@ -1,253 +0,0 @@ -google.cloud.tasks.v2beta3.QueueStats - */ -class QueueStats extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. An estimation of the number of tasks in the queue, that is, - * the tasks in the queue that haven't been executed, the tasks in the queue - * which the queue has dispatched but has not yet received a reply for, and - * the failed tasks that the queue is retrying. - * - * Generated from protobuf field int64 tasks_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $tasks_count = 0; - /** - * Output only. An estimation of the nearest time in the future where a task - * in the queue is scheduled to be executed. - * - * Generated from protobuf field .google.protobuf.Timestamp oldest_estimated_arrival_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $oldest_estimated_arrival_time = null; - /** - * Output only. The number of tasks that the queue has dispatched and received - * a reply for during the last minute. This variable counts both successful - * and non-successful executions. - * - * Generated from protobuf field int64 executed_last_minute_count = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $executed_last_minute_count = 0; - /** - * Output only. The number of requests that the queue has dispatched but has - * not received a reply for yet. - * - * Generated from protobuf field int64 concurrent_dispatches_count = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $concurrent_dispatches_count = 0; - /** - * Output only. The current maximum number of tasks per second executed by the - * queue. The maximum value of this variable is controlled by the RateLimits - * of the Queue. However, this value could be less to avoid overloading the - * endpoints tasks in the queue are targeting. - * - * Generated from protobuf field double effective_execution_rate = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $effective_execution_rate = 0.0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int|string $tasks_count - * Output only. An estimation of the number of tasks in the queue, that is, - * the tasks in the queue that haven't been executed, the tasks in the queue - * which the queue has dispatched but has not yet received a reply for, and - * the failed tasks that the queue is retrying. - * @type \Google\Protobuf\Timestamp $oldest_estimated_arrival_time - * Output only. An estimation of the nearest time in the future where a task - * in the queue is scheduled to be executed. - * @type int|string $executed_last_minute_count - * Output only. The number of tasks that the queue has dispatched and received - * a reply for during the last minute. This variable counts both successful - * and non-successful executions. - * @type int|string $concurrent_dispatches_count - * Output only. The number of requests that the queue has dispatched but has - * not received a reply for yet. - * @type float $effective_execution_rate - * Output only. The current maximum number of tasks per second executed by the - * queue. The maximum value of this variable is controlled by the RateLimits - * of the Queue. However, this value could be less to avoid overloading the - * endpoints tasks in the queue are targeting. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Queue::initOnce(); - parent::__construct($data); - } - - /** - * Output only. An estimation of the number of tasks in the queue, that is, - * the tasks in the queue that haven't been executed, the tasks in the queue - * which the queue has dispatched but has not yet received a reply for, and - * the failed tasks that the queue is retrying. - * - * Generated from protobuf field int64 tasks_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int|string - */ - public function getTasksCount() - { - return $this->tasks_count; - } - - /** - * Output only. An estimation of the number of tasks in the queue, that is, - * the tasks in the queue that haven't been executed, the tasks in the queue - * which the queue has dispatched but has not yet received a reply for, and - * the failed tasks that the queue is retrying. - * - * Generated from protobuf field int64 tasks_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int|string $var - * @return $this - */ - public function setTasksCount($var) - { - GPBUtil::checkInt64($var); - $this->tasks_count = $var; - - return $this; - } - - /** - * Output only. An estimation of the nearest time in the future where a task - * in the queue is scheduled to be executed. - * - * Generated from protobuf field .google.protobuf.Timestamp oldest_estimated_arrival_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getOldestEstimatedArrivalTime() - { - return $this->oldest_estimated_arrival_time; - } - - public function hasOldestEstimatedArrivalTime() - { - return isset($this->oldest_estimated_arrival_time); - } - - public function clearOldestEstimatedArrivalTime() - { - unset($this->oldest_estimated_arrival_time); - } - - /** - * Output only. An estimation of the nearest time in the future where a task - * in the queue is scheduled to be executed. - * - * Generated from protobuf field .google.protobuf.Timestamp oldest_estimated_arrival_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setOldestEstimatedArrivalTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->oldest_estimated_arrival_time = $var; - - return $this; - } - - /** - * Output only. The number of tasks that the queue has dispatched and received - * a reply for during the last minute. This variable counts both successful - * and non-successful executions. - * - * Generated from protobuf field int64 executed_last_minute_count = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int|string - */ - public function getExecutedLastMinuteCount() - { - return $this->executed_last_minute_count; - } - - /** - * Output only. The number of tasks that the queue has dispatched and received - * a reply for during the last minute. This variable counts both successful - * and non-successful executions. - * - * Generated from protobuf field int64 executed_last_minute_count = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int|string $var - * @return $this - */ - public function setExecutedLastMinuteCount($var) - { - GPBUtil::checkInt64($var); - $this->executed_last_minute_count = $var; - - return $this; - } - - /** - * Output only. The number of requests that the queue has dispatched but has - * not received a reply for yet. - * - * Generated from protobuf field int64 concurrent_dispatches_count = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int|string - */ - public function getConcurrentDispatchesCount() - { - return $this->concurrent_dispatches_count; - } - - /** - * Output only. The number of requests that the queue has dispatched but has - * not received a reply for yet. - * - * Generated from protobuf field int64 concurrent_dispatches_count = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int|string $var - * @return $this - */ - public function setConcurrentDispatchesCount($var) - { - GPBUtil::checkInt64($var); - $this->concurrent_dispatches_count = $var; - - return $this; - } - - /** - * Output only. The current maximum number of tasks per second executed by the - * queue. The maximum value of this variable is controlled by the RateLimits - * of the Queue. However, this value could be less to avoid overloading the - * endpoints tasks in the queue are targeting. - * - * Generated from protobuf field double effective_execution_rate = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return float - */ - public function getEffectiveExecutionRate() - { - return $this->effective_execution_rate; - } - - /** - * Output only. The current maximum number of tasks per second executed by the - * queue. The maximum value of this variable is controlled by the RateLimits - * of the Queue. However, this value could be less to avoid overloading the - * endpoints tasks in the queue are targeting. - * - * Generated from protobuf field double effective_execution_rate = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param float $var - * @return $this - */ - public function setEffectiveExecutionRate($var) - { - GPBUtil::checkDouble($var); - $this->effective_execution_rate = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/RateLimits.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/RateLimits.php deleted file mode 100644 index 9e87d52e942a..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/RateLimits.php +++ /dev/null @@ -1,317 +0,0 @@ -google.cloud.tasks.v2beta3.RateLimits - */ -class RateLimits extends \Google\Protobuf\Internal\Message -{ - /** - * The maximum rate at which tasks are dispatched from this queue. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * * For [App Engine queues][google.cloud.tasks.v2beta3.AppEngineHttpQueue], - * the maximum allowed value - * is 500. - * This field has the same meaning as - * [rate in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate). - * - * Generated from protobuf field double max_dispatches_per_second = 1; - */ - protected $max_dispatches_per_second = 0.0; - /** - * The max burst size. - * Max burst size limits how fast tasks in queue are processed when - * many tasks are in the queue and the rate is high. This field - * allows the queue to have a high rate so processing starts shortly - * after a task is enqueued, but still limits resource usage when - * many tasks are enqueued in a short period of time. - * The [token bucket](https://wikipedia.org/wiki/Token_Bucket) - * algorithm is used to control the rate of task dispatches. Each - * queue has a token bucket that holds tokens, up to the maximum - * specified by `max_burst_size`. Each time a task is dispatched, a - * token is removed from the bucket. Tasks will be dispatched until - * the queue's bucket runs out of tokens. The bucket will be - * continuously refilled with new tokens based on - * [max_dispatches_per_second][google.cloud.tasks.v2beta3.RateLimits.max_dispatches_per_second]. - * The default value of `max_burst_size` is picked by Cloud Tasks - * based on the value of - * [max_dispatches_per_second][google.cloud.tasks.v2beta3.RateLimits.max_dispatches_per_second]. - * The maximum value of `max_burst_size` is 500. - * For App Engine queues that were created or updated using - * `queue.yaml/xml`, `max_burst_size` is equal to - * [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size). - * If - * [UpdateQueue][google.cloud.tasks.v2beta3.CloudTasks.UpdateQueue] is called - * on a queue without explicitly setting a value for `max_burst_size`, - * `max_burst_size` value will get updated if - * [UpdateQueue][google.cloud.tasks.v2beta3.CloudTasks.UpdateQueue] is - * updating - * [max_dispatches_per_second][google.cloud.tasks.v2beta3.RateLimits.max_dispatches_per_second]. - * - * Generated from protobuf field int32 max_burst_size = 2; - */ - protected $max_burst_size = 0; - /** - * The maximum number of concurrent tasks that Cloud Tasks allows - * to be dispatched for this queue. After this threshold has been - * reached, Cloud Tasks stops dispatching tasks until the number of - * concurrent requests decreases. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * The maximum allowed value is 5,000. - * This field has the same meaning as - * [max_concurrent_requests in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests). - * - * Generated from protobuf field int32 max_concurrent_dispatches = 3; - */ - protected $max_concurrent_dispatches = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type float $max_dispatches_per_second - * The maximum rate at which tasks are dispatched from this queue. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * * For [App Engine queues][google.cloud.tasks.v2beta3.AppEngineHttpQueue], - * the maximum allowed value - * is 500. - * This field has the same meaning as - * [rate in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate). - * @type int $max_burst_size - * The max burst size. - * Max burst size limits how fast tasks in queue are processed when - * many tasks are in the queue and the rate is high. This field - * allows the queue to have a high rate so processing starts shortly - * after a task is enqueued, but still limits resource usage when - * many tasks are enqueued in a short period of time. - * The [token bucket](https://wikipedia.org/wiki/Token_Bucket) - * algorithm is used to control the rate of task dispatches. Each - * queue has a token bucket that holds tokens, up to the maximum - * specified by `max_burst_size`. Each time a task is dispatched, a - * token is removed from the bucket. Tasks will be dispatched until - * the queue's bucket runs out of tokens. The bucket will be - * continuously refilled with new tokens based on - * [max_dispatches_per_second][google.cloud.tasks.v2beta3.RateLimits.max_dispatches_per_second]. - * The default value of `max_burst_size` is picked by Cloud Tasks - * based on the value of - * [max_dispatches_per_second][google.cloud.tasks.v2beta3.RateLimits.max_dispatches_per_second]. - * The maximum value of `max_burst_size` is 500. - * For App Engine queues that were created or updated using - * `queue.yaml/xml`, `max_burst_size` is equal to - * [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size). - * If - * [UpdateQueue][google.cloud.tasks.v2beta3.CloudTasks.UpdateQueue] is called - * on a queue without explicitly setting a value for `max_burst_size`, - * `max_burst_size` value will get updated if - * [UpdateQueue][google.cloud.tasks.v2beta3.CloudTasks.UpdateQueue] is - * updating - * [max_dispatches_per_second][google.cloud.tasks.v2beta3.RateLimits.max_dispatches_per_second]. - * @type int $max_concurrent_dispatches - * The maximum number of concurrent tasks that Cloud Tasks allows - * to be dispatched for this queue. After this threshold has been - * reached, Cloud Tasks stops dispatching tasks until the number of - * concurrent requests decreases. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * The maximum allowed value is 5,000. - * This field has the same meaning as - * [max_concurrent_requests in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Queue::initOnce(); - parent::__construct($data); - } - - /** - * The maximum rate at which tasks are dispatched from this queue. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * * For [App Engine queues][google.cloud.tasks.v2beta3.AppEngineHttpQueue], - * the maximum allowed value - * is 500. - * This field has the same meaning as - * [rate in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate). - * - * Generated from protobuf field double max_dispatches_per_second = 1; - * @return float - */ - public function getMaxDispatchesPerSecond() - { - return $this->max_dispatches_per_second; - } - - /** - * The maximum rate at which tasks are dispatched from this queue. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * * For [App Engine queues][google.cloud.tasks.v2beta3.AppEngineHttpQueue], - * the maximum allowed value - * is 500. - * This field has the same meaning as - * [rate in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate). - * - * Generated from protobuf field double max_dispatches_per_second = 1; - * @param float $var - * @return $this - */ - public function setMaxDispatchesPerSecond($var) - { - GPBUtil::checkDouble($var); - $this->max_dispatches_per_second = $var; - - return $this; - } - - /** - * The max burst size. - * Max burst size limits how fast tasks in queue are processed when - * many tasks are in the queue and the rate is high. This field - * allows the queue to have a high rate so processing starts shortly - * after a task is enqueued, but still limits resource usage when - * many tasks are enqueued in a short period of time. - * The [token bucket](https://wikipedia.org/wiki/Token_Bucket) - * algorithm is used to control the rate of task dispatches. Each - * queue has a token bucket that holds tokens, up to the maximum - * specified by `max_burst_size`. Each time a task is dispatched, a - * token is removed from the bucket. Tasks will be dispatched until - * the queue's bucket runs out of tokens. The bucket will be - * continuously refilled with new tokens based on - * [max_dispatches_per_second][google.cloud.tasks.v2beta3.RateLimits.max_dispatches_per_second]. - * The default value of `max_burst_size` is picked by Cloud Tasks - * based on the value of - * [max_dispatches_per_second][google.cloud.tasks.v2beta3.RateLimits.max_dispatches_per_second]. - * The maximum value of `max_burst_size` is 500. - * For App Engine queues that were created or updated using - * `queue.yaml/xml`, `max_burst_size` is equal to - * [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size). - * If - * [UpdateQueue][google.cloud.tasks.v2beta3.CloudTasks.UpdateQueue] is called - * on a queue without explicitly setting a value for `max_burst_size`, - * `max_burst_size` value will get updated if - * [UpdateQueue][google.cloud.tasks.v2beta3.CloudTasks.UpdateQueue] is - * updating - * [max_dispatches_per_second][google.cloud.tasks.v2beta3.RateLimits.max_dispatches_per_second]. - * - * Generated from protobuf field int32 max_burst_size = 2; - * @return int - */ - public function getMaxBurstSize() - { - return $this->max_burst_size; - } - - /** - * The max burst size. - * Max burst size limits how fast tasks in queue are processed when - * many tasks are in the queue and the rate is high. This field - * allows the queue to have a high rate so processing starts shortly - * after a task is enqueued, but still limits resource usage when - * many tasks are enqueued in a short period of time. - * The [token bucket](https://wikipedia.org/wiki/Token_Bucket) - * algorithm is used to control the rate of task dispatches. Each - * queue has a token bucket that holds tokens, up to the maximum - * specified by `max_burst_size`. Each time a task is dispatched, a - * token is removed from the bucket. Tasks will be dispatched until - * the queue's bucket runs out of tokens. The bucket will be - * continuously refilled with new tokens based on - * [max_dispatches_per_second][google.cloud.tasks.v2beta3.RateLimits.max_dispatches_per_second]. - * The default value of `max_burst_size` is picked by Cloud Tasks - * based on the value of - * [max_dispatches_per_second][google.cloud.tasks.v2beta3.RateLimits.max_dispatches_per_second]. - * The maximum value of `max_burst_size` is 500. - * For App Engine queues that were created or updated using - * `queue.yaml/xml`, `max_burst_size` is equal to - * [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size). - * If - * [UpdateQueue][google.cloud.tasks.v2beta3.CloudTasks.UpdateQueue] is called - * on a queue without explicitly setting a value for `max_burst_size`, - * `max_burst_size` value will get updated if - * [UpdateQueue][google.cloud.tasks.v2beta3.CloudTasks.UpdateQueue] is - * updating - * [max_dispatches_per_second][google.cloud.tasks.v2beta3.RateLimits.max_dispatches_per_second]. - * - * Generated from protobuf field int32 max_burst_size = 2; - * @param int $var - * @return $this - */ - public function setMaxBurstSize($var) - { - GPBUtil::checkInt32($var); - $this->max_burst_size = $var; - - return $this; - } - - /** - * The maximum number of concurrent tasks that Cloud Tasks allows - * to be dispatched for this queue. After this threshold has been - * reached, Cloud Tasks stops dispatching tasks until the number of - * concurrent requests decreases. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * The maximum allowed value is 5,000. - * This field has the same meaning as - * [max_concurrent_requests in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests). - * - * Generated from protobuf field int32 max_concurrent_dispatches = 3; - * @return int - */ - public function getMaxConcurrentDispatches() - { - return $this->max_concurrent_dispatches; - } - - /** - * The maximum number of concurrent tasks that Cloud Tasks allows - * to be dispatched for this queue. After this threshold has been - * reached, Cloud Tasks stops dispatching tasks until the number of - * concurrent requests decreases. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * The maximum allowed value is 5,000. - * This field has the same meaning as - * [max_concurrent_requests in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests). - * - * Generated from protobuf field int32 max_concurrent_dispatches = 3; - * @param int $var - * @return $this - */ - public function setMaxConcurrentDispatches($var) - { - GPBUtil::checkInt32($var); - $this->max_concurrent_dispatches = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ResumeQueueRequest.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ResumeQueueRequest.php deleted file mode 100644 index c1b61275d139..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ResumeQueueRequest.php +++ /dev/null @@ -1,72 +0,0 @@ -google.cloud.tasks.v2beta3.ResumeQueueRequest - */ -class ResumeQueueRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/RetryConfig.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/RetryConfig.php deleted file mode 100644 index 39fa65ea3b58..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/RetryConfig.php +++ /dev/null @@ -1,502 +0,0 @@ -google.cloud.tasks.v2beta3.RetryConfig - */ -class RetryConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Number of attempts per task. - * Cloud Tasks will attempt the task `max_attempts` times (that is, if the - * first attempt fails, then there will be `max_attempts - 1` retries). Must - * be >= -1. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * -1 indicates unlimited attempts. - * This field has the same meaning as - * [task_retry_limit in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * - * Generated from protobuf field int32 max_attempts = 1; - */ - protected $max_attempts = 0; - /** - * If positive, `max_retry_duration` specifies the time limit for - * retrying a failed task, measured from when the task was first - * attempted. Once `max_retry_duration` time has passed *and* the - * task has been attempted - * [max_attempts][google.cloud.tasks.v2beta3.RetryConfig.max_attempts] times, - * no further attempts will be made and the task will be deleted. - * If zero, then the task age is unlimited. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * `max_retry_duration` will be truncated to the nearest second. - * This field has the same meaning as - * [task_age_limit in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * - * Generated from protobuf field .google.protobuf.Duration max_retry_duration = 2; - */ - protected $max_retry_duration = null; - /** - * A task will be [scheduled][google.cloud.tasks.v2beta3.Task.schedule_time] - * for retry between - * [min_backoff][google.cloud.tasks.v2beta3.RetryConfig.min_backoff] and - * [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] duration - * after it fails, if the queue's - * [RetryConfig][google.cloud.tasks.v2beta3.RetryConfig] specifies that the - * task should be retried. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * `min_backoff` will be truncated to the nearest second. - * This field has the same meaning as - * [min_backoff_seconds in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * - * Generated from protobuf field .google.protobuf.Duration min_backoff = 3; - */ - protected $min_backoff = null; - /** - * A task will be [scheduled][google.cloud.tasks.v2beta3.Task.schedule_time] - * for retry between - * [min_backoff][google.cloud.tasks.v2beta3.RetryConfig.min_backoff] and - * [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] duration - * after it fails, if the queue's - * [RetryConfig][google.cloud.tasks.v2beta3.RetryConfig] specifies that the - * task should be retried. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * `max_backoff` will be truncated to the nearest second. - * This field has the same meaning as - * [max_backoff_seconds in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * - * Generated from protobuf field .google.protobuf.Duration max_backoff = 4; - */ - protected $max_backoff = null; - /** - * The time between retries will double `max_doublings` times. - * A task's retry interval starts at - * [min_backoff][google.cloud.tasks.v2beta3.RetryConfig.min_backoff], then - * doubles `max_doublings` times, then increases linearly, and finally retries - * at intervals of - * [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] up to - * [max_attempts][google.cloud.tasks.v2beta3.RetryConfig.max_attempts] times. - * For example, if - * [min_backoff][google.cloud.tasks.v2beta3.RetryConfig.min_backoff] is 10s, - * [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] is 300s, - * and `max_doublings` is 3, then the a task will first be retried in 10s. The - * retry interval will double three times, and then increase linearly by 2^3 * - * 10s. Finally, the task will retry at intervals of - * [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] until the - * task has been attempted - * [max_attempts][google.cloud.tasks.v2beta3.RetryConfig.max_attempts] times. - * Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, - * 300s, .... - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * This field has the same meaning as - * [max_doublings in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * - * Generated from protobuf field int32 max_doublings = 5; - */ - protected $max_doublings = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $max_attempts - * Number of attempts per task. - * Cloud Tasks will attempt the task `max_attempts` times (that is, if the - * first attempt fails, then there will be `max_attempts - 1` retries). Must - * be >= -1. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * -1 indicates unlimited attempts. - * This field has the same meaning as - * [task_retry_limit in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * @type \Google\Protobuf\Duration $max_retry_duration - * If positive, `max_retry_duration` specifies the time limit for - * retrying a failed task, measured from when the task was first - * attempted. Once `max_retry_duration` time has passed *and* the - * task has been attempted - * [max_attempts][google.cloud.tasks.v2beta3.RetryConfig.max_attempts] times, - * no further attempts will be made and the task will be deleted. - * If zero, then the task age is unlimited. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * `max_retry_duration` will be truncated to the nearest second. - * This field has the same meaning as - * [task_age_limit in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * @type \Google\Protobuf\Duration $min_backoff - * A task will be [scheduled][google.cloud.tasks.v2beta3.Task.schedule_time] - * for retry between - * [min_backoff][google.cloud.tasks.v2beta3.RetryConfig.min_backoff] and - * [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] duration - * after it fails, if the queue's - * [RetryConfig][google.cloud.tasks.v2beta3.RetryConfig] specifies that the - * task should be retried. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * `min_backoff` will be truncated to the nearest second. - * This field has the same meaning as - * [min_backoff_seconds in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * @type \Google\Protobuf\Duration $max_backoff - * A task will be [scheduled][google.cloud.tasks.v2beta3.Task.schedule_time] - * for retry between - * [min_backoff][google.cloud.tasks.v2beta3.RetryConfig.min_backoff] and - * [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] duration - * after it fails, if the queue's - * [RetryConfig][google.cloud.tasks.v2beta3.RetryConfig] specifies that the - * task should be retried. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * `max_backoff` will be truncated to the nearest second. - * This field has the same meaning as - * [max_backoff_seconds in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * @type int $max_doublings - * The time between retries will double `max_doublings` times. - * A task's retry interval starts at - * [min_backoff][google.cloud.tasks.v2beta3.RetryConfig.min_backoff], then - * doubles `max_doublings` times, then increases linearly, and finally retries - * at intervals of - * [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] up to - * [max_attempts][google.cloud.tasks.v2beta3.RetryConfig.max_attempts] times. - * For example, if - * [min_backoff][google.cloud.tasks.v2beta3.RetryConfig.min_backoff] is 10s, - * [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] is 300s, - * and `max_doublings` is 3, then the a task will first be retried in 10s. The - * retry interval will double three times, and then increase linearly by 2^3 * - * 10s. Finally, the task will retry at intervals of - * [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] until the - * task has been attempted - * [max_attempts][google.cloud.tasks.v2beta3.RetryConfig.max_attempts] times. - * Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, - * 300s, .... - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * This field has the same meaning as - * [max_doublings in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Queue::initOnce(); - parent::__construct($data); - } - - /** - * Number of attempts per task. - * Cloud Tasks will attempt the task `max_attempts` times (that is, if the - * first attempt fails, then there will be `max_attempts - 1` retries). Must - * be >= -1. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * -1 indicates unlimited attempts. - * This field has the same meaning as - * [task_retry_limit in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * - * Generated from protobuf field int32 max_attempts = 1; - * @return int - */ - public function getMaxAttempts() - { - return $this->max_attempts; - } - - /** - * Number of attempts per task. - * Cloud Tasks will attempt the task `max_attempts` times (that is, if the - * first attempt fails, then there will be `max_attempts - 1` retries). Must - * be >= -1. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * -1 indicates unlimited attempts. - * This field has the same meaning as - * [task_retry_limit in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * - * Generated from protobuf field int32 max_attempts = 1; - * @param int $var - * @return $this - */ - public function setMaxAttempts($var) - { - GPBUtil::checkInt32($var); - $this->max_attempts = $var; - - return $this; - } - - /** - * If positive, `max_retry_duration` specifies the time limit for - * retrying a failed task, measured from when the task was first - * attempted. Once `max_retry_duration` time has passed *and* the - * task has been attempted - * [max_attempts][google.cloud.tasks.v2beta3.RetryConfig.max_attempts] times, - * no further attempts will be made and the task will be deleted. - * If zero, then the task age is unlimited. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * `max_retry_duration` will be truncated to the nearest second. - * This field has the same meaning as - * [task_age_limit in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * - * Generated from protobuf field .google.protobuf.Duration max_retry_duration = 2; - * @return \Google\Protobuf\Duration|null - */ - public function getMaxRetryDuration() - { - return $this->max_retry_duration; - } - - public function hasMaxRetryDuration() - { - return isset($this->max_retry_duration); - } - - public function clearMaxRetryDuration() - { - unset($this->max_retry_duration); - } - - /** - * If positive, `max_retry_duration` specifies the time limit for - * retrying a failed task, measured from when the task was first - * attempted. Once `max_retry_duration` time has passed *and* the - * task has been attempted - * [max_attempts][google.cloud.tasks.v2beta3.RetryConfig.max_attempts] times, - * no further attempts will be made and the task will be deleted. - * If zero, then the task age is unlimited. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * `max_retry_duration` will be truncated to the nearest second. - * This field has the same meaning as - * [task_age_limit in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * - * Generated from protobuf field .google.protobuf.Duration max_retry_duration = 2; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setMaxRetryDuration($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->max_retry_duration = $var; - - return $this; - } - - /** - * A task will be [scheduled][google.cloud.tasks.v2beta3.Task.schedule_time] - * for retry between - * [min_backoff][google.cloud.tasks.v2beta3.RetryConfig.min_backoff] and - * [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] duration - * after it fails, if the queue's - * [RetryConfig][google.cloud.tasks.v2beta3.RetryConfig] specifies that the - * task should be retried. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * `min_backoff` will be truncated to the nearest second. - * This field has the same meaning as - * [min_backoff_seconds in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * - * Generated from protobuf field .google.protobuf.Duration min_backoff = 3; - * @return \Google\Protobuf\Duration|null - */ - public function getMinBackoff() - { - return $this->min_backoff; - } - - public function hasMinBackoff() - { - return isset($this->min_backoff); - } - - public function clearMinBackoff() - { - unset($this->min_backoff); - } - - /** - * A task will be [scheduled][google.cloud.tasks.v2beta3.Task.schedule_time] - * for retry between - * [min_backoff][google.cloud.tasks.v2beta3.RetryConfig.min_backoff] and - * [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] duration - * after it fails, if the queue's - * [RetryConfig][google.cloud.tasks.v2beta3.RetryConfig] specifies that the - * task should be retried. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * `min_backoff` will be truncated to the nearest second. - * This field has the same meaning as - * [min_backoff_seconds in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * - * Generated from protobuf field .google.protobuf.Duration min_backoff = 3; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setMinBackoff($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->min_backoff = $var; - - return $this; - } - - /** - * A task will be [scheduled][google.cloud.tasks.v2beta3.Task.schedule_time] - * for retry between - * [min_backoff][google.cloud.tasks.v2beta3.RetryConfig.min_backoff] and - * [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] duration - * after it fails, if the queue's - * [RetryConfig][google.cloud.tasks.v2beta3.RetryConfig] specifies that the - * task should be retried. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * `max_backoff` will be truncated to the nearest second. - * This field has the same meaning as - * [max_backoff_seconds in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * - * Generated from protobuf field .google.protobuf.Duration max_backoff = 4; - * @return \Google\Protobuf\Duration|null - */ - public function getMaxBackoff() - { - return $this->max_backoff; - } - - public function hasMaxBackoff() - { - return isset($this->max_backoff); - } - - public function clearMaxBackoff() - { - unset($this->max_backoff); - } - - /** - * A task will be [scheduled][google.cloud.tasks.v2beta3.Task.schedule_time] - * for retry between - * [min_backoff][google.cloud.tasks.v2beta3.RetryConfig.min_backoff] and - * [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] duration - * after it fails, if the queue's - * [RetryConfig][google.cloud.tasks.v2beta3.RetryConfig] specifies that the - * task should be retried. - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * `max_backoff` will be truncated to the nearest second. - * This field has the same meaning as - * [max_backoff_seconds in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * - * Generated from protobuf field .google.protobuf.Duration max_backoff = 4; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setMaxBackoff($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->max_backoff = $var; - - return $this; - } - - /** - * The time between retries will double `max_doublings` times. - * A task's retry interval starts at - * [min_backoff][google.cloud.tasks.v2beta3.RetryConfig.min_backoff], then - * doubles `max_doublings` times, then increases linearly, and finally retries - * at intervals of - * [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] up to - * [max_attempts][google.cloud.tasks.v2beta3.RetryConfig.max_attempts] times. - * For example, if - * [min_backoff][google.cloud.tasks.v2beta3.RetryConfig.min_backoff] is 10s, - * [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] is 300s, - * and `max_doublings` is 3, then the a task will first be retried in 10s. The - * retry interval will double three times, and then increase linearly by 2^3 * - * 10s. Finally, the task will retry at intervals of - * [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] until the - * task has been attempted - * [max_attempts][google.cloud.tasks.v2beta3.RetryConfig.max_attempts] times. - * Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, - * 300s, .... - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * This field has the same meaning as - * [max_doublings in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * - * Generated from protobuf field int32 max_doublings = 5; - * @return int - */ - public function getMaxDoublings() - { - return $this->max_doublings; - } - - /** - * The time between retries will double `max_doublings` times. - * A task's retry interval starts at - * [min_backoff][google.cloud.tasks.v2beta3.RetryConfig.min_backoff], then - * doubles `max_doublings` times, then increases linearly, and finally retries - * at intervals of - * [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] up to - * [max_attempts][google.cloud.tasks.v2beta3.RetryConfig.max_attempts] times. - * For example, if - * [min_backoff][google.cloud.tasks.v2beta3.RetryConfig.min_backoff] is 10s, - * [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] is 300s, - * and `max_doublings` is 3, then the a task will first be retried in 10s. The - * retry interval will double three times, and then increase linearly by 2^3 * - * 10s. Finally, the task will retry at intervals of - * [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] until the - * task has been attempted - * [max_attempts][google.cloud.tasks.v2beta3.RetryConfig.max_attempts] times. - * Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, - * 300s, .... - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. - * This field has the same meaning as - * [max_doublings in - * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - * - * Generated from protobuf field int32 max_doublings = 5; - * @param int $var - * @return $this - */ - public function setMaxDoublings($var) - { - GPBUtil::checkInt32($var); - $this->max_doublings = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/RunTaskRequest.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/RunTaskRequest.php deleted file mode 100644 index 01e52b93e151..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/RunTaskRequest.php +++ /dev/null @@ -1,146 +0,0 @@ -google.cloud.tasks.v2beta3.RunTaskRequest - */ -class RunTaskRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta3.Task] will be returned. - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta3.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.Task.View response_view = 2; - */ - protected $response_view = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * @type int $response_view - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta3.Task] will be returned. - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta3.Task] resource. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta3.Task] will be returned. - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta3.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.Task.View response_view = 2; - * @return int - */ - public function getResponseView() - { - return $this->response_view; - } - - /** - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta3.Task] will be returned. - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta3.Task] resource. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.Task.View response_view = 2; - * @param int $var - * @return $this - */ - public function setResponseView($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta3\Task\View::class); - $this->response_view = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/StackdriverLoggingConfig.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/StackdriverLoggingConfig.php deleted file mode 100644 index 77ae9bd3407e..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/StackdriverLoggingConfig.php +++ /dev/null @@ -1,80 +0,0 @@ -google.cloud.tasks.v2beta3.StackdriverLoggingConfig - */ -class StackdriverLoggingConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Specifies the fraction of operations to write to - * [Stackdriver Logging](https://cloud.google.com/logging/docs/). - * This field may contain any value between 0.0 and 1.0, inclusive. - * 0.0 is the default and means that no operations are logged. - * - * Generated from protobuf field double sampling_ratio = 1; - */ - protected $sampling_ratio = 0.0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type float $sampling_ratio - * Specifies the fraction of operations to write to - * [Stackdriver Logging](https://cloud.google.com/logging/docs/). - * This field may contain any value between 0.0 and 1.0, inclusive. - * 0.0 is the default and means that no operations are logged. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Queue::initOnce(); - parent::__construct($data); - } - - /** - * Specifies the fraction of operations to write to - * [Stackdriver Logging](https://cloud.google.com/logging/docs/). - * This field may contain any value between 0.0 and 1.0, inclusive. - * 0.0 is the default and means that no operations are logged. - * - * Generated from protobuf field double sampling_ratio = 1; - * @return float - */ - public function getSamplingRatio() - { - return $this->sampling_ratio; - } - - /** - * Specifies the fraction of operations to write to - * [Stackdriver Logging](https://cloud.google.com/logging/docs/). - * This field may contain any value between 0.0 and 1.0, inclusive. - * 0.0 is the default and means that no operations are logged. - * - * Generated from protobuf field double sampling_ratio = 1; - * @param float $var - * @return $this - */ - public function setSamplingRatio($var) - { - GPBUtil::checkDouble($var); - $this->sampling_ratio = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Task.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Task.php deleted file mode 100644 index 5663cef6459a..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Task.php +++ /dev/null @@ -1,746 +0,0 @@ -google.cloud.tasks.v2beta3.Task - */ -class Task extends \Google\Protobuf\Internal\Message -{ - /** - * Optionally caller-specified in - * [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - * The task name. - * The task name must have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - * hyphens (-), colons (:), or periods (.). - * For more information, see - * [Identifying - * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) - * * `LOCATION_ID` is the canonical ID for the task's location. - * The list of available locations can be obtained by calling - * [ListLocations][google.cloud.location.Locations.ListLocations]. - * For more information, see https://cloud.google.com/about/locations/. - * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or - * hyphens (-). The maximum length is 100 characters. - * * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), - * hyphens (-), or underscores (_). The maximum length is 500 characters. - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * The time when the task is scheduled to be attempted. - * For App Engine queues, this is when the task will be attempted or retried. - * `schedule_time` will be truncated to the nearest microsecond. - * - * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 4; - */ - protected $schedule_time = null; - /** - * Output only. The time that the task was created. - * `create_time` will be truncated to the nearest second. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; - */ - protected $create_time = null; - /** - * The deadline for requests sent to the worker. If the worker does not - * respond by this deadline then the request is cancelled and the attempt - * is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the - * task according to the - * [RetryConfig][google.cloud.tasks.v2beta3.RetryConfig]. - * Note that when the request is cancelled, Cloud Tasks will stop listening - * for the response, but whether the worker stops processing depends on the - * worker. For example, if the worker is stuck, it may not react to cancelled - * requests. - * The default and maximum values depend on the type of request: - * * For [HTTP tasks][google.cloud.tasks.v2beta3.HttpRequest], the default is - * 10 minutes. The deadline - * must be in the interval [15 seconds, 30 minutes]. - * * For [App Engine tasks][google.cloud.tasks.v2beta3.AppEngineHttpRequest], - * 0 indicates that the - * request has the default deadline. The default deadline depends on the - * [scaling - * type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling) - * of the service: 10 minutes for standard apps with automatic scaling, 24 - * hours for standard apps with manual and basic scaling, and 60 minutes for - * flex apps. If the request deadline is set, it must be in the interval [15 - * seconds, 24 hours 15 seconds]. Regardless of the task's - * `dispatch_deadline`, the app handler will not run for longer than than - * the service's timeout. We recommend setting the `dispatch_deadline` to - * at most a few seconds more than the app handler's timeout. For more - * information see - * [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts). - * `dispatch_deadline` will be truncated to the nearest millisecond. The - * deadline is an approximate deadline. - * - * Generated from protobuf field .google.protobuf.Duration dispatch_deadline = 12; - */ - protected $dispatch_deadline = null; - /** - * Output only. The number of attempts dispatched. - * This count includes attempts which have been dispatched but haven't - * received a response. - * - * Generated from protobuf field int32 dispatch_count = 6; - */ - protected $dispatch_count = 0; - /** - * Output only. The number of attempts which have received a response. - * - * Generated from protobuf field int32 response_count = 7; - */ - protected $response_count = 0; - /** - * Output only. The status of the task's first attempt. - * Only [dispatch_time][google.cloud.tasks.v2beta3.Attempt.dispatch_time] will - * be set. The other [Attempt][google.cloud.tasks.v2beta3.Attempt] information - * is not retained by Cloud Tasks. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.Attempt first_attempt = 8; - */ - protected $first_attempt = null; - /** - * Output only. The status of the task's last attempt. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.Attempt last_attempt = 9; - */ - protected $last_attempt = null; - /** - * Output only. The view specifies which subset of the - * [Task][google.cloud.tasks.v2beta3.Task] has been returned. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.Task.View view = 10; - */ - protected $view = 0; - protected $payload_type; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Optionally caller-specified in - * [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - * The task name. - * The task name must have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - * hyphens (-), colons (:), or periods (.). - * For more information, see - * [Identifying - * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) - * * `LOCATION_ID` is the canonical ID for the task's location. - * The list of available locations can be obtained by calling - * [ListLocations][google.cloud.location.Locations.ListLocations]. - * For more information, see https://cloud.google.com/about/locations/. - * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or - * hyphens (-). The maximum length is 100 characters. - * * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), - * hyphens (-), or underscores (_). The maximum length is 500 characters. - * @type \Google\Cloud\Tasks\V2beta3\AppEngineHttpRequest $app_engine_http_request - * HTTP request that is sent to the App Engine app handler. - * An App Engine task is a task that has - * [AppEngineHttpRequest][google.cloud.tasks.v2beta3.AppEngineHttpRequest] - * set. - * @type \Google\Cloud\Tasks\V2beta3\HttpRequest $http_request - * HTTP request that is sent to the task's target. - * An HTTP task is a task that has - * [HttpRequest][google.cloud.tasks.v2beta3.HttpRequest] set. - * @type \Google\Cloud\Tasks\V2beta3\PullMessage $pull_message - * Pull Message contained in a task in a - * [PULL][google.cloud.tasks.v2beta3.Queue.type] queue type. This payload - * type cannot be explicitly set through Cloud Tasks API. Its purpose, - * currently is to provide backward compatibility with App Engine Task Queue - * [pull](https://cloud.google.com/appengine/docs/standard/java/taskqueue/pull/) - * queues to provide a way to inspect contents of pull tasks through the - * [CloudTasks.GetTask][google.cloud.tasks.v2beta3.CloudTasks.GetTask]. - * @type \Google\Protobuf\Timestamp $schedule_time - * The time when the task is scheduled to be attempted. - * For App Engine queues, this is when the task will be attempted or retried. - * `schedule_time` will be truncated to the nearest microsecond. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time that the task was created. - * `create_time` will be truncated to the nearest second. - * @type \Google\Protobuf\Duration $dispatch_deadline - * The deadline for requests sent to the worker. If the worker does not - * respond by this deadline then the request is cancelled and the attempt - * is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the - * task according to the - * [RetryConfig][google.cloud.tasks.v2beta3.RetryConfig]. - * Note that when the request is cancelled, Cloud Tasks will stop listening - * for the response, but whether the worker stops processing depends on the - * worker. For example, if the worker is stuck, it may not react to cancelled - * requests. - * The default and maximum values depend on the type of request: - * * For [HTTP tasks][google.cloud.tasks.v2beta3.HttpRequest], the default is - * 10 minutes. The deadline - * must be in the interval [15 seconds, 30 minutes]. - * * For [App Engine tasks][google.cloud.tasks.v2beta3.AppEngineHttpRequest], - * 0 indicates that the - * request has the default deadline. The default deadline depends on the - * [scaling - * type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling) - * of the service: 10 minutes for standard apps with automatic scaling, 24 - * hours for standard apps with manual and basic scaling, and 60 minutes for - * flex apps. If the request deadline is set, it must be in the interval [15 - * seconds, 24 hours 15 seconds]. Regardless of the task's - * `dispatch_deadline`, the app handler will not run for longer than than - * the service's timeout. We recommend setting the `dispatch_deadline` to - * at most a few seconds more than the app handler's timeout. For more - * information see - * [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts). - * `dispatch_deadline` will be truncated to the nearest millisecond. The - * deadline is an approximate deadline. - * @type int $dispatch_count - * Output only. The number of attempts dispatched. - * This count includes attempts which have been dispatched but haven't - * received a response. - * @type int $response_count - * Output only. The number of attempts which have received a response. - * @type \Google\Cloud\Tasks\V2beta3\Attempt $first_attempt - * Output only. The status of the task's first attempt. - * Only [dispatch_time][google.cloud.tasks.v2beta3.Attempt.dispatch_time] will - * be set. The other [Attempt][google.cloud.tasks.v2beta3.Attempt] information - * is not retained by Cloud Tasks. - * @type \Google\Cloud\Tasks\V2beta3\Attempt $last_attempt - * Output only. The status of the task's last attempt. - * @type int $view - * Output only. The view specifies which subset of the - * [Task][google.cloud.tasks.v2beta3.Task] has been returned. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Task::initOnce(); - parent::__construct($data); - } - - /** - * Optionally caller-specified in - * [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - * The task name. - * The task name must have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - * hyphens (-), colons (:), or periods (.). - * For more information, see - * [Identifying - * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) - * * `LOCATION_ID` is the canonical ID for the task's location. - * The list of available locations can be obtained by calling - * [ListLocations][google.cloud.location.Locations.ListLocations]. - * For more information, see https://cloud.google.com/about/locations/. - * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or - * hyphens (-). The maximum length is 100 characters. - * * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), - * hyphens (-), or underscores (_). The maximum length is 500 characters. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Optionally caller-specified in - * [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - * The task name. - * The task name must have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - * hyphens (-), colons (:), or periods (.). - * For more information, see - * [Identifying - * projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) - * * `LOCATION_ID` is the canonical ID for the task's location. - * The list of available locations can be obtained by calling - * [ListLocations][google.cloud.location.Locations.ListLocations]. - * For more information, see https://cloud.google.com/about/locations/. - * * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or - * hyphens (-). The maximum length is 100 characters. - * * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), - * hyphens (-), or underscores (_). The maximum length is 500 characters. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * HTTP request that is sent to the App Engine app handler. - * An App Engine task is a task that has - * [AppEngineHttpRequest][google.cloud.tasks.v2beta3.AppEngineHttpRequest] - * set. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.AppEngineHttpRequest app_engine_http_request = 3; - * @return \Google\Cloud\Tasks\V2beta3\AppEngineHttpRequest|null - */ - public function getAppEngineHttpRequest() - { - return $this->readOneof(3); - } - - public function hasAppEngineHttpRequest() - { - return $this->hasOneof(3); - } - - /** - * HTTP request that is sent to the App Engine app handler. - * An App Engine task is a task that has - * [AppEngineHttpRequest][google.cloud.tasks.v2beta3.AppEngineHttpRequest] - * set. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.AppEngineHttpRequest app_engine_http_request = 3; - * @param \Google\Cloud\Tasks\V2beta3\AppEngineHttpRequest $var - * @return $this - */ - public function setAppEngineHttpRequest($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\AppEngineHttpRequest::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * HTTP request that is sent to the task's target. - * An HTTP task is a task that has - * [HttpRequest][google.cloud.tasks.v2beta3.HttpRequest] set. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.HttpRequest http_request = 11; - * @return \Google\Cloud\Tasks\V2beta3\HttpRequest|null - */ - public function getHttpRequest() - { - return $this->readOneof(11); - } - - public function hasHttpRequest() - { - return $this->hasOneof(11); - } - - /** - * HTTP request that is sent to the task's target. - * An HTTP task is a task that has - * [HttpRequest][google.cloud.tasks.v2beta3.HttpRequest] set. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.HttpRequest http_request = 11; - * @param \Google\Cloud\Tasks\V2beta3\HttpRequest $var - * @return $this - */ - public function setHttpRequest($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\HttpRequest::class); - $this->writeOneof(11, $var); - - return $this; - } - - /** - * Pull Message contained in a task in a - * [PULL][google.cloud.tasks.v2beta3.Queue.type] queue type. This payload - * type cannot be explicitly set through Cloud Tasks API. Its purpose, - * currently is to provide backward compatibility with App Engine Task Queue - * [pull](https://cloud.google.com/appengine/docs/standard/java/taskqueue/pull/) - * queues to provide a way to inspect contents of pull tasks through the - * [CloudTasks.GetTask][google.cloud.tasks.v2beta3.CloudTasks.GetTask]. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.PullMessage pull_message = 13; - * @return \Google\Cloud\Tasks\V2beta3\PullMessage|null - */ - public function getPullMessage() - { - return $this->readOneof(13); - } - - public function hasPullMessage() - { - return $this->hasOneof(13); - } - - /** - * Pull Message contained in a task in a - * [PULL][google.cloud.tasks.v2beta3.Queue.type] queue type. This payload - * type cannot be explicitly set through Cloud Tasks API. Its purpose, - * currently is to provide backward compatibility with App Engine Task Queue - * [pull](https://cloud.google.com/appengine/docs/standard/java/taskqueue/pull/) - * queues to provide a way to inspect contents of pull tasks through the - * [CloudTasks.GetTask][google.cloud.tasks.v2beta3.CloudTasks.GetTask]. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.PullMessage pull_message = 13; - * @param \Google\Cloud\Tasks\V2beta3\PullMessage $var - * @return $this - */ - public function setPullMessage($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\PullMessage::class); - $this->writeOneof(13, $var); - - return $this; - } - - /** - * The time when the task is scheduled to be attempted. - * For App Engine queues, this is when the task will be attempted or retried. - * `schedule_time` will be truncated to the nearest microsecond. - * - * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 4; - * @return \Google\Protobuf\Timestamp|null - */ - public function getScheduleTime() - { - return $this->schedule_time; - } - - public function hasScheduleTime() - { - return isset($this->schedule_time); - } - - public function clearScheduleTime() - { - unset($this->schedule_time); - } - - /** - * The time when the task is scheduled to be attempted. - * For App Engine queues, this is when the task will be attempted or retried. - * `schedule_time` will be truncated to the nearest microsecond. - * - * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 4; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setScheduleTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->schedule_time = $var; - - return $this; - } - - /** - * Output only. The time that the task was created. - * `create_time` will be truncated to the nearest second. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The time that the task was created. - * `create_time` will be truncated to the nearest second. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * The deadline for requests sent to the worker. If the worker does not - * respond by this deadline then the request is cancelled and the attempt - * is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the - * task according to the - * [RetryConfig][google.cloud.tasks.v2beta3.RetryConfig]. - * Note that when the request is cancelled, Cloud Tasks will stop listening - * for the response, but whether the worker stops processing depends on the - * worker. For example, if the worker is stuck, it may not react to cancelled - * requests. - * The default and maximum values depend on the type of request: - * * For [HTTP tasks][google.cloud.tasks.v2beta3.HttpRequest], the default is - * 10 minutes. The deadline - * must be in the interval [15 seconds, 30 minutes]. - * * For [App Engine tasks][google.cloud.tasks.v2beta3.AppEngineHttpRequest], - * 0 indicates that the - * request has the default deadline. The default deadline depends on the - * [scaling - * type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling) - * of the service: 10 minutes for standard apps with automatic scaling, 24 - * hours for standard apps with manual and basic scaling, and 60 minutes for - * flex apps. If the request deadline is set, it must be in the interval [15 - * seconds, 24 hours 15 seconds]. Regardless of the task's - * `dispatch_deadline`, the app handler will not run for longer than than - * the service's timeout. We recommend setting the `dispatch_deadline` to - * at most a few seconds more than the app handler's timeout. For more - * information see - * [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts). - * `dispatch_deadline` will be truncated to the nearest millisecond. The - * deadline is an approximate deadline. - * - * Generated from protobuf field .google.protobuf.Duration dispatch_deadline = 12; - * @return \Google\Protobuf\Duration|null - */ - public function getDispatchDeadline() - { - return $this->dispatch_deadline; - } - - public function hasDispatchDeadline() - { - return isset($this->dispatch_deadline); - } - - public function clearDispatchDeadline() - { - unset($this->dispatch_deadline); - } - - /** - * The deadline for requests sent to the worker. If the worker does not - * respond by this deadline then the request is cancelled and the attempt - * is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the - * task according to the - * [RetryConfig][google.cloud.tasks.v2beta3.RetryConfig]. - * Note that when the request is cancelled, Cloud Tasks will stop listening - * for the response, but whether the worker stops processing depends on the - * worker. For example, if the worker is stuck, it may not react to cancelled - * requests. - * The default and maximum values depend on the type of request: - * * For [HTTP tasks][google.cloud.tasks.v2beta3.HttpRequest], the default is - * 10 minutes. The deadline - * must be in the interval [15 seconds, 30 minutes]. - * * For [App Engine tasks][google.cloud.tasks.v2beta3.AppEngineHttpRequest], - * 0 indicates that the - * request has the default deadline. The default deadline depends on the - * [scaling - * type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling) - * of the service: 10 minutes for standard apps with automatic scaling, 24 - * hours for standard apps with manual and basic scaling, and 60 minutes for - * flex apps. If the request deadline is set, it must be in the interval [15 - * seconds, 24 hours 15 seconds]. Regardless of the task's - * `dispatch_deadline`, the app handler will not run for longer than than - * the service's timeout. We recommend setting the `dispatch_deadline` to - * at most a few seconds more than the app handler's timeout. For more - * information see - * [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts). - * `dispatch_deadline` will be truncated to the nearest millisecond. The - * deadline is an approximate deadline. - * - * Generated from protobuf field .google.protobuf.Duration dispatch_deadline = 12; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setDispatchDeadline($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->dispatch_deadline = $var; - - return $this; - } - - /** - * Output only. The number of attempts dispatched. - * This count includes attempts which have been dispatched but haven't - * received a response. - * - * Generated from protobuf field int32 dispatch_count = 6; - * @return int - */ - public function getDispatchCount() - { - return $this->dispatch_count; - } - - /** - * Output only. The number of attempts dispatched. - * This count includes attempts which have been dispatched but haven't - * received a response. - * - * Generated from protobuf field int32 dispatch_count = 6; - * @param int $var - * @return $this - */ - public function setDispatchCount($var) - { - GPBUtil::checkInt32($var); - $this->dispatch_count = $var; - - return $this; - } - - /** - * Output only. The number of attempts which have received a response. - * - * Generated from protobuf field int32 response_count = 7; - * @return int - */ - public function getResponseCount() - { - return $this->response_count; - } - - /** - * Output only. The number of attempts which have received a response. - * - * Generated from protobuf field int32 response_count = 7; - * @param int $var - * @return $this - */ - public function setResponseCount($var) - { - GPBUtil::checkInt32($var); - $this->response_count = $var; - - return $this; - } - - /** - * Output only. The status of the task's first attempt. - * Only [dispatch_time][google.cloud.tasks.v2beta3.Attempt.dispatch_time] will - * be set. The other [Attempt][google.cloud.tasks.v2beta3.Attempt] information - * is not retained by Cloud Tasks. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.Attempt first_attempt = 8; - * @return \Google\Cloud\Tasks\V2beta3\Attempt|null - */ - public function getFirstAttempt() - { - return $this->first_attempt; - } - - public function hasFirstAttempt() - { - return isset($this->first_attempt); - } - - public function clearFirstAttempt() - { - unset($this->first_attempt); - } - - /** - * Output only. The status of the task's first attempt. - * Only [dispatch_time][google.cloud.tasks.v2beta3.Attempt.dispatch_time] will - * be set. The other [Attempt][google.cloud.tasks.v2beta3.Attempt] information - * is not retained by Cloud Tasks. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.Attempt first_attempt = 8; - * @param \Google\Cloud\Tasks\V2beta3\Attempt $var - * @return $this - */ - public function setFirstAttempt($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\Attempt::class); - $this->first_attempt = $var; - - return $this; - } - - /** - * Output only. The status of the task's last attempt. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.Attempt last_attempt = 9; - * @return \Google\Cloud\Tasks\V2beta3\Attempt|null - */ - public function getLastAttempt() - { - return $this->last_attempt; - } - - public function hasLastAttempt() - { - return isset($this->last_attempt); - } - - public function clearLastAttempt() - { - unset($this->last_attempt); - } - - /** - * Output only. The status of the task's last attempt. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.Attempt last_attempt = 9; - * @param \Google\Cloud\Tasks\V2beta3\Attempt $var - * @return $this - */ - public function setLastAttempt($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\Attempt::class); - $this->last_attempt = $var; - - return $this; - } - - /** - * Output only. The view specifies which subset of the - * [Task][google.cloud.tasks.v2beta3.Task] has been returned. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.Task.View view = 10; - * @return int - */ - public function getView() - { - return $this->view; - } - - /** - * Output only. The view specifies which subset of the - * [Task][google.cloud.tasks.v2beta3.Task] has been returned. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.Task.View view = 10; - * @param int $var - * @return $this - */ - public function setView($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta3\Task\View::class); - $this->view = $var; - - return $this; - } - - /** - * @return string - */ - public function getPayloadType() - { - return $this->whichOneof("payload_type"); - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Task/View.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Task/View.php deleted file mode 100644 index 7c45c3bd5ac8..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Task/View.php +++ /dev/null @@ -1,81 +0,0 @@ -google.cloud.tasks.v2beta3.Task.View - */ -class View -{ - /** - * Unspecified. Defaults to BASIC. - * - * Generated from protobuf enum VIEW_UNSPECIFIED = 0; - */ - const VIEW_UNSPECIFIED = 0; - /** - * The basic view omits fields which can be large or can contain - * sensitive data. - * This view does not include the - * [body in - * AppEngineHttpRequest][google.cloud.tasks.v2beta3.AppEngineHttpRequest.body]. - * Bodies are desirable to return only when needed, because they - * can be large and because of the sensitivity of the data that you - * choose to store in it. - * - * Generated from protobuf enum BASIC = 1; - */ - const BASIC = 1; - /** - * All information is returned. - * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Queue][google.cloud.tasks.v2beta3.Queue] resource. - * - * Generated from protobuf enum FULL = 2; - */ - const FULL = 2; - - private static $valueToName = [ - self::VIEW_UNSPECIFIED => 'VIEW_UNSPECIFIED', - self::BASIC => 'BASIC', - self::FULL => 'FULL', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(View::class, \Google\Cloud\Tasks\V2beta3\Task_View::class); - diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/UpdateQueueRequest.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/UpdateQueueRequest.php deleted file mode 100644 index 8fa7fdcb2fdd..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/UpdateQueueRequest.php +++ /dev/null @@ -1,150 +0,0 @@ -google.cloud.tasks.v2beta3.UpdateQueueRequest - */ -class UpdateQueueRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The queue to create or update. - * The queue's [name][google.cloud.tasks.v2beta3.Queue.name] must be - * specified. - * Output only fields cannot be modified using UpdateQueue. - * Any value specified for an output only field will be ignored. - * The queue's [name][google.cloud.tasks.v2beta3.Queue.name] cannot be - * changed. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.Queue queue = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $queue = null; - /** - * A mask used to specify which fields of the queue are being updated. - * If empty, then all fields will be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - */ - protected $update_mask = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Tasks\V2beta3\Queue $queue - * Required. The queue to create or update. - * The queue's [name][google.cloud.tasks.v2beta3.Queue.name] must be - * specified. - * Output only fields cannot be modified using UpdateQueue. - * Any value specified for an output only field will be ignored. - * The queue's [name][google.cloud.tasks.v2beta3.Queue.name] cannot be - * changed. - * @type \Google\Protobuf\FieldMask $update_mask - * A mask used to specify which fields of the queue are being updated. - * If empty, then all fields will be updated. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Cloudtasks::initOnce(); - parent::__construct($data); - } - - /** - * Required. The queue to create or update. - * The queue's [name][google.cloud.tasks.v2beta3.Queue.name] must be - * specified. - * Output only fields cannot be modified using UpdateQueue. - * Any value specified for an output only field will be ignored. - * The queue's [name][google.cloud.tasks.v2beta3.Queue.name] cannot be - * changed. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.Queue queue = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Tasks\V2beta3\Queue|null - */ - public function getQueue() - { - return $this->queue; - } - - public function hasQueue() - { - return isset($this->queue); - } - - public function clearQueue() - { - unset($this->queue); - } - - /** - * Required. The queue to create or update. - * The queue's [name][google.cloud.tasks.v2beta3.Queue.name] must be - * specified. - * Output only fields cannot be modified using UpdateQueue. - * Any value specified for an output only field will be ignored. - * The queue's [name][google.cloud.tasks.v2beta3.Queue.name] cannot be - * changed. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.Queue queue = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Tasks\V2beta3\Queue $var - * @return $this - */ - public function setQueue($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\Queue::class); - $this->queue = $var; - - return $this; - } - - /** - * A mask used to specify which fields of the queue are being updated. - * If empty, then all fields will be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * A mask used to specify which fields of the queue are being updated. - * If empty, then all fields will be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/UriOverride.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/UriOverride.php deleted file mode 100644 index 99ef21814b14..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/UriOverride.php +++ /dev/null @@ -1,353 +0,0 @@ -google.cloud.tasks.v2beta3.UriOverride - */ -class UriOverride extends \Google\Protobuf\Internal\Message -{ - /** - * Scheme override. - * When specified, the task URI scheme is replaced by the provided value (HTTP - * or HTTPS). - * - * Generated from protobuf field optional .google.cloud.tasks.v2beta3.UriOverride.Scheme scheme = 1; - */ - protected $scheme = null; - /** - * Host override. - * When specified, replaces the host part of the task URL. For example, - * if the task URL is "https://www.google.com," and host value is set to - * "example.net", the overridden URI will be changed to "https://example.net." - * Host value cannot be an empty string (INVALID_ARGUMENT). - * - * Generated from protobuf field optional string host = 2; - */ - protected $host = null; - /** - * Port override. - * When specified, replaces the port part of the task URI. For instance, - * for a URI http://www.google.com/foo and port=123, the overridden URI - * becomes http://www.google.com:123/foo. Note that the port value must be a - * positive integer. Setting the port to 0 (Zero) clears the URI port. - * - * Generated from protobuf field optional int64 port = 3; - */ - protected $port = null; - /** - * URI path. - * When specified, replaces the existing path of the task URL. Setting the - * path value to an empty string clears the URI path segment. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.PathOverride path_override = 4; - */ - protected $path_override = null; - /** - * URI Query. - * When specified, replaces the query part of the task URI. Setting the - * query value to an empty string clears the URI query segment. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.QueryOverride query_override = 5; - */ - protected $query_override = null; - /** - * URI Override Enforce Mode - * When specified, determines the Target UriOverride mode. If not specified, - * it defaults to ALWAYS. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.UriOverride.UriOverrideEnforceMode uri_override_enforce_mode = 6; - */ - protected $uri_override_enforce_mode = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $scheme - * Scheme override. - * When specified, the task URI scheme is replaced by the provided value (HTTP - * or HTTPS). - * @type string $host - * Host override. - * When specified, replaces the host part of the task URL. For example, - * if the task URL is "https://www.google.com," and host value is set to - * "example.net", the overridden URI will be changed to "https://example.net." - * Host value cannot be an empty string (INVALID_ARGUMENT). - * @type int|string $port - * Port override. - * When specified, replaces the port part of the task URI. For instance, - * for a URI http://www.google.com/foo and port=123, the overridden URI - * becomes http://www.google.com:123/foo. Note that the port value must be a - * positive integer. Setting the port to 0 (Zero) clears the URI port. - * @type \Google\Cloud\Tasks\V2beta3\PathOverride $path_override - * URI path. - * When specified, replaces the existing path of the task URL. Setting the - * path value to an empty string clears the URI path segment. - * @type \Google\Cloud\Tasks\V2beta3\QueryOverride $query_override - * URI Query. - * When specified, replaces the query part of the task URI. Setting the - * query value to an empty string clears the URI query segment. - * @type int $uri_override_enforce_mode - * URI Override Enforce Mode - * When specified, determines the Target UriOverride mode. If not specified, - * it defaults to ALWAYS. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Target::initOnce(); - parent::__construct($data); - } - - /** - * Scheme override. - * When specified, the task URI scheme is replaced by the provided value (HTTP - * or HTTPS). - * - * Generated from protobuf field optional .google.cloud.tasks.v2beta3.UriOverride.Scheme scheme = 1; - * @return int - */ - public function getScheme() - { - return isset($this->scheme) ? $this->scheme : 0; - } - - public function hasScheme() - { - return isset($this->scheme); - } - - public function clearScheme() - { - unset($this->scheme); - } - - /** - * Scheme override. - * When specified, the task URI scheme is replaced by the provided value (HTTP - * or HTTPS). - * - * Generated from protobuf field optional .google.cloud.tasks.v2beta3.UriOverride.Scheme scheme = 1; - * @param int $var - * @return $this - */ - public function setScheme($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta3\UriOverride\Scheme::class); - $this->scheme = $var; - - return $this; - } - - /** - * Host override. - * When specified, replaces the host part of the task URL. For example, - * if the task URL is "https://www.google.com," and host value is set to - * "example.net", the overridden URI will be changed to "https://example.net." - * Host value cannot be an empty string (INVALID_ARGUMENT). - * - * Generated from protobuf field optional string host = 2; - * @return string - */ - public function getHost() - { - return isset($this->host) ? $this->host : ''; - } - - public function hasHost() - { - return isset($this->host); - } - - public function clearHost() - { - unset($this->host); - } - - /** - * Host override. - * When specified, replaces the host part of the task URL. For example, - * if the task URL is "https://www.google.com," and host value is set to - * "example.net", the overridden URI will be changed to "https://example.net." - * Host value cannot be an empty string (INVALID_ARGUMENT). - * - * Generated from protobuf field optional string host = 2; - * @param string $var - * @return $this - */ - public function setHost($var) - { - GPBUtil::checkString($var, True); - $this->host = $var; - - return $this; - } - - /** - * Port override. - * When specified, replaces the port part of the task URI. For instance, - * for a URI http://www.google.com/foo and port=123, the overridden URI - * becomes http://www.google.com:123/foo. Note that the port value must be a - * positive integer. Setting the port to 0 (Zero) clears the URI port. - * - * Generated from protobuf field optional int64 port = 3; - * @return int|string - */ - public function getPort() - { - return isset($this->port) ? $this->port : 0; - } - - public function hasPort() - { - return isset($this->port); - } - - public function clearPort() - { - unset($this->port); - } - - /** - * Port override. - * When specified, replaces the port part of the task URI. For instance, - * for a URI http://www.google.com/foo and port=123, the overridden URI - * becomes http://www.google.com:123/foo. Note that the port value must be a - * positive integer. Setting the port to 0 (Zero) clears the URI port. - * - * Generated from protobuf field optional int64 port = 3; - * @param int|string $var - * @return $this - */ - public function setPort($var) - { - GPBUtil::checkInt64($var); - $this->port = $var; - - return $this; - } - - /** - * URI path. - * When specified, replaces the existing path of the task URL. Setting the - * path value to an empty string clears the URI path segment. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.PathOverride path_override = 4; - * @return \Google\Cloud\Tasks\V2beta3\PathOverride|null - */ - public function getPathOverride() - { - return $this->path_override; - } - - public function hasPathOverride() - { - return isset($this->path_override); - } - - public function clearPathOverride() - { - unset($this->path_override); - } - - /** - * URI path. - * When specified, replaces the existing path of the task URL. Setting the - * path value to an empty string clears the URI path segment. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.PathOverride path_override = 4; - * @param \Google\Cloud\Tasks\V2beta3\PathOverride $var - * @return $this - */ - public function setPathOverride($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\PathOverride::class); - $this->path_override = $var; - - return $this; - } - - /** - * URI Query. - * When specified, replaces the query part of the task URI. Setting the - * query value to an empty string clears the URI query segment. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.QueryOverride query_override = 5; - * @return \Google\Cloud\Tasks\V2beta3\QueryOverride|null - */ - public function getQueryOverride() - { - return $this->query_override; - } - - public function hasQueryOverride() - { - return isset($this->query_override); - } - - public function clearQueryOverride() - { - unset($this->query_override); - } - - /** - * URI Query. - * When specified, replaces the query part of the task URI. Setting the - * query value to an empty string clears the URI query segment. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.QueryOverride query_override = 5; - * @param \Google\Cloud\Tasks\V2beta3\QueryOverride $var - * @return $this - */ - public function setQueryOverride($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta3\QueryOverride::class); - $this->query_override = $var; - - return $this; - } - - /** - * URI Override Enforce Mode - * When specified, determines the Target UriOverride mode. If not specified, - * it defaults to ALWAYS. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.UriOverride.UriOverrideEnforceMode uri_override_enforce_mode = 6; - * @return int - */ - public function getUriOverrideEnforceMode() - { - return $this->uri_override_enforce_mode; - } - - /** - * URI Override Enforce Mode - * When specified, determines the Target UriOverride mode. If not specified, - * it defaults to ALWAYS. - * - * Generated from protobuf field .google.cloud.tasks.v2beta3.UriOverride.UriOverrideEnforceMode uri_override_enforce_mode = 6; - * @param int $var - * @return $this - */ - public function setUriOverrideEnforceMode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2beta3\UriOverride\UriOverrideEnforceMode::class); - $this->uri_override_enforce_mode = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/UriOverride/Scheme.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/UriOverride/Scheme.php deleted file mode 100644 index 1711330bfdfb..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/UriOverride/Scheme.php +++ /dev/null @@ -1,66 +0,0 @@ -google.cloud.tasks.v2beta3.UriOverride.Scheme - */ -class Scheme -{ - /** - * Scheme unspecified. Defaults to HTTPS. - * - * Generated from protobuf enum SCHEME_UNSPECIFIED = 0; - */ - const SCHEME_UNSPECIFIED = 0; - /** - * Convert the scheme to HTTP, e.g., https://www.google.ca will change to - * http://www.google.ca. - * - * Generated from protobuf enum HTTP = 1; - */ - const HTTP = 1; - /** - * Convert the scheme to HTTPS, e.g., http://www.google.ca will change to - * https://www.google.ca. - * - * Generated from protobuf enum HTTPS = 2; - */ - const HTTPS = 2; - - private static $valueToName = [ - self::SCHEME_UNSPECIFIED => 'SCHEME_UNSPECIFIED', - self::HTTP => 'HTTP', - self::HTTPS => 'HTTPS', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Scheme::class, \Google\Cloud\Tasks\V2beta3\UriOverride_Scheme::class); - diff --git a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/UriOverride/UriOverrideEnforceMode.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/UriOverride/UriOverrideEnforceMode.php deleted file mode 100644 index be36cdfbe464..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/UriOverride/UriOverrideEnforceMode.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.tasks.v2beta3.UriOverride.UriOverrideEnforceMode - */ -class UriOverrideEnforceMode -{ - /** - * OverrideMode Unspecified. Defaults to ALWAYS. - * - * Generated from protobuf enum URI_OVERRIDE_ENFORCE_MODE_UNSPECIFIED = 0; - */ - const URI_OVERRIDE_ENFORCE_MODE_UNSPECIFIED = 0; - /** - * In the IF_NOT_EXISTS mode, queue-level configuration is only - * applied where task-level configuration does not exist. - * - * Generated from protobuf enum IF_NOT_EXISTS = 1; - */ - const IF_NOT_EXISTS = 1; - /** - * In the ALWAYS mode, queue-level configuration overrides all - * task-level configuration - * - * Generated from protobuf enum ALWAYS = 2; - */ - const ALWAYS = 2; - - private static $valueToName = [ - self::URI_OVERRIDE_ENFORCE_MODE_UNSPECIFIED => 'URI_OVERRIDE_ENFORCE_MODE_UNSPECIFIED', - self::IF_NOT_EXISTS => 'IF_NOT_EXISTS', - self::ALWAYS => 'ALWAYS', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(UriOverrideEnforceMode::class, \Google\Cloud\Tasks\V2beta3\UriOverride_UriOverrideEnforceMode::class); - diff --git a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/create_queue.php b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/create_queue.php deleted file mode 100644 index a550d82cc75c..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/create_queue.php +++ /dev/null @@ -1,85 +0,0 @@ -createQueue($formattedParent, $queue); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = CloudTasksClient::locationName('[PROJECT]', '[LOCATION]'); - - create_queue_sample($formattedParent); -} -// [END cloudtasks_v2beta3_generated_CloudTasks_CreateQueue_sync] diff --git a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/create_task.php b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/create_task.php deleted file mode 100644 index 4210d260bed5..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/create_task.php +++ /dev/null @@ -1,76 +0,0 @@ -createTask($formattedParent, $task); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = CloudTasksClient::queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - - create_task_sample($formattedParent); -} -// [END cloudtasks_v2beta3_generated_CloudTasks_CreateTask_sync] diff --git a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/delete_queue.php b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/delete_queue.php deleted file mode 100644 index a2468d76a522..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/delete_queue.php +++ /dev/null @@ -1,77 +0,0 @@ -deleteQueue($formattedName); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudTasksClient::queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - - delete_queue_sample($formattedName); -} -// [END cloudtasks_v2beta3_generated_CloudTasks_DeleteQueue_sync] diff --git a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/delete_task.php b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/delete_task.php deleted file mode 100644 index a131ad410095..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/delete_task.php +++ /dev/null @@ -1,69 +0,0 @@ -deleteTask($formattedName); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudTasksClient::taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - - delete_task_sample($formattedName); -} -// [END cloudtasks_v2beta3_generated_CloudTasks_DeleteTask_sync] diff --git a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/get_iam_policy.php b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/get_iam_policy.php deleted file mode 100644 index 287e8a4b9401..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/get_iam_policy.php +++ /dev/null @@ -1,74 +0,0 @@ -getIamPolicy($resource); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - - get_iam_policy_sample($resource); -} -// [END cloudtasks_v2beta3_generated_CloudTasks_GetIamPolicy_sync] diff --git a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/get_location.php b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/get_location.php deleted file mode 100644 index c87c50e29e10..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/get_location.php +++ /dev/null @@ -1,53 +0,0 @@ -getLocation(); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END cloudtasks_v2beta3_generated_CloudTasks_GetLocation_sync] diff --git a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/get_queue.php b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/get_queue.php deleted file mode 100644 index b7bb947057e2..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/get_queue.php +++ /dev/null @@ -1,67 +0,0 @@ -getQueue($formattedName); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudTasksClient::queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - - get_queue_sample($formattedName); -} -// [END cloudtasks_v2beta3_generated_CloudTasks_GetQueue_sync] diff --git a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/get_task.php b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/get_task.php deleted file mode 100644 index 679006068828..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/get_task.php +++ /dev/null @@ -1,67 +0,0 @@ -getTask($formattedName); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudTasksClient::taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - - get_task_sample($formattedName); -} -// [END cloudtasks_v2beta3_generated_CloudTasks_GetTask_sync] diff --git a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/list_locations.php b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/list_locations.php deleted file mode 100644 index f5495e55af5d..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/list_locations.php +++ /dev/null @@ -1,58 +0,0 @@ -listLocations(); - - /** @var Location $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END cloudtasks_v2beta3_generated_CloudTasks_ListLocations_sync] diff --git a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/list_queues.php b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/list_queues.php deleted file mode 100644 index 5158c1b76ade..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/list_queues.php +++ /dev/null @@ -1,74 +0,0 @@ -listQueues($formattedParent); - - /** @var Queue $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = CloudTasksClient::locationName('[PROJECT]', '[LOCATION]'); - - list_queues_sample($formattedParent); -} -// [END cloudtasks_v2beta3_generated_CloudTasks_ListQueues_sync] diff --git a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/list_tasks.php b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/list_tasks.php deleted file mode 100644 index 63228c12a8cc..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/list_tasks.php +++ /dev/null @@ -1,80 +0,0 @@ -listTasks($formattedParent); - - /** @var Task $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = CloudTasksClient::queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - - list_tasks_sample($formattedParent); -} -// [END cloudtasks_v2beta3_generated_CloudTasks_ListTasks_sync] diff --git a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/pause_queue.php b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/pause_queue.php deleted file mode 100644 index ec9dc04545e2..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/pause_queue.php +++ /dev/null @@ -1,74 +0,0 @@ -pauseQueue($formattedName); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudTasksClient::queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - - pause_queue_sample($formattedName); -} -// [END cloudtasks_v2beta3_generated_CloudTasks_PauseQueue_sync] diff --git a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/purge_queue.php b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/purge_queue.php deleted file mode 100644 index 3b2d46dd6ac7..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/purge_queue.php +++ /dev/null @@ -1,72 +0,0 @@ -purgeQueue($formattedName); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudTasksClient::queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - - purge_queue_sample($formattedName); -} -// [END cloudtasks_v2beta3_generated_CloudTasks_PurgeQueue_sync] diff --git a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/resume_queue.php b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/resume_queue.php deleted file mode 100644 index 7c944dd8e591..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/resume_queue.php +++ /dev/null @@ -1,81 +0,0 @@ -resumeQueue($formattedName); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudTasksClient::queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - - resume_queue_sample($formattedName); -} -// [END cloudtasks_v2beta3_generated_CloudTasks_ResumeQueue_sync] diff --git a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/run_task.php b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/run_task.php deleted file mode 100644 index 2ada5904ec08..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/run_task.php +++ /dev/null @@ -1,93 +0,0 @@ -runTask($formattedName); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudTasksClient::taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - - run_task_sample($formattedName); -} -// [END cloudtasks_v2beta3_generated_CloudTasks_RunTask_sync] diff --git a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/set_iam_policy.php b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/set_iam_policy.php deleted file mode 100644 index 547643a9d362..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/set_iam_policy.php +++ /dev/null @@ -1,79 +0,0 @@ -setIamPolicy($resource, $policy); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - - set_iam_policy_sample($resource); -} -// [END cloudtasks_v2beta3_generated_CloudTasks_SetIamPolicy_sync] diff --git a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/test_iam_permissions.php b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/test_iam_permissions.php deleted file mode 100644 index fcf085d532b7..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/test_iam_permissions.php +++ /dev/null @@ -1,81 +0,0 @@ -testIamPermissions($resource, $permissions); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $resource = '[RESOURCE]'; - $permissionsElement = '[PERMISSIONS]'; - - test_iam_permissions_sample($resource, $permissionsElement); -} -// [END cloudtasks_v2beta3_generated_CloudTasks_TestIamPermissions_sync] diff --git a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/update_queue.php b/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/update_queue.php deleted file mode 100644 index d793d7f4046f..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/samples/V2beta3/CloudTasksClient/update_queue.php +++ /dev/null @@ -1,70 +0,0 @@ -updateQueue($queue); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END cloudtasks_v2beta3_generated_CloudTasks_UpdateQueue_sync] diff --git a/owl-bot-staging/Tasks/v2beta3/src/V2beta3/CloudTasksClient.php b/owl-bot-staging/Tasks/v2beta3/src/V2beta3/CloudTasksClient.php deleted file mode 100644 index 59762f56ffc9..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/src/V2beta3/CloudTasksClient.php +++ /dev/null @@ -1,36 +0,0 @@ -locationName('[PROJECT]', '[LOCATION]'); - * $queue = new Queue(); - * $response = $cloudTasksClient->createQueue($formattedParent, $queue); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @experimental - * - * @deprecated This class will be removed in the next major version update. - */ -class CloudTasksGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.tasks.v2beta3.CloudTasks'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'cloudtasks.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'cloudtasks.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $locationNameTemplate; - - private static $queueNameTemplate; - - private static $taskNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/cloud_tasks_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/cloud_tasks_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/cloud_tasks_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/cloud_tasks_rest_client_config.php', - ], - ], - ]; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getQueueNameTemplate() - { - if (self::$queueNameTemplate == null) { - self::$queueNameTemplate = new PathTemplate('projects/{project}/locations/{location}/queues/{queue}'); - } - - return self::$queueNameTemplate; - } - - private static function getTaskNameTemplate() - { - if (self::$taskNameTemplate == null) { - self::$taskNameTemplate = new PathTemplate('projects/{project}/locations/{location}/queues/{queue}/tasks/{task}'); - } - - return self::$taskNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'location' => self::getLocationNameTemplate(), - 'queue' => self::getQueueNameTemplate(), - 'task' => self::getTaskNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - * - * @experimental - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a queue - * resource. - * - * @param string $project - * @param string $location - * @param string $queue - * - * @return string The formatted queue resource. - * - * @experimental - */ - public static function queueName($project, $location, $queue) - { - return self::getQueueNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'queue' => $queue, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a task - * resource. - * - * @param string $project - * @param string $location - * @param string $queue - * @param string $task - * - * @return string The formatted task resource. - * - * @experimental - */ - public static function taskName($project, $location, $queue, $task) - { - return self::getTaskNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'queue' => $queue, - 'task' => $task, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - location: projects/{project}/locations/{location} - * - queue: projects/{project}/locations/{location}/queues/{queue} - * - task: projects/{project}/locations/{location}/queues/{queue}/tasks/{task} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - * - * @experimental - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'cloudtasks.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - * - * @experimental - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Creates a queue. - * - * Queues created with this method allow tasks to live for a maximum of 31 - * days. After a task is 31 days old, the task will be deleted regardless of - * whether it was dispatched or not. - * - * WARNING: Using this method may have unintended side effects if you are - * using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - * Read - * [Overview of Queue Management and - * queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - * this method. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $formattedParent = $cloudTasksClient->locationName('[PROJECT]', '[LOCATION]'); - * $queue = new Queue(); - * $response = $cloudTasksClient->createQueue($formattedParent, $queue); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $parent Required. The location name in which the queue will be created. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * - * The list of allowed locations can be obtained by calling Cloud - * Tasks' implementation of - * [ListLocations][google.cloud.location.Locations.ListLocations]. - * @param Queue $queue Required. The queue to create. - * - * [Queue's name][google.cloud.tasks.v2beta3.Queue.name] cannot be the same as - * an existing queue. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Tasks\V2beta3\Queue - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createQueue($parent, $queue, array $optionalArgs = []) - { - $request = new CreateQueueRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setQueue($queue); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateQueue', Queue::class, $optionalArgs, $request)->wait(); - } - - /** - * Creates a task and adds it to a queue. - * - * Tasks cannot be updated after creation; there is no UpdateTask command. - * - * * The maximum task size is 100KB. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $formattedParent = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - * $task = new Task(); - * $response = $cloudTasksClient->createTask($formattedParent, $task); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $parent Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * - * The queue must already exist. - * @param Task $task Required. The task to add. - * - * Task names have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. - * The user can optionally specify a task - * [name][google.cloud.tasks.v2beta3.Task.name]. If a name is not specified - * then the system will generate a random unique task id, which will be set in - * the task returned in the [response][google.cloud.tasks.v2beta3.Task.name]. - * - * If [schedule_time][google.cloud.tasks.v2beta3.Task.schedule_time] is not - * set or is in the past then Cloud Tasks will set it to the current time. - * - * Task De-duplication: - * - * Explicitly specifying a task ID enables task de-duplication. If - * a task's ID is identical to that of an existing task or a task - * that was deleted or executed recently then the call will fail - * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. - * If the task's queue was created using Cloud Tasks, then another task with - * the same name can't be created for ~1 hour after the original task was - * deleted or executed. If the task's queue was created using queue.yaml or - * queue.xml, then another task with the same name can't be created - * for ~9 days after the original task was deleted or executed. - * - * Because there is an extra lookup cost to identify duplicate task - * names, these [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask] - * calls have significantly increased latency. Using hashed strings for the - * task id or for the prefix of the task id is recommended. Choosing task ids - * that are sequential or have sequential prefixes, for example using a - * timestamp, causes an increase in latency and error rates in all - * task commands. The infrastructure relies on an approximately - * uniform distribution of task ids to store and serve tasks - * efficiently. - * @param array $optionalArgs { - * Optional. - * - * @type int $responseView - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta3.Task] will be returned. - * - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * - * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta3.Task] resource. - * For allowed values, use constants defined on {@see \Google\Cloud\Tasks\V2beta3\Task\View} - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Tasks\V2beta3\Task - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createTask($parent, $task, array $optionalArgs = []) - { - $request = new CreateTaskRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setTask($task); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['responseView'])) { - $request->setResponseView($optionalArgs['responseView']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateTask', Task::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes a queue. - * - * This command will delete the queue even if it has tasks in it. - * - * Note: If you delete a queue, a queue with the same name can't be created - * for 7 days. - * - * WARNING: Using this method may have unintended side effects if you are - * using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - * Read - * [Overview of Queue Management and - * queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - * this method. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - * $cloudTasksClient->deleteQueue($formattedName); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $name Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteQueue($name, array $optionalArgs = []) - { - $request = new DeleteQueueRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteQueue', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes a task. - * - * A task can be deleted if it is scheduled or dispatched. A task - * cannot be deleted if it has executed successfully or permanently - * failed. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $formattedName = $cloudTasksClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - * $cloudTasksClient->deleteTask($formattedName); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $name Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteTask($name, array $optionalArgs = []) - { - $request = new DeleteTaskRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteTask', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets the access control policy for a - * [Queue][google.cloud.tasks.v2beta3.Queue]. Returns an empty policy if the - * resource exists and does not have a policy set. - * - * Authorization requires the following - * [Google IAM](https://cloud.google.com/iam) permission on the specified - * resource parent: - * - * * `cloudtasks.queues.getIamPolicy` - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $resource = 'resource'; - * $response = $cloudTasksClient->getIamPolicy($resource); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets a queue. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - * $response = $cloudTasksClient->getQueue($formattedName); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the queue. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $readMask - * Optional. Read mask is used for a more granular control over what the API - * returns. If the mask is not present all fields will be returned except - * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - * specified in the mask. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Tasks\V2beta3\Queue - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getQueue($name, array $optionalArgs = []) - { - $request = new GetQueueRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['readMask'])) { - $request->setReadMask($optionalArgs['readMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetQueue', Queue::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets a task. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $formattedName = $cloudTasksClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - * $response = $cloudTasksClient->getTask($formattedName); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $name Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * @param array $optionalArgs { - * Optional. - * - * @type int $responseView - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta3.Task] will be returned. - * - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * - * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta3.Task] resource. - * For allowed values, use constants defined on {@see \Google\Cloud\Tasks\V2beta3\Task\View} - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Tasks\V2beta3\Task - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getTask($name, array $optionalArgs = []) - { - $request = new GetTaskRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['responseView'])) { - $request->setResponseView($optionalArgs['responseView']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetTask', Task::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists queues. - * - * Queues are returned in lexicographical order. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $formattedParent = $cloudTasksClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $cloudTasksClient->listQueues($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $cloudTasksClient->listQueues($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $parent Required. The location name. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * `filter` can be used to specify a subset of queues. Any - * [Queue][google.cloud.tasks.v2beta3.Queue] field can be used as a filter and - * several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The - * filter syntax is the same as described in [Stackdriver's Advanced Logs - * Filters](https://cloud.google.com/logging/docs/view/advanced_filters). - * - * Sample filter "state: PAUSED". - * - * Note that using filters might cause fewer queues than the - * requested page_size to be returned. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type FieldMask $readMask - * Optional. Read mask is used for a more granular control over what the API - * returns. If the mask is not present all fields will be returned except - * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - * specified in the mask. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listQueues($parent, array $optionalArgs = []) - { - $request = new ListQueuesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['readMask'])) { - $request->setReadMask($optionalArgs['readMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListQueues', $optionalArgs, ListQueuesResponse::class, $request); - } - - /** - * Lists the tasks in a queue. - * - * By default, only the [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC] - * view is retrieved due to performance considerations; - * [response_view][google.cloud.tasks.v2beta3.ListTasksRequest.response_view] - * controls the subset of information which is returned. - * - * The tasks may be returned in any order. The ordering may change at any - * time. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $formattedParent = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - * // Iterate over pages of elements - * $pagedResponse = $cloudTasksClient->listTasks($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $cloudTasksClient->listTasks($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $parent Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * @param array $optionalArgs { - * Optional. - * - * @type int $responseView - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta3.Task] will be returned. - * - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * - * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta3.Task] resource. - * For allowed values, use constants defined on {@see \Google\Cloud\Tasks\V2beta3\Task\View} - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listTasks($parent, array $optionalArgs = []) - { - $request = new ListTasksRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['responseView'])) { - $request->setResponseView($optionalArgs['responseView']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListTasks', $optionalArgs, ListTasksResponse::class, $request); - } - - /** - * Pauses the queue. - * - * If a queue is paused then the system will stop dispatching tasks - * until the queue is resumed via - * [ResumeQueue][google.cloud.tasks.v2beta3.CloudTasks.ResumeQueue]. Tasks can - * still be added when the queue is paused. A queue is paused if its - * [state][google.cloud.tasks.v2beta3.Queue.state] is - * [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED]. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - * $response = $cloudTasksClient->pauseQueue($formattedName); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $name Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Tasks\V2beta3\Queue - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function pauseQueue($name, array $optionalArgs = []) - { - $request = new PauseQueueRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('PauseQueue', Queue::class, $optionalArgs, $request)->wait(); - } - - /** - * Purges a queue by deleting all of its tasks. - * - * All tasks created before this method is called are permanently deleted. - * - * Purge operations can take up to one minute to take effect. Tasks - * might be dispatched before the purge takes effect. A purge is irreversible. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - * $response = $cloudTasksClient->purgeQueue($formattedName); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $name Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Tasks\V2beta3\Queue - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function purgeQueue($name, array $optionalArgs = []) - { - $request = new PurgeQueueRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('PurgeQueue', Queue::class, $optionalArgs, $request)->wait(); - } - - /** - * Resume a queue. - * - * This method resumes a queue after it has been - * [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED] or - * [DISABLED][google.cloud.tasks.v2beta3.Queue.State.DISABLED]. The state of a - * queue is stored in the queue's - * [state][google.cloud.tasks.v2beta3.Queue.state]; after calling this method - * it will be set to - * [RUNNING][google.cloud.tasks.v2beta3.Queue.State.RUNNING]. - * - * WARNING: Resuming many high-QPS queues at the same time can - * lead to target overloading. If you are resuming high-QPS - * queues, follow the 500/50/5 pattern described in - * [Managing Cloud Tasks Scaling - * Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling). - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - * $response = $cloudTasksClient->resumeQueue($formattedName); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $name Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Tasks\V2beta3\Queue - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function resumeQueue($name, array $optionalArgs = []) - { - $request = new ResumeQueueRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('ResumeQueue', Queue::class, $optionalArgs, $request)->wait(); - } - - /** - * Forces a task to run now. - * - * When this method is called, Cloud Tasks will dispatch the task, even if - * the task is already running, the queue has reached its - * [RateLimits][google.cloud.tasks.v2beta3.RateLimits] or is - * [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED]. - * - * This command is meant to be used for manual debugging. For - * example, [RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] can be - * used to retry a failed task after a fix has been made or to manually force - * a task to be dispatched now. - * - * The dispatched task is returned. That is, the task that is returned - * contains the [status][Task.status] after the task is dispatched but - * before the task is received by its target. - * - * If Cloud Tasks receives a successful response from the task's - * target, then the task will be deleted; otherwise the task's - * [schedule_time][google.cloud.tasks.v2beta3.Task.schedule_time] will be - * reset to the time that - * [RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] was called plus - * the retry delay specified in the queue's - * [RetryConfig][google.cloud.tasks.v2beta3.RetryConfig]. - * - * [RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] returns - * [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a - * task that has already succeeded or permanently failed. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $formattedName = $cloudTasksClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - * $response = $cloudTasksClient->runTask($formattedName); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $name Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * @param array $optionalArgs { - * Optional. - * - * @type int $responseView - * The response_view specifies which subset of the - * [Task][google.cloud.tasks.v2beta3.Task] will be returned. - * - * By default response_view is - * [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all information is - * retrieved by default because some data, such as payloads, might be - * desirable to return only when needed because of its large size or because - * of the sensitivity of data that it contains. - * - * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] - * requires `cloudtasks.tasks.fullView` [Google - * IAM](https://cloud.google.com/iam/) permission on the - * [Task][google.cloud.tasks.v2beta3.Task] resource. - * For allowed values, use constants defined on {@see \Google\Cloud\Tasks\V2beta3\Task\View} - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Tasks\V2beta3\Task - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function runTask($name, array $optionalArgs = []) - { - $request = new RunTaskRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['responseView'])) { - $request->setResponseView($optionalArgs['responseView']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('RunTask', Task::class, $optionalArgs, $request)->wait(); - } - - /** - * Sets the access control policy for a - * [Queue][google.cloud.tasks.v2beta3.Queue]. Replaces any existing policy. - * - * Note: The Cloud Console does not check queue-level IAM permissions yet. - * Project-level permissions are required to use the Cloud Console. - * - * Authorization requires the following - * [Google IAM](https://cloud.google.com/iam) permission on the specified - * resource parent: - * - * * `cloudtasks.queues.setIamPolicy` - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $cloudTasksClient->setIamPolicy($resource, $policy); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); - } - - /** - * Returns permissions that a caller has on a - * [Queue][google.cloud.tasks.v2beta3.Queue]. If the resource does not exist, - * this will return an empty set of permissions, not a - * [NOT_FOUND][google.rpc.Code.NOT_FOUND] error. - * - * Note: This operation is designed to be used for building permission-aware - * UIs and command-line tools, not for authorization checking. This operation - * may "fail open" without warning. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $cloudTasksClient->testIamPermissions($resource, $permissions); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function testIamPermissions($resource, $permissions, array $optionalArgs = []) - { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('TestIamPermissions', TestIamPermissionsResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Updates a queue. - * - * This method creates the queue if it does not exist and updates - * the queue if it does exist. - * - * Queues created with this method allow tasks to live for a maximum of 31 - * days. After a task is 31 days old, the task will be deleted regardless of - * whether it was dispatched or not. - * - * WARNING: Using this method may have unintended side effects if you are - * using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - * Read - * [Overview of Queue Management and - * queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - * this method. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $queue = new Queue(); - * $response = $cloudTasksClient->updateQueue($queue); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param Queue $queue Required. The queue to create or update. - * - * The queue's [name][google.cloud.tasks.v2beta3.Queue.name] must be - * specified. - * - * Output only fields cannot be modified using UpdateQueue. - * Any value specified for an output only field will be ignored. - * The queue's [name][google.cloud.tasks.v2beta3.Queue.name] cannot be - * changed. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * A mask used to specify which fields of the queue are being updated. - * - * If empty, then all fields will be updated. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Tasks\V2beta3\Queue - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function updateQueue($queue, array $optionalArgs = []) - { - $request = new UpdateQueueRequest(); - $requestParamHeaders = []; - $request->setQueue($queue); - $requestParamHeaders['queue.name'] = $queue->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateQueue', Queue::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $response = $cloudTasksClient->getLocation(); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $cloudTasksClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $cloudTasksClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $cloudTasksClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); - } -} diff --git a/owl-bot-staging/Tasks/v2beta3/src/V2beta3/gapic_metadata.json b/owl-bot-staging/Tasks/v2beta3/src/V2beta3/gapic_metadata.json deleted file mode 100644 index 91fdac01bfc2..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/src/V2beta3/gapic_metadata.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.cloud.tasks.v2beta3", - "libraryPackage": "Google\\Cloud\\Tasks\\V2beta3", - "services": { - "CloudTasks": { - "clients": { - "grpc": { - "libraryClient": "CloudTasksGapicClient", - "rpcs": { - "CreateQueue": { - "methods": [ - "createQueue" - ] - }, - "CreateTask": { - "methods": [ - "createTask" - ] - }, - "DeleteQueue": { - "methods": [ - "deleteQueue" - ] - }, - "DeleteTask": { - "methods": [ - "deleteTask" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "GetQueue": { - "methods": [ - "getQueue" - ] - }, - "GetTask": { - "methods": [ - "getTask" - ] - }, - "ListQueues": { - "methods": [ - "listQueues" - ] - }, - "ListTasks": { - "methods": [ - "listTasks" - ] - }, - "PauseQueue": { - "methods": [ - "pauseQueue" - ] - }, - "PurgeQueue": { - "methods": [ - "purgeQueue" - ] - }, - "ResumeQueue": { - "methods": [ - "resumeQueue" - ] - }, - "RunTask": { - "methods": [ - "runTask" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - }, - "UpdateQueue": { - "methods": [ - "updateQueue" - ] - }, - "GetLocation": { - "methods": [ - "getLocation" - ] - }, - "ListLocations": { - "methods": [ - "listLocations" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/Tasks/v2beta3/src/V2beta3/resources/cloud_tasks_client_config.json b/owl-bot-staging/Tasks/v2beta3/src/V2beta3/resources/cloud_tasks_client_config.json deleted file mode 100644 index d68dd2e3a24f..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/src/V2beta3/resources/cloud_tasks_client_config.json +++ /dev/null @@ -1,135 +0,0 @@ -{ - "interfaces": { - "google.cloud.tasks.v2beta3.CloudTasks": { - "retry_codes": { - "no_retry_codes": [], - "no_retry_1_codes": [], - "retry_policy_1_codes": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "no_retry_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 0, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 0, - "total_timeout_millis": 0 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 20000 - }, - "retry_policy_1_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 10000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 20000 - } - }, - "methods": { - "CreateQueue": { - "timeout_millis": 20000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "CreateTask": { - "timeout_millis": 20000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteQueue": { - "timeout_millis": 20000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "DeleteTask": { - "timeout_millis": 20000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetIamPolicy": { - "timeout_millis": 20000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetQueue": { - "timeout_millis": 20000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetTask": { - "timeout_millis": 20000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListQueues": { - "timeout_millis": 20000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListTasks": { - "timeout_millis": 20000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "PauseQueue": { - "timeout_millis": 20000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "PurgeQueue": { - "timeout_millis": 20000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "ResumeQueue": { - "timeout_millis": 20000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "RunTask": { - "timeout_millis": 20000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "SetIamPolicy": { - "timeout_millis": 20000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "TestIamPermissions": { - "timeout_millis": 20000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "UpdateQueue": { - "timeout_millis": 20000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GetLocation": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListLocations": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - } - } - } - } -} diff --git a/owl-bot-staging/Tasks/v2beta3/src/V2beta3/resources/cloud_tasks_descriptor_config.php b/owl-bot-staging/Tasks/v2beta3/src/V2beta3/resources/cloud_tasks_descriptor_config.php deleted file mode 100644 index 59bc660c1596..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/src/V2beta3/resources/cloud_tasks_descriptor_config.php +++ /dev/null @@ -1,42 +0,0 @@ - [ - 'google.cloud.tasks.v2beta3.CloudTasks' => [ - 'ListQueues' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getQueues', - ], - ], - 'ListTasks' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getTasks', - ], - ], - 'GetLocation' => [ - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'ListLocations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getLocations', - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - ], - ], -]; diff --git a/owl-bot-staging/Tasks/v2beta3/src/V2beta3/resources/cloud_tasks_rest_client_config.php b/owl-bot-staging/Tasks/v2beta3/src/V2beta3/resources/cloud_tasks_rest_client_config.php deleted file mode 100644 index 8bcffbc8b257..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/src/V2beta3/resources/cloud_tasks_rest_client_config.php +++ /dev/null @@ -1,220 +0,0 @@ - [ - 'google.cloud.location.Locations' => [ - 'GetLocation' => [ - 'method' => 'get', - 'uriTemplate' => '/v2beta3/{name=projects/*/locations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListLocations' => [ - 'method' => 'get', - 'uriTemplate' => '/v2beta3/{name=projects/*}/locations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.cloud.tasks.v2beta3.CloudTasks' => [ - 'CreateQueue' => [ - 'method' => 'post', - 'uriTemplate' => '/v2beta3/{parent=projects/*/locations/*}/queues', - 'body' => 'queue', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'CreateTask' => [ - 'method' => 'post', - 'uriTemplate' => '/v2beta3/{parent=projects/*/locations/*/queues/*}/tasks', - 'body' => '*', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteQueue' => [ - 'method' => 'delete', - 'uriTemplate' => '/v2beta3/{name=projects/*/locations/*/queues/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteTask' => [ - 'method' => 'delete', - 'uriTemplate' => '/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v2beta3/{resource=projects/*/locations/*/queues/*}:getIamPolicy', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'GetQueue' => [ - 'method' => 'get', - 'uriTemplate' => '/v2beta3/{name=projects/*/locations/*/queues/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetTask' => [ - 'method' => 'get', - 'uriTemplate' => '/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListQueues' => [ - 'method' => 'get', - 'uriTemplate' => '/v2beta3/{parent=projects/*/locations/*}/queues', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListTasks' => [ - 'method' => 'get', - 'uriTemplate' => '/v2beta3/{parent=projects/*/locations/*/queues/*}/tasks', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'PauseQueue' => [ - 'method' => 'post', - 'uriTemplate' => '/v2beta3/{name=projects/*/locations/*/queues/*}:pause', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'PurgeQueue' => [ - 'method' => 'post', - 'uriTemplate' => '/v2beta3/{name=projects/*/locations/*/queues/*}:purge', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ResumeQueue' => [ - 'method' => 'post', - 'uriTemplate' => '/v2beta3/{name=projects/*/locations/*/queues/*}:resume', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'RunTask' => [ - 'method' => 'post', - 'uriTemplate' => '/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}:run', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'SetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v2beta3/{resource=projects/*/locations/*/queues/*}:setIamPolicy', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'method' => 'post', - 'uriTemplate' => '/v2beta3/{resource=projects/*/locations/*/queues/*}:testIamPermissions', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'UpdateQueue' => [ - 'method' => 'patch', - 'uriTemplate' => '/v2beta3/{queue.name=projects/*/locations/*/queues/*}', - 'body' => 'queue', - 'placeholders' => [ - 'queue.name' => [ - 'getters' => [ - 'getQueue', - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Tasks/v2beta3/tests/Unit/V2beta3/CloudTasksClientTest.php b/owl-bot-staging/Tasks/v2beta3/tests/Unit/V2beta3/CloudTasksClientTest.php deleted file mode 100644 index 539258bf1eb2..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/tests/Unit/V2beta3/CloudTasksClientTest.php +++ /dev/null @@ -1,1189 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return CloudTasksClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new CloudTasksClient($options); - } - - /** @test */ - public function createQueueTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new Queue(); - $expectedResponse->setName($name); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $queue = new Queue(); - $response = $gapicClient->createQueue($formattedParent, $queue); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/CreateQueue', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getQueue(); - $this->assertProtobufEquals($queue, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createQueueExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $queue = new Queue(); - try { - $gapicClient->createQueue($formattedParent, $queue); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createTaskTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $dispatchCount = 1217252086; - $responseCount = 424727441; - $expectedResponse = new Task(); - $expectedResponse->setName($name); - $expectedResponse->setDispatchCount($dispatchCount); - $expectedResponse->setResponseCount($responseCount); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $task = new Task(); - $response = $gapicClient->createTask($formattedParent, $task); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/CreateTask', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getTask(); - $this->assertProtobufEquals($task, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createTaskExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $task = new Task(); - try { - $gapicClient->createTask($formattedParent, $task); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteQueueTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $gapicClient->deleteQueue($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/DeleteQueue', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteQueueExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - try { - $gapicClient->deleteQueue($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteTaskTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - $gapicClient->deleteTask($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/DeleteTask', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteTaskExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - try { - $gapicClient->deleteTask($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getQueueTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new Queue(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $response = $gapicClient->getQueue($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/GetQueue', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getQueueExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - try { - $gapicClient->getQueue($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getTaskTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $dispatchCount = 1217252086; - $responseCount = 424727441; - $expectedResponse = new Task(); - $expectedResponse->setName($name2); - $expectedResponse->setDispatchCount($dispatchCount); - $expectedResponse->setResponseCount($responseCount); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - $response = $gapicClient->getTask($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/GetTask', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getTaskExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - try { - $gapicClient->getTask($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listQueuesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $queuesElement = new Queue(); - $queues = [ - $queuesElement, - ]; - $expectedResponse = new ListQueuesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setQueues($queues); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listQueues($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getQueues()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/ListQueues', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listQueuesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listQueues($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTasksTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $tasksElement = new Task(); - $tasks = [ - $tasksElement, - ]; - $expectedResponse = new ListTasksResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTasks($tasks); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $response = $gapicClient->listTasks($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getTasks()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/ListTasks', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listTasksExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - try { - $gapicClient->listTasks($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function pauseQueueTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new Queue(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $response = $gapicClient->pauseQueue($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/PauseQueue', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function pauseQueueExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - try { - $gapicClient->pauseQueue($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function purgeQueueTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new Queue(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $response = $gapicClient->purgeQueue($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/PurgeQueue', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function purgeQueueExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - try { - $gapicClient->purgeQueue($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function resumeQueueTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new Queue(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $response = $gapicClient->resumeQueue($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/ResumeQueue', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function resumeQueueExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - try { - $gapicClient->resumeQueue($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function runTaskTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $dispatchCount = 1217252086; - $responseCount = 424727441; - $expectedResponse = new Task(); - $expectedResponse->setName($name2); - $expectedResponse->setDispatchCount($dispatchCount); - $expectedResponse->setResponseCount($responseCount); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - $response = $gapicClient->runTask($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/RunTask', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function runTaskExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - try { - $gapicClient->runTask($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateQueueTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new Queue(); - $expectedResponse->setName($name); - $transport->addResponse($expectedResponse); - // Mock request - $queue = new Queue(); - $response = $gapicClient->updateQueue($queue); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/UpdateQueue', $actualFuncCall); - $actualValue = $actualRequestObject->getQueue(); - $this->assertProtobufEquals($queue, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateQueueExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $queue = new Queue(); - try { - $gapicClient->updateQueue($queue); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -}