Repository navigation
Expand file tree
/
Copy pathCompleteQueryResponse.php
More file actions
207 lines (192 loc) · 9.03 KB
/
Copy pathCompleteQueryResponse.php
File metadata and controls
207 lines (192 loc) · 9.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/cloud/retail/v2/completion_service.proto
namespace Google\Cloud\Retail\V2;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* Response of the auto-complete query.
*
* Generated from protobuf message <code>google.cloud.retail.v2.CompleteQueryResponse</code>
*/
class CompleteQueryResponse extends \Google\Protobuf\Internal\Message
{
/**
* Results of the matching suggestions. The result list is ordered and the
* first result is top suggestion.
*
* Generated from protobuf field <code>repeated .google.cloud.retail.v2.CompleteQueryResponse.CompletionResult completion_results = 1;</code>
*/
private $completion_results;
/**
* A unique complete token. This should be included in the
* [SearchRequest][google.cloud.retail.v2.SearchRequest] resulting from this
* completion, which enables accurate attribution of complete model
* performance.
*
* Generated from protobuf field <code>string attribution_token = 2;</code>
*/
private $attribution_token = '';
/**
* Matched recent searches of this user. The maximum number of recent searches
* is 10. This field is a restricted feature. Contact Retail Search support
* team if you are interested in enabling it.
* This feature is only available when
* [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id]
* field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported.
* The recent searches satisfy the follow rules:
* * They are ordered from latest to oldest.
* * They are matched with
* [CompleteQueryRequest.query][google.cloud.retail.v2.CompleteQueryRequest.query]
* case insensitively.
* * They are transformed to lower cases.
* * They are UTF-8 safe.
* Recent searches are deduplicated. More recent searches will be reserved
* when duplication happens.
*
* Generated from protobuf field <code>repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3;</code>
*/
private $recent_search_results;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type \Google\Cloud\Retail\V2\CompleteQueryResponse\CompletionResult[]|\Google\Protobuf\Internal\RepeatedField $completion_results
* Results of the matching suggestions. The result list is ordered and the
* first result is top suggestion.
* @type string $attribution_token
* A unique complete token. This should be included in the
* [SearchRequest][google.cloud.retail.v2.SearchRequest] resulting from this
* completion, which enables accurate attribution of complete model
* performance.
* @type \Google\Cloud\Retail\V2\CompleteQueryResponse\RecentSearchResult[]|\Google\Protobuf\Internal\RepeatedField $recent_search_results
* Matched recent searches of this user. The maximum number of recent searches
* is 10. This field is a restricted feature. Contact Retail Search support
* team if you are interested in enabling it.
* This feature is only available when
* [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id]
* field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported.
* The recent searches satisfy the follow rules:
* * They are ordered from latest to oldest.
* * They are matched with
* [CompleteQueryRequest.query][google.cloud.retail.v2.CompleteQueryRequest.query]
* case insensitively.
* * They are transformed to lower cases.
* * They are UTF-8 safe.
* Recent searches are deduplicated. More recent searches will be reserved
* when duplication happens.
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Google\Cloud\Retail\V2\CompletionService::initOnce();
parent::__construct($data);
}
/**
* Results of the matching suggestions. The result list is ordered and the
* first result is top suggestion.
*
* Generated from protobuf field <code>repeated .google.cloud.retail.v2.CompleteQueryResponse.CompletionResult completion_results = 1;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getCompletionResults()
{
return $this->completion_results;
}
/**
* Results of the matching suggestions. The result list is ordered and the
* first result is top suggestion.
*
* Generated from protobuf field <code>repeated .google.cloud.retail.v2.CompleteQueryResponse.CompletionResult completion_results = 1;</code>
* @param \Google\Cloud\Retail\V2\CompleteQueryResponse\CompletionResult[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setCompletionResults($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\CompleteQueryResponse\CompletionResult::class);
$this->completion_results = $arr;
return $this;
}
/**
* A unique complete token. This should be included in the
* [SearchRequest][google.cloud.retail.v2.SearchRequest] resulting from this
* completion, which enables accurate attribution of complete model
* performance.
*
* Generated from protobuf field <code>string attribution_token = 2;</code>
* @return string
*/
public function getAttributionToken()
{
return $this->attribution_token;
}
/**
* A unique complete token. This should be included in the
* [SearchRequest][google.cloud.retail.v2.SearchRequest] resulting from this
* completion, which enables accurate attribution of complete model
* performance.
*
* Generated from protobuf field <code>string attribution_token = 2;</code>
* @param string $var
* @return $this
*/
public function setAttributionToken($var)
{
GPBUtil::checkString($var, True);
$this->attribution_token = $var;
return $this;
}
/**
* Matched recent searches of this user. The maximum number of recent searches
* is 10. This field is a restricted feature. Contact Retail Search support
* team if you are interested in enabling it.
* This feature is only available when
* [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id]
* field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported.
* The recent searches satisfy the follow rules:
* * They are ordered from latest to oldest.
* * They are matched with
* [CompleteQueryRequest.query][google.cloud.retail.v2.CompleteQueryRequest.query]
* case insensitively.
* * They are transformed to lower cases.
* * They are UTF-8 safe.
* Recent searches are deduplicated. More recent searches will be reserved
* when duplication happens.
*
* Generated from protobuf field <code>repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getRecentSearchResults()
{
return $this->recent_search_results;
}
/**
* Matched recent searches of this user. The maximum number of recent searches
* is 10. This field is a restricted feature. Contact Retail Search support
* team if you are interested in enabling it.
* This feature is only available when
* [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id]
* field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported.
* The recent searches satisfy the follow rules:
* * They are ordered from latest to oldest.
* * They are matched with
* [CompleteQueryRequest.query][google.cloud.retail.v2.CompleteQueryRequest.query]
* case insensitively.
* * They are transformed to lower cases.
* * They are UTF-8 safe.
* Recent searches are deduplicated. More recent searches will be reserved
* when duplication happens.
*
* Generated from protobuf field <code>repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3;</code>
* @param \Google\Cloud\Retail\V2\CompleteQueryResponse\RecentSearchResult[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setRecentSearchResults($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\CompleteQueryResponse\RecentSearchResult::class);
$this->recent_search_results = $arr;
return $this;
}
}