From 5f94c96de3c6d6cb4d0bfb0c5acc0cc03ff4fcea Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 5 Jan 2022 07:58:12 +0000 Subject: [PATCH 1/2] feat: update client libraries to support Database operations PiperOrigin-RevId: 419710013 Source-Link: https://github.com/googleapis/googleapis/commit/b7c9d05c60f87c05c8701e67c6ef24699846a42d Source-Link: https://github.com/googleapis/googleapis-gen/commit/ae498279c4e71cd4aa6e0655e92a693df97472c4 Copy-Tag: eyJwIjoiVGFza3MvLk93bEJvdC55YW1sIiwiaCI6ImFlNDk4Mjc5YzRlNzFjZDRhYTZlMDY1NWU5MmE2OTNkZjk3NDcyYzQifQ== --- .../Google/Cloud/Tasks/V2/Cloudtasks.php | 114 ++ .../Google/Cloud/Tasks/V2/Queue.php | Bin 0 -> 2066 bytes .../Google/Cloud/Tasks/V2/Target.php | Bin 0 -> 1844 bytes .../Google/Cloud/Tasks/V2/Task.php | Bin 0 -> 2105 bytes .../Cloud/Tasks/V2/AppEngineHttpRequest.php | 465 +++++ .../Cloud/Tasks/V2/AppEngineRouting.php | 361 ++++ .../src/Google/Cloud/Tasks/V2/Attempt.php | 229 +++ .../Cloud/Tasks/V2/CloudTasksGrpcClient.php | 402 ++++ .../Cloud/Tasks/V2/CreateQueueRequest.php | 131 ++ .../Cloud/Tasks/V2/CreateTaskRequest.php | 297 +++ .../Cloud/Tasks/V2/DeleteQueueRequest.php | 71 + .../Cloud/Tasks/V2/DeleteTaskRequest.php | 72 + .../Google/Cloud/Tasks/V2/GetQueueRequest.php | 71 + .../Google/Cloud/Tasks/V2/GetTaskRequest.php | 141 ++ .../src/Google/Cloud/Tasks/V2/HttpMethod.php | 96 + .../src/Google/Cloud/Tasks/V2/HttpRequest.php | 414 ++++ .../Cloud/Tasks/V2/ListQueuesRequest.php | 249 +++ .../Cloud/Tasks/V2/ListQueuesResponse.php | 121 ++ .../Cloud/Tasks/V2/ListTasksRequest.php | 253 +++ .../Cloud/Tasks/V2/ListTasksResponse.php | 117 ++ .../src/Google/Cloud/Tasks/V2/OAuthToken.php | 128 ++ .../src/Google/Cloud/Tasks/V2/OidcToken.php | 126 ++ .../Cloud/Tasks/V2/PauseQueueRequest.php | 71 + .../Cloud/Tasks/V2/PurgeQueueRequest.php | 71 + .../proto/src/Google/Cloud/Tasks/V2/Queue.php | 579 ++++++ .../src/Google/Cloud/Tasks/V2/Queue/State.php | 89 + .../src/Google/Cloud/Tasks/V2/Queue_State.php | 16 + .../src/Google/Cloud/Tasks/V2/RateLimits.php | 307 +++ .../Cloud/Tasks/V2/ResumeQueueRequest.php | 71 + .../src/Google/Cloud/Tasks/V2/RetryConfig.php | 478 +++++ .../Google/Cloud/Tasks/V2/RunTaskRequest.php | 142 ++ .../Tasks/V2/StackdriverLoggingConfig.php | 80 + .../proto/src/Google/Cloud/Tasks/V2/Task.php | 662 ++++++ .../src/Google/Cloud/Tasks/V2/Task/View.php | 78 + .../src/Google/Cloud/Tasks/V2/Task_View.php | 16 + .../Cloud/Tasks/V2/UpdateQueueRequest.php | 141 ++ .../Tasks/v2/src/V2/CloudTasksClient.php | 34 + .../v2/src/V2/Gapic/CloudTasksGapicClient.php | 1345 +++++++++++++ .../Tasks/v2/src/V2/gapic_metadata.json | 98 + .../resources/cloud_tasks_client_config.json | 125 ++ .../cloud_tasks_descriptor_config.php | 28 + .../cloud_tasks_rest_client_config.php | 195 ++ .../v2/tests/Unit/V2/CloudTasksClientTest.php | 1139 +++++++++++ .../Google/Cloud/Tasks/V2Beta2/Cloudtasks.php | 147 ++ .../Google/Cloud/Tasks/V2Beta2/Queue.php | Bin 0 -> 2596 bytes .../Google/Cloud/Tasks/V2Beta2/Target.php | Bin 0 -> 1466 bytes .../Google/Cloud/Tasks/V2Beta2/Task.php | Bin 0 -> 2146 bytes .../Tasks/V2beta2/AcknowledgeTaskRequest.php | 132 ++ .../Tasks/V2beta2/AppEngineHttpRequest.php | 464 +++++ .../Tasks/V2beta2/AppEngineHttpTarget.php | 102 + .../Cloud/Tasks/V2beta2/AppEngineRouting.php | 500 +++++ .../Cloud/Tasks/V2beta2/AttemptStatus.php | 229 +++ .../Tasks/V2beta2/CancelLeaseRequest.php | 202 ++ .../Tasks/V2beta2/CloudTasksGrpcClient.php | 508 +++++ .../Tasks/V2beta2/CreateQueueRequest.php | 131 ++ .../Cloud/Tasks/V2beta2/CreateTaskRequest.php | 297 +++ .../Tasks/V2beta2/DeleteQueueRequest.php | 71 + .../Cloud/Tasks/V2beta2/DeleteTaskRequest.php | 72 + .../Cloud/Tasks/V2beta2/GetQueueRequest.php | 127 ++ .../Cloud/Tasks/V2beta2/GetTaskRequest.php | 141 ++ .../Google/Cloud/Tasks/V2beta2/HttpMethod.php | 82 + .../Cloud/Tasks/V2beta2/LeaseTasksRequest.php | 413 ++++ .../Tasks/V2beta2/LeaseTasksResponse.php | 67 + .../Cloud/Tasks/V2beta2/ListQueuesRequest.php | 305 +++ .../Tasks/V2beta2/ListQueuesResponse.php | 121 ++ .../Cloud/Tasks/V2beta2/ListTasksRequest.php | 253 +++ .../Cloud/Tasks/V2beta2/ListTasksResponse.php | 117 ++ .../Cloud/Tasks/V2beta2/PauseQueueRequest.php | 71 + .../Cloud/Tasks/V2beta2/PullMessage.php | 160 ++ .../Google/Cloud/Tasks/V2beta2/PullTarget.php | 33 + .../Cloud/Tasks/V2beta2/PurgeQueueRequest.php | 71 + .../src/Google/Cloud/Tasks/V2beta2/Queue.php | 708 +++++++ .../Cloud/Tasks/V2beta2/Queue/State.php | 93 + .../Google/Cloud/Tasks/V2beta2/QueueStats.php | 253 +++ .../Cloud/Tasks/V2beta2/Queue_State.php | 16 + .../Google/Cloud/Tasks/V2beta2/RateLimits.php | 331 +++ .../Cloud/Tasks/V2beta2/RenewLeaseRequest.php | 254 +++ .../Tasks/V2beta2/ResumeQueueRequest.php | 71 + .../Cloud/Tasks/V2beta2/RetryConfig.php | 508 +++++ .../Cloud/Tasks/V2beta2/RunTaskRequest.php | 142 ++ .../src/Google/Cloud/Tasks/V2beta2/Task.php | 422 ++++ .../Google/Cloud/Tasks/V2beta2/Task/View.php | 79 + .../Google/Cloud/Tasks/V2beta2/TaskStatus.php | 217 ++ .../Google/Cloud/Tasks/V2beta2/Task_View.php | 16 + .../Tasks/V2beta2/UpdateQueueRequest.php | 141 ++ .../v2beta2/src/V2beta2/CloudTasksClient.php | 36 + .../V2beta2/Gapic/CloudTasksGapicClient.php | 1785 +++++++++++++++++ .../v2beta2/src/V2beta2/gapic_metadata.json | 118 ++ .../resources/cloud_tasks_client_config.json | 145 ++ .../cloud_tasks_descriptor_config.php | 28 + .../cloud_tasks_rest_client_config.php | 243 +++ .../Unit/V2beta2/CloudTasksClientTest.php | 1401 +++++++++++++ .../Google/Cloud/Tasks/V2Beta3/Cloudtasks.php | 116 ++ .../Google/Cloud/Tasks/V2Beta3/Queue.php | Bin 0 -> 2731 bytes .../Google/Cloud/Tasks/V2Beta3/Target.php | Bin 0 -> 1965 bytes .../Google/Cloud/Tasks/V2Beta3/Task.php | Bin 0 -> 2238 bytes .../Tasks/V2beta3/AppEngineHttpQueue.php | 102 + .../Tasks/V2beta3/AppEngineHttpRequest.php | 454 +++++ .../Cloud/Tasks/V2beta3/AppEngineRouting.php | 356 ++++ .../Google/Cloud/Tasks/V2beta3/Attempt.php | 229 +++ .../Tasks/V2beta3/CloudTasksGrpcClient.php | 401 ++++ .../Tasks/V2beta3/CreateQueueRequest.php | 131 ++ .../Cloud/Tasks/V2beta3/CreateTaskRequest.php | 297 +++ .../Tasks/V2beta3/DeleteQueueRequest.php | 71 + .../Cloud/Tasks/V2beta3/DeleteTaskRequest.php | 72 + .../Cloud/Tasks/V2beta3/GetQueueRequest.php | 127 ++ .../Cloud/Tasks/V2beta3/GetTaskRequest.php | 141 ++ .../Google/Cloud/Tasks/V2beta3/HttpMethod.php | 96 + .../Cloud/Tasks/V2beta3/HttpRequest.php | 414 ++++ .../Cloud/Tasks/V2beta3/ListQueuesRequest.php | 305 +++ .../Tasks/V2beta3/ListQueuesResponse.php | 121 ++ .../Cloud/Tasks/V2beta3/ListTasksRequest.php | 253 +++ .../Cloud/Tasks/V2beta3/ListTasksResponse.php | 117 ++ .../Google/Cloud/Tasks/V2beta3/OAuthToken.php | 128 ++ .../Google/Cloud/Tasks/V2beta3/OidcToken.php | 126 ++ .../Cloud/Tasks/V2beta3/PauseQueueRequest.php | 71 + .../Cloud/Tasks/V2beta3/PullMessage.php | 131 ++ .../Cloud/Tasks/V2beta3/PurgeQueueRequest.php | 71 + .../src/Google/Cloud/Tasks/V2beta3/Queue.php | 801 ++++++++ .../Cloud/Tasks/V2beta3/Queue/State.php | 89 + .../Google/Cloud/Tasks/V2beta3/Queue/Type.php | 64 + .../Google/Cloud/Tasks/V2beta3/QueueStats.php | 253 +++ .../Cloud/Tasks/V2beta3/Queue_State.php | 16 + .../Google/Cloud/Tasks/V2beta3/Queue_Type.php | 16 + .../Google/Cloud/Tasks/V2beta3/RateLimits.php | 307 +++ .../Tasks/V2beta3/ResumeQueueRequest.php | 71 + .../Cloud/Tasks/V2beta3/RetryConfig.php | 478 +++++ .../Cloud/Tasks/V2beta3/RunTaskRequest.php | 142 ++ .../V2beta3/StackdriverLoggingConfig.php | 80 + .../src/Google/Cloud/Tasks/V2beta3/Task.php | 717 +++++++ .../Google/Cloud/Tasks/V2beta3/Task/View.php | 78 + .../Google/Cloud/Tasks/V2beta3/Task_View.php | 16 + .../Tasks/V2beta3/UpdateQueueRequest.php | 141 ++ .../v2beta3/src/V2beta3/CloudTasksClient.php | 36 + .../V2beta3/Gapic/CloudTasksGapicClient.php | 1409 +++++++++++++ .../v2beta3/src/V2beta3/gapic_metadata.json | 98 + .../resources/cloud_tasks_client_config.json | 125 ++ .../cloud_tasks_descriptor_config.php | 28 + .../cloud_tasks_rest_client_config.php | 195 ++ .../Unit/V2beta3/CloudTasksClientTest.php | 1139 +++++++++++ 140 files changed, 32075 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/CloudTasksGrpcClient.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/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/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/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/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/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/CloudTasksGrpcClient.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/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/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/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/Queue_State.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/Task_View.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/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/CloudTasksGrpcClient.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/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/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/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/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/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/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/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..7572e8a8e468 --- /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\'AA!cloudtasks.googleapis.com/Queue +filter (  + page_size ( + +page_token ( "[ +ListQueuesResponse, +queues ( 2.google.cloud.tasks.v2.Queue +next_page_token ( "H +GetQueueRequest5 +name ( B\'AA! +cloudtasks.googleapis.com/Queue" +CreateQueueRequest7 +parent ( B\'AA!cloudtasks.googleapis.com/Queue0 +queue ( 2.google.cloud.tasks.v2.QueueBA"w +UpdateQueueRequest0 +queue ( 2.google.cloud.tasks.v2.QueueBA/ + update_mask ( 2.google.protobuf.FieldMask"K +DeleteQueueRequest5 +name ( B\'AA! +cloudtasks.googleapis.com/Queue"J +PurgeQueueRequest5 +name ( B\'AA! +cloudtasks.googleapis.com/Queue"J +PauseQueueRequest5 +name ( B\'AA! +cloudtasks.googleapis.com/Queue"K +ResumeQueueRequest5 +name ( B\'AA! +cloudtasks.googleapis.com/Queue" +ListTasksRequest6 +parent ( B&AA 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&AA +cloudtasks.googleapis.com/Task7 + response_view (2 .google.cloud.tasks.v2.Task.View" +CreateTaskRequest6 +parent ( B&AA cloudtasks.googleapis.com/Task. +task ( 2.google.cloud.tasks.v2.TaskBA7 + response_view (2 .google.cloud.tasks.v2.Task.View"I +DeleteTaskRequest4 +name ( B&AA +cloudtasks.googleapis.com/Task" +RunTaskRequest4 +name ( B&AA +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/*}/queuesAparent +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"H3"*/v2/{parent=projects/*/locations/*}/queues:queueA parent,queue + UpdateQueue).google.cloud.tasks.v2.UpdateQueueRequest.google.cloud.tasks.v2.Queue"S920/v2/{queue.name=projects/*/locations/*/queues/*}:queueAqueue,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"B5"0/v2/{name=projects/*/locations/*/queues/*}:purge:*Aname + +PauseQueue(.google.cloud.tasks.v2.PauseQueueRequest.google.cloud.tasks.v2.Queue"B5"0/v2/{name=projects/*/locations/*/queues/*}:pause:*Aname + ResumeQueue).google.cloud.tasks.v2.ResumeQueueRequest.google.cloud.tasks.v2.Queue"C6"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"cF"A/v2/{resource=projects/*/locations/*/queues/*}:testIamPermissions:*Aresource,permissions + ListTasks\'.google.cloud.tasks.v2.ListTasksRequest(.google.cloud.tasks.v2.ListTasksResponse"C42/v2/{parent=projects/*/locations/*/queues/*}/tasksAparent +GetTask%.google.cloud.tasks.v2.GetTaskRequest.google.cloud.tasks.v2.Task"A42/v2/{name=projects/*/locations/*/queues/*/tasks/*}Aname + +CreateTask(.google.cloud.tasks.v2.CreateTaskRequest.google.cloud.tasks.v2.Task"K7"2/v2/{parent=projects/*/locations/*/queues/*}/tasks:*A parent,task + +DeleteTask(.google.cloud.tasks.v2.DeleteTaskRequest.google.protobuf.Empty"A4*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:*AnameMAcloudtasks.googleapis.comA.https://www.googleapis.com/auth/cloud-platformBr +com.google.cloud.tasks.v2BCloudTasksProtoPZ:google.golang.org/genproto/googleapis/cloud/tasks/v2;tasksTASKSbproto3' + , 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..b0cc4d5fdb0bedd0890d7f145fd1b0e3706ecf22 GIT binary patch literal 2066 zcmbVNVQ(8X7$#fOQKwAfL{VB0bHk)&65NR(CX`Z8+GJIv(uO2O8anB8xpS`GF80m# zRg5Zsihsff{sg~**Y;hSb}5_4mt1nsWBYxc$M5^YPuWF=zQo6b5fLg9Dd_fy8ZDkP$kbrMA|svJV}Wcr96*470OrAyKH%{ zbCMI+tcDN^XGCUUMDX$8@MogJI8>p3Y>57mCi-Jd^nY#bBNU~fl=v6D0J=gLK3P6V zX@sQ;6?{FRGN6nq8m9CQIQapdhN&dLd>cE>S)?duSQE}zM4C^rT~lM9WE?6zz~xZ} zx_Btu?=wXN3sb*KWF%;&xEKJm-A;&FNT&a3J}tJ@%h4%r+B3G>ZyoXgE0L4s-7ywK z<$~>-bL$1>izk1DP@RnWLsH1zzAosRzlwEJUeH-U4ej@)FC^*akP}eye^AF1>{sC| zdw;I3wZjG^wu{V&g8Nh8`KD^9`!%YeVW)pge5d zMKQIzBaL)igt8ox9B2va>t?H+a;s8*cM&{igmz$y=v6Ez=n|wn0kM+us2hgwmHeC5 z>m5ttiRIaIH+raQPqT$S9*sNWUT}Uo8uX6(&-=aZqYs=KdN4dcJ?)EnRh&=JLk*eaLaIPQ zi!~9dIt3MwQ7!~wYH1Y{lWOCy3aSm4oc#oC>ZL-Z$Si{}>A+T&POI$7zFColS?_KBM)_C1FIhm{* e*tdI&M)#E+GD|ZFQV%n8#XK@dJ38iQj?ll;oS_N; 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..6b28eebeb65599e4490c3872da4055a564477ab4 GIT binary patch literal 1844 zcmb7FU2o$=6y1EZ+1v!MtS*EFq}l9B%_4B5Afd|L0!iaGk=VxCdU-&Rtcg8IMs;V* zcpRyV`g?fi7r{Sa#x_aWCKUW)Ykba~bMLux=hgS|GKS~qoG>D=Bq5sJAh{$c7F_ax zM`)JL=R}}@U&k~e!a`^`K^GGbIm5B{Oi>e_ih$T?!TBO0-5}y=*p)cBO1i6_`Vb2u ztt=b>!`CEj1awuj!Ub^LL7AhxWtnn@@6#m34@fb%?d1p8Tk;(u# z4TFNXpApdxF%tzWcuy^8{zFd#Dp%wtuZ{Tu?5%K=lB^(gyL?m{d<+L#AQ$vq=Dwfj z-~PP}2mLs9*n%>0x7hEMRu}z0mG%@&9LGM%0{VidlCni6q|uum?#OJd;7yJ<51=VX zq?E3Rp9-p6Ql6XRjcwJ;wxfsQ-N|UXf7+_%|E*@*1LL0LkD!(iv7!MfTu=)u)nV$W z$ry(U;hdwg(FB5<}r{gpDWaN3S|Jw0JlcE3i;?i|a$7f?_Xgo3>L)D#J zdPd2tLFL@>jIv%DIsKtg(M#@I�OJ`$OkP$8(H5vkrT1-#Z-{`(^`b6W1G0E-sDQ zU=E+En`OI$gGN63vsvtxezuDvz2FgM3yX_IcR^Tovvl)cYJ?>3T|md#oSE%sux}36 Xlk2N|2;Z66JLh$V%%|!t+yeXsn(iy+ literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Tasks/v2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2/Task.php b/owl-bot-staging/Tasks/v2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2/Task.php new file mode 100644 index 0000000000000000000000000000000000000000..b533045336449dfe1cd0c0b590d94f5e29543322 GIT binary patch literal 2105 zcmbVN|8Cnh5Ux9?t(i2-gspXhA>+IPb-=bf=^qi~eMjDX-`)NAvzQ3<9o}UzONnFwKKX#JNFdHFT)t$aLWi)u zVJul1lgR6{jHX=3BprdN>xN8L2~#`mr^U6(9UtSid86xIc;ptAY0f^r9pjYAJdHQ? zyOo1kwel{>Q&({BfE7u1=K;;}m!TH33u#Uv2KUDBDkc3KR05g&AJ8KX>`QVgZjL<= z)H?*a^X%prm7i`LCrTwrd<9Tb{=-kaAh;U@6`wnx@^;05;^PVWyMeBixAm1N09zM; ztqZ_D>#Vn~std({sf_iF!baB#D9;IsG#BUJoIjUkE(?Q)g+VH)qqLW2#lhFb0TJ9G z^Q@TD)?Z7gt_sXrL3LG}%^I$?8`d6rNQCfN9P*g?6DftCviCW#*Srk|%bjPoaeFRS zyDP*%gI)vXz(8K#vRt&X;N&yyq;-XpMeK8QKcf>C=&6~B` z?&RMtLmT?lM(jotptQ_}Y2j#LZ392QF)A}>TC8SHlu%Qf&a_<49FP|X%$e%{te78D z<#^UxMJv!cG7G`!SHIlW|XX-hL>W@v`ce{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 will fail + * 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 documentation for the request handlers in the language your app is + * written in e.g. + * [Python Request + * Handler](https://cloud.google.com/appengine/docs/python/tools/webapp/requesthandlerclass). + * + * 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][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][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 will fail + * 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 documentation for the request handlers in the language your app is + * written in e.g. + * [Python Request + * Handler](https://cloud.google.com/appengine/docs/python/tools/webapp/requesthandlerclass). + * @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][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][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 will fail + * 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 documentation for the request handlers in the language your app is + * written in e.g. + * [Python Request + * Handler](https://cloud.google.com/appengine/docs/python/tools/webapp/requesthandlerclass). + * + * 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 will fail + * 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 documentation for the request handlers in the language your app is + * written in e.g. + * [Python Request + * Handler](https://cloud.google.com/appengine/docs/python/tools/webapp/requesthandlerclass). + * + * 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][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][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][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][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..2aa2abaf387c --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/AppEngineRouting.php @@ -0,0 +1,361 @@ +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/CloudTasksGrpcClient.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/CloudTasksGrpcClient.php new file mode 100644 index 000000000000..aecebe48a9b1 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/CloudTasksGrpcClient.php @@ -0,0 +1,402 @@ +_simpleRequest('/google.cloud.tasks.v2.CloudTasks/ListQueues', + $argument, + ['\Google\Cloud\Tasks\V2\ListQueuesResponse', 'decode'], + $metadata, $options); + } + + /** + * Gets a queue. + * @param \Google\Cloud\Tasks\V2\GetQueueRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetQueue(\Google\Cloud\Tasks\V2\GetQueueRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2.CloudTasks/GetQueue', + $argument, + ['\Google\Cloud\Tasks\V2\Queue', 'decode'], + $metadata, $options); + } + + /** + * 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. + * @param \Google\Cloud\Tasks\V2\CreateQueueRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function CreateQueue(\Google\Cloud\Tasks\V2\CreateQueueRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2.CloudTasks/CreateQueue', + $argument, + ['\Google\Cloud\Tasks\V2\Queue', 'decode'], + $metadata, $options); + } + + /** + * 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. + * @param \Google\Cloud\Tasks\V2\UpdateQueueRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function UpdateQueue(\Google\Cloud\Tasks\V2\UpdateQueueRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2.CloudTasks/UpdateQueue', + $argument, + ['\Google\Cloud\Tasks\V2\Queue', 'decode'], + $metadata, $options); + } + + /** + * 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. + * @param \Google\Cloud\Tasks\V2\DeleteQueueRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function DeleteQueue(\Google\Cloud\Tasks\V2\DeleteQueueRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2.CloudTasks/DeleteQueue', + $argument, + ['\Google\Protobuf\GPBEmpty', 'decode'], + $metadata, $options); + } + + /** + * 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. + * @param \Google\Cloud\Tasks\V2\PurgeQueueRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function PurgeQueue(\Google\Cloud\Tasks\V2\PurgeQueueRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2.CloudTasks/PurgeQueue', + $argument, + ['\Google\Cloud\Tasks\V2\Queue', 'decode'], + $metadata, $options); + } + + /** + * 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]. + * @param \Google\Cloud\Tasks\V2\PauseQueueRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function PauseQueue(\Google\Cloud\Tasks\V2\PauseQueueRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2.CloudTasks/PauseQueue', + $argument, + ['\Google\Cloud\Tasks\V2\Queue', 'decode'], + $metadata, $options); + } + + /** + * 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). + * @param \Google\Cloud\Tasks\V2\ResumeQueueRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ResumeQueue(\Google\Cloud\Tasks\V2\ResumeQueueRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2.CloudTasks/ResumeQueue', + $argument, + ['\Google\Cloud\Tasks\V2\Queue', 'decode'], + $metadata, $options); + } + + /** + * 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` + * @param \Google\Cloud\Iam\V1\GetIamPolicyRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetIamPolicy(\Google\Cloud\Iam\V1\GetIamPolicyRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2.CloudTasks/GetIamPolicy', + $argument, + ['\Google\Cloud\Iam\V1\Policy', 'decode'], + $metadata, $options); + } + + /** + * 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` + * @param \Google\Cloud\Iam\V1\SetIamPolicyRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function SetIamPolicy(\Google\Cloud\Iam\V1\SetIamPolicyRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2.CloudTasks/SetIamPolicy', + $argument, + ['\Google\Cloud\Iam\V1\Policy', 'decode'], + $metadata, $options); + } + + /** + * 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. + * @param \Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function TestIamPermissions(\Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2.CloudTasks/TestIamPermissions', + $argument, + ['\Google\Cloud\Iam\V1\TestIamPermissionsResponse', 'decode'], + $metadata, $options); + } + + /** + * 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. + * @param \Google\Cloud\Tasks\V2\ListTasksRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ListTasks(\Google\Cloud\Tasks\V2\ListTasksRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2.CloudTasks/ListTasks', + $argument, + ['\Google\Cloud\Tasks\V2\ListTasksResponse', 'decode'], + $metadata, $options); + } + + /** + * Gets a task. + * @param \Google\Cloud\Tasks\V2\GetTaskRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetTask(\Google\Cloud\Tasks\V2\GetTaskRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2.CloudTasks/GetTask', + $argument, + ['\Google\Cloud\Tasks\V2\Task', 'decode'], + $metadata, $options); + } + + /** + * 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. + * @param \Google\Cloud\Tasks\V2\CreateTaskRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function CreateTask(\Google\Cloud\Tasks\V2\CreateTaskRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2.CloudTasks/CreateTask', + $argument, + ['\Google\Cloud\Tasks\V2\Task', 'decode'], + $metadata, $options); + } + + /** + * 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. + * @param \Google\Cloud\Tasks\V2\DeleteTaskRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function DeleteTask(\Google\Cloud\Tasks\V2\DeleteTaskRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2.CloudTasks/DeleteTask', + $argument, + ['\Google\Protobuf\GPBEmpty', 'decode'], + $metadata, $options); + } + + /** + * 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. + * @param \Google\Cloud\Tasks\V2\RunTaskRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function RunTask(\Google\Cloud\Tasks\V2\RunTaskRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2.CloudTasks/RunTask', + $argument, + ['\Google\Cloud\Tasks\V2\Task', 'decode'], + $metadata, $options); + } + +} 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..914909a7e157 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/CreateQueueRequest.php @@ -0,0 +1,131 @@ +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; + + /** + * 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..aed43430b056 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/CreateTaskRequest.php @@ -0,0 +1,297 @@ +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; + + /** + * 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..6ebae01632af --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/DeleteQueueRequest.php @@ -0,0 +1,71 @@ +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 = ''; + + /** + * 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..167321f647b5 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/DeleteTaskRequest.php @@ -0,0 +1,72 @@ +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 = ''; + + /** + * 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..917ce94efd88 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/GetQueueRequest.php @@ -0,0 +1,71 @@ +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 = ''; + + /** + * 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..3387ee43a453 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/GetTaskRequest.php @@ -0,0 +1,141 @@ +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; + + /** + * 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..5f58385a81ce --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/HttpRequest.php @@ -0,0 +1,414 @@ +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..5c87912e290c --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ListQueuesRequest.php @@ -0,0 +1,249 @@ +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 = ''; + + /** + * 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..48d28798fbc6 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ListQueuesResponse.php @@ -0,0 +1,121 @@ +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 \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 \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..76ee4a430783 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ListTasksRequest.php @@ -0,0 +1,253 @@ +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 = ''; + + /** + * 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..31ab5b1644e9 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ListTasksResponse.php @@ -0,0 +1,117 @@ +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 \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 \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..63272222819e --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/PauseQueueRequest.php @@ -0,0 +1,71 @@ +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 = ''; + + /** + * 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..590ea88f7c09 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/PurgeQueueRequest.php @@ -0,0 +1,71 @@ +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 = ''; + + /** + * 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..48e239b4f191 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Queue.php @@ -0,0 +1,579 @@ +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 called + * [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 called + * [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 called + * [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 called + * [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/Queue_State.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Queue_State.php new file mode 100644 index 000000000000..fb750035b8bf --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Queue_State.php @@ -0,0 +1,16 @@ +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..99fa482f4453 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ResumeQueueRequest.php @@ -0,0 +1,71 @@ +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 = ''; + + /** + * 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..11748103a51f --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/RetryConfig.php @@ -0,0 +1,478 @@ +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 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 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 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 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..feaaa63724bc --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/RunTaskRequest.php @@ -0,0 +1,142 @@ +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; + + /** + * 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..63397eb4a3bc --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Task.php @@ -0,0 +1,662 @@ +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 listing 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 listing 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 listing 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 listing 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..bc3e4647cee4 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Task/View.php @@ -0,0 +1,78 @@ +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/Task_View.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Task_View.php new file mode 100644 index 000000000000..a1ccba180953 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Task_View.php @@ -0,0 +1,16 @@ +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; + + /** + * 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/src/V2/CloudTasksClient.php b/owl-bot-staging/Tasks/v2/src/V2/CloudTasksClient.php new file mode 100644 index 000000000000..711c73151899 --- /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. + */ +class CloudTasksGapicClient +{ + use GapicClientTrait; + + /** + * The name of the service. + */ + const SERVICE_NAME = 'google.cloud.tasks.v2.CloudTasks'; + + /** + * The default address of the service. + */ + const SERVICE_ADDRESS = 'cloudtasks.googleapis.com'; + + /** + * 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, + 'serviceAddress' => 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 $serviceAddress + * 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 + * $serviceAddress 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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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`. This field is only used by Cloud IAM. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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; + $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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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(); + } +} 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..6277d0594d0f --- /dev/null +++ b/owl-bot-staging/Tasks/v2/src/V2/gapic_metadata.json @@ -0,0 +1,98 @@ +{ + "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" + ] + } + } + } + } + } + } +} \ 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..4bae73ae12b6 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/src/V2/resources/cloud_tasks_client_config.json @@ -0,0 +1,125 @@ +{ + "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": 10000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 10000, + "total_timeout_millis": 10000 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 10000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 10000, + "total_timeout_millis": 10000 + } + }, + "methods": { + "CreateQueue": { + "timeout_millis": 10000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateTask": { + "timeout_millis": 10000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteQueue": { + "timeout_millis": 10000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteTask": { + "timeout_millis": 10000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetIamPolicy": { + "timeout_millis": 10000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetQueue": { + "timeout_millis": 10000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetTask": { + "timeout_millis": 10000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListQueues": { + "timeout_millis": 10000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListTasks": { + "timeout_millis": 10000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "PauseQueue": { + "timeout_millis": 10000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "PurgeQueue": { + "timeout_millis": 10000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ResumeQueue": { + "timeout_millis": 10000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "RunTask": { + "timeout_millis": 10000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetIamPolicy": { + "timeout_millis": 10000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "timeout_millis": 10000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateQueue": { + "timeout_millis": 10000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_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..f96345a0f259 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/src/V2/resources/cloud_tasks_descriptor_config.php @@ -0,0 +1,28 @@ + [ + 'google.cloud.tasks.v2.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', + ], + ], + ], + ], +]; 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..5f0644a0be9d --- /dev/null +++ b/owl-bot-staging/Tasks/v2/src/V2/resources/cloud_tasks_rest_client_config.php @@ -0,0 +1,195 @@ + [ + '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', + ], + ], + ], + ], + ], + ], +]; 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..763123be80d3 --- /dev/null +++ b/owl-bot-staging/Tasks/v2/tests/Unit/V2/CloudTasksClientTest.php @@ -0,0 +1,1139 @@ +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(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new Queue(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); + $queue = new Queue(); + $response = $client->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(); + $client = $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 = $client->locationName('[PROJECT]', '[LOCATION]'); + $queue = new Queue(); + try { + $client->createQueue($formattedParent, $queue); + // If the $client 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(); + $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $task = new Task(); + $response = $client->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(); + $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $task = new Task(); + try { + $client->createTask($formattedParent, $task); + // If the $client 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(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $client->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(); + $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + try { + $client->deleteQueue($formattedName); + // If the $client 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(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $client->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(); + $client = $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 = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + try { + $client->deleteTask($formattedName); + // If the $client 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(); + $client = $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 = $client->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(); + $client = $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 { + $client->getIamPolicy($resource); + // If the $client 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(); + $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $response = $client->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(); + $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + try { + $client->getQueue($formattedName); + // If the $client 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(); + $client = $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 = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $response = $client->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(); + $client = $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 = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + try { + $client->getTask($formattedName); + // If the $client 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(); + $client = $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 = $client->locationName('[PROJECT]', '[LOCATION]'); + $response = $client->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(); + $client = $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 = $client->locationName('[PROJECT]', '[LOCATION]'); + try { + $client->listQueues($formattedParent); + // If the $client 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(); + $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $response = $client->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(); + $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + try { + $client->listTasks($formattedParent); + // If the $client 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(); + $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $response = $client->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(); + $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + try { + $client->pauseQueue($formattedName); + // If the $client 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(); + $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $response = $client->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(); + $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + try { + $client->purgeQueue($formattedName); + // If the $client 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(); + $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $response = $client->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(); + $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + try { + $client->resumeQueue($formattedName); + // If the $client 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(); + $client = $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 = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $response = $client->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(); + $client = $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 = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + try { + $client->runTask($formattedName); + // If the $client 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(); + $client = $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 = $client->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(); + $client = $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 { + $client->setIamPolicy($resource, $policy); + // If the $client 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(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $response = $client->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(); + $client = $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 { + $client->testIamPermissions($resource, $permissions); + // If the $client 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(); + $client = $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 = $client->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(); + $client = $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 { + $client->updateQueue($queue); + // If the $client 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 000000000000..5767544c54cb --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta2/Cloudtasks.php @@ -0,0 +1,147 @@ +internalAddGeneratedFile( + ' +5 ++google/cloud/tasks/v2beta2/cloudtasks.protogoogle.cloud.tasks.v2beta2google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto&google/cloud/tasks/v2beta2/queue.proto%google/cloud/tasks/v2beta2/task.protogoogle/iam/v1/iam_policy.protogoogle/iam/v1/policy.protogoogle/protobuf/duration.protogoogle/protobuf/empty.proto google/protobuf/field_mask.protogoogle/protobuf/timestamp.proto" +ListQueuesRequest7 +parent ( B\'AA!cloudtasks.googleapis.com/Queue +filter (  + page_size ( + +page_token ( 2 + read_mask ( 2.google.protobuf.FieldMaskBA"` +ListQueuesResponse1 +queues ( 2!.google.cloud.tasks.v2beta2.Queue +next_page_token ( "| +GetQueueRequest5 +name ( B\'AA! +cloudtasks.googleapis.com/Queue2 + read_mask ( 2.google.protobuf.FieldMaskBA" +CreateQueueRequest7 +parent ( B\'AA!cloudtasks.googleapis.com/Queue5 +queue ( 2!.google.cloud.tasks.v2beta2.QueueBA"| +UpdateQueueRequest5 +queue ( 2!.google.cloud.tasks.v2beta2.QueueBA/ + update_mask ( 2.google.protobuf.FieldMask"K +DeleteQueueRequest5 +name ( B\'AA! +cloudtasks.googleapis.com/Queue"J +PurgeQueueRequest5 +name ( B\'AA! +cloudtasks.googleapis.com/Queue"J +PauseQueueRequest5 +name ( B\'AA! +cloudtasks.googleapis.com/Queue"K +ResumeQueueRequest5 +name ( B\'AA! +cloudtasks.googleapis.com/Queue" +ListTasksRequest6 +parent ( B&AA cloudtasks.googleapis.com/Task< + response_view (2%.google.cloud.tasks.v2beta2.Task.View + page_size ( + +page_token ( "] +ListTasksResponse/ +tasks ( 2 .google.cloud.tasks.v2beta2.Task +next_page_token ( " +GetTaskRequest4 +name ( B&AA +cloudtasks.googleapis.com/Task< + response_view (2%.google.cloud.tasks.v2beta2.Task.View" +CreateTaskRequest6 +parent ( B&AA cloudtasks.googleapis.com/Task3 +task ( 2 .google.cloud.tasks.v2beta2.TaskBA< + response_view (2%.google.cloud.tasks.v2beta2.Task.View"I +DeleteTaskRequest4 +name ( B&AA +cloudtasks.googleapis.com/Task" +LeaseTasksRequest6 +parent ( B&AA cloudtasks.googleapis.com/Task + max_tasks (6 +lease_duration ( 2.google.protobuf.DurationBA< + response_view (2%.google.cloud.tasks.v2beta2.Task.View +filter ( "E +LeaseTasksResponse/ +tasks ( 2 .google.cloud.tasks.v2beta2.Task" +AcknowledgeTaskRequest4 +name ( B&AA +cloudtasks.googleapis.com/Task6 + schedule_time ( 2.google.protobuf.TimestampBA" +RenewLeaseRequest4 +name ( B&AA +cloudtasks.googleapis.com/Task6 + schedule_time ( 2.google.protobuf.TimestampBA6 +lease_duration ( 2.google.protobuf.DurationBA< + response_view (2%.google.cloud.tasks.v2beta2.Task.View" +CancelLeaseRequest4 +name ( B&AA +cloudtasks.googleapis.com/Task6 + schedule_time ( 2.google.protobuf.TimestampBA< + response_view (2%.google.cloud.tasks.v2beta2.Task.View" +RunTaskRequest4 +name ( B&AA +cloudtasks.googleapis.com/Task< + response_view (2%.google.cloud.tasks.v2beta2.Task.View2 + +CloudTasks + +ListQueues-.google.cloud.tasks.v2beta2.ListQueuesRequest..google.cloud.tasks.v2beta2.ListQueuesResponse"@1//v2beta2/{parent=projects/*/locations/*}/queuesAparent +GetQueue+.google.cloud.tasks.v2beta2.GetQueueRequest!.google.cloud.tasks.v2beta2.Queue">1//v2beta2/{name=projects/*/locations/*/queues/*}Aname + CreateQueue..google.cloud.tasks.v2beta2.CreateQueueRequest!.google.cloud.tasks.v2beta2.Queue"M8"//v2beta2/{parent=projects/*/locations/*}/queues:queueA parent,queue + UpdateQueue..google.cloud.tasks.v2beta2.UpdateQueueRequest!.google.cloud.tasks.v2beta2.Queue"X>25/v2beta2/{queue.name=projects/*/locations/*/queues/*}:queueAqueue,update_mask + DeleteQueue..google.cloud.tasks.v2beta2.DeleteQueueRequest.google.protobuf.Empty">1*//v2beta2/{name=projects/*/locations/*/queues/*}Aname + +PurgeQueue-.google.cloud.tasks.v2beta2.PurgeQueueRequest!.google.cloud.tasks.v2beta2.Queue"G:"5/v2beta2/{name=projects/*/locations/*/queues/*}:purge:*Aname + +PauseQueue-.google.cloud.tasks.v2beta2.PauseQueueRequest!.google.cloud.tasks.v2beta2.Queue"G:"5/v2beta2/{name=projects/*/locations/*/queues/*}:pause:*Aname + ResumeQueue..google.cloud.tasks.v2beta2.ResumeQueueRequest!.google.cloud.tasks.v2beta2.Queue"H;"6/v2beta2/{name=projects/*/locations/*/queues/*}:resume:*Aname + GetIamPolicy".google.iam.v1.GetIamPolicyRequest.google.iam.v1.Policy"VE"@/v2beta2/{resource=projects/*/locations/*/queues/*}:getIamPolicy:*Aresource + SetIamPolicy".google.iam.v1.SetIamPolicyRequest.google.iam.v1.Policy"]E"@/v2beta2/{resource=projects/*/locations/*/queues/*}:setIamPolicy:*Aresource,policy +TestIamPermissions(.google.iam.v1.TestIamPermissionsRequest).google.iam.v1.TestIamPermissionsResponse"hK"F/v2beta2/{resource=projects/*/locations/*/queues/*}:testIamPermissions:*Aresource,permissions + ListTasks,.google.cloud.tasks.v2beta2.ListTasksRequest-.google.cloud.tasks.v2beta2.ListTasksResponse"H97/v2beta2/{parent=projects/*/locations/*/queues/*}/tasksAparent +GetTask*.google.cloud.tasks.v2beta2.GetTaskRequest .google.cloud.tasks.v2beta2.Task"F97/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}Aname + +CreateTask-.google.cloud.tasks.v2beta2.CreateTaskRequest .google.cloud.tasks.v2beta2.Task"P<"7/v2beta2/{parent=projects/*/locations/*/queues/*}/tasks:*A parent,task + +DeleteTask-.google.cloud.tasks.v2beta2.DeleteTaskRequest.google.protobuf.Empty"F9*7/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}Aname + +LeaseTasks-.google.cloud.tasks.v2beta2.LeaseTasksRequest..google.cloud.tasks.v2beta2.LeaseTasksResponse"`B"=/v2beta2/{parent=projects/*/locations/*/queues/*}/tasks:lease:*Aparent,lease_duration +AcknowledgeTask2.google.cloud.tasks.v2beta2.AcknowledgeTaskRequest.google.protobuf.Empty"cH"C/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:acknowledge:*Aname,schedule_time + +RenewLease-.google.cloud.tasks.v2beta2.RenewLeaseRequest .google.cloud.tasks.v2beta2.Task"qG"B/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:renewLease:*A!name,schedule_time,lease_duration + CancelLease..google.cloud.tasks.v2beta2.CancelLeaseRequest .google.cloud.tasks.v2beta2.Task"cH"C/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:cancelLease:*Aname,schedule_time +RunTask*.google.cloud.tasks.v2beta2.RunTaskRequest .google.cloud.tasks.v2beta2.Task"M@";/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:run:*AnameMAcloudtasks.googleapis.comA.https://www.googleapis.com/auth/cloud-platformB| +com.google.cloud.tasks.v2beta2BCloudTasksProtoPZ?google.golang.org/genproto/googleapis/cloud/tasks/v2beta2;tasksTASKSbproto3' + , 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..b0d678135b6d9ffbae2bd41a71c1b5ba3bbb329d GIT binary patch literal 2596 zcmbVO(M}sj6pbM!xlxn5bdUtH5tamoM zvnUk#p`X!T>r)@Aens!htc_J%gMx&xnRD*UoO{m9{P;3Hi{VRhKqH!Xf(E2}NyHf? zal!@nc}TihuSXN&^Fho)nplK1j>zFrhcp|l&KF2cd6xLJO8T7lLu&gW&jMR`>3M2j zRJv4n75jZgGis@l0FgJKY3%uw9JK2{<9Of+&pA+RXHT-7j$}J;D|N}<0q{dFP01Ts z1+IYLPn>l_=95%-0{=W^smmfJm>06&a1Xnr=Y=Un=1pubi+sU&L?q!T@@e@w(KRLZ zY0PoYyJWPUwv+)Sa9WX|N#uo2gQkAMV!@L(LaWt26=U(_f6CAEX=ORqBW1nDYW2n< zcZokkqXNp?2m^u55hC!X4c^8Z))#~-Gu8aI1^_b?pyEAJ_ zd$3svYH;_N$C5TObR2f#Bd8sQ9unRlzB^ZHRf{4n9mAt^I#IR%+n-q8>{<|vd%KVB zFORz+d$SFHEW@+A+1^;!I7`LDQt`0zc&tCpYj`oUle{N7E$hzqjQT<;pCg~-K$S9d ztR3X?=Hr|H9Ty`FbHK*LD!gl<^yt=~MJTEO8cT3rM%XNnLiwTb2G+bdc4^dS5p~am zh+Vxba~{V_72DEfr)}J-#c@*+Um;KX=+!-A7fNv!hNC+7Rh?(E>a-C)rtd&Wo@8#w z227-8@pk$#!e1*i&b@>YOfFrYM?Kaz7Zlsso;CZiB#N#FffyqSDhk zk$A%bh%*e5E8Ai&s%h6pvyOUdjeT!?4U5u5t`MR5P@x~+K#u}udODPzPfj|uPSZU-JZU%gTKlbLWA&a&Vu2e1YQp zN_~;qSNW%*9dci%+`bxp9O_F5QSaq7GORB{NgLG_moeQs2bi#dvkjXA?*m#8FCsT! zcwY(sj0SE@6E~%3jzIapV64H41a`9|6>f^Rk2!~m6^#w}RQ?~4ewHLO61tX3MRDu* zIVerqW(}4k+7p5fVl=JHRuQAH0Y(-nBjeoTQ8~jRj{X3KWNE{W;-2Sjh8rv>4OrxM zJ^!5ddZy0TEqJ-b9Ipd41OEt?<+1`U@93zXst^_HE3g!0gYho5{w@GqTgNbEKcw0| z&my4|m{)!>_Th6L26*1P_{#>E7Stk1*oB8@giMRnqg0uZ7F`FMx=ue(Ka&OUMIl_2 z0l(xk%JV9pu?(M0G;ZAf(b}Y9Ir1woDZY>JMR7r0T^w&0R~|s>l~h-V@Cm< zatGA46m9w3XcvBYnID>c9(qyV;z{4`(?}fy_H_!Ty|s3fh}{K+{eF9VVSS??8xwC6 Tc}_8Z%DY4%_3L2>Lx6t)9&k$g 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..8d6af065b9e7a0a494e0a132954fea94436c580a GIT binary patch literal 1466 zcmb7EZEq7f5GGAu=p;b2AW?yIG6B)>wvoaYlwLt8S(-|;Szx&j$4Zg2nQSb!w$JuP z>Ye)U_#ONf?A=@_YN;S!5>MuNW}bQM`SX>WNw`n;k)xspCuDp=%nXTC!iYp8e-PcXP%UzmV3(vqq#3r8OyrZcq589K&pTr@v|~>yMdKHo z0GuA9mNY@KAMPF6gb6h?-Y?+sYX^@b2ao^i>^b-jK$20dNmS6le?aU<=HrYdL>p@C z*8`?Uj5EV%#{RV`cFB}x8ZGpE?lk9#VS*C}81e*Lk4VYsavw-xRqvAj8w%YZ>=5Du zZcuTW#eLL?V$ui|+SG2>N?VT4MOu#*WgQ)xl2+Mcw|lP1U1C&@XR8yU(Bz8m6n#5_ z)8()Df^qdEi+h|4HwD3UxBFewcZx#NvzKfkpf{N;`+Z|QZ7nOfdfV`I9pdd@bkn<2 zCi;c#eqp=6u)SFa2=go}ZEHS(nmZk$)-*-$25d-rk_kH5s*p;n?$w}bXu7px51Y*y z-0Vpi@RV^J7$Zv#?;YHwQjV~QkCey_i@haf64m31UJ8|z^!G_ zm3oi=EhC|B85 z)y>B{f{hu{2`as{N~*0|XZNzkF4E@@N_@bLIyvjcnseih5A`1stUI6aq?qugcMaC& zG|RCxtGn`|(u|<7tg;xbBh{$pEGeDYbOCFXwl}pzdJVYBxP2b>5iW$)VRa_7v8t@h z$DaVs4D~MD9z;<%It-%0us`~E^dSshAG|pT`i(2zRagy&AEHLZ+konR5H(g@Xb|-J zjj9WUAEU;q2e94`-Ud<7Slg5EhuvzI%x$k$Ub|uigq6QvE$&q+GRjk5sI;9TFSc5{ o{EJGaFWP`R#lsk{7rD>3mk;h~xd6`Wi=Xa_BC~wcr*I1J4N3RII{*Lx literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta2/Task.php b/owl-bot-staging/Tasks/v2beta2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta2/Task.php new file mode 100644 index 0000000000000000000000000000000000000000..0d0a79570eaf865aecdea34f0bb02e1c4c221999 GIT binary patch literal 2146 zcma)7(Qex|6sx9DJvP`IrfWW@t#B8bI-l}VPB3U`U)Sjlx0M-0q$R7Jz`j9 zLJKMq+|P$YmSHN!k|!+lF+M!OZ%@u~=dgSJB|w$PGs>Dc79vhqKogM<0!`E}D)`Xo zGff)ypKlovO39chNhrg|z4jYe9uQ5!V+#%s3^+VD;P9f+HsD=^XhM|2<|~>Y3_qFo z6Hc+xM8o4LR}oLS<|N_2Lk4?zND{>Wcr$jGr&M#1VgooyDXZ^b$7y1pN&y+~;n{I| zMg$Nb?53J!DM`XZrf9~c7FiEMo6VT%QabaczEf;#==c!V-5HzB8;9J(I?LJh-7(IX z&a-sap4$*i%eQcjSS`uJQ&z~|yh`W_KMyrWVh}uoM4C%;l)9XAD5fT3xjgn%((nul zm#gJ5Cev1$3R7>9{twU=@7o`FQL5HpP*&y$oLeuoG|FzHKM;Dhlx4k57v@`M`_|ch z;q1+Ddm)FB)fs>Diz3jr0eC9VGwq6i$3;LUX<%HFt775vVu45=kSi73>eioCR5h*P z-A7f^TeS+V)YrT-^q5E)u{7o>i$+?@C}Y3oP_5cW5U}3(&Udu)((+qUb}aH008bt6 z)g5mi-IsZiL{M}^VpgkKrf_=^RSy7fTs$zmKo1lhu|b}&$Ouqdu@sv#hM78k=`1fm z>oj99n;c;ER>1dY)#+FJ*v5W6BcD@1-$>`|=)FYM51jp0y9cO;jc2!^{0j))dV#9u z={-Ul7v0WJ(Yv>2z0N`RsM|T*xZ|y%m3Hf_d$3XQ?xE_@yVtKb?lwpNv>19~597?_ z3IXL+K8)GGR`URq_?c0yf=Tf<4H7|J0|b-V>okCxLREu_eNKzPJ2Ax5_Cu%_xl9BZ zMEX*)t-mV>T}${0`iyAJ#!^QE4l`NPQA9GaEXO73+6Fq80BLJsR>% z>1f7M$nFfbvq->}+qY2u2z?48{sxb;*YZ4De^td5%6QA%$!%U2i5E%mLr&(@w!IVmw=zW8?OkDQnMMSG~&n{i3sDk&ra@ yMHUA!OKocfS6-WUQ|}tzsQ#*reYstZ%x~Ofb?t65XXbRyy=Eib6*NUtg#HD`rNSEk 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..3b44c9f51d20 --- /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..2f344a02a3c1 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AppEngineHttpRequest.php @@ -0,0 +1,464 @@ +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..e4b714a3f386 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AppEngineHttpTarget.php @@ -0,0 +1,102 @@ +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..dc71470737f7 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AppEngineRouting.php @@ -0,0 +1,500 @@ +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..39adc685ea96 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/CancelLeaseRequest.php @@ -0,0 +1,202 @@ +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/CloudTasksGrpcClient.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/CloudTasksGrpcClient.php new file mode 100644 index 000000000000..80542b9c3edf --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/CloudTasksGrpcClient.php @@ -0,0 +1,508 @@ +_simpleRequest('/google.cloud.tasks.v2beta2.CloudTasks/ListQueues', + $argument, + ['\Google\Cloud\Tasks\V2beta2\ListQueuesResponse', 'decode'], + $metadata, $options); + } + + /** + * Gets a queue. + * @param \Google\Cloud\Tasks\V2beta2\GetQueueRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetQueue(\Google\Cloud\Tasks\V2beta2\GetQueueRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2beta2.CloudTasks/GetQueue', + $argument, + ['\Google\Cloud\Tasks\V2beta2\Queue', 'decode'], + $metadata, $options); + } + + /** + * 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. + * @param \Google\Cloud\Tasks\V2beta2\CreateQueueRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function CreateQueue(\Google\Cloud\Tasks\V2beta2\CreateQueueRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2beta2.CloudTasks/CreateQueue', + $argument, + ['\Google\Cloud\Tasks\V2beta2\Queue', 'decode'], + $metadata, $options); + } + + /** + * 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. + * @param \Google\Cloud\Tasks\V2beta2\UpdateQueueRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function UpdateQueue(\Google\Cloud\Tasks\V2beta2\UpdateQueueRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2beta2.CloudTasks/UpdateQueue', + $argument, + ['\Google\Cloud\Tasks\V2beta2\Queue', 'decode'], + $metadata, $options); + } + + /** + * 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. + * @param \Google\Cloud\Tasks\V2beta2\DeleteQueueRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function DeleteQueue(\Google\Cloud\Tasks\V2beta2\DeleteQueueRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2beta2.CloudTasks/DeleteQueue', + $argument, + ['\Google\Protobuf\GPBEmpty', 'decode'], + $metadata, $options); + } + + /** + * 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. + * @param \Google\Cloud\Tasks\V2beta2\PurgeQueueRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function PurgeQueue(\Google\Cloud\Tasks\V2beta2\PurgeQueueRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2beta2.CloudTasks/PurgeQueue', + $argument, + ['\Google\Cloud\Tasks\V2beta2\Queue', 'decode'], + $metadata, $options); + } + + /** + * 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]. + * @param \Google\Cloud\Tasks\V2beta2\PauseQueueRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function PauseQueue(\Google\Cloud\Tasks\V2beta2\PauseQueueRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2beta2.CloudTasks/PauseQueue', + $argument, + ['\Google\Cloud\Tasks\V2beta2\Queue', 'decode'], + $metadata, $options); + } + + /** + * 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). + * @param \Google\Cloud\Tasks\V2beta2\ResumeQueueRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ResumeQueue(\Google\Cloud\Tasks\V2beta2\ResumeQueueRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2beta2.CloudTasks/ResumeQueue', + $argument, + ['\Google\Cloud\Tasks\V2beta2\Queue', 'decode'], + $metadata, $options); + } + + /** + * 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` + * @param \Google\Cloud\Iam\V1\GetIamPolicyRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetIamPolicy(\Google\Cloud\Iam\V1\GetIamPolicyRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2beta2.CloudTasks/GetIamPolicy', + $argument, + ['\Google\Cloud\Iam\V1\Policy', 'decode'], + $metadata, $options); + } + + /** + * 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` + * @param \Google\Cloud\Iam\V1\SetIamPolicyRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function SetIamPolicy(\Google\Cloud\Iam\V1\SetIamPolicyRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2beta2.CloudTasks/SetIamPolicy', + $argument, + ['\Google\Cloud\Iam\V1\Policy', 'decode'], + $metadata, $options); + } + + /** + * 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. + * @param \Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function TestIamPermissions(\Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2beta2.CloudTasks/TestIamPermissions', + $argument, + ['\Google\Cloud\Iam\V1\TestIamPermissionsResponse', 'decode'], + $metadata, $options); + } + + /** + * 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. + * @param \Google\Cloud\Tasks\V2beta2\ListTasksRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ListTasks(\Google\Cloud\Tasks\V2beta2\ListTasksRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2beta2.CloudTasks/ListTasks', + $argument, + ['\Google\Cloud\Tasks\V2beta2\ListTasksResponse', 'decode'], + $metadata, $options); + } + + /** + * Gets a task. + * @param \Google\Cloud\Tasks\V2beta2\GetTaskRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetTask(\Google\Cloud\Tasks\V2beta2\GetTaskRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2beta2.CloudTasks/GetTask', + $argument, + ['\Google\Cloud\Tasks\V2beta2\Task', 'decode'], + $metadata, $options); + } + + /** + * 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. + * @param \Google\Cloud\Tasks\V2beta2\CreateTaskRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function CreateTask(\Google\Cloud\Tasks\V2beta2\CreateTaskRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2beta2.CloudTasks/CreateTask', + $argument, + ['\Google\Cloud\Tasks\V2beta2\Task', 'decode'], + $metadata, $options); + } + + /** + * 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. + * @param \Google\Cloud\Tasks\V2beta2\DeleteTaskRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function DeleteTask(\Google\Cloud\Tasks\V2beta2\DeleteTaskRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2beta2.CloudTasks/DeleteTask', + $argument, + ['\Google\Protobuf\GPBEmpty', 'decode'], + $metadata, $options); + } + + /** + * 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. + * @param \Google\Cloud\Tasks\V2beta2\LeaseTasksRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function LeaseTasks(\Google\Cloud\Tasks\V2beta2\LeaseTasksRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2beta2.CloudTasks/LeaseTasks', + $argument, + ['\Google\Cloud\Tasks\V2beta2\LeaseTasksResponse', 'decode'], + $metadata, $options); + } + + /** + * 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]. + * @param \Google\Cloud\Tasks\V2beta2\AcknowledgeTaskRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function AcknowledgeTask(\Google\Cloud\Tasks\V2beta2\AcknowledgeTaskRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2beta2.CloudTasks/AcknowledgeTask', + $argument, + ['\Google\Protobuf\GPBEmpty', 'decode'], + $metadata, $options); + } + + /** + * 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]. + * @param \Google\Cloud\Tasks\V2beta2\RenewLeaseRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function RenewLease(\Google\Cloud\Tasks\V2beta2\RenewLeaseRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2beta2.CloudTasks/RenewLease', + $argument, + ['\Google\Cloud\Tasks\V2beta2\Task', 'decode'], + $metadata, $options); + } + + /** + * 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]. + * @param \Google\Cloud\Tasks\V2beta2\CancelLeaseRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function CancelLease(\Google\Cloud\Tasks\V2beta2\CancelLeaseRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2beta2.CloudTasks/CancelLease', + $argument, + ['\Google\Cloud\Tasks\V2beta2\Task', 'decode'], + $metadata, $options); + } + + /** + * 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]. + * @param \Google\Cloud\Tasks\V2beta2\RunTaskRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function RunTask(\Google\Cloud\Tasks\V2beta2\RunTaskRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2beta2.CloudTasks/RunTask', + $argument, + ['\Google\Cloud\Tasks\V2beta2\Task', 'decode'], + $metadata, $options); + } + +} 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..5b5a9af9c20d --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/CreateQueueRequest.php @@ -0,0 +1,131 @@ +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..611a11a22bf1 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/CreateTaskRequest.php @@ -0,0 +1,297 @@ +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 ~1hour 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 ~9days 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 ~1hour 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 ~9days 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 ~1hour 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 ~9days 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 ~1hour 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 ~9days 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..2623ee79b307 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/DeleteQueueRequest.php @@ -0,0 +1,71 @@ +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..09a8e599c601 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/GetQueueRequest.php @@ -0,0 +1,127 @@ +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..9b4754d72a7e --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/GetTaskRequest.php @@ -0,0 +1,141 @@ +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..ee9343aeab34 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/HttpMethod.php @@ -0,0 +1,82 @@ +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; + + 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', + ]; + + 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/LeaseTasksRequest.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/LeaseTasksRequest.php new file mode 100644 index 000000000000..2acce610fb27 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/LeaseTasksRequest.php @@ -0,0 +1,413 @@ +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..5dc3e76a34da --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/LeaseTasksResponse.php @@ -0,0 +1,67 @@ +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 \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 \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..f3235e0611e5 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ListQueuesRequest.php @@ -0,0 +1,305 @@ +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..70fa6d5b7590 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ListQueuesResponse.php @@ -0,0 +1,121 @@ +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 \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 \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..ad9e79a2c191 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ListTasksRequest.php @@ -0,0 +1,253 @@ +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..de79b66160d0 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ListTasksResponse.php @@ -0,0 +1,117 @@ +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 \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 \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/PauseQueueRequest.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PauseQueueRequest.php new file mode 100644 index 000000000000..cb07c5e3be5b --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PauseQueueRequest.php @@ -0,0 +1,71 @@ +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..2c3be0c0cfa5 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PullMessage.php @@ -0,0 +1,160 @@ +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..a8b3766a2cec --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PurgeQueueRequest.php @@ -0,0 +1,71 @@ +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/Queue.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Queue.php new file mode 100644 index 000000000000..818eb482ba08 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Queue.php @@ -0,0 +1,708 @@ +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 calling + * [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\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 calling + * [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; + } + + /** + * 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 calling + * [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 calling + * [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..e2960f3097c7 --- /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..86f8bfa8c66b --- /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/Queue_State.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Queue_State.php new file mode 100644 index 000000000000..913b043e0842 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Queue_State.php @@ -0,0 +1,16 @@ +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..56155d07cae0 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/RenewLeaseRequest.php @@ -0,0 +1,254 @@ +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..77d839a7f374 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ResumeQueueRequest.php @@ -0,0 +1,71 @@ +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..76aca2920b94 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/RetryConfig.php @@ -0,0 +1,508 @@ +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..8a3c33ebda68 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/RunTaskRequest.php @@ -0,0 +1,142 @@ +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..133ffe4c35b2 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Task.php @@ -0,0 +1,422 @@ +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\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; + } + + /** + * 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..fe60da25a7cd --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Task/View.php @@ -0,0 +1,79 @@ +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..a5e75acaf549 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/TaskStatus.php @@ -0,0 +1,217 @@ +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/Task_View.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Task_View.php new file mode 100644 index 000000000000..4046934c75c9 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Task_View.php @@ -0,0 +1,16 @@ +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/src/V2beta2/CloudTasksClient.php b/owl-bot-staging/Tasks/v2beta2/src/V2beta2/CloudTasksClient.php new file mode 100644 index 000000000000..0d78395d62b3 --- /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 + */ +class CloudTasksGapicClient +{ + use GapicClientTrait; + + /** + * The name of the service. + */ + const SERVICE_NAME = 'google.cloud.tasks.v2beta2.CloudTasks'; + + /** + * The default address of the service. + */ + const SERVICE_ADDRESS = 'cloudtasks.googleapis.com'; + + /** + * 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, + 'serviceAddress' => 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 $serviceAddress + * 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 + * $serviceAddress 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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 ~1hour 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 ~9days 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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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`. This field is only used by Cloud IAM. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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; + $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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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(); + } +} 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..6faa81e5bd33 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/src/V2beta2/gapic_metadata.json @@ -0,0 +1,118 @@ +{ + "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" + ] + } + } + } + } + } + } +} \ 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..ea9b38e559d2 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/src/V2beta2/resources/cloud_tasks_client_config.json @@ -0,0 +1,145 @@ +{ + "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" + } + } + } + } +} 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..3843e1420f48 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/src/V2beta2/resources/cloud_tasks_descriptor_config.php @@ -0,0 +1,28 @@ + [ + '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', + ], + ], + ], + ], +]; 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..795331d094d2 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/src/V2beta2/resources/cloud_tasks_rest_client_config.php @@ -0,0 +1,243 @@ + [ + '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', + ], + ], + ], + ], + ], + ], +]; 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..27881db2801e --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta2/tests/Unit/V2beta2/CloudTasksClientTest.php @@ -0,0 +1,1401 @@ +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(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $scheduleTime = new Timestamp(); + $client->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(); + $client = $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 = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $scheduleTime = new Timestamp(); + try { + $client->acknowledgeTask($formattedName, $scheduleTime); + // If the $client 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(); + $client = $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 = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $scheduleTime = new Timestamp(); + $response = $client->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(); + $client = $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 = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $scheduleTime = new Timestamp(); + try { + $client->cancelLease($formattedName, $scheduleTime); + // If the $client 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(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new Queue(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); + $queue = new Queue(); + $response = $client->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(); + $client = $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 = $client->locationName('[PROJECT]', '[LOCATION]'); + $queue = new Queue(); + try { + $client->createQueue($formattedParent, $queue); + // If the $client 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(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new Task(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $task = new Task(); + $response = $client->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(); + $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $task = new Task(); + try { + $client->createTask($formattedParent, $task); + // If the $client 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(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $client->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(); + $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + try { + $client->deleteQueue($formattedName); + // If the $client 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(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $client->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(); + $client = $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 = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + try { + $client->deleteTask($formattedName); + // If the $client 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(); + $client = $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 = $client->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(); + $client = $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 { + $client->getIamPolicy($resource); + // If the $client 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(); + $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $response = $client->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(); + $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + try { + $client->getQueue($formattedName); + // If the $client 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(); + $client = $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 = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $response = $client->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(); + $client = $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 = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + try { + $client->getTask($formattedName); + // If the $client 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(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new LeaseTasksResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $leaseDuration = new Duration(); + $response = $client->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(); + $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $leaseDuration = new Duration(); + try { + $client->leaseTasks($formattedParent, $leaseDuration); + // If the $client 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(); + $client = $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 = $client->locationName('[PROJECT]', '[LOCATION]'); + $response = $client->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(); + $client = $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 = $client->locationName('[PROJECT]', '[LOCATION]'); + try { + $client->listQueues($formattedParent); + // If the $client 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(); + $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $response = $client->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(); + $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + try { + $client->listTasks($formattedParent); + // If the $client 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(); + $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $response = $client->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(); + $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + try { + $client->pauseQueue($formattedName); + // If the $client 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(); + $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $response = $client->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(); + $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + try { + $client->purgeQueue($formattedName); + // If the $client 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(); + $client = $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 = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $scheduleTime = new Timestamp(); + $leaseDuration = new Duration(); + $response = $client->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(); + $client = $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 = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $scheduleTime = new Timestamp(); + $leaseDuration = new Duration(); + try { + $client->renewLease($formattedName, $scheduleTime, $leaseDuration); + // If the $client 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(); + $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $response = $client->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(); + $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + try { + $client->resumeQueue($formattedName); + // If the $client 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(); + $client = $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 = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $response = $client->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(); + $client = $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 = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + try { + $client->runTask($formattedName); + // If the $client 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(); + $client = $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 = $client->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(); + $client = $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 { + $client->setIamPolicy($resource, $policy); + // If the $client 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(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $response = $client->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(); + $client = $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 { + $client->testIamPermissions($resource, $permissions); + // If the $client 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(); + $client = $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 = $client->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(); + $client = $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 { + $client->updateQueue($queue); + // If the $client 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..fe0d3f4ec582 --- /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\'AA!cloudtasks.googleapis.com/Queue +filter (  + page_size ( + +page_token ( 2 + read_mask ( 2.google.protobuf.FieldMaskBA"` +ListQueuesResponse1 +queues ( 2!.google.cloud.tasks.v2beta3.Queue +next_page_token ( "| +GetQueueRequest5 +name ( B\'AA! +cloudtasks.googleapis.com/Queue2 + read_mask ( 2.google.protobuf.FieldMaskBA" +CreateQueueRequest7 +parent ( B\'AA!cloudtasks.googleapis.com/Queue5 +queue ( 2!.google.cloud.tasks.v2beta3.QueueBA"| +UpdateQueueRequest5 +queue ( 2!.google.cloud.tasks.v2beta3.QueueBA/ + update_mask ( 2.google.protobuf.FieldMask"K +DeleteQueueRequest5 +name ( B\'AA! +cloudtasks.googleapis.com/Queue"J +PurgeQueueRequest5 +name ( B\'AA! +cloudtasks.googleapis.com/Queue"J +PauseQueueRequest5 +name ( B\'AA! +cloudtasks.googleapis.com/Queue"K +ResumeQueueRequest5 +name ( B\'AA! +cloudtasks.googleapis.com/Queue" +ListTasksRequest6 +parent ( B&AA 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&AA +cloudtasks.googleapis.com/Task< + response_view (2%.google.cloud.tasks.v2beta3.Task.View" +CreateTaskRequest6 +parent ( B&AA cloudtasks.googleapis.com/Task3 +task ( 2 .google.cloud.tasks.v2beta3.TaskBA< + response_view (2%.google.cloud.tasks.v2beta3.Task.View"I +DeleteTaskRequest4 +name ( B&AA +cloudtasks.googleapis.com/Task" +RunTaskRequest4 +name ( B&AA +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/*}/queuesAparent +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"M8"//v2beta3/{parent=projects/*/locations/*}/queues:queueA parent,queue + UpdateQueue..google.cloud.tasks.v2beta3.UpdateQueueRequest!.google.cloud.tasks.v2beta3.Queue"X>25/v2beta3/{queue.name=projects/*/locations/*/queues/*}:queueAqueue,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"VE"@/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"hK"F/v2beta3/{resource=projects/*/locations/*/queues/*}:testIamPermissions:*Aresource,permissions + ListTasks,.google.cloud.tasks.v2beta3.ListTasksRequest-.google.cloud.tasks.v2beta3.ListTasksResponse"H97/v2beta3/{parent=projects/*/locations/*/queues/*}/tasksAparent +GetTask*.google.cloud.tasks.v2beta3.GetTaskRequest .google.cloud.tasks.v2beta3.Task"F97/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"F9*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:*AnameMAcloudtasks.googleapis.comA.https://www.googleapis.com/auth/cloud-platformB| +com.google.cloud.tasks.v2beta3BCloudTasksProtoPZ?google.golang.org/genproto/googleapis/cloud/tasks/v2beta3;tasksTASKSbproto3' + , 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..5acd8c8dff2521360d9e0cfad57e39405ec69f90 GIT binary patch literal 2731 zcmbVOaZlSu6mNh~`a%)2%4D*wy=GlWwau>5t0D7-S?&>txAt>`S=T@wxUH zm7#o?eWZPY?ayhSV(-pQh}txuB1K$szu$XzzxRH3_v4H3EQBw~J`HH(23GtPUCaIAgBwss}k>PoitYo#vP+W@Zb#4-6r zMuAHp_!lNUpSdI!j=+D9SZuR^3Fi3h58T5J={tT*k@-Hhp9HR8JRp*A9JsXngrqSg z_EE@j&pTwip0<<$C9qn7pi$uXR)fZF#6rQNHbSe_0TmPRx4K7!h1*h9h@hBxO*t!hEQWykO!o=sHc|Mn-A6}#qnliKcK z_m?NtkhR%@KiA;#&DvforZ_{{!%+4xGJ6y^vlvdu%qXi#>XxFlH7CAM%4f*?8Bny!IUO(ymlrM&ep!K2fdM=t#U~0E7wpz?Q1&w^iEW zIP171#-wevuVF>@fGvctuPF59d+4!0w5M=a@L?|&93_^FJJ&IOgCg$3eeFf;oJO|K z2UwoLSQSw8@5Tvdw4~hCn0=U%GlhPDC2eEGZees`KUaO|!#`>zt ze?3=98%yqDsR{X1=neR!)2(%z_UTcl-P~>MwVI9fTUr5bpPU{YwT|}Ja~i;MyLQ^a zi3RM|l}4*ms~_UG#nMw)lIzj#!Fu;)``sWbu+%<1Jj4iU)HzsRs9M&4wU_WfX_UG) zZD{mrY~ZD6s$FW&vBs~cD`N998;wk#yXjeDUXF*O^eRNu8+nZ<^1WJ^&?uK=c+ z`5|l$owv5f@U|508IA1_YZ+7QZBMx`r+o@*64FbeSlBV%efk1wo7XZbBHbj4XdtGd zC}-wNf90TXGS&L`U{!{4grLI^jVJA$*S-f${+gOgu`^fOA>F3}#;I5K}%V$6^h?UXvr3&aDY+RHo#tTEjZFTRY5|;kW0jL_PZqsxq zs4}Bhl0YcTqG~~H55C~Ohu4mcA2vkSd$tpy!5lwzy_CLCndAC2jQK z6m9wHY3F`_ksaOx?mNN2;L*Sw&_Eq$=9LX*J^8kkh`nWneYQ2ZH@`{WJX24kSYF8P PjOUR;rjM8ri~#-zNvU&! 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..981eca4a4d5836221a22e2e9fa89e41c0e84c2ec GIT binary patch literal 1965 zcmb7F;cnYD5UyhZ^ch6s>%M`vv2ZRxU6^YRN9H}Kiso;u- zJVEnpu^NbZ*>*}w7`iZ8hYJ#k+D!w&X562SxDMXP#)9xK1#XHdVt;$ z@=PIg5oU)>5y5aW8xt7{nkp_l?b`3_)Yj!QmiCk4SQCyeP&?gfmx zqB6nuEN>IwV*PJ+L%D`2oede|rV5da;^L?p%+FqYv&fA5* z0cN{*?56V|ckI}Jz2X*W{0kNM$}|BC(z|XAkO2{Vg~nYRMyu__X(3=ly4QOen1_?d`ZwT@oA- zA)94XZr6K1eF#`^=uC2$%ak~GwxKfT(Rs6CxeuVuai*4m;-`c)H?^^TJEQ4PyZgp_ za!)4&oJL`R-m>V&x6ztv?*jaw1Ka;$rb~57&Wlog0-GzGWF#+Zf8*!U=nL2}RJovU ztxSTv9IY6fVVb%uri_?+y~;>NoLBG=r)fZ}IS@Qkl*IvG5g}+q>?!r$)7!YNgTBte zt-m&4XKlRNS}J3Bw|Iwye&0j(0!766y)u98gQR7J%99+E3(ouUUI3d zjBBkvz@;voui*0{UVy`pXG{g;4AXbFP)kdOJT0WvdJeU9^o?asZx93;5)9zk<1<)i)W6BzM7)8T?IW&k;-;pHwDRDm3 z`%IDp{m<4B5emteC4x|f&w8ylVD^b5?wJO=CkpIdDX@E8Zz=F0LNp*rg4HUTAPhf| z_5)6FB8h~@W1e_C=x@vpG{Y}KEua_(kKrJVm17jVv{Mib(D^^0R~&R8 z$ylt8y%5yBgqo+x>KH{*GYlgol_>ldpsxG3-}9`>P2VqydJ3Yi6=hIG*+;)4^kgNq zTf4^1)=gpSrm(Z7*md`p#!wY8J+u2TbJQIKa&-KR_RRj}KkYK-HgkB8ImCiGN|0%i z8NSF2L~w`9STfeV-_}uCb)8i~W!1LT5-!y?tV{HO2;s4C$V29hq!eDveomp9)la}- zv;NFBVHX|SZVJ)S$X5WoFt}H@tYcL9Tck}L$=zQTYA%9EgTMn>C1l8|TPsB90pN}C zha8@xt%Q!4p9aiR6jsYR#BQEL&c9t~*K*J%jTsD116cb{zzcNG=P>^y9eF+@egGU+ zD;oCs+&+1GS@+R)fud0w%IZ2m*3^0o(-efwJhOgBuQ$-vfX9jSh?HzBWc9Az;ZeTB z0zKMI<7&M`6_~d(=*H^M162ON*)LTDknQ@DWxFX|+1KE__Z*eg)A|hUTz5M^c<$*N5#%O_i0{c8!S???Y>HTrm+QTRy;n0rap)+Km?hI#Eg+*Thhq_e#b?tkwU(D2R%tiRoy{U5M QbitjeJgoogle.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..c2458780d3d8 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/AppEngineHttpRequest.php @@ -0,0 +1,454 @@ +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..66b91012e1e9 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/AppEngineRouting.php @@ -0,0 +1,356 @@ +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/CloudTasksGrpcClient.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/CloudTasksGrpcClient.php new file mode 100644 index 000000000000..496ed4f6b92e --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/CloudTasksGrpcClient.php @@ -0,0 +1,401 @@ +_simpleRequest('/google.cloud.tasks.v2beta3.CloudTasks/ListQueues', + $argument, + ['\Google\Cloud\Tasks\V2beta3\ListQueuesResponse', 'decode'], + $metadata, $options); + } + + /** + * Gets a queue. + * @param \Google\Cloud\Tasks\V2beta3\GetQueueRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetQueue(\Google\Cloud\Tasks\V2beta3\GetQueueRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2beta3.CloudTasks/GetQueue', + $argument, + ['\Google\Cloud\Tasks\V2beta3\Queue', 'decode'], + $metadata, $options); + } + + /** + * 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. + * @param \Google\Cloud\Tasks\V2beta3\CreateQueueRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function CreateQueue(\Google\Cloud\Tasks\V2beta3\CreateQueueRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2beta3.CloudTasks/CreateQueue', + $argument, + ['\Google\Cloud\Tasks\V2beta3\Queue', 'decode'], + $metadata, $options); + } + + /** + * 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. + * @param \Google\Cloud\Tasks\V2beta3\UpdateQueueRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function UpdateQueue(\Google\Cloud\Tasks\V2beta3\UpdateQueueRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2beta3.CloudTasks/UpdateQueue', + $argument, + ['\Google\Cloud\Tasks\V2beta3\Queue', 'decode'], + $metadata, $options); + } + + /** + * 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. + * @param \Google\Cloud\Tasks\V2beta3\DeleteQueueRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function DeleteQueue(\Google\Cloud\Tasks\V2beta3\DeleteQueueRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2beta3.CloudTasks/DeleteQueue', + $argument, + ['\Google\Protobuf\GPBEmpty', 'decode'], + $metadata, $options); + } + + /** + * 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. + * @param \Google\Cloud\Tasks\V2beta3\PurgeQueueRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function PurgeQueue(\Google\Cloud\Tasks\V2beta3\PurgeQueueRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2beta3.CloudTasks/PurgeQueue', + $argument, + ['\Google\Cloud\Tasks\V2beta3\Queue', 'decode'], + $metadata, $options); + } + + /** + * 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]. + * @param \Google\Cloud\Tasks\V2beta3\PauseQueueRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function PauseQueue(\Google\Cloud\Tasks\V2beta3\PauseQueueRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2beta3.CloudTasks/PauseQueue', + $argument, + ['\Google\Cloud\Tasks\V2beta3\Queue', 'decode'], + $metadata, $options); + } + + /** + * 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). + * @param \Google\Cloud\Tasks\V2beta3\ResumeQueueRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ResumeQueue(\Google\Cloud\Tasks\V2beta3\ResumeQueueRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2beta3.CloudTasks/ResumeQueue', + $argument, + ['\Google\Cloud\Tasks\V2beta3\Queue', 'decode'], + $metadata, $options); + } + + /** + * 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` + * @param \Google\Cloud\Iam\V1\GetIamPolicyRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetIamPolicy(\Google\Cloud\Iam\V1\GetIamPolicyRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2beta3.CloudTasks/GetIamPolicy', + $argument, + ['\Google\Cloud\Iam\V1\Policy', 'decode'], + $metadata, $options); + } + + /** + * 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` + * @param \Google\Cloud\Iam\V1\SetIamPolicyRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function SetIamPolicy(\Google\Cloud\Iam\V1\SetIamPolicyRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2beta3.CloudTasks/SetIamPolicy', + $argument, + ['\Google\Cloud\Iam\V1\Policy', 'decode'], + $metadata, $options); + } + + /** + * 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. + * @param \Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function TestIamPermissions(\Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2beta3.CloudTasks/TestIamPermissions', + $argument, + ['\Google\Cloud\Iam\V1\TestIamPermissionsResponse', 'decode'], + $metadata, $options); + } + + /** + * 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. + * @param \Google\Cloud\Tasks\V2beta3\ListTasksRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ListTasks(\Google\Cloud\Tasks\V2beta3\ListTasksRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2beta3.CloudTasks/ListTasks', + $argument, + ['\Google\Cloud\Tasks\V2beta3\ListTasksResponse', 'decode'], + $metadata, $options); + } + + /** + * Gets a task. + * @param \Google\Cloud\Tasks\V2beta3\GetTaskRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetTask(\Google\Cloud\Tasks\V2beta3\GetTaskRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2beta3.CloudTasks/GetTask', + $argument, + ['\Google\Cloud\Tasks\V2beta3\Task', 'decode'], + $metadata, $options); + } + + /** + * 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. + * @param \Google\Cloud\Tasks\V2beta3\CreateTaskRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function CreateTask(\Google\Cloud\Tasks\V2beta3\CreateTaskRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2beta3.CloudTasks/CreateTask', + $argument, + ['\Google\Cloud\Tasks\V2beta3\Task', 'decode'], + $metadata, $options); + } + + /** + * 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. + * @param \Google\Cloud\Tasks\V2beta3\DeleteTaskRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function DeleteTask(\Google\Cloud\Tasks\V2beta3\DeleteTaskRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2beta3.CloudTasks/DeleteTask', + $argument, + ['\Google\Protobuf\GPBEmpty', 'decode'], + $metadata, $options); + } + + /** + * 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. + * @param \Google\Cloud\Tasks\V2beta3\RunTaskRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function RunTask(\Google\Cloud\Tasks\V2beta3\RunTaskRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.tasks.v2beta3.CloudTasks/RunTask', + $argument, + ['\Google\Cloud\Tasks\V2beta3\Task', 'decode'], + $metadata, $options); + } + +} 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..3c4e6e6a3162 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/CreateQueueRequest.php @@ -0,0 +1,131 @@ +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..9b36d8aded06 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/CreateTaskRequest.php @@ -0,0 +1,297 @@ +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 ~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.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 ~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.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 ~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.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 ~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.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..fd366e84b070 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/DeleteQueueRequest.php @@ -0,0 +1,71 @@ +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..08d07892bbe9 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/GetQueueRequest.php @@ -0,0 +1,127 @@ +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..0e8617545f07 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/GetTaskRequest.php @@ -0,0 +1,141 @@ +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..9c0d20c2179a --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/HttpRequest.php @@ -0,0 +1,414 @@ +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: + * * 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: + * * 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: + * * 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: + * * 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/ListQueuesRequest.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ListQueuesRequest.php new file mode 100644 index 000000000000..8660e3b2e625 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ListQueuesRequest.php @@ -0,0 +1,305 @@ +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..5408b682480b --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ListQueuesResponse.php @@ -0,0 +1,121 @@ +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 \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 \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..54da57c27677 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ListTasksRequest.php @@ -0,0 +1,253 @@ +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..8c5aa40b8201 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ListTasksResponse.php @@ -0,0 +1,117 @@ +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 \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 \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/PauseQueueRequest.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/PauseQueueRequest.php new file mode 100644 index 000000000000..211d6461b7e4 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/PauseQueueRequest.php @@ -0,0 +1,71 @@ +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..e1b39e5e4288 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/PullMessage.php @@ -0,0 +1,131 @@ +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..539a62c3b0b3 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/PurgeQueueRequest.php @@ -0,0 +1,71 @@ +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/Queue.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Queue.php new file mode 100644 index 000000000000..1aefd40fce0d --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Queue.php @@ -0,0 +1,801 @@ +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 = ''; + /** + * 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 calling + * [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\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 calling + * [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; + } + + /** + * 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 calling + * [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 calling + * [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..05d1d2a8ed97 --- /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/Queue_State.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Queue_State.php new file mode 100644 index 000000000000..7f37129ff2e2 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Queue_State.php @@ -0,0 +1,16 @@ +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..bcf37ed209cf --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ResumeQueueRequest.php @@ -0,0 +1,71 @@ +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..f3825bdd7e31 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/RetryConfig.php @@ -0,0 +1,478 @@ +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..be4be783aa2e --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/RunTaskRequest.php @@ -0,0 +1,142 @@ +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..fd9a972eefe1 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Task.php @@ -0,0 +1,717 @@ +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..273f7dbc5725 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Task/View.php @@ -0,0 +1,78 @@ +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/Task_View.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Task_View.php new file mode 100644 index 000000000000..f7837cbe97ea --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Task_View.php @@ -0,0 +1,16 @@ +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/src/V2beta3/CloudTasksClient.php b/owl-bot-staging/Tasks/v2beta3/src/V2beta3/CloudTasksClient.php new file mode 100644 index 000000000000..95b780b5952f --- /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 + */ +class CloudTasksGapicClient +{ + use GapicClientTrait; + + /** + * The name of the service. + */ + const SERVICE_NAME = 'google.cloud.tasks.v2beta3.CloudTasks'; + + /** + * The default address of the service. + */ + const SERVICE_ADDRESS = 'cloudtasks.googleapis.com'; + + /** + * 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, + 'serviceAddress' => 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 $serviceAddress + * 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 + * $serviceAddress 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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 ~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.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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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`. This field is only used by Cloud IAM. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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; + $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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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(); + } +} 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..61b5c721a665 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/src/V2beta3/gapic_metadata.json @@ -0,0 +1,98 @@ +{ + "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" + ] + } + } + } + } + } + } +} \ 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..99bdac739d33 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/src/V2beta3/resources/cloud_tasks_client_config.json @@ -0,0 +1,125 @@ +{ + "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" + } + } + } + } +} 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..6c9bdb8dc108 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/src/V2beta3/resources/cloud_tasks_descriptor_config.php @@ -0,0 +1,28 @@ + [ + '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', + ], + ], + ], + ], +]; 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..608534c564a3 --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/src/V2beta3/resources/cloud_tasks_rest_client_config.php @@ -0,0 +1,195 @@ + [ + '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', + ], + ], + ], + ], + ], + ], +]; 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..18b65a64353e --- /dev/null +++ b/owl-bot-staging/Tasks/v2beta3/tests/Unit/V2beta3/CloudTasksClientTest.php @@ -0,0 +1,1139 @@ +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(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new Queue(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); + $queue = new Queue(); + $response = $client->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(); + $client = $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 = $client->locationName('[PROJECT]', '[LOCATION]'); + $queue = new Queue(); + try { + $client->createQueue($formattedParent, $queue); + // If the $client 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(); + $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $task = new Task(); + $response = $client->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(); + $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $task = new Task(); + try { + $client->createTask($formattedParent, $task); + // If the $client 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(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $client->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(); + $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + try { + $client->deleteQueue($formattedName); + // If the $client 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(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $client->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(); + $client = $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 = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + try { + $client->deleteTask($formattedName); + // If the $client 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(); + $client = $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 = $client->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(); + $client = $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 { + $client->getIamPolicy($resource); + // If the $client 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(); + $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $response = $client->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(); + $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + try { + $client->getQueue($formattedName); + // If the $client 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(); + $client = $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 = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $response = $client->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(); + $client = $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 = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + try { + $client->getTask($formattedName); + // If the $client 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(); + $client = $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 = $client->locationName('[PROJECT]', '[LOCATION]'); + $response = $client->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(); + $client = $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 = $client->locationName('[PROJECT]', '[LOCATION]'); + try { + $client->listQueues($formattedParent); + // If the $client 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(); + $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $response = $client->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(); + $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + try { + $client->listTasks($formattedParent); + // If the $client 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(); + $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $response = $client->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(); + $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + try { + $client->pauseQueue($formattedName); + // If the $client 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(); + $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $response = $client->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(); + $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + try { + $client->purgeQueue($formattedName); + // If the $client 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(); + $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $response = $client->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(); + $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + try { + $client->resumeQueue($formattedName); + // If the $client 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(); + $client = $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 = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $response = $client->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(); + $client = $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 = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + try { + $client->runTask($formattedName); + // If the $client 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(); + $client = $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 = $client->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(); + $client = $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 { + $client->setIamPolicy($resource, $policy); + // If the $client 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(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $response = $client->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(); + $client = $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 { + $client->testIamPermissions($resource, $permissions); + // If the $client 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(); + $client = $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 = $client->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(); + $client = $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 { + $client->updateQueue($queue); + // If the $client 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 0a278675df78f30ee4f4b3dc2ec81940212b01a6 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 5 Jan 2022 08:00:00 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot?= 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/src/V2/AppEngineHttpRequest.php | 2 +- Tasks/src/V2/Attempt.php | 8 +- Tasks/src/V2/CloudTasksClient.php | 14 +- Tasks/src/V2/CreateQueueRequest.php | 2 +- Tasks/src/V2/CreateTaskRequest.php | 2 +- Tasks/src/V2/Gapic/CloudTasksGapicClient.php | 1403 ++++++------ Tasks/src/V2/HttpRequest.php | 16 +- Tasks/src/V2/Queue.php | 10 +- Tasks/src/V2/RetryConfig.php | 6 +- Tasks/src/V2/Task.php | 10 +- Tasks/src/V2/UpdateQueueRequest.php | 4 +- .../v2 => Tasks}/src/V2/gapic_metadata.json | 0 .../resources/cloud_tasks_client_config.json | 242 +- .../cloud_tasks_rest_client_config.php | 144 +- Tasks/src/V2beta2/AcknowledgeTaskRequest.php | 2 +- Tasks/src/V2beta2/AppEngineHttpRequest.php | 2 +- Tasks/src/V2beta2/AppEngineHttpTarget.php | 2 +- Tasks/src/V2beta2/AttemptStatus.php | 8 +- Tasks/src/V2beta2/CancelLeaseRequest.php | 2 +- Tasks/src/V2beta2/CloudTasksClient.php | 14 +- Tasks/src/V2beta2/CreateQueueRequest.php | 2 +- Tasks/src/V2beta2/CreateTaskRequest.php | 2 +- .../V2beta2/Gapic/CloudTasksGapicClient.php | 1950 ++++++++--------- Tasks/src/V2beta2/GetQueueRequest.php | 2 +- Tasks/src/V2beta2/LeaseTasksRequest.php | 2 +- Tasks/src/V2beta2/ListQueuesRequest.php | 2 +- Tasks/src/V2beta2/Queue.php | 20 +- Tasks/src/V2beta2/QueueStats.php | 2 +- Tasks/src/V2beta2/RenewLeaseRequest.php | 4 +- Tasks/src/V2beta2/RetryConfig.php | 6 +- Tasks/src/V2beta2/Task.php | 6 +- Tasks/src/V2beta2/TaskStatus.php | 4 +- Tasks/src/V2beta2/UpdateQueueRequest.php | 4 +- .../src/V2beta2/gapic_metadata.json | 0 .../resources/cloud_tasks_client_config.json | 282 +-- .../cloud_tasks_rest_client_config.php | 144 +- Tasks/src/V2beta3/AppEngineHttpQueue.php | 2 +- Tasks/src/V2beta3/AppEngineHttpRequest.php | 2 +- Tasks/src/V2beta3/Attempt.php | 8 +- Tasks/src/V2beta3/CloudTasksClient.php | 14 +- Tasks/src/V2beta3/CreateQueueRequest.php | 2 +- Tasks/src/V2beta3/CreateTaskRequest.php | 2 +- .../V2beta3/Gapic/CloudTasksGapicClient.php | 1462 ++++++------ Tasks/src/V2beta3/GetQueueRequest.php | 2 +- Tasks/src/V2beta3/HttpRequest.php | 16 +- Tasks/src/V2beta3/ListQueuesRequest.php | 2 +- Tasks/src/V2beta3/Queue.php | 22 +- Tasks/src/V2beta3/QueueStats.php | 2 +- Tasks/src/V2beta3/RetryConfig.php | 6 +- Tasks/src/V2beta3/Task.php | 10 +- Tasks/src/V2beta3/UpdateQueueRequest.php | 4 +- .../src/V2beta3/gapic_metadata.json | 0 .../resources/cloud_tasks_client_config.json | 242 +- .../cloud_tasks_rest_client_config.php | 144 +- Tasks/tests/Unit/V2/CloudTasksClientTest.php | 935 ++++---- .../Unit/V2beta2/CloudTasksClientTest.php | 1074 ++++----- .../Unit/V2beta3/CloudTasksClientTest.php | 935 ++++---- .../Google/Cloud/Tasks/V2/Cloudtasks.php | 114 - .../Google/Cloud/Tasks/V2/Queue.php | Bin 2066 -> 0 bytes .../Google/Cloud/Tasks/V2/Target.php | Bin 1844 -> 0 bytes .../Google/Cloud/Tasks/V2/Task.php | Bin 2105 -> 0 bytes .../Cloud/Tasks/V2/AppEngineHttpRequest.php | 465 ---- .../Cloud/Tasks/V2/AppEngineRouting.php | 361 --- .../src/Google/Cloud/Tasks/V2/Attempt.php | 229 -- .../Cloud/Tasks/V2/CloudTasksGrpcClient.php | 402 ---- .../Cloud/Tasks/V2/CreateQueueRequest.php | 131 -- .../Cloud/Tasks/V2/CreateTaskRequest.php | 297 --- .../Cloud/Tasks/V2/DeleteQueueRequest.php | 71 - .../Cloud/Tasks/V2/DeleteTaskRequest.php | 72 - .../Google/Cloud/Tasks/V2/GetQueueRequest.php | 71 - .../Google/Cloud/Tasks/V2/GetTaskRequest.php | 141 -- .../src/Google/Cloud/Tasks/V2/HttpMethod.php | 96 - .../src/Google/Cloud/Tasks/V2/HttpRequest.php | 414 ---- .../Cloud/Tasks/V2/ListQueuesRequest.php | 249 --- .../Cloud/Tasks/V2/ListQueuesResponse.php | 121 - .../Cloud/Tasks/V2/ListTasksRequest.php | 253 --- .../Cloud/Tasks/V2/ListTasksResponse.php | 117 - .../src/Google/Cloud/Tasks/V2/OAuthToken.php | 128 -- .../src/Google/Cloud/Tasks/V2/OidcToken.php | 126 -- .../Cloud/Tasks/V2/PauseQueueRequest.php | 71 - .../Cloud/Tasks/V2/PurgeQueueRequest.php | 71 - .../proto/src/Google/Cloud/Tasks/V2/Queue.php | 579 ----- .../src/Google/Cloud/Tasks/V2/Queue/State.php | 89 - .../src/Google/Cloud/Tasks/V2/Queue_State.php | 16 - .../src/Google/Cloud/Tasks/V2/RateLimits.php | 307 --- .../Cloud/Tasks/V2/ResumeQueueRequest.php | 71 - .../src/Google/Cloud/Tasks/V2/RetryConfig.php | 478 ---- .../Google/Cloud/Tasks/V2/RunTaskRequest.php | 142 -- .../Tasks/V2/StackdriverLoggingConfig.php | 80 - .../proto/src/Google/Cloud/Tasks/V2/Task.php | 662 ------ .../src/Google/Cloud/Tasks/V2/Task/View.php | 78 - .../src/Google/Cloud/Tasks/V2/Task_View.php | 16 - .../Cloud/Tasks/V2/UpdateQueueRequest.php | 141 -- .../Tasks/v2/src/V2/CloudTasksClient.php | 34 - .../v2/src/V2/Gapic/CloudTasksGapicClient.php | 1345 ------------ .../resources/cloud_tasks_client_config.json | 125 -- .../cloud_tasks_descriptor_config.php | 28 - .../cloud_tasks_rest_client_config.php | 195 -- .../v2/tests/Unit/V2/CloudTasksClientTest.php | 1139 ---------- .../Google/Cloud/Tasks/V2Beta2/Cloudtasks.php | 147 -- .../Google/Cloud/Tasks/V2Beta2/Queue.php | Bin 2596 -> 0 bytes .../Google/Cloud/Tasks/V2Beta2/Target.php | Bin 1466 -> 0 bytes .../Google/Cloud/Tasks/V2Beta2/Task.php | Bin 2146 -> 0 bytes .../Tasks/V2beta2/AcknowledgeTaskRequest.php | 132 -- .../Tasks/V2beta2/AppEngineHttpRequest.php | 464 ---- .../Tasks/V2beta2/AppEngineHttpTarget.php | 102 - .../Cloud/Tasks/V2beta2/AppEngineRouting.php | 500 ----- .../Cloud/Tasks/V2beta2/AttemptStatus.php | 229 -- .../Tasks/V2beta2/CancelLeaseRequest.php | 202 -- .../Tasks/V2beta2/CloudTasksGrpcClient.php | 508 ----- .../Tasks/V2beta2/CreateQueueRequest.php | 131 -- .../Cloud/Tasks/V2beta2/CreateTaskRequest.php | 297 --- .../Tasks/V2beta2/DeleteQueueRequest.php | 71 - .../Cloud/Tasks/V2beta2/DeleteTaskRequest.php | 72 - .../Cloud/Tasks/V2beta2/GetQueueRequest.php | 127 -- .../Cloud/Tasks/V2beta2/GetTaskRequest.php | 141 -- .../Google/Cloud/Tasks/V2beta2/HttpMethod.php | 82 - .../Cloud/Tasks/V2beta2/LeaseTasksRequest.php | 413 ---- .../Tasks/V2beta2/LeaseTasksResponse.php | 67 - .../Cloud/Tasks/V2beta2/ListQueuesRequest.php | 305 --- .../Tasks/V2beta2/ListQueuesResponse.php | 121 - .../Cloud/Tasks/V2beta2/ListTasksRequest.php | 253 --- .../Cloud/Tasks/V2beta2/ListTasksResponse.php | 117 - .../Cloud/Tasks/V2beta2/PauseQueueRequest.php | 71 - .../Cloud/Tasks/V2beta2/PullMessage.php | 160 -- .../Google/Cloud/Tasks/V2beta2/PullTarget.php | 33 - .../Cloud/Tasks/V2beta2/PurgeQueueRequest.php | 71 - .../src/Google/Cloud/Tasks/V2beta2/Queue.php | 708 ------ .../Cloud/Tasks/V2beta2/Queue/State.php | 93 - .../Google/Cloud/Tasks/V2beta2/QueueStats.php | 253 --- .../Cloud/Tasks/V2beta2/Queue_State.php | 16 - .../Google/Cloud/Tasks/V2beta2/RateLimits.php | 331 --- .../Cloud/Tasks/V2beta2/RenewLeaseRequest.php | 254 --- .../Tasks/V2beta2/ResumeQueueRequest.php | 71 - .../Cloud/Tasks/V2beta2/RetryConfig.php | 508 ----- .../Cloud/Tasks/V2beta2/RunTaskRequest.php | 142 -- .../src/Google/Cloud/Tasks/V2beta2/Task.php | 422 ---- .../Google/Cloud/Tasks/V2beta2/Task/View.php | 79 - .../Google/Cloud/Tasks/V2beta2/TaskStatus.php | 217 -- .../Google/Cloud/Tasks/V2beta2/Task_View.php | 16 - .../Tasks/V2beta2/UpdateQueueRequest.php | 141 -- .../v2beta2/src/V2beta2/CloudTasksClient.php | 36 - .../V2beta2/Gapic/CloudTasksGapicClient.php | 1785 --------------- .../resources/cloud_tasks_client_config.json | 145 -- .../cloud_tasks_descriptor_config.php | 28 - .../cloud_tasks_rest_client_config.php | 243 -- .../Unit/V2beta2/CloudTasksClientTest.php | 1401 ------------ .../Google/Cloud/Tasks/V2Beta3/Cloudtasks.php | 116 - .../Google/Cloud/Tasks/V2Beta3/Queue.php | Bin 2731 -> 0 bytes .../Google/Cloud/Tasks/V2Beta3/Target.php | Bin 1965 -> 0 bytes .../Google/Cloud/Tasks/V2Beta3/Task.php | Bin 2238 -> 0 bytes .../Tasks/V2beta3/AppEngineHttpQueue.php | 102 - .../Tasks/V2beta3/AppEngineHttpRequest.php | 454 ---- .../Cloud/Tasks/V2beta3/AppEngineRouting.php | 356 --- .../Google/Cloud/Tasks/V2beta3/Attempt.php | 229 -- .../Tasks/V2beta3/CloudTasksGrpcClient.php | 401 ---- .../Tasks/V2beta3/CreateQueueRequest.php | 131 -- .../Cloud/Tasks/V2beta3/CreateTaskRequest.php | 297 --- .../Tasks/V2beta3/DeleteQueueRequest.php | 71 - .../Cloud/Tasks/V2beta3/DeleteTaskRequest.php | 72 - .../Cloud/Tasks/V2beta3/GetQueueRequest.php | 127 -- .../Cloud/Tasks/V2beta3/GetTaskRequest.php | 141 -- .../Google/Cloud/Tasks/V2beta3/HttpMethod.php | 96 - .../Cloud/Tasks/V2beta3/HttpRequest.php | 414 ---- .../Cloud/Tasks/V2beta3/ListQueuesRequest.php | 305 --- .../Tasks/V2beta3/ListQueuesResponse.php | 121 - .../Cloud/Tasks/V2beta3/ListTasksRequest.php | 253 --- .../Cloud/Tasks/V2beta3/ListTasksResponse.php | 117 - .../Google/Cloud/Tasks/V2beta3/OAuthToken.php | 128 -- .../Google/Cloud/Tasks/V2beta3/OidcToken.php | 126 -- .../Cloud/Tasks/V2beta3/PauseQueueRequest.php | 71 - .../Cloud/Tasks/V2beta3/PullMessage.php | 131 -- .../Cloud/Tasks/V2beta3/PurgeQueueRequest.php | 71 - .../src/Google/Cloud/Tasks/V2beta3/Queue.php | 801 ------- .../Cloud/Tasks/V2beta3/Queue/State.php | 89 - .../Google/Cloud/Tasks/V2beta3/Queue/Type.php | 64 - .../Google/Cloud/Tasks/V2beta3/QueueStats.php | 253 --- .../Cloud/Tasks/V2beta3/Queue_State.php | 16 - .../Google/Cloud/Tasks/V2beta3/Queue_Type.php | 16 - .../Google/Cloud/Tasks/V2beta3/RateLimits.php | 307 --- .../Tasks/V2beta3/ResumeQueueRequest.php | 71 - .../Cloud/Tasks/V2beta3/RetryConfig.php | 478 ---- .../Cloud/Tasks/V2beta3/RunTaskRequest.php | 142 -- .../V2beta3/StackdriverLoggingConfig.php | 80 - .../src/Google/Cloud/Tasks/V2beta3/Task.php | 717 ------ .../Google/Cloud/Tasks/V2beta3/Task/View.php | 78 - .../Google/Cloud/Tasks/V2beta3/Task_View.php | 16 - .../Tasks/V2beta3/UpdateQueueRequest.php | 141 -- .../v2beta3/src/V2beta3/CloudTasksClient.php | 36 - .../V2beta3/Gapic/CloudTasksGapicClient.php | 1409 ------------ .../resources/cloud_tasks_client_config.json | 125 -- .../cloud_tasks_descriptor_config.php | 28 - .../cloud_tasks_rest_client_config.php | 195 -- .../Unit/V2beta3/CloudTasksClientTest.php | 1139 ---------- 194 files changed, 4164 insertions(+), 36808 deletions(-) rename {owl-bot-staging/Tasks/v2 => Tasks}/src/V2/gapic_metadata.json (100%) rename {owl-bot-staging/Tasks/v2beta2 => Tasks}/src/V2beta2/gapic_metadata.json (100%) rename {owl-bot-staging/Tasks/v2beta3 => Tasks}/src/V2beta3/gapic_metadata.json (100%) 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/CloudTasksGrpcClient.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/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/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/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/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/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/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/CloudTasksGrpcClient.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/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/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/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/Queue_State.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/Task_View.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/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/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/CloudTasksGrpcClient.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/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/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/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/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/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/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/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/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/src/V2/AppEngineHttpRequest.php b/Tasks/src/V2/AppEngineHttpRequest.php index f2cd2b1c1f0a..79bf879f8287 100644 --- a/Tasks/src/V2/AppEngineHttpRequest.php +++ b/Tasks/src/V2/AppEngineHttpRequest.php @@ -275,7 +275,7 @@ public function setHttpMethod($var) */ public function getAppEngineRouting() { - return isset($this->app_engine_routing) ? $this->app_engine_routing : null; + return $this->app_engine_routing; } public function hasAppEngineRouting() diff --git a/Tasks/src/V2/Attempt.php b/Tasks/src/V2/Attempt.php index dc986b297c17..279571f388db 100644 --- a/Tasks/src/V2/Attempt.php +++ b/Tasks/src/V2/Attempt.php @@ -80,7 +80,7 @@ public function __construct($data = NULL) { */ public function getScheduleTime() { - return isset($this->schedule_time) ? $this->schedule_time : null; + return $this->schedule_time; } public function hasScheduleTime() @@ -118,7 +118,7 @@ public function setScheduleTime($var) */ public function getDispatchTime() { - return isset($this->dispatch_time) ? $this->dispatch_time : null; + return $this->dispatch_time; } public function hasDispatchTime() @@ -156,7 +156,7 @@ public function setDispatchTime($var) */ public function getResponseTime() { - return isset($this->response_time) ? $this->response_time : null; + return $this->response_time; } public function hasResponseTime() @@ -195,7 +195,7 @@ public function setResponseTime($var) */ public function getResponseStatus() { - return isset($this->response_status) ? $this->response_status : null; + return $this->response_status; } public function hasResponseStatus() diff --git a/Tasks/src/V2/CloudTasksClient.php b/Tasks/src/V2/CloudTasksClient.php index fd4fe6facb84..8dc621425f5c 100644 --- a/Tasks/src/V2/CloudTasksClient.php +++ b/Tasks/src/V2/CloudTasksClient.php @@ -17,20 +17,18 @@ /* * GENERATED CODE WARNING - * This file was generated from the file - * https://github.com/google/googleapis/blob/master/google/cloud/tasks/v2/cloudtasks.proto - * and updates to that file get reflected here through a refresh process. + * Generated by gapic-generator-php from the file + * https://github.com/googleapis/googleapis/blob/master/google/cloud/tasks/v2/cloudtasks.proto + * Updates to the above are reflected here through a refresh process. */ namespace Google\Cloud\Tasks\V2; use Google\Cloud\Tasks\V2\Gapic\CloudTasksGapicClient; -/** - * {@inheritdoc} - */ +/** {@inheritdoc} */ class CloudTasksClient extends CloudTasksGapicClient { - // This class is intentionally empty, and is intended to hold manual - // additions to the generated {@see CloudTasksGapicClient} class. + // This class is intentionally empty, and is intended to hold manual additions to + // the generated {@see CloudTasksGapicClient} class. } diff --git a/Tasks/src/V2/CreateQueueRequest.php b/Tasks/src/V2/CreateQueueRequest.php index 7742ab287d5e..246219ac0190 100644 --- a/Tasks/src/V2/CreateQueueRequest.php +++ b/Tasks/src/V2/CreateQueueRequest.php @@ -98,7 +98,7 @@ public function setParent($var) */ public function getQueue() { - return isset($this->queue) ? $this->queue : null; + return $this->queue; } public function hasQueue() diff --git a/Tasks/src/V2/CreateTaskRequest.php b/Tasks/src/V2/CreateTaskRequest.php index 1fb732cffb5c..55b13af87a22 100644 --- a/Tasks/src/V2/CreateTaskRequest.php +++ b/Tasks/src/V2/CreateTaskRequest.php @@ -194,7 +194,7 @@ public function setParent($var) */ public function getTask() { - return isset($this->task) ? $this->task : null; + return $this->task; } public function hasTask() diff --git a/Tasks/src/V2/Gapic/CloudTasksGapicClient.php b/Tasks/src/V2/Gapic/CloudTasksGapicClient.php index 29dd0ada6f47..1a7038f27d83 100644 --- a/Tasks/src/V2/Gapic/CloudTasksGapicClient.php +++ b/Tasks/src/V2/Gapic/CloudTasksGapicClient.php @@ -17,9 +17,9 @@ /* * GENERATED CODE WARNING - * This file was generated from the file - * https://github.com/google/googleapis/blob/master/google/cloud/tasks/v2/cloudtasks.proto - * and updates to that file get reflected here through a refresh process. + * Generated by gapic-generator-php from the file + * https://github.com/googleapis/googleapis/blob/master/google/cloud/tasks/v2/cloudtasks.proto + * Updates to the above are reflected here through a refresh process. */ namespace Google\Cloud\Tasks\V2\Gapic; @@ -27,6 +27,7 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; + use Google\ApiCore\PathTemplate; use Google\ApiCore\RequestParamsHeaderDescriptor; use Google\ApiCore\RetrySettings; @@ -71,31 +72,17 @@ * $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); - * } + * $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. + * 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. */ class CloudTasksGapicClient { @@ -127,26 +114,29 @@ class CloudTasksGapicClient public static $serviceScopes = [ 'https://www.googleapis.com/auth/cloud-platform', ]; + private static $locationNameTemplate; - private static $projectNameTemplate; + 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', + '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', + 'restClientConfigPath' => __DIR__ . '/../resources/cloud_tasks_rest_client_config.php', ], ], ]; @@ -154,7 +144,7 @@ private static function getClientDefaults() private static function getLocationNameTemplate() { - if (null == self::$locationNameTemplate) { + if (self::$locationNameTemplate == null) { self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); } @@ -172,7 +162,7 @@ private static function getProjectNameTemplate() private static function getQueueNameTemplate() { - if (null == self::$queueNameTemplate) { + if (self::$queueNameTemplate == null) { self::$queueNameTemplate = new PathTemplate('projects/{project}/locations/{location}/queues/{queue}'); } @@ -181,7 +171,7 @@ private static function getQueueNameTemplate() private static function getTaskNameTemplate() { - if (null == self::$taskNameTemplate) { + if (self::$taskNameTemplate == null) { self::$taskNameTemplate = new PathTemplate('projects/{project}/locations/{location}/queues/{queue}/tasks/{task}'); } @@ -190,7 +180,7 @@ private static function getTaskNameTemplate() private static function getPathTemplateMap() { - if (null == self::$pathTemplateMap) { + if (self::$pathTemplateMap == null) { self::$pathTemplateMap = [ 'location' => self::getLocationNameTemplate(), 'project' => self::getProjectNameTemplate(), @@ -203,8 +193,8 @@ private static function getPathTemplateMap() } /** - * Formats a string containing the fully-qualified path to represent - * a location resource. + * Formats a string containing the fully-qualified path to represent a location + * resource. * * @param string $project * @param string $location @@ -220,8 +210,8 @@ public static function locationName($project, $location) } /** - * Formats a string containing the fully-qualified path to represent - * a queue resource. + * Formats a string containing the fully-qualified path to represent a queue + * resource. * * @param string $project * @param string $location @@ -239,8 +229,8 @@ public static function queueName($project, $location, $queue) } /** - * Formats a string containing the fully-qualified path to represent - * a task resource. + * Formats a string containing the fully-qualified path to represent a task + * resource. * * @param string $project * @param string $location @@ -280,12 +270,13 @@ public static function projectName($project) * Template: Pattern * - location: projects/{project}/locations/{location} * - queue: projects/{project}/locations/{location}/queues/{queue} - * - task: projects/{project}/locations/{location}/queues/{queue}/tasks/{task}. + * - 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. + * 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 @@ -297,7 +288,6 @@ public static function projectName($project) 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"); @@ -313,6 +303,7 @@ public static function parseName($formattedName, $template = null) // Swallow the exception to continue trying other path templates } } + throw new ValidationException("Input did not match any known format. Input: $formattedName"); } @@ -320,7 +311,7 @@ public static function parseName($formattedName, $template = null) * Constructor. * * @param array $options { - * Optional. Options for configuring the service API wrapper. + * Optional. Options for configuring the service API wrapper. * * @type string $serviceAddress * **Deprecated**. This option will be removed in a future major release. Please @@ -337,35 +328,38 @@ public static function parseName($formattedName, $template = null) * {@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()}. + * 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. + * 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. + * 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 + * $serviceAddress 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' => [...] + * '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 @@ -376,153 +370,6 @@ public function __construct(array $options = []) $this->setClientOptions($clientOptions); } - /** - * 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 Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listQueues($parent, array $optionalArgs = []) - { - $request = new ListQueuesRequest(); - $request->setParent($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([ - 'parent' => $request->getParent(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->getPagedListResponse( - 'ListQueues', - $optionalArgs, - ListQueuesResponse::class, - $request - ); - } - - /** - * 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 Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\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(); - $request->setName($name); - - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'GetQueue', - Queue::class, - $optionalArgs, - $request - )->wait(); - } - /** * Creates a queue. * @@ -549,23 +396,23 @@ public function getQueue($name, array $optionalArgs = []) * } * ``` * - * @param string $parent Required. The location name in which the queue will be created. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * @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. + * 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. + * [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 Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * * @return \Google\Cloud\Tasks\V2\Queue @@ -575,98 +422,113 @@ public function getQueue($name, array $optionalArgs = []) public function createQueue($parent, $queue, array $optionalArgs = []) { $request = new CreateQueueRequest(); + $requestParamHeaders = []; $request->setParent($parent); $request->setQueue($queue); - - $requestParams = new RequestParamsHeaderDescriptor([ - 'parent' => $request->getParent(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'CreateQueue', - Queue::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** - * Updates a queue. - * - * This method creates the queue if it does not exist and updates - * the queue if it does exist. + * Creates a task and adds it to 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. + * Tasks cannot be updated after creation; there is no UpdateTask command. * - * 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 maximum task size is 100KB. * * Sample code: * ``` * $cloudTasksClient = new CloudTasksClient(); * try { - * $queue = new Queue(); - * $response = $cloudTasksClient->updateQueue($queue); + * $formattedParent = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * $task = new Task(); + * $response = $cloudTasksClient->createTask($formattedParent, $task); * } 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. + * @param string $parent Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` * - * @type FieldMask $updateMask - * A mask used to specify which fields of the queue are being updated. + * 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. * - * If empty, then all fields will be updated. + * @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 Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\Cloud\Tasks\V2\Queue + * @return \Google\Cloud\Tasks\V2\Task * * @throws ApiException if the remote call fails */ - public function updateQueue($queue, array $optionalArgs = []) + public function createTask($parent, $task, array $optionalArgs = []) { - $request = new UpdateQueueRequest(); - $request->setQueue($queue); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); + $request = new CreateTaskRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setTask($task); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['responseView'])) { + $request->setResponseView($optionalArgs['responseView']); } - $requestParams = new RequestParamsHeaderDescriptor([ - 'queue.name' => $request->getQueue()->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'UpdateQueue', - Queue::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** @@ -698,13 +560,13 @@ public function updateQueue($queue, array $optionalArgs = []) * @param string $name Required. The queue name. For example: * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` * @param array $optionalArgs { - * Optional. + * Optional. * * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * * @throws ApiException if the remote call fails @@ -712,386 +574,299 @@ public function updateQueue($queue, array $optionalArgs = []) public function deleteQueue($name, array $optionalArgs = []) { $request = new DeleteQueueRequest(); + $requestParamHeaders = []; $request->setName($name); - - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'DeleteQueue', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** - * Purges a queue by deleting all of its tasks. - * - * All tasks created before this method is called are permanently deleted. + * Deletes a task. * - * Purge operations can take up to one minute to take effect. Tasks - * might be dispatched before the purge takes effect. A purge is irreversible. + * 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->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - * $response = $cloudTasksClient->purgeQueue($formattedName); + * $formattedName = $cloudTasksClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + * $cloudTasksClient->deleteTask($formattedName); * } finally { * $cloudTasksClient->close(); * } * ``` * - * @param string $name Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * @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. + * Optional. * * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\Cloud\Tasks\V2\Queue - * * @throws ApiException if the remote call fails */ - public function purgeQueue($name, array $optionalArgs = []) + public function deleteTask($name, array $optionalArgs = []) { - $request = new PurgeQueueRequest(); + $request = new DeleteTaskRequest(); + $requestParamHeaders = []; $request->setName($name); - - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'PurgeQueue', - Queue::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** - * Pauses the queue. + * 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. * - * 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]. + * 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 { - * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - * $response = $cloudTasksClient->pauseQueue($formattedName); + * $resource = 'resource'; + * $response = $cloudTasksClient->getIamPolicy($resource); * } finally { * $cloudTasksClient->close(); * } * ``` * - * @param string $name Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * @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. + * Optional. * + * @type GetPolicyOptions $options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\Cloud\Tasks\V2\Queue + * @return \Google\Cloud\Iam\V1\Policy * * @throws ApiException if the remote call fails */ - public function pauseQueue($name, array $optionalArgs = []) + public function getIamPolicy($resource, array $optionalArgs = []) { - $request = new PauseQueueRequest(); - $request->setName($name); - - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); + $request = new GetIamPolicyRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['options'])) { + $request->setOptions($optionalArgs['options']); + } - return $this->startCall( - 'PauseQueue', - Queue::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** - * 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). + * Gets a queue. * * Sample code: * ``` * $cloudTasksClient = new CloudTasksClient(); * try { * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - * $response = $cloudTasksClient->resumeQueue($formattedName); + * $response = $cloudTasksClient->getQueue($formattedName); * } finally { * $cloudTasksClient->close(); * } * ``` * - * @param string $name Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * @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. + * Optional. * * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * * @return \Google\Cloud\Tasks\V2\Queue * * @throws ApiException if the remote call fails */ - public function resumeQueue($name, array $optionalArgs = []) + public function getQueue($name, array $optionalArgs = []) { - $request = new ResumeQueueRequest(); + $request = new GetQueueRequest(); + $requestParamHeaders = []; $request->setName($name); - - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'ResumeQueue', - Queue::class, - $optionalArgs, - $request - )->wait(); + $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 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` + * Gets a task. * * Sample code: * ``` * $cloudTasksClient = new CloudTasksClient(); * try { - * $resource = ''; - * $response = $cloudTasksClient->getIamPolicy($resource); + * $formattedName = $cloudTasksClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + * $response = $cloudTasksClient->getTask($formattedName); * } 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 string $name Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` * @param array $optionalArgs { - * Optional. + * Optional. * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. + * @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 Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\Cloud\Iam\V1\Policy + * @return \Google\Cloud\Tasks\V2\Task * * @throws ApiException if the remote call fails */ - public function getIamPolicy($resource, array $optionalArgs = []) + public function getTask($name, array $optionalArgs = []) { - $request = new GetIamPolicyRequest(); - $request->setResource($resource); - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); + $request = new GetTaskRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['responseView'])) { + $request->setResponseView($optionalArgs['responseView']); } - $requestParams = new RequestParamsHeaderDescriptor([ - 'resource' => $request->getResource(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'GetIamPolicy', - Policy::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** - * 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: + * Lists queues. * - * * `cloudtasks.queues.setIamPolicy` + * Queues are returned in lexicographical order. * * Sample code: * ``` * $cloudTasksClient = new CloudTasksClient(); * try { - * $resource = ''; - * $policy = new Policy(); - * $response = $cloudTasksClient->setIamPolicy($resource, $policy); + * $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 $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 string $parent Required. The location name. + * For example: `projects/PROJECT_ID/locations/LOCATION_ID` * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy + * Optional. * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $request->setResource($resource); - $request->setPolicy($policy); - - $requestParams = new RequestParamsHeaderDescriptor([ - 'resource' => $request->getResource(), - ]); - $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 = ''; - * $permissions = []; - * $response = $cloudTasksClient->testIamPermissions($resource, $permissions); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` + * @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). * - * @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. + * 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 Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse + * @return \Google\ApiCore\PagedListResponse * * @throws ApiException if the remote call fails */ - public function testIamPermissions($resource, $permissions, array $optionalArgs = []) + public function listQueues($parent, array $optionalArgs = []) { - $request = new TestIamPermissionsRequest(); - $request->setResource($resource); - $request->setPermissions($permissions); + $request = new ListQueuesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } - $requestParams = new RequestParamsHeaderDescriptor([ - 'resource' => $request->getResource(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } - return $this->startCall( - 'TestIamPermissions', - TestIamPermissionsResponse::class, - $optionalArgs, - $request - )->wait(); + 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); } /** @@ -1117,10 +892,7 @@ public function testIamPermissions($resource, $permissions, array $optionalArgs * // doSomethingWith($element); * } * } - * - * * // Alternatively: - * * // Iterate through all elements * $pagedResponse = $cloudTasksClient->listTasks($formattedParent); * foreach ($pagedResponse->iterateAllElements() as $element) { @@ -1134,36 +906,36 @@ public function testIamPermissions($resource, $permissions, array $optionalArgs * @param string $parent Required. The queue name. For example: * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` * @param array $optionalArgs { - * Optional. + * 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} + * 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. + * 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. + * 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 Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * * @return \Google\ApiCore\PagedListResponse @@ -1173,257 +945,170 @@ public function testIamPermissions($resource, $permissions, array $optionalArgs 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([ - 'parent' => $request->getParent(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->getPagedListResponse( - 'ListTasks', - $optionalArgs, - ListTasksResponse::class, - $request - ); + $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); } /** - * Gets a task. + * 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->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - * $response = $cloudTasksClient->getTask($formattedName); + * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * $response = $cloudTasksClient->pauseQueue($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 string $name Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` * @param array $optionalArgs { - * Optional. + * 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 Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\Cloud\Tasks\V2\Task + * @return \Google\Cloud\Tasks\V2\Queue * * @throws ApiException if the remote call fails */ - public function getTask($name, array $optionalArgs = []) + public function pauseQueue($name, array $optionalArgs = []) { - $request = new GetTaskRequest(); + $request = new PauseQueueRequest(); + $requestParamHeaders = []; $request->setName($name); - if (isset($optionalArgs['responseView'])) { - $request->setResponseView($optionalArgs['responseView']); - } - - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'GetTask', - Task::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** - * Creates a task and adds it to a queue. + * Purges a queue by deleting all of its tasks. * - * Tasks cannot be updated after creation; there is no UpdateTask command. + * All tasks created before this method is called are permanently deleted. * - * * The maximum task size is 100KB. + * 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 { - * $formattedParent = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - * $task = new Task(); - * $response = $cloudTasksClient->createTask($formattedParent, $task); + * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * $response = $cloudTasksClient->purgeQueue($formattedName); * } 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. + * @param string $name Required. The queue name. For example: + * `projects/PROJECT_ID/location/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 RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\Cloud\Tasks\V2\Task + * @return \Google\Cloud\Tasks\V2\Queue * * @throws ApiException if the remote call fails */ - public function createTask($parent, $task, array $optionalArgs = []) + public function purgeQueue($name, array $optionalArgs = []) { - $request = new CreateTaskRequest(); - $request->setParent($parent); - $request->setTask($task); - if (isset($optionalArgs['responseView'])) { - $request->setResponseView($optionalArgs['responseView']); - } - - $requestParams = new RequestParamsHeaderDescriptor([ - 'parent' => $request->getParent(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'CreateTask', - Task::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** - * Deletes a task. + * Resume a queue. * - * A task can be deleted if it is scheduled or dispatched. A task - * cannot be deleted if it has executed successfully or permanently - * failed. + * 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->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - * $cloudTasksClient->deleteTask($formattedName); + * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * $response = $cloudTasksClient->resumeQueue($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 string $name Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` * @param array $optionalArgs { - * Optional. + * Optional. * * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * + * @return \Google\Cloud\Tasks\V2\Queue + * * @throws ApiException if the remote call fails */ - public function deleteTask($name, array $optionalArgs = []) + public function resumeQueue($name, array $optionalArgs = []) { - $request = new DeleteTaskRequest(); + $request = new ResumeQueueRequest(); + $requestParamHeaders = []; $request->setName($name); - - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'DeleteTask', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** @@ -1466,27 +1151,27 @@ public function deleteTask($name, array $optionalArgs = []) * @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. + * 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} + * 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 Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * * @return \Google\Cloud\Tasks\V2\Task @@ -1496,23 +1181,193 @@ public function deleteTask($name, array $optionalArgs = []) 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([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); + $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 RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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; + $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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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']); + } - return $this->startCall( - 'RunTask', - Task::class, - $optionalArgs, - $request - )->wait(); + $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(); } } diff --git a/Tasks/src/V2/HttpRequest.php b/Tasks/src/V2/HttpRequest.php index 5a77f6288f21..8dabbc2d03f9 100644 --- a/Tasks/src/V2/HttpRequest.php +++ b/Tasks/src/V2/HttpRequest.php @@ -66,8 +66,8 @@ class HttpRequest extends \Google\Protobuf\Internal\Message * [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. + * * `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]. @@ -119,8 +119,8 @@ class HttpRequest extends \Google\Protobuf\Internal\Message * [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. + * * `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]. @@ -232,8 +232,8 @@ public function setHttpMethod($var) * [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. + * * `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]. @@ -263,8 +263,8 @@ public function getHeaders() * [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. + * * `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]. diff --git a/Tasks/src/V2/Queue.php b/Tasks/src/V2/Queue.php index cdef419f62c8..46f68ed0a7e5 100644 --- a/Tasks/src/V2/Queue.php +++ b/Tasks/src/V2/Queue.php @@ -287,7 +287,7 @@ public function setName($var) */ public function getAppEngineRoutingOverride() { - return isset($this->app_engine_routing_override) ? $this->app_engine_routing_override : null; + return $this->app_engine_routing_override; } public function hasAppEngineRoutingOverride() @@ -350,7 +350,7 @@ public function setAppEngineRoutingOverride($var) */ public function getRateLimits() { - return isset($this->rate_limits) ? $this->rate_limits : null; + return $this->rate_limits; } public function hasRateLimits() @@ -413,7 +413,7 @@ public function setRateLimits($var) */ public function getRetryConfig() { - return isset($this->retry_config) ? $this->retry_config : null; + return $this->retry_config; } public function hasRetryConfig() @@ -500,7 +500,7 @@ public function setState($var) */ public function getPurgeTime() { - return isset($this->purge_time) ? $this->purge_time : null; + return $this->purge_time; } public function hasPurgeTime() @@ -545,7 +545,7 @@ public function setPurgeTime($var) */ public function getStackdriverLoggingConfig() { - return isset($this->stackdriver_logging_config) ? $this->stackdriver_logging_config : null; + return $this->stackdriver_logging_config; } public function hasStackdriverLoggingConfig() diff --git a/Tasks/src/V2/RetryConfig.php b/Tasks/src/V2/RetryConfig.php index 325eaa0f2b90..2b1083d1c897 100644 --- a/Tasks/src/V2/RetryConfig.php +++ b/Tasks/src/V2/RetryConfig.php @@ -256,7 +256,7 @@ public function setMaxAttempts($var) */ public function getMaxRetryDuration() { - return isset($this->max_retry_duration) ? $this->max_retry_duration : null; + return $this->max_retry_duration; } public function hasMaxRetryDuration() @@ -314,7 +314,7 @@ public function setMaxRetryDuration($var) */ public function getMinBackoff() { - return isset($this->min_backoff) ? $this->min_backoff : null; + return $this->min_backoff; } public function hasMinBackoff() @@ -370,7 +370,7 @@ public function setMinBackoff($var) */ public function getMaxBackoff() { - return isset($this->max_backoff) ? $this->max_backoff : null; + return $this->max_backoff; } public function hasMaxBackoff() diff --git a/Tasks/src/V2/Task.php b/Tasks/src/V2/Task.php index 5c9ce9d6388e..72bf25e135a2 100644 --- a/Tasks/src/V2/Task.php +++ b/Tasks/src/V2/Task.php @@ -337,7 +337,7 @@ public function setHttpRequest($var) */ public function getScheduleTime() { - return isset($this->schedule_time) ? $this->schedule_time : null; + return $this->schedule_time; } public function hasScheduleTime() @@ -375,7 +375,7 @@ public function setScheduleTime($var) */ public function getCreateTime() { - return isset($this->create_time) ? $this->create_time : null; + return $this->create_time; } public function hasCreateTime() @@ -437,7 +437,7 @@ public function setCreateTime($var) */ public function getDispatchDeadline() { - return isset($this->dispatch_deadline) ? $this->dispatch_deadline : null; + return $this->dispatch_deadline; } public function hasDispatchDeadline() @@ -556,7 +556,7 @@ public function setResponseCount($var) */ public function getFirstAttempt() { - return isset($this->first_attempt) ? $this->first_attempt : null; + return $this->first_attempt; } public function hasFirstAttempt() @@ -594,7 +594,7 @@ public function setFirstAttempt($var) */ public function getLastAttempt() { - return isset($this->last_attempt) ? $this->last_attempt : null; + return $this->last_attempt; } public function hasLastAttempt() diff --git a/Tasks/src/V2/UpdateQueueRequest.php b/Tasks/src/V2/UpdateQueueRequest.php index fdd95102e7c2..106f4b67243d 100644 --- a/Tasks/src/V2/UpdateQueueRequest.php +++ b/Tasks/src/V2/UpdateQueueRequest.php @@ -67,7 +67,7 @@ public function __construct($data = NULL) { */ public function getQueue() { - return isset($this->queue) ? $this->queue : null; + return $this->queue; } public function hasQueue() @@ -108,7 +108,7 @@ public function setQueue($var) */ public function getUpdateMask() { - return isset($this->update_mask) ? $this->update_mask : null; + return $this->update_mask; } public function hasUpdateMask() diff --git a/owl-bot-staging/Tasks/v2/src/V2/gapic_metadata.json b/Tasks/src/V2/gapic_metadata.json similarity index 100% rename from owl-bot-staging/Tasks/v2/src/V2/gapic_metadata.json rename to Tasks/src/V2/gapic_metadata.json diff --git a/Tasks/src/V2/resources/cloud_tasks_client_config.json b/Tasks/src/V2/resources/cloud_tasks_client_config.json index fd96fd3a8747..4bae73ae12b6 100644 --- a/Tasks/src/V2/resources/cloud_tasks_client_config.json +++ b/Tasks/src/V2/resources/cloud_tasks_client_config.json @@ -1,125 +1,125 @@ { - "interfaces": { - "google.cloud.tasks.v2.CloudTasks": { - "retry_codes": { - "retry_policy_1_codes": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "no_retry_codes": [], - "no_retry_1_codes": [] - }, - "retry_params": { - "retry_policy_1_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 10000, - "initial_rpc_timeout_millis": 10000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 10000, - "total_timeout_millis": 10000 - }, - "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": 10000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 10000, - "total_timeout_millis": 10000 + "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": 10000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 10000, + "total_timeout_millis": 10000 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 10000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 10000, + "total_timeout_millis": 10000 + } + }, + "methods": { + "CreateQueue": { + "timeout_millis": 10000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateTask": { + "timeout_millis": 10000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteQueue": { + "timeout_millis": 10000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteTask": { + "timeout_millis": 10000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetIamPolicy": { + "timeout_millis": 10000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetQueue": { + "timeout_millis": 10000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetTask": { + "timeout_millis": 10000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListQueues": { + "timeout_millis": 10000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListTasks": { + "timeout_millis": 10000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "PauseQueue": { + "timeout_millis": 10000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "PurgeQueue": { + "timeout_millis": 10000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ResumeQueue": { + "timeout_millis": 10000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "RunTask": { + "timeout_millis": 10000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetIamPolicy": { + "timeout_millis": 10000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "timeout_millis": 10000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateQueue": { + "timeout_millis": 10000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } } - }, - "methods": { - "ListQueues": { - "timeout_millis": 15000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetQueue": { - "timeout_millis": 10000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "CreateQueue": { - "timeout_millis": 10000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UpdateQueue": { - "timeout_millis": 10000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteQueue": { - "timeout_millis": 10000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "PurgeQueue": { - "timeout_millis": 10000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "PauseQueue": { - "timeout_millis": 10000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "ResumeQueue": { - "timeout_millis": 10000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GetIamPolicy": { - "timeout_millis": 10000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "SetIamPolicy": { - "timeout_millis": 10000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "TestIamPermissions": { - "timeout_millis": 10000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListTasks": { - "timeout_millis": 10000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetTask": { - "timeout_millis": 10000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "CreateTask": { - "timeout_millis": 10000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteTask": { - "timeout_millis": 10000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "RunTask": { - "timeout_millis": 10000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - } - } } - } } diff --git a/Tasks/src/V2/resources/cloud_tasks_rest_client_config.php b/Tasks/src/V2/resources/cloud_tasks_rest_client_config.php index 5f9e4deca013..5f0644a0be9d 100644 --- a/Tasks/src/V2/resources/cloud_tasks_rest_client_config.php +++ b/Tasks/src/V2/resources/cloud_tasks_rest_client_config.php @@ -3,9 +3,10 @@ return [ 'interfaces' => [ 'google.cloud.tasks.v2.CloudTasks' => [ - 'ListQueues' => [ - 'method' => 'get', + 'CreateQueue' => [ + 'method' => 'post', 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/queues', + 'body' => 'queue', 'placeholders' => [ 'parent' => [ 'getters' => [ @@ -14,21 +15,10 @@ ], ], ], - 'GetQueue' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/queues/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'CreateQueue' => [ + 'CreateTask' => [ 'method' => 'post', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/queues', - 'body' => 'queue', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/queues/*}/tasks', + 'body' => '*', 'placeholders' => [ 'parent' => [ 'getters' => [ @@ -37,22 +27,20 @@ ], ], ], - 'UpdateQueue' => [ - 'method' => 'patch', - 'uriTemplate' => '/v2/{queue.name=projects/*/locations/*/queues/*}', - 'body' => 'queue', + 'DeleteQueue' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/queues/*}', 'placeholders' => [ - 'queue.name' => [ + 'name' => [ 'getters' => [ - 'getQueue', 'getName', ], ], ], ], - 'DeleteQueue' => [ + 'DeleteTask' => [ 'method' => 'delete', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/queues/*}', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/queues/*/tasks/*}', 'placeholders' => [ 'name' => [ 'getters' => [ @@ -61,22 +49,21 @@ ], ], ], - 'PurgeQueue' => [ + 'GetIamPolicy' => [ 'method' => 'post', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/queues/*}:purge', + 'uriTemplate' => '/v2/{resource=projects/*/locations/*/queues/*}:getIamPolicy', 'body' => '*', 'placeholders' => [ - 'name' => [ + 'resource' => [ 'getters' => [ - 'getName', + 'getResource', ], ], ], ], - 'PauseQueue' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/queues/*}:pause', - 'body' => '*', + 'GetQueue' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/queues/*}', 'placeholders' => [ 'name' => [ 'getters' => [ @@ -85,10 +72,9 @@ ], ], ], - 'ResumeQueue' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/queues/*}:resume', - 'body' => '*', + 'GetTask' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/queues/*/tasks/*}', 'placeholders' => [ 'name' => [ 'getters' => [ @@ -97,56 +83,56 @@ ], ], ], - 'GetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{resource=projects/*/locations/*/queues/*}:getIamPolicy', - 'body' => '*', + 'ListQueues' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/queues', 'placeholders' => [ - 'resource' => [ + 'parent' => [ 'getters' => [ - 'getResource', + 'getParent', ], ], ], ], - 'SetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{resource=projects/*/locations/*/queues/*}:setIamPolicy', - 'body' => '*', + 'ListTasks' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/queues/*}/tasks', 'placeholders' => [ - 'resource' => [ + 'parent' => [ 'getters' => [ - 'getResource', + 'getParent', ], ], ], ], - 'TestIamPermissions' => [ + 'PauseQueue' => [ 'method' => 'post', - 'uriTemplate' => '/v2/{resource=projects/*/locations/*/queues/*}:testIamPermissions', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/queues/*}:pause', 'body' => '*', 'placeholders' => [ - 'resource' => [ + 'name' => [ 'getters' => [ - 'getResource', + 'getName', ], ], ], ], - 'ListTasks' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*/queues/*}/tasks', + 'PurgeQueue' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/queues/*}:purge', + 'body' => '*', 'placeholders' => [ - 'parent' => [ + 'name' => [ 'getters' => [ - 'getParent', + 'getName', ], ], ], ], - 'GetTask' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/queues/*/tasks/*}', + 'ResumeQueue' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/queues/*}:resume', + 'body' => '*', 'placeholders' => [ 'name' => [ 'getters' => [ @@ -155,36 +141,50 @@ ], ], ], - 'CreateTask' => [ + 'RunTask' => [ 'method' => 'post', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*/queues/*}/tasks', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/queues/*/tasks/*}:run', 'body' => '*', 'placeholders' => [ - 'parent' => [ + 'name' => [ 'getters' => [ - 'getParent', + 'getName', ], ], ], ], - 'DeleteTask' => [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/queues/*/tasks/*}', + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{resource=projects/*/locations/*/queues/*}:setIamPolicy', + 'body' => '*', 'placeholders' => [ - 'name' => [ + 'resource' => [ 'getters' => [ - 'getName', + 'getResource', ], ], ], ], - 'RunTask' => [ + 'TestIamPermissions' => [ 'method' => 'post', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/queues/*/tasks/*}:run', + 'uriTemplate' => '/v2/{resource=projects/*/locations/*/queues/*}:testIamPermissions', 'body' => '*', 'placeholders' => [ - 'name' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'UpdateQueue' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{queue.name=projects/*/locations/*/queues/*}', + 'body' => 'queue', + 'placeholders' => [ + 'queue.name' => [ 'getters' => [ + 'getQueue', 'getName', ], ], diff --git a/Tasks/src/V2beta2/AcknowledgeTaskRequest.php b/Tasks/src/V2beta2/AcknowledgeTaskRequest.php index c07c703e9439..249894669f4c 100644 --- a/Tasks/src/V2beta2/AcknowledgeTaskRequest.php +++ b/Tasks/src/V2beta2/AcknowledgeTaskRequest.php @@ -96,7 +96,7 @@ public function setName($var) */ public function getScheduleTime() { - return isset($this->schedule_time) ? $this->schedule_time : null; + return $this->schedule_time; } public function hasScheduleTime() diff --git a/Tasks/src/V2beta2/AppEngineHttpRequest.php b/Tasks/src/V2beta2/AppEngineHttpRequest.php index 0ed11ac87d26..b7a5020d0e91 100644 --- a/Tasks/src/V2beta2/AppEngineHttpRequest.php +++ b/Tasks/src/V2beta2/AppEngineHttpRequest.php @@ -270,7 +270,7 @@ public function setHttpMethod($var) */ public function getAppEngineRouting() { - return isset($this->app_engine_routing) ? $this->app_engine_routing : null; + return $this->app_engine_routing; } public function hasAppEngineRouting() diff --git a/Tasks/src/V2beta2/AppEngineHttpTarget.php b/Tasks/src/V2beta2/AppEngineHttpTarget.php index bdae54cd604f..d5f8a6871ae7 100644 --- a/Tasks/src/V2beta2/AppEngineHttpTarget.php +++ b/Tasks/src/V2beta2/AppEngineHttpTarget.php @@ -66,7 +66,7 @@ public function __construct($data = NULL) { */ public function getAppEngineRoutingOverride() { - return isset($this->app_engine_routing_override) ? $this->app_engine_routing_override : null; + return $this->app_engine_routing_override; } public function hasAppEngineRoutingOverride() diff --git a/Tasks/src/V2beta2/AttemptStatus.php b/Tasks/src/V2beta2/AttemptStatus.php index a814038ef196..b8a349382bb4 100644 --- a/Tasks/src/V2beta2/AttemptStatus.php +++ b/Tasks/src/V2beta2/AttemptStatus.php @@ -80,7 +80,7 @@ public function __construct($data = NULL) { */ public function getScheduleTime() { - return isset($this->schedule_time) ? $this->schedule_time : null; + return $this->schedule_time; } public function hasScheduleTime() @@ -118,7 +118,7 @@ public function setScheduleTime($var) */ public function getDispatchTime() { - return isset($this->dispatch_time) ? $this->dispatch_time : null; + return $this->dispatch_time; } public function hasDispatchTime() @@ -156,7 +156,7 @@ public function setDispatchTime($var) */ public function getResponseTime() { - return isset($this->response_time) ? $this->response_time : null; + return $this->response_time; } public function hasResponseTime() @@ -195,7 +195,7 @@ public function setResponseTime($var) */ public function getResponseStatus() { - return isset($this->response_status) ? $this->response_status : null; + return $this->response_status; } public function hasResponseStatus() diff --git a/Tasks/src/V2beta2/CancelLeaseRequest.php b/Tasks/src/V2beta2/CancelLeaseRequest.php index 9f401d27b1b1..9b6a2e3d4494 100644 --- a/Tasks/src/V2beta2/CancelLeaseRequest.php +++ b/Tasks/src/V2beta2/CancelLeaseRequest.php @@ -122,7 +122,7 @@ public function setName($var) */ public function getScheduleTime() { - return isset($this->schedule_time) ? $this->schedule_time : null; + return $this->schedule_time; } public function hasScheduleTime() diff --git a/Tasks/src/V2beta2/CloudTasksClient.php b/Tasks/src/V2beta2/CloudTasksClient.php index f9131aca22ba..0559226dcc38 100644 --- a/Tasks/src/V2beta2/CloudTasksClient.php +++ b/Tasks/src/V2beta2/CloudTasksClient.php @@ -17,9 +17,9 @@ /* * GENERATED CODE WARNING - * This file was generated from the file - * https://github.com/google/googleapis/blob/master/google/cloud/tasks/v2beta2/cloudtasks.proto - * and updates to that file get reflected here through a refresh process. + * Generated by gapic-generator-php from the file + * https://github.com/googleapis/googleapis/blob/master/google/cloud/tasks/v2beta2/cloudtasks.proto + * Updates to the above are reflected here through a refresh process. * * @experimental */ @@ -28,11 +28,9 @@ use Google\Cloud\Tasks\V2beta2\Gapic\CloudTasksGapicClient; -/** - * {@inheritdoc} - */ +/** {@inheritdoc} */ class CloudTasksClient extends CloudTasksGapicClient { - // This class is intentionally empty, and is intended to hold manual - // additions to the generated {@see CloudTasksGapicClient} class. + // This class is intentionally empty, and is intended to hold manual additions to + // the generated {@see CloudTasksGapicClient} class. } diff --git a/Tasks/src/V2beta2/CreateQueueRequest.php b/Tasks/src/V2beta2/CreateQueueRequest.php index 6b93ba215f83..d5b049bb2cac 100644 --- a/Tasks/src/V2beta2/CreateQueueRequest.php +++ b/Tasks/src/V2beta2/CreateQueueRequest.php @@ -98,7 +98,7 @@ public function setParent($var) */ public function getQueue() { - return isset($this->queue) ? $this->queue : null; + return $this->queue; } public function hasQueue() diff --git a/Tasks/src/V2beta2/CreateTaskRequest.php b/Tasks/src/V2beta2/CreateTaskRequest.php index 57f17bc6b803..08f3b2ddd8f5 100644 --- a/Tasks/src/V2beta2/CreateTaskRequest.php +++ b/Tasks/src/V2beta2/CreateTaskRequest.php @@ -194,7 +194,7 @@ public function setParent($var) */ public function getTask() { - return isset($this->task) ? $this->task : null; + return $this->task; } public function hasTask() diff --git a/Tasks/src/V2beta2/Gapic/CloudTasksGapicClient.php b/Tasks/src/V2beta2/Gapic/CloudTasksGapicClient.php index 4fefba83238b..004279589178 100644 --- a/Tasks/src/V2beta2/Gapic/CloudTasksGapicClient.php +++ b/Tasks/src/V2beta2/Gapic/CloudTasksGapicClient.php @@ -17,9 +17,9 @@ /* * GENERATED CODE WARNING - * This file was generated from the file - * https://github.com/google/googleapis/blob/master/google/cloud/tasks/v2beta2/cloudtasks.proto - * and updates to that file get reflected here through a refresh process. + * Generated by gapic-generator-php from the file + * https://github.com/googleapis/googleapis/blob/master/google/cloud/tasks/v2beta2/cloudtasks.proto + * Updates to the above are reflected here through a refresh process. * * @experimental */ @@ -29,6 +29,7 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; + use Google\ApiCore\PathTemplate; use Google\ApiCore\RequestParamsHeaderDescriptor; use Google\ApiCore\RetrySettings; @@ -79,32 +80,18 @@ * ``` * $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); - * } + * $formattedName = $cloudTasksClient->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. + * 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 */ @@ -138,26 +125,29 @@ class CloudTasksGapicClient public static $serviceScopes = [ 'https://www.googleapis.com/auth/cloud-platform', ]; + private static $locationNameTemplate; - private static $projectNameTemplate; + 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', + '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', + 'restClientConfigPath' => __DIR__ . '/../resources/cloud_tasks_rest_client_config.php', ], ], ]; @@ -165,7 +155,7 @@ private static function getClientDefaults() private static function getLocationNameTemplate() { - if (null == self::$locationNameTemplate) { + if (self::$locationNameTemplate == null) { self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); } @@ -183,7 +173,7 @@ private static function getProjectNameTemplate() private static function getQueueNameTemplate() { - if (null == self::$queueNameTemplate) { + if (self::$queueNameTemplate == null) { self::$queueNameTemplate = new PathTemplate('projects/{project}/locations/{location}/queues/{queue}'); } @@ -192,7 +182,7 @@ private static function getQueueNameTemplate() private static function getTaskNameTemplate() { - if (null == self::$taskNameTemplate) { + if (self::$taskNameTemplate == null) { self::$taskNameTemplate = new PathTemplate('projects/{project}/locations/{location}/queues/{queue}/tasks/{task}'); } @@ -201,7 +191,7 @@ private static function getTaskNameTemplate() private static function getPathTemplateMap() { - if (null == self::$pathTemplateMap) { + if (self::$pathTemplateMap == null) { self::$pathTemplateMap = [ 'location' => self::getLocationNameTemplate(), 'project' => self::getProjectNameTemplate(), @@ -214,13 +204,14 @@ private static function getPathTemplateMap() } /** - * Formats a string containing the fully-qualified path to represent - * a location resource. + * 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) @@ -232,14 +223,15 @@ public static function locationName($project, $location) } /** - * Formats a string containing the fully-qualified path to represent - * a queue resource. + * 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) @@ -252,8 +244,8 @@ public static function queueName($project, $location, $queue) } /** - * Formats a string containing the fully-qualified path to represent - * a task resource. + * Formats a string containing the fully-qualified path to represent a task + * resource. * * @param string $project * @param string $location @@ -261,6 +253,7 @@ public static function queueName($project, $location, $queue) * @param string $task * * @return string The formatted task resource. + * * @experimental */ public static function taskName($project, $location, $queue, $task) @@ -294,12 +287,13 @@ public static function projectName($project) * Template: Pattern * - location: projects/{project}/locations/{location} * - queue: projects/{project}/locations/{location}/queues/{queue} - * - task: projects/{project}/locations/{location}/queues/{queue}/tasks/{task}. + * - 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. + * 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 @@ -307,12 +301,12 @@ public static function projectName($project) * @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"); @@ -328,6 +322,7 @@ public static function parseName($formattedName, $template = null) // Swallow the exception to continue trying other path templates } } + throw new ValidationException("Input did not match any known format. Input: $formattedName"); } @@ -335,7 +330,7 @@ public static function parseName($formattedName, $template = null) * Constructor. * * @param array $options { - * Optional. Options for configuring the service API wrapper. + * Optional. Options for configuring the service API wrapper. * * @type string $serviceAddress * **Deprecated**. This option will be removed in a future major release. Please @@ -352,38 +347,42 @@ public static function parseName($formattedName, $template = null) * {@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()}. + * 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. + * 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. + * 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 + * $serviceAddress 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' => [...] + * '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 = []) @@ -393,168 +392,136 @@ public function __construct(array $options = []) } /** - * Lists queues. + * Acknowledges a pull task. * - * Queues are returned in lexicographical order. + * 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 { - * $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); - * } + * $formattedName = $cloudTasksClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + * $scheduleTime = new Timestamp(); + * $cloudTasksClient->acknowledgeTask($formattedName, $scheduleTime); * } 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: *". + * @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. * - * 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 Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\ApiCore\PagedListResponse - * * @throws ApiException if the remote call fails + * * @experimental */ - public function listQueues($parent, array $optionalArgs = []) + public function acknowledgeTask($name, $scheduleTime, array $optionalArgs = []) { - $request = new ListQueuesRequest(); - $request->setParent($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([ - 'parent' => $request->getParent(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->getPagedListResponse( - 'ListQueues', - $optionalArgs, - ListQueuesResponse::class, - $request - ); + $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(); } /** - * Gets a queue. + * 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->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - * $response = $cloudTasksClient->getQueue($formattedName); + * $formattedName = $cloudTasksClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + * $scheduleTime = new Timestamp(); + * $response = $cloudTasksClient->cancelLease($formattedName, $scheduleTime); * } 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. + * @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 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 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 Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\Cloud\Tasks\V2beta2\Queue + * @return \Google\Cloud\Tasks\V2beta2\Task * * @throws ApiException if the remote call fails + * * @experimental */ - public function getQueue($name, array $optionalArgs = []) + public function cancelLease($name, $scheduleTime, array $optionalArgs = []) { - $request = new GetQueueRequest(); + $request = new CancelLeaseRequest(); + $requestParamHeaders = []; $request->setName($name); - if (isset($optionalArgs['readMask'])) { - $request->setReadMask($optionalArgs['readMask']); + $request->setScheduleTime($scheduleTime); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['responseView'])) { + $request->setResponseView($optionalArgs['responseView']); } - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'GetQueue', - Queue::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** @@ -583,126 +550,145 @@ public function getQueue($name, array $optionalArgs = []) * } * ``` * - * @param string $parent Required. The location name in which the queue will be created. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * @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. + * 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. + * [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 Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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); - - $requestParams = new RequestParamsHeaderDescriptor([ - 'parent' => $request->getParent(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'CreateQueue', - Queue::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** - * Updates a queue. - * - * This method creates the queue if it does not exist and updates - * the queue if it does exist. + * Creates a task and adds it to 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. + * Tasks cannot be updated after creation; there is no UpdateTask command. * - * 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. + * * 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 { - * $queue = new Queue(); - * $response = $cloudTasksClient->updateQueue($queue); + * $formattedParent = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * $task = new Task(); + * $response = $cloudTasksClient->createTask($formattedParent, $task); * } 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. + * @param string $parent Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` * - * @type FieldMask $updateMask - * A mask used to specify which fields of the queue are being updated. + * 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 ~1hour 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 ~9days 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. * - * If empty, then all fields will be updated. + * @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 Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\Cloud\Tasks\V2beta2\Queue + * @return \Google\Cloud\Tasks\V2beta2\Task * * @throws ApiException if the remote call fails + * * @experimental */ - public function updateQueue($queue, array $optionalArgs = []) + public function createTask($parent, $task, array $optionalArgs = []) { - $request = new UpdateQueueRequest(); - $request->setQueue($queue); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); + $request = new CreateTaskRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setTask($task); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['responseView'])) { + $request->setResponseView($optionalArgs['responseView']); } - $requestParams = new RequestParamsHeaderDescriptor([ - 'queue.name' => $request->getQueue()->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'UpdateQueue', - Queue::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** @@ -734,407 +720,495 @@ public function updateQueue($queue, array $optionalArgs = []) * @param string $name Required. The queue name. For example: * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` * @param array $optionalArgs { - * Optional. + * Optional. * * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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); - - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'DeleteQueue', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** - * Purges a queue by deleting all of its tasks. - * - * All tasks created before this method is called are permanently deleted. + * Deletes a task. * - * Purge operations can take up to one minute to take effect. Tasks - * might be dispatched before the purge takes effect. A purge is irreversible. + * 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->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - * $response = $cloudTasksClient->purgeQueue($formattedName); + * $formattedName = $cloudTasksClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + * $cloudTasksClient->deleteTask($formattedName); * } finally { * $cloudTasksClient->close(); * } * ``` * - * @param string $name Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * @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. + * Optional. * * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\Cloud\Tasks\V2beta2\Queue - * * @throws ApiException if the remote call fails + * * @experimental */ - public function purgeQueue($name, array $optionalArgs = []) + public function deleteTask($name, array $optionalArgs = []) { - $request = new PurgeQueueRequest(); + $request = new DeleteTaskRequest(); + $requestParamHeaders = []; $request->setName($name); - - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'PurgeQueue', - Queue::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** - * Pauses the queue. + * 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. * - * 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]. + * 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 { - * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - * $response = $cloudTasksClient->pauseQueue($formattedName); + * $resource = 'resource'; + * $response = $cloudTasksClient->getIamPolicy($resource); * } finally { * $cloudTasksClient->close(); * } * ``` * - * @param string $name Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * @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. + * Optional. * + * @type GetPolicyOptions $options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\Cloud\Tasks\V2beta2\Queue + * @return \Google\Cloud\Iam\V1\Policy * * @throws ApiException if the remote call fails + * * @experimental */ - public function pauseQueue($name, array $optionalArgs = []) + public function getIamPolicy($resource, array $optionalArgs = []) { - $request = new PauseQueueRequest(); - $request->setName($name); + $request = new GetIamPolicyRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['options'])) { + $request->setOptions($optionalArgs['options']); + } - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'PauseQueue', - Queue::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** - * 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). + * Gets a queue. * * Sample code: * ``` * $cloudTasksClient = new CloudTasksClient(); * try { * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - * $response = $cloudTasksClient->resumeQueue($formattedName); + * $response = $cloudTasksClient->getQueue($formattedName); * } finally { * $cloudTasksClient->close(); * } * ``` * - * @param string $name Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * @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. + * 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 Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * * @return \Google\Cloud\Tasks\V2beta2\Queue * * @throws ApiException if the remote call fails + * * @experimental */ - public function resumeQueue($name, array $optionalArgs = []) + public function getQueue($name, array $optionalArgs = []) { - $request = new ResumeQueueRequest(); + $request = new GetQueueRequest(); + $requestParamHeaders = []; $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['readMask'])) { + $request->setReadMask($optionalArgs['readMask']); + } - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'ResumeQueue', - Queue::class, - $optionalArgs, - $request - )->wait(); + $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 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` + * Gets a task. * * Sample code: * ``` * $cloudTasksClient = new CloudTasksClient(); * try { - * $resource = ''; - * $response = $cloudTasksClient->getIamPolicy($resource); + * $formattedName = $cloudTasksClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + * $response = $cloudTasksClient->getTask($formattedName); * } 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 string $name Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` * @param array $optionalArgs { - * Optional. + * Optional. * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. + * @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 Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\Cloud\Iam\V1\Policy + * @return \Google\Cloud\Tasks\V2beta2\Task * * @throws ApiException if the remote call fails + * * @experimental */ - public function getIamPolicy($resource, array $optionalArgs = []) + public function getTask($name, array $optionalArgs = []) { - $request = new GetIamPolicyRequest(); - $request->setResource($resource); - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); + $request = new GetTaskRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['responseView'])) { + $request->setResponseView($optionalArgs['responseView']); } - $requestParams = new RequestParamsHeaderDescriptor([ - 'resource' => $request->getResource(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'GetIamPolicy', - Policy::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** - * Sets the access control policy for a [Queue][google.cloud.tasks.v2beta2.Queue]. Replaces any existing - * policy. + * Leases tasks from a pull queue for + * [lease_duration][google.cloud.tasks.v2beta2.LeaseTasksRequest.lease_duration]. * - * Note: The Cloud Console does not check queue-level IAM permissions yet. - * Project-level permissions are required to use the Cloud Console. + * 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. * - * Authorization requires the following - * [Google IAM](https://cloud.google.com/iam) permission on the specified - * resource parent: + * 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]. * - * * `cloudtasks.queues.setIamPolicy` + * 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 { - * $resource = ''; - * $policy = new Policy(); - * $response = $cloudTasksClient->setIamPolicy($resource, $policy); + * $formattedParent = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * $leaseDuration = new Duration(); + * $response = $cloudTasksClient->leaseTasks($formattedParent, $leaseDuration); * } 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. + * @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 Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\Cloud\Iam\V1\Policy + * @return \Google\Cloud\Tasks\V2beta2\LeaseTasksResponse * * @throws ApiException if the remote call fails + * * @experimental */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) + public function leaseTasks($parent, $leaseDuration, array $optionalArgs = []) { - $request = new SetIamPolicyRequest(); - $request->setResource($resource); - $request->setPolicy($policy); + $request = new LeaseTasksRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setLeaseDuration($leaseDuration); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['maxTasks'])) { + $request->setMaxTasks($optionalArgs['maxTasks']); + } - $requestParams = new RequestParamsHeaderDescriptor([ - 'resource' => $request->getResource(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'SetIamPolicy', - Policy::class, - $optionalArgs, - $request - )->wait(); + 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(); } /** - * 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. + * Lists queues. * - * 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. + * Queues are returned in lexicographical order. * * Sample code: * ``` * $cloudTasksClient = new CloudTasksClient(); * try { - * $resource = ''; - * $permissions = []; - * $response = $cloudTasksClient->testIamPermissions($resource, $permissions); + * $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 $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. + * @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 Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse + * @return \Google\ApiCore\PagedListResponse * * @throws ApiException if the remote call fails + * * @experimental */ - public function testIamPermissions($resource, $permissions, array $optionalArgs = []) + public function listQueues($parent, array $optionalArgs = []) { - $request = new TestIamPermissionsRequest(); - $request->setResource($resource); - $request->setPermissions($permissions); + $request = new ListQueuesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } - $requestParams = new RequestParamsHeaderDescriptor([ - 'resource' => $request->getResource(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'TestIamPermissions', - TestIamPermissionsResponse::class, - $optionalArgs, - $request - )->wait(); + 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); } /** @@ -1160,10 +1234,7 @@ public function testIamPermissions($resource, $permissions, array $optionalArgs * // doSomethingWith($element); * } * } - * - * * // Alternatively: - * * // Iterate through all elements * $pagedResponse = $cloudTasksClient->listTasks($formattedParent); * foreach ($pagedResponse->iterateAllElements() as $element) { @@ -1177,771 +1248,566 @@ public function testIamPermissions($resource, $permissions, array $optionalArgs * @param string $parent Required. The queue name. For example: * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` * @param array $optionalArgs { - * Optional. + * 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} + * 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. + * 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. + * 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 Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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([ - 'parent' => $request->getParent(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->getPagedListResponse( - 'ListTasks', - $optionalArgs, - ListTasksResponse::class, - $request - ); + $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); } /** - * Gets a task. + * 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->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - * $response = $cloudTasksClient->getTask($formattedName); + * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * $response = $cloudTasksClient->pauseQueue($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 string $name Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` * @param array $optionalArgs { - * Optional. + * 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 Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\Cloud\Tasks\V2beta2\Task + * @return \Google\Cloud\Tasks\V2beta2\Queue * * @throws ApiException if the remote call fails + * * @experimental */ - public function getTask($name, array $optionalArgs = []) + public function pauseQueue($name, array $optionalArgs = []) { - $request = new GetTaskRequest(); + $request = new PauseQueueRequest(); + $requestParamHeaders = []; $request->setName($name); - if (isset($optionalArgs['responseView'])) { - $request->setResponseView($optionalArgs['responseView']); - } - - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'GetTask', - Task::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** - * Creates a task and adds it to a queue. + * Purges a queue by deleting all of its tasks. * - * Tasks cannot be updated after creation; there is no UpdateTask command. + * All tasks created before this method is called are permanently deleted. * - * * 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. + * 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 { - * $formattedParent = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - * $task = new Task(); - * $response = $cloudTasksClient->createTask($formattedParent, $task); + * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * $response = $cloudTasksClient->purgeQueue($formattedName); * } 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 ~1hour 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 ~9days 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. + * @param string $name Required. The queue name. For example: + * `projects/PROJECT_ID/location/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 RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\Cloud\Tasks\V2beta2\Task + * @return \Google\Cloud\Tasks\V2beta2\Queue * * @throws ApiException if the remote call fails + * * @experimental */ - public function createTask($parent, $task, array $optionalArgs = []) + public function purgeQueue($name, array $optionalArgs = []) { - $request = new CreateTaskRequest(); - $request->setParent($parent); - $request->setTask($task); - if (isset($optionalArgs['responseView'])) { - $request->setResponseView($optionalArgs['responseView']); - } - - $requestParams = new RequestParamsHeaderDescriptor([ - 'parent' => $request->getParent(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'CreateTask', - Task::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** - * Deletes a task. + * Renew the current lease of a pull 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. + * 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]'); - * $cloudTasksClient->deleteTask($formattedName); + * $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 array $optionalArgs { - * Optional. + * @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 Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * + * @return \Google\Cloud\Tasks\V2beta2\Task + * * @throws ApiException if the remote call fails + * * @experimental */ - public function deleteTask($name, array $optionalArgs = []) + public function renewLease($name, $scheduleTime, $leaseDuration, array $optionalArgs = []) { - $request = new DeleteTaskRequest(); + $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([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'DeleteTask', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** - * 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. + * Resume a queue. * - * 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]. + * 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]. * - * 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. + * 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 { - * $formattedParent = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - * $leaseDuration = new Duration(); - * $response = $cloudTasksClient->leaseTasks($formattedParent, $leaseDuration); + * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * $response = $cloudTasksClient->resumeQueue($formattedName); * } 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]. - * @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). + * @param string $name Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * @param array $optionalArgs { + * Optional. * - * 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 Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\Cloud\Tasks\V2beta2\LeaseTasksResponse + * @return \Google\Cloud\Tasks\V2beta2\Queue * * @throws ApiException if the remote call fails + * * @experimental */ - public function leaseTasks($parent, $leaseDuration, array $optionalArgs = []) + public function resumeQueue($name, array $optionalArgs = []) { - $request = new LeaseTasksRequest(); - $request->setParent($parent); - $request->setLeaseDuration($leaseDuration); - 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([ - 'parent' => $request->getParent(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'LeaseTasks', - LeaseTasksResponse::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** - * Acknowledges a pull task. + * Forces a task to run now. * - * 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. + * 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]. * - * 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]. + * 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]'); - * $scheduleTime = new Timestamp(); - * $cloudTasksClient->acknowledgeTask($formattedName, $scheduleTime); + * $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 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. + * @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 Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * + * @return \Google\Cloud\Tasks\V2beta2\Task + * * @throws ApiException if the remote call fails + * * @experimental */ - public function acknowledgeTask($name, $scheduleTime, array $optionalArgs = []) + public function runTask($name, array $optionalArgs = []) { - $request = new AcknowledgeTaskRequest(); + $request = new RunTaskRequest(); + $requestParamHeaders = []; $request->setName($name); - $request->setScheduleTime($scheduleTime); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['responseView'])) { + $request->setResponseView($optionalArgs['responseView']); + } - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'AcknowledgeTask', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** - * Renew the current lease of a pull task. + * Sets the access control policy for a [Queue][google.cloud.tasks.v2beta2.Queue]. Replaces any existing + * policy. * - * 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]. + * 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 { - * $formattedName = $cloudTasksClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - * $scheduleTime = new Timestamp(); - * $leaseDuration = new Duration(); - * $response = $cloudTasksClient->renewLease($formattedName, $scheduleTime, $leaseDuration); + * $resource = 'resource'; + * $policy = new Policy(); + * $response = $cloudTasksClient->setIamPolicy($resource, $policy); * } 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. - * @param array $optionalArgs { - * Optional. + * @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 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 Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\Cloud\Tasks\V2beta2\Task + * @return \Google\Cloud\Iam\V1\Policy * * @throws ApiException if the remote call fails + * * @experimental */ - public function renewLease($name, $scheduleTime, $leaseDuration, array $optionalArgs = []) + public function setIamPolicy($resource, $policy, array $optionalArgs = []) { - $request = new RenewLeaseRequest(); - $request->setName($name); - $request->setScheduleTime($scheduleTime); - $request->setLeaseDuration($leaseDuration); - if (isset($optionalArgs['responseView'])) { - $request->setResponseView($optionalArgs['responseView']); - } - - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'RenewLease', - Task::class, - $optionalArgs, - $request - )->wait(); + $request = new SetIamPolicyRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $request->setPolicy($policy); + $requestParamHeaders['resource'] = $resource; + $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(); } /** - * Cancel a pull task's lease. + * 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. * - * 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]. + * 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 { - * $formattedName = $cloudTasksClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - * $scheduleTime = new Timestamp(); - * $response = $cloudTasksClient->cancelLease($formattedName, $scheduleTime); + * $resource = 'resource'; + * $permissions = []; + * $response = $cloudTasksClient->testIamPermissions($resource, $permissions); * } 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. + * @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 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 Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\Cloud\Tasks\V2beta2\Task + * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse * * @throws ApiException if the remote call fails + * * @experimental */ - public function cancelLease($name, $scheduleTime, array $optionalArgs = []) + public function testIamPermissions($resource, $permissions, array $optionalArgs = []) { - $request = new CancelLeaseRequest(); - $request->setName($name); - $request->setScheduleTime($scheduleTime); - if (isset($optionalArgs['responseView'])) { - $request->setResponseView($optionalArgs['responseView']); - } - - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'CancelLease', - Task::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** - * 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. + * Updates a queue. * - * 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]. + * This method creates the queue if it does not exist and updates + * the queue if it does exist. * - * [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. + * 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. * - * [RunTask][google.cloud.tasks.v2beta2.CloudTasks.RunTask] cannot be called on a - * [pull task][google.cloud.tasks.v2beta2.PullMessage]. + * 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->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - * $response = $cloudTasksClient->runTask($formattedName); + * $queue = new Queue(); + * $response = $cloudTasksClient->updateQueue($queue); * } 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. + * @param Queue $queue Required. The queue to create or update. * - * @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} + * 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 Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\Cloud\Tasks\V2beta2\Task + * @return \Google\Cloud\Tasks\V2beta2\Queue * * @throws ApiException if the remote call fails + * * @experimental */ - public function runTask($name, array $optionalArgs = []) + public function updateQueue($queue, array $optionalArgs = []) { - $request = new RunTaskRequest(); - $request->setName($name); - if (isset($optionalArgs['responseView'])) { - $request->setResponseView($optionalArgs['responseView']); + $request = new UpdateQueueRequest(); + $requestParamHeaders = []; + $request->setQueue($queue); + $requestParamHeaders['queue.name'] = $queue->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); } - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'RunTask', - Task::class, - $optionalArgs, - $request - )->wait(); + $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(); } } diff --git a/Tasks/src/V2beta2/GetQueueRequest.php b/Tasks/src/V2beta2/GetQueueRequest.php index 7c0d80019d29..e4dc677a8139 100644 --- a/Tasks/src/V2beta2/GetQueueRequest.php +++ b/Tasks/src/V2beta2/GetQueueRequest.php @@ -92,7 +92,7 @@ public function setName($var) */ public function getReadMask() { - return isset($this->read_mask) ? $this->read_mask : null; + return $this->read_mask; } public function hasReadMask() diff --git a/Tasks/src/V2beta2/LeaseTasksRequest.php b/Tasks/src/V2beta2/LeaseTasksRequest.php index f695cf9e0eac..3db2f182af56 100644 --- a/Tasks/src/V2beta2/LeaseTasksRequest.php +++ b/Tasks/src/V2beta2/LeaseTasksRequest.php @@ -257,7 +257,7 @@ public function setMaxTasks($var) */ public function getLeaseDuration() { - return isset($this->lease_duration) ? $this->lease_duration : null; + return $this->lease_duration; } public function hasLeaseDuration() diff --git a/Tasks/src/V2beta2/ListQueuesRequest.php b/Tasks/src/V2beta2/ListQueuesRequest.php index dbcae7ebae9e..d5d88b1e71b3 100644 --- a/Tasks/src/V2beta2/ListQueuesRequest.php +++ b/Tasks/src/V2beta2/ListQueuesRequest.php @@ -270,7 +270,7 @@ public function setPageToken($var) */ public function getReadMask() { - return isset($this->read_mask) ? $this->read_mask : null; + return $this->read_mask; } public function hasReadMask() diff --git a/Tasks/src/V2beta2/Queue.php b/Tasks/src/V2beta2/Queue.php index 7b1e8792f237..6e35efe3e5d9 100644 --- a/Tasks/src/V2beta2/Queue.php +++ b/Tasks/src/V2beta2/Queue.php @@ -72,7 +72,7 @@ class Queue extends \Google\Protobuf\Internal\Message private $retry_config = null; /** * Output only. The state of the queue. - * `state` can only be changed by called + * `state` can only be changed by calling * [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). @@ -187,7 +187,7 @@ class Queue extends \Google\Protobuf\Internal\Message * 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 + * `state` can only be changed by calling * [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). @@ -374,7 +374,7 @@ public function setPullTarget($var) */ public function getRateLimits() { - return isset($this->rate_limits) ? $this->rate_limits : null; + return $this->rate_limits; } public function hasRateLimits() @@ -430,7 +430,7 @@ public function setRateLimits($var) */ public function getRetryConfig() { - return isset($this->retry_config) ? $this->retry_config : null; + return $this->retry_config; } public function hasRetryConfig() @@ -468,7 +468,7 @@ public function setRetryConfig($var) /** * Output only. The state of the queue. - * `state` can only be changed by called + * `state` can only be changed by calling * [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). @@ -484,7 +484,7 @@ public function getState() /** * Output only. The state of the queue. - * `state` can only be changed by called + * `state` can only be changed by calling * [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). @@ -517,7 +517,7 @@ public function setState($var) */ public function getPurgeTime() { - return isset($this->purge_time) ? $this->purge_time : null; + return $this->purge_time; } public function hasPurgeTime() @@ -569,7 +569,7 @@ public function setPurgeTime($var) */ public function getTaskTtl() { - return isset($this->task_ttl) ? $this->task_ttl : null; + return $this->task_ttl; } public function hasTaskTtl() @@ -621,7 +621,7 @@ public function setTaskTtl($var) */ public function getTombstoneTtl() { - return isset($this->tombstone_ttl) ? $this->tombstone_ttl : null; + return $this->tombstone_ttl; } public function hasTombstoneTtl() @@ -666,7 +666,7 @@ public function setTombstoneTtl($var) */ public function getStats() { - return isset($this->stats) ? $this->stats : null; + return $this->stats; } public function hasStats() diff --git a/Tasks/src/V2beta2/QueueStats.php b/Tasks/src/V2beta2/QueueStats.php index fef4024c452e..1f240180f60a 100644 --- a/Tasks/src/V2beta2/QueueStats.php +++ b/Tasks/src/V2beta2/QueueStats.php @@ -130,7 +130,7 @@ public function setTasksCount($var) */ public function getOldestEstimatedArrivalTime() { - return isset($this->oldest_estimated_arrival_time) ? $this->oldest_estimated_arrival_time : null; + return $this->oldest_estimated_arrival_time; } public function hasOldestEstimatedArrivalTime() diff --git a/Tasks/src/V2beta2/RenewLeaseRequest.php b/Tasks/src/V2beta2/RenewLeaseRequest.php index e9c04cd16b79..42cb7dd6e248 100644 --- a/Tasks/src/V2beta2/RenewLeaseRequest.php +++ b/Tasks/src/V2beta2/RenewLeaseRequest.php @@ -134,7 +134,7 @@ public function setName($var) */ public function getScheduleTime() { - return isset($this->schedule_time) ? $this->schedule_time : null; + return $this->schedule_time; } public function hasScheduleTime() @@ -176,7 +176,7 @@ public function setScheduleTime($var) */ public function getLeaseDuration() { - return isset($this->lease_duration) ? $this->lease_duration : null; + return $this->lease_duration; } public function hasLeaseDuration() diff --git a/Tasks/src/V2beta2/RetryConfig.php b/Tasks/src/V2beta2/RetryConfig.php index 2b27bdc4d086..1edf24a4da3c 100644 --- a/Tasks/src/V2beta2/RetryConfig.php +++ b/Tasks/src/V2beta2/RetryConfig.php @@ -271,7 +271,7 @@ public function setUnlimitedAttempts($var) */ public function getMaxRetryDuration() { - return isset($this->max_retry_duration) ? $this->max_retry_duration : null; + return $this->max_retry_duration; } public function hasMaxRetryDuration() @@ -331,7 +331,7 @@ public function setMaxRetryDuration($var) */ public function getMinBackoff() { - return isset($this->min_backoff) ? $this->min_backoff : null; + return $this->min_backoff; } public function hasMinBackoff() @@ -389,7 +389,7 @@ public function setMinBackoff($var) */ public function getMaxBackoff() { - return isset($this->max_backoff) ? $this->max_backoff : null; + return $this->max_backoff; } public function hasMaxBackoff() diff --git a/Tasks/src/V2beta2/Task.php b/Tasks/src/V2beta2/Task.php index 7a2655e503c6..6768a79ca20a 100644 --- a/Tasks/src/V2beta2/Task.php +++ b/Tasks/src/V2beta2/Task.php @@ -274,7 +274,7 @@ public function setPullMessage($var) */ public function getScheduleTime() { - return isset($this->schedule_time) ? $this->schedule_time : null; + return $this->schedule_time; } public function hasScheduleTime() @@ -317,7 +317,7 @@ public function setScheduleTime($var) */ public function getCreateTime() { - return isset($this->create_time) ? $this->create_time : null; + return $this->create_time; } public function hasCreateTime() @@ -354,7 +354,7 @@ public function setCreateTime($var) */ public function getStatus() { - return isset($this->status) ? $this->status : null; + return $this->status; } public function hasStatus() diff --git a/Tasks/src/V2beta2/TaskStatus.php b/Tasks/src/V2beta2/TaskStatus.php index 136c27d631fa..92d26851eb74 100644 --- a/Tasks/src/V2beta2/TaskStatus.php +++ b/Tasks/src/V2beta2/TaskStatus.php @@ -144,7 +144,7 @@ public function setAttemptResponseCount($var) */ public function getFirstAttemptStatus() { - return isset($this->first_attempt_status) ? $this->first_attempt_status : null; + return $this->first_attempt_status; } public function hasFirstAttemptStatus() @@ -184,7 +184,7 @@ public function setFirstAttemptStatus($var) */ public function getLastAttemptStatus() { - return isset($this->last_attempt_status) ? $this->last_attempt_status : null; + return $this->last_attempt_status; } public function hasLastAttemptStatus() diff --git a/Tasks/src/V2beta2/UpdateQueueRequest.php b/Tasks/src/V2beta2/UpdateQueueRequest.php index c8e9510366f3..d1604fd36dfa 100644 --- a/Tasks/src/V2beta2/UpdateQueueRequest.php +++ b/Tasks/src/V2beta2/UpdateQueueRequest.php @@ -67,7 +67,7 @@ public function __construct($data = NULL) { */ public function getQueue() { - return isset($this->queue) ? $this->queue : null; + return $this->queue; } public function hasQueue() @@ -108,7 +108,7 @@ public function setQueue($var) */ public function getUpdateMask() { - return isset($this->update_mask) ? $this->update_mask : null; + return $this->update_mask; } public function hasUpdateMask() diff --git a/owl-bot-staging/Tasks/v2beta2/src/V2beta2/gapic_metadata.json b/Tasks/src/V2beta2/gapic_metadata.json similarity index 100% rename from owl-bot-staging/Tasks/v2beta2/src/V2beta2/gapic_metadata.json rename to Tasks/src/V2beta2/gapic_metadata.json diff --git a/Tasks/src/V2beta2/resources/cloud_tasks_client_config.json b/Tasks/src/V2beta2/resources/cloud_tasks_client_config.json index 755c0e81639f..ea9b38e559d2 100644 --- a/Tasks/src/V2beta2/resources/cloud_tasks_client_config.json +++ b/Tasks/src/V2beta2/resources/cloud_tasks_client_config.json @@ -1,145 +1,145 @@ { - "interfaces": { - "google.cloud.tasks.v2beta2.CloudTasks": { - "retry_codes": { - "retry_policy_1_codes": [ - "UNAVAILABLE", - "DEADLINE_EXCEEDED" - ], - "no_retry_codes": [], - "no_retry_1_codes": [] - }, - "retry_params": { - "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_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 + "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" + } + } } - }, - "methods": { - "ListQueues": { - "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" - }, - "CreateQueue": { - "timeout_millis": 20000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UpdateQueue": { - "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" - }, - "PurgeQueue": { - "timeout_millis": 20000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "PauseQueue": { - "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" - }, - "GetIamPolicy": { - "timeout_millis": 20000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_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" - }, - "ListTasks": { - "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" - }, - "CreateTask": { - "timeout_millis": 20000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteTask": { - "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" - }, - "AcknowledgeTask": { - "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" - }, - "CancelLease": { - "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" - } - } } - } } 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 4ebf3cbc4840..795331d094d2 100644 --- a/Tasks/src/V2beta2/resources/cloud_tasks_rest_client_config.php +++ b/Tasks/src/V2beta2/resources/cloud_tasks_rest_client_config.php @@ -3,20 +3,22 @@ return [ 'interfaces' => [ 'google.cloud.tasks.v2beta2.CloudTasks' => [ - 'ListQueues' => [ - 'method' => 'get', - 'uriTemplate' => '/v2beta2/{parent=projects/*/locations/*}/queues', + 'AcknowledgeTask' => [ + 'method' => 'post', + 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:acknowledge', + 'body' => '*', 'placeholders' => [ - 'parent' => [ + 'name' => [ 'getters' => [ - 'getParent', + 'getName', ], ], ], ], - 'GetQueue' => [ - 'method' => 'get', - 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*/queues/*}', + 'CancelLease' => [ + 'method' => 'post', + 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:cancelLease', + 'body' => '*', 'placeholders' => [ 'name' => [ 'getters' => [ @@ -37,15 +39,14 @@ ], ], ], - 'UpdateQueue' => [ - 'method' => 'patch', - 'uriTemplate' => '/v2beta2/{queue.name=projects/*/locations/*/queues/*}', - 'body' => 'queue', + 'CreateTask' => [ + 'method' => 'post', + 'uriTemplate' => '/v2beta2/{parent=projects/*/locations/*/queues/*}/tasks', + 'body' => '*', 'placeholders' => [ - 'queue.name' => [ + 'parent' => [ 'getters' => [ - 'getQueue', - 'getName', + 'getParent', ], ], ], @@ -61,10 +62,9 @@ ], ], ], - 'PurgeQueue' => [ - 'method' => 'post', - 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*/queues/*}:purge', - 'body' => '*', + 'DeleteTask' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}', 'placeholders' => [ 'name' => [ 'getters' => [ @@ -73,22 +73,21 @@ ], ], ], - 'PauseQueue' => [ + 'GetIamPolicy' => [ 'method' => 'post', - 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*/queues/*}:pause', + 'uriTemplate' => '/v2beta2/{resource=projects/*/locations/*/queues/*}:getIamPolicy', 'body' => '*', 'placeholders' => [ - 'name' => [ + 'resource' => [ 'getters' => [ - 'getName', + 'getResource', ], ], ], ], - 'ResumeQueue' => [ - 'method' => 'post', - 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*/queues/*}:resume', - 'body' => '*', + 'GetQueue' => [ + 'method' => 'get', + 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*/queues/*}', 'placeholders' => [ 'name' => [ 'getters' => [ @@ -97,38 +96,36 @@ ], ], ], - 'GetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v2beta2/{resource=projects/*/locations/*/queues/*}:getIamPolicy', - 'body' => '*', + 'GetTask' => [ + 'method' => 'get', + 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}', 'placeholders' => [ - 'resource' => [ + 'name' => [ 'getters' => [ - 'getResource', + 'getName', ], ], ], ], - 'SetIamPolicy' => [ + 'LeaseTasks' => [ 'method' => 'post', - 'uriTemplate' => '/v2beta2/{resource=projects/*/locations/*/queues/*}:setIamPolicy', + 'uriTemplate' => '/v2beta2/{parent=projects/*/locations/*/queues/*}/tasks:lease', 'body' => '*', 'placeholders' => [ - 'resource' => [ + 'parent' => [ 'getters' => [ - 'getResource', + 'getParent', ], ], ], ], - 'TestIamPermissions' => [ - 'method' => 'post', - 'uriTemplate' => '/v2beta2/{resource=projects/*/locations/*/queues/*}:testIamPermissions', - 'body' => '*', + 'ListQueues' => [ + 'method' => 'get', + 'uriTemplate' => '/v2beta2/{parent=projects/*/locations/*}/queues', 'placeholders' => [ - 'resource' => [ + 'parent' => [ 'getters' => [ - 'getResource', + 'getParent', ], ], ], @@ -144,9 +141,10 @@ ], ], ], - 'GetTask' => [ - 'method' => 'get', - 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}', + 'PauseQueue' => [ + 'method' => 'post', + 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*/queues/*}:pause', + 'body' => '*', 'placeholders' => [ 'name' => [ 'getters' => [ @@ -155,21 +153,22 @@ ], ], ], - 'CreateTask' => [ + 'PurgeQueue' => [ 'method' => 'post', - 'uriTemplate' => '/v2beta2/{parent=projects/*/locations/*/queues/*}/tasks', + 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*/queues/*}:purge', 'body' => '*', 'placeholders' => [ - 'parent' => [ + 'name' => [ 'getters' => [ - 'getParent', + 'getName', ], ], ], ], - 'DeleteTask' => [ - 'method' => 'delete', - 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}', + 'RenewLease' => [ + 'method' => 'post', + 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:renewLease', + 'body' => '*', 'placeholders' => [ 'name' => [ 'getters' => [ @@ -178,21 +177,21 @@ ], ], ], - 'LeaseTasks' => [ + 'ResumeQueue' => [ 'method' => 'post', - 'uriTemplate' => '/v2beta2/{parent=projects/*/locations/*/queues/*}/tasks:lease', + 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*/queues/*}:resume', 'body' => '*', 'placeholders' => [ - 'parent' => [ + 'name' => [ 'getters' => [ - 'getParent', + 'getName', ], ], ], ], - 'AcknowledgeTask' => [ + 'RunTask' => [ 'method' => 'post', - 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:acknowledge', + 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:run', 'body' => '*', 'placeholders' => [ 'name' => [ @@ -202,37 +201,38 @@ ], ], ], - 'RenewLease' => [ + 'SetIamPolicy' => [ 'method' => 'post', - 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:renewLease', + 'uriTemplate' => '/v2beta2/{resource=projects/*/locations/*/queues/*}:setIamPolicy', 'body' => '*', 'placeholders' => [ - 'name' => [ + 'resource' => [ 'getters' => [ - 'getName', + 'getResource', ], ], ], ], - 'CancelLease' => [ + 'TestIamPermissions' => [ 'method' => 'post', - 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:cancelLease', + 'uriTemplate' => '/v2beta2/{resource=projects/*/locations/*/queues/*}:testIamPermissions', 'body' => '*', 'placeholders' => [ - 'name' => [ + 'resource' => [ 'getters' => [ - 'getName', + 'getResource', ], ], ], ], - 'RunTask' => [ - 'method' => 'post', - 'uriTemplate' => '/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:run', - 'body' => '*', + 'UpdateQueue' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2beta2/{queue.name=projects/*/locations/*/queues/*}', + 'body' => 'queue', 'placeholders' => [ - 'name' => [ + 'queue.name' => [ 'getters' => [ + 'getQueue', 'getName', ], ], diff --git a/Tasks/src/V2beta3/AppEngineHttpQueue.php b/Tasks/src/V2beta3/AppEngineHttpQueue.php index 8ef0f1e2b527..f3bb59e6f4da 100644 --- a/Tasks/src/V2beta3/AppEngineHttpQueue.php +++ b/Tasks/src/V2beta3/AppEngineHttpQueue.php @@ -66,7 +66,7 @@ public function __construct($data = NULL) { */ public function getAppEngineRoutingOverride() { - return isset($this->app_engine_routing_override) ? $this->app_engine_routing_override : null; + return $this->app_engine_routing_override; } public function hasAppEngineRoutingOverride() diff --git a/Tasks/src/V2beta3/AppEngineHttpRequest.php b/Tasks/src/V2beta3/AppEngineHttpRequest.php index 04304336d0d6..c857f4347d99 100644 --- a/Tasks/src/V2beta3/AppEngineHttpRequest.php +++ b/Tasks/src/V2beta3/AppEngineHttpRequest.php @@ -264,7 +264,7 @@ public function setHttpMethod($var) */ public function getAppEngineRouting() { - return isset($this->app_engine_routing) ? $this->app_engine_routing : null; + return $this->app_engine_routing; } public function hasAppEngineRouting() diff --git a/Tasks/src/V2beta3/Attempt.php b/Tasks/src/V2beta3/Attempt.php index 06dce1f8e592..4fa901f83df8 100644 --- a/Tasks/src/V2beta3/Attempt.php +++ b/Tasks/src/V2beta3/Attempt.php @@ -80,7 +80,7 @@ public function __construct($data = NULL) { */ public function getScheduleTime() { - return isset($this->schedule_time) ? $this->schedule_time : null; + return $this->schedule_time; } public function hasScheduleTime() @@ -118,7 +118,7 @@ public function setScheduleTime($var) */ public function getDispatchTime() { - return isset($this->dispatch_time) ? $this->dispatch_time : null; + return $this->dispatch_time; } public function hasDispatchTime() @@ -156,7 +156,7 @@ public function setDispatchTime($var) */ public function getResponseTime() { - return isset($this->response_time) ? $this->response_time : null; + return $this->response_time; } public function hasResponseTime() @@ -195,7 +195,7 @@ public function setResponseTime($var) */ public function getResponseStatus() { - return isset($this->response_status) ? $this->response_status : null; + return $this->response_status; } public function hasResponseStatus() diff --git a/Tasks/src/V2beta3/CloudTasksClient.php b/Tasks/src/V2beta3/CloudTasksClient.php index fb71d40ea5d5..19f8ce333fcd 100644 --- a/Tasks/src/V2beta3/CloudTasksClient.php +++ b/Tasks/src/V2beta3/CloudTasksClient.php @@ -17,9 +17,9 @@ /* * GENERATED CODE WARNING - * This file was generated from the file - * https://github.com/google/googleapis/blob/master/google/cloud/tasks/v2beta3/cloudtasks.proto - * and updates to that file get reflected here through a refresh process. + * Generated by gapic-generator-php from the file + * https://github.com/googleapis/googleapis/blob/master/google/cloud/tasks/v2beta3/cloudtasks.proto + * Updates to the above are reflected here through a refresh process. * * @experimental */ @@ -28,11 +28,9 @@ use Google\Cloud\Tasks\V2beta3\Gapic\CloudTasksGapicClient; -/** - * {@inheritdoc} - */ +/** {@inheritdoc} */ class CloudTasksClient extends CloudTasksGapicClient { - // This class is intentionally empty, and is intended to hold manual - // additions to the generated {@see CloudTasksGapicClient} class. + // This class is intentionally empty, and is intended to hold manual additions to + // the generated {@see CloudTasksGapicClient} class. } diff --git a/Tasks/src/V2beta3/CreateQueueRequest.php b/Tasks/src/V2beta3/CreateQueueRequest.php index b265b9fb6e73..50d220c64fb2 100644 --- a/Tasks/src/V2beta3/CreateQueueRequest.php +++ b/Tasks/src/V2beta3/CreateQueueRequest.php @@ -98,7 +98,7 @@ public function setParent($var) */ public function getQueue() { - return isset($this->queue) ? $this->queue : null; + return $this->queue; } public function hasQueue() diff --git a/Tasks/src/V2beta3/CreateTaskRequest.php b/Tasks/src/V2beta3/CreateTaskRequest.php index e479ed34662a..1d9e74da6416 100644 --- a/Tasks/src/V2beta3/CreateTaskRequest.php +++ b/Tasks/src/V2beta3/CreateTaskRequest.php @@ -194,7 +194,7 @@ public function setParent($var) */ public function getTask() { - return isset($this->task) ? $this->task : null; + return $this->task; } public function hasTask() diff --git a/Tasks/src/V2beta3/Gapic/CloudTasksGapicClient.php b/Tasks/src/V2beta3/Gapic/CloudTasksGapicClient.php index fdf6a894d017..e1214eb0e8c8 100644 --- a/Tasks/src/V2beta3/Gapic/CloudTasksGapicClient.php +++ b/Tasks/src/V2beta3/Gapic/CloudTasksGapicClient.php @@ -17,9 +17,9 @@ /* * GENERATED CODE WARNING - * This file was generated from the file - * https://github.com/google/googleapis/blob/master/google/cloud/tasks/v2beta3/cloudtasks.proto - * and updates to that file get reflected here through a refresh process. + * Generated by gapic-generator-php from the file + * https://github.com/googleapis/googleapis/blob/master/google/cloud/tasks/v2beta3/cloudtasks.proto + * Updates to the above are reflected here through a refresh process. * * @experimental */ @@ -29,6 +29,7 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; + use Google\ApiCore\PathTemplate; use Google\ApiCore\RequestParamsHeaderDescriptor; use Google\ApiCore\RetrySettings; @@ -73,31 +74,17 @@ * $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); - * } + * $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. + * 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 */ @@ -131,26 +118,29 @@ class CloudTasksGapicClient public static $serviceScopes = [ 'https://www.googleapis.com/auth/cloud-platform', ]; + private static $locationNameTemplate; - private static $projectNameTemplate; + 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', + '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', + 'restClientConfigPath' => __DIR__ . '/../resources/cloud_tasks_rest_client_config.php', ], ], ]; @@ -158,7 +148,7 @@ private static function getClientDefaults() private static function getLocationNameTemplate() { - if (null == self::$locationNameTemplate) { + if (self::$locationNameTemplate == null) { self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); } @@ -176,7 +166,7 @@ private static function getProjectNameTemplate() private static function getQueueNameTemplate() { - if (null == self::$queueNameTemplate) { + if (self::$queueNameTemplate == null) { self::$queueNameTemplate = new PathTemplate('projects/{project}/locations/{location}/queues/{queue}'); } @@ -185,7 +175,7 @@ private static function getQueueNameTemplate() private static function getTaskNameTemplate() { - if (null == self::$taskNameTemplate) { + if (self::$taskNameTemplate == null) { self::$taskNameTemplate = new PathTemplate('projects/{project}/locations/{location}/queues/{queue}/tasks/{task}'); } @@ -194,7 +184,7 @@ private static function getTaskNameTemplate() private static function getPathTemplateMap() { - if (null == self::$pathTemplateMap) { + if (self::$pathTemplateMap == null) { self::$pathTemplateMap = [ 'location' => self::getLocationNameTemplate(), 'project' => self::getProjectNameTemplate(), @@ -207,13 +197,14 @@ private static function getPathTemplateMap() } /** - * Formats a string containing the fully-qualified path to represent - * a location resource. + * 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) @@ -225,14 +216,15 @@ public static function locationName($project, $location) } /** - * Formats a string containing the fully-qualified path to represent - * a queue resource. + * 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) @@ -245,8 +237,8 @@ public static function queueName($project, $location, $queue) } /** - * Formats a string containing the fully-qualified path to represent - * a task resource. + * Formats a string containing the fully-qualified path to represent a task + * resource. * * @param string $project * @param string $location @@ -254,6 +246,7 @@ public static function queueName($project, $location, $queue) * @param string $task * * @return string The formatted task resource. + * * @experimental */ public static function taskName($project, $location, $queue, $task) @@ -287,12 +280,13 @@ public static function projectName($project) * Template: Pattern * - location: projects/{project}/locations/{location} * - queue: projects/{project}/locations/{location}/queues/{queue} - * - task: projects/{project}/locations/{location}/queues/{queue}/tasks/{task}. + * - 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. + * 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 @@ -300,12 +294,12 @@ public static function projectName($project) * @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"); @@ -321,6 +315,7 @@ public static function parseName($formattedName, $template = null) // Swallow the exception to continue trying other path templates } } + throw new ValidationException("Input did not match any known format. Input: $formattedName"); } @@ -328,7 +323,7 @@ public static function parseName($formattedName, $template = null) * Constructor. * * @param array $options { - * Optional. Options for configuring the service API wrapper. + * Optional. Options for configuring the service API wrapper. * * @type string $serviceAddress * **Deprecated**. This option will be removed in a future major release. Please @@ -345,38 +340,42 @@ public static function parseName($formattedName, $template = null) * {@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()}. + * 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. + * 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. + * 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 + * $serviceAddress 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' => [...] + * '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 = []) @@ -385,171 +384,6 @@ public function __construct(array $options = []) $this->setClientOptions($clientOptions); } - /** - * 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 Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\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(); - $request->setParent($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([ - 'parent' => $request->getParent(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->getPagedListResponse( - 'ListQueues', - $optionalArgs, - ListQueuesResponse::class, - $request - ); - } - - /** - * 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 Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\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(); - $request->setName($name); - if (isset($optionalArgs['readMask'])) { - $request->setReadMask($optionalArgs['readMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'GetQueue', - Queue::class, - $optionalArgs, - $request - )->wait(); - } - /** * Creates a queue. * @@ -576,126 +410,143 @@ public function getQueue($name, array $optionalArgs = []) * } * ``` * - * @param string $parent Required. The location name in which the queue will be created. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * @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. + * 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. + * [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 Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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); - - $requestParams = new RequestParamsHeaderDescriptor([ - 'parent' => $request->getParent(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'CreateQueue', - Queue::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** - * Updates a queue. - * - * This method creates the queue if it does not exist and updates - * the queue if it does exist. + * Creates a task and adds it to 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. + * Tasks cannot be updated after creation; there is no UpdateTask command. * - * 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 maximum task size is 100KB. * * Sample code: * ``` * $cloudTasksClient = new CloudTasksClient(); * try { - * $queue = new Queue(); - * $response = $cloudTasksClient->updateQueue($queue); + * $formattedParent = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * $task = new Task(); + * $response = $cloudTasksClient->createTask($formattedParent, $task); * } 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. + * @param string $parent Required. The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` * - * @type FieldMask $updateMask - * A mask used to specify which fields of the queue are being updated. + * 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 ~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.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. * - * If empty, then all fields will be updated. + * @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 Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\Cloud\Tasks\V2beta3\Queue + * @return \Google\Cloud\Tasks\V2beta3\Task * * @throws ApiException if the remote call fails + * * @experimental */ - public function updateQueue($queue, array $optionalArgs = []) + public function createTask($parent, $task, array $optionalArgs = []) { - $request = new UpdateQueueRequest(); - $request->setQueue($queue); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); + $request = new CreateTaskRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setTask($task); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['responseView'])) { + $request->setResponseView($optionalArgs['responseView']); } - $requestParams = new RequestParamsHeaderDescriptor([ - 'queue.name' => $request->getQueue()->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'UpdateQueue', - Queue::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** @@ -727,407 +578,343 @@ public function updateQueue($queue, array $optionalArgs = []) * @param string $name Required. The queue name. For example: * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` * @param array $optionalArgs { - * Optional. + * Optional. * * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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); - - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'DeleteQueue', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** - * Purges a queue by deleting all of its tasks. - * - * All tasks created before this method is called are permanently deleted. + * Deletes a task. * - * Purge operations can take up to one minute to take effect. Tasks - * might be dispatched before the purge takes effect. A purge is irreversible. + * 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->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - * $response = $cloudTasksClient->purgeQueue($formattedName); + * $formattedName = $cloudTasksClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + * $cloudTasksClient->deleteTask($formattedName); * } finally { * $cloudTasksClient->close(); * } * ``` * - * @param string $name Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * @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. + * Optional. * * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\Cloud\Tasks\V2beta3\Queue - * * @throws ApiException if the remote call fails + * * @experimental */ - public function purgeQueue($name, array $optionalArgs = []) + public function deleteTask($name, array $optionalArgs = []) { - $request = new PurgeQueueRequest(); + $request = new DeleteTaskRequest(); + $requestParamHeaders = []; $request->setName($name); - - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'PurgeQueue', - Queue::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** - * Pauses the queue. + * 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. * - * 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]. + * 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 { - * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - * $response = $cloudTasksClient->pauseQueue($formattedName); + * $resource = 'resource'; + * $response = $cloudTasksClient->getIamPolicy($resource); * } finally { * $cloudTasksClient->close(); * } * ``` * - * @param string $name Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * @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. + * Optional. * + * @type GetPolicyOptions $options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\Cloud\Tasks\V2beta3\Queue + * @return \Google\Cloud\Iam\V1\Policy * * @throws ApiException if the remote call fails + * * @experimental */ - public function pauseQueue($name, array $optionalArgs = []) + public function getIamPolicy($resource, array $optionalArgs = []) { - $request = new PauseQueueRequest(); - $request->setName($name); - - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); + $request = new GetIamPolicyRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['options'])) { + $request->setOptions($optionalArgs['options']); + } - return $this->startCall( - 'PauseQueue', - Queue::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** - * 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). + * Gets a queue. * * Sample code: * ``` * $cloudTasksClient = new CloudTasksClient(); * try { * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - * $response = $cloudTasksClient->resumeQueue($formattedName); + * $response = $cloudTasksClient->getQueue($formattedName); * } finally { * $cloudTasksClient->close(); * } * ``` * - * @param string $name Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * @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. + * 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 Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * * @return \Google\Cloud\Tasks\V2beta3\Queue * * @throws ApiException if the remote call fails + * * @experimental */ - public function resumeQueue($name, array $optionalArgs = []) + public function getQueue($name, array $optionalArgs = []) { - $request = new ResumeQueueRequest(); + $request = new GetQueueRequest(); + $requestParamHeaders = []; $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['readMask'])) { + $request->setReadMask($optionalArgs['readMask']); + } - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'ResumeQueue', - Queue::class, - $optionalArgs, - $request - )->wait(); + $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 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` + * Gets a task. * * Sample code: * ``` * $cloudTasksClient = new CloudTasksClient(); * try { - * $resource = ''; - * $response = $cloudTasksClient->getIamPolicy($resource); + * $formattedName = $cloudTasksClient->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + * $response = $cloudTasksClient->getTask($formattedName); * } 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 string $name Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` * @param array $optionalArgs { - * Optional. + * Optional. * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. + * @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 Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\Cloud\Iam\V1\Policy + * @return \Google\Cloud\Tasks\V2beta3\Task * * @throws ApiException if the remote call fails + * * @experimental */ - public function getIamPolicy($resource, array $optionalArgs = []) + public function getTask($name, array $optionalArgs = []) { - $request = new GetIamPolicyRequest(); - $request->setResource($resource); - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); + $request = new GetTaskRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['responseView'])) { + $request->setResponseView($optionalArgs['responseView']); } - $requestParams = new RequestParamsHeaderDescriptor([ - 'resource' => $request->getResource(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'GetIamPolicy', - Policy::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** - * 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: + * Lists queues. * - * * `cloudtasks.queues.setIamPolicy` + * Queues are returned in lexicographical order. * * Sample code: * ``` * $cloudTasksClient = new CloudTasksClient(); * try { - * $resource = ''; - * $policy = new Policy(); - * $response = $cloudTasksClient->setIamPolicy($resource, $policy); + * $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 $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 string $parent Required. The location name. + * For example: `projects/PROJECT_ID/locations/LOCATION_ID` * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\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(); - $request->setResource($resource); - $request->setPolicy($policy); - - $requestParams = new RequestParamsHeaderDescriptor([ - 'resource' => $request->getResource(), - ]); - $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. + * Optional. * - * Sample code: - * ``` - * $cloudTasksClient = new CloudTasksClient(); - * try { - * $resource = ''; - * $permissions = []; - * $response = $cloudTasksClient->testIamPermissions($resource, $permissions); - * } finally { - * $cloudTasksClient->close(); - * } - * ``` + * @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). * - * @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. + * 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 Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse + * @return \Google\ApiCore\PagedListResponse * * @throws ApiException if the remote call fails + * * @experimental */ - public function testIamPermissions($resource, $permissions, array $optionalArgs = []) + public function listQueues($parent, array $optionalArgs = []) { - $request = new TestIamPermissionsRequest(); - $request->setResource($resource); - $request->setPermissions($permissions); + $request = new ListQueuesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } - $requestParams = new RequestParamsHeaderDescriptor([ - 'resource' => $request->getResource(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } - return $this->startCall( - 'TestIamPermissions', - TestIamPermissionsResponse::class, - $optionalArgs, - $request - )->wait(); + 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); } /** @@ -1153,10 +940,7 @@ public function testIamPermissions($resource, $permissions, array $optionalArgs * // doSomethingWith($element); * } * } - * - * * // Alternatively: - * * // Iterate through all elements * $pagedResponse = $cloudTasksClient->listTasks($formattedParent); * foreach ($pagedResponse->iterateAllElements() as $element) { @@ -1170,300 +954,217 @@ public function testIamPermissions($resource, $permissions, array $optionalArgs * @param string $parent Required. The queue name. For example: * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` * @param array $optionalArgs { - * Optional. + * 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} + * 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. + * 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. + * 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 Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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([ - 'parent' => $request->getParent(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->getPagedListResponse( - 'ListTasks', - $optionalArgs, - ListTasksResponse::class, - $request - ); + $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); } /** - * Gets a task. + * 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->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - * $response = $cloudTasksClient->getTask($formattedName); + * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * $response = $cloudTasksClient->pauseQueue($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 string $name Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` * @param array $optionalArgs { - * Optional. + * 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 Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\Cloud\Tasks\V2beta3\Task + * @return \Google\Cloud\Tasks\V2beta3\Queue * * @throws ApiException if the remote call fails + * * @experimental */ - public function getTask($name, array $optionalArgs = []) + public function pauseQueue($name, array $optionalArgs = []) { - $request = new GetTaskRequest(); + $request = new PauseQueueRequest(); + $requestParamHeaders = []; $request->setName($name); - if (isset($optionalArgs['responseView'])) { - $request->setResponseView($optionalArgs['responseView']); - } - - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'GetTask', - Task::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** - * Creates a task and adds it to a queue. + * Purges a queue by deleting all of its tasks. * - * Tasks cannot be updated after creation; there is no UpdateTask command. + * All tasks created before this method is called are permanently deleted. * - * * The maximum task size is 100KB. + * 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 { - * $formattedParent = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - * $task = new Task(); - * $response = $cloudTasksClient->createTask($formattedParent, $task); + * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * $response = $cloudTasksClient->purgeQueue($formattedName); * } 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 ~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.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. + * @param string $name Required. The queue name. For example: + * `projects/PROJECT_ID/location/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 RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\Cloud\Tasks\V2beta3\Task + * @return \Google\Cloud\Tasks\V2beta3\Queue * * @throws ApiException if the remote call fails + * * @experimental */ - public function createTask($parent, $task, array $optionalArgs = []) + public function purgeQueue($name, array $optionalArgs = []) { - $request = new CreateTaskRequest(); - $request->setParent($parent); - $request->setTask($task); - if (isset($optionalArgs['responseView'])) { - $request->setResponseView($optionalArgs['responseView']); - } - - $requestParams = new RequestParamsHeaderDescriptor([ - 'parent' => $request->getParent(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'CreateTask', - Task::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** - * Deletes a task. + * Resume a queue. * - * A task can be deleted if it is scheduled or dispatched. A task - * cannot be deleted if it has executed successfully or permanently - * failed. + * 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->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - * $cloudTasksClient->deleteTask($formattedName); + * $formattedName = $cloudTasksClient->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * $response = $cloudTasksClient->resumeQueue($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 string $name Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` * @param array $optionalArgs { - * Optional. + * Optional. * * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * + * @return \Google\Cloud\Tasks\V2beta3\Queue + * * @throws ApiException if the remote call fails + * * @experimental */ - public function deleteTask($name, array $optionalArgs = []) + public function resumeQueue($name, array $optionalArgs = []) { - $request = new DeleteTaskRequest(); + $request = new ResumeQueueRequest(); + $requestParamHeaders = []; $request->setName($name); - - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'DeleteTask', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** @@ -1506,54 +1207,231 @@ public function deleteTask($name, array $optionalArgs = []) * @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. + * 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} + * 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 Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); + $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 RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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; + $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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\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']); + } - return $this->startCall( - 'RunTask', - Task::class, - $optionalArgs, - $request - )->wait(); + $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(); } } diff --git a/Tasks/src/V2beta3/GetQueueRequest.php b/Tasks/src/V2beta3/GetQueueRequest.php index 1b583b1c0111..90b5ba3c75a3 100644 --- a/Tasks/src/V2beta3/GetQueueRequest.php +++ b/Tasks/src/V2beta3/GetQueueRequest.php @@ -92,7 +92,7 @@ public function setName($var) */ public function getReadMask() { - return isset($this->read_mask) ? $this->read_mask : null; + return $this->read_mask; } public function hasReadMask() diff --git a/Tasks/src/V2beta3/HttpRequest.php b/Tasks/src/V2beta3/HttpRequest.php index 7ef2bf537132..068f45de5ef4 100644 --- a/Tasks/src/V2beta3/HttpRequest.php +++ b/Tasks/src/V2beta3/HttpRequest.php @@ -66,8 +66,8 @@ class HttpRequest extends \Google\Protobuf\Internal\Message * [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. + * * `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]. @@ -119,8 +119,8 @@ class HttpRequest extends \Google\Protobuf\Internal\Message * [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. + * * `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]. @@ -232,8 +232,8 @@ public function setHttpMethod($var) * [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. + * * `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]. @@ -263,8 +263,8 @@ public function getHeaders() * [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. + * * `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]. diff --git a/Tasks/src/V2beta3/ListQueuesRequest.php b/Tasks/src/V2beta3/ListQueuesRequest.php index f911a6146b22..84679df60846 100644 --- a/Tasks/src/V2beta3/ListQueuesRequest.php +++ b/Tasks/src/V2beta3/ListQueuesRequest.php @@ -270,7 +270,7 @@ public function setPageToken($var) */ public function getReadMask() { - return isset($this->read_mask) ? $this->read_mask : null; + return $this->read_mask; } public function hasReadMask() diff --git a/Tasks/src/V2beta3/Queue.php b/Tasks/src/V2beta3/Queue.php index a25350e4510e..ae67bfaac172 100644 --- a/Tasks/src/V2beta3/Queue.php +++ b/Tasks/src/V2beta3/Queue.php @@ -79,7 +79,7 @@ class Queue extends \Google\Protobuf\Internal\Message private $retry_config = null; /** * Output only. The state of the queue. - * `state` can only be changed by called + * `state` can only be changed by calling * [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). @@ -216,7 +216,7 @@ class Queue extends \Google\Protobuf\Internal\Message * 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 + * `state` can only be changed by calling * [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). @@ -388,7 +388,7 @@ public function setAppEngineHttpQueue($var) */ public function getRateLimits() { - return isset($this->rate_limits) ? $this->rate_limits : null; + return $this->rate_limits; } public function hasRateLimits() @@ -451,7 +451,7 @@ public function setRateLimits($var) */ public function getRetryConfig() { - return isset($this->retry_config) ? $this->retry_config : null; + return $this->retry_config; } public function hasRetryConfig() @@ -489,7 +489,7 @@ public function setRetryConfig($var) /** * Output only. The state of the queue. - * `state` can only be changed by called + * `state` can only be changed by calling * [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). @@ -505,7 +505,7 @@ public function getState() /** * Output only. The state of the queue. - * `state` can only be changed by called + * `state` can only be changed by calling * [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). @@ -538,7 +538,7 @@ public function setState($var) */ public function getPurgeTime() { - return isset($this->purge_time) ? $this->purge_time : null; + return $this->purge_time; } public function hasPurgeTime() @@ -590,7 +590,7 @@ public function setPurgeTime($var) */ public function getTaskTtl() { - return isset($this->task_ttl) ? $this->task_ttl : null; + return $this->task_ttl; } public function hasTaskTtl() @@ -642,7 +642,7 @@ public function setTaskTtl($var) */ public function getTombstoneTtl() { - return isset($this->tombstone_ttl) ? $this->tombstone_ttl : null; + return $this->tombstone_ttl; } public function hasTombstoneTtl() @@ -687,7 +687,7 @@ public function setTombstoneTtl($var) */ public function getStackdriverLoggingConfig() { - return isset($this->stackdriver_logging_config) ? $this->stackdriver_logging_config : null; + return $this->stackdriver_logging_config; } public function hasStackdriverLoggingConfig() @@ -759,7 +759,7 @@ public function setType($var) */ public function getStats() { - return isset($this->stats) ? $this->stats : null; + return $this->stats; } public function hasStats() diff --git a/Tasks/src/V2beta3/QueueStats.php b/Tasks/src/V2beta3/QueueStats.php index 398dd3cf7db4..d6a3e5dc1df1 100644 --- a/Tasks/src/V2beta3/QueueStats.php +++ b/Tasks/src/V2beta3/QueueStats.php @@ -130,7 +130,7 @@ public function setTasksCount($var) */ public function getOldestEstimatedArrivalTime() { - return isset($this->oldest_estimated_arrival_time) ? $this->oldest_estimated_arrival_time : null; + return $this->oldest_estimated_arrival_time; } public function hasOldestEstimatedArrivalTime() diff --git a/Tasks/src/V2beta3/RetryConfig.php b/Tasks/src/V2beta3/RetryConfig.php index 55de2e237d04..2af9eb9ad617 100644 --- a/Tasks/src/V2beta3/RetryConfig.php +++ b/Tasks/src/V2beta3/RetryConfig.php @@ -256,7 +256,7 @@ public function setMaxAttempts($var) */ public function getMaxRetryDuration() { - return isset($this->max_retry_duration) ? $this->max_retry_duration : null; + return $this->max_retry_duration; } public function hasMaxRetryDuration() @@ -314,7 +314,7 @@ public function setMaxRetryDuration($var) */ public function getMinBackoff() { - return isset($this->min_backoff) ? $this->min_backoff : null; + return $this->min_backoff; } public function hasMinBackoff() @@ -370,7 +370,7 @@ public function setMinBackoff($var) */ public function getMaxBackoff() { - return isset($this->max_backoff) ? $this->max_backoff : null; + return $this->max_backoff; } public function hasMaxBackoff() diff --git a/Tasks/src/V2beta3/Task.php b/Tasks/src/V2beta3/Task.php index 8c8333cbc739..bca0ae44199d 100644 --- a/Tasks/src/V2beta3/Task.php +++ b/Tasks/src/V2beta3/Task.php @@ -391,7 +391,7 @@ public function setPullMessage($var) */ public function getScheduleTime() { - return isset($this->schedule_time) ? $this->schedule_time : null; + return $this->schedule_time; } public function hasScheduleTime() @@ -430,7 +430,7 @@ public function setScheduleTime($var) */ public function getCreateTime() { - return isset($this->create_time) ? $this->create_time : null; + return $this->create_time; } public function hasCreateTime() @@ -492,7 +492,7 @@ public function setCreateTime($var) */ public function getDispatchDeadline() { - return isset($this->dispatch_deadline) ? $this->dispatch_deadline : null; + return $this->dispatch_deadline; } public function hasDispatchDeadline() @@ -611,7 +611,7 @@ public function setResponseCount($var) */ public function getFirstAttempt() { - return isset($this->first_attempt) ? $this->first_attempt : null; + return $this->first_attempt; } public function hasFirstAttempt() @@ -649,7 +649,7 @@ public function setFirstAttempt($var) */ public function getLastAttempt() { - return isset($this->last_attempt) ? $this->last_attempt : null; + return $this->last_attempt; } public function hasLastAttempt() diff --git a/Tasks/src/V2beta3/UpdateQueueRequest.php b/Tasks/src/V2beta3/UpdateQueueRequest.php index 4c06b708f688..109f7ab308ff 100644 --- a/Tasks/src/V2beta3/UpdateQueueRequest.php +++ b/Tasks/src/V2beta3/UpdateQueueRequest.php @@ -67,7 +67,7 @@ public function __construct($data = NULL) { */ public function getQueue() { - return isset($this->queue) ? $this->queue : null; + return $this->queue; } public function hasQueue() @@ -108,7 +108,7 @@ public function setQueue($var) */ public function getUpdateMask() { - return isset($this->update_mask) ? $this->update_mask : null; + return $this->update_mask; } public function hasUpdateMask() diff --git a/owl-bot-staging/Tasks/v2beta3/src/V2beta3/gapic_metadata.json b/Tasks/src/V2beta3/gapic_metadata.json similarity index 100% rename from owl-bot-staging/Tasks/v2beta3/src/V2beta3/gapic_metadata.json rename to Tasks/src/V2beta3/gapic_metadata.json diff --git a/Tasks/src/V2beta3/resources/cloud_tasks_client_config.json b/Tasks/src/V2beta3/resources/cloud_tasks_client_config.json index c535acea0801..99bdac739d33 100644 --- a/Tasks/src/V2beta3/resources/cloud_tasks_client_config.json +++ b/Tasks/src/V2beta3/resources/cloud_tasks_client_config.json @@ -1,125 +1,125 @@ { - "interfaces": { - "google.cloud.tasks.v2beta3.CloudTasks": { - "retry_codes": { - "retry_policy_1_codes": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "no_retry_codes": [], - "no_retry_1_codes": [] - }, - "retry_params": { - "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_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 + "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" + } + } } - }, - "methods": { - "ListQueues": { - "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" - }, - "CreateQueue": { - "timeout_millis": 20000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UpdateQueue": { - "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" - }, - "PurgeQueue": { - "timeout_millis": 20000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "PauseQueue": { - "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" - }, - "GetIamPolicy": { - "timeout_millis": 20000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_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" - }, - "ListTasks": { - "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" - }, - "CreateTask": { - "timeout_millis": 20000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteTask": { - "timeout_millis": 20000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "RunTask": { - "timeout_millis": 20000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - } - } } - } } 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 41368ea52675..608534c564a3 100644 --- a/Tasks/src/V2beta3/resources/cloud_tasks_rest_client_config.php +++ b/Tasks/src/V2beta3/resources/cloud_tasks_rest_client_config.php @@ -3,9 +3,10 @@ return [ 'interfaces' => [ 'google.cloud.tasks.v2beta3.CloudTasks' => [ - 'ListQueues' => [ - 'method' => 'get', + 'CreateQueue' => [ + 'method' => 'post', 'uriTemplate' => '/v2beta3/{parent=projects/*/locations/*}/queues', + 'body' => 'queue', 'placeholders' => [ 'parent' => [ 'getters' => [ @@ -14,21 +15,10 @@ ], ], ], - 'GetQueue' => [ - 'method' => 'get', - 'uriTemplate' => '/v2beta3/{name=projects/*/locations/*/queues/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'CreateQueue' => [ + 'CreateTask' => [ 'method' => 'post', - 'uriTemplate' => '/v2beta3/{parent=projects/*/locations/*}/queues', - 'body' => 'queue', + 'uriTemplate' => '/v2beta3/{parent=projects/*/locations/*/queues/*}/tasks', + 'body' => '*', 'placeholders' => [ 'parent' => [ 'getters' => [ @@ -37,22 +27,20 @@ ], ], ], - 'UpdateQueue' => [ - 'method' => 'patch', - 'uriTemplate' => '/v2beta3/{queue.name=projects/*/locations/*/queues/*}', - 'body' => 'queue', + 'DeleteQueue' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2beta3/{name=projects/*/locations/*/queues/*}', 'placeholders' => [ - 'queue.name' => [ + 'name' => [ 'getters' => [ - 'getQueue', 'getName', ], ], ], ], - 'DeleteQueue' => [ + 'DeleteTask' => [ 'method' => 'delete', - 'uriTemplate' => '/v2beta3/{name=projects/*/locations/*/queues/*}', + 'uriTemplate' => '/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}', 'placeholders' => [ 'name' => [ 'getters' => [ @@ -61,22 +49,21 @@ ], ], ], - 'PurgeQueue' => [ + 'GetIamPolicy' => [ 'method' => 'post', - 'uriTemplate' => '/v2beta3/{name=projects/*/locations/*/queues/*}:purge', + 'uriTemplate' => '/v2beta3/{resource=projects/*/locations/*/queues/*}:getIamPolicy', 'body' => '*', 'placeholders' => [ - 'name' => [ + 'resource' => [ 'getters' => [ - 'getName', + 'getResource', ], ], ], ], - 'PauseQueue' => [ - 'method' => 'post', - 'uriTemplate' => '/v2beta3/{name=projects/*/locations/*/queues/*}:pause', - 'body' => '*', + 'GetQueue' => [ + 'method' => 'get', + 'uriTemplate' => '/v2beta3/{name=projects/*/locations/*/queues/*}', 'placeholders' => [ 'name' => [ 'getters' => [ @@ -85,10 +72,9 @@ ], ], ], - 'ResumeQueue' => [ - 'method' => 'post', - 'uriTemplate' => '/v2beta3/{name=projects/*/locations/*/queues/*}:resume', - 'body' => '*', + 'GetTask' => [ + 'method' => 'get', + 'uriTemplate' => '/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}', 'placeholders' => [ 'name' => [ 'getters' => [ @@ -97,56 +83,56 @@ ], ], ], - 'GetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v2beta3/{resource=projects/*/locations/*/queues/*}:getIamPolicy', - 'body' => '*', + 'ListQueues' => [ + 'method' => 'get', + 'uriTemplate' => '/v2beta3/{parent=projects/*/locations/*}/queues', 'placeholders' => [ - 'resource' => [ + 'parent' => [ 'getters' => [ - 'getResource', + 'getParent', ], ], ], ], - 'SetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v2beta3/{resource=projects/*/locations/*/queues/*}:setIamPolicy', - 'body' => '*', + 'ListTasks' => [ + 'method' => 'get', + 'uriTemplate' => '/v2beta3/{parent=projects/*/locations/*/queues/*}/tasks', 'placeholders' => [ - 'resource' => [ + 'parent' => [ 'getters' => [ - 'getResource', + 'getParent', ], ], ], ], - 'TestIamPermissions' => [ + 'PauseQueue' => [ 'method' => 'post', - 'uriTemplate' => '/v2beta3/{resource=projects/*/locations/*/queues/*}:testIamPermissions', + 'uriTemplate' => '/v2beta3/{name=projects/*/locations/*/queues/*}:pause', 'body' => '*', 'placeholders' => [ - 'resource' => [ + 'name' => [ 'getters' => [ - 'getResource', + 'getName', ], ], ], ], - 'ListTasks' => [ - 'method' => 'get', - 'uriTemplate' => '/v2beta3/{parent=projects/*/locations/*/queues/*}/tasks', + 'PurgeQueue' => [ + 'method' => 'post', + 'uriTemplate' => '/v2beta3/{name=projects/*/locations/*/queues/*}:purge', + 'body' => '*', 'placeholders' => [ - 'parent' => [ + 'name' => [ 'getters' => [ - 'getParent', + 'getName', ], ], ], ], - 'GetTask' => [ - 'method' => 'get', - 'uriTemplate' => '/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}', + 'ResumeQueue' => [ + 'method' => 'post', + 'uriTemplate' => '/v2beta3/{name=projects/*/locations/*/queues/*}:resume', + 'body' => '*', 'placeholders' => [ 'name' => [ 'getters' => [ @@ -155,36 +141,50 @@ ], ], ], - 'CreateTask' => [ + 'RunTask' => [ 'method' => 'post', - 'uriTemplate' => '/v2beta3/{parent=projects/*/locations/*/queues/*}/tasks', + 'uriTemplate' => '/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}:run', 'body' => '*', 'placeholders' => [ - 'parent' => [ + 'name' => [ 'getters' => [ - 'getParent', + 'getName', ], ], ], ], - 'DeleteTask' => [ - 'method' => 'delete', - 'uriTemplate' => '/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}', + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v2beta3/{resource=projects/*/locations/*/queues/*}:setIamPolicy', + 'body' => '*', 'placeholders' => [ - 'name' => [ + 'resource' => [ 'getters' => [ - 'getName', + 'getResource', ], ], ], ], - 'RunTask' => [ + 'TestIamPermissions' => [ 'method' => 'post', - 'uriTemplate' => '/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}:run', + 'uriTemplate' => '/v2beta3/{resource=projects/*/locations/*/queues/*}:testIamPermissions', 'body' => '*', 'placeholders' => [ - 'name' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'UpdateQueue' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2beta3/{queue.name=projects/*/locations/*/queues/*}', + 'body' => 'queue', + 'placeholders' => [ + 'queue.name' => [ 'getters' => [ + 'getQueue', 'getName', ], ], diff --git a/Tasks/tests/Unit/V2/CloudTasksClientTest.php b/Tasks/tests/Unit/V2/CloudTasksClientTest.php index 012da6becb96..7ff127931198 100644 --- a/Tasks/tests/Unit/V2/CloudTasksClientTest.php +++ b/Tasks/tests/Unit/V2/CloudTasksClientTest.php @@ -22,24 +22,26 @@ namespace Google\Cloud\Tasks\Tests\Unit\V2; -use Google\Cloud\Tasks\V2\CloudTasksClient; use Google\ApiCore\ApiException; + use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; + use Google\Cloud\Iam\V1\Policy; use Google\Cloud\Iam\V1\TestIamPermissionsResponse; +use Google\Cloud\Tasks\V2\CloudTasksClient; use Google\Cloud\Tasks\V2\ListQueuesResponse; use Google\Cloud\Tasks\V2\ListTasksResponse; use Google\Cloud\Tasks\V2\Queue; use Google\Cloud\Tasks\V2\Task; -use Google\Protobuf\Any; use Google\Protobuf\GPBEmpty; use Google\Rpc\Code; use stdClass; /** * @group tasks + * * @group gapic */ class CloudTasksClientTest extends GeneratedTest @@ -57,9 +59,7 @@ private function createTransport($deserialize = null) */ private function createCredentials() { - return $this->getMockBuilder(CredentialsWrapper::class) - ->disableOriginalConstructor() - ->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); } /** @@ -70,84 +70,72 @@ private function createClient(array $options = []) $options += [ 'credentials' => $this->createCredentials(), ]; - return new CloudTasksClient($options); } /** * @test */ - public function listQueuesTest() + public function createQueueTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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); + $name = 'name3373707'; + $expectedResponse = new Queue(); + $expectedResponse->setName($name); $transport->addResponse($expectedResponse); - // Mock request $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); - - $response = $client->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]); - + $queue = new Queue(); + $response = $client->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/ListQueues', $actualFuncCall); - + $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 listQueuesExceptionTest() + public function createQueueExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); - + $queue = new Queue(); try { - $client->listQueues($formattedParent); + $client->createQueue($formattedParent, $queue); // If the $client 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()); @@ -156,71 +144,70 @@ public function listQueuesExceptionTest() /** * @test */ - public function getQueueTest() + public function createTaskTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new Queue(); - $expectedResponse->setName($name2); + $name = 'name3373707'; + $dispatchCount = 1217252086; + $responseCount = 424727441; + $expectedResponse = new Task(); + $expectedResponse->setName($name); + $expectedResponse->setDispatchCount($dispatchCount); + $expectedResponse->setResponseCount($responseCount); $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - - $response = $client->getQueue($formattedName); + $formattedParent = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $task = new Task(); + $response = $client->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/GetQueue', $actualFuncCall); - - $actualValue = $actualRequestObject->getName(); - - $this->assertProtobufEquals($formattedName, $actualValue); - + $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 getQueueExceptionTest() + public function createTaskExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - + $formattedParent = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $task = new Task(); try { - $client->getQueue($formattedName); + $client->createTask($formattedParent, $task); // If the $client 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()); @@ -229,76 +216,59 @@ public function getQueueExceptionTest() /** * @test */ - public function createQueueTest() + public function deleteQueueTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new Queue(); - $expectedResponse->setName($name); + $expectedResponse = new GPBEmpty(); $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); - $queue = new Queue(); - - $response = $client->createQueue($formattedParent, $queue); - $this->assertEquals($expectedResponse, $response); + $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $client->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/CreateQueue', $actualFuncCall); - - $actualValue = $actualRequestObject->getParent(); - - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getQueue(); - - $this->assertProtobufEquals($queue, $actualValue); - + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/DeleteQueue', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function createQueueExceptionTest() + public function deleteQueueExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); - $queue = new Queue(); - + $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); try { - $client->createQueue($formattedParent, $queue); + $client->deleteQueue($formattedName); // If the $client 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()); @@ -307,71 +277,59 @@ public function createQueueExceptionTest() /** * @test */ - public function updateQueueTest() + public function deleteTaskTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new Queue(); - $expectedResponse->setName($name); + $expectedResponse = new GPBEmpty(); $transport->addResponse($expectedResponse); - // Mock request - $queue = new Queue(); - - $response = $client->updateQueue($queue); - $this->assertEquals($expectedResponse, $response); + $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $client->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/UpdateQueue', $actualFuncCall); - - $actualValue = $actualRequestObject->getQueue(); - - $this->assertProtobufEquals($queue, $actualValue); - + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/DeleteTask', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function updateQueueExceptionTest() + public function deleteTaskExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $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(); - + $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); try { - $client->updateQueue($queue); + $client->deleteTask($formattedName); // If the $client 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()); @@ -380,68 +338,64 @@ public function updateQueueExceptionTest() /** * @test */ - public function deleteQueueTest() + public function getIamPolicyTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - - $client->deleteQueue($formattedName); + $resource = 'resource-341064690'; + $response = $client->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/DeleteQueue', $actualFuncCall); - - $actualValue = $actualRequestObject->getName(); - - $this->assertProtobufEquals($formattedName, $actualValue); - + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function deleteQueueExceptionTest() + public function getIamPolicyExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - + $resource = 'resource-341064690'; try { - $client->deleteQueue($formattedName); + $client->getIamPolicy($resource); // If the $client 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()); @@ -450,71 +404,62 @@ public function deleteQueueExceptionTest() /** * @test */ - public function purgeQueueTest() + public function getQueueTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - - $response = $client->purgeQueue($formattedName); + $response = $client->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/PurgeQueue', $actualFuncCall); - + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/GetQueue', $actualFuncCall); $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function purgeQueueExceptionTest() + public function getQueueExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - try { - $client->purgeQueue($formattedName); + $client->getQueue($formattedName); // If the $client 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()); @@ -523,71 +468,66 @@ public function purgeQueueExceptionTest() /** * @test */ - public function pauseQueueTest() + public function getTaskTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response $name2 = 'name2-1052831874'; - $expectedResponse = new Queue(); + $dispatchCount = 1217252086; + $responseCount = 424727441; + $expectedResponse = new Task(); $expectedResponse->setName($name2); + $expectedResponse->setDispatchCount($dispatchCount); + $expectedResponse->setResponseCount($responseCount); $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - - $response = $client->pauseQueue($formattedName); + $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $response = $client->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/PauseQueue', $actualFuncCall); - + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/GetTask', $actualFuncCall); $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function pauseQueueExceptionTest() + public function getTaskExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - + $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); try { - $client->pauseQueue($formattedName); + $client->getTask($formattedName); // If the $client 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()); @@ -596,71 +536,70 @@ public function pauseQueueExceptionTest() /** * @test */ - public function resumeQueueTest() + public function listQueuesTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new Queue(); - $expectedResponse->setName($name2); + $nextPageToken = ''; + $queuesElement = new Queue(); + $queues = [ + $queuesElement, + ]; + $expectedResponse = new ListQueuesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setQueues($queues); $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - - $response = $client->resumeQueue($formattedName); - $this->assertEquals($expectedResponse, $response); + $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); + $response = $client->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/ResumeQueue', $actualFuncCall); - - $actualValue = $actualRequestObject->getName(); - - $this->assertProtobufEquals($formattedName, $actualValue); - + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/ListQueues', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function resumeQueueExceptionTest() + public function listQueuesExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - + $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); try { - $client->resumeQueue($formattedName); + $client->listQueues($formattedParent); // If the $client 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()); @@ -669,73 +608,70 @@ public function resumeQueueExceptionTest() /** * @test */ - public function getIamPolicyTest() + public function listTasksTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); + $nextPageToken = ''; + $tasksElement = new Task(); + $tasks = [ + $tasksElement, + ]; + $expectedResponse = new ListTasksResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTasks($tasks); $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - - $response = $client->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); + $formattedParent = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $response = $client->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/GetIamPolicy', $actualFuncCall); - - $actualValue = $actualRequestObject->getResource(); - - $this->assertProtobufEquals($resource, $actualValue); - + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/ListTasks', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function getIamPolicyExceptionTest() + public function listTasksExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $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'; - + $formattedParent = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); try { - $client->getIamPolicy($resource); + $client->listTasks($formattedParent); // If the $client 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()); @@ -744,78 +680,62 @@ public function getIamPolicyExceptionTest() /** * @test */ - public function setIamPolicyTest() + public function pauseQueueTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); + $name2 = 'name2-1052831874'; + $expectedResponse = new Queue(); + $expectedResponse->setName($name2); $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - - $response = $client->setIamPolicy($resource, $policy); + $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $response = $client->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/SetIamPolicy', $actualFuncCall); - - $actualValue = $actualRequestObject->getResource(); - - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - - $this->assertProtobufEquals($policy, $actualValue); - + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/PauseQueue', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function setIamPolicyExceptionTest() + public function pauseQueueExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $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(); - + $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); try { - $client->setIamPolicy($resource, $policy); + $client->pauseQueue($formattedName); // If the $client 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()); @@ -824,74 +744,62 @@ public function setIamPolicyExceptionTest() /** * @test */ - public function testIamPermissionsTest() + public function purgeQueueTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); + $name2 = 'name2-1052831874'; + $expectedResponse = new Queue(); + $expectedResponse->setName($name2); $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - - $response = $client->testIamPermissions($resource, $permissions); + $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $response = $client->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/TestIamPermissions', $actualFuncCall); - - $actualValue = $actualRequestObject->getResource(); - - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - - $this->assertProtobufEquals($permissions, $actualValue); - + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/PurgeQueue', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function testIamPermissionsExceptionTest() + public function purgeQueueExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $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 = []; - + $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); try { - $client->testIamPermissions($resource, $permissions); + $client->purgeQueue($formattedName); // If the $client 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()); @@ -900,77 +808,62 @@ public function testIamPermissionsExceptionTest() /** * @test */ - public function listTasksTest() + public function resumeQueueTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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); + $name2 = 'name2-1052831874'; + $expectedResponse = new Queue(); + $expectedResponse->setName($name2); $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - - $response = $client->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]); - + $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $response = $client->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/ListTasks', $actualFuncCall); - - $actualValue = $actualRequestObject->getParent(); - - $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/ResumeQueue', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function listTasksExceptionTest() + public function resumeQueueExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedParent = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - + $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); try { - $client->listTasks($formattedParent); + $client->resumeQueue($formattedName); // If the $client 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()); @@ -979,13 +872,13 @@ public function listTasksExceptionTest() /** * @test */ - public function getTaskTest() + public function runTaskTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response $name2 = 'name2-1052831874'; $dispatchCount = 1217252086; @@ -995,59 +888,50 @@ public function getTaskTest() $expectedResponse->setDispatchCount($dispatchCount); $expectedResponse->setResponseCount($responseCount); $transport->addResponse($expectedResponse); - // Mock request $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - - $response = $client->getTask($formattedName); + $response = $client->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/GetTask', $actualFuncCall); - + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/RunTask', $actualFuncCall); $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function getTaskExceptionTest() + public function runTaskExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - try { - $client->getTask($formattedName); + $client->runTask($formattedName); // If the $client 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()); @@ -1056,80 +940,68 @@ public function getTaskExceptionTest() /** * @test */ - public function createTaskTest() + public function setIamPolicyTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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); + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $task = new Task(); - - $response = $client->createTask($formattedParent, $task); + $resource = 'resource-341064690'; + $policy = new Policy(); + $response = $client->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/CreateTask', $actualFuncCall); - - $actualValue = $actualRequestObject->getParent(); - - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getTask(); - - $this->assertProtobufEquals($task, $actualValue); - + $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 createTaskExceptionTest() + public function setIamPolicyExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedParent = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $task = new Task(); - + $resource = 'resource-341064690'; + $policy = new Policy(); try { - $client->createTask($formattedParent, $task); + $client->setIamPolicy($resource, $policy); // If the $client 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()); @@ -1138,68 +1010,64 @@ public function createTaskExceptionTest() /** * @test */ - public function deleteTaskTest() + public function testIamPermissionsTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); + $expectedResponse = new TestIamPermissionsResponse(); $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - - $client->deleteTask($formattedName); + $resource = 'resource-341064690'; + $permissions = []; + $response = $client->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/DeleteTask', $actualFuncCall); - - $actualValue = $actualRequestObject->getName(); - - $this->assertProtobufEquals($formattedName, $actualValue); - + $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 deleteTaskExceptionTest() + public function testIamPermissionsExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - + $resource = 'resource-341064690'; + $permissions = []; try { - $client->deleteTask($formattedName); + $client->testIamPermissions($resource, $permissions); // If the $client 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()); @@ -1208,75 +1076,62 @@ public function deleteTaskExceptionTest() /** * @test */ - public function runTaskTest() + public function updateQueueTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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); + $name = 'name3373707'; + $expectedResponse = new Queue(); + $expectedResponse->setName($name); $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - - $response = $client->runTask($formattedName); + $queue = new Queue(); + $response = $client->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/RunTask', $actualFuncCall); - - $actualValue = $actualRequestObject->getName(); - - $this->assertProtobufEquals($formattedName, $actualValue); - + $this->assertSame('/google.cloud.tasks.v2.CloudTasks/UpdateQueue', $actualFuncCall); + $actualValue = $actualRequestObject->getQueue(); + $this->assertProtobufEquals($queue, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function runTaskExceptionTest() + public function updateQueueExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - + $queue = new Queue(); try { - $client->runTask($formattedName); + $client->updateQueue($queue); // If the $client 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/Tasks/tests/Unit/V2beta2/CloudTasksClientTest.php b/Tasks/tests/Unit/V2beta2/CloudTasksClientTest.php index 112e6b1efca3..64e96151de86 100644 --- a/Tasks/tests/Unit/V2beta2/CloudTasksClientTest.php +++ b/Tasks/tests/Unit/V2beta2/CloudTasksClientTest.php @@ -22,19 +22,20 @@ namespace Google\Cloud\Tasks\Tests\Unit\V2beta2; -use Google\Cloud\Tasks\V2beta2\CloudTasksClient; use Google\ApiCore\ApiException; + use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; + use Google\Cloud\Iam\V1\Policy; use Google\Cloud\Iam\V1\TestIamPermissionsResponse; +use Google\Cloud\Tasks\V2beta2\CloudTasksClient; use Google\Cloud\Tasks\V2beta2\LeaseTasksResponse; use Google\Cloud\Tasks\V2beta2\ListQueuesResponse; use Google\Cloud\Tasks\V2beta2\ListTasksResponse; use Google\Cloud\Tasks\V2beta2\Queue; use Google\Cloud\Tasks\V2beta2\Task; -use Google\Protobuf\Any; use Google\Protobuf\Duration; use Google\Protobuf\GPBEmpty; use Google\Protobuf\Timestamp; @@ -43,6 +44,7 @@ /** * @group tasks + * * @group gapic */ class CloudTasksClientTest extends GeneratedTest @@ -60,9 +62,7 @@ private function createTransport($deserialize = null) */ private function createCredentials() { - return $this->getMockBuilder(CredentialsWrapper::class) - ->disableOriginalConstructor() - ->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); } /** @@ -73,84 +73,69 @@ private function createClient(array $options = []) $options += [ 'credentials' => $this->createCredentials(), ]; - return new CloudTasksClient($options); } /** * @test */ - public function listQueuesTest() + public function acknowledgeTaskTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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); + $expectedResponse = new GPBEmpty(); $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); - - $response = $client->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]); - + $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $scheduleTime = new Timestamp(); + $client->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/ListQueues', $actualFuncCall); - - $actualValue = $actualRequestObject->getParent(); - - $this->assertProtobufEquals($formattedParent, $actualValue); + $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 listQueuesExceptionTest() + public function acknowledgeTaskExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); - + $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $scheduleTime = new Timestamp(); try { - $client->listQueues($formattedParent); + $client->acknowledgeTask($formattedName, $scheduleTime); // If the $client 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()); @@ -159,71 +144,66 @@ public function listQueuesExceptionTest() /** * @test */ - public function getQueueTest() + public function cancelLeaseTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response $name2 = 'name2-1052831874'; - $expectedResponse = new Queue(); + $expectedResponse = new Task(); $expectedResponse->setName($name2); $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - - $response = $client->getQueue($formattedName); + $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $scheduleTime = new Timestamp(); + $response = $client->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/GetQueue', $actualFuncCall); - + $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 getQueueExceptionTest() + public function cancelLeaseExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - + $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $scheduleTime = new Timestamp(); try { - $client->getQueue($formattedName); + $client->cancelLease($formattedName, $scheduleTime); // If the $client 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()); @@ -235,20 +215,18 @@ public function getQueueExceptionTest() public function createQueueTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response $name = 'name3373707'; $expectedResponse = new Queue(); $expectedResponse->setName($name); $transport->addResponse($expectedResponse); - // Mock request $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); $queue = new Queue(); - $response = $client->createQueue($formattedParent, $queue); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -256,14 +234,10 @@ public function createQueueTest() $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()); } @@ -273,26 +247,23 @@ public function createQueueTest() public function createQueueExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); $queue = new Queue(); - try { $client->createQueue($formattedParent, $queue); // If the $client method call did not throw, fail the test @@ -301,7 +272,6 @@ public function createQueueExceptionTest() $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()); @@ -310,71 +280,66 @@ public function createQueueExceptionTest() /** * @test */ - public function updateQueueTest() + public function createTaskTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response $name = 'name3373707'; - $expectedResponse = new Queue(); + $expectedResponse = new Task(); $expectedResponse->setName($name); $transport->addResponse($expectedResponse); - // Mock request - $queue = new Queue(); - - $response = $client->updateQueue($queue); + $formattedParent = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $task = new Task(); + $response = $client->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/UpdateQueue', $actualFuncCall); - - $actualValue = $actualRequestObject->getQueue(); - - $this->assertProtobufEquals($queue, $actualValue); - + $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 updateQueueExceptionTest() + public function createTaskExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $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(); - + $formattedParent = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $task = new Task(); try { - $client->updateQueue($queue); + $client->createTask($formattedParent, $task); // If the $client 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()); @@ -386,28 +351,23 @@ public function updateQueueExceptionTest() public function deleteQueueTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response $expectedResponse = new GPBEmpty(); $transport->addResponse($expectedResponse); - // Mock request $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $client->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()); } @@ -417,25 +377,22 @@ public function deleteQueueTest() public function deleteQueueExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - try { $client->deleteQueue($formattedName); // If the $client method call did not throw, fail the test @@ -444,7 +401,6 @@ public function deleteQueueExceptionTest() $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()); @@ -453,71 +409,59 @@ public function deleteQueueExceptionTest() /** * @test */ - public function purgeQueueTest() + public function deleteTaskTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new Queue(); - $expectedResponse->setName($name2); + $expectedResponse = new GPBEmpty(); $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - - $response = $client->purgeQueue($formattedName); - $this->assertEquals($expectedResponse, $response); + $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $client->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/PurgeQueue', $actualFuncCall); - + $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/DeleteTask', $actualFuncCall); $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function purgeQueueExceptionTest() + public function deleteTaskExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - + $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); try { - $client->purgeQueue($formattedName); + $client->deleteTask($formattedName); // If the $client 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()); @@ -526,71 +470,64 @@ public function purgeQueueExceptionTest() /** * @test */ - public function pauseQueueTest() + public function getIamPolicyTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new Queue(); - $expectedResponse->setName($name2); + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - - $response = $client->pauseQueue($formattedName); + $resource = 'resource-341064690'; + $response = $client->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/PauseQueue', $actualFuncCall); - - $actualValue = $actualRequestObject->getName(); - - $this->assertProtobufEquals($formattedName, $actualValue); - + $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function pauseQueueExceptionTest() + public function getIamPolicyExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - + $resource = 'resource-341064690'; try { - $client->pauseQueue($formattedName); + $client->getIamPolicy($resource); // If the $client 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()); @@ -599,71 +536,62 @@ public function pauseQueueExceptionTest() /** * @test */ - public function resumeQueueTest() + public function getQueueTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - - $response = $client->resumeQueue($formattedName); + $response = $client->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/ResumeQueue', $actualFuncCall); - + $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/GetQueue', $actualFuncCall); $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function resumeQueueExceptionTest() + public function getQueueExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - try { - $client->resumeQueue($formattedName); + $client->getQueue($formattedName); // If the $client 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()); @@ -672,73 +600,62 @@ public function resumeQueueExceptionTest() /** * @test */ - public function getIamPolicyTest() + public function getTaskTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); + $name2 = 'name2-1052831874'; + $expectedResponse = new Task(); + $expectedResponse->setName($name2); $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - - $response = $client->getIamPolicy($resource); + $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $response = $client->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/GetIamPolicy', $actualFuncCall); - - $actualValue = $actualRequestObject->getResource(); - - $this->assertProtobufEquals($resource, $actualValue); - + $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/GetTask', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function getIamPolicyExceptionTest() + public function getTaskExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $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'; - + $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); try { - $client->getIamPolicy($resource); + $client->getTask($formattedName); // If the $client 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()); @@ -747,78 +664,64 @@ public function getIamPolicyExceptionTest() /** * @test */ - public function setIamPolicyTest() + public function leaseTasksTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); + $expectedResponse = new LeaseTasksResponse(); $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - - $response = $client->setIamPolicy($resource, $policy); + $formattedParent = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $leaseDuration = new Duration(); + $response = $client->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/SetIamPolicy', $actualFuncCall); - - $actualValue = $actualRequestObject->getResource(); - - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - - $this->assertProtobufEquals($policy, $actualValue); - + $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 setIamPolicyExceptionTest() + public function leaseTasksExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $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(); - + $formattedParent = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $leaseDuration = new Duration(); try { - $client->setIamPolicy($resource, $policy); + $client->leaseTasks($formattedParent, $leaseDuration); // If the $client 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()); @@ -827,74 +730,70 @@ public function setIamPolicyExceptionTest() /** * @test */ - public function testIamPermissionsTest() + public function listQueuesTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); + $nextPageToken = ''; + $queuesElement = new Queue(); + $queues = [ + $queuesElement, + ]; + $expectedResponse = new ListQueuesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setQueues($queues); $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - - $response = $client->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); + $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); + $response = $client->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/TestIamPermissions', $actualFuncCall); - - $actualValue = $actualRequestObject->getResource(); - - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - - $this->assertProtobufEquals($permissions, $actualValue); - + $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/ListQueues', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function testIamPermissionsExceptionTest() + public function listQueuesExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $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 = []; - + $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); try { - $client->testIamPermissions($resource, $permissions); + $client->listQueues($formattedParent); // If the $client 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()); @@ -906,36 +805,33 @@ public function testIamPermissionsExceptionTest() public function listTasksTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response $nextPageToken = ''; $tasksElement = new Task(); - $tasks = [$tasksElement]; + $tasks = [ + $tasksElement, + ]; $expectedResponse = new ListTasksResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setTasks($tasks); $transport->addResponse($expectedResponse); - // Mock request $formattedParent = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $response = $client->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()); } @@ -946,25 +842,22 @@ public function listTasksTest() public function listTasksExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request $formattedParent = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - try { $client->listTasks($formattedParent); // If the $client method call did not throw, fail the test @@ -973,7 +866,6 @@ public function listTasksExceptionTest() $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()); @@ -982,71 +874,62 @@ public function listTasksExceptionTest() /** * @test */ - public function getTaskTest() + public function pauseQueueTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response $name2 = 'name2-1052831874'; - $expectedResponse = new Task(); + $expectedResponse = new Queue(); $expectedResponse->setName($name2); $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - - $response = $client->getTask($formattedName); + $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $response = $client->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/GetTask', $actualFuncCall); - + $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/PauseQueue', $actualFuncCall); $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function getTaskExceptionTest() + public function pauseQueueExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - + $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); try { - $client->getTask($formattedName); + $client->pauseQueue($formattedName); // If the $client 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()); @@ -1055,76 +938,62 @@ public function getTaskExceptionTest() /** * @test */ - public function createTaskTest() + public function purgeQueueTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new Task(); - $expectedResponse->setName($name); + $name2 = 'name2-1052831874'; + $expectedResponse = new Queue(); + $expectedResponse->setName($name2); $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $task = new Task(); - - $response = $client->createTask($formattedParent, $task); + $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $response = $client->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/CreateTask', $actualFuncCall); - - $actualValue = $actualRequestObject->getParent(); - - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getTask(); - - $this->assertProtobufEquals($task, $actualValue); - + $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/PurgeQueue', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function createTaskExceptionTest() + public function purgeQueueExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedParent = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $task = new Task(); - + $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); try { - $client->createTask($formattedParent, $task); + $client->purgeQueue($formattedName); // If the $client 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()); @@ -1133,68 +1002,70 @@ public function createTaskExceptionTest() /** * @test */ - public function deleteTaskTest() + public function renewLeaseTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); + $name2 = 'name2-1052831874'; + $expectedResponse = new Task(); + $expectedResponse->setName($name2); $transport->addResponse($expectedResponse); - // Mock request $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - - $client->deleteTask($formattedName); + $scheduleTime = new Timestamp(); + $leaseDuration = new Duration(); + $response = $client->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/DeleteTask', $actualFuncCall); - + $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 deleteTaskExceptionTest() + public function renewLeaseExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - + $scheduleTime = new Timestamp(); + $leaseDuration = new Duration(); try { - $client->deleteTask($formattedName); + $client->renewLease($formattedName, $scheduleTime, $leaseDuration); // If the $client 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()); @@ -1203,74 +1074,62 @@ public function deleteTaskExceptionTest() /** * @test */ - public function leaseTasksTest() + public function resumeQueueTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new LeaseTasksResponse(); + $name2 = 'name2-1052831874'; + $expectedResponse = new Queue(); + $expectedResponse->setName($name2); $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $leaseDuration = new Duration(); - - $response = $client->leaseTasks($formattedParent, $leaseDuration); + $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $response = $client->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/LeaseTasks', $actualFuncCall); - - $actualValue = $actualRequestObject->getParent(); - - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getLeaseDuration(); - - $this->assertProtobufEquals($leaseDuration, $actualValue); - + $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/ResumeQueue', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function leaseTasksExceptionTest() + public function resumeQueueExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedParent = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $leaseDuration = new Duration(); - + $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); try { - $client->leaseTasks($formattedParent, $leaseDuration); + $client->resumeQueue($formattedName); // If the $client 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()); @@ -1279,73 +1138,62 @@ public function leaseTasksExceptionTest() /** * @test */ - public function acknowledgeTaskTest() + public function runTaskTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); + $name2 = 'name2-1052831874'; + $expectedResponse = new Task(); + $expectedResponse->setName($name2); $transport->addResponse($expectedResponse); - // Mock request $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - $scheduleTime = new Timestamp(); - - $client->acknowledgeTask($formattedName, $scheduleTime); + $response = $client->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/AcknowledgeTask', $actualFuncCall); - + $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/RunTask', $actualFuncCall); $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getScheduleTime(); - - $this->assertProtobufEquals($scheduleTime, $actualValue); - $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function acknowledgeTaskExceptionTest() + public function runTaskExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - $scheduleTime = new Timestamp(); - try { - $client->acknowledgeTask($formattedName, $scheduleTime); + $client->runTask($formattedName); // If the $client 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()); @@ -1354,81 +1202,68 @@ public function acknowledgeTaskExceptionTest() /** * @test */ - public function renewLeaseTest() + public function setIamPolicyTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new Task(); - $expectedResponse->setName($name2); + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - $scheduleTime = new Timestamp(); - $leaseDuration = new Duration(); - - $response = $client->renewLease($formattedName, $scheduleTime, $leaseDuration); + $resource = 'resource-341064690'; + $policy = new Policy(); + $response = $client->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/RenewLease', $actualFuncCall); - - $actualValue = $actualRequestObject->getName(); - - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getScheduleTime(); - - $this->assertProtobufEquals($scheduleTime, $actualValue); - $actualValue = $actualRequestObject->getLeaseDuration(); - - $this->assertProtobufEquals($leaseDuration, $actualValue); - + $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 renewLeaseExceptionTest() + public function setIamPolicyExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - $scheduleTime = new Timestamp(); - $leaseDuration = new Duration(); - + $resource = 'resource-341064690'; + $policy = new Policy(); try { - $client->renewLease($formattedName, $scheduleTime, $leaseDuration); + $client->setIamPolicy($resource, $policy); // If the $client 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()); @@ -1437,76 +1272,64 @@ public function renewLeaseExceptionTest() /** * @test */ - public function cancelLeaseTest() + public function testIamPermissionsTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new Task(); - $expectedResponse->setName($name2); + $expectedResponse = new TestIamPermissionsResponse(); $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - $scheduleTime = new Timestamp(); - - $response = $client->cancelLease($formattedName, $scheduleTime); + $resource = 'resource-341064690'; + $permissions = []; + $response = $client->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/CancelLease', $actualFuncCall); - - $actualValue = $actualRequestObject->getName(); - - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getScheduleTime(); - - $this->assertProtobufEquals($scheduleTime, $actualValue); - + $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 cancelLeaseExceptionTest() + public function testIamPermissionsExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - $scheduleTime = new Timestamp(); - + $resource = 'resource-341064690'; + $permissions = []; try { - $client->cancelLease($formattedName, $scheduleTime); + $client->testIamPermissions($resource, $permissions); // If the $client 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()); @@ -1515,71 +1338,62 @@ public function cancelLeaseExceptionTest() /** * @test */ - public function runTaskTest() + public function updateQueueTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new Task(); - $expectedResponse->setName($name2); + $name = 'name3373707'; + $expectedResponse = new Queue(); + $expectedResponse->setName($name); $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - - $response = $client->runTask($formattedName); + $queue = new Queue(); + $response = $client->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/RunTask', $actualFuncCall); - - $actualValue = $actualRequestObject->getName(); - - $this->assertProtobufEquals($formattedName, $actualValue); - + $this->assertSame('/google.cloud.tasks.v2beta2.CloudTasks/UpdateQueue', $actualFuncCall); + $actualValue = $actualRequestObject->getQueue(); + $this->assertProtobufEquals($queue, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function runTaskExceptionTest() + public function updateQueueExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - + $queue = new Queue(); try { - $client->runTask($formattedName); + $client->updateQueue($queue); // If the $client 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/Tasks/tests/Unit/V2beta3/CloudTasksClientTest.php b/Tasks/tests/Unit/V2beta3/CloudTasksClientTest.php index 1b08e2d24a11..6272edded921 100644 --- a/Tasks/tests/Unit/V2beta3/CloudTasksClientTest.php +++ b/Tasks/tests/Unit/V2beta3/CloudTasksClientTest.php @@ -22,24 +22,26 @@ namespace Google\Cloud\Tasks\Tests\Unit\V2beta3; -use Google\Cloud\Tasks\V2beta3\CloudTasksClient; use Google\ApiCore\ApiException; + use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; + use Google\Cloud\Iam\V1\Policy; use Google\Cloud\Iam\V1\TestIamPermissionsResponse; +use Google\Cloud\Tasks\V2beta3\CloudTasksClient; use Google\Cloud\Tasks\V2beta3\ListQueuesResponse; use Google\Cloud\Tasks\V2beta3\ListTasksResponse; use Google\Cloud\Tasks\V2beta3\Queue; use Google\Cloud\Tasks\V2beta3\Task; -use Google\Protobuf\Any; use Google\Protobuf\GPBEmpty; use Google\Rpc\Code; use stdClass; /** * @group tasks + * * @group gapic */ class CloudTasksClientTest extends GeneratedTest @@ -57,9 +59,7 @@ private function createTransport($deserialize = null) */ private function createCredentials() { - return $this->getMockBuilder(CredentialsWrapper::class) - ->disableOriginalConstructor() - ->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); } /** @@ -70,84 +70,72 @@ private function createClient(array $options = []) $options += [ 'credentials' => $this->createCredentials(), ]; - return new CloudTasksClient($options); } /** * @test */ - public function listQueuesTest() + public function createQueueTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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); + $name = 'name3373707'; + $expectedResponse = new Queue(); + $expectedResponse->setName($name); $transport->addResponse($expectedResponse); - // Mock request $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); - - $response = $client->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]); - + $queue = new Queue(); + $response = $client->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/ListQueues', $actualFuncCall); - + $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 listQueuesExceptionTest() + public function createQueueExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); - + $queue = new Queue(); try { - $client->listQueues($formattedParent); + $client->createQueue($formattedParent, $queue); // If the $client 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()); @@ -156,71 +144,70 @@ public function listQueuesExceptionTest() /** * @test */ - public function getQueueTest() + public function createTaskTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new Queue(); - $expectedResponse->setName($name2); + $name = 'name3373707'; + $dispatchCount = 1217252086; + $responseCount = 424727441; + $expectedResponse = new Task(); + $expectedResponse->setName($name); + $expectedResponse->setDispatchCount($dispatchCount); + $expectedResponse->setResponseCount($responseCount); $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - - $response = $client->getQueue($formattedName); + $formattedParent = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $task = new Task(); + $response = $client->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/GetQueue', $actualFuncCall); - - $actualValue = $actualRequestObject->getName(); - - $this->assertProtobufEquals($formattedName, $actualValue); - + $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 getQueueExceptionTest() + public function createTaskExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - + $formattedParent = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $task = new Task(); try { - $client->getQueue($formattedName); + $client->createTask($formattedParent, $task); // If the $client 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()); @@ -229,76 +216,59 @@ public function getQueueExceptionTest() /** * @test */ - public function createQueueTest() + public function deleteQueueTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new Queue(); - $expectedResponse->setName($name); + $expectedResponse = new GPBEmpty(); $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); - $queue = new Queue(); - - $response = $client->createQueue($formattedParent, $queue); - $this->assertEquals($expectedResponse, $response); + $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $client->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/CreateQueue', $actualFuncCall); - - $actualValue = $actualRequestObject->getParent(); - - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getQueue(); - - $this->assertProtobufEquals($queue, $actualValue); - + $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/DeleteQueue', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function createQueueExceptionTest() + public function deleteQueueExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); - $queue = new Queue(); - + $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); try { - $client->createQueue($formattedParent, $queue); + $client->deleteQueue($formattedName); // If the $client 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()); @@ -307,71 +277,59 @@ public function createQueueExceptionTest() /** * @test */ - public function updateQueueTest() + public function deleteTaskTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new Queue(); - $expectedResponse->setName($name); + $expectedResponse = new GPBEmpty(); $transport->addResponse($expectedResponse); - // Mock request - $queue = new Queue(); - - $response = $client->updateQueue($queue); - $this->assertEquals($expectedResponse, $response); + $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $client->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/UpdateQueue', $actualFuncCall); - - $actualValue = $actualRequestObject->getQueue(); - - $this->assertProtobufEquals($queue, $actualValue); - + $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/DeleteTask', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function updateQueueExceptionTest() + public function deleteTaskExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $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(); - + $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); try { - $client->updateQueue($queue); + $client->deleteTask($formattedName); // If the $client 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()); @@ -380,68 +338,64 @@ public function updateQueueExceptionTest() /** * @test */ - public function deleteQueueTest() + public function getIamPolicyTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - - $client->deleteQueue($formattedName); + $resource = 'resource-341064690'; + $response = $client->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/DeleteQueue', $actualFuncCall); - - $actualValue = $actualRequestObject->getName(); - - $this->assertProtobufEquals($formattedName, $actualValue); - + $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function deleteQueueExceptionTest() + public function getIamPolicyExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - + $resource = 'resource-341064690'; try { - $client->deleteQueue($formattedName); + $client->getIamPolicy($resource); // If the $client 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()); @@ -450,71 +404,62 @@ public function deleteQueueExceptionTest() /** * @test */ - public function purgeQueueTest() + public function getQueueTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - - $response = $client->purgeQueue($formattedName); + $response = $client->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/PurgeQueue', $actualFuncCall); - + $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/GetQueue', $actualFuncCall); $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function purgeQueueExceptionTest() + public function getQueueExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - try { - $client->purgeQueue($formattedName); + $client->getQueue($formattedName); // If the $client 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()); @@ -523,71 +468,66 @@ public function purgeQueueExceptionTest() /** * @test */ - public function pauseQueueTest() + public function getTaskTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response $name2 = 'name2-1052831874'; - $expectedResponse = new Queue(); + $dispatchCount = 1217252086; + $responseCount = 424727441; + $expectedResponse = new Task(); $expectedResponse->setName($name2); + $expectedResponse->setDispatchCount($dispatchCount); + $expectedResponse->setResponseCount($responseCount); $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - - $response = $client->pauseQueue($formattedName); + $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + $response = $client->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/PauseQueue', $actualFuncCall); - + $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/GetTask', $actualFuncCall); $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function pauseQueueExceptionTest() + public function getTaskExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - + $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); try { - $client->pauseQueue($formattedName); + $client->getTask($formattedName); // If the $client 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()); @@ -596,71 +536,70 @@ public function pauseQueueExceptionTest() /** * @test */ - public function resumeQueueTest() + public function listQueuesTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new Queue(); - $expectedResponse->setName($name2); + $nextPageToken = ''; + $queuesElement = new Queue(); + $queues = [ + $queuesElement, + ]; + $expectedResponse = new ListQueuesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setQueues($queues); $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - - $response = $client->resumeQueue($formattedName); - $this->assertEquals($expectedResponse, $response); + $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); + $response = $client->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/ResumeQueue', $actualFuncCall); - - $actualValue = $actualRequestObject->getName(); - - $this->assertProtobufEquals($formattedName, $actualValue); - + $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/ListQueues', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function resumeQueueExceptionTest() + public function listQueuesExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - + $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); try { - $client->resumeQueue($formattedName); + $client->listQueues($formattedParent); // If the $client 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()); @@ -669,73 +608,70 @@ public function resumeQueueExceptionTest() /** * @test */ - public function getIamPolicyTest() + public function listTasksTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); + $nextPageToken = ''; + $tasksElement = new Task(); + $tasks = [ + $tasksElement, + ]; + $expectedResponse = new ListTasksResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTasks($tasks); $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - - $response = $client->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); + $formattedParent = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $response = $client->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/GetIamPolicy', $actualFuncCall); - - $actualValue = $actualRequestObject->getResource(); - - $this->assertProtobufEquals($resource, $actualValue); - + $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/ListTasks', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function getIamPolicyExceptionTest() + public function listTasksExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $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'; - + $formattedParent = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); try { - $client->getIamPolicy($resource); + $client->listTasks($formattedParent); // If the $client 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()); @@ -744,78 +680,62 @@ public function getIamPolicyExceptionTest() /** * @test */ - public function setIamPolicyTest() + public function pauseQueueTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); + $name2 = 'name2-1052831874'; + $expectedResponse = new Queue(); + $expectedResponse->setName($name2); $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - - $response = $client->setIamPolicy($resource, $policy); + $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $response = $client->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/SetIamPolicy', $actualFuncCall); - - $actualValue = $actualRequestObject->getResource(); - - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - - $this->assertProtobufEquals($policy, $actualValue); - + $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/PauseQueue', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function setIamPolicyExceptionTest() + public function pauseQueueExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $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(); - + $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); try { - $client->setIamPolicy($resource, $policy); + $client->pauseQueue($formattedName); // If the $client 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()); @@ -824,74 +744,62 @@ public function setIamPolicyExceptionTest() /** * @test */ - public function testIamPermissionsTest() + public function purgeQueueTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); + $name2 = 'name2-1052831874'; + $expectedResponse = new Queue(); + $expectedResponse->setName($name2); $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - - $response = $client->testIamPermissions($resource, $permissions); + $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $response = $client->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/TestIamPermissions', $actualFuncCall); - - $actualValue = $actualRequestObject->getResource(); - - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - - $this->assertProtobufEquals($permissions, $actualValue); - + $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/PurgeQueue', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function testIamPermissionsExceptionTest() + public function purgeQueueExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $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 = []; - + $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); try { - $client->testIamPermissions($resource, $permissions); + $client->purgeQueue($formattedName); // If the $client 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()); @@ -900,77 +808,62 @@ public function testIamPermissionsExceptionTest() /** * @test */ - public function listTasksTest() + public function resumeQueueTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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); + $name2 = 'name2-1052831874'; + $expectedResponse = new Queue(); + $expectedResponse->setName($name2); $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - - $response = $client->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]); - + $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); + $response = $client->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/ListTasks', $actualFuncCall); - - $actualValue = $actualRequestObject->getParent(); - - $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/ResumeQueue', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function listTasksExceptionTest() + public function resumeQueueExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedParent = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - + $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); try { - $client->listTasks($formattedParent); + $client->resumeQueue($formattedName); // If the $client 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()); @@ -979,13 +872,13 @@ public function listTasksExceptionTest() /** * @test */ - public function getTaskTest() + public function runTaskTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response $name2 = 'name2-1052831874'; $dispatchCount = 1217252086; @@ -995,59 +888,50 @@ public function getTaskTest() $expectedResponse->setDispatchCount($dispatchCount); $expectedResponse->setResponseCount($responseCount); $transport->addResponse($expectedResponse); - // Mock request $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - - $response = $client->getTask($formattedName); + $response = $client->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/GetTask', $actualFuncCall); - + $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/RunTask', $actualFuncCall); $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function getTaskExceptionTest() + public function runTaskExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - try { - $client->getTask($formattedName); + $client->runTask($formattedName); // If the $client 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()); @@ -1056,80 +940,68 @@ public function getTaskExceptionTest() /** * @test */ - public function createTaskTest() + public function setIamPolicyTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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); + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $task = new Task(); - - $response = $client->createTask($formattedParent, $task); + $resource = 'resource-341064690'; + $policy = new Policy(); + $response = $client->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/CreateTask', $actualFuncCall); - - $actualValue = $actualRequestObject->getParent(); - - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getTask(); - - $this->assertProtobufEquals($task, $actualValue); - + $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 createTaskExceptionTest() + public function setIamPolicyExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedParent = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $task = new Task(); - + $resource = 'resource-341064690'; + $policy = new Policy(); try { - $client->createTask($formattedParent, $task); + $client->setIamPolicy($resource, $policy); // If the $client 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()); @@ -1138,68 +1010,64 @@ public function createTaskExceptionTest() /** * @test */ - public function deleteTaskTest() + public function testIamPermissionsTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); + $expectedResponse = new TestIamPermissionsResponse(); $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - - $client->deleteTask($formattedName); + $resource = 'resource-341064690'; + $permissions = []; + $response = $client->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/DeleteTask', $actualFuncCall); - - $actualValue = $actualRequestObject->getName(); - - $this->assertProtobufEquals($formattedName, $actualValue); - + $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 deleteTaskExceptionTest() + public function testIamPermissionsExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - + $resource = 'resource-341064690'; + $permissions = []; try { - $client->deleteTask($formattedName); + $client->testIamPermissions($resource, $permissions); // If the $client 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()); @@ -1208,75 +1076,62 @@ public function deleteTaskExceptionTest() /** * @test */ - public function runTaskTest() + public function updateQueueTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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); + $name = 'name3373707'; + $expectedResponse = new Queue(); + $expectedResponse->setName($name); $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - - $response = $client->runTask($formattedName); + $queue = new Queue(); + $response = $client->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/RunTask', $actualFuncCall); - - $actualValue = $actualRequestObject->getName(); - - $this->assertProtobufEquals($formattedName, $actualValue); - + $this->assertSame('/google.cloud.tasks.v2beta3.CloudTasks/UpdateQueue', $actualFuncCall); + $actualValue = $actualRequestObject->getQueue(); + $this->assertProtobufEquals($queue, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function runTaskExceptionTest() + public function updateQueueExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $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' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - + $queue = new Queue(); try { - $client->runTask($formattedName); + $client->updateQueue($queue); // If the $client 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/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 7572e8a8e468..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\'AA!cloudtasks.googleapis.com/Queue -filter (  - page_size ( - -page_token ( "[ -ListQueuesResponse, -queues ( 2.google.cloud.tasks.v2.Queue -next_page_token ( "H -GetQueueRequest5 -name ( B\'AA! -cloudtasks.googleapis.com/Queue" -CreateQueueRequest7 -parent ( B\'AA!cloudtasks.googleapis.com/Queue0 -queue ( 2.google.cloud.tasks.v2.QueueBA"w -UpdateQueueRequest0 -queue ( 2.google.cloud.tasks.v2.QueueBA/ - update_mask ( 2.google.protobuf.FieldMask"K -DeleteQueueRequest5 -name ( B\'AA! -cloudtasks.googleapis.com/Queue"J -PurgeQueueRequest5 -name ( B\'AA! -cloudtasks.googleapis.com/Queue"J -PauseQueueRequest5 -name ( B\'AA! -cloudtasks.googleapis.com/Queue"K -ResumeQueueRequest5 -name ( B\'AA! -cloudtasks.googleapis.com/Queue" -ListTasksRequest6 -parent ( B&AA 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&AA -cloudtasks.googleapis.com/Task7 - response_view (2 .google.cloud.tasks.v2.Task.View" -CreateTaskRequest6 -parent ( B&AA cloudtasks.googleapis.com/Task. -task ( 2.google.cloud.tasks.v2.TaskBA7 - response_view (2 .google.cloud.tasks.v2.Task.View"I -DeleteTaskRequest4 -name ( B&AA -cloudtasks.googleapis.com/Task" -RunTaskRequest4 -name ( B&AA -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/*}/queuesAparent -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"H3"*/v2/{parent=projects/*/locations/*}/queues:queueA parent,queue - UpdateQueue).google.cloud.tasks.v2.UpdateQueueRequest.google.cloud.tasks.v2.Queue"S920/v2/{queue.name=projects/*/locations/*/queues/*}:queueAqueue,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"B5"0/v2/{name=projects/*/locations/*/queues/*}:purge:*Aname - -PauseQueue(.google.cloud.tasks.v2.PauseQueueRequest.google.cloud.tasks.v2.Queue"B5"0/v2/{name=projects/*/locations/*/queues/*}:pause:*Aname - ResumeQueue).google.cloud.tasks.v2.ResumeQueueRequest.google.cloud.tasks.v2.Queue"C6"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"cF"A/v2/{resource=projects/*/locations/*/queues/*}:testIamPermissions:*Aresource,permissions - ListTasks\'.google.cloud.tasks.v2.ListTasksRequest(.google.cloud.tasks.v2.ListTasksResponse"C42/v2/{parent=projects/*/locations/*/queues/*}/tasksAparent -GetTask%.google.cloud.tasks.v2.GetTaskRequest.google.cloud.tasks.v2.Task"A42/v2/{name=projects/*/locations/*/queues/*/tasks/*}Aname - -CreateTask(.google.cloud.tasks.v2.CreateTaskRequest.google.cloud.tasks.v2.Task"K7"2/v2/{parent=projects/*/locations/*/queues/*}/tasks:*A parent,task - -DeleteTask(.google.cloud.tasks.v2.DeleteTaskRequest.google.protobuf.Empty"A4*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:*AnameMAcloudtasks.googleapis.comA.https://www.googleapis.com/auth/cloud-platformBr -com.google.cloud.tasks.v2BCloudTasksProtoPZ:google.golang.org/genproto/googleapis/cloud/tasks/v2;tasksTASKSbproto3' - , 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 b0cc4d5fdb0bedd0890d7f145fd1b0e3706ecf22..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2066 zcmbVNVQ(8X7$#fOQKwAfL{VB0bHk)&65NR(CX`Z8+GJIv(uO2O8anB8xpS`GF80m# zRg5Zsihsff{sg~**Y;hSb}5_4mt1nsWBYxc$M5^YPuWF=zQo6b5fLg9Dd_fy8ZDkP$kbrMA|svJV}Wcr96*470OrAyKH%{ zbCMI+tcDN^XGCUUMDX$8@MogJI8>p3Y>57mCi-Jd^nY#bBNU~fl=v6D0J=gLK3P6V zX@sQ;6?{FRGN6nq8m9CQIQapdhN&dLd>cE>S)?duSQE}zM4C^rT~lM9WE?6zz~xZ} zx_Btu?=wXN3sb*KWF%;&xEKJm-A;&FNT&a3J}tJ@%h4%r+B3G>ZyoXgE0L4s-7ywK z<$~>-bL$1>izk1DP@RnWLsH1zzAosRzlwEJUeH-U4ej@)FC^*akP}eye^AF1>{sC| zdw;I3wZjG^wu{V&g8Nh8`KD^9`!%YeVW)pge5d zMKQIzBaL)igt8ox9B2va>t?H+a;s8*cM&{igmz$y=v6Ez=n|wn0kM+us2hgwmHeC5 z>m5ttiRIaIH+raQPqT$S9*sNWUT}Uo8uX6(&-=aZqYs=KdN4dcJ?)EnRh&=JLk*eaLaIPQ zi!~9dIt3MwQ7!~wYH1Y{lWOCy3aSm4oc#oC>ZL-Z$Si{}>A+T&POI$7zFColS?_KBM)_C1FIhm{* e*tdI&M)#E+GD|ZFQV%n8#XK@dJ38iQj?ll;oS_N; 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 6b28eebeb65599e4490c3872da4055a564477ab4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1844 zcmb7FU2o$=6y1EZ+1v!MtS*EFq}l9B%_4B5Afd|L0!iaGk=VxCdU-&Rtcg8IMs;V* zcpRyV`g?fi7r{Sa#x_aWCKUW)Ykba~bMLux=hgS|GKS~qoG>D=Bq5sJAh{$c7F_ax zM`)JL=R}}@U&k~e!a`^`K^GGbIm5B{Oi>e_ih$T?!TBO0-5}y=*p)cBO1i6_`Vb2u ztt=b>!`CEj1awuj!Ub^LL7AhxWtnn@@6#m34@fb%?d1p8Tk;(u# z4TFNXpApdxF%tzWcuy^8{zFd#Dp%wtuZ{Tu?5%K=lB^(gyL?m{d<+L#AQ$vq=Dwfj z-~PP}2mLs9*n%>0x7hEMRu}z0mG%@&9LGM%0{VidlCni6q|uum?#OJd;7yJ<51=VX zq?E3Rp9-p6Ql6XRjcwJ;wxfsQ-N|UXf7+_%|E*@*1LL0LkD!(iv7!MfTu=)u)nV$W z$ry(U;hdwg(FB5<}r{gpDWaN3S|Jw0JlcE3i;?i|a$7f?_Xgo3>L)D#J zdPd2tLFL@>jIv%DIsKtg(M#@I�OJ`$OkP$8(H5vkrT1-#Z-{`(^`b6W1G0E-sDQ zU=E+En`OI$gGN63vsvtxezuDvz2FgM3yX_IcR^Tovvl)cYJ?>3T|md#oSE%sux}36 Xlk2N|2;Z66JLh$V%%|!t+yeXsn(iy+ diff --git a/owl-bot-staging/Tasks/v2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2/Task.php b/owl-bot-staging/Tasks/v2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2/Task.php deleted file mode 100644 index b533045336449dfe1cd0c0b590d94f5e29543322..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2105 zcmbVN|8Cnh5Ux9?t(i2-gspXhA>+IPb-=bf=^qi~eMjDX-`)NAvzQ3<9o}UzONnFwKKX#JNFdHFT)t$aLWi)u zVJul1lgR6{jHX=3BprdN>xN8L2~#`mr^U6(9UtSid86xIc;ptAY0f^r9pjYAJdHQ? zyOo1kwel{>Q&({BfE7u1=K;;}m!TH33u#Uv2KUDBDkc3KR05g&AJ8KX>`QVgZjL<= z)H?*a^X%prm7i`LCrTwrd<9Tb{=-kaAh;U@6`wnx@^;05;^PVWyMeBixAm1N09zM; ztqZ_D>#Vn~std({sf_iF!baB#D9;IsG#BUJoIjUkE(?Q)g+VH)qqLW2#lhFb0TJ9G z^Q@TD)?Z7gt_sXrL3LG}%^I$?8`d6rNQCfN9P*g?6DftCviCW#*Srk|%bjPoaeFRS zyDP*%gI)vXz(8K#vRt&X;N&yyq;-XpMeK8QKcf>C=&6~B` z?&RMtLmT?lM(jotptQ_}Y2j#LZ392QF)A}>TC8SHlu%Qf&a_<49FP|X%$e%{te78D z<#^UxMJv!cG7G`!SHIlW|XX-hL>W@v`ce{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 will fail - * 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 documentation for the request handlers in the language your app is - * written in e.g. - * [Python Request - * Handler](https://cloud.google.com/appengine/docs/python/tools/webapp/requesthandlerclass). - * - * 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][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][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 will fail - * 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 documentation for the request handlers in the language your app is - * written in e.g. - * [Python Request - * Handler](https://cloud.google.com/appengine/docs/python/tools/webapp/requesthandlerclass). - * @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][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][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 will fail - * 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 documentation for the request handlers in the language your app is - * written in e.g. - * [Python Request - * Handler](https://cloud.google.com/appengine/docs/python/tools/webapp/requesthandlerclass). - * - * 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 will fail - * 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 documentation for the request handlers in the language your app is - * written in e.g. - * [Python Request - * Handler](https://cloud.google.com/appengine/docs/python/tools/webapp/requesthandlerclass). - * - * 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][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][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][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][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 2aa2abaf387c..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/AppEngineRouting.php +++ /dev/null @@ -1,361 +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/CloudTasksGrpcClient.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/CloudTasksGrpcClient.php deleted file mode 100644 index aecebe48a9b1..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/CloudTasksGrpcClient.php +++ /dev/null @@ -1,402 +0,0 @@ -_simpleRequest('/google.cloud.tasks.v2.CloudTasks/ListQueues', - $argument, - ['\Google\Cloud\Tasks\V2\ListQueuesResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a queue. - * @param \Google\Cloud\Tasks\V2\GetQueueRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetQueue(\Google\Cloud\Tasks\V2\GetQueueRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2.CloudTasks/GetQueue', - $argument, - ['\Google\Cloud\Tasks\V2\Queue', 'decode'], - $metadata, $options); - } - - /** - * 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. - * @param \Google\Cloud\Tasks\V2\CreateQueueRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateQueue(\Google\Cloud\Tasks\V2\CreateQueueRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2.CloudTasks/CreateQueue', - $argument, - ['\Google\Cloud\Tasks\V2\Queue', 'decode'], - $metadata, $options); - } - - /** - * 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. - * @param \Google\Cloud\Tasks\V2\UpdateQueueRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateQueue(\Google\Cloud\Tasks\V2\UpdateQueueRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2.CloudTasks/UpdateQueue', - $argument, - ['\Google\Cloud\Tasks\V2\Queue', 'decode'], - $metadata, $options); - } - - /** - * 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. - * @param \Google\Cloud\Tasks\V2\DeleteQueueRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteQueue(\Google\Cloud\Tasks\V2\DeleteQueueRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2.CloudTasks/DeleteQueue', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * 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. - * @param \Google\Cloud\Tasks\V2\PurgeQueueRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function PurgeQueue(\Google\Cloud\Tasks\V2\PurgeQueueRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2.CloudTasks/PurgeQueue', - $argument, - ['\Google\Cloud\Tasks\V2\Queue', 'decode'], - $metadata, $options); - } - - /** - * 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]. - * @param \Google\Cloud\Tasks\V2\PauseQueueRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function PauseQueue(\Google\Cloud\Tasks\V2\PauseQueueRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2.CloudTasks/PauseQueue', - $argument, - ['\Google\Cloud\Tasks\V2\Queue', 'decode'], - $metadata, $options); - } - - /** - * 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). - * @param \Google\Cloud\Tasks\V2\ResumeQueueRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ResumeQueue(\Google\Cloud\Tasks\V2\ResumeQueueRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2.CloudTasks/ResumeQueue', - $argument, - ['\Google\Cloud\Tasks\V2\Queue', 'decode'], - $metadata, $options); - } - - /** - * 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` - * @param \Google\Cloud\Iam\V1\GetIamPolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetIamPolicy(\Google\Cloud\Iam\V1\GetIamPolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2.CloudTasks/GetIamPolicy', - $argument, - ['\Google\Cloud\Iam\V1\Policy', 'decode'], - $metadata, $options); - } - - /** - * 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` - * @param \Google\Cloud\Iam\V1\SetIamPolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function SetIamPolicy(\Google\Cloud\Iam\V1\SetIamPolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2.CloudTasks/SetIamPolicy', - $argument, - ['\Google\Cloud\Iam\V1\Policy', 'decode'], - $metadata, $options); - } - - /** - * 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. - * @param \Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function TestIamPermissions(\Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2.CloudTasks/TestIamPermissions', - $argument, - ['\Google\Cloud\Iam\V1\TestIamPermissionsResponse', 'decode'], - $metadata, $options); - } - - /** - * 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. - * @param \Google\Cloud\Tasks\V2\ListTasksRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListTasks(\Google\Cloud\Tasks\V2\ListTasksRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2.CloudTasks/ListTasks', - $argument, - ['\Google\Cloud\Tasks\V2\ListTasksResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a task. - * @param \Google\Cloud\Tasks\V2\GetTaskRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetTask(\Google\Cloud\Tasks\V2\GetTaskRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2.CloudTasks/GetTask', - $argument, - ['\Google\Cloud\Tasks\V2\Task', 'decode'], - $metadata, $options); - } - - /** - * 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. - * @param \Google\Cloud\Tasks\V2\CreateTaskRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateTask(\Google\Cloud\Tasks\V2\CreateTaskRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2.CloudTasks/CreateTask', - $argument, - ['\Google\Cloud\Tasks\V2\Task', 'decode'], - $metadata, $options); - } - - /** - * 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. - * @param \Google\Cloud\Tasks\V2\DeleteTaskRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteTask(\Google\Cloud\Tasks\V2\DeleteTaskRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2.CloudTasks/DeleteTask', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * 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. - * @param \Google\Cloud\Tasks\V2\RunTaskRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function RunTask(\Google\Cloud\Tasks\V2\RunTaskRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2.CloudTasks/RunTask', - $argument, - ['\Google\Cloud\Tasks\V2\Task', 'decode'], - $metadata, $options); - } - -} 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 914909a7e157..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/CreateQueueRequest.php +++ /dev/null @@ -1,131 +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; - - /** - * 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 aed43430b056..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/CreateTaskRequest.php +++ /dev/null @@ -1,297 +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; - - /** - * 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 6ebae01632af..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/DeleteQueueRequest.php +++ /dev/null @@ -1,71 +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 = ''; - - /** - * 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 167321f647b5..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/DeleteTaskRequest.php +++ /dev/null @@ -1,72 +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 = ''; - - /** - * 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 917ce94efd88..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/GetQueueRequest.php +++ /dev/null @@ -1,71 +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 = ''; - - /** - * 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 3387ee43a453..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/GetTaskRequest.php +++ /dev/null @@ -1,141 +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; - - /** - * 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 5f58385a81ce..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/HttpRequest.php +++ /dev/null @@ -1,414 +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 5c87912e290c..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ListQueuesRequest.php +++ /dev/null @@ -1,249 +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 = ''; - - /** - * 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 48d28798fbc6..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ListQueuesResponse.php +++ /dev/null @@ -1,121 +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 \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 \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 76ee4a430783..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ListTasksRequest.php +++ /dev/null @@ -1,253 +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 = ''; - - /** - * 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 31ab5b1644e9..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ListTasksResponse.php +++ /dev/null @@ -1,117 +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 \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 \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 63272222819e..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/PauseQueueRequest.php +++ /dev/null @@ -1,71 +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 = ''; - - /** - * 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 590ea88f7c09..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/PurgeQueueRequest.php +++ /dev/null @@ -1,71 +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 = ''; - - /** - * 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 48e239b4f191..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Queue.php +++ /dev/null @@ -1,579 +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 called - * [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 called - * [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 called - * [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 called - * [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/Queue_State.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Queue_State.php deleted file mode 100644 index fb750035b8bf..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Queue_State.php +++ /dev/null @@ -1,16 +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 99fa482f4453..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/ResumeQueueRequest.php +++ /dev/null @@ -1,71 +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 = ''; - - /** - * 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 11748103a51f..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/RetryConfig.php +++ /dev/null @@ -1,478 +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 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 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 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 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 feaaa63724bc..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/RunTaskRequest.php +++ /dev/null @@ -1,142 +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; - - /** - * 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 63397eb4a3bc..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Task.php +++ /dev/null @@ -1,662 +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 listing 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 listing 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 listing 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 listing 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 bc3e4647cee4..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Task/View.php +++ /dev/null @@ -1,78 +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/Task_View.php b/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Task_View.php deleted file mode 100644 index a1ccba180953..000000000000 --- a/owl-bot-staging/Tasks/v2/proto/src/Google/Cloud/Tasks/V2/Task_View.php +++ /dev/null @@ -1,16 +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; - - /** - * 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/src/V2/CloudTasksClient.php b/owl-bot-staging/Tasks/v2/src/V2/CloudTasksClient.php deleted file mode 100644 index 711c73151899..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. - */ -class CloudTasksGapicClient -{ - use GapicClientTrait; - - /** - * The name of the service. - */ - const SERVICE_NAME = 'google.cloud.tasks.v2.CloudTasks'; - - /** - * The default address of the service. - */ - const SERVICE_ADDRESS = 'cloudtasks.googleapis.com'; - - /** - * 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, - 'serviceAddress' => 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 $serviceAddress - * 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 - * $serviceAddress 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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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`. This field is only used by Cloud IAM. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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 RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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; - $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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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(); - } -} 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 4bae73ae12b6..000000000000 --- a/owl-bot-staging/Tasks/v2/src/V2/resources/cloud_tasks_client_config.json +++ /dev/null @@ -1,125 +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": 10000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 10000, - "total_timeout_millis": 10000 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 10000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 10000, - "total_timeout_millis": 10000 - } - }, - "methods": { - "CreateQueue": { - "timeout_millis": 10000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "CreateTask": { - "timeout_millis": 10000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteQueue": { - "timeout_millis": 10000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "DeleteTask": { - "timeout_millis": 10000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetIamPolicy": { - "timeout_millis": 10000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetQueue": { - "timeout_millis": 10000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetTask": { - "timeout_millis": 10000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListQueues": { - "timeout_millis": 10000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListTasks": { - "timeout_millis": 10000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "PauseQueue": { - "timeout_millis": 10000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "PurgeQueue": { - "timeout_millis": 10000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "ResumeQueue": { - "timeout_millis": 10000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "RunTask": { - "timeout_millis": 10000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "SetIamPolicy": { - "timeout_millis": 10000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "TestIamPermissions": { - "timeout_millis": 10000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "UpdateQueue": { - "timeout_millis": 10000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_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 f96345a0f259..000000000000 --- a/owl-bot-staging/Tasks/v2/src/V2/resources/cloud_tasks_descriptor_config.php +++ /dev/null @@ -1,28 +0,0 @@ - [ - 'google.cloud.tasks.v2.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', - ], - ], - ], - ], -]; 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 5f0644a0be9d..000000000000 --- a/owl-bot-staging/Tasks/v2/src/V2/resources/cloud_tasks_rest_client_config.php +++ /dev/null @@ -1,195 +0,0 @@ - [ - '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', - ], - ], - ], - ], - ], - ], -]; 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 763123be80d3..000000000000 --- a/owl-bot-staging/Tasks/v2/tests/Unit/V2/CloudTasksClientTest.php +++ /dev/null @@ -1,1139 +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(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new Queue(); - $expectedResponse->setName($name); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); - $queue = new Queue(); - $response = $client->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(); - $client = $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 = $client->locationName('[PROJECT]', '[LOCATION]'); - $queue = new Queue(); - try { - $client->createQueue($formattedParent, $queue); - // If the $client 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(); - $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $task = new Task(); - $response = $client->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(); - $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $task = new Task(); - try { - $client->createTask($formattedParent, $task); - // If the $client 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(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $client->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(); - $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - try { - $client->deleteQueue($formattedName); - // If the $client 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(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - $client->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(); - $client = $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 = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - try { - $client->deleteTask($formattedName); - // If the $client 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(); - $client = $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 = $client->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(); - $client = $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 { - $client->getIamPolicy($resource); - // If the $client 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(); - $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $response = $client->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(); - $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - try { - $client->getQueue($formattedName); - // If the $client 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(); - $client = $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 = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - $response = $client->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(); - $client = $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 = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - try { - $client->getTask($formattedName); - // If the $client 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(); - $client = $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 = $client->locationName('[PROJECT]', '[LOCATION]'); - $response = $client->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(); - $client = $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 = $client->locationName('[PROJECT]', '[LOCATION]'); - try { - $client->listQueues($formattedParent); - // If the $client 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(); - $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $response = $client->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(); - $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - try { - $client->listTasks($formattedParent); - // If the $client 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(); - $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $response = $client->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(); - $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - try { - $client->pauseQueue($formattedName); - // If the $client 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(); - $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $response = $client->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(); - $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - try { - $client->purgeQueue($formattedName); - // If the $client 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(); - $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $response = $client->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(); - $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - try { - $client->resumeQueue($formattedName); - // If the $client 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(); - $client = $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 = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - $response = $client->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(); - $client = $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 = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - try { - $client->runTask($formattedName); - // If the $client 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(); - $client = $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 = $client->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(); - $client = $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 { - $client->setIamPolicy($resource, $policy); - // If the $client 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(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $client->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(); - $client = $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 { - $client->testIamPermissions($resource, $permissions); - // If the $client 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(); - $client = $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 = $client->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(); - $client = $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 { - $client->updateQueue($queue); - // If the $client 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 5767544c54cb..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta2/Cloudtasks.php +++ /dev/null @@ -1,147 +0,0 @@ -internalAddGeneratedFile( - ' -5 -+google/cloud/tasks/v2beta2/cloudtasks.protogoogle.cloud.tasks.v2beta2google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto&google/cloud/tasks/v2beta2/queue.proto%google/cloud/tasks/v2beta2/task.protogoogle/iam/v1/iam_policy.protogoogle/iam/v1/policy.protogoogle/protobuf/duration.protogoogle/protobuf/empty.proto google/protobuf/field_mask.protogoogle/protobuf/timestamp.proto" -ListQueuesRequest7 -parent ( B\'AA!cloudtasks.googleapis.com/Queue -filter (  - page_size ( - -page_token ( 2 - read_mask ( 2.google.protobuf.FieldMaskBA"` -ListQueuesResponse1 -queues ( 2!.google.cloud.tasks.v2beta2.Queue -next_page_token ( "| -GetQueueRequest5 -name ( B\'AA! -cloudtasks.googleapis.com/Queue2 - read_mask ( 2.google.protobuf.FieldMaskBA" -CreateQueueRequest7 -parent ( B\'AA!cloudtasks.googleapis.com/Queue5 -queue ( 2!.google.cloud.tasks.v2beta2.QueueBA"| -UpdateQueueRequest5 -queue ( 2!.google.cloud.tasks.v2beta2.QueueBA/ - update_mask ( 2.google.protobuf.FieldMask"K -DeleteQueueRequest5 -name ( B\'AA! -cloudtasks.googleapis.com/Queue"J -PurgeQueueRequest5 -name ( B\'AA! -cloudtasks.googleapis.com/Queue"J -PauseQueueRequest5 -name ( B\'AA! -cloudtasks.googleapis.com/Queue"K -ResumeQueueRequest5 -name ( B\'AA! -cloudtasks.googleapis.com/Queue" -ListTasksRequest6 -parent ( B&AA cloudtasks.googleapis.com/Task< - response_view (2%.google.cloud.tasks.v2beta2.Task.View - page_size ( - -page_token ( "] -ListTasksResponse/ -tasks ( 2 .google.cloud.tasks.v2beta2.Task -next_page_token ( " -GetTaskRequest4 -name ( B&AA -cloudtasks.googleapis.com/Task< - response_view (2%.google.cloud.tasks.v2beta2.Task.View" -CreateTaskRequest6 -parent ( B&AA cloudtasks.googleapis.com/Task3 -task ( 2 .google.cloud.tasks.v2beta2.TaskBA< - response_view (2%.google.cloud.tasks.v2beta2.Task.View"I -DeleteTaskRequest4 -name ( B&AA -cloudtasks.googleapis.com/Task" -LeaseTasksRequest6 -parent ( B&AA cloudtasks.googleapis.com/Task - max_tasks (6 -lease_duration ( 2.google.protobuf.DurationBA< - response_view (2%.google.cloud.tasks.v2beta2.Task.View -filter ( "E -LeaseTasksResponse/ -tasks ( 2 .google.cloud.tasks.v2beta2.Task" -AcknowledgeTaskRequest4 -name ( B&AA -cloudtasks.googleapis.com/Task6 - schedule_time ( 2.google.protobuf.TimestampBA" -RenewLeaseRequest4 -name ( B&AA -cloudtasks.googleapis.com/Task6 - schedule_time ( 2.google.protobuf.TimestampBA6 -lease_duration ( 2.google.protobuf.DurationBA< - response_view (2%.google.cloud.tasks.v2beta2.Task.View" -CancelLeaseRequest4 -name ( B&AA -cloudtasks.googleapis.com/Task6 - schedule_time ( 2.google.protobuf.TimestampBA< - response_view (2%.google.cloud.tasks.v2beta2.Task.View" -RunTaskRequest4 -name ( B&AA -cloudtasks.googleapis.com/Task< - response_view (2%.google.cloud.tasks.v2beta2.Task.View2 - -CloudTasks - -ListQueues-.google.cloud.tasks.v2beta2.ListQueuesRequest..google.cloud.tasks.v2beta2.ListQueuesResponse"@1//v2beta2/{parent=projects/*/locations/*}/queuesAparent -GetQueue+.google.cloud.tasks.v2beta2.GetQueueRequest!.google.cloud.tasks.v2beta2.Queue">1//v2beta2/{name=projects/*/locations/*/queues/*}Aname - CreateQueue..google.cloud.tasks.v2beta2.CreateQueueRequest!.google.cloud.tasks.v2beta2.Queue"M8"//v2beta2/{parent=projects/*/locations/*}/queues:queueA parent,queue - UpdateQueue..google.cloud.tasks.v2beta2.UpdateQueueRequest!.google.cloud.tasks.v2beta2.Queue"X>25/v2beta2/{queue.name=projects/*/locations/*/queues/*}:queueAqueue,update_mask - DeleteQueue..google.cloud.tasks.v2beta2.DeleteQueueRequest.google.protobuf.Empty">1*//v2beta2/{name=projects/*/locations/*/queues/*}Aname - -PurgeQueue-.google.cloud.tasks.v2beta2.PurgeQueueRequest!.google.cloud.tasks.v2beta2.Queue"G:"5/v2beta2/{name=projects/*/locations/*/queues/*}:purge:*Aname - -PauseQueue-.google.cloud.tasks.v2beta2.PauseQueueRequest!.google.cloud.tasks.v2beta2.Queue"G:"5/v2beta2/{name=projects/*/locations/*/queues/*}:pause:*Aname - ResumeQueue..google.cloud.tasks.v2beta2.ResumeQueueRequest!.google.cloud.tasks.v2beta2.Queue"H;"6/v2beta2/{name=projects/*/locations/*/queues/*}:resume:*Aname - GetIamPolicy".google.iam.v1.GetIamPolicyRequest.google.iam.v1.Policy"VE"@/v2beta2/{resource=projects/*/locations/*/queues/*}:getIamPolicy:*Aresource - SetIamPolicy".google.iam.v1.SetIamPolicyRequest.google.iam.v1.Policy"]E"@/v2beta2/{resource=projects/*/locations/*/queues/*}:setIamPolicy:*Aresource,policy -TestIamPermissions(.google.iam.v1.TestIamPermissionsRequest).google.iam.v1.TestIamPermissionsResponse"hK"F/v2beta2/{resource=projects/*/locations/*/queues/*}:testIamPermissions:*Aresource,permissions - ListTasks,.google.cloud.tasks.v2beta2.ListTasksRequest-.google.cloud.tasks.v2beta2.ListTasksResponse"H97/v2beta2/{parent=projects/*/locations/*/queues/*}/tasksAparent -GetTask*.google.cloud.tasks.v2beta2.GetTaskRequest .google.cloud.tasks.v2beta2.Task"F97/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}Aname - -CreateTask-.google.cloud.tasks.v2beta2.CreateTaskRequest .google.cloud.tasks.v2beta2.Task"P<"7/v2beta2/{parent=projects/*/locations/*/queues/*}/tasks:*A parent,task - -DeleteTask-.google.cloud.tasks.v2beta2.DeleteTaskRequest.google.protobuf.Empty"F9*7/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}Aname - -LeaseTasks-.google.cloud.tasks.v2beta2.LeaseTasksRequest..google.cloud.tasks.v2beta2.LeaseTasksResponse"`B"=/v2beta2/{parent=projects/*/locations/*/queues/*}/tasks:lease:*Aparent,lease_duration -AcknowledgeTask2.google.cloud.tasks.v2beta2.AcknowledgeTaskRequest.google.protobuf.Empty"cH"C/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:acknowledge:*Aname,schedule_time - -RenewLease-.google.cloud.tasks.v2beta2.RenewLeaseRequest .google.cloud.tasks.v2beta2.Task"qG"B/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:renewLease:*A!name,schedule_time,lease_duration - CancelLease..google.cloud.tasks.v2beta2.CancelLeaseRequest .google.cloud.tasks.v2beta2.Task"cH"C/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:cancelLease:*Aname,schedule_time -RunTask*.google.cloud.tasks.v2beta2.RunTaskRequest .google.cloud.tasks.v2beta2.Task"M@";/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:run:*AnameMAcloudtasks.googleapis.comA.https://www.googleapis.com/auth/cloud-platformB| -com.google.cloud.tasks.v2beta2BCloudTasksProtoPZ?google.golang.org/genproto/googleapis/cloud/tasks/v2beta2;tasksTASKSbproto3' - , 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 b0d678135b6d9ffbae2bd41a71c1b5ba3bbb329d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2596 zcmbVO(M}sj6pbM!xlxn5bdUtH5tamoM zvnUk#p`X!T>r)@Aens!htc_J%gMx&xnRD*UoO{m9{P;3Hi{VRhKqH!Xf(E2}NyHf? zal!@nc}TihuSXN&^Fho)nplK1j>zFrhcp|l&KF2cd6xLJO8T7lLu&gW&jMR`>3M2j zRJv4n75jZgGis@l0FgJKY3%uw9JK2{<9Of+&pA+RXHT-7j$}J;D|N}<0q{dFP01Ts z1+IYLPn>l_=95%-0{=W^smmfJm>06&a1Xnr=Y=Un=1pubi+sU&L?q!T@@e@w(KRLZ zY0PoYyJWPUwv+)Sa9WX|N#uo2gQkAMV!@L(LaWt26=U(_f6CAEX=ORqBW1nDYW2n< zcZokkqXNp?2m^u55hC!X4c^8Z))#~-Gu8aI1^_b?pyEAJ_ zd$3svYH;_N$C5TObR2f#Bd8sQ9unRlzB^ZHRf{4n9mAt^I#IR%+n-q8>{<|vd%KVB zFORz+d$SFHEW@+A+1^;!I7`LDQt`0zc&tCpYj`oUle{N7E$hzqjQT<;pCg~-K$S9d ztR3X?=Hr|H9Ty`FbHK*LD!gl<^yt=~MJTEO8cT3rM%XNnLiwTb2G+bdc4^dS5p~am zh+Vxba~{V_72DEfr)}J-#c@*+Um;KX=+!-A7fNv!hNC+7Rh?(E>a-C)rtd&Wo@8#w z227-8@pk$#!e1*i&b@>YOfFrYM?Kaz7Zlsso;CZiB#N#FffyqSDhk zk$A%bh%*e5E8Ai&s%h6pvyOUdjeT!?4U5u5t`MR5P@x~+K#u}udODPzPfj|uPSZU-JZU%gTKlbLWA&a&Vu2e1YQp zN_~;qSNW%*9dci%+`bxp9O_F5QSaq7GORB{NgLG_moeQs2bi#dvkjXA?*m#8FCsT! zcwY(sj0SE@6E~%3jzIapV64H41a`9|6>f^Rk2!~m6^#w}RQ?~4ewHLO61tX3MRDu* zIVerqW(}4k+7p5fVl=JHRuQAH0Y(-nBjeoTQ8~jRj{X3KWNE{W;-2Sjh8rv>4OrxM zJ^!5ddZy0TEqJ-b9Ipd41OEt?<+1`U@93zXst^_HE3g!0gYho5{w@GqTgNbEKcw0| z&my4|m{)!>_Th6L26*1P_{#>E7Stk1*oB8@giMRnqg0uZ7F`FMx=ue(Ka&OUMIl_2 z0l(xk%JV9pu?(M0G;ZAf(b}Y9Ir1woDZY>JMR7r0T^w&0R~|s>l~h-V@Cm< zatGA46m9w3XcvBYnID>c9(qyV;z{4`(?}fy_H_!Ty|s3fh}{K+{eF9VVSS??8xwC6 Tc}_8Z%DY4%_3L2>Lx6t)9&k$g 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 8d6af065b9e7a0a494e0a132954fea94436c580a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1466 zcmb7EZEq7f5GGAu=p;b2AW?yIG6B)>wvoaYlwLt8S(-|;Szx&j$4Zg2nQSb!w$JuP z>Ye)U_#ONf?A=@_YN;S!5>MuNW}bQM`SX>WNw`n;k)xspCuDp=%nXTC!iYp8e-PcXP%UzmV3(vqq#3r8OyrZcq589K&pTr@v|~>yMdKHo z0GuA9mNY@KAMPF6gb6h?-Y?+sYX^@b2ao^i>^b-jK$20dNmS6le?aU<=HrYdL>p@C z*8`?Uj5EV%#{RV`cFB}x8ZGpE?lk9#VS*C}81e*Lk4VYsavw-xRqvAj8w%YZ>=5Du zZcuTW#eLL?V$ui|+SG2>N?VT4MOu#*WgQ)xl2+Mcw|lP1U1C&@XR8yU(Bz8m6n#5_ z)8()Df^qdEi+h|4HwD3UxBFewcZx#NvzKfkpf{N;`+Z|QZ7nOfdfV`I9pdd@bkn<2 zCi;c#eqp=6u)SFa2=go}ZEHS(nmZk$)-*-$25d-rk_kH5s*p;n?$w}bXu7px51Y*y z-0Vpi@RV^J7$Zv#?;YHwQjV~QkCey_i@haf64m31UJ8|z^!G_ zm3oi=EhC|B85 z)y>B{f{hu{2`as{N~*0|XZNzkF4E@@N_@bLIyvjcnseih5A`1stUI6aq?qugcMaC& zG|RCxtGn`|(u|<7tg;xbBh{$pEGeDYbOCFXwl}pzdJVYBxP2b>5iW$)VRa_7v8t@h z$DaVs4D~MD9z;<%It-%0us`~E^dSshAG|pT`i(2zRagy&AEHLZ+konR5H(g@Xb|-J zjj9WUAEU;q2e94`-Ud<7Slg5EhuvzI%x$k$Ub|uigq6QvE$&q+GRjk5sI;9TFSc5{ o{EJGaFWP`R#lsk{7rD>3mk;h~xd6`Wi=Xa_BC~wcr*I1J4N3RII{*Lx diff --git a/owl-bot-staging/Tasks/v2beta2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta2/Task.php b/owl-bot-staging/Tasks/v2beta2/proto/src/GPBMetadata/Google/Cloud/Tasks/V2Beta2/Task.php deleted file mode 100644 index 0d0a79570eaf865aecdea34f0bb02e1c4c221999..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2146 zcma)7(Qex|6sx9DJvP`IrfWW@t#B8bI-l}VPB3U`U)Sjlx0M-0q$R7Jz`j9 zLJKMq+|P$YmSHN!k|!+lF+M!OZ%@u~=dgSJB|w$PGs>Dc79vhqKogM<0!`E}D)`Xo zGff)ypKlovO39chNhrg|z4jYe9uQ5!V+#%s3^+VD;P9f+HsD=^XhM|2<|~>Y3_qFo z6Hc+xM8o4LR}oLS<|N_2Lk4?zND{>Wcr$jGr&M#1VgooyDXZ^b$7y1pN&y+~;n{I| zMg$Nb?53J!DM`XZrf9~c7FiEMo6VT%QabaczEf;#==c!V-5HzB8;9J(I?LJh-7(IX z&a-sap4$*i%eQcjSS`uJQ&z~|yh`W_KMyrWVh}uoM4C%;l)9XAD5fT3xjgn%((nul zm#gJ5Cev1$3R7>9{twU=@7o`FQL5HpP*&y$oLeuoG|FzHKM;Dhlx4k57v@`M`_|ch z;q1+Ddm)FB)fs>Diz3jr0eC9VGwq6i$3;LUX<%HFt775vVu45=kSi73>eioCR5h*P z-A7f^TeS+V)YrT-^q5E)u{7o>i$+?@C}Y3oP_5cW5U}3(&Udu)((+qUb}aH008bt6 z)g5mi-IsZiL{M}^VpgkKrf_=^RSy7fTs$zmKo1lhu|b}&$Ouqdu@sv#hM78k=`1fm z>oj99n;c;ER>1dY)#+FJ*v5W6BcD@1-$>`|=)FYM51jp0y9cO;jc2!^{0j))dV#9u z={-Ul7v0WJ(Yv>2z0N`RsM|T*xZ|y%m3Hf_d$3XQ?xE_@yVtKb?lwpNv>19~597?_ z3IXL+K8)GGR`URq_?c0yf=Tf<4H7|J0|b-V>okCxLREu_eNKzPJ2Ax5_Cu%_xl9BZ zMEX*)t-mV>T}${0`iyAJ#!^QE4l`NPQA9GaEXO73+6Fq80BLJsR>% z>1f7M$nFfbvq->}+qY2u2z?48{sxb;*YZ4De^td5%6QA%$!%U2i5E%mLr&(@w!IVmw=zW8?OkDQnMMSG~&n{i3sDk&ra@ yMHUA!OKocfS6-WUQ|}tzsQ#*reYstZ%x~Ofb?t65XXbRyy=Eib6*NUtg#HD`rNSEk 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 3b44c9f51d20..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 2f344a02a3c1..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AppEngineHttpRequest.php +++ /dev/null @@ -1,464 +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 e4b714a3f386..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AppEngineHttpTarget.php +++ /dev/null @@ -1,102 +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 dc71470737f7..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/AppEngineRouting.php +++ /dev/null @@ -1,500 +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 39adc685ea96..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/CancelLeaseRequest.php +++ /dev/null @@ -1,202 +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/CloudTasksGrpcClient.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/CloudTasksGrpcClient.php deleted file mode 100644 index 80542b9c3edf..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/CloudTasksGrpcClient.php +++ /dev/null @@ -1,508 +0,0 @@ -_simpleRequest('/google.cloud.tasks.v2beta2.CloudTasks/ListQueues', - $argument, - ['\Google\Cloud\Tasks\V2beta2\ListQueuesResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a queue. - * @param \Google\Cloud\Tasks\V2beta2\GetQueueRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetQueue(\Google\Cloud\Tasks\V2beta2\GetQueueRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2beta2.CloudTasks/GetQueue', - $argument, - ['\Google\Cloud\Tasks\V2beta2\Queue', 'decode'], - $metadata, $options); - } - - /** - * 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. - * @param \Google\Cloud\Tasks\V2beta2\CreateQueueRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateQueue(\Google\Cloud\Tasks\V2beta2\CreateQueueRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2beta2.CloudTasks/CreateQueue', - $argument, - ['\Google\Cloud\Tasks\V2beta2\Queue', 'decode'], - $metadata, $options); - } - - /** - * 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. - * @param \Google\Cloud\Tasks\V2beta2\UpdateQueueRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateQueue(\Google\Cloud\Tasks\V2beta2\UpdateQueueRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2beta2.CloudTasks/UpdateQueue', - $argument, - ['\Google\Cloud\Tasks\V2beta2\Queue', 'decode'], - $metadata, $options); - } - - /** - * 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. - * @param \Google\Cloud\Tasks\V2beta2\DeleteQueueRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteQueue(\Google\Cloud\Tasks\V2beta2\DeleteQueueRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2beta2.CloudTasks/DeleteQueue', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * 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. - * @param \Google\Cloud\Tasks\V2beta2\PurgeQueueRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function PurgeQueue(\Google\Cloud\Tasks\V2beta2\PurgeQueueRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2beta2.CloudTasks/PurgeQueue', - $argument, - ['\Google\Cloud\Tasks\V2beta2\Queue', 'decode'], - $metadata, $options); - } - - /** - * 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]. - * @param \Google\Cloud\Tasks\V2beta2\PauseQueueRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function PauseQueue(\Google\Cloud\Tasks\V2beta2\PauseQueueRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2beta2.CloudTasks/PauseQueue', - $argument, - ['\Google\Cloud\Tasks\V2beta2\Queue', 'decode'], - $metadata, $options); - } - - /** - * 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). - * @param \Google\Cloud\Tasks\V2beta2\ResumeQueueRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ResumeQueue(\Google\Cloud\Tasks\V2beta2\ResumeQueueRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2beta2.CloudTasks/ResumeQueue', - $argument, - ['\Google\Cloud\Tasks\V2beta2\Queue', 'decode'], - $metadata, $options); - } - - /** - * 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` - * @param \Google\Cloud\Iam\V1\GetIamPolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetIamPolicy(\Google\Cloud\Iam\V1\GetIamPolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2beta2.CloudTasks/GetIamPolicy', - $argument, - ['\Google\Cloud\Iam\V1\Policy', 'decode'], - $metadata, $options); - } - - /** - * 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` - * @param \Google\Cloud\Iam\V1\SetIamPolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function SetIamPolicy(\Google\Cloud\Iam\V1\SetIamPolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2beta2.CloudTasks/SetIamPolicy', - $argument, - ['\Google\Cloud\Iam\V1\Policy', 'decode'], - $metadata, $options); - } - - /** - * 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. - * @param \Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function TestIamPermissions(\Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2beta2.CloudTasks/TestIamPermissions', - $argument, - ['\Google\Cloud\Iam\V1\TestIamPermissionsResponse', 'decode'], - $metadata, $options); - } - - /** - * 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. - * @param \Google\Cloud\Tasks\V2beta2\ListTasksRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListTasks(\Google\Cloud\Tasks\V2beta2\ListTasksRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2beta2.CloudTasks/ListTasks', - $argument, - ['\Google\Cloud\Tasks\V2beta2\ListTasksResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a task. - * @param \Google\Cloud\Tasks\V2beta2\GetTaskRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetTask(\Google\Cloud\Tasks\V2beta2\GetTaskRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2beta2.CloudTasks/GetTask', - $argument, - ['\Google\Cloud\Tasks\V2beta2\Task', 'decode'], - $metadata, $options); - } - - /** - * 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. - * @param \Google\Cloud\Tasks\V2beta2\CreateTaskRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateTask(\Google\Cloud\Tasks\V2beta2\CreateTaskRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2beta2.CloudTasks/CreateTask', - $argument, - ['\Google\Cloud\Tasks\V2beta2\Task', 'decode'], - $metadata, $options); - } - - /** - * 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. - * @param \Google\Cloud\Tasks\V2beta2\DeleteTaskRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteTask(\Google\Cloud\Tasks\V2beta2\DeleteTaskRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2beta2.CloudTasks/DeleteTask', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * 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. - * @param \Google\Cloud\Tasks\V2beta2\LeaseTasksRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function LeaseTasks(\Google\Cloud\Tasks\V2beta2\LeaseTasksRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2beta2.CloudTasks/LeaseTasks', - $argument, - ['\Google\Cloud\Tasks\V2beta2\LeaseTasksResponse', 'decode'], - $metadata, $options); - } - - /** - * 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]. - * @param \Google\Cloud\Tasks\V2beta2\AcknowledgeTaskRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function AcknowledgeTask(\Google\Cloud\Tasks\V2beta2\AcknowledgeTaskRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2beta2.CloudTasks/AcknowledgeTask', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * 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]. - * @param \Google\Cloud\Tasks\V2beta2\RenewLeaseRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function RenewLease(\Google\Cloud\Tasks\V2beta2\RenewLeaseRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2beta2.CloudTasks/RenewLease', - $argument, - ['\Google\Cloud\Tasks\V2beta2\Task', 'decode'], - $metadata, $options); - } - - /** - * 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]. - * @param \Google\Cloud\Tasks\V2beta2\CancelLeaseRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CancelLease(\Google\Cloud\Tasks\V2beta2\CancelLeaseRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2beta2.CloudTasks/CancelLease', - $argument, - ['\Google\Cloud\Tasks\V2beta2\Task', 'decode'], - $metadata, $options); - } - - /** - * 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]. - * @param \Google\Cloud\Tasks\V2beta2\RunTaskRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function RunTask(\Google\Cloud\Tasks\V2beta2\RunTaskRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2beta2.CloudTasks/RunTask', - $argument, - ['\Google\Cloud\Tasks\V2beta2\Task', 'decode'], - $metadata, $options); - } - -} 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 5b5a9af9c20d..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/CreateQueueRequest.php +++ /dev/null @@ -1,131 +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 611a11a22bf1..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/CreateTaskRequest.php +++ /dev/null @@ -1,297 +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 ~1hour 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 ~9days 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 ~1hour 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 ~9days 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 ~1hour 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 ~9days 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 ~1hour 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 ~9days 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 2623ee79b307..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/DeleteQueueRequest.php +++ /dev/null @@ -1,71 +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 09a8e599c601..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/GetQueueRequest.php +++ /dev/null @@ -1,127 +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 9b4754d72a7e..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/GetTaskRequest.php +++ /dev/null @@ -1,141 +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 ee9343aeab34..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/HttpMethod.php +++ /dev/null @@ -1,82 +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; - - 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', - ]; - - 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/LeaseTasksRequest.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/LeaseTasksRequest.php deleted file mode 100644 index 2acce610fb27..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/LeaseTasksRequest.php +++ /dev/null @@ -1,413 +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 5dc3e76a34da..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/LeaseTasksResponse.php +++ /dev/null @@ -1,67 +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 \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 \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 f3235e0611e5..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ListQueuesRequest.php +++ /dev/null @@ -1,305 +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 70fa6d5b7590..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ListQueuesResponse.php +++ /dev/null @@ -1,121 +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 \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 \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 ad9e79a2c191..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ListTasksRequest.php +++ /dev/null @@ -1,253 +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 de79b66160d0..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ListTasksResponse.php +++ /dev/null @@ -1,117 +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 \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 \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/PauseQueueRequest.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PauseQueueRequest.php deleted file mode 100644 index cb07c5e3be5b..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PauseQueueRequest.php +++ /dev/null @@ -1,71 +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 2c3be0c0cfa5..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PullMessage.php +++ /dev/null @@ -1,160 +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 a8b3766a2cec..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/PurgeQueueRequest.php +++ /dev/null @@ -1,71 +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/Queue.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Queue.php deleted file mode 100644 index 818eb482ba08..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Queue.php +++ /dev/null @@ -1,708 +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 calling - * [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\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 calling - * [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; - } - - /** - * 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 calling - * [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 calling - * [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 e2960f3097c7..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 86f8bfa8c66b..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/Queue_State.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Queue_State.php deleted file mode 100644 index 913b043e0842..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Queue_State.php +++ /dev/null @@ -1,16 +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 56155d07cae0..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/RenewLeaseRequest.php +++ /dev/null @@ -1,254 +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 77d839a7f374..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/ResumeQueueRequest.php +++ /dev/null @@ -1,71 +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 76aca2920b94..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/RetryConfig.php +++ /dev/null @@ -1,508 +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 8a3c33ebda68..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/RunTaskRequest.php +++ /dev/null @@ -1,142 +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 133ffe4c35b2..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Task.php +++ /dev/null @@ -1,422 +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\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; - } - - /** - * 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 fe60da25a7cd..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Task/View.php +++ /dev/null @@ -1,79 +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 a5e75acaf549..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/TaskStatus.php +++ /dev/null @@ -1,217 +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/Task_View.php b/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Task_View.php deleted file mode 100644 index 4046934c75c9..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/proto/src/Google/Cloud/Tasks/V2beta2/Task_View.php +++ /dev/null @@ -1,16 +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/src/V2beta2/CloudTasksClient.php b/owl-bot-staging/Tasks/v2beta2/src/V2beta2/CloudTasksClient.php deleted file mode 100644 index 0d78395d62b3..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 - */ -class CloudTasksGapicClient -{ - use GapicClientTrait; - - /** - * The name of the service. - */ - const SERVICE_NAME = 'google.cloud.tasks.v2beta2.CloudTasks'; - - /** - * The default address of the service. - */ - const SERVICE_ADDRESS = 'cloudtasks.googleapis.com'; - - /** - * 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, - 'serviceAddress' => 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 $serviceAddress - * 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 - * $serviceAddress 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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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 ~1hour 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 ~9days 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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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`. This field is only used by Cloud IAM. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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 RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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; - $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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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(); - } -} 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 ea9b38e559d2..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/src/V2beta2/resources/cloud_tasks_client_config.json +++ /dev/null @@ -1,145 +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" - } - } - } - } -} 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 3843e1420f48..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/src/V2beta2/resources/cloud_tasks_descriptor_config.php +++ /dev/null @@ -1,28 +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', - ], - ], - ], - ], -]; 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 795331d094d2..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/src/V2beta2/resources/cloud_tasks_rest_client_config.php +++ /dev/null @@ -1,243 +0,0 @@ - [ - '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', - ], - ], - ], - ], - ], - ], -]; 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 27881db2801e..000000000000 --- a/owl-bot-staging/Tasks/v2beta2/tests/Unit/V2beta2/CloudTasksClientTest.php +++ /dev/null @@ -1,1401 +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(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - $scheduleTime = new Timestamp(); - $client->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(); - $client = $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 = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - $scheduleTime = new Timestamp(); - try { - $client->acknowledgeTask($formattedName, $scheduleTime); - // If the $client 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(); - $client = $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 = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - $scheduleTime = new Timestamp(); - $response = $client->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(); - $client = $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 = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - $scheduleTime = new Timestamp(); - try { - $client->cancelLease($formattedName, $scheduleTime); - // If the $client 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(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new Queue(); - $expectedResponse->setName($name); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); - $queue = new Queue(); - $response = $client->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(); - $client = $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 = $client->locationName('[PROJECT]', '[LOCATION]'); - $queue = new Queue(); - try { - $client->createQueue($formattedParent, $queue); - // If the $client 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(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new Task(); - $expectedResponse->setName($name); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $task = new Task(); - $response = $client->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(); - $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $task = new Task(); - try { - $client->createTask($formattedParent, $task); - // If the $client 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(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $client->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(); - $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - try { - $client->deleteQueue($formattedName); - // If the $client 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(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - $client->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(); - $client = $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 = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - try { - $client->deleteTask($formattedName); - // If the $client 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(); - $client = $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 = $client->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(); - $client = $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 { - $client->getIamPolicy($resource); - // If the $client 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(); - $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $response = $client->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(); - $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - try { - $client->getQueue($formattedName); - // If the $client 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(); - $client = $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 = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - $response = $client->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(); - $client = $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 = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - try { - $client->getTask($formattedName); - // If the $client 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(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new LeaseTasksResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $leaseDuration = new Duration(); - $response = $client->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(); - $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $leaseDuration = new Duration(); - try { - $client->leaseTasks($formattedParent, $leaseDuration); - // If the $client 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(); - $client = $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 = $client->locationName('[PROJECT]', '[LOCATION]'); - $response = $client->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(); - $client = $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 = $client->locationName('[PROJECT]', '[LOCATION]'); - try { - $client->listQueues($formattedParent); - // If the $client 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(); - $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $response = $client->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(); - $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - try { - $client->listTasks($formattedParent); - // If the $client 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(); - $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $response = $client->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(); - $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - try { - $client->pauseQueue($formattedName); - // If the $client 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(); - $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $response = $client->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(); - $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - try { - $client->purgeQueue($formattedName); - // If the $client 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(); - $client = $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 = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - $scheduleTime = new Timestamp(); - $leaseDuration = new Duration(); - $response = $client->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(); - $client = $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 = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - $scheduleTime = new Timestamp(); - $leaseDuration = new Duration(); - try { - $client->renewLease($formattedName, $scheduleTime, $leaseDuration); - // If the $client 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(); - $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $response = $client->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(); - $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - try { - $client->resumeQueue($formattedName); - // If the $client 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(); - $client = $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 = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - $response = $client->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(); - $client = $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 = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - try { - $client->runTask($formattedName); - // If the $client 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(); - $client = $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 = $client->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(); - $client = $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 { - $client->setIamPolicy($resource, $policy); - // If the $client 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(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $client->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(); - $client = $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 { - $client->testIamPermissions($resource, $permissions); - // If the $client 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(); - $client = $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 = $client->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(); - $client = $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 { - $client->updateQueue($queue); - // If the $client 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 fe0d3f4ec582..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\'AA!cloudtasks.googleapis.com/Queue -filter (  - page_size ( - -page_token ( 2 - read_mask ( 2.google.protobuf.FieldMaskBA"` -ListQueuesResponse1 -queues ( 2!.google.cloud.tasks.v2beta3.Queue -next_page_token ( "| -GetQueueRequest5 -name ( B\'AA! -cloudtasks.googleapis.com/Queue2 - read_mask ( 2.google.protobuf.FieldMaskBA" -CreateQueueRequest7 -parent ( B\'AA!cloudtasks.googleapis.com/Queue5 -queue ( 2!.google.cloud.tasks.v2beta3.QueueBA"| -UpdateQueueRequest5 -queue ( 2!.google.cloud.tasks.v2beta3.QueueBA/ - update_mask ( 2.google.protobuf.FieldMask"K -DeleteQueueRequest5 -name ( B\'AA! -cloudtasks.googleapis.com/Queue"J -PurgeQueueRequest5 -name ( B\'AA! -cloudtasks.googleapis.com/Queue"J -PauseQueueRequest5 -name ( B\'AA! -cloudtasks.googleapis.com/Queue"K -ResumeQueueRequest5 -name ( B\'AA! -cloudtasks.googleapis.com/Queue" -ListTasksRequest6 -parent ( B&AA 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&AA -cloudtasks.googleapis.com/Task< - response_view (2%.google.cloud.tasks.v2beta3.Task.View" -CreateTaskRequest6 -parent ( B&AA cloudtasks.googleapis.com/Task3 -task ( 2 .google.cloud.tasks.v2beta3.TaskBA< - response_view (2%.google.cloud.tasks.v2beta3.Task.View"I -DeleteTaskRequest4 -name ( B&AA -cloudtasks.googleapis.com/Task" -RunTaskRequest4 -name ( B&AA -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/*}/queuesAparent -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"M8"//v2beta3/{parent=projects/*/locations/*}/queues:queueA parent,queue - UpdateQueue..google.cloud.tasks.v2beta3.UpdateQueueRequest!.google.cloud.tasks.v2beta3.Queue"X>25/v2beta3/{queue.name=projects/*/locations/*/queues/*}:queueAqueue,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"VE"@/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"hK"F/v2beta3/{resource=projects/*/locations/*/queues/*}:testIamPermissions:*Aresource,permissions - ListTasks,.google.cloud.tasks.v2beta3.ListTasksRequest-.google.cloud.tasks.v2beta3.ListTasksResponse"H97/v2beta3/{parent=projects/*/locations/*/queues/*}/tasksAparent -GetTask*.google.cloud.tasks.v2beta3.GetTaskRequest .google.cloud.tasks.v2beta3.Task"F97/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"F9*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:*AnameMAcloudtasks.googleapis.comA.https://www.googleapis.com/auth/cloud-platformB| -com.google.cloud.tasks.v2beta3BCloudTasksProtoPZ?google.golang.org/genproto/googleapis/cloud/tasks/v2beta3;tasksTASKSbproto3' - , 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 5acd8c8dff2521360d9e0cfad57e39405ec69f90..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2731 zcmbVOaZlSu6mNh~`a%)2%4D*wy=GlWwau>5t0D7-S?&>txAt>`S=T@wxUH zm7#o?eWZPY?ayhSV(-pQh}txuB1K$szu$XzzxRH3_v4H3EQBw~J`HH(23GtPUCaIAgBwss}k>PoitYo#vP+W@Zb#4-6r zMuAHp_!lNUpSdI!j=+D9SZuR^3Fi3h58T5J={tT*k@-Hhp9HR8JRp*A9JsXngrqSg z_EE@j&pTwip0<<$C9qn7pi$uXR)fZF#6rQNHbSe_0TmPRx4K7!h1*h9h@hBxO*t!hEQWykO!o=sHc|Mn-A6}#qnliKcK z_m?NtkhR%@KiA;#&DvforZ_{{!%+4xGJ6y^vlvdu%qXi#>XxFlH7CAM%4f*?8Bny!IUO(ymlrM&ep!K2fdM=t#U~0E7wpz?Q1&w^iEW zIP171#-wevuVF>@fGvctuPF59d+4!0w5M=a@L?|&93_^FJJ&IOgCg$3eeFf;oJO|K z2UwoLSQSw8@5Tvdw4~hCn0=U%GlhPDC2eEGZees`KUaO|!#`>zt ze?3=98%yqDsR{X1=neR!)2(%z_UTcl-P~>MwVI9fTUr5bpPU{YwT|}Ja~i;MyLQ^a zi3RM|l}4*ms~_UG#nMw)lIzj#!Fu;)``sWbu+%<1Jj4iU)HzsRs9M&4wU_WfX_UG) zZD{mrY~ZD6s$FW&vBs~cD`N998;wk#yXjeDUXF*O^eRNu8+nZ<^1WJ^&?uK=c+ z`5|l$owv5f@U|508IA1_YZ+7QZBMx`r+o@*64FbeSlBV%efk1wo7XZbBHbj4XdtGd zC}-wNf90TXGS&L`U{!{4grLI^jVJA$*S-f${+gOgu`^fOA>F3}#;I5K}%V$6^h?UXvr3&aDY+RHo#tTEjZFTRY5|;kW0jL_PZqsxq zs4}Bhl0YcTqG~~H55C~Ohu4mcA2vkSd$tpy!5lwzy_CLCndAC2jQK z6m9wHY3F`_ksaOx?mNN2;L*Sw&_Eq$=9LX*J^8kkh`nWneYQ2ZH@`{WJX24kSYF8P PjOUR;rjM8ri~#-zNvU&! 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 981eca4a4d5836221a22e2e9fa89e41c0e84c2ec..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1965 zcmb7F;cnYD5UyhZ^ch6s>%M`vv2ZRxU6^YRN9H}Kiso;u- zJVEnpu^NbZ*>*}w7`iZ8hYJ#k+D!w&X562SxDMXP#)9xK1#XHdVt;$ z@=PIg5oU)>5y5aW8xt7{nkp_l?b`3_)Yj!QmiCk4SQCyeP&?gfmx zqB6nuEN>IwV*PJ+L%D`2oede|rV5da;^L?p%+FqYv&fA5* z0cN{*?56V|ckI}Jz2X*W{0kNM$}|BC(z|XAkO2{Vg~nYRMyu__X(3=ly4QOen1_?d`ZwT@oA- zA)94XZr6K1eF#`^=uC2$%ak~GwxKfT(Rs6CxeuVuai*4m;-`c)H?^^TJEQ4PyZgp_ za!)4&oJL`R-m>V&x6ztv?*jaw1Ka;$rb~57&Wlog0-GzGWF#+Zf8*!U=nL2}RJovU ztxSTv9IY6fVVb%uri_?+y~;>NoLBG=r)fZ}IS@Qkl*IvG5g}+q>?!r$)7!YNgTBte zt-m&4XKlRNS}J3Bw|Iwye&0j(0!766y)u98gQR7J%99+E3(ouUUI3d zjBBkvz@;voui*0{UVy`pXG{g;4AXbFP)kdOJT0WvdJeU9^o?asZx93;5)9zk<1<)i)W6BzM7)8T?IW&k;-;pHwDRDm3 z`%IDp{m<4B5emteC4x|f&w8ylVD^b5?wJO=CkpIdDX@E8Zz=F0LNp*rg4HUTAPhf| z_5)6FB8h~@W1e_C=x@vpG{Y}KEua_(kKrJVm17jVv{Mib(D^^0R~&R8 z$ylt8y%5yBgqo+x>KH{*GYlgol_>ldpsxG3-}9`>P2VqydJ3Yi6=hIG*+;)4^kgNq zTf4^1)=gpSrm(Z7*md`p#!wY8J+u2TbJQIKa&-KR_RRj}KkYK-HgkB8ImCiGN|0%i z8NSF2L~w`9STfeV-_}uCb)8i~W!1LT5-!y?tV{HO2;s4C$V29hq!eDveomp9)la}- zv;NFBVHX|SZVJ)S$X5WoFt}H@tYcL9Tck}L$=zQTYA%9EgTMn>C1l8|TPsB90pN}C zha8@xt%Q!4p9aiR6jsYR#BQEL&c9t~*K*J%jTsD116cb{zzcNG=P>^y9eF+@egGU+ zD;oCs+&+1GS@+R)fud0w%IZ2m*3^0o(-efwJhOgBuQ$-vfX9jSh?HzBWc9Az;ZeTB z0zKMI<7&M`6_~d(=*H^M162ON*)LTDknQ@DWxFX|+1KE__Z*eg)A|hUTz5M^c<$*N5#%O_i0{c8!S???Y>HTrm+QTRy;n0rap)+Km?hI#Eg+*Thhq_e#b?tkwU(D2R%tiRoy{U5M QbitjeJgoogle.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 c2458780d3d8..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/AppEngineHttpRequest.php +++ /dev/null @@ -1,454 +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 66b91012e1e9..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/AppEngineRouting.php +++ /dev/null @@ -1,356 +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/CloudTasksGrpcClient.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/CloudTasksGrpcClient.php deleted file mode 100644 index 496ed4f6b92e..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/CloudTasksGrpcClient.php +++ /dev/null @@ -1,401 +0,0 @@ -_simpleRequest('/google.cloud.tasks.v2beta3.CloudTasks/ListQueues', - $argument, - ['\Google\Cloud\Tasks\V2beta3\ListQueuesResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a queue. - * @param \Google\Cloud\Tasks\V2beta3\GetQueueRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetQueue(\Google\Cloud\Tasks\V2beta3\GetQueueRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2beta3.CloudTasks/GetQueue', - $argument, - ['\Google\Cloud\Tasks\V2beta3\Queue', 'decode'], - $metadata, $options); - } - - /** - * 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. - * @param \Google\Cloud\Tasks\V2beta3\CreateQueueRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateQueue(\Google\Cloud\Tasks\V2beta3\CreateQueueRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2beta3.CloudTasks/CreateQueue', - $argument, - ['\Google\Cloud\Tasks\V2beta3\Queue', 'decode'], - $metadata, $options); - } - - /** - * 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. - * @param \Google\Cloud\Tasks\V2beta3\UpdateQueueRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateQueue(\Google\Cloud\Tasks\V2beta3\UpdateQueueRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2beta3.CloudTasks/UpdateQueue', - $argument, - ['\Google\Cloud\Tasks\V2beta3\Queue', 'decode'], - $metadata, $options); - } - - /** - * 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. - * @param \Google\Cloud\Tasks\V2beta3\DeleteQueueRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteQueue(\Google\Cloud\Tasks\V2beta3\DeleteQueueRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2beta3.CloudTasks/DeleteQueue', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * 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. - * @param \Google\Cloud\Tasks\V2beta3\PurgeQueueRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function PurgeQueue(\Google\Cloud\Tasks\V2beta3\PurgeQueueRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2beta3.CloudTasks/PurgeQueue', - $argument, - ['\Google\Cloud\Tasks\V2beta3\Queue', 'decode'], - $metadata, $options); - } - - /** - * 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]. - * @param \Google\Cloud\Tasks\V2beta3\PauseQueueRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function PauseQueue(\Google\Cloud\Tasks\V2beta3\PauseQueueRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2beta3.CloudTasks/PauseQueue', - $argument, - ['\Google\Cloud\Tasks\V2beta3\Queue', 'decode'], - $metadata, $options); - } - - /** - * 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). - * @param \Google\Cloud\Tasks\V2beta3\ResumeQueueRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ResumeQueue(\Google\Cloud\Tasks\V2beta3\ResumeQueueRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2beta3.CloudTasks/ResumeQueue', - $argument, - ['\Google\Cloud\Tasks\V2beta3\Queue', 'decode'], - $metadata, $options); - } - - /** - * 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` - * @param \Google\Cloud\Iam\V1\GetIamPolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetIamPolicy(\Google\Cloud\Iam\V1\GetIamPolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2beta3.CloudTasks/GetIamPolicy', - $argument, - ['\Google\Cloud\Iam\V1\Policy', 'decode'], - $metadata, $options); - } - - /** - * 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` - * @param \Google\Cloud\Iam\V1\SetIamPolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function SetIamPolicy(\Google\Cloud\Iam\V1\SetIamPolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2beta3.CloudTasks/SetIamPolicy', - $argument, - ['\Google\Cloud\Iam\V1\Policy', 'decode'], - $metadata, $options); - } - - /** - * 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. - * @param \Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function TestIamPermissions(\Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2beta3.CloudTasks/TestIamPermissions', - $argument, - ['\Google\Cloud\Iam\V1\TestIamPermissionsResponse', 'decode'], - $metadata, $options); - } - - /** - * 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. - * @param \Google\Cloud\Tasks\V2beta3\ListTasksRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListTasks(\Google\Cloud\Tasks\V2beta3\ListTasksRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2beta3.CloudTasks/ListTasks', - $argument, - ['\Google\Cloud\Tasks\V2beta3\ListTasksResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a task. - * @param \Google\Cloud\Tasks\V2beta3\GetTaskRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetTask(\Google\Cloud\Tasks\V2beta3\GetTaskRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2beta3.CloudTasks/GetTask', - $argument, - ['\Google\Cloud\Tasks\V2beta3\Task', 'decode'], - $metadata, $options); - } - - /** - * 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. - * @param \Google\Cloud\Tasks\V2beta3\CreateTaskRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateTask(\Google\Cloud\Tasks\V2beta3\CreateTaskRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2beta3.CloudTasks/CreateTask', - $argument, - ['\Google\Cloud\Tasks\V2beta3\Task', 'decode'], - $metadata, $options); - } - - /** - * 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. - * @param \Google\Cloud\Tasks\V2beta3\DeleteTaskRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteTask(\Google\Cloud\Tasks\V2beta3\DeleteTaskRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2beta3.CloudTasks/DeleteTask', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * 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. - * @param \Google\Cloud\Tasks\V2beta3\RunTaskRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function RunTask(\Google\Cloud\Tasks\V2beta3\RunTaskRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.tasks.v2beta3.CloudTasks/RunTask', - $argument, - ['\Google\Cloud\Tasks\V2beta3\Task', 'decode'], - $metadata, $options); - } - -} 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 3c4e6e6a3162..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/CreateQueueRequest.php +++ /dev/null @@ -1,131 +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 9b36d8aded06..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/CreateTaskRequest.php +++ /dev/null @@ -1,297 +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 ~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.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 ~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.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 ~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.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 ~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.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 fd366e84b070..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/DeleteQueueRequest.php +++ /dev/null @@ -1,71 +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 08d07892bbe9..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/GetQueueRequest.php +++ /dev/null @@ -1,127 +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 0e8617545f07..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/GetTaskRequest.php +++ /dev/null @@ -1,141 +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 9c0d20c2179a..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/HttpRequest.php +++ /dev/null @@ -1,414 +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: - * * 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: - * * 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: - * * 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: - * * 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/ListQueuesRequest.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ListQueuesRequest.php deleted file mode 100644 index 8660e3b2e625..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ListQueuesRequest.php +++ /dev/null @@ -1,305 +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 5408b682480b..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ListQueuesResponse.php +++ /dev/null @@ -1,121 +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 \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 \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 54da57c27677..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ListTasksRequest.php +++ /dev/null @@ -1,253 +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 8c5aa40b8201..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ListTasksResponse.php +++ /dev/null @@ -1,117 +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 \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 \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/PauseQueueRequest.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/PauseQueueRequest.php deleted file mode 100644 index 211d6461b7e4..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/PauseQueueRequest.php +++ /dev/null @@ -1,71 +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 e1b39e5e4288..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/PullMessage.php +++ /dev/null @@ -1,131 +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 539a62c3b0b3..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/PurgeQueueRequest.php +++ /dev/null @@ -1,71 +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/Queue.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Queue.php deleted file mode 100644 index 1aefd40fce0d..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Queue.php +++ /dev/null @@ -1,801 +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 = ''; - /** - * 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 calling - * [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\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 calling - * [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; - } - - /** - * 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 calling - * [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 calling - * [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 05d1d2a8ed97..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/Queue_State.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Queue_State.php deleted file mode 100644 index 7f37129ff2e2..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Queue_State.php +++ /dev/null @@ -1,16 +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 bcf37ed209cf..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/ResumeQueueRequest.php +++ /dev/null @@ -1,71 +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 f3825bdd7e31..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/RetryConfig.php +++ /dev/null @@ -1,478 +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 be4be783aa2e..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/RunTaskRequest.php +++ /dev/null @@ -1,142 +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 fd9a972eefe1..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Task.php +++ /dev/null @@ -1,717 +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 273f7dbc5725..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Task/View.php +++ /dev/null @@ -1,78 +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/Task_View.php b/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Task_View.php deleted file mode 100644 index f7837cbe97ea..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/proto/src/Google/Cloud/Tasks/V2beta3/Task_View.php +++ /dev/null @@ -1,16 +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/src/V2beta3/CloudTasksClient.php b/owl-bot-staging/Tasks/v2beta3/src/V2beta3/CloudTasksClient.php deleted file mode 100644 index 95b780b5952f..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 - */ -class CloudTasksGapicClient -{ - use GapicClientTrait; - - /** - * The name of the service. - */ - const SERVICE_NAME = 'google.cloud.tasks.v2beta3.CloudTasks'; - - /** - * The default address of the service. - */ - const SERVICE_ADDRESS = 'cloudtasks.googleapis.com'; - - /** - * 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, - 'serviceAddress' => 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 $serviceAddress - * 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 - * $serviceAddress 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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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 ~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.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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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`. This field is only used by Cloud IAM. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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 RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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; - $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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\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(); - } -} 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 99bdac739d33..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/src/V2beta3/resources/cloud_tasks_client_config.json +++ /dev/null @@ -1,125 +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" - } - } - } - } -} 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 6c9bdb8dc108..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/src/V2beta3/resources/cloud_tasks_descriptor_config.php +++ /dev/null @@ -1,28 +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', - ], - ], - ], - ], -]; 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 608534c564a3..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/src/V2beta3/resources/cloud_tasks_rest_client_config.php +++ /dev/null @@ -1,195 +0,0 @@ - [ - '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', - ], - ], - ], - ], - ], - ], -]; 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 18b65a64353e..000000000000 --- a/owl-bot-staging/Tasks/v2beta3/tests/Unit/V2beta3/CloudTasksClientTest.php +++ /dev/null @@ -1,1139 +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(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new Queue(); - $expectedResponse->setName($name); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); - $queue = new Queue(); - $response = $client->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(); - $client = $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 = $client->locationName('[PROJECT]', '[LOCATION]'); - $queue = new Queue(); - try { - $client->createQueue($formattedParent, $queue); - // If the $client 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(); - $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $task = new Task(); - $response = $client->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(); - $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $task = new Task(); - try { - $client->createTask($formattedParent, $task); - // If the $client 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(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $client->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(); - $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - try { - $client->deleteQueue($formattedName); - // If the $client 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(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - $client->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(); - $client = $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 = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - try { - $client->deleteTask($formattedName); - // If the $client 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(); - $client = $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 = $client->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(); - $client = $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 { - $client->getIamPolicy($resource); - // If the $client 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(); - $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $response = $client->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(); - $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - try { - $client->getQueue($formattedName); - // If the $client 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(); - $client = $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 = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - $response = $client->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(); - $client = $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 = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - try { - $client->getTask($formattedName); - // If the $client 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(); - $client = $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 = $client->locationName('[PROJECT]', '[LOCATION]'); - $response = $client->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(); - $client = $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 = $client->locationName('[PROJECT]', '[LOCATION]'); - try { - $client->listQueues($formattedParent); - // If the $client 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(); - $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $response = $client->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(); - $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - try { - $client->listTasks($formattedParent); - // If the $client 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(); - $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $response = $client->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(); - $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - try { - $client->pauseQueue($formattedName); - // If the $client 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(); - $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $response = $client->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(); - $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - try { - $client->purgeQueue($formattedName); - // If the $client 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(); - $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - $response = $client->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(); - $client = $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 = $client->queueName('[PROJECT]', '[LOCATION]', '[QUEUE]'); - try { - $client->resumeQueue($formattedName); - // If the $client 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(); - $client = $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 = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - $response = $client->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(); - $client = $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 = $client->taskName('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); - try { - $client->runTask($formattedName); - // If the $client 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(); - $client = $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 = $client->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(); - $client = $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 { - $client->setIamPolicy($resource, $policy); - // If the $client 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(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $client->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(); - $client = $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 { - $client->testIamPermissions($resource, $permissions); - // If the $client 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(); - $client = $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 = $client->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(); - $client = $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 { - $client->updateQueue($queue); - // If the $client 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()); - } -}