Skip to content

Commit a6adde3

Browse files
1 parent 84e2928 commit a6adde3

8 files changed

Lines changed: 210 additions & 34 deletions

src/Pubsub/AIInference.php

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
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 AIInference extends \Google\Model
21+
{
22+
/**
23+
* Required. An endpoint to a Vertex AI model of the form
24+
* `projects/{project}/locations/{location}/endpoints/{endpoint}` or `projects
25+
* /{project}/locations/{location}/publishers/{publisher}/models/{model}`.
26+
* Vertex AI API requests will be sent to this endpoint.
27+
*
28+
* @var string
29+
*/
30+
public $endpoint;
31+
/**
32+
* Optional. The service account to use to make prediction requests against
33+
* endpoints. The resource creator or updater that specifies this field must
34+
* have `iam.serviceAccounts.actAs` permission on the service account. If not
35+
* specified, the Pub/Sub [service
36+
* agent]({$universe.dns_names.final_documentation_domain}/iam/docs/service-
37+
* agents), service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is
38+
* used.
39+
*
40+
* @var string
41+
*/
42+
public $serviceAccountEmail;
43+
protected $unstructuredInferenceType = UnstructuredInference::class;
44+
protected $unstructuredInferenceDataType = '';
45+
46+
/**
47+
* Required. An endpoint to a Vertex AI model of the form
48+
* `projects/{project}/locations/{location}/endpoints/{endpoint}` or `projects
49+
* /{project}/locations/{location}/publishers/{publisher}/models/{model}`.
50+
* Vertex AI API requests will be sent to this endpoint.
51+
*
52+
* @param string $endpoint
53+
*/
54+
public function setEndpoint($endpoint)
55+
{
56+
$this->endpoint = $endpoint;
57+
}
58+
/**
59+
* @return string
60+
*/
61+
public function getEndpoint()
62+
{
63+
return $this->endpoint;
64+
}
65+
/**
66+
* Optional. The service account to use to make prediction requests against
67+
* endpoints. The resource creator or updater that specifies this field must
68+
* have `iam.serviceAccounts.actAs` permission on the service account. If not
69+
* specified, the Pub/Sub [service
70+
* agent]({$universe.dns_names.final_documentation_domain}/iam/docs/service-
71+
* agents), service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is
72+
* used.
73+
*
74+
* @param string $serviceAccountEmail
75+
*/
76+
public function setServiceAccountEmail($serviceAccountEmail)
77+
{
78+
$this->serviceAccountEmail = $serviceAccountEmail;
79+
}
80+
/**
81+
* @return string
82+
*/
83+
public function getServiceAccountEmail()
84+
{
85+
return $this->serviceAccountEmail;
86+
}
87+
/**
88+
* Optional. Requests and responses can be any arbitrary JSON object.
89+
*
90+
* @param UnstructuredInference $unstructuredInference
91+
*/
92+
public function setUnstructuredInference(UnstructuredInference $unstructuredInference)
93+
{
94+
$this->unstructuredInference = $unstructuredInference;
95+
}
96+
/**
97+
* @return UnstructuredInference
98+
*/
99+
public function getUnstructuredInference()
100+
{
101+
return $this->unstructuredInference;
102+
}
103+
}
104+
105+
// Adding a class alias for backwards compatibility with the previous class name.
106+
class_alias(AIInference::class, 'Google_Service_Pubsub_AIInference');

src/Pubsub/CreateSnapshotRequest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class CreateSnapshotRequest extends \Google\Model
2727
*/
2828
public $labels;
2929
/**
30-
* Required. Identifier. The subscription whose backlog the snapshot retains.
30+
* Required. The subscription whose backlog the snapshot retains.
3131
* Specifically, the created snapshot is guaranteed to retain: (a) The
3232
* existing backlog on the subscription. More precisely, this is defined as
3333
* the messages in the subscription's backlog that are unacknowledged upon the
@@ -66,7 +66,7 @@ public function getLabels()
6666
return $this->labels;
6767
}
6868
/**
69-
* Required. Identifier. The subscription whose backlog the snapshot retains.
69+
* Required. The subscription whose backlog the snapshot retains.
7070
* Specifically, the created snapshot is guaranteed to retain: (a) The
7171
* existing backlog on the subscription. More precisely, this is defined as
7272
* the messages in the subscription's backlog that are unacknowledged upon the

src/Pubsub/MessageTransform.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919

2020
class MessageTransform extends \Google\Model
2121
{
22+
protected $aiInferenceType = AIInference::class;
23+
protected $aiInferenceDataType = '';
2224
/**
2325
* Optional. If true, the transform is disabled and will not be applied to
2426
* messages. Defaults to `false`.
@@ -37,6 +39,24 @@ class MessageTransform extends \Google\Model
3739
protected $javascriptUdfType = JavaScriptUDF::class;
3840
protected $javascriptUdfDataType = '';
3941

42+
/**
43+
* Optional. AI Inference. Specifies the Vertex AI endpoint that inference
44+
* requests built from the Pub/Sub message data and provided parameters will
45+
* be sent to.
46+
*
47+
* @param AIInference $aiInference
48+
*/
49+
public function setAiInference(AIInference $aiInference)
50+
{
51+
$this->aiInference = $aiInference;
52+
}
53+
/**
54+
* @return AIInference
55+
*/
56+
public function getAiInference()
57+
{
58+
return $this->aiInference;
59+
}
4060
/**
4161
* Optional. If true, the transform is disabled and will not be applied to
4262
* messages. Defaults to `false`.

src/Pubsub/Resource/ProjectsSnapshots.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ class ProjectsSnapshots extends \Google\Service\Resource
5454
* Snapshot object. Note that for REST API requests, you must specify a name in
5555
* the request. (snapshots.create)
5656
*
57-
* @param string $name Required. Identifier. User-provided name for this
58-
* snapshot. If the name is not provided in the request, the server will assign
59-
* a random name for this snapshot on the same project as the subscription. Note
60-
* that for REST API requests, you must specify a name. See the [resource name
57+
* @param string $name Required. User-provided name for this snapshot. If the
58+
* name is not provided in the request, the server will assign a random name for
59+
* this snapshot on the same project as the subscription. Note that for REST API
60+
* requests, you must specify a name. See the [resource name
6161
* rules](https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names).
6262
* Format is `projects/{project}/snapshots/{snap}`.
6363
* @param CreateSnapshotRequest $postBody
@@ -82,8 +82,8 @@ public function create($name, CreateSnapshotRequest $postBody, $optParams = [])
8282
* with the old snapshot or its subscription, unless the same subscription is
8383
* specified. (snapshots.delete)
8484
*
85-
* @param string $snapshot Required. Identifier. The name of the snapshot to
86-
* delete. Format is `projects/{project}/snapshots/{snap}`.
85+
* @param string $snapshot Required. The name of the snapshot to delete. Format
86+
* is `projects/{project}/snapshots/{snap}`.
8787
* @param array $optParams Optional parameters.
8888
* @return PubsubEmpty
8989
* @throws \Google\Service\Exception
@@ -101,8 +101,8 @@ public function delete($snapshot, $optParams = [])
101101
* set the acknowledgment state of messages in an existing subscription to the
102102
* state captured by a snapshot. (snapshots.get)
103103
*
104-
* @param string $snapshot Required. Identifier. The name of the snapshot to
105-
* get. Format is `projects/{project}/snapshots/{snap}`.
104+
* @param string $snapshot Required. The name of the snapshot to get. Format is
105+
* `projects/{project}/snapshots/{snap}`.
106106
* @param array $optParams Optional parameters.
107107
* @return Snapshot
108108
* @throws \Google\Service\Exception
@@ -151,8 +151,8 @@ public function getIamPolicy($resource, $optParams = [])
151151
* acknowledgment state of messages in an existing subscription to the state
152152
* captured by a snapshot. (snapshots.listProjectsSnapshots)
153153
*
154-
* @param string $project Required. Identifier. The name of the project in which
155-
* to list snapshots. Format is `projects/{project-id}`.
154+
* @param string $project Required. The name of the project in which to list
155+
* snapshots. Format is `projects/{project-id}`.
156156
* @param array $optParams Optional parameters.
157157
*
158158
* @opt_param int pageSize Optional. Maximum number of snapshots to return.

src/Pubsub/Resource/ProjectsSubscriptions.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ public function create($name, Subscription $postBody, $optParams = [])
101101
* the same name, but the new one has no association with the old subscription
102102
* or its topic unless the same topic is specified. (subscriptions.delete)
103103
*
104-
* @param string $subscription Required. Identifier. The subscription to delete.
105-
* Format is `projects/{project}/subscriptions/{sub}`.
104+
* @param string $subscription Required. The subscription to delete. Format is
105+
* `projects/{project}/subscriptions/{sub}`.
106106
* @param array $optParams Optional parameters.
107107
* @return PubsubEmpty
108108
* @throws \Google\Service\Exception
@@ -134,8 +134,8 @@ public function detach($subscription, $optParams = [])
134134
/**
135135
* Gets the configuration details of a subscription. (subscriptions.get)
136136
*
137-
* @param string $subscription Required. Identifier. The name of the
138-
* subscription to get. Format is `projects/{project}/subscriptions/{sub}`.
137+
* @param string $subscription Required. The name of the subscription to get.
138+
* Format is `projects/{project}/subscriptions/{sub}`.
139139
* @param array $optParams Optional parameters.
140140
* @return Subscription
141141
* @throws \Google\Service\Exception
@@ -180,8 +180,8 @@ public function getIamPolicy($resource, $optParams = [])
180180
/**
181181
* Lists matching subscriptions. (subscriptions.listProjectsSubscriptions)
182182
*
183-
* @param string $project Required. Identifier. The name of the project in which
184-
* to list subscriptions. Format is `projects/{project-id}`.
183+
* @param string $project Required. The name of the project in which to list
184+
* subscriptions. Format is `projects/{project-id}`.
185185
* @param array $optParams Optional parameters.
186186
*
187187
* @opt_param int pageSize Optional. Maximum number of subscriptions to return.

src/Pubsub/Resource/ProjectsTopics.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ public function create($name, Topic $postBody, $optParams = [])
6767
* subscriptions. Existing subscriptions to this topic are not deleted, but
6868
* their `topic` field is set to `_deleted-topic_`. (topics.delete)
6969
*
70-
* @param string $topic Required. Identifier. Name of the topic to delete.
71-
* Format is `projects/{project}/topics/{topic}`.
70+
* @param string $topic Required. Name of the topic to delete. Format is
71+
* `projects/{project}/topics/{topic}`.
7272
* @param array $optParams Optional parameters.
7373
* @return PubsubEmpty
7474
* @throws \Google\Service\Exception
@@ -82,8 +82,8 @@ public function delete($topic, $optParams = [])
8282
/**
8383
* Gets the configuration of a topic. (topics.get)
8484
*
85-
* @param string $topic Required. Identifier. The name of the topic to get.
86-
* Format is `projects/{project}/topics/{topic}`.
85+
* @param string $topic Required. The name of the topic to get. Format is
86+
* `projects/{project}/topics/{topic}`.
8787
* @param array $optParams Optional parameters.
8888
* @return Topic
8989
* @throws \Google\Service\Exception
@@ -128,8 +128,8 @@ public function getIamPolicy($resource, $optParams = [])
128128
/**
129129
* Lists matching topics. (topics.listProjectsTopics)
130130
*
131-
* @param string $project Required. Identifier. The name of the project in which
132-
* to list topics. Format is `projects/{project-id}`.
131+
* @param string $project Required. The name of the project in which to list
132+
* topics. Format is `projects/{project-id}`.
133133
* @param array $optParams Optional parameters.
134134
*
135135
* @opt_param int pageSize Optional. Maximum number of topics to return.
@@ -171,8 +171,8 @@ public function patch($name, UpdateTopicRequest $postBody, $optParams = [])
171171
* Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic does
172172
* not exist. (topics.publish)
173173
*
174-
* @param string $topic Required. Identifier. The messages in the request will
175-
* be published on this topic. Format is `projects/{project}/topics/{topic}`.
174+
* @param string $topic Required. The messages in the request will be published
175+
* on this topic. Format is `projects/{project}/topics/{topic}`.
176176
* @param PublishRequest $postBody
177177
* @param array $optParams Optional parameters.
178178
* @return PublishResponse

src/Pubsub/Subscription.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,9 @@ class Subscription extends \Google\Collection
168168
*/
169169
public $tags;
170170
/**
171-
* Required. Identifier. The name of the topic from which this subscription is
172-
* receiving messages. Format is `projects/{project}/topics/{topic}`. The
173-
* value of this field will be `_deleted-topic_` if the topic has been
174-
* deleted.
171+
* Required. The name of the topic from which this subscription is receiving
172+
* messages. Format is `projects/{project}/topics/{topic}`. The value of this
173+
* field will be `_deleted-topic_` if the topic has been deleted.
175174
*
176175
* @var string
177176
*/
@@ -566,10 +565,9 @@ public function getTags()
566565
return $this->tags;
567566
}
568567
/**
569-
* Required. Identifier. The name of the topic from which this subscription is
570-
* receiving messages. Format is `projects/{project}/topics/{topic}`. The
571-
* value of this field will be `_deleted-topic_` if the topic has been
572-
* deleted.
568+
* Required. The name of the topic from which this subscription is receiving
569+
* messages. Format is `projects/{project}/topics/{topic}`. The value of this
570+
* field will be `_deleted-topic_` if the topic has been deleted.
573571
*
574572
* @param string $topic
575573
*/
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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 UnstructuredInference extends \Google\Model
21+
{
22+
/**
23+
* Optional. A parameters object to be included in each inference request. The
24+
* parameters object is combined with the data field of the Pub/Sub message to
25+
* form the inference request.
26+
*
27+
* @var array[]
28+
*/
29+
public $parameters;
30+
31+
/**
32+
* Optional. A parameters object to be included in each inference request. The
33+
* parameters object is combined with the data field of the Pub/Sub message to
34+
* form the inference request.
35+
*
36+
* @param array[] $parameters
37+
*/
38+
public function setParameters($parameters)
39+
{
40+
$this->parameters = $parameters;
41+
}
42+
/**
43+
* @return array[]
44+
*/
45+
public function getParameters()
46+
{
47+
return $this->parameters;
48+
}
49+
}
50+
51+
// Adding a class alias for backwards compatibility with the previous class name.
52+
class_alias(UnstructuredInference::class, 'Google_Service_Pubsub_UnstructuredInference');

0 commit comments

Comments
 (0)