PubsubTarget.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <?php
  2. /*
  3. * Copyright 2014 Google Inc.
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  6. * use this file except in compliance with the License. You may obtain a copy of
  7. * the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  13. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  14. * License for the specific language governing permissions and limitations under
  15. * the License.
  16. */
  17. namespace Google\Service\CloudScheduler;
  18. class PubsubTarget extends \Google\Model
  19. {
  20. /**
  21. * Attributes for PubsubMessage. Pubsub message must contain either non-empty
  22. * data, or at least one attribute.
  23. *
  24. * @var string[]
  25. */
  26. public $attributes;
  27. /**
  28. * The message payload for PubsubMessage. Pubsub message must contain either
  29. * non-empty data, or at least one attribute.
  30. *
  31. * @var string
  32. */
  33. public $data;
  34. /**
  35. * Required. The name of the Cloud Pub/Sub topic to which messages will be
  36. * published when a job is delivered. The topic name must be in the same
  37. * format as required by Pub/Sub's [PublishRequest.name](https://cloud.google.
  38. * com/pubsub/docs/reference/rpc/google.pubsub.v1#publishrequest), for example
  39. * `projects/PROJECT_ID/topics/TOPIC_ID`. The topic must be in the same
  40. * project as the Cloud Scheduler job.
  41. *
  42. * @var string
  43. */
  44. public $topicName;
  45. /**
  46. * Attributes for PubsubMessage. Pubsub message must contain either non-empty
  47. * data, or at least one attribute.
  48. *
  49. * @param string[] $attributes
  50. */
  51. public function setAttributes($attributes)
  52. {
  53. $this->attributes = $attributes;
  54. }
  55. /**
  56. * @return string[]
  57. */
  58. public function getAttributes()
  59. {
  60. return $this->attributes;
  61. }
  62. /**
  63. * The message payload for PubsubMessage. Pubsub message must contain either
  64. * non-empty data, or at least one attribute.
  65. *
  66. * @param string $data
  67. */
  68. public function setData($data)
  69. {
  70. $this->data = $data;
  71. }
  72. /**
  73. * @return string
  74. */
  75. public function getData()
  76. {
  77. return $this->data;
  78. }
  79. /**
  80. * Required. The name of the Cloud Pub/Sub topic to which messages will be
  81. * published when a job is delivered. The topic name must be in the same
  82. * format as required by Pub/Sub's [PublishRequest.name](https://cloud.google.
  83. * com/pubsub/docs/reference/rpc/google.pubsub.v1#publishrequest), for example
  84. * `projects/PROJECT_ID/topics/TOPIC_ID`. The topic must be in the same
  85. * project as the Cloud Scheduler job.
  86. *
  87. * @param string $topicName
  88. */
  89. public function setTopicName($topicName)
  90. {
  91. $this->topicName = $topicName;
  92. }
  93. /**
  94. * @return string
  95. */
  96. public function getTopicName()
  97. {
  98. return $this->topicName;
  99. }
  100. }
  101. // Adding a class alias for backwards compatibility with the previous class name.
  102. class_alias(PubsubTarget::class, 'Google_Service_CloudScheduler_PubsubTarget');