Skip to content

Commit 573513c

Browse files
1 parent f31e7ed commit 573513c

4 files changed

Lines changed: 158 additions & 2 deletions

File tree

src/Pubsub/JavaScriptUDF.php

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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+
18+
namespace Google\Service\Pubsub;
19+
20+
class JavaScriptUDF extends \Google\Model
21+
{
22+
/**
23+
* @var string
24+
*/
25+
public $code;
26+
/**
27+
* @var string
28+
*/
29+
public $functionName;
30+
31+
/**
32+
* @param string
33+
*/
34+
public function setCode($code)
35+
{
36+
$this->code = $code;
37+
}
38+
/**
39+
* @return string
40+
*/
41+
public function getCode()
42+
{
43+
return $this->code;
44+
}
45+
/**
46+
* @param string
47+
*/
48+
public function setFunctionName($functionName)
49+
{
50+
$this->functionName = $functionName;
51+
}
52+
/**
53+
* @return string
54+
*/
55+
public function getFunctionName()
56+
{
57+
return $this->functionName;
58+
}
59+
}
60+
61+
// Adding a class alias for backwards compatibility with the previous class name.
62+
class_alias(JavaScriptUDF::class, 'Google_Service_Pubsub_JavaScriptUDF');

src/Pubsub/MessageTransform.php

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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+
18+
namespace Google\Service\Pubsub;
19+
20+
class MessageTransform extends \Google\Model
21+
{
22+
/**
23+
* @var bool
24+
*/
25+
public $enabled;
26+
protected $javascriptUdfType = JavaScriptUDF::class;
27+
protected $javascriptUdfDataType = '';
28+
29+
/**
30+
* @param bool
31+
*/
32+
public function setEnabled($enabled)
33+
{
34+
$this->enabled = $enabled;
35+
}
36+
/**
37+
* @return bool
38+
*/
39+
public function getEnabled()
40+
{
41+
return $this->enabled;
42+
}
43+
/**
44+
* @param JavaScriptUDF
45+
*/
46+
public function setJavascriptUdf(JavaScriptUDF $javascriptUdf)
47+
{
48+
$this->javascriptUdf = $javascriptUdf;
49+
}
50+
/**
51+
* @return JavaScriptUDF
52+
*/
53+
public function getJavascriptUdf()
54+
{
55+
return $this->javascriptUdf;
56+
}
57+
}
58+
59+
// Adding a class alias for backwards compatibility with the previous class name.
60+
class_alias(MessageTransform::class, 'Google_Service_Pubsub_MessageTransform');

src/Pubsub/Subscription.php

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@
1717

1818
namespace Google\Service\Pubsub;
1919

20-
class Subscription extends \Google\Model
20+
class Subscription extends \Google\Collection
2121
{
22+
protected $collection_key = 'messageTransforms';
2223
/**
2324
* @var int
2425
*/
@@ -57,6 +58,8 @@ class Subscription extends \Google\Model
5758
* @var string
5859
*/
5960
public $messageRetentionDuration;
61+
protected $messageTransformsType = MessageTransform::class;
62+
protected $messageTransformsDataType = 'array';
6063
/**
6164
* @var string
6265
*/
@@ -250,6 +253,20 @@ public function getMessageRetentionDuration()
250253
{
251254
return $this->messageRetentionDuration;
252255
}
256+
/**
257+
* @param MessageTransform[]
258+
*/
259+
public function setMessageTransforms($messageTransforms)
260+
{
261+
$this->messageTransforms = $messageTransforms;
262+
}
263+
/**
264+
* @return MessageTransform[]
265+
*/
266+
public function getMessageTransforms()
267+
{
268+
return $this->messageTransforms;
269+
}
253270
/**
254271
* @param string
255272
*/

src/Pubsub/Topic.php

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@
1717

1818
namespace Google\Service\Pubsub;
1919

20-
class Topic extends \Google\Model
20+
class Topic extends \Google\Collection
2121
{
22+
protected $collection_key = 'messageTransforms';
2223
protected $ingestionDataSourceSettingsType = IngestionDataSourceSettings::class;
2324
protected $ingestionDataSourceSettingsDataType = '';
2425
/**
@@ -35,6 +36,8 @@ class Topic extends \Google\Model
3536
public $messageRetentionDuration;
3637
protected $messageStoragePolicyType = MessageStoragePolicy::class;
3738
protected $messageStoragePolicyDataType = '';
39+
protected $messageTransformsType = MessageTransform::class;
40+
protected $messageTransformsDataType = 'array';
3841
/**
3942
* @var string
4043
*/
@@ -120,6 +123,20 @@ public function getMessageStoragePolicy()
120123
{
121124
return $this->messageStoragePolicy;
122125
}
126+
/**
127+
* @param MessageTransform[]
128+
*/
129+
public function setMessageTransforms($messageTransforms)
130+
{
131+
$this->messageTransforms = $messageTransforms;
132+
}
133+
/**
134+
* @return MessageTransform[]
135+
*/
136+
public function getMessageTransforms()
137+
{
138+
return $this->messageTransforms;
139+
}
123140
/**
124141
* @param string
125142
*/

0 commit comments

Comments
 (0)