├── VERSION
├── metadata
└── V2
│ ├── Queue.php
│ ├── Target.php
│ ├── Task.php
│ └── Cloudtasks.php
├── .gitattributes
├── SECURITY.md
├── CONTRIBUTING.md
├── composer.json
├── CODE_OF_CONDUCT.md
├── src
└── V2
│ ├── HttpMethod.php
│ ├── Task
│ └── View.php
│ ├── StackdriverLoggingConfig.php
│ ├── PauseQueueRequest.php
│ ├── PurgeQueueRequest.php
│ ├── ResumeQueueRequest.php
│ ├── DeleteQueueRequest.php
│ ├── GetQueueRequest.php
│ ├── DeleteTaskRequest.php
│ ├── Queue
│ └── State.php
│ ├── ListTasksResponse.php
│ ├── ListQueuesResponse.php
│ ├── OidcToken.php
│ ├── OAuthToken.php
│ ├── resources
│ ├── cloud_tasks_client_config.json
│ ├── cloud_tasks_rest_client_config.php
│ └── cloud_tasks_descriptor_config.php
│ ├── CreateQueueRequest.php
│ ├── UpdateQueueRequest.php
│ ├── GetTaskRequest.php
│ ├── RunTaskRequest.php
│ ├── Attempt.php
│ ├── ListQueuesRequest.php
│ ├── ListTasksRequest.php
│ ├── RateLimits.php
│ ├── AppEngineRouting.php
│ ├── CreateTaskRequest.php
│ └── HttpRequest.php
├── README.md
└── LICENSE
/VERSION:
--------------------------------------------------------------------------------
1 | 2.1.1
2 |
--------------------------------------------------------------------------------
/metadata/V2/Queue.php:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googleapis/google-cloud-php-tasks/HEAD/metadata/V2/Queue.php
--------------------------------------------------------------------------------
/metadata/V2/Target.php:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googleapis/google-cloud-php-tasks/HEAD/metadata/V2/Target.php
--------------------------------------------------------------------------------
/metadata/V2/Task.php:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googleapis/google-cloud-php-tasks/HEAD/metadata/V2/Task.php
--------------------------------------------------------------------------------
/metadata/V2/Cloudtasks.php:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googleapis/google-cloud-php-tasks/HEAD/metadata/V2/Cloudtasks.php
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | /*.xml.dist export-ignore
2 | /tests export-ignore
3 | /.github export-ignore
4 | /samples export-ignore
5 | /.OwlBot.yaml export-ignore
6 | /owlbot.py export-ignore
7 | /src/**/gapic_metadata.json export-ignore
8 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 | # Security Policy
2 |
3 | To report a security issue, please use [g.co/vulnz](https://g.co/vulnz).
4 |
5 | The Google Security Team will respond within 5 working days of your report on g.co/vulnz.
6 |
7 | We use g.co/vulnz for our intake, and do coordination and disclosure here using GitHub Security Advisory to privately discuss and fix the issue.
8 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # How to Contribute
2 |
3 | We'd love to accept your patches and contributions to this project. We accept
4 | and review pull requests against the main
5 | [Google Cloud PHP](https://github.com/googleapis/google-cloud-php)
6 | repository, which contains all of our client libraries. You will also need to
7 | sign a Contributor License Agreement. For more details about how to contribute,
8 | see the
9 | [CONTRIBUTING.md](https://github.com/googleapis/google-cloud-php/blob/main/CONTRIBUTING.md)
10 | file in the main Google Cloud PHP repository.
11 |
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "google/cloud-tasks",
3 | "description": "Google Cloud Tasks Client for PHP",
4 | "license": "Apache-2.0",
5 | "minimum-stability": "stable",
6 | "autoload": {
7 | "psr-4": {
8 | "Google\\Cloud\\Tasks\\": "src",
9 | "GPBMetadata\\Google\\Cloud\\Tasks\\": "metadata"
10 | }
11 | },
12 | "autoload-dev": {
13 | "psr-4": {
14 | "Google\\Cloud\\Tasks\\Tests\\": "tests"
15 | }
16 | },
17 | "extra": {
18 | "component": {
19 | "id": "cloud-tasks",
20 | "path": "Tasks",
21 | "entry": null,
22 | "target": "googleapis/google-cloud-php-tasks.git"
23 | }
24 | },
25 | "require": {
26 | "php": "^8.1",
27 | "google/gax": "^1.38.0"
28 | },
29 | "require-dev": {
30 | "phpunit/phpunit": "^9.0",
31 | "google/cloud-core": "^1.52.7"
32 | },
33 | "suggest": {
34 | "ext-grpc": "Enables use of gRPC, a universal high-performance RPC framework created by Google.",
35 | "ext-protobuf": "Provides a significant increase in throughput over the pure PHP protobuf implementation. See https://cloud.google.com/php/grpc for installation instructions."
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Code of Conduct
2 |
3 | As contributors and maintainers of this project,
4 | and in the interest of fostering an open and welcoming community,
5 | we pledge to respect all people who contribute through reporting issues,
6 | posting feature requests, updating documentation,
7 | submitting pull requests or patches, and other activities.
8 |
9 | We are committed to making participation in this project
10 | a harassment-free experience for everyone,
11 | regardless of level of experience, gender, gender identity and expression,
12 | sexual orientation, disability, personal appearance,
13 | body size, race, ethnicity, age, religion, or nationality.
14 |
15 | Examples of unacceptable behavior by participants include:
16 |
17 | * The use of sexualized language or imagery
18 | * Personal attacks
19 | * Trolling or insulting/derogatory comments
20 | * Public or private harassment
21 | * Publishing other's private information,
22 | such as physical or electronic
23 | addresses, without explicit permission
24 | * Other unethical or unprofessional conduct.
25 |
26 | Project maintainers have the right and responsibility to remove, edit, or reject
27 | comments, commits, code, wiki edits, issues, and other contributions
28 | that are not aligned to this Code of Conduct.
29 | By adopting this Code of Conduct,
30 | project maintainers commit themselves to fairly and consistently
31 | applying these principles to every aspect of managing this project.
32 | Project maintainers who do not follow or enforce the Code of Conduct
33 | may be permanently removed from the project team.
34 |
35 | This code of conduct applies both within project spaces and in public spaces
36 | when an individual is representing the project or its community.
37 |
38 | Instances of abusive, harassing, or otherwise unacceptable behavior
39 | may be reported by opening an issue
40 | or contacting one or more of the project maintainers.
41 |
42 | This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0,
43 | available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/)
--------------------------------------------------------------------------------
/src/V2/HttpMethod.php:
--------------------------------------------------------------------------------
1 | google.cloud.tasks.v2.HttpMethod
13 | */
14 | class HttpMethod
15 | {
16 | /**
17 | * HTTP method unspecified
18 | *
19 | * Generated from protobuf enum HTTP_METHOD_UNSPECIFIED = 0;
20 | */
21 | const HTTP_METHOD_UNSPECIFIED = 0;
22 | /**
23 | * HTTP POST
24 | *
25 | * Generated from protobuf enum POST = 1;
26 | */
27 | const POST = 1;
28 | /**
29 | * HTTP GET
30 | *
31 | * Generated from protobuf enum GET = 2;
32 | */
33 | const GET = 2;
34 | /**
35 | * HTTP HEAD
36 | *
37 | * Generated from protobuf enum HEAD = 3;
38 | */
39 | const HEAD = 3;
40 | /**
41 | * HTTP PUT
42 | *
43 | * Generated from protobuf enum PUT = 4;
44 | */
45 | const PUT = 4;
46 | /**
47 | * HTTP DELETE
48 | *
49 | * Generated from protobuf enum DELETE = 5;
50 | */
51 | const DELETE = 5;
52 | /**
53 | * HTTP PATCH
54 | *
55 | * Generated from protobuf enum PATCH = 6;
56 | */
57 | const PATCH = 6;
58 | /**
59 | * HTTP OPTIONS
60 | *
61 | * Generated from protobuf enum OPTIONS = 7;
62 | */
63 | const OPTIONS = 7;
64 |
65 | private static $valueToName = [
66 | self::HTTP_METHOD_UNSPECIFIED => 'HTTP_METHOD_UNSPECIFIED',
67 | self::POST => 'POST',
68 | self::GET => 'GET',
69 | self::HEAD => 'HEAD',
70 | self::PUT => 'PUT',
71 | self::DELETE => 'DELETE',
72 | self::PATCH => 'PATCH',
73 | self::OPTIONS => 'OPTIONS',
74 | ];
75 |
76 | public static function name($value)
77 | {
78 | if (!isset(self::$valueToName[$value])) {
79 | throw new UnexpectedValueException(sprintf(
80 | 'Enum %s has no name defined for value %s', __CLASS__, $value));
81 | }
82 | return self::$valueToName[$value];
83 | }
84 |
85 |
86 | public static function value($name)
87 | {
88 | $const = __CLASS__ . '::' . strtoupper($name);
89 | if (!defined($const)) {
90 | throw new UnexpectedValueException(sprintf(
91 | 'Enum %s has no value defined for name %s', __CLASS__, $name));
92 | }
93 | return constant($const);
94 | }
95 | }
96 |
97 |
--------------------------------------------------------------------------------
/src/V2/Task/View.php:
--------------------------------------------------------------------------------
1 | google.cloud.tasks.v2.Task.View
18 | */
19 | class View
20 | {
21 | /**
22 | * Unspecified. Defaults to BASIC.
23 | *
24 | * Generated from protobuf enum VIEW_UNSPECIFIED = 0;
25 | */
26 | const VIEW_UNSPECIFIED = 0;
27 | /**
28 | * The basic view omits fields which can be large or can contain
29 | * sensitive data.
30 | * This view does not include the
31 | * [body in
32 | * AppEngineHttpRequest][google.cloud.tasks.v2.AppEngineHttpRequest.body].
33 | * Bodies are desirable to return only when needed, because they
34 | * can be large and because of the sensitivity of the data that you
35 | * choose to store in it.
36 | *
37 | * Generated from protobuf enum BASIC = 1;
38 | */
39 | const BASIC = 1;
40 | /**
41 | * All information is returned.
42 | * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires
43 | * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
44 | * permission on the [Queue][google.cloud.tasks.v2.Queue] resource.
45 | *
46 | * Generated from protobuf enum FULL = 2;
47 | */
48 | const FULL = 2;
49 |
50 | private static $valueToName = [
51 | self::VIEW_UNSPECIFIED => 'VIEW_UNSPECIFIED',
52 | self::BASIC => 'BASIC',
53 | self::FULL => 'FULL',
54 | ];
55 |
56 | public static function name($value)
57 | {
58 | if (!isset(self::$valueToName[$value])) {
59 | throw new UnexpectedValueException(sprintf(
60 | 'Enum %s has no name defined for value %s', __CLASS__, $value));
61 | }
62 | return self::$valueToName[$value];
63 | }
64 |
65 |
66 | public static function value($name)
67 | {
68 | $const = __CLASS__ . '::' . strtoupper($name);
69 | if (!defined($const)) {
70 | throw new UnexpectedValueException(sprintf(
71 | 'Enum %s has no value defined for name %s', __CLASS__, $name));
72 | }
73 | return constant($const);
74 | }
75 | }
76 |
77 |
78 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Google Cloud Tasks for PHP
2 |
3 | > Idiomatic PHP client for Google Cloud Tasks.
4 |
5 | [](https://packagist.org/packages/google/cloud-tasks) [](https://packagist.org/packages/google/cloud-tasks)
6 |
7 | * [API documentation](https://cloud.google.com/php/docs/reference/cloud-tasks/latest)
8 |
9 | **NOTE:** This repository is part of [Google Cloud PHP](https://github.com/googleapis/google-cloud-php). Any
10 | support requests, bug reports, or development contributions should be directed to
11 | that project.
12 |
13 | ### Installation
14 |
15 | To begin, install the preferred dependency manager for PHP, [Composer](https://getcomposer.org/).
16 |
17 | Now install this component:
18 |
19 | ```sh
20 | $ composer require google/cloud-tasks
21 | ```
22 |
23 | This component supports both REST over HTTP/1.1 and gRPC. In order to take advantage of the benefits offered by gRPC (such as streaming methods)
24 | please see our [gRPC installation guide](https://cloud.google.com/php/grpc).
25 |
26 |
27 | ### Authentication
28 |
29 | Please see our [Authentication guide](https://github.com/googleapis/google-cloud-php/blob/main/AUTHENTICATION.md) for more information
30 | on authenticating your client. Once authenticated, you'll be ready to start making requests.
31 |
32 | ### Sample
33 |
34 | ```php
35 | use Google\ApiCore\ApiException;
36 | use Google\Cloud\Location\GetLocationRequest;
37 | use Google\Cloud\Location\Location;
38 | use Google\Cloud\Tasks\V2\Client\CloudTasksClient;
39 |
40 | // Create a client.
41 | $cloudTasksClient = new CloudTasksClient();
42 |
43 | // Prepare the request message.
44 | $request = new GetLocationRequest();
45 |
46 | // Call the API and handle any network failures.
47 | try {
48 | /** @var Location $response */
49 | $response = $cloudTasksClient->getLocation($request);
50 | printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
51 | } catch (ApiException $ex) {
52 | printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
53 | }
54 | ```
55 |
56 | ### Debugging
57 |
58 | Please see our [Debugging guide](https://github.com/googleapis/google-cloud-php/blob/main/DEBUG.md)
59 | for more information about the debugging tools.
60 |
61 | ### Version
62 |
63 | This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in
64 | any minor or patch releases. We will address issues and requests with the highest priority.
65 |
66 | ### Removal of pull queue
67 |
68 | The past version (V2beta2) supported pull queues, but we removed the
69 | pull queue support from V2/V2beta3. For more details, read
70 | [our documentation](https://cloud.google.com/tasks/docs/alpha-to-beta#pull)
71 | about the removal.
72 |
--------------------------------------------------------------------------------
/src/V2/StackdriverLoggingConfig.php:
--------------------------------------------------------------------------------
1 | google.cloud.tasks.v2.StackdriverLoggingConfig
16 | */
17 | class StackdriverLoggingConfig extends \Google\Protobuf\Internal\Message
18 | {
19 | /**
20 | * Specifies the fraction of operations to write to
21 | * [Stackdriver Logging](https://cloud.google.com/logging/docs/).
22 | * This field may contain any value between 0.0 and 1.0, inclusive.
23 | * 0.0 is the default and means that no operations are logged.
24 | *
25 | * Generated from protobuf field double sampling_ratio = 1;
26 | */
27 | protected $sampling_ratio = 0.0;
28 |
29 | /**
30 | * Constructor.
31 | *
32 | * @param array $data {
33 | * Optional. Data for populating the Message object.
34 | *
35 | * @type float $sampling_ratio
36 | * Specifies the fraction of operations to write to
37 | * [Stackdriver Logging](https://cloud.google.com/logging/docs/).
38 | * This field may contain any value between 0.0 and 1.0, inclusive.
39 | * 0.0 is the default and means that no operations are logged.
40 | * }
41 | */
42 | public function __construct($data = NULL) {
43 | \GPBMetadata\Google\Cloud\Tasks\V2\Queue::initOnce();
44 | parent::__construct($data);
45 | }
46 |
47 | /**
48 | * Specifies the fraction of operations to write to
49 | * [Stackdriver Logging](https://cloud.google.com/logging/docs/).
50 | * This field may contain any value between 0.0 and 1.0, inclusive.
51 | * 0.0 is the default and means that no operations are logged.
52 | *
53 | * Generated from protobuf field double sampling_ratio = 1;
54 | * @return float
55 | */
56 | public function getSamplingRatio()
57 | {
58 | return $this->sampling_ratio;
59 | }
60 |
61 | /**
62 | * Specifies the fraction of operations to write to
63 | * [Stackdriver Logging](https://cloud.google.com/logging/docs/).
64 | * This field may contain any value between 0.0 and 1.0, inclusive.
65 | * 0.0 is the default and means that no operations are logged.
66 | *
67 | * Generated from protobuf field double sampling_ratio = 1;
68 | * @param float $var
69 | * @return $this
70 | */
71 | public function setSamplingRatio($var)
72 | {
73 | GPBUtil::checkDouble($var);
74 | $this->sampling_ratio = $var;
75 |
76 | return $this;
77 | }
78 |
79 | }
80 |
81 |
--------------------------------------------------------------------------------
/src/V2/PauseQueueRequest.php:
--------------------------------------------------------------------------------
1 | google.cloud.tasks.v2.PauseQueueRequest
16 | */
17 | class PauseQueueRequest extends \Google\Protobuf\Internal\Message
18 | {
19 | /**
20 | * Required. The queue name. For example:
21 | * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
22 | *
23 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
24 | */
25 | protected $name = '';
26 |
27 | /**
28 | * @param string $name Required. The queue name. For example:
29 | * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
30 | * Please see {@see CloudTasksClient::queueName()} for help formatting this field.
31 | *
32 | * @return \Google\Cloud\Tasks\V2\PauseQueueRequest
33 | *
34 | * @experimental
35 | */
36 | public static function build(string $name): self
37 | {
38 | return (new self())
39 | ->setName($name);
40 | }
41 |
42 | /**
43 | * Constructor.
44 | *
45 | * @param array $data {
46 | * Optional. Data for populating the Message object.
47 | *
48 | * @type string $name
49 | * Required. The queue name. For example:
50 | * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
51 | * }
52 | */
53 | public function __construct($data = NULL) {
54 | \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce();
55 | parent::__construct($data);
56 | }
57 |
58 | /**
59 | * Required. The queue name. For example:
60 | * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
61 | *
62 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
63 | * @return string
64 | */
65 | public function getName()
66 | {
67 | return $this->name;
68 | }
69 |
70 | /**
71 | * Required. The queue name. For example:
72 | * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
73 | *
74 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
75 | * @param string $var
76 | * @return $this
77 | */
78 | public function setName($var)
79 | {
80 | GPBUtil::checkString($var, True);
81 | $this->name = $var;
82 |
83 | return $this;
84 | }
85 |
86 | }
87 |
88 |
--------------------------------------------------------------------------------
/src/V2/PurgeQueueRequest.php:
--------------------------------------------------------------------------------
1 | google.cloud.tasks.v2.PurgeQueueRequest
16 | */
17 | class PurgeQueueRequest extends \Google\Protobuf\Internal\Message
18 | {
19 | /**
20 | * Required. The queue name. For example:
21 | * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
22 | *
23 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
24 | */
25 | protected $name = '';
26 |
27 | /**
28 | * @param string $name Required. The queue name. For example:
29 | * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
30 | * Please see {@see CloudTasksClient::queueName()} for help formatting this field.
31 | *
32 | * @return \Google\Cloud\Tasks\V2\PurgeQueueRequest
33 | *
34 | * @experimental
35 | */
36 | public static function build(string $name): self
37 | {
38 | return (new self())
39 | ->setName($name);
40 | }
41 |
42 | /**
43 | * Constructor.
44 | *
45 | * @param array $data {
46 | * Optional. Data for populating the Message object.
47 | *
48 | * @type string $name
49 | * Required. The queue name. For example:
50 | * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
51 | * }
52 | */
53 | public function __construct($data = NULL) {
54 | \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce();
55 | parent::__construct($data);
56 | }
57 |
58 | /**
59 | * Required. The queue name. For example:
60 | * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
61 | *
62 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
63 | * @return string
64 | */
65 | public function getName()
66 | {
67 | return $this->name;
68 | }
69 |
70 | /**
71 | * Required. The queue name. For example:
72 | * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
73 | *
74 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
75 | * @param string $var
76 | * @return $this
77 | */
78 | public function setName($var)
79 | {
80 | GPBUtil::checkString($var, True);
81 | $this->name = $var;
82 |
83 | return $this;
84 | }
85 |
86 | }
87 |
88 |
--------------------------------------------------------------------------------
/src/V2/ResumeQueueRequest.php:
--------------------------------------------------------------------------------
1 | google.cloud.tasks.v2.ResumeQueueRequest
16 | */
17 | class ResumeQueueRequest extends \Google\Protobuf\Internal\Message
18 | {
19 | /**
20 | * Required. The queue name. For example:
21 | * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
22 | *
23 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
24 | */
25 | protected $name = '';
26 |
27 | /**
28 | * @param string $name Required. The queue name. For example:
29 | * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
30 | * Please see {@see CloudTasksClient::queueName()} for help formatting this field.
31 | *
32 | * @return \Google\Cloud\Tasks\V2\ResumeQueueRequest
33 | *
34 | * @experimental
35 | */
36 | public static function build(string $name): self
37 | {
38 | return (new self())
39 | ->setName($name);
40 | }
41 |
42 | /**
43 | * Constructor.
44 | *
45 | * @param array $data {
46 | * Optional. Data for populating the Message object.
47 | *
48 | * @type string $name
49 | * Required. The queue name. For example:
50 | * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
51 | * }
52 | */
53 | public function __construct($data = NULL) {
54 | \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce();
55 | parent::__construct($data);
56 | }
57 |
58 | /**
59 | * Required. The queue name. For example:
60 | * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
61 | *
62 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
63 | * @return string
64 | */
65 | public function getName()
66 | {
67 | return $this->name;
68 | }
69 |
70 | /**
71 | * Required. The queue name. For example:
72 | * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
73 | *
74 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
75 | * @param string $var
76 | * @return $this
77 | */
78 | public function setName($var)
79 | {
80 | GPBUtil::checkString($var, True);
81 | $this->name = $var;
82 |
83 | return $this;
84 | }
85 |
86 | }
87 |
88 |
--------------------------------------------------------------------------------
/src/V2/DeleteQueueRequest.php:
--------------------------------------------------------------------------------
1 | google.cloud.tasks.v2.DeleteQueueRequest
16 | */
17 | class DeleteQueueRequest extends \Google\Protobuf\Internal\Message
18 | {
19 | /**
20 | * Required. The queue name. For example:
21 | * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
22 | *
23 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
24 | */
25 | protected $name = '';
26 |
27 | /**
28 | * @param string $name Required. The queue name. For example:
29 | * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
30 | * Please see {@see CloudTasksClient::queueName()} for help formatting this field.
31 | *
32 | * @return \Google\Cloud\Tasks\V2\DeleteQueueRequest
33 | *
34 | * @experimental
35 | */
36 | public static function build(string $name): self
37 | {
38 | return (new self())
39 | ->setName($name);
40 | }
41 |
42 | /**
43 | * Constructor.
44 | *
45 | * @param array $data {
46 | * Optional. Data for populating the Message object.
47 | *
48 | * @type string $name
49 | * Required. The queue name. For example:
50 | * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
51 | * }
52 | */
53 | public function __construct($data = NULL) {
54 | \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce();
55 | parent::__construct($data);
56 | }
57 |
58 | /**
59 | * Required. The queue name. For example:
60 | * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
61 | *
62 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
63 | * @return string
64 | */
65 | public function getName()
66 | {
67 | return $this->name;
68 | }
69 |
70 | /**
71 | * Required. The queue name. For example:
72 | * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
73 | *
74 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
75 | * @param string $var
76 | * @return $this
77 | */
78 | public function setName($var)
79 | {
80 | GPBUtil::checkString($var, True);
81 | $this->name = $var;
82 |
83 | return $this;
84 | }
85 |
86 | }
87 |
88 |
--------------------------------------------------------------------------------
/src/V2/GetQueueRequest.php:
--------------------------------------------------------------------------------
1 | google.cloud.tasks.v2.GetQueueRequest
15 | */
16 | class GetQueueRequest extends \Google\Protobuf\Internal\Message
17 | {
18 | /**
19 | * Required. The resource name of the queue. For example:
20 | * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
21 | *
22 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
23 | */
24 | protected $name = '';
25 |
26 | /**
27 | * @param string $name Required. The resource name of the queue. For example:
28 | * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
29 | * Please see {@see CloudTasksClient::queueName()} for help formatting this field.
30 | *
31 | * @return \Google\Cloud\Tasks\V2\GetQueueRequest
32 | *
33 | * @experimental
34 | */
35 | public static function build(string $name): self
36 | {
37 | return (new self())
38 | ->setName($name);
39 | }
40 |
41 | /**
42 | * Constructor.
43 | *
44 | * @param array $data {
45 | * Optional. Data for populating the Message object.
46 | *
47 | * @type string $name
48 | * Required. The resource name of the queue. For example:
49 | * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
50 | * }
51 | */
52 | public function __construct($data = NULL) {
53 | \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce();
54 | parent::__construct($data);
55 | }
56 |
57 | /**
58 | * Required. The resource name of the queue. For example:
59 | * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
60 | *
61 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
62 | * @return string
63 | */
64 | public function getName()
65 | {
66 | return $this->name;
67 | }
68 |
69 | /**
70 | * Required. The resource name of the queue. For example:
71 | * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
72 | *
73 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
74 | * @param string $var
75 | * @return $this
76 | */
77 | public function setName($var)
78 | {
79 | GPBUtil::checkString($var, True);
80 | $this->name = $var;
81 |
82 | return $this;
83 | }
84 |
85 | }
86 |
87 |
--------------------------------------------------------------------------------
/src/V2/DeleteTaskRequest.php:
--------------------------------------------------------------------------------
1 | google.cloud.tasks.v2.DeleteTaskRequest
16 | */
17 | class DeleteTaskRequest extends \Google\Protobuf\Internal\Message
18 | {
19 | /**
20 | * Required. The task name. For example:
21 | * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
22 | *
23 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
24 | */
25 | protected $name = '';
26 |
27 | /**
28 | * @param string $name Required. The task name. For example:
29 | * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
30 | * Please see {@see CloudTasksClient::taskName()} for help formatting this field.
31 | *
32 | * @return \Google\Cloud\Tasks\V2\DeleteTaskRequest
33 | *
34 | * @experimental
35 | */
36 | public static function build(string $name): self
37 | {
38 | return (new self())
39 | ->setName($name);
40 | }
41 |
42 | /**
43 | * Constructor.
44 | *
45 | * @param array $data {
46 | * Optional. Data for populating the Message object.
47 | *
48 | * @type string $name
49 | * Required. The task name. For example:
50 | * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
51 | * }
52 | */
53 | public function __construct($data = NULL) {
54 | \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce();
55 | parent::__construct($data);
56 | }
57 |
58 | /**
59 | * Required. The task name. For example:
60 | * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
61 | *
62 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
63 | * @return string
64 | */
65 | public function getName()
66 | {
67 | return $this->name;
68 | }
69 |
70 | /**
71 | * Required. The task name. For example:
72 | * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
73 | *
74 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
75 | * @param string $var
76 | * @return $this
77 | */
78 | public function setName($var)
79 | {
80 | GPBUtil::checkString($var, True);
81 | $this->name = $var;
82 |
83 | return $this;
84 | }
85 |
86 | }
87 |
88 |
--------------------------------------------------------------------------------
/src/V2/Queue/State.php:
--------------------------------------------------------------------------------
1 | google.cloud.tasks.v2.Queue.State
13 | */
14 | class State
15 | {
16 | /**
17 | * Unspecified state.
18 | *
19 | * Generated from protobuf enum STATE_UNSPECIFIED = 0;
20 | */
21 | const STATE_UNSPECIFIED = 0;
22 | /**
23 | * The queue is running. Tasks can be dispatched.
24 | * If the queue was created using Cloud Tasks and the queue has
25 | * had no activity (method calls or task dispatches) for 30 days,
26 | * the queue may take a few minutes to re-activate. Some method
27 | * calls may return [NOT_FOUND][google.rpc.Code.NOT_FOUND] and
28 | * tasks may not be dispatched for a few minutes until the queue
29 | * has been re-activated.
30 | *
31 | * Generated from protobuf enum RUNNING = 1;
32 | */
33 | const RUNNING = 1;
34 | /**
35 | * Tasks are paused by the user. If the queue is paused then Cloud
36 | * Tasks will stop delivering tasks from it, but more tasks can
37 | * still be added to it by the user.
38 | *
39 | * Generated from protobuf enum PAUSED = 2;
40 | */
41 | const PAUSED = 2;
42 | /**
43 | * The queue is disabled.
44 | * A queue becomes `DISABLED` when
45 | * [queue.yaml](https://cloud.google.com/appengine/docs/python/config/queueref)
46 | * or
47 | * [queue.xml](https://cloud.google.com/appengine/docs/standard/java/config/queueref)
48 | * is uploaded which does not contain the queue. You cannot directly disable
49 | * a queue.
50 | * When a queue is disabled, tasks can still be added to a queue
51 | * but the tasks are not dispatched.
52 | * To permanently delete this queue and all of its tasks, call
53 | * [DeleteQueue][google.cloud.tasks.v2.CloudTasks.DeleteQueue].
54 | *
55 | * Generated from protobuf enum DISABLED = 3;
56 | */
57 | const DISABLED = 3;
58 |
59 | private static $valueToName = [
60 | self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED',
61 | self::RUNNING => 'RUNNING',
62 | self::PAUSED => 'PAUSED',
63 | self::DISABLED => 'DISABLED',
64 | ];
65 |
66 | public static function name($value)
67 | {
68 | if (!isset(self::$valueToName[$value])) {
69 | throw new UnexpectedValueException(sprintf(
70 | 'Enum %s has no name defined for value %s', __CLASS__, $value));
71 | }
72 | return self::$valueToName[$value];
73 | }
74 |
75 |
76 | public static function value($name)
77 | {
78 | $const = __CLASS__ . '::' . strtoupper($name);
79 | if (!defined($const)) {
80 | throw new UnexpectedValueException(sprintf(
81 | 'Enum %s has no value defined for name %s', __CLASS__, $name));
82 | }
83 | return constant($const);
84 | }
85 | }
86 |
87 |
88 |
--------------------------------------------------------------------------------
/src/V2/ListTasksResponse.php:
--------------------------------------------------------------------------------
1 | google.cloud.tasks.v2.ListTasksResponse
16 | */
17 | class ListTasksResponse extends \Google\Protobuf\Internal\Message
18 | {
19 | /**
20 | * The list of tasks.
21 | *
22 | * Generated from protobuf field repeated .google.cloud.tasks.v2.Task tasks = 1;
23 | */
24 | private $tasks;
25 | /**
26 | * A token to retrieve next page of results.
27 | * To return the next page of results, call
28 | * [ListTasks][google.cloud.tasks.v2.CloudTasks.ListTasks] with this value as
29 | * the [page_token][google.cloud.tasks.v2.ListTasksRequest.page_token].
30 | * If the next_page_token is empty, there are no more results.
31 | *
32 | * Generated from protobuf field string next_page_token = 2;
33 | */
34 | protected $next_page_token = '';
35 |
36 | /**
37 | * Constructor.
38 | *
39 | * @param array $data {
40 | * Optional. Data for populating the Message object.
41 | *
42 | * @type array<\Google\Cloud\Tasks\V2\Task>|\Google\Protobuf\Internal\RepeatedField $tasks
43 | * The list of tasks.
44 | * @type string $next_page_token
45 | * A token to retrieve next page of results.
46 | * To return the next page of results, call
47 | * [ListTasks][google.cloud.tasks.v2.CloudTasks.ListTasks] with this value as
48 | * the [page_token][google.cloud.tasks.v2.ListTasksRequest.page_token].
49 | * If the next_page_token is empty, there are no more results.
50 | * }
51 | */
52 | public function __construct($data = NULL) {
53 | \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce();
54 | parent::__construct($data);
55 | }
56 |
57 | /**
58 | * The list of tasks.
59 | *
60 | * Generated from protobuf field repeated .google.cloud.tasks.v2.Task tasks = 1;
61 | * @return \Google\Protobuf\Internal\RepeatedField
62 | */
63 | public function getTasks()
64 | {
65 | return $this->tasks;
66 | }
67 |
68 | /**
69 | * The list of tasks.
70 | *
71 | * Generated from protobuf field repeated .google.cloud.tasks.v2.Task tasks = 1;
72 | * @param array<\Google\Cloud\Tasks\V2\Task>|\Google\Protobuf\Internal\RepeatedField $var
73 | * @return $this
74 | */
75 | public function setTasks($var)
76 | {
77 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Tasks\V2\Task::class);
78 | $this->tasks = $arr;
79 |
80 | return $this;
81 | }
82 |
83 | /**
84 | * A token to retrieve next page of results.
85 | * To return the next page of results, call
86 | * [ListTasks][google.cloud.tasks.v2.CloudTasks.ListTasks] with this value as
87 | * the [page_token][google.cloud.tasks.v2.ListTasksRequest.page_token].
88 | * If the next_page_token is empty, there are no more results.
89 | *
90 | * Generated from protobuf field string next_page_token = 2;
91 | * @return string
92 | */
93 | public function getNextPageToken()
94 | {
95 | return $this->next_page_token;
96 | }
97 |
98 | /**
99 | * A token to retrieve next page of results.
100 | * To return the next page of results, call
101 | * [ListTasks][google.cloud.tasks.v2.CloudTasks.ListTasks] with this value as
102 | * the [page_token][google.cloud.tasks.v2.ListTasksRequest.page_token].
103 | * If the next_page_token is empty, there are no more results.
104 | *
105 | * Generated from protobuf field string next_page_token = 2;
106 | * @param string $var
107 | * @return $this
108 | */
109 | public function setNextPageToken($var)
110 | {
111 | GPBUtil::checkString($var, True);
112 | $this->next_page_token = $var;
113 |
114 | return $this;
115 | }
116 |
117 | }
118 |
119 |
--------------------------------------------------------------------------------
/src/V2/ListQueuesResponse.php:
--------------------------------------------------------------------------------
1 | google.cloud.tasks.v2.ListQueuesResponse
16 | */
17 | class ListQueuesResponse extends \Google\Protobuf\Internal\Message
18 | {
19 | /**
20 | * The list of queues.
21 | *
22 | * Generated from protobuf field repeated .google.cloud.tasks.v2.Queue queues = 1;
23 | */
24 | private $queues;
25 | /**
26 | * A token to retrieve next page of results.
27 | * To return the next page of results, call
28 | * [ListQueues][google.cloud.tasks.v2.CloudTasks.ListQueues] with this value
29 | * as the [page_token][google.cloud.tasks.v2.ListQueuesRequest.page_token].
30 | * If the next_page_token is empty, there are no more results.
31 | * The page token is valid for only 2 hours.
32 | *
33 | * Generated from protobuf field string next_page_token = 2;
34 | */
35 | protected $next_page_token = '';
36 |
37 | /**
38 | * Constructor.
39 | *
40 | * @param array $data {
41 | * Optional. Data for populating the Message object.
42 | *
43 | * @type array<\Google\Cloud\Tasks\V2\Queue>|\Google\Protobuf\Internal\RepeatedField $queues
44 | * The list of queues.
45 | * @type string $next_page_token
46 | * A token to retrieve next page of results.
47 | * To return the next page of results, call
48 | * [ListQueues][google.cloud.tasks.v2.CloudTasks.ListQueues] with this value
49 | * as the [page_token][google.cloud.tasks.v2.ListQueuesRequest.page_token].
50 | * If the next_page_token is empty, there are no more results.
51 | * The page token is valid for only 2 hours.
52 | * }
53 | */
54 | public function __construct($data = NULL) {
55 | \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce();
56 | parent::__construct($data);
57 | }
58 |
59 | /**
60 | * The list of queues.
61 | *
62 | * Generated from protobuf field repeated .google.cloud.tasks.v2.Queue queues = 1;
63 | * @return \Google\Protobuf\Internal\RepeatedField
64 | */
65 | public function getQueues()
66 | {
67 | return $this->queues;
68 | }
69 |
70 | /**
71 | * The list of queues.
72 | *
73 | * Generated from protobuf field repeated .google.cloud.tasks.v2.Queue queues = 1;
74 | * @param array<\Google\Cloud\Tasks\V2\Queue>|\Google\Protobuf\Internal\RepeatedField $var
75 | * @return $this
76 | */
77 | public function setQueues($var)
78 | {
79 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Tasks\V2\Queue::class);
80 | $this->queues = $arr;
81 |
82 | return $this;
83 | }
84 |
85 | /**
86 | * A token to retrieve next page of results.
87 | * To return the next page of results, call
88 | * [ListQueues][google.cloud.tasks.v2.CloudTasks.ListQueues] with this value
89 | * as the [page_token][google.cloud.tasks.v2.ListQueuesRequest.page_token].
90 | * If the next_page_token is empty, there are no more results.
91 | * The page token is valid for only 2 hours.
92 | *
93 | * Generated from protobuf field string next_page_token = 2;
94 | * @return string
95 | */
96 | public function getNextPageToken()
97 | {
98 | return $this->next_page_token;
99 | }
100 |
101 | /**
102 | * A token to retrieve next page of results.
103 | * To return the next page of results, call
104 | * [ListQueues][google.cloud.tasks.v2.CloudTasks.ListQueues] with this value
105 | * as the [page_token][google.cloud.tasks.v2.ListQueuesRequest.page_token].
106 | * If the next_page_token is empty, there are no more results.
107 | * The page token is valid for only 2 hours.
108 | *
109 | * Generated from protobuf field string next_page_token = 2;
110 | * @param string $var
111 | * @return $this
112 | */
113 | public function setNextPageToken($var)
114 | {
115 | GPBUtil::checkString($var, True);
116 | $this->next_page_token = $var;
117 |
118 | return $this;
119 | }
120 |
121 | }
122 |
123 |
--------------------------------------------------------------------------------
/src/V2/OidcToken.php:
--------------------------------------------------------------------------------
1 | google.cloud.tasks.v2.OidcToken
20 | */
21 | class OidcToken extends \Google\Protobuf\Internal\Message
22 | {
23 | /**
24 | * [Service account email](https://cloud.google.com/iam/docs/service-accounts)
25 | * to be used for generating OIDC token.
26 | * The service account must be within the same project as the queue. The
27 | * caller must have iam.serviceAccounts.actAs permission for the service
28 | * account.
29 | *
30 | * Generated from protobuf field string service_account_email = 1;
31 | */
32 | protected $service_account_email = '';
33 | /**
34 | * Audience to be used when generating OIDC token. If not specified, the URI
35 | * specified in target will be used.
36 | *
37 | * Generated from protobuf field string audience = 2;
38 | */
39 | protected $audience = '';
40 |
41 | /**
42 | * Constructor.
43 | *
44 | * @param array $data {
45 | * Optional. Data for populating the Message object.
46 | *
47 | * @type string $service_account_email
48 | * [Service account email](https://cloud.google.com/iam/docs/service-accounts)
49 | * to be used for generating OIDC token.
50 | * The service account must be within the same project as the queue. The
51 | * caller must have iam.serviceAccounts.actAs permission for the service
52 | * account.
53 | * @type string $audience
54 | * Audience to be used when generating OIDC token. If not specified, the URI
55 | * specified in target will be used.
56 | * }
57 | */
58 | public function __construct($data = NULL) {
59 | \GPBMetadata\Google\Cloud\Tasks\V2\Target::initOnce();
60 | parent::__construct($data);
61 | }
62 |
63 | /**
64 | * [Service account email](https://cloud.google.com/iam/docs/service-accounts)
65 | * to be used for generating OIDC token.
66 | * The service account must be within the same project as the queue. The
67 | * caller must have iam.serviceAccounts.actAs permission for the service
68 | * account.
69 | *
70 | * Generated from protobuf field string service_account_email = 1;
71 | * @return string
72 | */
73 | public function getServiceAccountEmail()
74 | {
75 | return $this->service_account_email;
76 | }
77 |
78 | /**
79 | * [Service account email](https://cloud.google.com/iam/docs/service-accounts)
80 | * to be used for generating OIDC token.
81 | * The service account must be within the same project as the queue. The
82 | * caller must have iam.serviceAccounts.actAs permission for the service
83 | * account.
84 | *
85 | * Generated from protobuf field string service_account_email = 1;
86 | * @param string $var
87 | * @return $this
88 | */
89 | public function setServiceAccountEmail($var)
90 | {
91 | GPBUtil::checkString($var, True);
92 | $this->service_account_email = $var;
93 |
94 | return $this;
95 | }
96 |
97 | /**
98 | * Audience to be used when generating OIDC token. If not specified, the URI
99 | * specified in target will be used.
100 | *
101 | * Generated from protobuf field string audience = 2;
102 | * @return string
103 | */
104 | public function getAudience()
105 | {
106 | return $this->audience;
107 | }
108 |
109 | /**
110 | * Audience to be used when generating OIDC token. If not specified, the URI
111 | * specified in target will be used.
112 | *
113 | * Generated from protobuf field string audience = 2;
114 | * @param string $var
115 | * @return $this
116 | */
117 | public function setAudience($var)
118 | {
119 | GPBUtil::checkString($var, True);
120 | $this->audience = $var;
121 |
122 | return $this;
123 | }
124 |
125 | }
126 |
127 |
--------------------------------------------------------------------------------
/src/V2/OAuthToken.php:
--------------------------------------------------------------------------------
1 | google.cloud.tasks.v2.OAuthToken
18 | */
19 | class OAuthToken extends \Google\Protobuf\Internal\Message
20 | {
21 | /**
22 | * [Service account email](https://cloud.google.com/iam/docs/service-accounts)
23 | * to be used for generating OAuth token.
24 | * The service account must be within the same project as the queue. The
25 | * caller must have iam.serviceAccounts.actAs permission for the service
26 | * account.
27 | *
28 | * Generated from protobuf field string service_account_email = 1;
29 | */
30 | protected $service_account_email = '';
31 | /**
32 | * OAuth scope to be used for generating OAuth access token.
33 | * If not specified, "https://www.googleapis.com/auth/cloud-platform"
34 | * will be used.
35 | *
36 | * Generated from protobuf field string scope = 2;
37 | */
38 | protected $scope = '';
39 |
40 | /**
41 | * Constructor.
42 | *
43 | * @param array $data {
44 | * Optional. Data for populating the Message object.
45 | *
46 | * @type string $service_account_email
47 | * [Service account email](https://cloud.google.com/iam/docs/service-accounts)
48 | * to be used for generating OAuth token.
49 | * The service account must be within the same project as the queue. The
50 | * caller must have iam.serviceAccounts.actAs permission for the service
51 | * account.
52 | * @type string $scope
53 | * OAuth scope to be used for generating OAuth access token.
54 | * If not specified, "https://www.googleapis.com/auth/cloud-platform"
55 | * will be used.
56 | * }
57 | */
58 | public function __construct($data = NULL) {
59 | \GPBMetadata\Google\Cloud\Tasks\V2\Target::initOnce();
60 | parent::__construct($data);
61 | }
62 |
63 | /**
64 | * [Service account email](https://cloud.google.com/iam/docs/service-accounts)
65 | * to be used for generating OAuth token.
66 | * The service account must be within the same project as the queue. The
67 | * caller must have iam.serviceAccounts.actAs permission for the service
68 | * account.
69 | *
70 | * Generated from protobuf field string service_account_email = 1;
71 | * @return string
72 | */
73 | public function getServiceAccountEmail()
74 | {
75 | return $this->service_account_email;
76 | }
77 |
78 | /**
79 | * [Service account email](https://cloud.google.com/iam/docs/service-accounts)
80 | * to be used for generating OAuth token.
81 | * The service account must be within the same project as the queue. The
82 | * caller must have iam.serviceAccounts.actAs permission for the service
83 | * account.
84 | *
85 | * Generated from protobuf field string service_account_email = 1;
86 | * @param string $var
87 | * @return $this
88 | */
89 | public function setServiceAccountEmail($var)
90 | {
91 | GPBUtil::checkString($var, True);
92 | $this->service_account_email = $var;
93 |
94 | return $this;
95 | }
96 |
97 | /**
98 | * OAuth scope to be used for generating OAuth access token.
99 | * If not specified, "https://www.googleapis.com/auth/cloud-platform"
100 | * will be used.
101 | *
102 | * Generated from protobuf field string scope = 2;
103 | * @return string
104 | */
105 | public function getScope()
106 | {
107 | return $this->scope;
108 | }
109 |
110 | /**
111 | * OAuth scope to be used for generating OAuth access token.
112 | * If not specified, "https://www.googleapis.com/auth/cloud-platform"
113 | * will be used.
114 | *
115 | * Generated from protobuf field string scope = 2;
116 | * @param string $var
117 | * @return $this
118 | */
119 | public function setScope($var)
120 | {
121 | GPBUtil::checkString($var, True);
122 | $this->scope = $var;
123 |
124 | return $this;
125 | }
126 |
127 | }
128 |
129 |
--------------------------------------------------------------------------------
/src/V2/resources/cloud_tasks_client_config.json:
--------------------------------------------------------------------------------
1 | {
2 | "interfaces": {
3 | "google.cloud.tasks.v2.CloudTasks": {
4 | "retry_codes": {
5 | "no_retry_codes": [],
6 | "retry_policy_1_codes": [
7 | "DEADLINE_EXCEEDED",
8 | "UNAVAILABLE"
9 | ],
10 | "no_retry_1_codes": []
11 | },
12 | "retry_params": {
13 | "no_retry_params": {
14 | "initial_retry_delay_millis": 0,
15 | "retry_delay_multiplier": 0.0,
16 | "max_retry_delay_millis": 0,
17 | "initial_rpc_timeout_millis": 0,
18 | "rpc_timeout_multiplier": 1.0,
19 | "max_rpc_timeout_millis": 0,
20 | "total_timeout_millis": 0
21 | },
22 | "retry_policy_1_params": {
23 | "initial_retry_delay_millis": 100,
24 | "retry_delay_multiplier": 1.3,
25 | "max_retry_delay_millis": 10000,
26 | "initial_rpc_timeout_millis": 20000,
27 | "rpc_timeout_multiplier": 1.0,
28 | "max_rpc_timeout_millis": 20000,
29 | "total_timeout_millis": 20000
30 | },
31 | "no_retry_1_params": {
32 | "initial_retry_delay_millis": 0,
33 | "retry_delay_multiplier": 0.0,
34 | "max_retry_delay_millis": 0,
35 | "initial_rpc_timeout_millis": 20000,
36 | "rpc_timeout_multiplier": 1.0,
37 | "max_rpc_timeout_millis": 20000,
38 | "total_timeout_millis": 20000
39 | }
40 | },
41 | "methods": {
42 | "CreateQueue": {
43 | "timeout_millis": 20000,
44 | "retry_codes_name": "no_retry_1_codes",
45 | "retry_params_name": "no_retry_1_params"
46 | },
47 | "CreateTask": {
48 | "timeout_millis": 20000,
49 | "retry_codes_name": "no_retry_1_codes",
50 | "retry_params_name": "no_retry_1_params"
51 | },
52 | "DeleteQueue": {
53 | "timeout_millis": 20000,
54 | "retry_codes_name": "retry_policy_1_codes",
55 | "retry_params_name": "retry_policy_1_params"
56 | },
57 | "DeleteTask": {
58 | "timeout_millis": 20000,
59 | "retry_codes_name": "retry_policy_1_codes",
60 | "retry_params_name": "retry_policy_1_params"
61 | },
62 | "GetIamPolicy": {
63 | "timeout_millis": 20000,
64 | "retry_codes_name": "retry_policy_1_codes",
65 | "retry_params_name": "retry_policy_1_params"
66 | },
67 | "GetQueue": {
68 | "timeout_millis": 20000,
69 | "retry_codes_name": "retry_policy_1_codes",
70 | "retry_params_name": "retry_policy_1_params"
71 | },
72 | "GetTask": {
73 | "timeout_millis": 20000,
74 | "retry_codes_name": "retry_policy_1_codes",
75 | "retry_params_name": "retry_policy_1_params"
76 | },
77 | "ListQueues": {
78 | "timeout_millis": 20000,
79 | "retry_codes_name": "retry_policy_1_codes",
80 | "retry_params_name": "retry_policy_1_params"
81 | },
82 | "ListTasks": {
83 | "timeout_millis": 20000,
84 | "retry_codes_name": "retry_policy_1_codes",
85 | "retry_params_name": "retry_policy_1_params"
86 | },
87 | "PauseQueue": {
88 | "timeout_millis": 20000,
89 | "retry_codes_name": "no_retry_1_codes",
90 | "retry_params_name": "no_retry_1_params"
91 | },
92 | "PurgeQueue": {
93 | "timeout_millis": 20000,
94 | "retry_codes_name": "no_retry_1_codes",
95 | "retry_params_name": "no_retry_1_params"
96 | },
97 | "ResumeQueue": {
98 | "timeout_millis": 20000,
99 | "retry_codes_name": "no_retry_1_codes",
100 | "retry_params_name": "no_retry_1_params"
101 | },
102 | "RunTask": {
103 | "timeout_millis": 20000,
104 | "retry_codes_name": "no_retry_1_codes",
105 | "retry_params_name": "no_retry_1_params"
106 | },
107 | "SetIamPolicy": {
108 | "timeout_millis": 20000,
109 | "retry_codes_name": "no_retry_1_codes",
110 | "retry_params_name": "no_retry_1_params"
111 | },
112 | "TestIamPermissions": {
113 | "timeout_millis": 20000,
114 | "retry_codes_name": "retry_policy_1_codes",
115 | "retry_params_name": "retry_policy_1_params"
116 | },
117 | "UpdateQueue": {
118 | "timeout_millis": 20000,
119 | "retry_codes_name": "no_retry_1_codes",
120 | "retry_params_name": "no_retry_1_params"
121 | },
122 | "GetLocation": {
123 | "timeout_millis": 60000,
124 | "retry_codes_name": "no_retry_codes",
125 | "retry_params_name": "no_retry_params"
126 | },
127 | "ListLocations": {
128 | "timeout_millis": 60000,
129 | "retry_codes_name": "no_retry_codes",
130 | "retry_params_name": "no_retry_params"
131 | }
132 | }
133 | }
134 | }
135 | }
136 |
--------------------------------------------------------------------------------
/src/V2/CreateQueueRequest.php:
--------------------------------------------------------------------------------
1 | google.cloud.tasks.v2.CreateQueueRequest
16 | */
17 | class CreateQueueRequest extends \Google\Protobuf\Internal\Message
18 | {
19 | /**
20 | * Required. The location name in which the queue will be created.
21 | * For example: `projects/PROJECT_ID/locations/LOCATION_ID`
22 | * The list of allowed locations can be obtained by calling Cloud
23 | * Tasks' implementation of
24 | * [ListLocations][google.cloud.location.Locations.ListLocations].
25 | *
26 | * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
27 | */
28 | protected $parent = '';
29 | /**
30 | * Required. The queue to create.
31 | * [Queue's name][google.cloud.tasks.v2.Queue.name] cannot be the same as an
32 | * existing queue.
33 | *
34 | * Generated from protobuf field .google.cloud.tasks.v2.Queue queue = 2 [(.google.api.field_behavior) = REQUIRED];
35 | */
36 | protected $queue = null;
37 |
38 | /**
39 | * @param string $parent Required. The location name in which the queue will be created.
40 | * For example: `projects/PROJECT_ID/locations/LOCATION_ID`
41 | *
42 | * The list of allowed locations can be obtained by calling Cloud
43 | * Tasks' implementation of
44 | * [ListLocations][google.cloud.location.Locations.ListLocations]. Please see
45 | * {@see CloudTasksClient::locationName()} for help formatting this field.
46 | * @param \Google\Cloud\Tasks\V2\Queue $queue Required. The queue to create.
47 | *
48 | * [Queue's name][google.cloud.tasks.v2.Queue.name] cannot be the same as an
49 | * existing queue.
50 | *
51 | * @return \Google\Cloud\Tasks\V2\CreateQueueRequest
52 | *
53 | * @experimental
54 | */
55 | public static function build(string $parent, \Google\Cloud\Tasks\V2\Queue $queue): self
56 | {
57 | return (new self())
58 | ->setParent($parent)
59 | ->setQueue($queue);
60 | }
61 |
62 | /**
63 | * Constructor.
64 | *
65 | * @param array $data {
66 | * Optional. Data for populating the Message object.
67 | *
68 | * @type string $parent
69 | * Required. The location name in which the queue will be created.
70 | * For example: `projects/PROJECT_ID/locations/LOCATION_ID`
71 | * The list of allowed locations can be obtained by calling Cloud
72 | * Tasks' implementation of
73 | * [ListLocations][google.cloud.location.Locations.ListLocations].
74 | * @type \Google\Cloud\Tasks\V2\Queue $queue
75 | * Required. The queue to create.
76 | * [Queue's name][google.cloud.tasks.v2.Queue.name] cannot be the same as an
77 | * existing queue.
78 | * }
79 | */
80 | public function __construct($data = NULL) {
81 | \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce();
82 | parent::__construct($data);
83 | }
84 |
85 | /**
86 | * Required. The location name in which the queue will be created.
87 | * For example: `projects/PROJECT_ID/locations/LOCATION_ID`
88 | * The list of allowed locations can be obtained by calling Cloud
89 | * Tasks' implementation of
90 | * [ListLocations][google.cloud.location.Locations.ListLocations].
91 | *
92 | * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
93 | * @return string
94 | */
95 | public function getParent()
96 | {
97 | return $this->parent;
98 | }
99 |
100 | /**
101 | * Required. The location name in which the queue will be created.
102 | * For example: `projects/PROJECT_ID/locations/LOCATION_ID`
103 | * The list of allowed locations can be obtained by calling Cloud
104 | * Tasks' implementation of
105 | * [ListLocations][google.cloud.location.Locations.ListLocations].
106 | *
107 | * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
108 | * @param string $var
109 | * @return $this
110 | */
111 | public function setParent($var)
112 | {
113 | GPBUtil::checkString($var, True);
114 | $this->parent = $var;
115 |
116 | return $this;
117 | }
118 |
119 | /**
120 | * Required. The queue to create.
121 | * [Queue's name][google.cloud.tasks.v2.Queue.name] cannot be the same as an
122 | * existing queue.
123 | *
124 | * Generated from protobuf field .google.cloud.tasks.v2.Queue queue = 2 [(.google.api.field_behavior) = REQUIRED];
125 | * @return \Google\Cloud\Tasks\V2\Queue|null
126 | */
127 | public function getQueue()
128 | {
129 | return $this->queue;
130 | }
131 |
132 | public function hasQueue()
133 | {
134 | return isset($this->queue);
135 | }
136 |
137 | public function clearQueue()
138 | {
139 | unset($this->queue);
140 | }
141 |
142 | /**
143 | * Required. The queue to create.
144 | * [Queue's name][google.cloud.tasks.v2.Queue.name] cannot be the same as an
145 | * existing queue.
146 | *
147 | * Generated from protobuf field .google.cloud.tasks.v2.Queue queue = 2 [(.google.api.field_behavior) = REQUIRED];
148 | * @param \Google\Cloud\Tasks\V2\Queue $var
149 | * @return $this
150 | */
151 | public function setQueue($var)
152 | {
153 | GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2\Queue::class);
154 | $this->queue = $var;
155 |
156 | return $this;
157 | }
158 |
159 | }
160 |
161 |
--------------------------------------------------------------------------------
/src/V2/UpdateQueueRequest.php:
--------------------------------------------------------------------------------
1 | google.cloud.tasks.v2.UpdateQueueRequest
16 | */
17 | class UpdateQueueRequest extends \Google\Protobuf\Internal\Message
18 | {
19 | /**
20 | * Required. The queue to create or update.
21 | * The queue's [name][google.cloud.tasks.v2.Queue.name] must be specified.
22 | * Output only fields cannot be modified using UpdateQueue.
23 | * Any value specified for an output only field will be ignored.
24 | * The queue's [name][google.cloud.tasks.v2.Queue.name] cannot be changed.
25 | *
26 | * Generated from protobuf field .google.cloud.tasks.v2.Queue queue = 1 [(.google.api.field_behavior) = REQUIRED];
27 | */
28 | protected $queue = null;
29 | /**
30 | * A mask used to specify which fields of the queue are being updated.
31 | * If empty, then all fields will be updated.
32 | *
33 | * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2;
34 | */
35 | protected $update_mask = null;
36 |
37 | /**
38 | * @param \Google\Cloud\Tasks\V2\Queue $queue Required. The queue to create or update.
39 | *
40 | * The queue's [name][google.cloud.tasks.v2.Queue.name] must be specified.
41 | *
42 | * Output only fields cannot be modified using UpdateQueue.
43 | * Any value specified for an output only field will be ignored.
44 | * The queue's [name][google.cloud.tasks.v2.Queue.name] cannot be changed.
45 | * @param \Google\Protobuf\FieldMask $updateMask A mask used to specify which fields of the queue are being updated.
46 | *
47 | * If empty, then all fields will be updated.
48 | *
49 | * @return \Google\Cloud\Tasks\V2\UpdateQueueRequest
50 | *
51 | * @experimental
52 | */
53 | public static function build(\Google\Cloud\Tasks\V2\Queue $queue, \Google\Protobuf\FieldMask $updateMask): self
54 | {
55 | return (new self())
56 | ->setQueue($queue)
57 | ->setUpdateMask($updateMask);
58 | }
59 |
60 | /**
61 | * Constructor.
62 | *
63 | * @param array $data {
64 | * Optional. Data for populating the Message object.
65 | *
66 | * @type \Google\Cloud\Tasks\V2\Queue $queue
67 | * Required. The queue to create or update.
68 | * The queue's [name][google.cloud.tasks.v2.Queue.name] must be specified.
69 | * Output only fields cannot be modified using UpdateQueue.
70 | * Any value specified for an output only field will be ignored.
71 | * The queue's [name][google.cloud.tasks.v2.Queue.name] cannot be changed.
72 | * @type \Google\Protobuf\FieldMask $update_mask
73 | * A mask used to specify which fields of the queue are being updated.
74 | * If empty, then all fields will be updated.
75 | * }
76 | */
77 | public function __construct($data = NULL) {
78 | \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce();
79 | parent::__construct($data);
80 | }
81 |
82 | /**
83 | * Required. The queue to create or update.
84 | * The queue's [name][google.cloud.tasks.v2.Queue.name] must be specified.
85 | * Output only fields cannot be modified using UpdateQueue.
86 | * Any value specified for an output only field will be ignored.
87 | * The queue's [name][google.cloud.tasks.v2.Queue.name] cannot be changed.
88 | *
89 | * Generated from protobuf field .google.cloud.tasks.v2.Queue queue = 1 [(.google.api.field_behavior) = REQUIRED];
90 | * @return \Google\Cloud\Tasks\V2\Queue|null
91 | */
92 | public function getQueue()
93 | {
94 | return $this->queue;
95 | }
96 |
97 | public function hasQueue()
98 | {
99 | return isset($this->queue);
100 | }
101 |
102 | public function clearQueue()
103 | {
104 | unset($this->queue);
105 | }
106 |
107 | /**
108 | * Required. The queue to create or update.
109 | * The queue's [name][google.cloud.tasks.v2.Queue.name] must be specified.
110 | * Output only fields cannot be modified using UpdateQueue.
111 | * Any value specified for an output only field will be ignored.
112 | * The queue's [name][google.cloud.tasks.v2.Queue.name] cannot be changed.
113 | *
114 | * Generated from protobuf field .google.cloud.tasks.v2.Queue queue = 1 [(.google.api.field_behavior) = REQUIRED];
115 | * @param \Google\Cloud\Tasks\V2\Queue $var
116 | * @return $this
117 | */
118 | public function setQueue($var)
119 | {
120 | GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2\Queue::class);
121 | $this->queue = $var;
122 |
123 | return $this;
124 | }
125 |
126 | /**
127 | * A mask used to specify which fields of the queue are being updated.
128 | * If empty, then all fields will be updated.
129 | *
130 | * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2;
131 | * @return \Google\Protobuf\FieldMask|null
132 | */
133 | public function getUpdateMask()
134 | {
135 | return $this->update_mask;
136 | }
137 |
138 | public function hasUpdateMask()
139 | {
140 | return isset($this->update_mask);
141 | }
142 |
143 | public function clearUpdateMask()
144 | {
145 | unset($this->update_mask);
146 | }
147 |
148 | /**
149 | * A mask used to specify which fields of the queue are being updated.
150 | * If empty, then all fields will be updated.
151 | *
152 | * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2;
153 | * @param \Google\Protobuf\FieldMask $var
154 | * @return $this
155 | */
156 | public function setUpdateMask($var)
157 | {
158 | GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class);
159 | $this->update_mask = $var;
160 |
161 | return $this;
162 | }
163 |
164 | }
165 |
166 |
--------------------------------------------------------------------------------
/src/V2/GetTaskRequest.php:
--------------------------------------------------------------------------------
1 | google.cloud.tasks.v2.GetTaskRequest
16 | */
17 | class GetTaskRequest extends \Google\Protobuf\Internal\Message
18 | {
19 | /**
20 | * Required. The task name. For example:
21 | * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
22 | *
23 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
24 | */
25 | protected $name = '';
26 | /**
27 | * The response_view specifies which subset of the
28 | * [Task][google.cloud.tasks.v2.Task] will be returned.
29 | * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC];
30 | * not all information is retrieved by default because some data, such as
31 | * payloads, might be desirable to return only when needed because
32 | * of its large size or because of the sensitivity of data that it
33 | * contains.
34 | * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires
35 | * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
36 | * permission on the [Task][google.cloud.tasks.v2.Task] resource.
37 | *
38 | * Generated from protobuf field .google.cloud.tasks.v2.Task.View response_view = 2;
39 | */
40 | protected $response_view = 0;
41 |
42 | /**
43 | * @param string $name Required. The task name. For example:
44 | * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
45 | * Please see {@see CloudTasksClient::taskName()} for help formatting this field.
46 | *
47 | * @return \Google\Cloud\Tasks\V2\GetTaskRequest
48 | *
49 | * @experimental
50 | */
51 | public static function build(string $name): self
52 | {
53 | return (new self())
54 | ->setName($name);
55 | }
56 |
57 | /**
58 | * Constructor.
59 | *
60 | * @param array $data {
61 | * Optional. Data for populating the Message object.
62 | *
63 | * @type string $name
64 | * Required. The task name. For example:
65 | * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
66 | * @type int $response_view
67 | * The response_view specifies which subset of the
68 | * [Task][google.cloud.tasks.v2.Task] will be returned.
69 | * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC];
70 | * not all information is retrieved by default because some data, such as
71 | * payloads, might be desirable to return only when needed because
72 | * of its large size or because of the sensitivity of data that it
73 | * contains.
74 | * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires
75 | * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
76 | * permission on the [Task][google.cloud.tasks.v2.Task] resource.
77 | * }
78 | */
79 | public function __construct($data = NULL) {
80 | \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce();
81 | parent::__construct($data);
82 | }
83 |
84 | /**
85 | * Required. The task name. For example:
86 | * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
87 | *
88 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
89 | * @return string
90 | */
91 | public function getName()
92 | {
93 | return $this->name;
94 | }
95 |
96 | /**
97 | * Required. The task name. For example:
98 | * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
99 | *
100 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
101 | * @param string $var
102 | * @return $this
103 | */
104 | public function setName($var)
105 | {
106 | GPBUtil::checkString($var, True);
107 | $this->name = $var;
108 |
109 | return $this;
110 | }
111 |
112 | /**
113 | * The response_view specifies which subset of the
114 | * [Task][google.cloud.tasks.v2.Task] will be returned.
115 | * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC];
116 | * not all information is retrieved by default because some data, such as
117 | * payloads, might be desirable to return only when needed because
118 | * of its large size or because of the sensitivity of data that it
119 | * contains.
120 | * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires
121 | * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
122 | * permission on the [Task][google.cloud.tasks.v2.Task] resource.
123 | *
124 | * Generated from protobuf field .google.cloud.tasks.v2.Task.View response_view = 2;
125 | * @return int
126 | */
127 | public function getResponseView()
128 | {
129 | return $this->response_view;
130 | }
131 |
132 | /**
133 | * The response_view specifies which subset of the
134 | * [Task][google.cloud.tasks.v2.Task] will be returned.
135 | * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC];
136 | * not all information is retrieved by default because some data, such as
137 | * payloads, might be desirable to return only when needed because
138 | * of its large size or because of the sensitivity of data that it
139 | * contains.
140 | * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires
141 | * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
142 | * permission on the [Task][google.cloud.tasks.v2.Task] resource.
143 | *
144 | * Generated from protobuf field .google.cloud.tasks.v2.Task.View response_view = 2;
145 | * @param int $var
146 | * @return $this
147 | */
148 | public function setResponseView($var)
149 | {
150 | GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2\Task\View::class);
151 | $this->response_view = $var;
152 |
153 | return $this;
154 | }
155 |
156 | }
157 |
158 |
--------------------------------------------------------------------------------
/src/V2/RunTaskRequest.php:
--------------------------------------------------------------------------------
1 | google.cloud.tasks.v2.RunTaskRequest
16 | */
17 | class RunTaskRequest extends \Google\Protobuf\Internal\Message
18 | {
19 | /**
20 | * Required. The task name. For example:
21 | * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
22 | *
23 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
24 | */
25 | protected $name = '';
26 | /**
27 | * The response_view specifies which subset of the
28 | * [Task][google.cloud.tasks.v2.Task] will be returned.
29 | * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC];
30 | * not all information is retrieved by default because some data, such as
31 | * payloads, might be desirable to return only when needed because
32 | * of its large size or because of the sensitivity of data that it
33 | * contains.
34 | * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires
35 | * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
36 | * permission on the [Task][google.cloud.tasks.v2.Task] resource.
37 | *
38 | * Generated from protobuf field .google.cloud.tasks.v2.Task.View response_view = 2;
39 | */
40 | protected $response_view = 0;
41 |
42 | /**
43 | * @param string $name Required. The task name. For example:
44 | * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
45 | * Please see {@see CloudTasksClient::taskName()} for help formatting this field.
46 | *
47 | * @return \Google\Cloud\Tasks\V2\RunTaskRequest
48 | *
49 | * @experimental
50 | */
51 | public static function build(string $name): self
52 | {
53 | return (new self())
54 | ->setName($name);
55 | }
56 |
57 | /**
58 | * Constructor.
59 | *
60 | * @param array $data {
61 | * Optional. Data for populating the Message object.
62 | *
63 | * @type string $name
64 | * Required. The task name. For example:
65 | * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
66 | * @type int $response_view
67 | * The response_view specifies which subset of the
68 | * [Task][google.cloud.tasks.v2.Task] will be returned.
69 | * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC];
70 | * not all information is retrieved by default because some data, such as
71 | * payloads, might be desirable to return only when needed because
72 | * of its large size or because of the sensitivity of data that it
73 | * contains.
74 | * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires
75 | * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
76 | * permission on the [Task][google.cloud.tasks.v2.Task] resource.
77 | * }
78 | */
79 | public function __construct($data = NULL) {
80 | \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce();
81 | parent::__construct($data);
82 | }
83 |
84 | /**
85 | * Required. The task name. For example:
86 | * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
87 | *
88 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
89 | * @return string
90 | */
91 | public function getName()
92 | {
93 | return $this->name;
94 | }
95 |
96 | /**
97 | * Required. The task name. For example:
98 | * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
99 | *
100 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
101 | * @param string $var
102 | * @return $this
103 | */
104 | public function setName($var)
105 | {
106 | GPBUtil::checkString($var, True);
107 | $this->name = $var;
108 |
109 | return $this;
110 | }
111 |
112 | /**
113 | * The response_view specifies which subset of the
114 | * [Task][google.cloud.tasks.v2.Task] will be returned.
115 | * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC];
116 | * not all information is retrieved by default because some data, such as
117 | * payloads, might be desirable to return only when needed because
118 | * of its large size or because of the sensitivity of data that it
119 | * contains.
120 | * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires
121 | * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
122 | * permission on the [Task][google.cloud.tasks.v2.Task] resource.
123 | *
124 | * Generated from protobuf field .google.cloud.tasks.v2.Task.View response_view = 2;
125 | * @return int
126 | */
127 | public function getResponseView()
128 | {
129 | return $this->response_view;
130 | }
131 |
132 | /**
133 | * The response_view specifies which subset of the
134 | * [Task][google.cloud.tasks.v2.Task] will be returned.
135 | * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC];
136 | * not all information is retrieved by default because some data, such as
137 | * payloads, might be desirable to return only when needed because
138 | * of its large size or because of the sensitivity of data that it
139 | * contains.
140 | * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires
141 | * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
142 | * permission on the [Task][google.cloud.tasks.v2.Task] resource.
143 | *
144 | * Generated from protobuf field .google.cloud.tasks.v2.Task.View response_view = 2;
145 | * @param int $var
146 | * @return $this
147 | */
148 | public function setResponseView($var)
149 | {
150 | GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2\Task\View::class);
151 | $this->response_view = $var;
152 |
153 | return $this;
154 | }
155 |
156 | }
157 |
158 |
--------------------------------------------------------------------------------
/src/V2/Attempt.php:
--------------------------------------------------------------------------------
1 | google.cloud.tasks.v2.Attempt
15 | */
16 | class Attempt extends \Google\Protobuf\Internal\Message
17 | {
18 | /**
19 | * Output only. The time that this attempt was scheduled.
20 | * `schedule_time` will be truncated to the nearest microsecond.
21 | *
22 | * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 1;
23 | */
24 | protected $schedule_time = null;
25 | /**
26 | * Output only. The time that this attempt was dispatched.
27 | * `dispatch_time` will be truncated to the nearest microsecond.
28 | *
29 | * Generated from protobuf field .google.protobuf.Timestamp dispatch_time = 2;
30 | */
31 | protected $dispatch_time = null;
32 | /**
33 | * Output only. The time that this attempt response was received.
34 | * `response_time` will be truncated to the nearest microsecond.
35 | *
36 | * Generated from protobuf field .google.protobuf.Timestamp response_time = 3;
37 | */
38 | protected $response_time = null;
39 | /**
40 | * Output only. The response from the worker for this attempt.
41 | * If `response_time` is unset, then the task has not been attempted or is
42 | * currently running and the `response_status` field is meaningless.
43 | *
44 | * Generated from protobuf field .google.rpc.Status response_status = 4;
45 | */
46 | protected $response_status = null;
47 |
48 | /**
49 | * Constructor.
50 | *
51 | * @param array $data {
52 | * Optional. Data for populating the Message object.
53 | *
54 | * @type \Google\Protobuf\Timestamp $schedule_time
55 | * Output only. The time that this attempt was scheduled.
56 | * `schedule_time` will be truncated to the nearest microsecond.
57 | * @type \Google\Protobuf\Timestamp $dispatch_time
58 | * Output only. The time that this attempt was dispatched.
59 | * `dispatch_time` will be truncated to the nearest microsecond.
60 | * @type \Google\Protobuf\Timestamp $response_time
61 | * Output only. The time that this attempt response was received.
62 | * `response_time` will be truncated to the nearest microsecond.
63 | * @type \Google\Rpc\Status $response_status
64 | * Output only. The response from the worker for this attempt.
65 | * If `response_time` is unset, then the task has not been attempted or is
66 | * currently running and the `response_status` field is meaningless.
67 | * }
68 | */
69 | public function __construct($data = NULL) {
70 | \GPBMetadata\Google\Cloud\Tasks\V2\Task::initOnce();
71 | parent::__construct($data);
72 | }
73 |
74 | /**
75 | * Output only. The time that this attempt was scheduled.
76 | * `schedule_time` will be truncated to the nearest microsecond.
77 | *
78 | * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 1;
79 | * @return \Google\Protobuf\Timestamp|null
80 | */
81 | public function getScheduleTime()
82 | {
83 | return $this->schedule_time;
84 | }
85 |
86 | public function hasScheduleTime()
87 | {
88 | return isset($this->schedule_time);
89 | }
90 |
91 | public function clearScheduleTime()
92 | {
93 | unset($this->schedule_time);
94 | }
95 |
96 | /**
97 | * Output only. The time that this attempt was scheduled.
98 | * `schedule_time` will be truncated to the nearest microsecond.
99 | *
100 | * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 1;
101 | * @param \Google\Protobuf\Timestamp $var
102 | * @return $this
103 | */
104 | public function setScheduleTime($var)
105 | {
106 | GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
107 | $this->schedule_time = $var;
108 |
109 | return $this;
110 | }
111 |
112 | /**
113 | * Output only. The time that this attempt was dispatched.
114 | * `dispatch_time` will be truncated to the nearest microsecond.
115 | *
116 | * Generated from protobuf field .google.protobuf.Timestamp dispatch_time = 2;
117 | * @return \Google\Protobuf\Timestamp|null
118 | */
119 | public function getDispatchTime()
120 | {
121 | return $this->dispatch_time;
122 | }
123 |
124 | public function hasDispatchTime()
125 | {
126 | return isset($this->dispatch_time);
127 | }
128 |
129 | public function clearDispatchTime()
130 | {
131 | unset($this->dispatch_time);
132 | }
133 |
134 | /**
135 | * Output only. The time that this attempt was dispatched.
136 | * `dispatch_time` will be truncated to the nearest microsecond.
137 | *
138 | * Generated from protobuf field .google.protobuf.Timestamp dispatch_time = 2;
139 | * @param \Google\Protobuf\Timestamp $var
140 | * @return $this
141 | */
142 | public function setDispatchTime($var)
143 | {
144 | GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
145 | $this->dispatch_time = $var;
146 |
147 | return $this;
148 | }
149 |
150 | /**
151 | * Output only. The time that this attempt response was received.
152 | * `response_time` will be truncated to the nearest microsecond.
153 | *
154 | * Generated from protobuf field .google.protobuf.Timestamp response_time = 3;
155 | * @return \Google\Protobuf\Timestamp|null
156 | */
157 | public function getResponseTime()
158 | {
159 | return $this->response_time;
160 | }
161 |
162 | public function hasResponseTime()
163 | {
164 | return isset($this->response_time);
165 | }
166 |
167 | public function clearResponseTime()
168 | {
169 | unset($this->response_time);
170 | }
171 |
172 | /**
173 | * Output only. The time that this attempt response was received.
174 | * `response_time` will be truncated to the nearest microsecond.
175 | *
176 | * Generated from protobuf field .google.protobuf.Timestamp response_time = 3;
177 | * @param \Google\Protobuf\Timestamp $var
178 | * @return $this
179 | */
180 | public function setResponseTime($var)
181 | {
182 | GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
183 | $this->response_time = $var;
184 |
185 | return $this;
186 | }
187 |
188 | /**
189 | * Output only. The response from the worker for this attempt.
190 | * If `response_time` is unset, then the task has not been attempted or is
191 | * currently running and the `response_status` field is meaningless.
192 | *
193 | * Generated from protobuf field .google.rpc.Status response_status = 4;
194 | * @return \Google\Rpc\Status|null
195 | */
196 | public function getResponseStatus()
197 | {
198 | return $this->response_status;
199 | }
200 |
201 | public function hasResponseStatus()
202 | {
203 | return isset($this->response_status);
204 | }
205 |
206 | public function clearResponseStatus()
207 | {
208 | unset($this->response_status);
209 | }
210 |
211 | /**
212 | * Output only. The response from the worker for this attempt.
213 | * If `response_time` is unset, then the task has not been attempted or is
214 | * currently running and the `response_status` field is meaningless.
215 | *
216 | * Generated from protobuf field .google.rpc.Status response_status = 4;
217 | * @param \Google\Rpc\Status $var
218 | * @return $this
219 | */
220 | public function setResponseStatus($var)
221 | {
222 | GPBUtil::checkMessage($var, \Google\Rpc\Status::class);
223 | $this->response_status = $var;
224 |
225 | return $this;
226 | }
227 |
228 | }
229 |
230 |
--------------------------------------------------------------------------------
/src/V2/resources/cloud_tasks_rest_client_config.php:
--------------------------------------------------------------------------------
1 | [
25 | 'google.cloud.location.Locations' => [
26 | 'GetLocation' => [
27 | 'method' => 'get',
28 | 'uriTemplate' => '/v2/{name=projects/*/locations/*}',
29 | 'placeholders' => [
30 | 'name' => [
31 | 'getters' => [
32 | 'getName',
33 | ],
34 | ],
35 | ],
36 | ],
37 | 'ListLocations' => [
38 | 'method' => 'get',
39 | 'uriTemplate' => '/v2/{name=projects/*}/locations',
40 | 'placeholders' => [
41 | 'name' => [
42 | 'getters' => [
43 | 'getName',
44 | ],
45 | ],
46 | ],
47 | ],
48 | ],
49 | 'google.cloud.tasks.v2.CloudTasks' => [
50 | 'CreateQueue' => [
51 | 'method' => 'post',
52 | 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/queues',
53 | 'body' => 'queue',
54 | 'placeholders' => [
55 | 'parent' => [
56 | 'getters' => [
57 | 'getParent',
58 | ],
59 | ],
60 | ],
61 | ],
62 | 'CreateTask' => [
63 | 'method' => 'post',
64 | 'uriTemplate' => '/v2/{parent=projects/*/locations/*/queues/*}/tasks',
65 | 'body' => '*',
66 | 'placeholders' => [
67 | 'parent' => [
68 | 'getters' => [
69 | 'getParent',
70 | ],
71 | ],
72 | ],
73 | ],
74 | 'DeleteQueue' => [
75 | 'method' => 'delete',
76 | 'uriTemplate' => '/v2/{name=projects/*/locations/*/queues/*}',
77 | 'placeholders' => [
78 | 'name' => [
79 | 'getters' => [
80 | 'getName',
81 | ],
82 | ],
83 | ],
84 | ],
85 | 'DeleteTask' => [
86 | 'method' => 'delete',
87 | 'uriTemplate' => '/v2/{name=projects/*/locations/*/queues/*/tasks/*}',
88 | 'placeholders' => [
89 | 'name' => [
90 | 'getters' => [
91 | 'getName',
92 | ],
93 | ],
94 | ],
95 | ],
96 | 'GetIamPolicy' => [
97 | 'method' => 'post',
98 | 'uriTemplate' => '/v2/{resource=projects/*/locations/*/queues/*}:getIamPolicy',
99 | 'body' => '*',
100 | 'placeholders' => [
101 | 'resource' => [
102 | 'getters' => [
103 | 'getResource',
104 | ],
105 | ],
106 | ],
107 | ],
108 | 'GetQueue' => [
109 | 'method' => 'get',
110 | 'uriTemplate' => '/v2/{name=projects/*/locations/*/queues/*}',
111 | 'placeholders' => [
112 | 'name' => [
113 | 'getters' => [
114 | 'getName',
115 | ],
116 | ],
117 | ],
118 | ],
119 | 'GetTask' => [
120 | 'method' => 'get',
121 | 'uriTemplate' => '/v2/{name=projects/*/locations/*/queues/*/tasks/*}',
122 | 'placeholders' => [
123 | 'name' => [
124 | 'getters' => [
125 | 'getName',
126 | ],
127 | ],
128 | ],
129 | ],
130 | 'ListQueues' => [
131 | 'method' => 'get',
132 | 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/queues',
133 | 'placeholders' => [
134 | 'parent' => [
135 | 'getters' => [
136 | 'getParent',
137 | ],
138 | ],
139 | ],
140 | ],
141 | 'ListTasks' => [
142 | 'method' => 'get',
143 | 'uriTemplate' => '/v2/{parent=projects/*/locations/*/queues/*}/tasks',
144 | 'placeholders' => [
145 | 'parent' => [
146 | 'getters' => [
147 | 'getParent',
148 | ],
149 | ],
150 | ],
151 | ],
152 | 'PauseQueue' => [
153 | 'method' => 'post',
154 | 'uriTemplate' => '/v2/{name=projects/*/locations/*/queues/*}:pause',
155 | 'body' => '*',
156 | 'placeholders' => [
157 | 'name' => [
158 | 'getters' => [
159 | 'getName',
160 | ],
161 | ],
162 | ],
163 | ],
164 | 'PurgeQueue' => [
165 | 'method' => 'post',
166 | 'uriTemplate' => '/v2/{name=projects/*/locations/*/queues/*}:purge',
167 | 'body' => '*',
168 | 'placeholders' => [
169 | 'name' => [
170 | 'getters' => [
171 | 'getName',
172 | ],
173 | ],
174 | ],
175 | ],
176 | 'ResumeQueue' => [
177 | 'method' => 'post',
178 | 'uriTemplate' => '/v2/{name=projects/*/locations/*/queues/*}:resume',
179 | 'body' => '*',
180 | 'placeholders' => [
181 | 'name' => [
182 | 'getters' => [
183 | 'getName',
184 | ],
185 | ],
186 | ],
187 | ],
188 | 'RunTask' => [
189 | 'method' => 'post',
190 | 'uriTemplate' => '/v2/{name=projects/*/locations/*/queues/*/tasks/*}:run',
191 | 'body' => '*',
192 | 'placeholders' => [
193 | 'name' => [
194 | 'getters' => [
195 | 'getName',
196 | ],
197 | ],
198 | ],
199 | ],
200 | 'SetIamPolicy' => [
201 | 'method' => 'post',
202 | 'uriTemplate' => '/v2/{resource=projects/*/locations/*/queues/*}:setIamPolicy',
203 | 'body' => '*',
204 | 'placeholders' => [
205 | 'resource' => [
206 | 'getters' => [
207 | 'getResource',
208 | ],
209 | ],
210 | ],
211 | ],
212 | 'TestIamPermissions' => [
213 | 'method' => 'post',
214 | 'uriTemplate' => '/v2/{resource=projects/*/locations/*/queues/*}:testIamPermissions',
215 | 'body' => '*',
216 | 'placeholders' => [
217 | 'resource' => [
218 | 'getters' => [
219 | 'getResource',
220 | ],
221 | ],
222 | ],
223 | ],
224 | 'UpdateQueue' => [
225 | 'method' => 'patch',
226 | 'uriTemplate' => '/v2/{queue.name=projects/*/locations/*/queues/*}',
227 | 'body' => 'queue',
228 | 'placeholders' => [
229 | 'queue.name' => [
230 | 'getters' => [
231 | 'getQueue',
232 | 'getName',
233 | ],
234 | ],
235 | ],
236 | ],
237 | ],
238 | ],
239 | 'numericEnums' => true,
240 | ];
241 |
--------------------------------------------------------------------------------
/src/V2/ListQueuesRequest.php:
--------------------------------------------------------------------------------
1 | google.cloud.tasks.v2.ListQueuesRequest
16 | */
17 | class ListQueuesRequest extends \Google\Protobuf\Internal\Message
18 | {
19 | /**
20 | * Required. The location name.
21 | * For example: `projects/PROJECT_ID/locations/LOCATION_ID`
22 | *
23 | * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
24 | */
25 | protected $parent = '';
26 | /**
27 | * `filter` can be used to specify a subset of queues. Any
28 | * [Queue][google.cloud.tasks.v2.Queue] field can be used as a filter and
29 | * several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The
30 | * filter syntax is the same as described in [Stackdriver's Advanced Logs
31 | * Filters](https://cloud.google.com/logging/docs/view/advanced_filters).
32 | * Sample filter "state: PAUSED".
33 | * Note that using filters might cause fewer queues than the
34 | * requested page_size to be returned.
35 | *
36 | * Generated from protobuf field string filter = 2;
37 | */
38 | protected $filter = '';
39 | /**
40 | * Requested page size.
41 | * The maximum page size is 9800. If unspecified, the page size will
42 | * be the maximum. Fewer queues than requested might be returned,
43 | * even if more queues exist; use the
44 | * [next_page_token][google.cloud.tasks.v2.ListQueuesResponse.next_page_token]
45 | * in the response to determine if more queues exist.
46 | *
47 | * Generated from protobuf field int32 page_size = 3;
48 | */
49 | protected $page_size = 0;
50 | /**
51 | * A token identifying the page of results to return.
52 | * To request the first page results, page_token must be empty. To
53 | * request the next page of results, page_token must be the value of
54 | * [next_page_token][google.cloud.tasks.v2.ListQueuesResponse.next_page_token]
55 | * returned from the previous call to
56 | * [ListQueues][google.cloud.tasks.v2.CloudTasks.ListQueues] method. It is an
57 | * error to switch the value of the
58 | * [filter][google.cloud.tasks.v2.ListQueuesRequest.filter] while iterating
59 | * through pages.
60 | *
61 | * Generated from protobuf field string page_token = 4;
62 | */
63 | protected $page_token = '';
64 |
65 | /**
66 | * @param string $parent Required. The location name.
67 | * For example: `projects/PROJECT_ID/locations/LOCATION_ID`
68 | * Please see {@see CloudTasksClient::locationName()} for help formatting this field.
69 | *
70 | * @return \Google\Cloud\Tasks\V2\ListQueuesRequest
71 | *
72 | * @experimental
73 | */
74 | public static function build(string $parent): self
75 | {
76 | return (new self())
77 | ->setParent($parent);
78 | }
79 |
80 | /**
81 | * Constructor.
82 | *
83 | * @param array $data {
84 | * Optional. Data for populating the Message object.
85 | *
86 | * @type string $parent
87 | * Required. The location name.
88 | * For example: `projects/PROJECT_ID/locations/LOCATION_ID`
89 | * @type string $filter
90 | * `filter` can be used to specify a subset of queues. Any
91 | * [Queue][google.cloud.tasks.v2.Queue] field can be used as a filter and
92 | * several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The
93 | * filter syntax is the same as described in [Stackdriver's Advanced Logs
94 | * Filters](https://cloud.google.com/logging/docs/view/advanced_filters).
95 | * Sample filter "state: PAUSED".
96 | * Note that using filters might cause fewer queues than the
97 | * requested page_size to be returned.
98 | * @type int $page_size
99 | * Requested page size.
100 | * The maximum page size is 9800. If unspecified, the page size will
101 | * be the maximum. Fewer queues than requested might be returned,
102 | * even if more queues exist; use the
103 | * [next_page_token][google.cloud.tasks.v2.ListQueuesResponse.next_page_token]
104 | * in the response to determine if more queues exist.
105 | * @type string $page_token
106 | * A token identifying the page of results to return.
107 | * To request the first page results, page_token must be empty. To
108 | * request the next page of results, page_token must be the value of
109 | * [next_page_token][google.cloud.tasks.v2.ListQueuesResponse.next_page_token]
110 | * returned from the previous call to
111 | * [ListQueues][google.cloud.tasks.v2.CloudTasks.ListQueues] method. It is an
112 | * error to switch the value of the
113 | * [filter][google.cloud.tasks.v2.ListQueuesRequest.filter] while iterating
114 | * through pages.
115 | * }
116 | */
117 | public function __construct($data = NULL) {
118 | \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce();
119 | parent::__construct($data);
120 | }
121 |
122 | /**
123 | * Required. The location name.
124 | * For example: `projects/PROJECT_ID/locations/LOCATION_ID`
125 | *
126 | * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
127 | * @return string
128 | */
129 | public function getParent()
130 | {
131 | return $this->parent;
132 | }
133 |
134 | /**
135 | * Required. The location name.
136 | * For example: `projects/PROJECT_ID/locations/LOCATION_ID`
137 | *
138 | * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
139 | * @param string $var
140 | * @return $this
141 | */
142 | public function setParent($var)
143 | {
144 | GPBUtil::checkString($var, True);
145 | $this->parent = $var;
146 |
147 | return $this;
148 | }
149 |
150 | /**
151 | * `filter` can be used to specify a subset of queues. Any
152 | * [Queue][google.cloud.tasks.v2.Queue] field can be used as a filter and
153 | * several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The
154 | * filter syntax is the same as described in [Stackdriver's Advanced Logs
155 | * Filters](https://cloud.google.com/logging/docs/view/advanced_filters).
156 | * Sample filter "state: PAUSED".
157 | * Note that using filters might cause fewer queues than the
158 | * requested page_size to be returned.
159 | *
160 | * Generated from protobuf field string filter = 2;
161 | * @return string
162 | */
163 | public function getFilter()
164 | {
165 | return $this->filter;
166 | }
167 |
168 | /**
169 | * `filter` can be used to specify a subset of queues. Any
170 | * [Queue][google.cloud.tasks.v2.Queue] field can be used as a filter and
171 | * several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The
172 | * filter syntax is the same as described in [Stackdriver's Advanced Logs
173 | * Filters](https://cloud.google.com/logging/docs/view/advanced_filters).
174 | * Sample filter "state: PAUSED".
175 | * Note that using filters might cause fewer queues than the
176 | * requested page_size to be returned.
177 | *
178 | * Generated from protobuf field string filter = 2;
179 | * @param string $var
180 | * @return $this
181 | */
182 | public function setFilter($var)
183 | {
184 | GPBUtil::checkString($var, True);
185 | $this->filter = $var;
186 |
187 | return $this;
188 | }
189 |
190 | /**
191 | * Requested page size.
192 | * The maximum page size is 9800. If unspecified, the page size will
193 | * be the maximum. Fewer queues than requested might be returned,
194 | * even if more queues exist; use the
195 | * [next_page_token][google.cloud.tasks.v2.ListQueuesResponse.next_page_token]
196 | * in the response to determine if more queues exist.
197 | *
198 | * Generated from protobuf field int32 page_size = 3;
199 | * @return int
200 | */
201 | public function getPageSize()
202 | {
203 | return $this->page_size;
204 | }
205 |
206 | /**
207 | * Requested page size.
208 | * The maximum page size is 9800. If unspecified, the page size will
209 | * be the maximum. Fewer queues than requested might be returned,
210 | * even if more queues exist; use the
211 | * [next_page_token][google.cloud.tasks.v2.ListQueuesResponse.next_page_token]
212 | * in the response to determine if more queues exist.
213 | *
214 | * Generated from protobuf field int32 page_size = 3;
215 | * @param int $var
216 | * @return $this
217 | */
218 | public function setPageSize($var)
219 | {
220 | GPBUtil::checkInt32($var);
221 | $this->page_size = $var;
222 |
223 | return $this;
224 | }
225 |
226 | /**
227 | * A token identifying the page of results to return.
228 | * To request the first page results, page_token must be empty. To
229 | * request the next page of results, page_token must be the value of
230 | * [next_page_token][google.cloud.tasks.v2.ListQueuesResponse.next_page_token]
231 | * returned from the previous call to
232 | * [ListQueues][google.cloud.tasks.v2.CloudTasks.ListQueues] method. It is an
233 | * error to switch the value of the
234 | * [filter][google.cloud.tasks.v2.ListQueuesRequest.filter] while iterating
235 | * through pages.
236 | *
237 | * Generated from protobuf field string page_token = 4;
238 | * @return string
239 | */
240 | public function getPageToken()
241 | {
242 | return $this->page_token;
243 | }
244 |
245 | /**
246 | * A token identifying the page of results to return.
247 | * To request the first page results, page_token must be empty. To
248 | * request the next page of results, page_token must be the value of
249 | * [next_page_token][google.cloud.tasks.v2.ListQueuesResponse.next_page_token]
250 | * returned from the previous call to
251 | * [ListQueues][google.cloud.tasks.v2.CloudTasks.ListQueues] method. It is an
252 | * error to switch the value of the
253 | * [filter][google.cloud.tasks.v2.ListQueuesRequest.filter] while iterating
254 | * through pages.
255 | *
256 | * Generated from protobuf field string page_token = 4;
257 | * @param string $var
258 | * @return $this
259 | */
260 | public function setPageToken($var)
261 | {
262 | GPBUtil::checkString($var, True);
263 | $this->page_token = $var;
264 |
265 | return $this;
266 | }
267 |
268 | }
269 |
270 |
--------------------------------------------------------------------------------
/src/V2/resources/cloud_tasks_descriptor_config.php:
--------------------------------------------------------------------------------
1 | [
25 | 'google.cloud.tasks.v2.CloudTasks' => [
26 | 'CreateQueue' => [
27 | 'callType' => \Google\ApiCore\Call::UNARY_CALL,
28 | 'responseType' => 'Google\Cloud\Tasks\V2\Queue',
29 | 'headerParams' => [
30 | [
31 | 'keyName' => 'parent',
32 | 'fieldAccessors' => [
33 | 'getParent',
34 | ],
35 | ],
36 | ],
37 | ],
38 | 'CreateTask' => [
39 | 'callType' => \Google\ApiCore\Call::UNARY_CALL,
40 | 'responseType' => 'Google\Cloud\Tasks\V2\Task',
41 | 'headerParams' => [
42 | [
43 | 'keyName' => 'parent',
44 | 'fieldAccessors' => [
45 | 'getParent',
46 | ],
47 | ],
48 | ],
49 | ],
50 | 'DeleteQueue' => [
51 | 'callType' => \Google\ApiCore\Call::UNARY_CALL,
52 | 'responseType' => 'Google\Protobuf\GPBEmpty',
53 | 'headerParams' => [
54 | [
55 | 'keyName' => 'name',
56 | 'fieldAccessors' => [
57 | 'getName',
58 | ],
59 | ],
60 | ],
61 | ],
62 | 'DeleteTask' => [
63 | 'callType' => \Google\ApiCore\Call::UNARY_CALL,
64 | 'responseType' => 'Google\Protobuf\GPBEmpty',
65 | 'headerParams' => [
66 | [
67 | 'keyName' => 'name',
68 | 'fieldAccessors' => [
69 | 'getName',
70 | ],
71 | ],
72 | ],
73 | ],
74 | 'GetIamPolicy' => [
75 | 'callType' => \Google\ApiCore\Call::UNARY_CALL,
76 | 'responseType' => 'Google\Cloud\Iam\V1\Policy',
77 | 'headerParams' => [
78 | [
79 | 'keyName' => 'resource',
80 | 'fieldAccessors' => [
81 | 'getResource',
82 | ],
83 | ],
84 | ],
85 | ],
86 | 'GetQueue' => [
87 | 'callType' => \Google\ApiCore\Call::UNARY_CALL,
88 | 'responseType' => 'Google\Cloud\Tasks\V2\Queue',
89 | 'headerParams' => [
90 | [
91 | 'keyName' => 'name',
92 | 'fieldAccessors' => [
93 | 'getName',
94 | ],
95 | ],
96 | ],
97 | ],
98 | 'GetTask' => [
99 | 'callType' => \Google\ApiCore\Call::UNARY_CALL,
100 | 'responseType' => 'Google\Cloud\Tasks\V2\Task',
101 | 'headerParams' => [
102 | [
103 | 'keyName' => 'name',
104 | 'fieldAccessors' => [
105 | 'getName',
106 | ],
107 | ],
108 | ],
109 | ],
110 | 'ListQueues' => [
111 | 'pageStreaming' => [
112 | 'requestPageTokenGetMethod' => 'getPageToken',
113 | 'requestPageTokenSetMethod' => 'setPageToken',
114 | 'requestPageSizeGetMethod' => 'getPageSize',
115 | 'requestPageSizeSetMethod' => 'setPageSize',
116 | 'responsePageTokenGetMethod' => 'getNextPageToken',
117 | 'resourcesGetMethod' => 'getQueues',
118 | ],
119 | 'callType' => \Google\ApiCore\Call::PAGINATED_CALL,
120 | 'responseType' => 'Google\Cloud\Tasks\V2\ListQueuesResponse',
121 | 'headerParams' => [
122 | [
123 | 'keyName' => 'parent',
124 | 'fieldAccessors' => [
125 | 'getParent',
126 | ],
127 | ],
128 | ],
129 | ],
130 | 'ListTasks' => [
131 | 'pageStreaming' => [
132 | 'requestPageTokenGetMethod' => 'getPageToken',
133 | 'requestPageTokenSetMethod' => 'setPageToken',
134 | 'requestPageSizeGetMethod' => 'getPageSize',
135 | 'requestPageSizeSetMethod' => 'setPageSize',
136 | 'responsePageTokenGetMethod' => 'getNextPageToken',
137 | 'resourcesGetMethod' => 'getTasks',
138 | ],
139 | 'callType' => \Google\ApiCore\Call::PAGINATED_CALL,
140 | 'responseType' => 'Google\Cloud\Tasks\V2\ListTasksResponse',
141 | 'headerParams' => [
142 | [
143 | 'keyName' => 'parent',
144 | 'fieldAccessors' => [
145 | 'getParent',
146 | ],
147 | ],
148 | ],
149 | ],
150 | 'PauseQueue' => [
151 | 'callType' => \Google\ApiCore\Call::UNARY_CALL,
152 | 'responseType' => 'Google\Cloud\Tasks\V2\Queue',
153 | 'headerParams' => [
154 | [
155 | 'keyName' => 'name',
156 | 'fieldAccessors' => [
157 | 'getName',
158 | ],
159 | ],
160 | ],
161 | ],
162 | 'PurgeQueue' => [
163 | 'callType' => \Google\ApiCore\Call::UNARY_CALL,
164 | 'responseType' => 'Google\Cloud\Tasks\V2\Queue',
165 | 'headerParams' => [
166 | [
167 | 'keyName' => 'name',
168 | 'fieldAccessors' => [
169 | 'getName',
170 | ],
171 | ],
172 | ],
173 | ],
174 | 'ResumeQueue' => [
175 | 'callType' => \Google\ApiCore\Call::UNARY_CALL,
176 | 'responseType' => 'Google\Cloud\Tasks\V2\Queue',
177 | 'headerParams' => [
178 | [
179 | 'keyName' => 'name',
180 | 'fieldAccessors' => [
181 | 'getName',
182 | ],
183 | ],
184 | ],
185 | ],
186 | 'RunTask' => [
187 | 'callType' => \Google\ApiCore\Call::UNARY_CALL,
188 | 'responseType' => 'Google\Cloud\Tasks\V2\Task',
189 | 'headerParams' => [
190 | [
191 | 'keyName' => 'name',
192 | 'fieldAccessors' => [
193 | 'getName',
194 | ],
195 | ],
196 | ],
197 | ],
198 | 'SetIamPolicy' => [
199 | 'callType' => \Google\ApiCore\Call::UNARY_CALL,
200 | 'responseType' => 'Google\Cloud\Iam\V1\Policy',
201 | 'headerParams' => [
202 | [
203 | 'keyName' => 'resource',
204 | 'fieldAccessors' => [
205 | 'getResource',
206 | ],
207 | ],
208 | ],
209 | ],
210 | 'TestIamPermissions' => [
211 | 'callType' => \Google\ApiCore\Call::UNARY_CALL,
212 | 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse',
213 | 'headerParams' => [
214 | [
215 | 'keyName' => 'resource',
216 | 'fieldAccessors' => [
217 | 'getResource',
218 | ],
219 | ],
220 | ],
221 | ],
222 | 'UpdateQueue' => [
223 | 'callType' => \Google\ApiCore\Call::UNARY_CALL,
224 | 'responseType' => 'Google\Cloud\Tasks\V2\Queue',
225 | 'headerParams' => [
226 | [
227 | 'keyName' => 'queue.name',
228 | 'fieldAccessors' => [
229 | 'getQueue',
230 | 'getName',
231 | ],
232 | ],
233 | ],
234 | ],
235 | 'GetLocation' => [
236 | 'callType' => \Google\ApiCore\Call::UNARY_CALL,
237 | 'responseType' => 'Google\Cloud\Location\Location',
238 | 'headerParams' => [
239 | [
240 | 'keyName' => 'name',
241 | 'fieldAccessors' => [
242 | 'getName',
243 | ],
244 | ],
245 | ],
246 | 'interfaceOverride' => 'google.cloud.location.Locations',
247 | ],
248 | 'ListLocations' => [
249 | 'pageStreaming' => [
250 | 'requestPageTokenGetMethod' => 'getPageToken',
251 | 'requestPageTokenSetMethod' => 'setPageToken',
252 | 'requestPageSizeGetMethod' => 'getPageSize',
253 | 'requestPageSizeSetMethod' => 'setPageSize',
254 | 'responsePageTokenGetMethod' => 'getNextPageToken',
255 | 'resourcesGetMethod' => 'getLocations',
256 | ],
257 | 'callType' => \Google\ApiCore\Call::PAGINATED_CALL,
258 | 'responseType' => 'Google\Cloud\Location\ListLocationsResponse',
259 | 'headerParams' => [
260 | [
261 | 'keyName' => 'name',
262 | 'fieldAccessors' => [
263 | 'getName',
264 | ],
265 | ],
266 | ],
267 | 'interfaceOverride' => 'google.cloud.location.Locations',
268 | ],
269 | 'templateMap' => [
270 | 'location' => 'projects/{project}/locations/{location}',
271 | 'queue' => 'projects/{project}/locations/{location}/queues/{queue}',
272 | 'task' => 'projects/{project}/locations/{location}/queues/{queue}/tasks/{task}',
273 | ],
274 | ],
275 | ],
276 | ];
277 |
--------------------------------------------------------------------------------
/src/V2/ListTasksRequest.php:
--------------------------------------------------------------------------------
1 | google.cloud.tasks.v2.ListTasksRequest
16 | */
17 | class ListTasksRequest extends \Google\Protobuf\Internal\Message
18 | {
19 | /**
20 | * Required. The queue name. For example:
21 | * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
22 | *
23 | * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
24 | */
25 | protected $parent = '';
26 | /**
27 | * The response_view specifies which subset of the
28 | * [Task][google.cloud.tasks.v2.Task] will be returned.
29 | * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC];
30 | * not all information is retrieved by default because some data, such as
31 | * payloads, might be desirable to return only when needed because
32 | * of its large size or because of the sensitivity of data that it
33 | * contains.
34 | * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires
35 | * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
36 | * permission on the [Task][google.cloud.tasks.v2.Task] resource.
37 | *
38 | * Generated from protobuf field .google.cloud.tasks.v2.Task.View response_view = 2;
39 | */
40 | protected $response_view = 0;
41 | /**
42 | * Maximum page size.
43 | * Fewer tasks than requested might be returned, even if more tasks exist; use
44 | * [next_page_token][google.cloud.tasks.v2.ListTasksResponse.next_page_token]
45 | * in the response to determine if more tasks exist.
46 | * The maximum page size is 1000. If unspecified, the page size will be the
47 | * maximum.
48 | *
49 | * Generated from protobuf field int32 page_size = 3;
50 | */
51 | protected $page_size = 0;
52 | /**
53 | * A token identifying the page of results to return.
54 | * To request the first page results, page_token must be empty. To
55 | * request the next page of results, page_token must be the value of
56 | * [next_page_token][google.cloud.tasks.v2.ListTasksResponse.next_page_token]
57 | * returned from the previous call to
58 | * [ListTasks][google.cloud.tasks.v2.CloudTasks.ListTasks] method.
59 | * The page token is valid for only 2 hours.
60 | *
61 | * Generated from protobuf field string page_token = 4;
62 | */
63 | protected $page_token = '';
64 |
65 | /**
66 | * @param string $parent Required. The queue name. For example:
67 | * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
68 | * Please see {@see CloudTasksClient::queueName()} for help formatting this field.
69 | *
70 | * @return \Google\Cloud\Tasks\V2\ListTasksRequest
71 | *
72 | * @experimental
73 | */
74 | public static function build(string $parent): self
75 | {
76 | return (new self())
77 | ->setParent($parent);
78 | }
79 |
80 | /**
81 | * Constructor.
82 | *
83 | * @param array $data {
84 | * Optional. Data for populating the Message object.
85 | *
86 | * @type string $parent
87 | * Required. The queue name. For example:
88 | * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
89 | * @type int $response_view
90 | * The response_view specifies which subset of the
91 | * [Task][google.cloud.tasks.v2.Task] will be returned.
92 | * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC];
93 | * not all information is retrieved by default because some data, such as
94 | * payloads, might be desirable to return only when needed because
95 | * of its large size or because of the sensitivity of data that it
96 | * contains.
97 | * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires
98 | * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
99 | * permission on the [Task][google.cloud.tasks.v2.Task] resource.
100 | * @type int $page_size
101 | * Maximum page size.
102 | * Fewer tasks than requested might be returned, even if more tasks exist; use
103 | * [next_page_token][google.cloud.tasks.v2.ListTasksResponse.next_page_token]
104 | * in the response to determine if more tasks exist.
105 | * The maximum page size is 1000. If unspecified, the page size will be the
106 | * maximum.
107 | * @type string $page_token
108 | * A token identifying the page of results to return.
109 | * To request the first page results, page_token must be empty. To
110 | * request the next page of results, page_token must be the value of
111 | * [next_page_token][google.cloud.tasks.v2.ListTasksResponse.next_page_token]
112 | * returned from the previous call to
113 | * [ListTasks][google.cloud.tasks.v2.CloudTasks.ListTasks] method.
114 | * The page token is valid for only 2 hours.
115 | * }
116 | */
117 | public function __construct($data = NULL) {
118 | \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce();
119 | parent::__construct($data);
120 | }
121 |
122 | /**
123 | * Required. The queue name. For example:
124 | * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
125 | *
126 | * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
127 | * @return string
128 | */
129 | public function getParent()
130 | {
131 | return $this->parent;
132 | }
133 |
134 | /**
135 | * Required. The queue name. For example:
136 | * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
137 | *
138 | * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
139 | * @param string $var
140 | * @return $this
141 | */
142 | public function setParent($var)
143 | {
144 | GPBUtil::checkString($var, True);
145 | $this->parent = $var;
146 |
147 | return $this;
148 | }
149 |
150 | /**
151 | * The response_view specifies which subset of the
152 | * [Task][google.cloud.tasks.v2.Task] will be returned.
153 | * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC];
154 | * not all information is retrieved by default because some data, such as
155 | * payloads, might be desirable to return only when needed because
156 | * of its large size or because of the sensitivity of data that it
157 | * contains.
158 | * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires
159 | * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
160 | * permission on the [Task][google.cloud.tasks.v2.Task] resource.
161 | *
162 | * Generated from protobuf field .google.cloud.tasks.v2.Task.View response_view = 2;
163 | * @return int
164 | */
165 | public function getResponseView()
166 | {
167 | return $this->response_view;
168 | }
169 |
170 | /**
171 | * The response_view specifies which subset of the
172 | * [Task][google.cloud.tasks.v2.Task] will be returned.
173 | * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC];
174 | * not all information is retrieved by default because some data, such as
175 | * payloads, might be desirable to return only when needed because
176 | * of its large size or because of the sensitivity of data that it
177 | * contains.
178 | * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires
179 | * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
180 | * permission on the [Task][google.cloud.tasks.v2.Task] resource.
181 | *
182 | * Generated from protobuf field .google.cloud.tasks.v2.Task.View response_view = 2;
183 | * @param int $var
184 | * @return $this
185 | */
186 | public function setResponseView($var)
187 | {
188 | GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2\Task\View::class);
189 | $this->response_view = $var;
190 |
191 | return $this;
192 | }
193 |
194 | /**
195 | * Maximum page size.
196 | * Fewer tasks than requested might be returned, even if more tasks exist; use
197 | * [next_page_token][google.cloud.tasks.v2.ListTasksResponse.next_page_token]
198 | * in the response to determine if more tasks exist.
199 | * The maximum page size is 1000. If unspecified, the page size will be the
200 | * maximum.
201 | *
202 | * Generated from protobuf field int32 page_size = 3;
203 | * @return int
204 | */
205 | public function getPageSize()
206 | {
207 | return $this->page_size;
208 | }
209 |
210 | /**
211 | * Maximum page size.
212 | * Fewer tasks than requested might be returned, even if more tasks exist; use
213 | * [next_page_token][google.cloud.tasks.v2.ListTasksResponse.next_page_token]
214 | * in the response to determine if more tasks exist.
215 | * The maximum page size is 1000. If unspecified, the page size will be the
216 | * maximum.
217 | *
218 | * Generated from protobuf field int32 page_size = 3;
219 | * @param int $var
220 | * @return $this
221 | */
222 | public function setPageSize($var)
223 | {
224 | GPBUtil::checkInt32($var);
225 | $this->page_size = $var;
226 |
227 | return $this;
228 | }
229 |
230 | /**
231 | * A token identifying the page of results to return.
232 | * To request the first page results, page_token must be empty. To
233 | * request the next page of results, page_token must be the value of
234 | * [next_page_token][google.cloud.tasks.v2.ListTasksResponse.next_page_token]
235 | * returned from the previous call to
236 | * [ListTasks][google.cloud.tasks.v2.CloudTasks.ListTasks] method.
237 | * The page token is valid for only 2 hours.
238 | *
239 | * Generated from protobuf field string page_token = 4;
240 | * @return string
241 | */
242 | public function getPageToken()
243 | {
244 | return $this->page_token;
245 | }
246 |
247 | /**
248 | * A token identifying the page of results to return.
249 | * To request the first page results, page_token must be empty. To
250 | * request the next page of results, page_token must be the value of
251 | * [next_page_token][google.cloud.tasks.v2.ListTasksResponse.next_page_token]
252 | * returned from the previous call to
253 | * [ListTasks][google.cloud.tasks.v2.CloudTasks.ListTasks] method.
254 | * The page token is valid for only 2 hours.
255 | *
256 | * Generated from protobuf field string page_token = 4;
257 | * @param string $var
258 | * @return $this
259 | */
260 | public function setPageToken($var)
261 | {
262 | GPBUtil::checkString($var, True);
263 | $this->page_token = $var;
264 |
265 | return $this;
266 | }
267 |
268 | }
269 |
270 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "{}"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright {yyyy} {name of copyright owner}
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
203 |
--------------------------------------------------------------------------------
/src/V2/RateLimits.php:
--------------------------------------------------------------------------------
1 | google.cloud.tasks.v2.RateLimits
20 | */
21 | class RateLimits extends \Google\Protobuf\Internal\Message
22 | {
23 | /**
24 | * The maximum rate at which tasks are dispatched from this queue.
25 | * If unspecified when the queue is created, Cloud Tasks will pick the
26 | * default.
27 | * * The maximum allowed value is 500.
28 | * This field has the same meaning as
29 | * [rate in
30 | * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate).
31 | *
32 | * Generated from protobuf field double max_dispatches_per_second = 1;
33 | */
34 | protected $max_dispatches_per_second = 0.0;
35 | /**
36 | * Output only. The max burst size.
37 | * Max burst size limits how fast tasks in queue are processed when
38 | * many tasks are in the queue and the rate is high. This field
39 | * allows the queue to have a high rate so processing starts shortly
40 | * after a task is enqueued, but still limits resource usage when
41 | * many tasks are enqueued in a short period of time.
42 | * The [token bucket](https://wikipedia.org/wiki/Token_Bucket)
43 | * algorithm is used to control the rate of task dispatches. Each
44 | * queue has a token bucket that holds tokens, up to the maximum
45 | * specified by `max_burst_size`. Each time a task is dispatched, a
46 | * token is removed from the bucket. Tasks will be dispatched until
47 | * the queue's bucket runs out of tokens. The bucket will be
48 | * continuously refilled with new tokens based on
49 | * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second].
50 | * Cloud Tasks will pick the value of `max_burst_size` based on the
51 | * value of
52 | * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second].
53 | * For queues that were created or updated using
54 | * `queue.yaml/xml`, `max_burst_size` is equal to
55 | * [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size).
56 | * Since `max_burst_size` is output only, if
57 | * [UpdateQueue][google.cloud.tasks.v2.CloudTasks.UpdateQueue] is called on a
58 | * queue created by `queue.yaml/xml`, `max_burst_size` will be reset based on
59 | * the value of
60 | * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second],
61 | * regardless of whether
62 | * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second]
63 | * is updated.
64 | *
65 | * Generated from protobuf field int32 max_burst_size = 2;
66 | */
67 | protected $max_burst_size = 0;
68 | /**
69 | * The maximum number of concurrent tasks that Cloud Tasks allows
70 | * to be dispatched for this queue. After this threshold has been
71 | * reached, Cloud Tasks stops dispatching tasks until the number of
72 | * concurrent requests decreases.
73 | * If unspecified when the queue is created, Cloud Tasks will pick the
74 | * default.
75 | * The maximum allowed value is 5,000.
76 | * This field has the same meaning as
77 | * [max_concurrent_requests in
78 | * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests).
79 | *
80 | * Generated from protobuf field int32 max_concurrent_dispatches = 3;
81 | */
82 | protected $max_concurrent_dispatches = 0;
83 |
84 | /**
85 | * Constructor.
86 | *
87 | * @param array $data {
88 | * Optional. Data for populating the Message object.
89 | *
90 | * @type float $max_dispatches_per_second
91 | * The maximum rate at which tasks are dispatched from this queue.
92 | * If unspecified when the queue is created, Cloud Tasks will pick the
93 | * default.
94 | * * The maximum allowed value is 500.
95 | * This field has the same meaning as
96 | * [rate in
97 | * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate).
98 | * @type int $max_burst_size
99 | * Output only. The max burst size.
100 | * Max burst size limits how fast tasks in queue are processed when
101 | * many tasks are in the queue and the rate is high. This field
102 | * allows the queue to have a high rate so processing starts shortly
103 | * after a task is enqueued, but still limits resource usage when
104 | * many tasks are enqueued in a short period of time.
105 | * The [token bucket](https://wikipedia.org/wiki/Token_Bucket)
106 | * algorithm is used to control the rate of task dispatches. Each
107 | * queue has a token bucket that holds tokens, up to the maximum
108 | * specified by `max_burst_size`. Each time a task is dispatched, a
109 | * token is removed from the bucket. Tasks will be dispatched until
110 | * the queue's bucket runs out of tokens. The bucket will be
111 | * continuously refilled with new tokens based on
112 | * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second].
113 | * Cloud Tasks will pick the value of `max_burst_size` based on the
114 | * value of
115 | * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second].
116 | * For queues that were created or updated using
117 | * `queue.yaml/xml`, `max_burst_size` is equal to
118 | * [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size).
119 | * Since `max_burst_size` is output only, if
120 | * [UpdateQueue][google.cloud.tasks.v2.CloudTasks.UpdateQueue] is called on a
121 | * queue created by `queue.yaml/xml`, `max_burst_size` will be reset based on
122 | * the value of
123 | * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second],
124 | * regardless of whether
125 | * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second]
126 | * is updated.
127 | * @type int $max_concurrent_dispatches
128 | * The maximum number of concurrent tasks that Cloud Tasks allows
129 | * to be dispatched for this queue. After this threshold has been
130 | * reached, Cloud Tasks stops dispatching tasks until the number of
131 | * concurrent requests decreases.
132 | * If unspecified when the queue is created, Cloud Tasks will pick the
133 | * default.
134 | * The maximum allowed value is 5,000.
135 | * This field has the same meaning as
136 | * [max_concurrent_requests in
137 | * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests).
138 | * }
139 | */
140 | public function __construct($data = NULL) {
141 | \GPBMetadata\Google\Cloud\Tasks\V2\Queue::initOnce();
142 | parent::__construct($data);
143 | }
144 |
145 | /**
146 | * The maximum rate at which tasks are dispatched from this queue.
147 | * If unspecified when the queue is created, Cloud Tasks will pick the
148 | * default.
149 | * * The maximum allowed value is 500.
150 | * This field has the same meaning as
151 | * [rate in
152 | * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate).
153 | *
154 | * Generated from protobuf field double max_dispatches_per_second = 1;
155 | * @return float
156 | */
157 | public function getMaxDispatchesPerSecond()
158 | {
159 | return $this->max_dispatches_per_second;
160 | }
161 |
162 | /**
163 | * The maximum rate at which tasks are dispatched from this queue.
164 | * If unspecified when the queue is created, Cloud Tasks will pick the
165 | * default.
166 | * * The maximum allowed value is 500.
167 | * This field has the same meaning as
168 | * [rate in
169 | * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate).
170 | *
171 | * Generated from protobuf field double max_dispatches_per_second = 1;
172 | * @param float $var
173 | * @return $this
174 | */
175 | public function setMaxDispatchesPerSecond($var)
176 | {
177 | GPBUtil::checkDouble($var);
178 | $this->max_dispatches_per_second = $var;
179 |
180 | return $this;
181 | }
182 |
183 | /**
184 | * Output only. The max burst size.
185 | * Max burst size limits how fast tasks in queue are processed when
186 | * many tasks are in the queue and the rate is high. This field
187 | * allows the queue to have a high rate so processing starts shortly
188 | * after a task is enqueued, but still limits resource usage when
189 | * many tasks are enqueued in a short period of time.
190 | * The [token bucket](https://wikipedia.org/wiki/Token_Bucket)
191 | * algorithm is used to control the rate of task dispatches. Each
192 | * queue has a token bucket that holds tokens, up to the maximum
193 | * specified by `max_burst_size`. Each time a task is dispatched, a
194 | * token is removed from the bucket. Tasks will be dispatched until
195 | * the queue's bucket runs out of tokens. The bucket will be
196 | * continuously refilled with new tokens based on
197 | * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second].
198 | * Cloud Tasks will pick the value of `max_burst_size` based on the
199 | * value of
200 | * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second].
201 | * For queues that were created or updated using
202 | * `queue.yaml/xml`, `max_burst_size` is equal to
203 | * [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size).
204 | * Since `max_burst_size` is output only, if
205 | * [UpdateQueue][google.cloud.tasks.v2.CloudTasks.UpdateQueue] is called on a
206 | * queue created by `queue.yaml/xml`, `max_burst_size` will be reset based on
207 | * the value of
208 | * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second],
209 | * regardless of whether
210 | * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second]
211 | * is updated.
212 | *
213 | * Generated from protobuf field int32 max_burst_size = 2;
214 | * @return int
215 | */
216 | public function getMaxBurstSize()
217 | {
218 | return $this->max_burst_size;
219 | }
220 |
221 | /**
222 | * Output only. The max burst size.
223 | * Max burst size limits how fast tasks in queue are processed when
224 | * many tasks are in the queue and the rate is high. This field
225 | * allows the queue to have a high rate so processing starts shortly
226 | * after a task is enqueued, but still limits resource usage when
227 | * many tasks are enqueued in a short period of time.
228 | * The [token bucket](https://wikipedia.org/wiki/Token_Bucket)
229 | * algorithm is used to control the rate of task dispatches. Each
230 | * queue has a token bucket that holds tokens, up to the maximum
231 | * specified by `max_burst_size`. Each time a task is dispatched, a
232 | * token is removed from the bucket. Tasks will be dispatched until
233 | * the queue's bucket runs out of tokens. The bucket will be
234 | * continuously refilled with new tokens based on
235 | * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second].
236 | * Cloud Tasks will pick the value of `max_burst_size` based on the
237 | * value of
238 | * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second].
239 | * For queues that were created or updated using
240 | * `queue.yaml/xml`, `max_burst_size` is equal to
241 | * [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size).
242 | * Since `max_burst_size` is output only, if
243 | * [UpdateQueue][google.cloud.tasks.v2.CloudTasks.UpdateQueue] is called on a
244 | * queue created by `queue.yaml/xml`, `max_burst_size` will be reset based on
245 | * the value of
246 | * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second],
247 | * regardless of whether
248 | * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second]
249 | * is updated.
250 | *
251 | * Generated from protobuf field int32 max_burst_size = 2;
252 | * @param int $var
253 | * @return $this
254 | */
255 | public function setMaxBurstSize($var)
256 | {
257 | GPBUtil::checkInt32($var);
258 | $this->max_burst_size = $var;
259 |
260 | return $this;
261 | }
262 |
263 | /**
264 | * The maximum number of concurrent tasks that Cloud Tasks allows
265 | * to be dispatched for this queue. After this threshold has been
266 | * reached, Cloud Tasks stops dispatching tasks until the number of
267 | * concurrent requests decreases.
268 | * If unspecified when the queue is created, Cloud Tasks will pick the
269 | * default.
270 | * The maximum allowed value is 5,000.
271 | * This field has the same meaning as
272 | * [max_concurrent_requests in
273 | * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests).
274 | *
275 | * Generated from protobuf field int32 max_concurrent_dispatches = 3;
276 | * @return int
277 | */
278 | public function getMaxConcurrentDispatches()
279 | {
280 | return $this->max_concurrent_dispatches;
281 | }
282 |
283 | /**
284 | * The maximum number of concurrent tasks that Cloud Tasks allows
285 | * to be dispatched for this queue. After this threshold has been
286 | * reached, Cloud Tasks stops dispatching tasks until the number of
287 | * concurrent requests decreases.
288 | * If unspecified when the queue is created, Cloud Tasks will pick the
289 | * default.
290 | * The maximum allowed value is 5,000.
291 | * This field has the same meaning as
292 | * [max_concurrent_requests in
293 | * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests).
294 | *
295 | * Generated from protobuf field int32 max_concurrent_dispatches = 3;
296 | * @param int $var
297 | * @return $this
298 | */
299 | public function setMaxConcurrentDispatches($var)
300 | {
301 | GPBUtil::checkInt32($var);
302 | $this->max_concurrent_dispatches = $var;
303 |
304 | return $this;
305 | }
306 |
307 | }
308 |
309 |
--------------------------------------------------------------------------------
/src/V2/AppEngineRouting.php:
--------------------------------------------------------------------------------
1 | google.cloud.tasks.v2.AppEngineRouting
31 | */
32 | class AppEngineRouting extends \Google\Protobuf\Internal\Message
33 | {
34 | /**
35 | * App service.
36 | * By default, the task is sent to the service which is the default
37 | * service when the task is attempted.
38 | * For some queues or tasks which were created using the App Engine
39 | * Task Queue API, [host][google.cloud.tasks.v2.AppEngineRouting.host] is not
40 | * parsable into [service][google.cloud.tasks.v2.AppEngineRouting.service],
41 | * [version][google.cloud.tasks.v2.AppEngineRouting.version], and
42 | * [instance][google.cloud.tasks.v2.AppEngineRouting.instance]. For example,
43 | * some tasks which were created using the App Engine SDK use a custom domain
44 | * name; custom domains are not parsed by Cloud Tasks. If
45 | * [host][google.cloud.tasks.v2.AppEngineRouting.host] is not parsable, then
46 | * [service][google.cloud.tasks.v2.AppEngineRouting.service],
47 | * [version][google.cloud.tasks.v2.AppEngineRouting.version], and
48 | * [instance][google.cloud.tasks.v2.AppEngineRouting.instance] are the empty
49 | * string.
50 | *
51 | * Generated from protobuf field string service = 1;
52 | */
53 | protected $service = '';
54 | /**
55 | * App version.
56 | * By default, the task is sent to the version which is the default
57 | * version when the task is attempted.
58 | * For some queues or tasks which were created using the App Engine
59 | * Task Queue API, [host][google.cloud.tasks.v2.AppEngineRouting.host] is not
60 | * parsable into [service][google.cloud.tasks.v2.AppEngineRouting.service],
61 | * [version][google.cloud.tasks.v2.AppEngineRouting.version], and
62 | * [instance][google.cloud.tasks.v2.AppEngineRouting.instance]. For example,
63 | * some tasks which were created using the App Engine SDK use a custom domain
64 | * name; custom domains are not parsed by Cloud Tasks. If
65 | * [host][google.cloud.tasks.v2.AppEngineRouting.host] is not parsable, then
66 | * [service][google.cloud.tasks.v2.AppEngineRouting.service],
67 | * [version][google.cloud.tasks.v2.AppEngineRouting.version], and
68 | * [instance][google.cloud.tasks.v2.AppEngineRouting.instance] are the empty
69 | * string.
70 | *
71 | * Generated from protobuf field string version = 2;
72 | */
73 | protected $version = '';
74 | /**
75 | * App instance.
76 | * By default, the task is sent to an instance which is available when
77 | * the task is attempted.
78 | * Requests can only be sent to a specific instance if
79 | * [manual scaling is used in App Engine
80 | * Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
81 | * App Engine Flex does not support instances. For more information, see
82 | * [App Engine Standard request
83 | * routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
84 | * and [App Engine Flex request
85 | * routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
86 | *
87 | * Generated from protobuf field string instance = 3;
88 | */
89 | protected $instance = '';
90 | /**
91 | * Output only. The host that the task is sent to.
92 | * The host is constructed from the domain name of the app associated with
93 | * the queue's project ID (for example .appspot.com), and the
94 | * [service][google.cloud.tasks.v2.AppEngineRouting.service],
95 | * [version][google.cloud.tasks.v2.AppEngineRouting.version], and
96 | * [instance][google.cloud.tasks.v2.AppEngineRouting.instance]. Tasks which
97 | * were created using the App Engine SDK might have a custom domain name.
98 | * For more information, see
99 | * [How Requests are
100 | * Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
101 | *
102 | * Generated from protobuf field string host = 4;
103 | */
104 | protected $host = '';
105 |
106 | /**
107 | * Constructor.
108 | *
109 | * @param array $data {
110 | * Optional. Data for populating the Message object.
111 | *
112 | * @type string $service
113 | * App service.
114 | * By default, the task is sent to the service which is the default
115 | * service when the task is attempted.
116 | * For some queues or tasks which were created using the App Engine
117 | * Task Queue API, [host][google.cloud.tasks.v2.AppEngineRouting.host] is not
118 | * parsable into [service][google.cloud.tasks.v2.AppEngineRouting.service],
119 | * [version][google.cloud.tasks.v2.AppEngineRouting.version], and
120 | * [instance][google.cloud.tasks.v2.AppEngineRouting.instance]. For example,
121 | * some tasks which were created using the App Engine SDK use a custom domain
122 | * name; custom domains are not parsed by Cloud Tasks. If
123 | * [host][google.cloud.tasks.v2.AppEngineRouting.host] is not parsable, then
124 | * [service][google.cloud.tasks.v2.AppEngineRouting.service],
125 | * [version][google.cloud.tasks.v2.AppEngineRouting.version], and
126 | * [instance][google.cloud.tasks.v2.AppEngineRouting.instance] are the empty
127 | * string.
128 | * @type string $version
129 | * App version.
130 | * By default, the task is sent to the version which is the default
131 | * version when the task is attempted.
132 | * For some queues or tasks which were created using the App Engine
133 | * Task Queue API, [host][google.cloud.tasks.v2.AppEngineRouting.host] is not
134 | * parsable into [service][google.cloud.tasks.v2.AppEngineRouting.service],
135 | * [version][google.cloud.tasks.v2.AppEngineRouting.version], and
136 | * [instance][google.cloud.tasks.v2.AppEngineRouting.instance]. For example,
137 | * some tasks which were created using the App Engine SDK use a custom domain
138 | * name; custom domains are not parsed by Cloud Tasks. If
139 | * [host][google.cloud.tasks.v2.AppEngineRouting.host] is not parsable, then
140 | * [service][google.cloud.tasks.v2.AppEngineRouting.service],
141 | * [version][google.cloud.tasks.v2.AppEngineRouting.version], and
142 | * [instance][google.cloud.tasks.v2.AppEngineRouting.instance] are the empty
143 | * string.
144 | * @type string $instance
145 | * App instance.
146 | * By default, the task is sent to an instance which is available when
147 | * the task is attempted.
148 | * Requests can only be sent to a specific instance if
149 | * [manual scaling is used in App Engine
150 | * Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
151 | * App Engine Flex does not support instances. For more information, see
152 | * [App Engine Standard request
153 | * routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
154 | * and [App Engine Flex request
155 | * routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
156 | * @type string $host
157 | * Output only. The host that the task is sent to.
158 | * The host is constructed from the domain name of the app associated with
159 | * the queue's project ID (for example .appspot.com), and the
160 | * [service][google.cloud.tasks.v2.AppEngineRouting.service],
161 | * [version][google.cloud.tasks.v2.AppEngineRouting.version], and
162 | * [instance][google.cloud.tasks.v2.AppEngineRouting.instance]. Tasks which
163 | * were created using the App Engine SDK might have a custom domain name.
164 | * For more information, see
165 | * [How Requests are
166 | * Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
167 | * }
168 | */
169 | public function __construct($data = NULL) {
170 | \GPBMetadata\Google\Cloud\Tasks\V2\Target::initOnce();
171 | parent::__construct($data);
172 | }
173 |
174 | /**
175 | * App service.
176 | * By default, the task is sent to the service which is the default
177 | * service when the task is attempted.
178 | * For some queues or tasks which were created using the App Engine
179 | * Task Queue API, [host][google.cloud.tasks.v2.AppEngineRouting.host] is not
180 | * parsable into [service][google.cloud.tasks.v2.AppEngineRouting.service],
181 | * [version][google.cloud.tasks.v2.AppEngineRouting.version], and
182 | * [instance][google.cloud.tasks.v2.AppEngineRouting.instance]. For example,
183 | * some tasks which were created using the App Engine SDK use a custom domain
184 | * name; custom domains are not parsed by Cloud Tasks. If
185 | * [host][google.cloud.tasks.v2.AppEngineRouting.host] is not parsable, then
186 | * [service][google.cloud.tasks.v2.AppEngineRouting.service],
187 | * [version][google.cloud.tasks.v2.AppEngineRouting.version], and
188 | * [instance][google.cloud.tasks.v2.AppEngineRouting.instance] are the empty
189 | * string.
190 | *
191 | * Generated from protobuf field string service = 1;
192 | * @return string
193 | */
194 | public function getService()
195 | {
196 | return $this->service;
197 | }
198 |
199 | /**
200 | * App service.
201 | * By default, the task is sent to the service which is the default
202 | * service when the task is attempted.
203 | * For some queues or tasks which were created using the App Engine
204 | * Task Queue API, [host][google.cloud.tasks.v2.AppEngineRouting.host] is not
205 | * parsable into [service][google.cloud.tasks.v2.AppEngineRouting.service],
206 | * [version][google.cloud.tasks.v2.AppEngineRouting.version], and
207 | * [instance][google.cloud.tasks.v2.AppEngineRouting.instance]. For example,
208 | * some tasks which were created using the App Engine SDK use a custom domain
209 | * name; custom domains are not parsed by Cloud Tasks. If
210 | * [host][google.cloud.tasks.v2.AppEngineRouting.host] is not parsable, then
211 | * [service][google.cloud.tasks.v2.AppEngineRouting.service],
212 | * [version][google.cloud.tasks.v2.AppEngineRouting.version], and
213 | * [instance][google.cloud.tasks.v2.AppEngineRouting.instance] are the empty
214 | * string.
215 | *
216 | * Generated from protobuf field string service = 1;
217 | * @param string $var
218 | * @return $this
219 | */
220 | public function setService($var)
221 | {
222 | GPBUtil::checkString($var, True);
223 | $this->service = $var;
224 |
225 | return $this;
226 | }
227 |
228 | /**
229 | * App version.
230 | * By default, the task is sent to the version which is the default
231 | * version when the task is attempted.
232 | * For some queues or tasks which were created using the App Engine
233 | * Task Queue API, [host][google.cloud.tasks.v2.AppEngineRouting.host] is not
234 | * parsable into [service][google.cloud.tasks.v2.AppEngineRouting.service],
235 | * [version][google.cloud.tasks.v2.AppEngineRouting.version], and
236 | * [instance][google.cloud.tasks.v2.AppEngineRouting.instance]. For example,
237 | * some tasks which were created using the App Engine SDK use a custom domain
238 | * name; custom domains are not parsed by Cloud Tasks. If
239 | * [host][google.cloud.tasks.v2.AppEngineRouting.host] is not parsable, then
240 | * [service][google.cloud.tasks.v2.AppEngineRouting.service],
241 | * [version][google.cloud.tasks.v2.AppEngineRouting.version], and
242 | * [instance][google.cloud.tasks.v2.AppEngineRouting.instance] are the empty
243 | * string.
244 | *
245 | * Generated from protobuf field string version = 2;
246 | * @return string
247 | */
248 | public function getVersion()
249 | {
250 | return $this->version;
251 | }
252 |
253 | /**
254 | * App version.
255 | * By default, the task is sent to the version which is the default
256 | * version when the task is attempted.
257 | * For some queues or tasks which were created using the App Engine
258 | * Task Queue API, [host][google.cloud.tasks.v2.AppEngineRouting.host] is not
259 | * parsable into [service][google.cloud.tasks.v2.AppEngineRouting.service],
260 | * [version][google.cloud.tasks.v2.AppEngineRouting.version], and
261 | * [instance][google.cloud.tasks.v2.AppEngineRouting.instance]. For example,
262 | * some tasks which were created using the App Engine SDK use a custom domain
263 | * name; custom domains are not parsed by Cloud Tasks. If
264 | * [host][google.cloud.tasks.v2.AppEngineRouting.host] is not parsable, then
265 | * [service][google.cloud.tasks.v2.AppEngineRouting.service],
266 | * [version][google.cloud.tasks.v2.AppEngineRouting.version], and
267 | * [instance][google.cloud.tasks.v2.AppEngineRouting.instance] are the empty
268 | * string.
269 | *
270 | * Generated from protobuf field string version = 2;
271 | * @param string $var
272 | * @return $this
273 | */
274 | public function setVersion($var)
275 | {
276 | GPBUtil::checkString($var, True);
277 | $this->version = $var;
278 |
279 | return $this;
280 | }
281 |
282 | /**
283 | * App instance.
284 | * By default, the task is sent to an instance which is available when
285 | * the task is attempted.
286 | * Requests can only be sent to a specific instance if
287 | * [manual scaling is used in App Engine
288 | * Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
289 | * App Engine Flex does not support instances. For more information, see
290 | * [App Engine Standard request
291 | * routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
292 | * and [App Engine Flex request
293 | * routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
294 | *
295 | * Generated from protobuf field string instance = 3;
296 | * @return string
297 | */
298 | public function getInstance()
299 | {
300 | return $this->instance;
301 | }
302 |
303 | /**
304 | * App instance.
305 | * By default, the task is sent to an instance which is available when
306 | * the task is attempted.
307 | * Requests can only be sent to a specific instance if
308 | * [manual scaling is used in App Engine
309 | * Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
310 | * App Engine Flex does not support instances. For more information, see
311 | * [App Engine Standard request
312 | * routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
313 | * and [App Engine Flex request
314 | * routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
315 | *
316 | * Generated from protobuf field string instance = 3;
317 | * @param string $var
318 | * @return $this
319 | */
320 | public function setInstance($var)
321 | {
322 | GPBUtil::checkString($var, True);
323 | $this->instance = $var;
324 |
325 | return $this;
326 | }
327 |
328 | /**
329 | * Output only. The host that the task is sent to.
330 | * The host is constructed from the domain name of the app associated with
331 | * the queue's project ID (for example .appspot.com), and the
332 | * [service][google.cloud.tasks.v2.AppEngineRouting.service],
333 | * [version][google.cloud.tasks.v2.AppEngineRouting.version], and
334 | * [instance][google.cloud.tasks.v2.AppEngineRouting.instance]. Tasks which
335 | * were created using the App Engine SDK might have a custom domain name.
336 | * For more information, see
337 | * [How Requests are
338 | * Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
339 | *
340 | * Generated from protobuf field string host = 4;
341 | * @return string
342 | */
343 | public function getHost()
344 | {
345 | return $this->host;
346 | }
347 |
348 | /**
349 | * Output only. The host that the task is sent to.
350 | * The host is constructed from the domain name of the app associated with
351 | * the queue's project ID (for example .appspot.com), and the
352 | * [service][google.cloud.tasks.v2.AppEngineRouting.service],
353 | * [version][google.cloud.tasks.v2.AppEngineRouting.version], and
354 | * [instance][google.cloud.tasks.v2.AppEngineRouting.instance]. Tasks which
355 | * were created using the App Engine SDK might have a custom domain name.
356 | * For more information, see
357 | * [How Requests are
358 | * Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
359 | *
360 | * Generated from protobuf field string host = 4;
361 | * @param string $var
362 | * @return $this
363 | */
364 | public function setHost($var)
365 | {
366 | GPBUtil::checkString($var, True);
367 | $this->host = $var;
368 |
369 | return $this;
370 | }
371 |
372 | }
373 |
374 |
--------------------------------------------------------------------------------
/src/V2/CreateTaskRequest.php:
--------------------------------------------------------------------------------
1 | google.cloud.tasks.v2.CreateTaskRequest
16 | */
17 | class CreateTaskRequest extends \Google\Protobuf\Internal\Message
18 | {
19 | /**
20 | * Required. The queue name. For example:
21 | * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
22 | * The queue must already exist.
23 | *
24 | * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
25 | */
26 | protected $parent = '';
27 | /**
28 | * Required. The task to add.
29 | * Task names have the following format:
30 | * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`.
31 | * The user can optionally specify a task
32 | * [name][google.cloud.tasks.v2.Task.name]. If a name is not specified then
33 | * the system will generate a random unique task id, which will be set in the
34 | * task returned in the [response][google.cloud.tasks.v2.Task.name].
35 | * If [schedule_time][google.cloud.tasks.v2.Task.schedule_time] is not set or
36 | * is in the past then Cloud Tasks will set it to the current time.
37 | * Task De-duplication:
38 | * Explicitly specifying a task ID enables task de-duplication. If
39 | * a task's ID is identical to that of an existing task or a task
40 | * that was deleted or executed recently then the call will fail
41 | * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS].
42 | * If the task's queue was created using Cloud Tasks, then another task with
43 | * the same name can't be created for ~1hour after the original task was
44 | * deleted or executed. If the task's queue was created using queue.yaml or
45 | * queue.xml, then another task with the same name can't be created
46 | * for ~9days after the original task was deleted or executed.
47 | * Because there is an extra lookup cost to identify duplicate task
48 | * names, these [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask]
49 | * calls have significantly increased latency. Using hashed strings for the
50 | * task id or for the prefix of the task id is recommended. Choosing task ids
51 | * that are sequential or have sequential prefixes, for example using a
52 | * timestamp, causes an increase in latency and error rates in all
53 | * task commands. The infrastructure relies on an approximately
54 | * uniform distribution of task ids to store and serve tasks
55 | * efficiently.
56 | *
57 | * Generated from protobuf field .google.cloud.tasks.v2.Task task = 2 [(.google.api.field_behavior) = REQUIRED];
58 | */
59 | protected $task = null;
60 | /**
61 | * The response_view specifies which subset of the
62 | * [Task][google.cloud.tasks.v2.Task] will be returned.
63 | * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC];
64 | * not all information is retrieved by default because some data, such as
65 | * payloads, might be desirable to return only when needed because
66 | * of its large size or because of the sensitivity of data that it
67 | * contains.
68 | * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires
69 | * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
70 | * permission on the [Task][google.cloud.tasks.v2.Task] resource.
71 | *
72 | * Generated from protobuf field .google.cloud.tasks.v2.Task.View response_view = 3;
73 | */
74 | protected $response_view = 0;
75 |
76 | /**
77 | * @param string $parent Required. The queue name. For example:
78 | * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
79 | *
80 | * The queue must already exist. Please see
81 | * {@see CloudTasksClient::queueName()} for help formatting this field.
82 | * @param \Google\Cloud\Tasks\V2\Task $task Required. The task to add.
83 | *
84 | * Task names have the following format:
85 | * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`.
86 | * The user can optionally specify a task
87 | * [name][google.cloud.tasks.v2.Task.name]. If a name is not specified then
88 | * the system will generate a random unique task id, which will be set in the
89 | * task returned in the [response][google.cloud.tasks.v2.Task.name].
90 | *
91 | * If [schedule_time][google.cloud.tasks.v2.Task.schedule_time] is not set or
92 | * is in the past then Cloud Tasks will set it to the current time.
93 | *
94 | * Task De-duplication:
95 | *
96 | * Explicitly specifying a task ID enables task de-duplication. If
97 | * a task's ID is identical to that of an existing task or a task
98 | * that was deleted or executed recently then the call will fail
99 | * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS].
100 | * If the task's queue was created using Cloud Tasks, then another task with
101 | * the same name can't be created for ~1hour after the original task was
102 | * deleted or executed. If the task's queue was created using queue.yaml or
103 | * queue.xml, then another task with the same name can't be created
104 | * for ~9days after the original task was deleted or executed.
105 | *
106 | * Because there is an extra lookup cost to identify duplicate task
107 | * names, these [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask]
108 | * calls have significantly increased latency. Using hashed strings for the
109 | * task id or for the prefix of the task id is recommended. Choosing task ids
110 | * that are sequential or have sequential prefixes, for example using a
111 | * timestamp, causes an increase in latency and error rates in all
112 | * task commands. The infrastructure relies on an approximately
113 | * uniform distribution of task ids to store and serve tasks
114 | * efficiently.
115 | *
116 | * @return \Google\Cloud\Tasks\V2\CreateTaskRequest
117 | *
118 | * @experimental
119 | */
120 | public static function build(string $parent, \Google\Cloud\Tasks\V2\Task $task): self
121 | {
122 | return (new self())
123 | ->setParent($parent)
124 | ->setTask($task);
125 | }
126 |
127 | /**
128 | * Constructor.
129 | *
130 | * @param array $data {
131 | * Optional. Data for populating the Message object.
132 | *
133 | * @type string $parent
134 | * Required. The queue name. For example:
135 | * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
136 | * The queue must already exist.
137 | * @type \Google\Cloud\Tasks\V2\Task $task
138 | * Required. The task to add.
139 | * Task names have the following format:
140 | * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`.
141 | * The user can optionally specify a task
142 | * [name][google.cloud.tasks.v2.Task.name]. If a name is not specified then
143 | * the system will generate a random unique task id, which will be set in the
144 | * task returned in the [response][google.cloud.tasks.v2.Task.name].
145 | * If [schedule_time][google.cloud.tasks.v2.Task.schedule_time] is not set or
146 | * is in the past then Cloud Tasks will set it to the current time.
147 | * Task De-duplication:
148 | * Explicitly specifying a task ID enables task de-duplication. If
149 | * a task's ID is identical to that of an existing task or a task
150 | * that was deleted or executed recently then the call will fail
151 | * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS].
152 | * If the task's queue was created using Cloud Tasks, then another task with
153 | * the same name can't be created for ~1hour after the original task was
154 | * deleted or executed. If the task's queue was created using queue.yaml or
155 | * queue.xml, then another task with the same name can't be created
156 | * for ~9days after the original task was deleted or executed.
157 | * Because there is an extra lookup cost to identify duplicate task
158 | * names, these [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask]
159 | * calls have significantly increased latency. Using hashed strings for the
160 | * task id or for the prefix of the task id is recommended. Choosing task ids
161 | * that are sequential or have sequential prefixes, for example using a
162 | * timestamp, causes an increase in latency and error rates in all
163 | * task commands. The infrastructure relies on an approximately
164 | * uniform distribution of task ids to store and serve tasks
165 | * efficiently.
166 | * @type int $response_view
167 | * The response_view specifies which subset of the
168 | * [Task][google.cloud.tasks.v2.Task] will be returned.
169 | * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC];
170 | * not all information is retrieved by default because some data, such as
171 | * payloads, might be desirable to return only when needed because
172 | * of its large size or because of the sensitivity of data that it
173 | * contains.
174 | * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires
175 | * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
176 | * permission on the [Task][google.cloud.tasks.v2.Task] resource.
177 | * }
178 | */
179 | public function __construct($data = NULL) {
180 | \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce();
181 | parent::__construct($data);
182 | }
183 |
184 | /**
185 | * Required. The queue name. For example:
186 | * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
187 | * The queue must already exist.
188 | *
189 | * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
190 | * @return string
191 | */
192 | public function getParent()
193 | {
194 | return $this->parent;
195 | }
196 |
197 | /**
198 | * Required. The queue name. For example:
199 | * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
200 | * The queue must already exist.
201 | *
202 | * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
203 | * @param string $var
204 | * @return $this
205 | */
206 | public function setParent($var)
207 | {
208 | GPBUtil::checkString($var, True);
209 | $this->parent = $var;
210 |
211 | return $this;
212 | }
213 |
214 | /**
215 | * Required. The task to add.
216 | * Task names have the following format:
217 | * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`.
218 | * The user can optionally specify a task
219 | * [name][google.cloud.tasks.v2.Task.name]. If a name is not specified then
220 | * the system will generate a random unique task id, which will be set in the
221 | * task returned in the [response][google.cloud.tasks.v2.Task.name].
222 | * If [schedule_time][google.cloud.tasks.v2.Task.schedule_time] is not set or
223 | * is in the past then Cloud Tasks will set it to the current time.
224 | * Task De-duplication:
225 | * Explicitly specifying a task ID enables task de-duplication. If
226 | * a task's ID is identical to that of an existing task or a task
227 | * that was deleted or executed recently then the call will fail
228 | * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS].
229 | * If the task's queue was created using Cloud Tasks, then another task with
230 | * the same name can't be created for ~1hour after the original task was
231 | * deleted or executed. If the task's queue was created using queue.yaml or
232 | * queue.xml, then another task with the same name can't be created
233 | * for ~9days after the original task was deleted or executed.
234 | * Because there is an extra lookup cost to identify duplicate task
235 | * names, these [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask]
236 | * calls have significantly increased latency. Using hashed strings for the
237 | * task id or for the prefix of the task id is recommended. Choosing task ids
238 | * that are sequential or have sequential prefixes, for example using a
239 | * timestamp, causes an increase in latency and error rates in all
240 | * task commands. The infrastructure relies on an approximately
241 | * uniform distribution of task ids to store and serve tasks
242 | * efficiently.
243 | *
244 | * Generated from protobuf field .google.cloud.tasks.v2.Task task = 2 [(.google.api.field_behavior) = REQUIRED];
245 | * @return \Google\Cloud\Tasks\V2\Task|null
246 | */
247 | public function getTask()
248 | {
249 | return $this->task;
250 | }
251 |
252 | public function hasTask()
253 | {
254 | return isset($this->task);
255 | }
256 |
257 | public function clearTask()
258 | {
259 | unset($this->task);
260 | }
261 |
262 | /**
263 | * Required. The task to add.
264 | * Task names have the following format:
265 | * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`.
266 | * The user can optionally specify a task
267 | * [name][google.cloud.tasks.v2.Task.name]. If a name is not specified then
268 | * the system will generate a random unique task id, which will be set in the
269 | * task returned in the [response][google.cloud.tasks.v2.Task.name].
270 | * If [schedule_time][google.cloud.tasks.v2.Task.schedule_time] is not set or
271 | * is in the past then Cloud Tasks will set it to the current time.
272 | * Task De-duplication:
273 | * Explicitly specifying a task ID enables task de-duplication. If
274 | * a task's ID is identical to that of an existing task or a task
275 | * that was deleted or executed recently then the call will fail
276 | * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS].
277 | * If the task's queue was created using Cloud Tasks, then another task with
278 | * the same name can't be created for ~1hour after the original task was
279 | * deleted or executed. If the task's queue was created using queue.yaml or
280 | * queue.xml, then another task with the same name can't be created
281 | * for ~9days after the original task was deleted or executed.
282 | * Because there is an extra lookup cost to identify duplicate task
283 | * names, these [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask]
284 | * calls have significantly increased latency. Using hashed strings for the
285 | * task id or for the prefix of the task id is recommended. Choosing task ids
286 | * that are sequential or have sequential prefixes, for example using a
287 | * timestamp, causes an increase in latency and error rates in all
288 | * task commands. The infrastructure relies on an approximately
289 | * uniform distribution of task ids to store and serve tasks
290 | * efficiently.
291 | *
292 | * Generated from protobuf field .google.cloud.tasks.v2.Task task = 2 [(.google.api.field_behavior) = REQUIRED];
293 | * @param \Google\Cloud\Tasks\V2\Task $var
294 | * @return $this
295 | */
296 | public function setTask($var)
297 | {
298 | GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2\Task::class);
299 | $this->task = $var;
300 |
301 | return $this;
302 | }
303 |
304 | /**
305 | * The response_view specifies which subset of the
306 | * [Task][google.cloud.tasks.v2.Task] will be returned.
307 | * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC];
308 | * not all information is retrieved by default because some data, such as
309 | * payloads, might be desirable to return only when needed because
310 | * of its large size or because of the sensitivity of data that it
311 | * contains.
312 | * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires
313 | * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
314 | * permission on the [Task][google.cloud.tasks.v2.Task] resource.
315 | *
316 | * Generated from protobuf field .google.cloud.tasks.v2.Task.View response_view = 3;
317 | * @return int
318 | */
319 | public function getResponseView()
320 | {
321 | return $this->response_view;
322 | }
323 |
324 | /**
325 | * The response_view specifies which subset of the
326 | * [Task][google.cloud.tasks.v2.Task] will be returned.
327 | * By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC];
328 | * not all information is retrieved by default because some data, such as
329 | * payloads, might be desirable to return only when needed because
330 | * of its large size or because of the sensitivity of data that it
331 | * contains.
332 | * Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires
333 | * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
334 | * permission on the [Task][google.cloud.tasks.v2.Task] resource.
335 | *
336 | * Generated from protobuf field .google.cloud.tasks.v2.Task.View response_view = 3;
337 | * @param int $var
338 | * @return $this
339 | */
340 | public function setResponseView($var)
341 | {
342 | GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2\Task\View::class);
343 | $this->response_view = $var;
344 |
345 | return $this;
346 | }
347 |
348 | }
349 |
350 |
--------------------------------------------------------------------------------
/src/V2/HttpRequest.php:
--------------------------------------------------------------------------------
1 | google.cloud.tasks.v2.HttpRequest
39 | */
40 | class HttpRequest extends \Google\Protobuf\Internal\Message
41 | {
42 | /**
43 | * Required. The full url path that the request will be sent to.
44 | * This string must begin with either "http://" or "https://". Some examples
45 | * are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will
46 | * encode some characters for safety and compatibility. The maximum allowed
47 | * URL length is 2083 characters after encoding.
48 | * The `Location` header response from a redirect response [`300` - `399`]
49 | * may be followed. The redirect is not counted as a separate attempt.
50 | *
51 | * Generated from protobuf field string url = 1 [(.google.api.field_behavior) = REQUIRED];
52 | */
53 | protected $url = '';
54 | /**
55 | * The HTTP method to use for the request. The default is POST.
56 | *
57 | * Generated from protobuf field .google.cloud.tasks.v2.HttpMethod http_method = 2;
58 | */
59 | protected $http_method = 0;
60 | /**
61 | * HTTP request headers.
62 | * This map contains the header field names and values.
63 | * Headers can be set when the
64 | * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask].
65 | * These headers represent a subset of the headers that will accompany the
66 | * task's HTTP request. Some HTTP request headers will be ignored or replaced.
67 | * A partial list of headers that will be ignored or replaced is:
68 | * * Host: This will be computed by Cloud Tasks and derived from
69 | * [HttpRequest.url][google.cloud.tasks.v2.HttpRequest.url].
70 | * * Content-Length: This will be computed by Cloud Tasks.
71 | * * User-Agent: This will be set to `"Google-Cloud-Tasks"`.
72 | * * `X-Google-*`: Google use only.
73 | * * `X-AppEngine-*`: Google use only.
74 | * `Content-Type` won't be set by Cloud Tasks. You can explicitly set
75 | * `Content-Type` to a media type when the
76 | * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask].
77 | * For example, `Content-Type` can be set to `"application/octet-stream"` or
78 | * `"application/json"`.
79 | * Headers which can have multiple values (according to RFC2616) can be
80 | * specified using comma-separated values.
81 | * The size of the headers must be less than 80KB.
82 | *
83 | * Generated from protobuf field map headers = 3;
84 | */
85 | private $headers;
86 | /**
87 | * HTTP request body.
88 | * A request body is allowed only if the
89 | * [HTTP method][google.cloud.tasks.v2.HttpRequest.http_method] is POST, PUT,
90 | * or PATCH. It is an error to set body on a task with an incompatible
91 | * [HttpMethod][google.cloud.tasks.v2.HttpMethod].
92 | *
93 | * Generated from protobuf field bytes body = 4;
94 | */
95 | protected $body = '';
96 | protected $authorization_header;
97 |
98 | /**
99 | * Constructor.
100 | *
101 | * @param array $data {
102 | * Optional. Data for populating the Message object.
103 | *
104 | * @type string $url
105 | * Required. The full url path that the request will be sent to.
106 | * This string must begin with either "http://" or "https://". Some examples
107 | * are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will
108 | * encode some characters for safety and compatibility. The maximum allowed
109 | * URL length is 2083 characters after encoding.
110 | * The `Location` header response from a redirect response [`300` - `399`]
111 | * may be followed. The redirect is not counted as a separate attempt.
112 | * @type int $http_method
113 | * The HTTP method to use for the request. The default is POST.
114 | * @type array|\Google\Protobuf\Internal\MapField $headers
115 | * HTTP request headers.
116 | * This map contains the header field names and values.
117 | * Headers can be set when the
118 | * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask].
119 | * These headers represent a subset of the headers that will accompany the
120 | * task's HTTP request. Some HTTP request headers will be ignored or replaced.
121 | * A partial list of headers that will be ignored or replaced is:
122 | * * Host: This will be computed by Cloud Tasks and derived from
123 | * [HttpRequest.url][google.cloud.tasks.v2.HttpRequest.url].
124 | * * Content-Length: This will be computed by Cloud Tasks.
125 | * * User-Agent: This will be set to `"Google-Cloud-Tasks"`.
126 | * * `X-Google-*`: Google use only.
127 | * * `X-AppEngine-*`: Google use only.
128 | * `Content-Type` won't be set by Cloud Tasks. You can explicitly set
129 | * `Content-Type` to a media type when the
130 | * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask].
131 | * For example, `Content-Type` can be set to `"application/octet-stream"` or
132 | * `"application/json"`.
133 | * Headers which can have multiple values (according to RFC2616) can be
134 | * specified using comma-separated values.
135 | * The size of the headers must be less than 80KB.
136 | * @type string $body
137 | * HTTP request body.
138 | * A request body is allowed only if the
139 | * [HTTP method][google.cloud.tasks.v2.HttpRequest.http_method] is POST, PUT,
140 | * or PATCH. It is an error to set body on a task with an incompatible
141 | * [HttpMethod][google.cloud.tasks.v2.HttpMethod].
142 | * @type \Google\Cloud\Tasks\V2\OAuthToken $oauth_token
143 | * If specified, an
144 | * [OAuth token](https://developers.google.com/identity/protocols/OAuth2)
145 | * will be generated and attached as an `Authorization` header in the HTTP
146 | * request.
147 | * This type of authorization should generally only be used when calling
148 | * Google APIs hosted on *.googleapis.com.
149 | * @type \Google\Cloud\Tasks\V2\OidcToken $oidc_token
150 | * If specified, an
151 | * [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect)
152 | * token will be generated and attached as an `Authorization` header in the
153 | * HTTP request.
154 | * This type of authorization can be used for many scenarios, including
155 | * calling Cloud Run, or endpoints where you intend to validate the token
156 | * yourself.
157 | * }
158 | */
159 | public function __construct($data = NULL) {
160 | \GPBMetadata\Google\Cloud\Tasks\V2\Target::initOnce();
161 | parent::__construct($data);
162 | }
163 |
164 | /**
165 | * Required. The full url path that the request will be sent to.
166 | * This string must begin with either "http://" or "https://". Some examples
167 | * are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will
168 | * encode some characters for safety and compatibility. The maximum allowed
169 | * URL length is 2083 characters after encoding.
170 | * The `Location` header response from a redirect response [`300` - `399`]
171 | * may be followed. The redirect is not counted as a separate attempt.
172 | *
173 | * Generated from protobuf field string url = 1 [(.google.api.field_behavior) = REQUIRED];
174 | * @return string
175 | */
176 | public function getUrl()
177 | {
178 | return $this->url;
179 | }
180 |
181 | /**
182 | * Required. The full url path that the request will be sent to.
183 | * This string must begin with either "http://" or "https://". Some examples
184 | * are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will
185 | * encode some characters for safety and compatibility. The maximum allowed
186 | * URL length is 2083 characters after encoding.
187 | * The `Location` header response from a redirect response [`300` - `399`]
188 | * may be followed. The redirect is not counted as a separate attempt.
189 | *
190 | * Generated from protobuf field string url = 1 [(.google.api.field_behavior) = REQUIRED];
191 | * @param string $var
192 | * @return $this
193 | */
194 | public function setUrl($var)
195 | {
196 | GPBUtil::checkString($var, True);
197 | $this->url = $var;
198 |
199 | return $this;
200 | }
201 |
202 | /**
203 | * The HTTP method to use for the request. The default is POST.
204 | *
205 | * Generated from protobuf field .google.cloud.tasks.v2.HttpMethod http_method = 2;
206 | * @return int
207 | */
208 | public function getHttpMethod()
209 | {
210 | return $this->http_method;
211 | }
212 |
213 | /**
214 | * The HTTP method to use for the request. The default is POST.
215 | *
216 | * Generated from protobuf field .google.cloud.tasks.v2.HttpMethod http_method = 2;
217 | * @param int $var
218 | * @return $this
219 | */
220 | public function setHttpMethod($var)
221 | {
222 | GPBUtil::checkEnum($var, \Google\Cloud\Tasks\V2\HttpMethod::class);
223 | $this->http_method = $var;
224 |
225 | return $this;
226 | }
227 |
228 | /**
229 | * HTTP request headers.
230 | * This map contains the header field names and values.
231 | * Headers can be set when the
232 | * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask].
233 | * These headers represent a subset of the headers that will accompany the
234 | * task's HTTP request. Some HTTP request headers will be ignored or replaced.
235 | * A partial list of headers that will be ignored or replaced is:
236 | * * Host: This will be computed by Cloud Tasks and derived from
237 | * [HttpRequest.url][google.cloud.tasks.v2.HttpRequest.url].
238 | * * Content-Length: This will be computed by Cloud Tasks.
239 | * * User-Agent: This will be set to `"Google-Cloud-Tasks"`.
240 | * * `X-Google-*`: Google use only.
241 | * * `X-AppEngine-*`: Google use only.
242 | * `Content-Type` won't be set by Cloud Tasks. You can explicitly set
243 | * `Content-Type` to a media type when the
244 | * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask].
245 | * For example, `Content-Type` can be set to `"application/octet-stream"` or
246 | * `"application/json"`.
247 | * Headers which can have multiple values (according to RFC2616) can be
248 | * specified using comma-separated values.
249 | * The size of the headers must be less than 80KB.
250 | *
251 | * Generated from protobuf field map headers = 3;
252 | * @return \Google\Protobuf\Internal\MapField
253 | */
254 | public function getHeaders()
255 | {
256 | return $this->headers;
257 | }
258 |
259 | /**
260 | * HTTP request headers.
261 | * This map contains the header field names and values.
262 | * Headers can be set when the
263 | * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask].
264 | * These headers represent a subset of the headers that will accompany the
265 | * task's HTTP request. Some HTTP request headers will be ignored or replaced.
266 | * A partial list of headers that will be ignored or replaced is:
267 | * * Host: This will be computed by Cloud Tasks and derived from
268 | * [HttpRequest.url][google.cloud.tasks.v2.HttpRequest.url].
269 | * * Content-Length: This will be computed by Cloud Tasks.
270 | * * User-Agent: This will be set to `"Google-Cloud-Tasks"`.
271 | * * `X-Google-*`: Google use only.
272 | * * `X-AppEngine-*`: Google use only.
273 | * `Content-Type` won't be set by Cloud Tasks. You can explicitly set
274 | * `Content-Type` to a media type when the
275 | * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask].
276 | * For example, `Content-Type` can be set to `"application/octet-stream"` or
277 | * `"application/json"`.
278 | * Headers which can have multiple values (according to RFC2616) can be
279 | * specified using comma-separated values.
280 | * The size of the headers must be less than 80KB.
281 | *
282 | * Generated from protobuf field map headers = 3;
283 | * @param array|\Google\Protobuf\Internal\MapField $var
284 | * @return $this
285 | */
286 | public function setHeaders($var)
287 | {
288 | $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
289 | $this->headers = $arr;
290 |
291 | return $this;
292 | }
293 |
294 | /**
295 | * HTTP request body.
296 | * A request body is allowed only if the
297 | * [HTTP method][google.cloud.tasks.v2.HttpRequest.http_method] is POST, PUT,
298 | * or PATCH. It is an error to set body on a task with an incompatible
299 | * [HttpMethod][google.cloud.tasks.v2.HttpMethod].
300 | *
301 | * Generated from protobuf field bytes body = 4;
302 | * @return string
303 | */
304 | public function getBody()
305 | {
306 | return $this->body;
307 | }
308 |
309 | /**
310 | * HTTP request body.
311 | * A request body is allowed only if the
312 | * [HTTP method][google.cloud.tasks.v2.HttpRequest.http_method] is POST, PUT,
313 | * or PATCH. It is an error to set body on a task with an incompatible
314 | * [HttpMethod][google.cloud.tasks.v2.HttpMethod].
315 | *
316 | * Generated from protobuf field bytes body = 4;
317 | * @param string $var
318 | * @return $this
319 | */
320 | public function setBody($var)
321 | {
322 | GPBUtil::checkString($var, False);
323 | $this->body = $var;
324 |
325 | return $this;
326 | }
327 |
328 | /**
329 | * If specified, an
330 | * [OAuth token](https://developers.google.com/identity/protocols/OAuth2)
331 | * will be generated and attached as an `Authorization` header in the HTTP
332 | * request.
333 | * This type of authorization should generally only be used when calling
334 | * Google APIs hosted on *.googleapis.com.
335 | *
336 | * Generated from protobuf field .google.cloud.tasks.v2.OAuthToken oauth_token = 5;
337 | * @return \Google\Cloud\Tasks\V2\OAuthToken|null
338 | */
339 | public function getOauthToken()
340 | {
341 | return $this->readOneof(5);
342 | }
343 |
344 | public function hasOauthToken()
345 | {
346 | return $this->hasOneof(5);
347 | }
348 |
349 | /**
350 | * If specified, an
351 | * [OAuth token](https://developers.google.com/identity/protocols/OAuth2)
352 | * will be generated and attached as an `Authorization` header in the HTTP
353 | * request.
354 | * This type of authorization should generally only be used when calling
355 | * Google APIs hosted on *.googleapis.com.
356 | *
357 | * Generated from protobuf field .google.cloud.tasks.v2.OAuthToken oauth_token = 5;
358 | * @param \Google\Cloud\Tasks\V2\OAuthToken $var
359 | * @return $this
360 | */
361 | public function setOauthToken($var)
362 | {
363 | GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2\OAuthToken::class);
364 | $this->writeOneof(5, $var);
365 |
366 | return $this;
367 | }
368 |
369 | /**
370 | * If specified, an
371 | * [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect)
372 | * token will be generated and attached as an `Authorization` header in the
373 | * HTTP request.
374 | * This type of authorization can be used for many scenarios, including
375 | * calling Cloud Run, or endpoints where you intend to validate the token
376 | * yourself.
377 | *
378 | * Generated from protobuf field .google.cloud.tasks.v2.OidcToken oidc_token = 6;
379 | * @return \Google\Cloud\Tasks\V2\OidcToken|null
380 | */
381 | public function getOidcToken()
382 | {
383 | return $this->readOneof(6);
384 | }
385 |
386 | public function hasOidcToken()
387 | {
388 | return $this->hasOneof(6);
389 | }
390 |
391 | /**
392 | * If specified, an
393 | * [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect)
394 | * token will be generated and attached as an `Authorization` header in the
395 | * HTTP request.
396 | * This type of authorization can be used for many scenarios, including
397 | * calling Cloud Run, or endpoints where you intend to validate the token
398 | * yourself.
399 | *
400 | * Generated from protobuf field .google.cloud.tasks.v2.OidcToken oidc_token = 6;
401 | * @param \Google\Cloud\Tasks\V2\OidcToken $var
402 | * @return $this
403 | */
404 | public function setOidcToken($var)
405 | {
406 | GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2\OidcToken::class);
407 | $this->writeOneof(6, $var);
408 |
409 | return $this;
410 | }
411 |
412 | /**
413 | * @return string
414 | */
415 | public function getAuthorizationHeader()
416 | {
417 | return $this->whichOneof("authorization_header");
418 | }
419 |
420 | }
421 |
422 |
--------------------------------------------------------------------------------