OLD | NEW |
1 // This is a generated file (see the discoveryapis_generator project). | 1 // This is a generated file (see the discoveryapis_generator project). |
2 | 2 |
3 library googleapis_beta.proximitybeacon.v1beta1; | 3 library googleapis_beta.proximitybeacon.v1beta1; |
4 | 4 |
5 import 'dart:core' as core; | 5 import 'dart:core' as core; |
6 import 'dart:async' as async; | 6 import 'dart:async' as async; |
7 import 'dart:convert' as convert; | 7 import 'dart:convert' as convert; |
8 | 8 |
9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; | 9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
10 import 'package:http/http.dart' as http; | 10 import 'package:http/http.dart' as http; |
11 | 11 |
12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show | 12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' |
13 ApiRequestError, DetailedApiRequestError; | 13 show ApiRequestError, DetailedApiRequestError; |
14 | 14 |
15 const core.String USER_AGENT = 'dart-api-client proximitybeacon/v1beta1'; | 15 const core.String USER_AGENT = 'dart-api-client proximitybeacon/v1beta1'; |
16 | 16 |
17 /** Registers, manages, indexes, and searches beacons. */ | 17 /// Registers, manages, indexes, and searches beacons. |
18 class ProximitybeaconApi { | 18 class ProximitybeaconApi { |
19 /** View and modify your beacons */ | 19 /// View and modify your beacons |
20 static const UserlocationBeaconRegistryScope = "https://www.googleapis.com/aut
h/userlocation.beacon.registry"; | 20 static const UserlocationBeaconRegistryScope = |
21 | 21 "https://www.googleapis.com/auth/userlocation.beacon.registry"; |
22 | 22 |
23 final commons.ApiRequester _requester; | 23 final commons.ApiRequester _requester; |
24 | 24 |
25 BeaconinfoResourceApi get beaconinfo => new BeaconinfoResourceApi(_requester); | 25 BeaconinfoResourceApi get beaconinfo => new BeaconinfoResourceApi(_requester); |
26 BeaconsResourceApi get beacons => new BeaconsResourceApi(_requester); | 26 BeaconsResourceApi get beacons => new BeaconsResourceApi(_requester); |
27 NamespacesResourceApi get namespaces => new NamespacesResourceApi(_requester); | 27 NamespacesResourceApi get namespaces => new NamespacesResourceApi(_requester); |
28 V1beta1ResourceApi get v1beta1 => new V1beta1ResourceApi(_requester); | 28 V1beta1ResourceApi get v1beta1 => new V1beta1ResourceApi(_requester); |
29 | 29 |
30 ProximitybeaconApi(http.Client client, {core.String rootUrl: "https://proximit
ybeacon.googleapis.com/", core.String servicePath: ""}) : | 30 ProximitybeaconApi(http.Client client, |
31 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); | 31 {core.String rootUrl: "https://proximitybeacon.googleapis.com/", |
| 32 core.String servicePath: ""}) |
| 33 : _requester = |
| 34 new commons.ApiRequester(client, rootUrl, servicePath, USER_AGENT); |
32 } | 35 } |
33 | 36 |
34 | |
35 class BeaconinfoResourceApi { | 37 class BeaconinfoResourceApi { |
36 final commons.ApiRequester _requester; | 38 final commons.ApiRequester _requester; |
37 | 39 |
38 BeaconinfoResourceApi(commons.ApiRequester client) : | 40 BeaconinfoResourceApi(commons.ApiRequester client) : _requester = client; |
39 _requester = client; | |
40 | 41 |
41 /** | 42 /// Given one or more beacon observations, returns any beacon information |
42 * Given one or more beacon observations, returns any beacon information | 43 /// and attachments accessible to your application. Authorize by using the |
43 * and attachments accessible to your application. Authorize by using the | 44 /// [API |
44 * [API | 45 /// key](https://developers.google.com/beacons/proximity/get-started#request_a
_browser_api_key) |
45 * key](https://developers.google.com/beacons/proximity/get-started#request_a_
browser_api_key) | 46 /// for the application. |
46 * for the application. | 47 /// |
47 * | 48 /// [request] - The metadata request object. |
48 * [request] - The metadata request object. | 49 /// |
49 * | 50 /// Request parameters: |
50 * Request parameters: | 51 /// |
51 * | 52 /// Completes with a [GetInfoForObservedBeaconsResponse]. |
52 * Completes with a [GetInfoForObservedBeaconsResponse]. | 53 /// |
53 * | 54 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
54 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 55 /// an error. |
55 * error. | 56 /// |
56 * | 57 /// If the used [http.Client] completes with an error when making a REST |
57 * If the used [http.Client] completes with an error when making a REST call, | 58 /// call, this method will complete with the same error. |
58 * this method will complete with the same error. | 59 async.Future<GetInfoForObservedBeaconsResponse> getforobserved( |
59 */ | 60 GetInfoForObservedBeaconsRequest request) { |
60 async.Future<GetInfoForObservedBeaconsResponse> getforobserved(GetInfoForObser
vedBeaconsRequest request) { | |
61 var _url = null; | 61 var _url = null; |
62 var _queryParams = new core.Map(); | 62 var _queryParams = new core.Map(); |
63 var _uploadMedia = null; | 63 var _uploadMedia = null; |
64 var _uploadOptions = null; | 64 var _uploadOptions = null; |
65 var _downloadOptions = commons.DownloadOptions.Metadata; | 65 var _downloadOptions = commons.DownloadOptions.Metadata; |
66 var _body = null; | 66 var _body = null; |
67 | 67 |
68 if (request != null) { | 68 if (request != null) { |
69 _body = convert.JSON.encode((request).toJson()); | 69 _body = convert.JSON.encode((request).toJson()); |
70 } | 70 } |
71 | 71 |
72 _url = 'v1beta1/beaconinfo:getforobserved'; | 72 _url = 'v1beta1/beaconinfo:getforobserved'; |
73 | 73 |
74 var _response = _requester.request(_url, | 74 var _response = _requester.request(_url, "POST", |
75 "POST", | 75 body: _body, |
76 body: _body, | 76 queryParams: _queryParams, |
77 queryParams: _queryParams, | 77 uploadOptions: _uploadOptions, |
78 uploadOptions: _uploadOptions, | 78 uploadMedia: _uploadMedia, |
79 uploadMedia: _uploadMedia, | 79 downloadOptions: _downloadOptions); |
80 downloadOptions: _downloadOptions); | 80 return _response |
81 return _response.then((data) => new GetInfoForObservedBeaconsResponse.fromJs
on(data)); | 81 .then((data) => new GetInfoForObservedBeaconsResponse.fromJson(data)); |
82 } | 82 } |
83 | |
84 } | 83 } |
85 | 84 |
86 | |
87 class BeaconsResourceApi { | 85 class BeaconsResourceApi { |
88 final commons.ApiRequester _requester; | 86 final commons.ApiRequester _requester; |
89 | 87 |
90 BeaconsAttachmentsResourceApi get attachments => new BeaconsAttachmentsResourc
eApi(_requester); | 88 BeaconsAttachmentsResourceApi get attachments => |
91 BeaconsDiagnosticsResourceApi get diagnostics => new BeaconsDiagnosticsResourc
eApi(_requester); | 89 new BeaconsAttachmentsResourceApi(_requester); |
| 90 BeaconsDiagnosticsResourceApi get diagnostics => |
| 91 new BeaconsDiagnosticsResourceApi(_requester); |
92 | 92 |
93 BeaconsResourceApi(commons.ApiRequester client) : | 93 BeaconsResourceApi(commons.ApiRequester client) : _requester = client; |
94 _requester = client; | |
95 | 94 |
96 /** | 95 /// Activates a beacon. A beacon that is active will return information |
97 * Activates a beacon. A beacon that is active will return information | 96 /// and attachment data when queried via `beaconinfo.getforobserved`. |
98 * and attachment data when queried via `beaconinfo.getforobserved`. | 97 /// Calling this method on an already active beacon will do nothing (but |
99 * Calling this method on an already active beacon will do nothing (but | 98 /// will return a successful response code). |
100 * will return a successful response code). | 99 /// |
101 * | 100 /// Authenticate using an [OAuth access |
102 * Authenticate using an [OAuth access | 101 /// token](https://developers.google.com/identity/protocols/OAuth2) |
103 * token](https://developers.google.com/identity/protocols/OAuth2) | 102 /// from a signed-in user with **Is owner** or **Can edit** permissions in |
104 * from a signed-in user with **Is owner** or **Can edit** permissions in the | 103 /// the |
105 * Google Developers Console project. | 104 /// Google Developers Console project. |
106 * | 105 /// |
107 * Request parameters: | 106 /// Request parameters: |
108 * | 107 /// |
109 * [beaconName] - Beacon that should be activated. A beacon name has the | 108 /// [beaconName] - Beacon that should be activated. A beacon name has the |
110 * format | 109 /// format |
111 * "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by | 110 /// "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by |
112 * the beacon and N is a code for the beacon's type. Possible values are | 111 /// the beacon and N is a code for the beacon's type. Possible values are |
113 * `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` | 112 /// `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` |
114 * for AltBeacon. For Eddystone-EID beacons, you may use either the | 113 /// for AltBeacon. For Eddystone-EID beacons, you may use either the |
115 * current EID or the beacon's "stable" UID. | 114 /// current EID or the beacon's "stable" UID. |
116 * Required. | 115 /// Required. |
117 * Value must have pattern "^beacons/[^/]+$". | 116 /// Value must have pattern "^beacons/[^/]+$". |
118 * | 117 /// |
119 * [projectId] - The project id of the beacon to activate. If the project id | 118 /// [projectId] - The project id of the beacon to activate. If the project id |
120 * is not | 119 /// is not |
121 * specified then the project making the request is used. The project id | 120 /// specified then the project making the request is used. The project id |
122 * must match the project that owns the beacon. | 121 /// must match the project that owns the beacon. |
123 * Optional. | 122 /// Optional. |
124 * | 123 /// |
125 * Completes with a [Empty]. | 124 /// Completes with a [Empty]. |
126 * | 125 /// |
127 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 126 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
128 * error. | 127 /// an error. |
129 * | 128 /// |
130 * If the used [http.Client] completes with an error when making a REST call, | 129 /// If the used [http.Client] completes with an error when making a REST |
131 * this method will complete with the same error. | 130 /// call, this method will complete with the same error. |
132 */ | 131 async.Future<Empty> activate(core.String beaconName, |
133 async.Future<Empty> activate(core.String beaconName, {core.String projectId})
{ | 132 {core.String projectId}) { |
134 var _url = null; | 133 var _url = null; |
135 var _queryParams = new core.Map(); | 134 var _queryParams = new core.Map(); |
136 var _uploadMedia = null; | 135 var _uploadMedia = null; |
137 var _uploadOptions = null; | 136 var _uploadOptions = null; |
138 var _downloadOptions = commons.DownloadOptions.Metadata; | 137 var _downloadOptions = commons.DownloadOptions.Metadata; |
139 var _body = null; | 138 var _body = null; |
140 | 139 |
141 if (beaconName == null) { | 140 if (beaconName == null) { |
142 throw new core.ArgumentError("Parameter beaconName is required."); | 141 throw new core.ArgumentError("Parameter beaconName is required."); |
143 } | 142 } |
144 if (projectId != null) { | 143 if (projectId != null) { |
145 _queryParams["projectId"] = [projectId]; | 144 _queryParams["projectId"] = [projectId]; |
146 } | 145 } |
147 | 146 |
148 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$beaconName') + '
:activate'; | 147 _url = 'v1beta1/' + |
| 148 commons.Escaper.ecapeVariableReserved('$beaconName') + |
| 149 ':activate'; |
149 | 150 |
150 var _response = _requester.request(_url, | 151 var _response = _requester.request(_url, "POST", |
151 "POST", | 152 body: _body, |
152 body: _body, | 153 queryParams: _queryParams, |
153 queryParams: _queryParams, | 154 uploadOptions: _uploadOptions, |
154 uploadOptions: _uploadOptions, | 155 uploadMedia: _uploadMedia, |
155 uploadMedia: _uploadMedia, | 156 downloadOptions: _downloadOptions); |
156 downloadOptions: _downloadOptions); | |
157 return _response.then((data) => new Empty.fromJson(data)); | 157 return _response.then((data) => new Empty.fromJson(data)); |
158 } | 158 } |
159 | 159 |
160 /** | 160 /// Deactivates a beacon. Once deactivated, the API will not return |
161 * Deactivates a beacon. Once deactivated, the API will not return | 161 /// information nor attachment data for the beacon when queried via |
162 * information nor attachment data for the beacon when queried via | 162 /// `beaconinfo.getforobserved`. Calling this method on an already inactive |
163 * `beaconinfo.getforobserved`. Calling this method on an already inactive | 163 /// beacon will do nothing (but will return a successful response code). |
164 * beacon will do nothing (but will return a successful response code). | 164 /// |
165 * | 165 /// Authenticate using an [OAuth access |
166 * Authenticate using an [OAuth access | 166 /// token](https://developers.google.com/identity/protocols/OAuth2) |
167 * token](https://developers.google.com/identity/protocols/OAuth2) | 167 /// from a signed-in user with **Is owner** or **Can edit** permissions in |
168 * from a signed-in user with **Is owner** or **Can edit** permissions in the | 168 /// the |
169 * Google Developers Console project. | 169 /// Google Developers Console project. |
170 * | 170 /// |
171 * Request parameters: | 171 /// Request parameters: |
172 * | 172 /// |
173 * [beaconName] - Beacon that should be deactivated. A beacon name has the | 173 /// [beaconName] - Beacon that should be deactivated. A beacon name has the |
174 * format | 174 /// format |
175 * "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by | 175 /// "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by |
176 * the beacon and N is a code for the beacon's type. Possible values are | 176 /// the beacon and N is a code for the beacon's type. Possible values are |
177 * `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` | 177 /// `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` |
178 * for AltBeacon. For Eddystone-EID beacons, you may use either the | 178 /// for AltBeacon. For Eddystone-EID beacons, you may use either the |
179 * current EID or the beacon's "stable" UID. | 179 /// current EID or the beacon's "stable" UID. |
180 * Required. | 180 /// Required. |
181 * Value must have pattern "^beacons/[^/]+$". | 181 /// Value must have pattern "^beacons/[^/]+$". |
182 * | 182 /// |
183 * [projectId] - The project id of the beacon to deactivate. If the project id | 183 /// [projectId] - The project id of the beacon to deactivate. If the project |
184 * is not | 184 /// id is not |
185 * specified then the project making the request is used. The project id must | 185 /// specified then the project making the request is used. The project id |
186 * match the project that owns the beacon. | 186 /// must |
187 * Optional. | 187 /// match the project that owns the beacon. |
188 * | 188 /// Optional. |
189 * Completes with a [Empty]. | 189 /// |
190 * | 190 /// Completes with a [Empty]. |
191 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 191 /// |
192 * error. | 192 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
193 * | 193 /// an error. |
194 * If the used [http.Client] completes with an error when making a REST call, | 194 /// |
195 * this method will complete with the same error. | 195 /// If the used [http.Client] completes with an error when making a REST |
196 */ | 196 /// call, this method will complete with the same error. |
197 async.Future<Empty> deactivate(core.String beaconName, {core.String projectId}
) { | 197 async.Future<Empty> deactivate(core.String beaconName, |
| 198 {core.String projectId}) { |
198 var _url = null; | 199 var _url = null; |
199 var _queryParams = new core.Map(); | 200 var _queryParams = new core.Map(); |
200 var _uploadMedia = null; | 201 var _uploadMedia = null; |
201 var _uploadOptions = null; | 202 var _uploadOptions = null; |
202 var _downloadOptions = commons.DownloadOptions.Metadata; | 203 var _downloadOptions = commons.DownloadOptions.Metadata; |
203 var _body = null; | 204 var _body = null; |
204 | 205 |
205 if (beaconName == null) { | 206 if (beaconName == null) { |
206 throw new core.ArgumentError("Parameter beaconName is required."); | 207 throw new core.ArgumentError("Parameter beaconName is required."); |
207 } | 208 } |
208 if (projectId != null) { | 209 if (projectId != null) { |
209 _queryParams["projectId"] = [projectId]; | 210 _queryParams["projectId"] = [projectId]; |
210 } | 211 } |
211 | 212 |
212 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$beaconName') + '
:deactivate'; | 213 _url = 'v1beta1/' + |
| 214 commons.Escaper.ecapeVariableReserved('$beaconName') + |
| 215 ':deactivate'; |
213 | 216 |
214 var _response = _requester.request(_url, | 217 var _response = _requester.request(_url, "POST", |
215 "POST", | 218 body: _body, |
216 body: _body, | 219 queryParams: _queryParams, |
217 queryParams: _queryParams, | 220 uploadOptions: _uploadOptions, |
218 uploadOptions: _uploadOptions, | 221 uploadMedia: _uploadMedia, |
219 uploadMedia: _uploadMedia, | 222 downloadOptions: _downloadOptions); |
220 downloadOptions: _downloadOptions); | |
221 return _response.then((data) => new Empty.fromJson(data)); | 223 return _response.then((data) => new Empty.fromJson(data)); |
222 } | 224 } |
223 | 225 |
224 /** | 226 /// Decommissions the specified beacon in the service. This beacon will no |
225 * Decommissions the specified beacon in the service. This beacon will no | 227 /// longer be returned from `beaconinfo.getforobserved`. This operation is |
226 * longer be returned from `beaconinfo.getforobserved`. This operation is | 228 /// permanent -- you will not be able to re-register a beacon with this ID |
227 * permanent -- you will not be able to re-register a beacon with this ID | 229 /// again. |
228 * again. | 230 /// |
229 * | 231 /// Authenticate using an [OAuth access |
230 * Authenticate using an [OAuth access | 232 /// token](https://developers.google.com/identity/protocols/OAuth2) |
231 * token](https://developers.google.com/identity/protocols/OAuth2) | 233 /// from a signed-in user with **Is owner** or **Can edit** permissions in |
232 * from a signed-in user with **Is owner** or **Can edit** permissions in the | 234 /// the |
233 * Google Developers Console project. | 235 /// Google Developers Console project. |
234 * | 236 /// |
235 * Request parameters: | 237 /// Request parameters: |
236 * | 238 /// |
237 * [beaconName] - Beacon that should be decommissioned. A beacon name has the | 239 /// [beaconName] - Beacon that should be decommissioned. A beacon name has |
238 * format | 240 /// the format |
239 * "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by | 241 /// "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by |
240 * the beacon and N is a code for the beacon's type. Possible values are | 242 /// the beacon and N is a code for the beacon's type. Possible values are |
241 * `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` | 243 /// `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` |
242 * for AltBeacon. For Eddystone-EID beacons, you may use either the | 244 /// for AltBeacon. For Eddystone-EID beacons, you may use either the |
243 * current EID of the beacon's "stable" UID. | 245 /// current EID of the beacon's "stable" UID. |
244 * Required. | 246 /// Required. |
245 * Value must have pattern "^beacons/[^/]+$". | 247 /// Value must have pattern "^beacons/[^/]+$". |
246 * | 248 /// |
247 * [projectId] - The project id of the beacon to decommission. If the project | 249 /// [projectId] - The project id of the beacon to decommission. If the |
248 * id is not | 250 /// project id is not |
249 * specified then the project making the request is used. The project id | 251 /// specified then the project making the request is used. The project id |
250 * must match the project that owns the beacon. | 252 /// must match the project that owns the beacon. |
251 * Optional. | 253 /// Optional. |
252 * | 254 /// |
253 * Completes with a [Empty]. | 255 /// Completes with a [Empty]. |
254 * | 256 /// |
255 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 257 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
256 * error. | 258 /// an error. |
257 * | 259 /// |
258 * If the used [http.Client] completes with an error when making a REST call, | 260 /// If the used [http.Client] completes with an error when making a REST |
259 * this method will complete with the same error. | 261 /// call, this method will complete with the same error. |
260 */ | 262 async.Future<Empty> decommission(core.String beaconName, |
261 async.Future<Empty> decommission(core.String beaconName, {core.String projectI
d}) { | 263 {core.String projectId}) { |
262 var _url = null; | 264 var _url = null; |
263 var _queryParams = new core.Map(); | 265 var _queryParams = new core.Map(); |
264 var _uploadMedia = null; | 266 var _uploadMedia = null; |
265 var _uploadOptions = null; | 267 var _uploadOptions = null; |
266 var _downloadOptions = commons.DownloadOptions.Metadata; | 268 var _downloadOptions = commons.DownloadOptions.Metadata; |
267 var _body = null; | 269 var _body = null; |
268 | 270 |
269 if (beaconName == null) { | 271 if (beaconName == null) { |
270 throw new core.ArgumentError("Parameter beaconName is required."); | 272 throw new core.ArgumentError("Parameter beaconName is required."); |
271 } | 273 } |
272 if (projectId != null) { | 274 if (projectId != null) { |
273 _queryParams["projectId"] = [projectId]; | 275 _queryParams["projectId"] = [projectId]; |
274 } | 276 } |
275 | 277 |
276 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$beaconName') + '
:decommission'; | 278 _url = 'v1beta1/' + |
| 279 commons.Escaper.ecapeVariableReserved('$beaconName') + |
| 280 ':decommission'; |
277 | 281 |
278 var _response = _requester.request(_url, | 282 var _response = _requester.request(_url, "POST", |
279 "POST", | 283 body: _body, |
280 body: _body, | 284 queryParams: _queryParams, |
281 queryParams: _queryParams, | 285 uploadOptions: _uploadOptions, |
282 uploadOptions: _uploadOptions, | 286 uploadMedia: _uploadMedia, |
283 uploadMedia: _uploadMedia, | 287 downloadOptions: _downloadOptions); |
284 downloadOptions: _downloadOptions); | |
285 return _response.then((data) => new Empty.fromJson(data)); | 288 return _response.then((data) => new Empty.fromJson(data)); |
286 } | 289 } |
287 | 290 |
288 /** | 291 /// Deletes the specified beacon including all diagnostics data for the |
289 * Deletes the specified beacon including all diagnostics data for the beacon | 292 /// beacon |
290 * as well as any attachments on the beacon (including those belonging to | 293 /// as well as any attachments on the beacon (including those belonging to |
291 * other projects). This operation cannot be undone. | 294 /// other projects). This operation cannot be undone. |
292 * | 295 /// |
293 * Authenticate using an [OAuth access | 296 /// Authenticate using an [OAuth access |
294 * token](https://developers.google.com/identity/protocols/OAuth2) | 297 /// token](https://developers.google.com/identity/protocols/OAuth2) |
295 * from a signed-in user with **Is owner** or **Can edit** permissions in the | 298 /// from a signed-in user with **Is owner** or **Can edit** permissions in |
296 * Google Developers Console project. | 299 /// the |
297 * | 300 /// Google Developers Console project. |
298 * Request parameters: | 301 /// |
299 * | 302 /// Request parameters: |
300 * [beaconName] - Beacon that should be deleted. A beacon name has the format | 303 /// |
301 * "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by | 304 /// [beaconName] - Beacon that should be deleted. A beacon name has the |
302 * the beacon and N is a code for the beacon's type. Possible values are | 305 /// format |
303 * `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` | 306 /// "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by |
304 * for AltBeacon. For Eddystone-EID beacons, you may use either the | 307 /// the beacon and N is a code for the beacon's type. Possible values are |
305 * current EID or the beacon's "stable" UID. | 308 /// `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` |
306 * Required. | 309 /// for AltBeacon. For Eddystone-EID beacons, you may use either the |
307 * Value must have pattern "^beacons/[^/]+$". | 310 /// current EID or the beacon's "stable" UID. |
308 * | 311 /// Required. |
309 * [projectId] - The project id of the beacon to delete. If not provided, the | 312 /// Value must have pattern "^beacons/[^/]+$". |
310 * project | 313 /// |
311 * that is making the request is used. | 314 /// [projectId] - The project id of the beacon to delete. If not provided, |
312 * Optional. | 315 /// the project |
313 * | 316 /// that is making the request is used. |
314 * Completes with a [Empty]. | 317 /// Optional. |
315 * | 318 /// |
316 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 319 /// Completes with a [Empty]. |
317 * error. | 320 /// |
318 * | 321 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
319 * If the used [http.Client] completes with an error when making a REST call, | 322 /// an error. |
320 * this method will complete with the same error. | 323 /// |
321 */ | 324 /// If the used [http.Client] completes with an error when making a REST |
| 325 /// call, this method will complete with the same error. |
322 async.Future<Empty> delete(core.String beaconName, {core.String projectId}) { | 326 async.Future<Empty> delete(core.String beaconName, {core.String projectId}) { |
323 var _url = null; | 327 var _url = null; |
324 var _queryParams = new core.Map(); | 328 var _queryParams = new core.Map(); |
325 var _uploadMedia = null; | 329 var _uploadMedia = null; |
326 var _uploadOptions = null; | 330 var _uploadOptions = null; |
327 var _downloadOptions = commons.DownloadOptions.Metadata; | 331 var _downloadOptions = commons.DownloadOptions.Metadata; |
328 var _body = null; | 332 var _body = null; |
329 | 333 |
330 if (beaconName == null) { | 334 if (beaconName == null) { |
331 throw new core.ArgumentError("Parameter beaconName is required."); | 335 throw new core.ArgumentError("Parameter beaconName is required."); |
332 } | 336 } |
333 if (projectId != null) { | 337 if (projectId != null) { |
334 _queryParams["projectId"] = [projectId]; | 338 _queryParams["projectId"] = [projectId]; |
335 } | 339 } |
336 | 340 |
337 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$beaconName'); | 341 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$beaconName'); |
338 | 342 |
339 var _response = _requester.request(_url, | 343 var _response = _requester.request(_url, "DELETE", |
340 "DELETE", | 344 body: _body, |
341 body: _body, | 345 queryParams: _queryParams, |
342 queryParams: _queryParams, | 346 uploadOptions: _uploadOptions, |
343 uploadOptions: _uploadOptions, | 347 uploadMedia: _uploadMedia, |
344 uploadMedia: _uploadMedia, | 348 downloadOptions: _downloadOptions); |
345 downloadOptions: _downloadOptions); | |
346 return _response.then((data) => new Empty.fromJson(data)); | 349 return _response.then((data) => new Empty.fromJson(data)); |
347 } | 350 } |
348 | 351 |
349 /** | 352 /// Returns detailed information about the specified beacon. |
350 * Returns detailed information about the specified beacon. | 353 /// |
351 * | 354 /// Authenticate using an [OAuth access |
352 * Authenticate using an [OAuth access | 355 /// token](https://developers.google.com/identity/protocols/OAuth2) |
353 * token](https://developers.google.com/identity/protocols/OAuth2) | 356 /// from a signed-in user with **viewer**, **Is owner** or **Can edit** |
354 * from a signed-in user with **viewer**, **Is owner** or **Can edit** | 357 /// permissions in the Google Developers Console project. |
355 * permissions in the Google Developers Console project. | 358 /// |
356 * | 359 /// Requests may supply an Eddystone-EID beacon name in the form: |
357 * Requests may supply an Eddystone-EID beacon name in the form: | 360 /// `beacons/4!beaconId` where the `beaconId` is the base16 ephemeral ID |
358 * `beacons/4!beaconId` where the `beaconId` is the base16 ephemeral ID | 361 /// broadcast by the beacon. The returned `Beacon` object will contain the |
359 * broadcast by the beacon. The returned `Beacon` object will contain the | 362 /// beacon's stable Eddystone-UID. Clients not authorized to resolve the |
360 * beacon's stable Eddystone-UID. Clients not authorized to resolve the | 363 /// beacon's ephemeral Eddystone-EID broadcast will receive an error. |
361 * beacon's ephemeral Eddystone-EID broadcast will receive an error. | 364 /// |
362 * | 365 /// Request parameters: |
363 * Request parameters: | 366 /// |
364 * | 367 /// [beaconName] - Resource name of this beacon. A beacon name has the format |
365 * [beaconName] - Resource name of this beacon. A beacon name has the format | 368 /// "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by |
366 * "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by | 369 /// the beacon and N is a code for the beacon's type. Possible values are |
367 * the beacon and N is a code for the beacon's type. Possible values are | 370 /// `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` |
368 * `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` | 371 /// for AltBeacon. For Eddystone-EID beacons, you may use either the |
369 * for AltBeacon. For Eddystone-EID beacons, you may use either the | 372 /// current EID or the beacon's "stable" UID. |
370 * current EID or the beacon's "stable" UID. | 373 /// Required. |
371 * Required. | 374 /// Value must have pattern "^beacons/[^/]+$". |
372 * Value must have pattern "^beacons/[^/]+$". | 375 /// |
373 * | 376 /// [projectId] - The project id of the beacon to request. If the project id |
374 * [projectId] - The project id of the beacon to request. If the project id is | 377 /// is not specified |
375 * not specified | 378 /// then the project making the request is used. The project id must match |
376 * then the project making the request is used. The project id must match the | 379 /// the |
377 * project that owns the beacon. | 380 /// project that owns the beacon. |
378 * Optional. | 381 /// Optional. |
379 * | 382 /// |
380 * Completes with a [Beacon]. | 383 /// Completes with a [Beacon]. |
381 * | 384 /// |
382 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 385 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
383 * error. | 386 /// an error. |
384 * | 387 /// |
385 * If the used [http.Client] completes with an error when making a REST call, | 388 /// If the used [http.Client] completes with an error when making a REST |
386 * this method will complete with the same error. | 389 /// call, this method will complete with the same error. |
387 */ | |
388 async.Future<Beacon> get(core.String beaconName, {core.String projectId}) { | 390 async.Future<Beacon> get(core.String beaconName, {core.String projectId}) { |
389 var _url = null; | 391 var _url = null; |
390 var _queryParams = new core.Map(); | 392 var _queryParams = new core.Map(); |
391 var _uploadMedia = null; | 393 var _uploadMedia = null; |
392 var _uploadOptions = null; | 394 var _uploadOptions = null; |
393 var _downloadOptions = commons.DownloadOptions.Metadata; | 395 var _downloadOptions = commons.DownloadOptions.Metadata; |
394 var _body = null; | 396 var _body = null; |
395 | 397 |
396 if (beaconName == null) { | 398 if (beaconName == null) { |
397 throw new core.ArgumentError("Parameter beaconName is required."); | 399 throw new core.ArgumentError("Parameter beaconName is required."); |
398 } | 400 } |
399 if (projectId != null) { | 401 if (projectId != null) { |
400 _queryParams["projectId"] = [projectId]; | 402 _queryParams["projectId"] = [projectId]; |
401 } | 403 } |
402 | 404 |
403 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$beaconName'); | 405 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$beaconName'); |
404 | 406 |
405 var _response = _requester.request(_url, | 407 var _response = _requester.request(_url, "GET", |
406 "GET", | 408 body: _body, |
407 body: _body, | 409 queryParams: _queryParams, |
408 queryParams: _queryParams, | 410 uploadOptions: _uploadOptions, |
409 uploadOptions: _uploadOptions, | 411 uploadMedia: _uploadMedia, |
410 uploadMedia: _uploadMedia, | 412 downloadOptions: _downloadOptions); |
411 downloadOptions: _downloadOptions); | |
412 return _response.then((data) => new Beacon.fromJson(data)); | 413 return _response.then((data) => new Beacon.fromJson(data)); |
413 } | 414 } |
414 | 415 |
415 /** | 416 /// Searches the beacon registry for beacons that match the given search |
416 * Searches the beacon registry for beacons that match the given search | 417 /// criteria. Only those beacons that the client has permission to list |
417 * criteria. Only those beacons that the client has permission to list | 418 /// will be returned. |
418 * will be returned. | 419 /// |
419 * | 420 /// Authenticate using an [OAuth access |
420 * Authenticate using an [OAuth access | 421 /// token](https://developers.google.com/identity/protocols/OAuth2) |
421 * token](https://developers.google.com/identity/protocols/OAuth2) | 422 /// from a signed-in user with **viewer**, **Is owner** or **Can edit** |
422 * from a signed-in user with **viewer**, **Is owner** or **Can edit** | 423 /// permissions in the Google Developers Console project. |
423 * permissions in the Google Developers Console project. | 424 /// |
424 * | 425 /// Request parameters: |
425 * Request parameters: | 426 /// |
426 * | 427 /// [pageToken] - A pagination token obtained from a previous request to list |
427 * [projectId] - The project id to list beacons under. If not present then the | 428 /// beacons. |
428 * project | 429 /// |
429 * credential that made the request is used as the project. | 430 /// [pageSize] - The maximum number of records to return for this request, up |
430 * Optional. | 431 /// to a |
431 * | 432 /// server-defined upper limit. |
432 * [pageToken] - A pagination token obtained from a previous request to list | 433 /// |
433 * beacons. | 434 /// [q] - Filter query string that supports the following field filters: |
434 * | 435 /// |
435 * [pageSize] - The maximum number of records to return for this request, up | 436 /// * **description:`"<string>"`** |
436 * to a | 437 /// For example: **description:"Room 3"** |
437 * server-defined upper limit. | 438 /// Returns beacons whose description matches tokens in the string "Room 3" |
438 * | 439 /// (not necessarily that exact string). |
439 * [q] - Filter query string that supports the following field filters: | 440 /// The string must be double-quoted. |
440 * | 441 /// * **status:`<enum>`** |
441 * * **description:`"<string>"`** | 442 /// For example: **status:active** |
442 * For example: **description:"Room 3"** | 443 /// Returns beacons whose status matches the given value. Values must be |
443 * Returns beacons whose description matches tokens in the string "Room 3" | 444 /// one of the Beacon.Status enum values (case insensitive). Accepts |
444 * (not necessarily that exact string). | 445 /// multiple filters which will be combined with OR logic. |
445 * The string must be double-quoted. | 446 /// * **stability:`<enum>`** |
446 * * **status:`<enum>`** | 447 /// For example: **stability:mobile** |
447 * For example: **status:active** | 448 /// Returns beacons whose expected stability matches the given value. |
448 * Returns beacons whose status matches the given value. Values must be | 449 /// Values must be one of the Beacon.Stability enum values (case |
449 * one of the Beacon.Status enum values (case insensitive). Accepts | 450 /// insensitive). Accepts multiple filters which will be combined with |
450 * multiple filters which will be combined with OR logic. | 451 /// OR logic. |
451 * * **stability:`<enum>`** | 452 /// * **place\_id:`"<string>"`** |
452 * For example: **stability:mobile** | 453 /// For example: **place\_id:"ChIJVSZzVR8FdkgRXGmmm6SslKw="** |
453 * Returns beacons whose expected stability matches the given value. | 454 /// Returns beacons explicitly registered at the given place, expressed as |
454 * Values must be one of the Beacon.Stability enum values (case | 455 /// a Place ID obtained from [Google Places API](/places/place-id). Does not |
455 * insensitive). Accepts multiple filters which will be combined with | 456 /// match places inside the given place. Does not consider the beacon's |
456 * OR logic. | 457 /// actual location (which may be different from its registered place). |
457 * * **place\_id:`"<string>"`** | 458 /// Accepts multiple filters that will be combined with OR logic. The place |
458 * For example: **place\_id:"ChIJVSZzVR8FdkgRXGmmm6SslKw="** | 459 /// ID must be double-quoted. |
459 * Returns beacons explicitly registered at the given place, expressed as | 460 /// * **registration\_time`[<|>|<=|>=]<integer>`** |
460 * a Place ID obtained from [Google Places API](/places/place-id). Does not | 461 /// For example: **registration\_time>=1433116800** |
461 * match places inside the given place. Does not consider the beacon's | 462 /// Returns beacons whose registration time matches the given filter. |
462 * actual location (which may be different from its registered place). | 463 /// Supports the operators: <, >, <=, and >=. Timestamp must be expressed as |
463 * Accepts multiple filters that will be combined with OR logic. The place | 464 /// an integer number of seconds since midnight January 1, 1970 UTC. Accepts |
464 * ID must be double-quoted. | 465 /// at most two filters that will be combined with AND logic, to support |
465 * * **registration\_time`[<|>|<=|>=]<integer>`** | 466 /// "between" semantics. If more than two are supplied, the latter ones are |
466 * For example: **registration\_time>=1433116800** | 467 /// ignored. |
467 * Returns beacons whose registration time matches the given filter. | 468 /// * **lat:`<double> lng:<double> radius:<integer>`** |
468 * Supports the operators: <, >, <=, and >=. Timestamp must be expressed as | 469 /// For example: **lat:51.1232343 lng:-1.093852 radius:1000** |
469 * an integer number of seconds since midnight January 1, 1970 UTC. Accepts | 470 /// Returns beacons whose registered location is within the given circle. |
470 * at most two filters that will be combined with AND logic, to support | 471 /// When any of these fields are given, all are required. Latitude and |
471 * "between" semantics. If more than two are supplied, the latter ones are | 472 /// longitude must be decimal degrees between -90.0 and 90.0 and between |
472 * ignored. | 473 /// -180.0 and 180.0 respectively. Radius must be an integer number of |
473 * * **lat:`<double> lng:<double> radius:<integer>`** | 474 /// meters between 10 and 1,000,000 (1000 km). |
474 * For example: **lat:51.1232343 lng:-1.093852 radius:1000** | 475 /// * **property:`"<string>=<string>"`** |
475 * Returns beacons whose registered location is within the given circle. | 476 /// For example: **property:"battery-type=CR2032"** |
476 * When any of these fields are given, all are required. Latitude and | 477 /// Returns beacons which have a property of the given name and value. |
477 * longitude must be decimal degrees between -90.0 and 90.0 and between | 478 /// Supports multiple filters which will be combined with OR logic. |
478 * -180.0 and 180.0 respectively. Radius must be an integer number of | 479 /// The entire name=value string must be double-quoted as one string. |
479 * meters between 10 and 1,000,000 (1000 km). | 480 /// * **attachment\_type:`"<string>"`** |
480 * * **property:`"<string>=<string>"`** | 481 /// For example: **attachment_type:"my-namespace/my-type"** |
481 * For example: **property:"battery-type=CR2032"** | 482 /// Returns beacons having at least one attachment of the given namespaced |
482 * Returns beacons which have a property of the given name and value. | 483 /// type. Supports "any within this namespace" via the partial wildcard |
483 * Supports multiple filters which will be combined with OR logic. | 484 /// syntax: "my-namespace / * ". Supports multiple filters which will be |
484 * The entire name=value string must be double-quoted as one string. | 485 /// combined with OR logic. The string must be double-quoted. |
485 * * **attachment\_type:`"<string>"`** | 486 /// * **indoor\_level:`"<string>"`** |
486 * For example: **attachment_type:"my-namespace/my-type"** | 487 /// For example: **indoor\_level:"1"** |
487 * Returns beacons having at least one attachment of the given namespaced | 488 /// Returns beacons which are located on the given indoor level. Accepts |
488 * type. Supports "any within this namespace" via the partial wildcard | 489 /// multiple filters that will be combined with OR logic. |
489 * syntax: "my-namespace / * ". Supports multiple filters which will be | 490 /// |
490 * combined with OR logic. The string must be double-quoted. | 491 /// Multiple filters on the same field are combined with OR logic (except |
491 * * **indoor\_level:`"<string>"`** | 492 /// registration_time which is combined with AND logic). |
492 * For example: **indoor\_level:"1"** | 493 /// Multiple filters on different fields are combined with AND logic. |
493 * Returns beacons which are located on the given indoor level. Accepts | 494 /// Filters should be separated by spaces. |
494 * multiple filters that will be combined with OR logic. | 495 /// |
495 * | 496 /// As with any HTTP query string parameter, the whole filter expression must |
496 * Multiple filters on the same field are combined with OR logic (except | 497 /// be URL-encoded. |
497 * registration_time which is combined with AND logic). | 498 /// |
498 * Multiple filters on different fields are combined with AND logic. | 499 /// Example REST request: |
499 * Filters should be separated by spaces. | 500 /// `GET |
500 * | 501 /// /v1beta1/beacons?q=status:active%20lat:51.123%20lng:-1.095%20radius:1000` |
501 * As with any HTTP query string parameter, the whole filter expression must | 502 /// |
502 * be URL-encoded. | 503 /// [projectId] - The project id to list beacons under. If not present then |
503 * | 504 /// the project |
504 * Example REST request: | 505 /// credential that made the request is used as the project. |
505 * `GET | 506 /// Optional. |
506 * /v1beta1/beacons?q=status:active%20lat:51.123%20lng:-1.095%20radius:1000` | 507 /// |
507 * | 508 /// Completes with a [ListBeaconsResponse]. |
508 * Completes with a [ListBeaconsResponse]. | 509 /// |
509 * | 510 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
510 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 511 /// an error. |
511 * error. | 512 /// |
512 * | 513 /// If the used [http.Client] completes with an error when making a REST |
513 * If the used [http.Client] completes with an error when making a REST call, | 514 /// call, this method will complete with the same error. |
514 * this method will complete with the same error. | 515 async.Future<ListBeaconsResponse> list( |
515 */ | 516 {core.String pageToken, |
516 async.Future<ListBeaconsResponse> list({core.String projectId, core.String pag
eToken, core.int pageSize, core.String q}) { | 517 core.int pageSize, |
| 518 core.String q, |
| 519 core.String projectId}) { |
517 var _url = null; | 520 var _url = null; |
518 var _queryParams = new core.Map(); | 521 var _queryParams = new core.Map(); |
519 var _uploadMedia = null; | 522 var _uploadMedia = null; |
520 var _uploadOptions = null; | 523 var _uploadOptions = null; |
521 var _downloadOptions = commons.DownloadOptions.Metadata; | 524 var _downloadOptions = commons.DownloadOptions.Metadata; |
522 var _body = null; | 525 var _body = null; |
523 | 526 |
524 if (projectId != null) { | |
525 _queryParams["projectId"] = [projectId]; | |
526 } | |
527 if (pageToken != null) { | 527 if (pageToken != null) { |
528 _queryParams["pageToken"] = [pageToken]; | 528 _queryParams["pageToken"] = [pageToken]; |
529 } | 529 } |
530 if (pageSize != null) { | 530 if (pageSize != null) { |
531 _queryParams["pageSize"] = ["${pageSize}"]; | 531 _queryParams["pageSize"] = ["${pageSize}"]; |
532 } | 532 } |
533 if (q != null) { | 533 if (q != null) { |
534 _queryParams["q"] = [q]; | 534 _queryParams["q"] = [q]; |
535 } | 535 } |
| 536 if (projectId != null) { |
| 537 _queryParams["projectId"] = [projectId]; |
| 538 } |
536 | 539 |
537 _url = 'v1beta1/beacons'; | 540 _url = 'v1beta1/beacons'; |
538 | 541 |
539 var _response = _requester.request(_url, | 542 var _response = _requester.request(_url, "GET", |
540 "GET", | 543 body: _body, |
541 body: _body, | 544 queryParams: _queryParams, |
542 queryParams: _queryParams, | 545 uploadOptions: _uploadOptions, |
543 uploadOptions: _uploadOptions, | 546 uploadMedia: _uploadMedia, |
544 uploadMedia: _uploadMedia, | 547 downloadOptions: _downloadOptions); |
545 downloadOptions: _downloadOptions); | |
546 return _response.then((data) => new ListBeaconsResponse.fromJson(data)); | 548 return _response.then((data) => new ListBeaconsResponse.fromJson(data)); |
547 } | 549 } |
548 | 550 |
549 /** | 551 /// Registers a previously unregistered beacon given its `advertisedId`. |
550 * Registers a previously unregistered beacon given its `advertisedId`. | 552 /// These IDs are unique within the system. An ID can be registered only |
551 * These IDs are unique within the system. An ID can be registered only once. | 553 /// once. |
552 * | 554 /// |
553 * Authenticate using an [OAuth access | 555 /// Authenticate using an [OAuth access |
554 * token](https://developers.google.com/identity/protocols/OAuth2) | 556 /// token](https://developers.google.com/identity/protocols/OAuth2) |
555 * from a signed-in user with **Is owner** or **Can edit** permissions in the | 557 /// from a signed-in user with **Is owner** or **Can edit** permissions in |
556 * Google Developers Console project. | 558 /// the |
557 * | 559 /// Google Developers Console project. |
558 * [request] - The metadata request object. | 560 /// |
559 * | 561 /// [request] - The metadata request object. |
560 * Request parameters: | 562 /// |
561 * | 563 /// Request parameters: |
562 * [projectId] - The project id of the project the beacon will be registered | 564 /// |
563 * to. If | 565 /// [projectId] - The project id of the project the beacon will be registered |
564 * the project id is not specified then the project making the request | 566 /// to. If |
565 * is used. | 567 /// the project id is not specified then the project making the request |
566 * Optional. | 568 /// is used. |
567 * | 569 /// Optional. |
568 * Completes with a [Beacon]. | 570 /// |
569 * | 571 /// Completes with a [Beacon]. |
570 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 572 /// |
571 * error. | 573 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
572 * | 574 /// an error. |
573 * If the used [http.Client] completes with an error when making a REST call, | 575 /// |
574 * this method will complete with the same error. | 576 /// If the used [http.Client] completes with an error when making a REST |
575 */ | 577 /// call, this method will complete with the same error. |
576 async.Future<Beacon> register(Beacon request, {core.String projectId}) { | 578 async.Future<Beacon> register(Beacon request, {core.String projectId}) { |
577 var _url = null; | 579 var _url = null; |
578 var _queryParams = new core.Map(); | 580 var _queryParams = new core.Map(); |
579 var _uploadMedia = null; | 581 var _uploadMedia = null; |
580 var _uploadOptions = null; | 582 var _uploadOptions = null; |
581 var _downloadOptions = commons.DownloadOptions.Metadata; | 583 var _downloadOptions = commons.DownloadOptions.Metadata; |
582 var _body = null; | 584 var _body = null; |
583 | 585 |
584 if (request != null) { | 586 if (request != null) { |
585 _body = convert.JSON.encode((request).toJson()); | 587 _body = convert.JSON.encode((request).toJson()); |
586 } | 588 } |
587 if (projectId != null) { | 589 if (projectId != null) { |
588 _queryParams["projectId"] = [projectId]; | 590 _queryParams["projectId"] = [projectId]; |
589 } | 591 } |
590 | 592 |
591 _url = 'v1beta1/beacons:register'; | 593 _url = 'v1beta1/beacons:register'; |
592 | 594 |
593 var _response = _requester.request(_url, | 595 var _response = _requester.request(_url, "POST", |
594 "POST", | 596 body: _body, |
595 body: _body, | 597 queryParams: _queryParams, |
596 queryParams: _queryParams, | 598 uploadOptions: _uploadOptions, |
597 uploadOptions: _uploadOptions, | 599 uploadMedia: _uploadMedia, |
598 uploadMedia: _uploadMedia, | 600 downloadOptions: _downloadOptions); |
599 downloadOptions: _downloadOptions); | |
600 return _response.then((data) => new Beacon.fromJson(data)); | 601 return _response.then((data) => new Beacon.fromJson(data)); |
601 } | 602 } |
602 | 603 |
603 /** | 604 /// Updates the information about the specified beacon. **Any field that you |
604 * Updates the information about the specified beacon. **Any field that you do | 605 /// do |
605 * not populate in the submitted beacon will be permanently erased**, so you | 606 /// not populate in the submitted beacon will be permanently erased**, so you |
606 * should follow the "read, modify, write" pattern to avoid inadvertently | 607 /// should follow the "read, modify, write" pattern to avoid inadvertently |
607 * destroying data. | 608 /// destroying data. |
608 * | 609 /// |
609 * Changes to the beacon status via this method will be silently ignored. | 610 /// Changes to the beacon status via this method will be silently ignored. |
610 * To update beacon status, use the separate methods on this API for | 611 /// To update beacon status, use the separate methods on this API for |
611 * activation, deactivation, and decommissioning. | 612 /// activation, deactivation, and decommissioning. |
612 * Authenticate using an [OAuth access | 613 /// Authenticate using an [OAuth access |
613 * token](https://developers.google.com/identity/protocols/OAuth2) | 614 /// token](https://developers.google.com/identity/protocols/OAuth2) |
614 * from a signed-in user with **Is owner** or **Can edit** permissions in the | 615 /// from a signed-in user with **Is owner** or **Can edit** permissions in |
615 * Google Developers Console project. | 616 /// the |
616 * | 617 /// Google Developers Console project. |
617 * [request] - The metadata request object. | 618 /// |
618 * | 619 /// [request] - The metadata request object. |
619 * Request parameters: | 620 /// |
620 * | 621 /// Request parameters: |
621 * [beaconName] - Resource name of this beacon. A beacon name has the format | 622 /// |
622 * "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by | 623 /// [beaconName] - Resource name of this beacon. A beacon name has the format |
623 * the beacon and N is a code for the beacon's type. Possible values are | 624 /// "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by |
624 * `3` for Eddystone, `1` for iBeacon, or `5` for AltBeacon. | 625 /// the beacon and N is a code for the beacon's type. Possible values are |
625 * | 626 /// `3` for Eddystone, `1` for iBeacon, or `5` for AltBeacon. |
626 * This field must be left empty when registering. After reading a beacon, | 627 /// |
627 * clients can use the name for future operations. | 628 /// This field must be left empty when registering. After reading a beacon, |
628 * Value must have pattern "^beacons/[^/]+$". | 629 /// clients can use the name for future operations. |
629 * | 630 /// Value must have pattern "^beacons/[^/]+$". |
630 * [projectId] - The project id of the beacon to update. If the project id is | 631 /// |
631 * not | 632 /// [projectId] - The project id of the beacon to update. If the project id |
632 * specified then the project making the request is used. The project id | 633 /// is not |
633 * must match the project that owns the beacon. | 634 /// specified then the project making the request is used. The project id |
634 * Optional. | 635 /// must match the project that owns the beacon. |
635 * | 636 /// Optional. |
636 * Completes with a [Beacon]. | 637 /// |
637 * | 638 /// Completes with a [Beacon]. |
638 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 639 /// |
639 * error. | 640 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
640 * | 641 /// an error. |
641 * If the used [http.Client] completes with an error when making a REST call, | 642 /// |
642 * this method will complete with the same error. | 643 /// If the used [http.Client] completes with an error when making a REST |
643 */ | 644 /// call, this method will complete with the same error. |
644 async.Future<Beacon> update(Beacon request, core.String beaconName, {core.Stri
ng projectId}) { | 645 async.Future<Beacon> update(Beacon request, core.String beaconName, |
| 646 {core.String projectId}) { |
645 var _url = null; | 647 var _url = null; |
646 var _queryParams = new core.Map(); | 648 var _queryParams = new core.Map(); |
647 var _uploadMedia = null; | 649 var _uploadMedia = null; |
648 var _uploadOptions = null; | 650 var _uploadOptions = null; |
649 var _downloadOptions = commons.DownloadOptions.Metadata; | 651 var _downloadOptions = commons.DownloadOptions.Metadata; |
650 var _body = null; | 652 var _body = null; |
651 | 653 |
652 if (request != null) { | 654 if (request != null) { |
653 _body = convert.JSON.encode((request).toJson()); | 655 _body = convert.JSON.encode((request).toJson()); |
654 } | 656 } |
655 if (beaconName == null) { | 657 if (beaconName == null) { |
656 throw new core.ArgumentError("Parameter beaconName is required."); | 658 throw new core.ArgumentError("Parameter beaconName is required."); |
657 } | 659 } |
658 if (projectId != null) { | 660 if (projectId != null) { |
659 _queryParams["projectId"] = [projectId]; | 661 _queryParams["projectId"] = [projectId]; |
660 } | 662 } |
661 | 663 |
662 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$beaconName'); | 664 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$beaconName'); |
663 | 665 |
664 var _response = _requester.request(_url, | 666 var _response = _requester.request(_url, "PUT", |
665 "PUT", | 667 body: _body, |
666 body: _body, | 668 queryParams: _queryParams, |
667 queryParams: _queryParams, | 669 uploadOptions: _uploadOptions, |
668 uploadOptions: _uploadOptions, | 670 uploadMedia: _uploadMedia, |
669 uploadMedia: _uploadMedia, | 671 downloadOptions: _downloadOptions); |
670 downloadOptions: _downloadOptions); | |
671 return _response.then((data) => new Beacon.fromJson(data)); | 672 return _response.then((data) => new Beacon.fromJson(data)); |
672 } | 673 } |
673 | |
674 } | 674 } |
675 | 675 |
676 | |
677 class BeaconsAttachmentsResourceApi { | 676 class BeaconsAttachmentsResourceApi { |
678 final commons.ApiRequester _requester; | 677 final commons.ApiRequester _requester; |
679 | 678 |
680 BeaconsAttachmentsResourceApi(commons.ApiRequester client) : | 679 BeaconsAttachmentsResourceApi(commons.ApiRequester client) |
681 _requester = client; | 680 : _requester = client; |
682 | 681 |
683 /** | 682 /// Deletes multiple attachments on a given beacon. This operation is |
684 * Deletes multiple attachments on a given beacon. This operation is | 683 /// permanent and cannot be undone. |
685 * permanent and cannot be undone. | 684 /// |
686 * | 685 /// You can optionally specify `namespacedType` to choose which attachments |
687 * You can optionally specify `namespacedType` to choose which attachments | 686 /// should be deleted. If you do not specify `namespacedType`, all your |
688 * should be deleted. If you do not specify `namespacedType`, all your | 687 /// attachments on the given beacon will be deleted. You also may explicitly |
689 * attachments on the given beacon will be deleted. You also may explicitly | 688 /// specify `* / * ` to delete all. |
690 * specify `* / * ` to delete all. | 689 /// |
691 * | 690 /// Authenticate using an [OAuth access |
692 * Authenticate using an [OAuth access | 691 /// token](https://developers.google.com/identity/protocols/OAuth2) |
693 * token](https://developers.google.com/identity/protocols/OAuth2) | 692 /// from a signed-in user with **Is owner** or **Can edit** permissions in |
694 * from a signed-in user with **Is owner** or **Can edit** permissions in the | 693 /// the |
695 * Google Developers Console project. | 694 /// Google Developers Console project. |
696 * | 695 /// |
697 * Request parameters: | 696 /// Request parameters: |
698 * | 697 /// |
699 * [beaconName] - The beacon whose attachments should be deleted. A beacon | 698 /// [beaconName] - The beacon whose attachments should be deleted. A beacon |
700 * name has the | 699 /// name has the |
701 * format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast | 700 /// format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast |
702 * by the beacon and N is a code for the beacon's type. Possible values are | 701 /// by the beacon and N is a code for the beacon's type. Possible values are |
703 * `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` | 702 /// `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` |
704 * for AltBeacon. For Eddystone-EID beacons, you may use either the | 703 /// for AltBeacon. For Eddystone-EID beacons, you may use either the |
705 * current EID or the beacon's "stable" UID. | 704 /// current EID or the beacon's "stable" UID. |
706 * Required. | 705 /// Required. |
707 * Value must have pattern "^beacons/[^/]+$". | 706 /// Value must have pattern "^beacons/[^/]+$". |
708 * | 707 /// |
709 * [projectId] - The project id to delete beacon attachments under. This field | 708 /// [projectId] - The project id to delete beacon attachments under. This |
710 * can be | 709 /// field can be |
711 * used when "*" is specified to mean all attachment namespaces. Projects | 710 /// used when "*" is specified to mean all attachment namespaces. Projects |
712 * may have multiple attachments with multiple namespaces. If "*" is | 711 /// may have multiple attachments with multiple namespaces. If "*" is |
713 * specified and the projectId string is empty, then the project | 712 /// specified and the projectId string is empty, then the project |
714 * making the request is used. | 713 /// making the request is used. |
715 * Optional. | 714 /// Optional. |
716 * | 715 /// |
717 * [namespacedType] - Specifies the namespace and type of attachments to | 716 /// [namespacedType] - Specifies the namespace and type of attachments to |
718 * delete in | 717 /// delete in |
719 * `namespace/type` format. Accepts `* / * ` to specify | 718 /// `namespace/type` format. Accepts `* / * ` to specify |
720 * "all types in all namespaces". | 719 /// "all types in all namespaces". |
721 * Optional. | 720 /// Optional. |
722 * | 721 /// |
723 * Completes with a [DeleteAttachmentsResponse]. | 722 /// Completes with a [DeleteAttachmentsResponse]. |
724 * | 723 /// |
725 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 724 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
726 * error. | 725 /// an error. |
727 * | 726 /// |
728 * If the used [http.Client] completes with an error when making a REST call, | 727 /// If the used [http.Client] completes with an error when making a REST |
729 * this method will complete with the same error. | 728 /// call, this method will complete with the same error. |
730 */ | 729 async.Future<DeleteAttachmentsResponse> batchDelete(core.String beaconName, |
731 async.Future<DeleteAttachmentsResponse> batchDelete(core.String beaconName, {c
ore.String projectId, core.String namespacedType}) { | 730 {core.String projectId, core.String namespacedType}) { |
732 var _url = null; | 731 var _url = null; |
733 var _queryParams = new core.Map(); | 732 var _queryParams = new core.Map(); |
734 var _uploadMedia = null; | 733 var _uploadMedia = null; |
735 var _uploadOptions = null; | 734 var _uploadOptions = null; |
736 var _downloadOptions = commons.DownloadOptions.Metadata; | 735 var _downloadOptions = commons.DownloadOptions.Metadata; |
737 var _body = null; | 736 var _body = null; |
738 | 737 |
739 if (beaconName == null) { | 738 if (beaconName == null) { |
740 throw new core.ArgumentError("Parameter beaconName is required."); | 739 throw new core.ArgumentError("Parameter beaconName is required."); |
741 } | 740 } |
742 if (projectId != null) { | 741 if (projectId != null) { |
743 _queryParams["projectId"] = [projectId]; | 742 _queryParams["projectId"] = [projectId]; |
744 } | 743 } |
745 if (namespacedType != null) { | 744 if (namespacedType != null) { |
746 _queryParams["namespacedType"] = [namespacedType]; | 745 _queryParams["namespacedType"] = [namespacedType]; |
747 } | 746 } |
748 | 747 |
749 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$beaconName') + '
/attachments:batchDelete'; | 748 _url = 'v1beta1/' + |
| 749 commons.Escaper.ecapeVariableReserved('$beaconName') + |
| 750 '/attachments:batchDelete'; |
750 | 751 |
751 var _response = _requester.request(_url, | 752 var _response = _requester.request(_url, "POST", |
752 "POST", | 753 body: _body, |
753 body: _body, | 754 queryParams: _queryParams, |
754 queryParams: _queryParams, | 755 uploadOptions: _uploadOptions, |
755 uploadOptions: _uploadOptions, | 756 uploadMedia: _uploadMedia, |
756 uploadMedia: _uploadMedia, | 757 downloadOptions: _downloadOptions); |
757 downloadOptions: _downloadOptions); | 758 return _response |
758 return _response.then((data) => new DeleteAttachmentsResponse.fromJson(data)
); | 759 .then((data) => new DeleteAttachmentsResponse.fromJson(data)); |
759 } | 760 } |
760 | 761 |
761 /** | 762 /// Associates the given data with the specified beacon. Attachment data must |
762 * Associates the given data with the specified beacon. Attachment data must | 763 /// contain two parts: |
763 * contain two parts: | 764 /// <ul> |
764 * <ul> | 765 /// <li>A namespaced type.</li> |
765 * <li>A namespaced type.</li> | 766 /// <li>The actual attachment data itself.</li> |
766 * <li>The actual attachment data itself.</li> | 767 /// </ul> |
767 * </ul> | 768 /// The namespaced type consists of two parts, the namespace and the type. |
768 * The namespaced type consists of two parts, the namespace and the type. | 769 /// The namespace must be one of the values returned by the `namespaces` |
769 * The namespace must be one of the values returned by the `namespaces` | 770 /// endpoint, while the type can be a string of any characters except for the |
770 * endpoint, while the type can be a string of any characters except for the | 771 /// forward slash (`/`) up to 100 characters in length. |
771 * forward slash (`/`) up to 100 characters in length. | 772 /// |
772 * | 773 /// Attachment data can be up to 1024 bytes long. |
773 * Attachment data can be up to 1024 bytes long. | 774 /// |
774 * | 775 /// Authenticate using an [OAuth access |
775 * Authenticate using an [OAuth access | 776 /// token](https://developers.google.com/identity/protocols/OAuth2) |
776 * token](https://developers.google.com/identity/protocols/OAuth2) | 777 /// from a signed-in user with **Is owner** or **Can edit** permissions in |
777 * from a signed-in user with **Is owner** or **Can edit** permissions in the | 778 /// the |
778 * Google Developers Console project. | 779 /// Google Developers Console project. |
779 * | 780 /// |
780 * [request] - The metadata request object. | 781 /// [request] - The metadata request object. |
781 * | 782 /// |
782 * Request parameters: | 783 /// Request parameters: |
783 * | 784 /// |
784 * [beaconName] - Beacon on which the attachment should be created. A beacon | 785 /// [beaconName] - Beacon on which the attachment should be created. A beacon |
785 * name has the | 786 /// name has the |
786 * format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast | 787 /// format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast |
787 * by the beacon and N is a code for the beacon's type. Possible values are | 788 /// by the beacon and N is a code for the beacon's type. Possible values are |
788 * `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` | 789 /// `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` |
789 * for AltBeacon. For Eddystone-EID beacons, you may use either the | 790 /// for AltBeacon. For Eddystone-EID beacons, you may use either the |
790 * current EID or the beacon's "stable" UID. | 791 /// current EID or the beacon's "stable" UID. |
791 * Required. | 792 /// Required. |
792 * Value must have pattern "^beacons/[^/]+$". | 793 /// Value must have pattern "^beacons/[^/]+$". |
793 * | 794 /// |
794 * [projectId] - The project id of the project the attachment will belong to. | 795 /// [projectId] - The project id of the project the attachment will belong |
795 * If | 796 /// to. If |
796 * the project id is not specified then the project making the request | 797 /// the project id is not specified then the project making the request |
797 * is used. | 798 /// is used. |
798 * Optional. | 799 /// Optional. |
799 * | 800 /// |
800 * Completes with a [BeaconAttachment]. | 801 /// Completes with a [BeaconAttachment]. |
801 * | 802 /// |
802 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 803 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
803 * error. | 804 /// an error. |
804 * | 805 /// |
805 * If the used [http.Client] completes with an error when making a REST call, | 806 /// If the used [http.Client] completes with an error when making a REST |
806 * this method will complete with the same error. | 807 /// call, this method will complete with the same error. |
807 */ | 808 async.Future<BeaconAttachment> create( |
808 async.Future<BeaconAttachment> create(BeaconAttachment request, core.String be
aconName, {core.String projectId}) { | 809 BeaconAttachment request, core.String beaconName, |
| 810 {core.String projectId}) { |
809 var _url = null; | 811 var _url = null; |
810 var _queryParams = new core.Map(); | 812 var _queryParams = new core.Map(); |
811 var _uploadMedia = null; | 813 var _uploadMedia = null; |
812 var _uploadOptions = null; | 814 var _uploadOptions = null; |
813 var _downloadOptions = commons.DownloadOptions.Metadata; | 815 var _downloadOptions = commons.DownloadOptions.Metadata; |
814 var _body = null; | 816 var _body = null; |
815 | 817 |
816 if (request != null) { | 818 if (request != null) { |
817 _body = convert.JSON.encode((request).toJson()); | 819 _body = convert.JSON.encode((request).toJson()); |
818 } | 820 } |
819 if (beaconName == null) { | 821 if (beaconName == null) { |
820 throw new core.ArgumentError("Parameter beaconName is required."); | 822 throw new core.ArgumentError("Parameter beaconName is required."); |
821 } | 823 } |
822 if (projectId != null) { | 824 if (projectId != null) { |
823 _queryParams["projectId"] = [projectId]; | 825 _queryParams["projectId"] = [projectId]; |
824 } | 826 } |
825 | 827 |
826 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$beaconName') + '
/attachments'; | 828 _url = 'v1beta1/' + |
| 829 commons.Escaper.ecapeVariableReserved('$beaconName') + |
| 830 '/attachments'; |
827 | 831 |
828 var _response = _requester.request(_url, | 832 var _response = _requester.request(_url, "POST", |
829 "POST", | 833 body: _body, |
830 body: _body, | 834 queryParams: _queryParams, |
831 queryParams: _queryParams, | 835 uploadOptions: _uploadOptions, |
832 uploadOptions: _uploadOptions, | 836 uploadMedia: _uploadMedia, |
833 uploadMedia: _uploadMedia, | 837 downloadOptions: _downloadOptions); |
834 downloadOptions: _downloadOptions); | |
835 return _response.then((data) => new BeaconAttachment.fromJson(data)); | 838 return _response.then((data) => new BeaconAttachment.fromJson(data)); |
836 } | 839 } |
837 | 840 |
838 /** | 841 /// Deletes the specified attachment for the given beacon. Each attachment |
839 * Deletes the specified attachment for the given beacon. Each attachment has | 842 /// has |
840 * a unique attachment name (`attachmentName`) which is returned when you | 843 /// a unique attachment name (`attachmentName`) which is returned when you |
841 * fetch the attachment data via this API. You specify this with the delete | 844 /// fetch the attachment data via this API. You specify this with the delete |
842 * request to control which attachment is removed. This operation cannot be | 845 /// request to control which attachment is removed. This operation cannot be |
843 * undone. | 846 /// undone. |
844 * | 847 /// |
845 * Authenticate using an [OAuth access | 848 /// Authenticate using an [OAuth access |
846 * token](https://developers.google.com/identity/protocols/OAuth2) | 849 /// token](https://developers.google.com/identity/protocols/OAuth2) |
847 * from a signed-in user with **Is owner** or **Can edit** permissions in the | 850 /// from a signed-in user with **Is owner** or **Can edit** permissions in |
848 * Google Developers Console project. | 851 /// the |
849 * | 852 /// Google Developers Console project. |
850 * Request parameters: | 853 /// |
851 * | 854 /// Request parameters: |
852 * [attachmentName] - The attachment name (`attachmentName`) of | 855 /// |
853 * the attachment to remove. For example: | 856 /// [attachmentName] - The attachment name (`attachmentName`) of |
854 * `beacons/3!893737abc9/attachments/c5e937-af0-494-959-ec49d12738`. For | 857 /// the attachment to remove. For example: |
855 * Eddystone-EID beacons, the beacon ID portion (`3!893737abc9`) may be the | 858 /// `beacons/3!893737abc9/attachments/c5e937-af0-494-959-ec49d12738`. For |
856 * beacon's current EID, or its "stable" Eddystone-UID. | 859 /// Eddystone-EID beacons, the beacon ID portion (`3!893737abc9`) may be the |
857 * Required. | 860 /// beacon's current EID, or its "stable" Eddystone-UID. |
858 * Value must have pattern "^beacons/[^/]+/attachments/[^/]+$". | 861 /// Required. |
859 * | 862 /// Value must have pattern "^beacons/[^/]+/attachments/[^/]+$". |
860 * [projectId] - The project id of the attachment to delete. If not provided, | 863 /// |
861 * the project | 864 /// [projectId] - The project id of the attachment to delete. If not |
862 * that is making the request is used. | 865 /// provided, the project |
863 * Optional. | 866 /// that is making the request is used. |
864 * | 867 /// Optional. |
865 * Completes with a [Empty]. | 868 /// |
866 * | 869 /// Completes with a [Empty]. |
867 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 870 /// |
868 * error. | 871 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
869 * | 872 /// an error. |
870 * If the used [http.Client] completes with an error when making a REST call, | 873 /// |
871 * this method will complete with the same error. | 874 /// If the used [http.Client] completes with an error when making a REST |
872 */ | 875 /// call, this method will complete with the same error. |
873 async.Future<Empty> delete(core.String attachmentName, {core.String projectId}
) { | 876 async.Future<Empty> delete(core.String attachmentName, |
| 877 {core.String projectId}) { |
874 var _url = null; | 878 var _url = null; |
875 var _queryParams = new core.Map(); | 879 var _queryParams = new core.Map(); |
876 var _uploadMedia = null; | 880 var _uploadMedia = null; |
877 var _uploadOptions = null; | 881 var _uploadOptions = null; |
878 var _downloadOptions = commons.DownloadOptions.Metadata; | 882 var _downloadOptions = commons.DownloadOptions.Metadata; |
879 var _body = null; | 883 var _body = null; |
880 | 884 |
881 if (attachmentName == null) { | 885 if (attachmentName == null) { |
882 throw new core.ArgumentError("Parameter attachmentName is required."); | 886 throw new core.ArgumentError("Parameter attachmentName is required."); |
883 } | 887 } |
884 if (projectId != null) { | 888 if (projectId != null) { |
885 _queryParams["projectId"] = [projectId]; | 889 _queryParams["projectId"] = [projectId]; |
886 } | 890 } |
887 | 891 |
888 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$attachmentName')
; | 892 _url = |
| 893 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$attachmentName'); |
889 | 894 |
890 var _response = _requester.request(_url, | 895 var _response = _requester.request(_url, "DELETE", |
891 "DELETE", | 896 body: _body, |
892 body: _body, | 897 queryParams: _queryParams, |
893 queryParams: _queryParams, | 898 uploadOptions: _uploadOptions, |
894 uploadOptions: _uploadOptions, | 899 uploadMedia: _uploadMedia, |
895 uploadMedia: _uploadMedia, | 900 downloadOptions: _downloadOptions); |
896 downloadOptions: _downloadOptions); | |
897 return _response.then((data) => new Empty.fromJson(data)); | 901 return _response.then((data) => new Empty.fromJson(data)); |
898 } | 902 } |
899 | 903 |
900 /** | 904 /// Returns the attachments for the specified beacon that match the specified |
901 * Returns the attachments for the specified beacon that match the specified | 905 /// namespaced-type pattern. |
902 * namespaced-type pattern. | 906 /// |
903 * | 907 /// To control which namespaced types are returned, you add the |
904 * To control which namespaced types are returned, you add the | 908 /// `namespacedType` query parameter to the request. You must either use |
905 * `namespacedType` query parameter to the request. You must either use | 909 /// `* / * `, to return all attachments, or the namespace must be one of |
906 * `* / * `, to return all attachments, or the namespace must be one of | 910 /// the ones returned from the `namespaces` endpoint. |
907 * the ones returned from the `namespaces` endpoint. | 911 /// |
908 * | 912 /// Authenticate using an [OAuth access |
909 * Authenticate using an [OAuth access | 913 /// token](https://developers.google.com/identity/protocols/OAuth2) |
910 * token](https://developers.google.com/identity/protocols/OAuth2) | 914 /// from a signed-in user with **viewer**, **Is owner** or **Can edit** |
911 * from a signed-in user with **viewer**, **Is owner** or **Can edit** | 915 /// permissions in the Google Developers Console project. |
912 * permissions in the Google Developers Console project. | 916 /// |
913 * | 917 /// Request parameters: |
914 * Request parameters: | 918 /// |
915 * | 919 /// [beaconName] - Beacon whose attachments should be fetched. A beacon name |
916 * [beaconName] - Beacon whose attachments should be fetched. A beacon name | 920 /// has the |
917 * has the | 921 /// format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast |
918 * format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast | 922 /// by the beacon and N is a code for the beacon's type. Possible values are |
919 * by the beacon and N is a code for the beacon's type. Possible values are | 923 /// `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` |
920 * `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` | 924 /// for AltBeacon. For Eddystone-EID beacons, you may use either the |
921 * for AltBeacon. For Eddystone-EID beacons, you may use either the | 925 /// current EID or the beacon's "stable" UID. |
922 * current EID or the beacon's "stable" UID. | 926 /// Required. |
923 * Required. | 927 /// Value must have pattern "^beacons/[^/]+$". |
924 * Value must have pattern "^beacons/[^/]+$". | 928 /// |
925 * | 929 /// [namespacedType] - Specifies the namespace and type of attachment to |
926 * [projectId] - The project id to list beacon attachments under. This field | 930 /// include in response in |
927 * can be | 931 /// <var>namespace/type</var> format. Accepts `* / * ` to specify |
928 * used when "*" is specified to mean all attachment namespaces. Projects | 932 /// "all types in all namespaces". |
929 * may have multiple attachments with multiple namespaces. If "*" is | 933 /// |
930 * specified and the projectId string is empty, then the project | 934 /// [projectId] - The project id to list beacon attachments under. This field |
931 * making the request is used. | 935 /// can be |
932 * Optional. | 936 /// used when "*" is specified to mean all attachment namespaces. Projects |
933 * | 937 /// may have multiple attachments with multiple namespaces. If "*" is |
934 * [namespacedType] - Specifies the namespace and type of attachment to | 938 /// specified and the projectId string is empty, then the project |
935 * include in response in | 939 /// making the request is used. |
936 * <var>namespace/type</var> format. Accepts `* / * ` to specify | 940 /// Optional. |
937 * "all types in all namespaces". | 941 /// |
938 * | 942 /// Completes with a [ListBeaconAttachmentsResponse]. |
939 * Completes with a [ListBeaconAttachmentsResponse]. | 943 /// |
940 * | 944 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
941 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 945 /// an error. |
942 * error. | 946 /// |
943 * | 947 /// If the used [http.Client] completes with an error when making a REST |
944 * If the used [http.Client] completes with an error when making a REST call, | 948 /// call, this method will complete with the same error. |
945 * this method will complete with the same error. | 949 async.Future<ListBeaconAttachmentsResponse> list(core.String beaconName, |
946 */ | 950 {core.String namespacedType, core.String projectId}) { |
947 async.Future<ListBeaconAttachmentsResponse> list(core.String beaconName, {core
.String projectId, core.String namespacedType}) { | |
948 var _url = null; | 951 var _url = null; |
949 var _queryParams = new core.Map(); | 952 var _queryParams = new core.Map(); |
950 var _uploadMedia = null; | 953 var _uploadMedia = null; |
951 var _uploadOptions = null; | 954 var _uploadOptions = null; |
952 var _downloadOptions = commons.DownloadOptions.Metadata; | 955 var _downloadOptions = commons.DownloadOptions.Metadata; |
953 var _body = null; | 956 var _body = null; |
954 | 957 |
955 if (beaconName == null) { | 958 if (beaconName == null) { |
956 throw new core.ArgumentError("Parameter beaconName is required."); | 959 throw new core.ArgumentError("Parameter beaconName is required."); |
957 } | 960 } |
| 961 if (namespacedType != null) { |
| 962 _queryParams["namespacedType"] = [namespacedType]; |
| 963 } |
958 if (projectId != null) { | 964 if (projectId != null) { |
959 _queryParams["projectId"] = [projectId]; | 965 _queryParams["projectId"] = [projectId]; |
960 } | 966 } |
961 if (namespacedType != null) { | |
962 _queryParams["namespacedType"] = [namespacedType]; | |
963 } | |
964 | 967 |
965 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$beaconName') + '
/attachments'; | 968 _url = 'v1beta1/' + |
| 969 commons.Escaper.ecapeVariableReserved('$beaconName') + |
| 970 '/attachments'; |
966 | 971 |
967 var _response = _requester.request(_url, | 972 var _response = _requester.request(_url, "GET", |
968 "GET", | 973 body: _body, |
969 body: _body, | 974 queryParams: _queryParams, |
970 queryParams: _queryParams, | 975 uploadOptions: _uploadOptions, |
971 uploadOptions: _uploadOptions, | 976 uploadMedia: _uploadMedia, |
972 uploadMedia: _uploadMedia, | 977 downloadOptions: _downloadOptions); |
973 downloadOptions: _downloadOptions); | 978 return _response |
974 return _response.then((data) => new ListBeaconAttachmentsResponse.fromJson(d
ata)); | 979 .then((data) => new ListBeaconAttachmentsResponse.fromJson(data)); |
975 } | 980 } |
976 | |
977 } | 981 } |
978 | 982 |
979 | |
980 class BeaconsDiagnosticsResourceApi { | 983 class BeaconsDiagnosticsResourceApi { |
981 final commons.ApiRequester _requester; | 984 final commons.ApiRequester _requester; |
982 | 985 |
983 BeaconsDiagnosticsResourceApi(commons.ApiRequester client) : | 986 BeaconsDiagnosticsResourceApi(commons.ApiRequester client) |
984 _requester = client; | 987 : _requester = client; |
985 | 988 |
986 /** | 989 /// List the diagnostics for a single beacon. You can also list diagnostics |
987 * List the diagnostics for a single beacon. You can also list diagnostics for | 990 /// for |
988 * all the beacons owned by your Google Developers Console project by using | 991 /// all the beacons owned by your Google Developers Console project by using |
989 * the beacon name `beacons/-`. | 992 /// the beacon name `beacons/-`. |
990 * | 993 /// |
991 * Authenticate using an [OAuth access | 994 /// Authenticate using an [OAuth access |
992 * token](https://developers.google.com/identity/protocols/OAuth2) | 995 /// token](https://developers.google.com/identity/protocols/OAuth2) |
993 * from a signed-in user with **viewer**, **Is owner** or **Can edit** | 996 /// from a signed-in user with **viewer**, **Is owner** or **Can edit** |
994 * permissions in the Google Developers Console project. | 997 /// permissions in the Google Developers Console project. |
995 * | 998 /// |
996 * Request parameters: | 999 /// Request parameters: |
997 * | 1000 /// |
998 * [beaconName] - Beacon that the diagnostics are for. | 1001 /// [beaconName] - Beacon that the diagnostics are for. |
999 * Value must have pattern "^beacons/[^/]+$". | 1002 /// Value must have pattern "^beacons/[^/]+$". |
1000 * | 1003 /// |
1001 * [alertFilter] - Requests only beacons that have the given alert. For | 1004 /// [pageToken] - Requests results that occur after the `page_token`, |
1002 * example, to find | 1005 /// obtained from the |
1003 * beacons that have low batteries use `alert_filter=LOW_BATTERY`. | 1006 /// response to a previous request. Optional. |
1004 * Possible string values are: | 1007 /// |
1005 * - "ALERT_UNSPECIFIED" : A ALERT_UNSPECIFIED. | 1008 /// [alertFilter] - Requests only beacons that have the given alert. For |
1006 * - "WRONG_LOCATION" : A WRONG_LOCATION. | 1009 /// example, to find |
1007 * - "LOW_BATTERY" : A LOW_BATTERY. | 1010 /// beacons that have low batteries use `alert_filter=LOW_BATTERY`. |
1008 * | 1011 /// Possible string values are: |
1009 * [pageSize] - Specifies the maximum number of results to return. Defaults to | 1012 /// - "ALERT_UNSPECIFIED" : A ALERT_UNSPECIFIED. |
1010 * 10. Maximum 1000. Optional. | 1013 /// - "WRONG_LOCATION" : A WRONG_LOCATION. |
1011 * | 1014 /// - "LOW_BATTERY" : A LOW_BATTERY. |
1012 * [projectId] - Requests only diagnostic records for the given project id. If | 1015 /// |
1013 * not set, | 1016 /// [pageSize] - Specifies the maximum number of results to return. Defaults |
1014 * then the project making the request will be used for looking up | 1017 /// to |
1015 * diagnostic records. Optional. | 1018 /// 10. Maximum 1000. Optional. |
1016 * | 1019 /// |
1017 * [pageToken] - Requests results that occur after the `page_token`, obtained | 1020 /// [projectId] - Requests only diagnostic records for the given project id. |
1018 * from the | 1021 /// If not set, |
1019 * response to a previous request. Optional. | 1022 /// then the project making the request will be used for looking up |
1020 * | 1023 /// diagnostic records. Optional. |
1021 * Completes with a [ListDiagnosticsResponse]. | 1024 /// |
1022 * | 1025 /// Completes with a [ListDiagnosticsResponse]. |
1023 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1026 /// |
1024 * error. | 1027 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
1025 * | 1028 /// an error. |
1026 * If the used [http.Client] completes with an error when making a REST call, | 1029 /// |
1027 * this method will complete with the same error. | 1030 /// If the used [http.Client] completes with an error when making a REST |
1028 */ | 1031 /// call, this method will complete with the same error. |
1029 async.Future<ListDiagnosticsResponse> list(core.String beaconName, {core.Strin
g alertFilter, core.int pageSize, core.String projectId, core.String pageToken})
{ | 1032 async.Future<ListDiagnosticsResponse> list(core.String beaconName, |
| 1033 {core.String pageToken, |
| 1034 core.String alertFilter, |
| 1035 core.int pageSize, |
| 1036 core.String projectId}) { |
1030 var _url = null; | 1037 var _url = null; |
1031 var _queryParams = new core.Map(); | 1038 var _queryParams = new core.Map(); |
1032 var _uploadMedia = null; | 1039 var _uploadMedia = null; |
1033 var _uploadOptions = null; | 1040 var _uploadOptions = null; |
1034 var _downloadOptions = commons.DownloadOptions.Metadata; | 1041 var _downloadOptions = commons.DownloadOptions.Metadata; |
1035 var _body = null; | 1042 var _body = null; |
1036 | 1043 |
1037 if (beaconName == null) { | 1044 if (beaconName == null) { |
1038 throw new core.ArgumentError("Parameter beaconName is required."); | 1045 throw new core.ArgumentError("Parameter beaconName is required."); |
1039 } | 1046 } |
| 1047 if (pageToken != null) { |
| 1048 _queryParams["pageToken"] = [pageToken]; |
| 1049 } |
1040 if (alertFilter != null) { | 1050 if (alertFilter != null) { |
1041 _queryParams["alertFilter"] = [alertFilter]; | 1051 _queryParams["alertFilter"] = [alertFilter]; |
1042 } | 1052 } |
1043 if (pageSize != null) { | 1053 if (pageSize != null) { |
1044 _queryParams["pageSize"] = ["${pageSize}"]; | 1054 _queryParams["pageSize"] = ["${pageSize}"]; |
1045 } | 1055 } |
1046 if (projectId != null) { | 1056 if (projectId != null) { |
1047 _queryParams["projectId"] = [projectId]; | 1057 _queryParams["projectId"] = [projectId]; |
1048 } | 1058 } |
1049 if (pageToken != null) { | |
1050 _queryParams["pageToken"] = [pageToken]; | |
1051 } | |
1052 | 1059 |
1053 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$beaconName') + '
/diagnostics'; | 1060 _url = 'v1beta1/' + |
| 1061 commons.Escaper.ecapeVariableReserved('$beaconName') + |
| 1062 '/diagnostics'; |
1054 | 1063 |
1055 var _response = _requester.request(_url, | 1064 var _response = _requester.request(_url, "GET", |
1056 "GET", | 1065 body: _body, |
1057 body: _body, | 1066 queryParams: _queryParams, |
1058 queryParams: _queryParams, | 1067 uploadOptions: _uploadOptions, |
1059 uploadOptions: _uploadOptions, | 1068 uploadMedia: _uploadMedia, |
1060 uploadMedia: _uploadMedia, | 1069 downloadOptions: _downloadOptions); |
1061 downloadOptions: _downloadOptions); | |
1062 return _response.then((data) => new ListDiagnosticsResponse.fromJson(data)); | 1070 return _response.then((data) => new ListDiagnosticsResponse.fromJson(data)); |
1063 } | 1071 } |
1064 | |
1065 } | 1072 } |
1066 | 1073 |
1067 | |
1068 class NamespacesResourceApi { | 1074 class NamespacesResourceApi { |
1069 final commons.ApiRequester _requester; | 1075 final commons.ApiRequester _requester; |
1070 | 1076 |
1071 NamespacesResourceApi(commons.ApiRequester client) : | 1077 NamespacesResourceApi(commons.ApiRequester client) : _requester = client; |
1072 _requester = client; | |
1073 | 1078 |
1074 /** | 1079 /// Lists all attachment namespaces owned by your Google Developers Console |
1075 * Lists all attachment namespaces owned by your Google Developers Console | 1080 /// project. Attachment data associated with a beacon must include a |
1076 * project. Attachment data associated with a beacon must include a | 1081 /// namespaced type, and the namespace must be owned by your project. |
1077 * namespaced type, and the namespace must be owned by your project. | 1082 /// |
1078 * | 1083 /// Authenticate using an [OAuth access |
1079 * Authenticate using an [OAuth access | 1084 /// token](https://developers.google.com/identity/protocols/OAuth2) |
1080 * token](https://developers.google.com/identity/protocols/OAuth2) | 1085 /// from a signed-in user with **viewer**, **Is owner** or **Can edit** |
1081 * from a signed-in user with **viewer**, **Is owner** or **Can edit** | 1086 /// permissions in the Google Developers Console project. |
1082 * permissions in the Google Developers Console project. | 1087 /// |
1083 * | 1088 /// Request parameters: |
1084 * Request parameters: | 1089 /// |
1085 * | 1090 /// [projectId] - The project id to list namespaces under. |
1086 * [projectId] - The project id to list namespaces under. | 1091 /// Optional. |
1087 * Optional. | 1092 /// |
1088 * | 1093 /// Completes with a [ListNamespacesResponse]. |
1089 * Completes with a [ListNamespacesResponse]. | 1094 /// |
1090 * | 1095 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
1091 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1096 /// an error. |
1092 * error. | 1097 /// |
1093 * | 1098 /// If the used [http.Client] completes with an error when making a REST |
1094 * If the used [http.Client] completes with an error when making a REST call, | 1099 /// call, this method will complete with the same error. |
1095 * this method will complete with the same error. | |
1096 */ | |
1097 async.Future<ListNamespacesResponse> list({core.String projectId}) { | 1100 async.Future<ListNamespacesResponse> list({core.String projectId}) { |
1098 var _url = null; | 1101 var _url = null; |
1099 var _queryParams = new core.Map(); | 1102 var _queryParams = new core.Map(); |
1100 var _uploadMedia = null; | 1103 var _uploadMedia = null; |
1101 var _uploadOptions = null; | 1104 var _uploadOptions = null; |
1102 var _downloadOptions = commons.DownloadOptions.Metadata; | 1105 var _downloadOptions = commons.DownloadOptions.Metadata; |
1103 var _body = null; | 1106 var _body = null; |
1104 | 1107 |
1105 if (projectId != null) { | 1108 if (projectId != null) { |
1106 _queryParams["projectId"] = [projectId]; | 1109 _queryParams["projectId"] = [projectId]; |
1107 } | 1110 } |
1108 | 1111 |
1109 _url = 'v1beta1/namespaces'; | 1112 _url = 'v1beta1/namespaces'; |
1110 | 1113 |
1111 var _response = _requester.request(_url, | 1114 var _response = _requester.request(_url, "GET", |
1112 "GET", | 1115 body: _body, |
1113 body: _body, | 1116 queryParams: _queryParams, |
1114 queryParams: _queryParams, | 1117 uploadOptions: _uploadOptions, |
1115 uploadOptions: _uploadOptions, | 1118 uploadMedia: _uploadMedia, |
1116 uploadMedia: _uploadMedia, | 1119 downloadOptions: _downloadOptions); |
1117 downloadOptions: _downloadOptions); | |
1118 return _response.then((data) => new ListNamespacesResponse.fromJson(data)); | 1120 return _response.then((data) => new ListNamespacesResponse.fromJson(data)); |
1119 } | 1121 } |
1120 | 1122 |
1121 /** | 1123 /// Updates the information about the specified namespace. Only the namespace |
1122 * Updates the information about the specified namespace. Only the namespace | 1124 /// visibility can be updated. |
1123 * visibility can be updated. | 1125 /// |
1124 * | 1126 /// [request] - The metadata request object. |
1125 * [request] - The metadata request object. | 1127 /// |
1126 * | 1128 /// Request parameters: |
1127 * Request parameters: | 1129 /// |
1128 * | 1130 /// [namespaceName] - Resource name of this namespace. Namespaces names have |
1129 * [namespaceName] - Resource name of this namespace. Namespaces names have | 1131 /// the format: |
1130 * the format: | 1132 /// <code>namespaces/<var>namespace</var></code>. |
1131 * <code>namespaces/<var>namespace</var></code>. | 1133 /// Value must have pattern "^namespaces/[^/]+$". |
1132 * Value must have pattern "^namespaces/[^/]+$". | 1134 /// |
1133 * | 1135 /// [projectId] - The project id of the namespace to update. If the project |
1134 * [projectId] - The project id of the namespace to update. If the project id | 1136 /// id is not |
1135 * is not | 1137 /// specified then the project making the request is used. The project id |
1136 * specified then the project making the request is used. The project id | 1138 /// must match the project that owns the beacon. |
1137 * must match the project that owns the beacon. | 1139 /// Optional. |
1138 * Optional. | 1140 /// |
1139 * | 1141 /// Completes with a [Namespace]. |
1140 * Completes with a [Namespace]. | 1142 /// |
1141 * | 1143 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
1142 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1144 /// an error. |
1143 * error. | 1145 /// |
1144 * | 1146 /// If the used [http.Client] completes with an error when making a REST |
1145 * If the used [http.Client] completes with an error when making a REST call, | 1147 /// call, this method will complete with the same error. |
1146 * this method will complete with the same error. | 1148 async.Future<Namespace> update(Namespace request, core.String namespaceName, |
1147 */ | 1149 {core.String projectId}) { |
1148 async.Future<Namespace> update(Namespace request, core.String namespaceName, {
core.String projectId}) { | |
1149 var _url = null; | 1150 var _url = null; |
1150 var _queryParams = new core.Map(); | 1151 var _queryParams = new core.Map(); |
1151 var _uploadMedia = null; | 1152 var _uploadMedia = null; |
1152 var _uploadOptions = null; | 1153 var _uploadOptions = null; |
1153 var _downloadOptions = commons.DownloadOptions.Metadata; | 1154 var _downloadOptions = commons.DownloadOptions.Metadata; |
1154 var _body = null; | 1155 var _body = null; |
1155 | 1156 |
1156 if (request != null) { | 1157 if (request != null) { |
1157 _body = convert.JSON.encode((request).toJson()); | 1158 _body = convert.JSON.encode((request).toJson()); |
1158 } | 1159 } |
1159 if (namespaceName == null) { | 1160 if (namespaceName == null) { |
1160 throw new core.ArgumentError("Parameter namespaceName is required."); | 1161 throw new core.ArgumentError("Parameter namespaceName is required."); |
1161 } | 1162 } |
1162 if (projectId != null) { | 1163 if (projectId != null) { |
1163 _queryParams["projectId"] = [projectId]; | 1164 _queryParams["projectId"] = [projectId]; |
1164 } | 1165 } |
1165 | 1166 |
1166 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$namespaceName'); | 1167 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$namespaceName'); |
1167 | 1168 |
1168 var _response = _requester.request(_url, | 1169 var _response = _requester.request(_url, "PUT", |
1169 "PUT", | 1170 body: _body, |
1170 body: _body, | 1171 queryParams: _queryParams, |
1171 queryParams: _queryParams, | 1172 uploadOptions: _uploadOptions, |
1172 uploadOptions: _uploadOptions, | 1173 uploadMedia: _uploadMedia, |
1173 uploadMedia: _uploadMedia, | 1174 downloadOptions: _downloadOptions); |
1174 downloadOptions: _downloadOptions); | |
1175 return _response.then((data) => new Namespace.fromJson(data)); | 1175 return _response.then((data) => new Namespace.fromJson(data)); |
1176 } | 1176 } |
1177 | |
1178 } | 1177 } |
1179 | 1178 |
1180 | |
1181 class V1beta1ResourceApi { | 1179 class V1beta1ResourceApi { |
1182 final commons.ApiRequester _requester; | 1180 final commons.ApiRequester _requester; |
1183 | 1181 |
1184 V1beta1ResourceApi(commons.ApiRequester client) : | 1182 V1beta1ResourceApi(commons.ApiRequester client) : _requester = client; |
1185 _requester = client; | |
1186 | 1183 |
1187 /** | 1184 /// Gets the Proximity Beacon API's current public key and associated |
1188 * Gets the Proximity Beacon API's current public key and associated | 1185 /// parameters used to initiate the Diffie-Hellman key exchange required to |
1189 * parameters used to initiate the Diffie-Hellman key exchange required to | 1186 /// register a beacon that broadcasts the Eddystone-EID format. This key |
1190 * register a beacon that broadcasts the Eddystone-EID format. This key | 1187 /// changes periodically; clients may cache it and re-use the same public key |
1191 * changes periodically; clients may cache it and re-use the same public key | 1188 /// to provision and register multiple beacons. However, clients should be |
1192 * to provision and register multiple beacons. However, clients should be | 1189 /// prepared to refresh this key when they encounter an error registering an |
1193 * prepared to refresh this key when they encounter an error registering an | 1190 /// Eddystone-EID beacon. |
1194 * Eddystone-EID beacon. | 1191 /// |
1195 * | 1192 /// Request parameters: |
1196 * Request parameters: | 1193 /// |
1197 * | 1194 /// Completes with a [EphemeralIdRegistrationParams]. |
1198 * Completes with a [EphemeralIdRegistrationParams]. | 1195 /// |
1199 * | 1196 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
1200 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1197 /// an error. |
1201 * error. | 1198 /// |
1202 * | 1199 /// If the used [http.Client] completes with an error when making a REST |
1203 * If the used [http.Client] completes with an error when making a REST call, | 1200 /// call, this method will complete with the same error. |
1204 * this method will complete with the same error. | |
1205 */ | |
1206 async.Future<EphemeralIdRegistrationParams> getEidparams() { | 1201 async.Future<EphemeralIdRegistrationParams> getEidparams() { |
1207 var _url = null; | 1202 var _url = null; |
1208 var _queryParams = new core.Map(); | 1203 var _queryParams = new core.Map(); |
1209 var _uploadMedia = null; | 1204 var _uploadMedia = null; |
1210 var _uploadOptions = null; | 1205 var _uploadOptions = null; |
1211 var _downloadOptions = commons.DownloadOptions.Metadata; | 1206 var _downloadOptions = commons.DownloadOptions.Metadata; |
1212 var _body = null; | 1207 var _body = null; |
1213 | 1208 |
1214 | |
1215 _url = 'v1beta1/eidparams'; | 1209 _url = 'v1beta1/eidparams'; |
1216 | 1210 |
1217 var _response = _requester.request(_url, | 1211 var _response = _requester.request(_url, "GET", |
1218 "GET", | 1212 body: _body, |
1219 body: _body, | 1213 queryParams: _queryParams, |
1220 queryParams: _queryParams, | 1214 uploadOptions: _uploadOptions, |
1221 uploadOptions: _uploadOptions, | 1215 uploadMedia: _uploadMedia, |
1222 uploadMedia: _uploadMedia, | 1216 downloadOptions: _downloadOptions); |
1223 downloadOptions: _downloadOptions); | 1217 return _response |
1224 return _response.then((data) => new EphemeralIdRegistrationParams.fromJson(d
ata)); | 1218 .then((data) => new EphemeralIdRegistrationParams.fromJson(data)); |
1225 } | 1219 } |
1226 | |
1227 } | 1220 } |
1228 | 1221 |
1229 | 1222 /// Defines a unique identifier of a beacon as broadcast by the device. |
1230 | |
1231 /** Defines a unique identifier of a beacon as broadcast by the device. */ | |
1232 class AdvertisedId { | 1223 class AdvertisedId { |
1233 /** | 1224 /// The actual beacon identifier, as broadcast by the beacon hardware. Must |
1234 * The actual beacon identifier, as broadcast by the beacon hardware. Must be | 1225 /// be |
1235 * [base64](http://tools.ietf.org/html/rfc4648#section-4) encoded in HTTP | 1226 /// [base64](http://tools.ietf.org/html/rfc4648#section-4) encoded in HTTP |
1236 * requests, and will be so encoded (with padding) in responses. The base64 | 1227 /// requests, and will be so encoded (with padding) in responses. The base64 |
1237 * encoding should be of the binary byte-stream and not any textual (such as | 1228 /// encoding should be of the binary byte-stream and not any textual (such as |
1238 * hex) representation thereof. | 1229 /// hex) representation thereof. |
1239 * Required. | 1230 /// Required. |
1240 */ | |
1241 core.String id; | 1231 core.String id; |
1242 core.List<core.int> get idAsBytes { | 1232 core.List<core.int> get idAsBytes { |
1243 return convert.BASE64.decode(id); | 1233 return convert.BASE64.decode(id); |
1244 } | 1234 } |
1245 | 1235 |
1246 void set idAsBytes(core.List<core.int> _bytes) { | 1236 void set idAsBytes(core.List<core.int> _bytes) { |
1247 id = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-")
; | 1237 id = |
| 1238 convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-"); |
1248 } | 1239 } |
1249 /** | 1240 |
1250 * Specifies the identifier type. | 1241 /// Specifies the identifier type. |
1251 * Required. | 1242 /// Required. |
1252 * Possible string values are: | 1243 /// Possible string values are: |
1253 * - "TYPE_UNSPECIFIED" : Do not use this value. | 1244 /// - "TYPE_UNSPECIFIED" : Do not use this value. |
1254 * - "EDDYSTONE" : Eddystone, an open beacon format that supports Android and | 1245 /// - "EDDYSTONE" : Eddystone, an open beacon format that supports Android |
1255 * iOS devices | 1246 /// and iOS devices |
1256 * https://github.com/google/eddystone/wiki/Beacon-Specification | 1247 /// https://github.com/google/eddystone/wiki/Beacon-Specification |
1257 * - "IBEACON" : Apple iBeacon compatible beacon | 1248 /// - "IBEACON" : Apple iBeacon compatible beacon |
1258 * - "ALTBEACON" : See http://altbeacon.org and/or | 1249 /// - "ALTBEACON" : See http://altbeacon.org and/or |
1259 * https://github.com/AltBeacon/spec. | 1250 /// https://github.com/AltBeacon/spec. |
1260 * - "EDDYSTONE_EID" : Eddystone Ephemeral ID | 1251 /// - "EDDYSTONE_EID" : Eddystone Ephemeral ID |
1261 */ | |
1262 core.String type; | 1252 core.String type; |
1263 | 1253 |
1264 AdvertisedId(); | 1254 AdvertisedId(); |
1265 | 1255 |
1266 AdvertisedId.fromJson(core.Map _json) { | 1256 AdvertisedId.fromJson(core.Map _json) { |
1267 if (_json.containsKey("id")) { | 1257 if (_json.containsKey("id")) { |
1268 id = _json["id"]; | 1258 id = _json["id"]; |
1269 } | 1259 } |
1270 if (_json.containsKey("type")) { | 1260 if (_json.containsKey("type")) { |
1271 type = _json["type"]; | 1261 type = _json["type"]; |
1272 } | 1262 } |
1273 } | 1263 } |
1274 | 1264 |
1275 core.Map<core.String, core.Object> toJson() { | 1265 core.Map<core.String, core.Object> toJson() { |
1276 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1266 final core.Map<core.String, core.Object> _json = |
| 1267 new core.Map<core.String, core.Object>(); |
1277 if (id != null) { | 1268 if (id != null) { |
1278 _json["id"] = id; | 1269 _json["id"] = id; |
1279 } | 1270 } |
1280 if (type != null) { | 1271 if (type != null) { |
1281 _json["type"] = type; | 1272 _json["type"] = type; |
1282 } | 1273 } |
1283 return _json; | 1274 return _json; |
1284 } | 1275 } |
1285 } | 1276 } |
1286 | 1277 |
1287 /** | 1278 /// A subset of attachment information served via the |
1288 * A subset of attachment information served via the | 1279 /// `beaconinfo.getforobserved` method, used when your users encounter your |
1289 * `beaconinfo.getforobserved` method, used when your users encounter your | 1280 /// beacons. |
1290 * beacons. | |
1291 */ | |
1292 class AttachmentInfo { | 1281 class AttachmentInfo { |
1293 /** An opaque data container for client-provided data. */ | 1282 /// An opaque data container for client-provided data. |
1294 core.String data; | 1283 core.String data; |
1295 core.List<core.int> get dataAsBytes { | 1284 core.List<core.int> get dataAsBytes { |
1296 return convert.BASE64.decode(data); | 1285 return convert.BASE64.decode(data); |
1297 } | 1286 } |
1298 | 1287 |
1299 void set dataAsBytes(core.List<core.int> _bytes) { | 1288 void set dataAsBytes(core.List<core.int> _bytes) { |
1300 data = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-
"); | 1289 data = |
| 1290 convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-"); |
1301 } | 1291 } |
1302 /** | 1292 |
1303 * Specifies what kind of attachment this is. Tells a client how to | 1293 /// Specifies what kind of attachment this is. Tells a client how to |
1304 * interpret the `data` field. Format is <var>namespace/type</var>, for | 1294 /// interpret the `data` field. Format is <var>namespace/type</var>, for |
1305 * example <code>scrupulous-wombat-12345/welcome-message</code> | 1295 /// example <code>scrupulous-wombat-12345/welcome-message</code> |
1306 */ | |
1307 core.String namespacedType; | 1296 core.String namespacedType; |
1308 | 1297 |
1309 AttachmentInfo(); | 1298 AttachmentInfo(); |
1310 | 1299 |
1311 AttachmentInfo.fromJson(core.Map _json) { | 1300 AttachmentInfo.fromJson(core.Map _json) { |
1312 if (_json.containsKey("data")) { | 1301 if (_json.containsKey("data")) { |
1313 data = _json["data"]; | 1302 data = _json["data"]; |
1314 } | 1303 } |
1315 if (_json.containsKey("namespacedType")) { | 1304 if (_json.containsKey("namespacedType")) { |
1316 namespacedType = _json["namespacedType"]; | 1305 namespacedType = _json["namespacedType"]; |
1317 } | 1306 } |
1318 } | 1307 } |
1319 | 1308 |
1320 core.Map<core.String, core.Object> toJson() { | 1309 core.Map<core.String, core.Object> toJson() { |
1321 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1310 final core.Map<core.String, core.Object> _json = |
| 1311 new core.Map<core.String, core.Object>(); |
1322 if (data != null) { | 1312 if (data != null) { |
1323 _json["data"] = data; | 1313 _json["data"] = data; |
1324 } | 1314 } |
1325 if (namespacedType != null) { | 1315 if (namespacedType != null) { |
1326 _json["namespacedType"] = namespacedType; | 1316 _json["namespacedType"] = namespacedType; |
1327 } | 1317 } |
1328 return _json; | 1318 return _json; |
1329 } | 1319 } |
1330 } | 1320 } |
1331 | 1321 |
1332 /** Details of a beacon device. */ | 1322 /// Details of a beacon device. |
1333 class Beacon { | 1323 class Beacon { |
1334 /** | 1324 /// The identifier of a beacon as advertised by it. This field must be |
1335 * The identifier of a beacon as advertised by it. This field must be | 1325 /// populated when registering. It may be empty when updating a beacon |
1336 * populated when registering. It may be empty when updating a beacon | 1326 /// record because it is ignored in updates. |
1337 * record because it is ignored in updates. | 1327 /// |
1338 * | 1328 /// When registering a beacon that broadcasts Eddystone-EID, this field |
1339 * When registering a beacon that broadcasts Eddystone-EID, this field | 1329 /// should contain a "stable" Eddystone-UID that identifies the beacon and |
1340 * should contain a "stable" Eddystone-UID that identifies the beacon and | 1330 /// links it to its attachments. The stable Eddystone-UID is only used for |
1341 * links it to its attachments. The stable Eddystone-UID is only used for | 1331 /// administering the beacon. |
1342 * administering the beacon. | |
1343 */ | |
1344 AdvertisedId advertisedId; | 1332 AdvertisedId advertisedId; |
1345 /** | 1333 |
1346 * Resource name of this beacon. A beacon name has the format | 1334 /// Resource name of this beacon. A beacon name has the format |
1347 * "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by | 1335 /// "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by |
1348 * the beacon and N is a code for the beacon's type. Possible values are | 1336 /// the beacon and N is a code for the beacon's type. Possible values are |
1349 * `3` for Eddystone, `1` for iBeacon, or `5` for AltBeacon. | 1337 /// `3` for Eddystone, `1` for iBeacon, or `5` for AltBeacon. |
1350 * | 1338 /// |
1351 * This field must be left empty when registering. After reading a beacon, | 1339 /// This field must be left empty when registering. After reading a beacon, |
1352 * clients can use the name for future operations. | 1340 /// clients can use the name for future operations. |
1353 */ | |
1354 core.String beaconName; | 1341 core.String beaconName; |
1355 /** | 1342 |
1356 * Free text used to identify and describe the beacon. Maximum length 140 | 1343 /// Free text used to identify and describe the beacon. Maximum length 140 |
1357 * characters. | 1344 /// characters. |
1358 * Optional. | 1345 /// Optional. |
1359 */ | |
1360 core.String description; | 1346 core.String description; |
1361 /** | 1347 |
1362 * Write-only registration parameters for beacons using Eddystone-EID | 1348 /// Write-only registration parameters for beacons using Eddystone-EID |
1363 * (remotely resolved ephemeral ID) format. This information will not be | 1349 /// (remotely resolved ephemeral ID) format. This information will not be |
1364 * populated in API responses. When submitting this data, the `advertised_id` | 1350 /// populated in API responses. When submitting this data, the |
1365 * field must contain an ID of type Eddystone-UID. Any other ID type will | 1351 /// `advertised_id` |
1366 * result in an error. | 1352 /// field must contain an ID of type Eddystone-UID. Any other ID type will |
1367 */ | 1353 /// result in an error. |
1368 EphemeralIdRegistration ephemeralIdRegistration; | 1354 EphemeralIdRegistration ephemeralIdRegistration; |
1369 /** | 1355 |
1370 * Expected location stability. This is set when the beacon is registered or | 1356 /// Expected location stability. This is set when the beacon is registered or |
1371 * updated, not automatically detected in any way. | 1357 /// updated, not automatically detected in any way. |
1372 * Optional. | 1358 /// Optional. |
1373 * Possible string values are: | 1359 /// Possible string values are: |
1374 * - "STABILITY_UNSPECIFIED" : Do not use this value. | 1360 /// - "STABILITY_UNSPECIFIED" : Do not use this value. |
1375 * - "STABLE" : Not expected to move, for example a store's front door. | 1361 /// - "STABLE" : Not expected to move, for example a store's front door. |
1376 * - "PORTABLE" : Usually stable but may move rarely, usually within a single | 1362 /// - "PORTABLE" : Usually stable but may move rarely, usually within a |
1377 * place, | 1363 /// single place, |
1378 * for example a store display. | 1364 /// for example a store display. |
1379 * - "MOBILE" : Moves frequently, for example a personal item or food truck. | 1365 /// - "MOBILE" : Moves frequently, for example a personal item or food truck. |
1380 * - "ROVING" : Moves continuously in service, for example a bus or train. | 1366 /// - "ROVING" : Moves continuously in service, for example a bus or train. |
1381 */ | |
1382 core.String expectedStability; | 1367 core.String expectedStability; |
1383 /** | 1368 |
1384 * The indoor level information for this beacon, if known. As returned by the | 1369 /// The indoor level information for this beacon, if known. As returned by |
1385 * Google Maps API. | 1370 /// the |
1386 * Optional. | 1371 /// Google Maps API. |
1387 */ | 1372 /// Optional. |
1388 IndoorLevel indoorLevel; | 1373 IndoorLevel indoorLevel; |
1389 /** | 1374 |
1390 * The location of the beacon, expressed as a latitude and longitude pair. | 1375 /// The location of the beacon, expressed as a latitude and longitude pair. |
1391 * This location is given when the beacon is registered or updated. It does | 1376 /// This location is given when the beacon is registered or updated. It does |
1392 * not necessarily indicate the actual current location of the beacon. | 1377 /// not necessarily indicate the actual current location of the beacon. |
1393 * Optional. | 1378 /// Optional. |
1394 */ | |
1395 LatLng latLng; | 1379 LatLng latLng; |
1396 /** | 1380 |
1397 * The [Google Places API](/places/place-id) Place ID of the place where | 1381 /// The [Google Places API](/places/place-id) Place ID of the place where |
1398 * the beacon is deployed. This is given when the beacon is registered or | 1382 /// the beacon is deployed. This is given when the beacon is registered or |
1399 * updated, not automatically detected in any way. | 1383 /// updated, not automatically detected in any way. |
1400 * Optional. | 1384 /// Optional. |
1401 */ | |
1402 core.String placeId; | 1385 core.String placeId; |
1403 /** | 1386 |
1404 * Properties of the beacon device, for example battery type or firmware | 1387 /// Properties of the beacon device, for example battery type or firmware |
1405 * version. | 1388 /// version. |
1406 * Optional. | 1389 /// Optional. |
1407 */ | |
1408 core.Map<core.String, core.String> properties; | 1390 core.Map<core.String, core.String> properties; |
1409 /** | 1391 |
1410 * Some beacons may require a user to provide an authorization key before | 1392 /// Some beacons may require a user to provide an authorization key before |
1411 * changing any of its configuration (e.g. broadcast frames, transmit power). | 1393 /// changing any of its configuration (e.g. broadcast frames, transmit |
1412 * This field provides a place to store and control access to that key. | 1394 /// power). |
1413 * This field is populated in responses to `GET /v1beta1/beacons/3!beaconId` | 1395 /// This field provides a place to store and control access to that key. |
1414 * from users with write access to the given beacon. That is to say: If the | 1396 /// This field is populated in responses to `GET /v1beta1/beacons/3!beaconId` |
1415 * user is authorized to write the beacon's confidential data in the service, | 1397 /// from users with write access to the given beacon. That is to say: If the |
1416 * the service considers them authorized to configure the beacon. Note | 1398 /// user is authorized to write the beacon's confidential data in the |
1417 * that this key grants nothing on the service, only on the beacon itself. | 1399 /// service, |
1418 */ | 1400 /// the service considers them authorized to configure the beacon. Note |
| 1401 /// that this key grants nothing on the service, only on the beacon itself. |
1419 core.String provisioningKey; | 1402 core.String provisioningKey; |
1420 core.List<core.int> get provisioningKeyAsBytes { | 1403 core.List<core.int> get provisioningKeyAsBytes { |
1421 return convert.BASE64.decode(provisioningKey); | 1404 return convert.BASE64.decode(provisioningKey); |
1422 } | 1405 } |
1423 | 1406 |
1424 void set provisioningKeyAsBytes(core.List<core.int> _bytes) { | 1407 void set provisioningKeyAsBytes(core.List<core.int> _bytes) { |
1425 provisioningKey = convert.BASE64.encode(_bytes).replaceAll("/", "_").replace
All("+", "-"); | 1408 provisioningKey = |
| 1409 convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-"); |
1426 } | 1410 } |
1427 /** | 1411 |
1428 * Current status of the beacon. | 1412 /// Current status of the beacon. |
1429 * Required. | 1413 /// Required. |
1430 * Possible string values are: | 1414 /// Possible string values are: |
1431 * - "STATUS_UNSPECIFIED" : Do not use this value. | 1415 /// - "STATUS_UNSPECIFIED" : Do not use this value. |
1432 * - "ACTIVE" : The "normal" in-use state of a beacon. | 1416 /// - "ACTIVE" : The "normal" in-use state of a beacon. |
1433 * - "DECOMMISSIONED" : Beacon should no longer be used for any purpose. This | 1417 /// - "DECOMMISSIONED" : Beacon should no longer be used for any purpose. |
1434 * is irreversible. | 1418 /// This is irreversible. |
1435 * - "INACTIVE" : The beacon should not be visible to mobile devices. This is | 1419 /// - "INACTIVE" : The beacon should not be visible to mobile devices. This |
1436 * reversible. | 1420 /// is reversible. |
1437 */ | |
1438 core.String status; | 1421 core.String status; |
1439 | 1422 |
1440 Beacon(); | 1423 Beacon(); |
1441 | 1424 |
1442 Beacon.fromJson(core.Map _json) { | 1425 Beacon.fromJson(core.Map _json) { |
1443 if (_json.containsKey("advertisedId")) { | 1426 if (_json.containsKey("advertisedId")) { |
1444 advertisedId = new AdvertisedId.fromJson(_json["advertisedId"]); | 1427 advertisedId = new AdvertisedId.fromJson(_json["advertisedId"]); |
1445 } | 1428 } |
1446 if (_json.containsKey("beaconName")) { | 1429 if (_json.containsKey("beaconName")) { |
1447 beaconName = _json["beaconName"]; | 1430 beaconName = _json["beaconName"]; |
1448 } | 1431 } |
1449 if (_json.containsKey("description")) { | 1432 if (_json.containsKey("description")) { |
1450 description = _json["description"]; | 1433 description = _json["description"]; |
1451 } | 1434 } |
1452 if (_json.containsKey("ephemeralIdRegistration")) { | 1435 if (_json.containsKey("ephemeralIdRegistration")) { |
1453 ephemeralIdRegistration = new EphemeralIdRegistration.fromJson(_json["ephe
meralIdRegistration"]); | 1436 ephemeralIdRegistration = new EphemeralIdRegistration.fromJson( |
| 1437 _json["ephemeralIdRegistration"]); |
1454 } | 1438 } |
1455 if (_json.containsKey("expectedStability")) { | 1439 if (_json.containsKey("expectedStability")) { |
1456 expectedStability = _json["expectedStability"]; | 1440 expectedStability = _json["expectedStability"]; |
1457 } | 1441 } |
1458 if (_json.containsKey("indoorLevel")) { | 1442 if (_json.containsKey("indoorLevel")) { |
1459 indoorLevel = new IndoorLevel.fromJson(_json["indoorLevel"]); | 1443 indoorLevel = new IndoorLevel.fromJson(_json["indoorLevel"]); |
1460 } | 1444 } |
1461 if (_json.containsKey("latLng")) { | 1445 if (_json.containsKey("latLng")) { |
1462 latLng = new LatLng.fromJson(_json["latLng"]); | 1446 latLng = new LatLng.fromJson(_json["latLng"]); |
1463 } | 1447 } |
1464 if (_json.containsKey("placeId")) { | 1448 if (_json.containsKey("placeId")) { |
1465 placeId = _json["placeId"]; | 1449 placeId = _json["placeId"]; |
1466 } | 1450 } |
1467 if (_json.containsKey("properties")) { | 1451 if (_json.containsKey("properties")) { |
1468 properties = _json["properties"]; | 1452 properties = _json["properties"]; |
1469 } | 1453 } |
1470 if (_json.containsKey("provisioningKey")) { | 1454 if (_json.containsKey("provisioningKey")) { |
1471 provisioningKey = _json["provisioningKey"]; | 1455 provisioningKey = _json["provisioningKey"]; |
1472 } | 1456 } |
1473 if (_json.containsKey("status")) { | 1457 if (_json.containsKey("status")) { |
1474 status = _json["status"]; | 1458 status = _json["status"]; |
1475 } | 1459 } |
1476 } | 1460 } |
1477 | 1461 |
1478 core.Map<core.String, core.Object> toJson() { | 1462 core.Map<core.String, core.Object> toJson() { |
1479 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1463 final core.Map<core.String, core.Object> _json = |
| 1464 new core.Map<core.String, core.Object>(); |
1480 if (advertisedId != null) { | 1465 if (advertisedId != null) { |
1481 _json["advertisedId"] = (advertisedId).toJson(); | 1466 _json["advertisedId"] = (advertisedId).toJson(); |
1482 } | 1467 } |
1483 if (beaconName != null) { | 1468 if (beaconName != null) { |
1484 _json["beaconName"] = beaconName; | 1469 _json["beaconName"] = beaconName; |
1485 } | 1470 } |
1486 if (description != null) { | 1471 if (description != null) { |
1487 _json["description"] = description; | 1472 _json["description"] = description; |
1488 } | 1473 } |
1489 if (ephemeralIdRegistration != null) { | 1474 if (ephemeralIdRegistration != null) { |
(...skipping 17 matching lines...) Expand all Loading... |
1507 if (provisioningKey != null) { | 1492 if (provisioningKey != null) { |
1508 _json["provisioningKey"] = provisioningKey; | 1493 _json["provisioningKey"] = provisioningKey; |
1509 } | 1494 } |
1510 if (status != null) { | 1495 if (status != null) { |
1511 _json["status"] = status; | 1496 _json["status"] = status; |
1512 } | 1497 } |
1513 return _json; | 1498 return _json; |
1514 } | 1499 } |
1515 } | 1500 } |
1516 | 1501 |
1517 /** Project-specific data associated with a beacon. */ | 1502 /// Project-specific data associated with a beacon. |
1518 class BeaconAttachment { | 1503 class BeaconAttachment { |
1519 /** | 1504 /// Resource name of this attachment. Attachment names have the format: |
1520 * Resource name of this attachment. Attachment names have the format: | 1505 /// <code>beacons/<var>beacon_id</var>/attachments/<var>attachment_id</var></c
ode>. |
1521 * <code>beacons/<var>beacon_id</var>/attachments/<var>attachment_id</var></co
de>. | 1506 /// Leave this empty on creation. |
1522 * Leave this empty on creation. | |
1523 */ | |
1524 core.String attachmentName; | 1507 core.String attachmentName; |
1525 /** | 1508 |
1526 * The UTC time when this attachment was created, in milliseconds since the | 1509 /// The UTC time when this attachment was created, in milliseconds since the |
1527 * UNIX epoch. | 1510 /// UNIX epoch. |
1528 */ | |
1529 core.String creationTimeMs; | 1511 core.String creationTimeMs; |
1530 /** | 1512 |
1531 * An opaque data container for client-provided data. Must be | 1513 /// An opaque data container for client-provided data. Must be |
1532 * [base64](http://tools.ietf.org/html/rfc4648#section-4) encoded in HTTP | 1514 /// [base64](http://tools.ietf.org/html/rfc4648#section-4) encoded in HTTP |
1533 * requests, and will be so encoded (with padding) in responses. | 1515 /// requests, and will be so encoded (with padding) in responses. |
1534 * Required. | 1516 /// Required. |
1535 */ | |
1536 core.String data; | 1517 core.String data; |
1537 core.List<core.int> get dataAsBytes { | 1518 core.List<core.int> get dataAsBytes { |
1538 return convert.BASE64.decode(data); | 1519 return convert.BASE64.decode(data); |
1539 } | 1520 } |
1540 | 1521 |
1541 void set dataAsBytes(core.List<core.int> _bytes) { | 1522 void set dataAsBytes(core.List<core.int> _bytes) { |
1542 data = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-
"); | 1523 data = |
| 1524 convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-"); |
1543 } | 1525 } |
1544 /** | 1526 |
1545 * Specifies what kind of attachment this is. Tells a client how to | 1527 /// Specifies what kind of attachment this is. Tells a client how to |
1546 * interpret the `data` field. Format is <var>namespace/type</var>. Namespace | 1528 /// interpret the `data` field. Format is <var>namespace/type</var>. |
1547 * provides type separation between clients. Type describes the type of | 1529 /// Namespace |
1548 * `data`, for use by the client when parsing the `data` field. | 1530 /// provides type separation between clients. Type describes the type of |
1549 * Required. | 1531 /// `data`, for use by the client when parsing the `data` field. |
1550 */ | 1532 /// Required. |
1551 core.String namespacedType; | 1533 core.String namespacedType; |
1552 | 1534 |
1553 BeaconAttachment(); | 1535 BeaconAttachment(); |
1554 | 1536 |
1555 BeaconAttachment.fromJson(core.Map _json) { | 1537 BeaconAttachment.fromJson(core.Map _json) { |
1556 if (_json.containsKey("attachmentName")) { | 1538 if (_json.containsKey("attachmentName")) { |
1557 attachmentName = _json["attachmentName"]; | 1539 attachmentName = _json["attachmentName"]; |
1558 } | 1540 } |
1559 if (_json.containsKey("creationTimeMs")) { | 1541 if (_json.containsKey("creationTimeMs")) { |
1560 creationTimeMs = _json["creationTimeMs"]; | 1542 creationTimeMs = _json["creationTimeMs"]; |
1561 } | 1543 } |
1562 if (_json.containsKey("data")) { | 1544 if (_json.containsKey("data")) { |
1563 data = _json["data"]; | 1545 data = _json["data"]; |
1564 } | 1546 } |
1565 if (_json.containsKey("namespacedType")) { | 1547 if (_json.containsKey("namespacedType")) { |
1566 namespacedType = _json["namespacedType"]; | 1548 namespacedType = _json["namespacedType"]; |
1567 } | 1549 } |
1568 } | 1550 } |
1569 | 1551 |
1570 core.Map<core.String, core.Object> toJson() { | 1552 core.Map<core.String, core.Object> toJson() { |
1571 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1553 final core.Map<core.String, core.Object> _json = |
| 1554 new core.Map<core.String, core.Object>(); |
1572 if (attachmentName != null) { | 1555 if (attachmentName != null) { |
1573 _json["attachmentName"] = attachmentName; | 1556 _json["attachmentName"] = attachmentName; |
1574 } | 1557 } |
1575 if (creationTimeMs != null) { | 1558 if (creationTimeMs != null) { |
1576 _json["creationTimeMs"] = creationTimeMs; | 1559 _json["creationTimeMs"] = creationTimeMs; |
1577 } | 1560 } |
1578 if (data != null) { | 1561 if (data != null) { |
1579 _json["data"] = data; | 1562 _json["data"] = data; |
1580 } | 1563 } |
1581 if (namespacedType != null) { | 1564 if (namespacedType != null) { |
1582 _json["namespacedType"] = namespacedType; | 1565 _json["namespacedType"] = namespacedType; |
1583 } | 1566 } |
1584 return _json; | 1567 return _json; |
1585 } | 1568 } |
1586 } | 1569 } |
1587 | 1570 |
1588 /** | 1571 /// A subset of beacon information served via the `beaconinfo.getforobserved` |
1589 * A subset of beacon information served via the `beaconinfo.getforobserved` | 1572 /// method, which you call when users of your app encounter your beacons. |
1590 * method, which you call when users of your app encounter your beacons. | |
1591 */ | |
1592 class BeaconInfo { | 1573 class BeaconInfo { |
1593 /** The ID advertised by the beacon. */ | 1574 /// The ID advertised by the beacon. |
1594 AdvertisedId advertisedId; | 1575 AdvertisedId advertisedId; |
1595 /** | 1576 |
1596 * Attachments matching the type(s) requested. | 1577 /// Attachments matching the type(s) requested. |
1597 * May be empty if no attachment types were requested. | 1578 /// May be empty if no attachment types were requested. |
1598 */ | |
1599 core.List<AttachmentInfo> attachments; | 1579 core.List<AttachmentInfo> attachments; |
1600 /** The name under which the beacon is registered. */ | 1580 |
| 1581 /// The name under which the beacon is registered. |
1601 core.String beaconName; | 1582 core.String beaconName; |
1602 | 1583 |
1603 BeaconInfo(); | 1584 BeaconInfo(); |
1604 | 1585 |
1605 BeaconInfo.fromJson(core.Map _json) { | 1586 BeaconInfo.fromJson(core.Map _json) { |
1606 if (_json.containsKey("advertisedId")) { | 1587 if (_json.containsKey("advertisedId")) { |
1607 advertisedId = new AdvertisedId.fromJson(_json["advertisedId"]); | 1588 advertisedId = new AdvertisedId.fromJson(_json["advertisedId"]); |
1608 } | 1589 } |
1609 if (_json.containsKey("attachments")) { | 1590 if (_json.containsKey("attachments")) { |
1610 attachments = _json["attachments"].map((value) => new AttachmentInfo.fromJ
son(value)).toList(); | 1591 attachments = _json["attachments"] |
| 1592 .map((value) => new AttachmentInfo.fromJson(value)) |
| 1593 .toList(); |
1611 } | 1594 } |
1612 if (_json.containsKey("beaconName")) { | 1595 if (_json.containsKey("beaconName")) { |
1613 beaconName = _json["beaconName"]; | 1596 beaconName = _json["beaconName"]; |
1614 } | 1597 } |
1615 } | 1598 } |
1616 | 1599 |
1617 core.Map<core.String, core.Object> toJson() { | 1600 core.Map<core.String, core.Object> toJson() { |
1618 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1601 final core.Map<core.String, core.Object> _json = |
| 1602 new core.Map<core.String, core.Object>(); |
1619 if (advertisedId != null) { | 1603 if (advertisedId != null) { |
1620 _json["advertisedId"] = (advertisedId).toJson(); | 1604 _json["advertisedId"] = (advertisedId).toJson(); |
1621 } | 1605 } |
1622 if (attachments != null) { | 1606 if (attachments != null) { |
1623 _json["attachments"] = attachments.map((value) => (value).toJson()).toList
(); | 1607 _json["attachments"] = |
| 1608 attachments.map((value) => (value).toJson()).toList(); |
1624 } | 1609 } |
1625 if (beaconName != null) { | 1610 if (beaconName != null) { |
1626 _json["beaconName"] = beaconName; | 1611 _json["beaconName"] = beaconName; |
1627 } | 1612 } |
1628 return _json; | 1613 return _json; |
1629 } | 1614 } |
1630 } | 1615 } |
1631 | 1616 |
1632 /** | 1617 /// Represents a whole calendar date, e.g. date of birth. The time of day and |
1633 * Represents a whole calendar date, e.g. date of birth. The time of day and | 1618 /// time zone are either specified elsewhere or are not significant. The date |
1634 * time zone are either specified elsewhere or are not significant. The date | 1619 /// is relative to the Proleptic Gregorian Calendar. The day may be 0 to |
1635 * is relative to the Proleptic Gregorian Calendar. The day may be 0 to | 1620 /// represent a year and month where the day is not significant, e.g. credit |
1636 * represent a year and month where the day is not significant, e.g. credit card | 1621 /// card |
1637 * expiration date. The year may be 0 to represent a month and day independent | 1622 /// expiration date. The year may be 0 to represent a month and day independent |
1638 * of year, e.g. anniversary date. Related types are google.type.TimeOfDay | 1623 /// of year, e.g. anniversary date. Related types are google.type.TimeOfDay |
1639 * and `google.protobuf.Timestamp`. | 1624 /// and `google.protobuf.Timestamp`. |
1640 */ | |
1641 class Date { | 1625 class Date { |
1642 /** | 1626 /// Day of month. Must be from 1 to 31 and valid for the year and month, or 0 |
1643 * Day of month. Must be from 1 to 31 and valid for the year and month, or 0 | 1627 /// if specifying a year/month where the day is not significant. |
1644 * if specifying a year/month where the day is not significant. | |
1645 */ | |
1646 core.int day; | 1628 core.int day; |
1647 /** Month of year. Must be from 1 to 12. */ | 1629 |
| 1630 /// Month of year. Must be from 1 to 12. |
1648 core.int month; | 1631 core.int month; |
1649 /** | 1632 |
1650 * Year of date. Must be from 1 to 9999, or 0 if specifying a date without | 1633 /// Year of date. Must be from 1 to 9999, or 0 if specifying a date without |
1651 * a year. | 1634 /// a year. |
1652 */ | |
1653 core.int year; | 1635 core.int year; |
1654 | 1636 |
1655 Date(); | 1637 Date(); |
1656 | 1638 |
1657 Date.fromJson(core.Map _json) { | 1639 Date.fromJson(core.Map _json) { |
1658 if (_json.containsKey("day")) { | 1640 if (_json.containsKey("day")) { |
1659 day = _json["day"]; | 1641 day = _json["day"]; |
1660 } | 1642 } |
1661 if (_json.containsKey("month")) { | 1643 if (_json.containsKey("month")) { |
1662 month = _json["month"]; | 1644 month = _json["month"]; |
1663 } | 1645 } |
1664 if (_json.containsKey("year")) { | 1646 if (_json.containsKey("year")) { |
1665 year = _json["year"]; | 1647 year = _json["year"]; |
1666 } | 1648 } |
1667 } | 1649 } |
1668 | 1650 |
1669 core.Map<core.String, core.Object> toJson() { | 1651 core.Map<core.String, core.Object> toJson() { |
1670 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1652 final core.Map<core.String, core.Object> _json = |
| 1653 new core.Map<core.String, core.Object>(); |
1671 if (day != null) { | 1654 if (day != null) { |
1672 _json["day"] = day; | 1655 _json["day"] = day; |
1673 } | 1656 } |
1674 if (month != null) { | 1657 if (month != null) { |
1675 _json["month"] = month; | 1658 _json["month"] = month; |
1676 } | 1659 } |
1677 if (year != null) { | 1660 if (year != null) { |
1678 _json["year"] = year; | 1661 _json["year"] = year; |
1679 } | 1662 } |
1680 return _json; | 1663 return _json; |
1681 } | 1664 } |
1682 } | 1665 } |
1683 | 1666 |
1684 /** Response for a request to delete attachments. */ | 1667 /// Response for a request to delete attachments. |
1685 class DeleteAttachmentsResponse { | 1668 class DeleteAttachmentsResponse { |
1686 /** The number of attachments that were deleted. */ | 1669 /// The number of attachments that were deleted. |
1687 core.int numDeleted; | 1670 core.int numDeleted; |
1688 | 1671 |
1689 DeleteAttachmentsResponse(); | 1672 DeleteAttachmentsResponse(); |
1690 | 1673 |
1691 DeleteAttachmentsResponse.fromJson(core.Map _json) { | 1674 DeleteAttachmentsResponse.fromJson(core.Map _json) { |
1692 if (_json.containsKey("numDeleted")) { | 1675 if (_json.containsKey("numDeleted")) { |
1693 numDeleted = _json["numDeleted"]; | 1676 numDeleted = _json["numDeleted"]; |
1694 } | 1677 } |
1695 } | 1678 } |
1696 | 1679 |
1697 core.Map<core.String, core.Object> toJson() { | 1680 core.Map<core.String, core.Object> toJson() { |
1698 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1681 final core.Map<core.String, core.Object> _json = |
| 1682 new core.Map<core.String, core.Object>(); |
1699 if (numDeleted != null) { | 1683 if (numDeleted != null) { |
1700 _json["numDeleted"] = numDeleted; | 1684 _json["numDeleted"] = numDeleted; |
1701 } | 1685 } |
1702 return _json; | 1686 return _json; |
1703 } | 1687 } |
1704 } | 1688 } |
1705 | 1689 |
1706 /** Diagnostics for a single beacon. */ | 1690 /// Diagnostics for a single beacon. |
1707 class Diagnostics { | 1691 class Diagnostics { |
1708 /** An unordered list of Alerts that the beacon has. */ | 1692 /// An unordered list of Alerts that the beacon has. |
1709 core.List<core.String> alerts; | 1693 core.List<core.String> alerts; |
1710 /** | 1694 |
1711 * Resource name of the beacon. For Eddystone-EID beacons, this may | 1695 /// Resource name of the beacon. For Eddystone-EID beacons, this may |
1712 * be the beacon's current EID, or the beacon's "stable" Eddystone-UID. | 1696 /// be the beacon's current EID, or the beacon's "stable" Eddystone-UID. |
1713 */ | |
1714 core.String beaconName; | 1697 core.String beaconName; |
1715 /** | 1698 |
1716 * The date when the battery is expected to be low. If the value is missing | 1699 /// The date when the battery is expected to be low. If the value is missing |
1717 * then there is no estimate for when the battery will be low. | 1700 /// then there is no estimate for when the battery will be low. |
1718 * This value is only an estimate, not an exact date. | 1701 /// This value is only an estimate, not an exact date. |
1719 */ | |
1720 Date estimatedLowBatteryDate; | 1702 Date estimatedLowBatteryDate; |
1721 | 1703 |
1722 Diagnostics(); | 1704 Diagnostics(); |
1723 | 1705 |
1724 Diagnostics.fromJson(core.Map _json) { | 1706 Diagnostics.fromJson(core.Map _json) { |
1725 if (_json.containsKey("alerts")) { | 1707 if (_json.containsKey("alerts")) { |
1726 alerts = _json["alerts"]; | 1708 alerts = _json["alerts"]; |
1727 } | 1709 } |
1728 if (_json.containsKey("beaconName")) { | 1710 if (_json.containsKey("beaconName")) { |
1729 beaconName = _json["beaconName"]; | 1711 beaconName = _json["beaconName"]; |
1730 } | 1712 } |
1731 if (_json.containsKey("estimatedLowBatteryDate")) { | 1713 if (_json.containsKey("estimatedLowBatteryDate")) { |
1732 estimatedLowBatteryDate = new Date.fromJson(_json["estimatedLowBatteryDate
"]); | 1714 estimatedLowBatteryDate = |
| 1715 new Date.fromJson(_json["estimatedLowBatteryDate"]); |
1733 } | 1716 } |
1734 } | 1717 } |
1735 | 1718 |
1736 core.Map<core.String, core.Object> toJson() { | 1719 core.Map<core.String, core.Object> toJson() { |
1737 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1720 final core.Map<core.String, core.Object> _json = |
| 1721 new core.Map<core.String, core.Object>(); |
1738 if (alerts != null) { | 1722 if (alerts != null) { |
1739 _json["alerts"] = alerts; | 1723 _json["alerts"] = alerts; |
1740 } | 1724 } |
1741 if (beaconName != null) { | 1725 if (beaconName != null) { |
1742 _json["beaconName"] = beaconName; | 1726 _json["beaconName"] = beaconName; |
1743 } | 1727 } |
1744 if (estimatedLowBatteryDate != null) { | 1728 if (estimatedLowBatteryDate != null) { |
1745 _json["estimatedLowBatteryDate"] = (estimatedLowBatteryDate).toJson(); | 1729 _json["estimatedLowBatteryDate"] = (estimatedLowBatteryDate).toJson(); |
1746 } | 1730 } |
1747 return _json; | 1731 return _json; |
1748 } | 1732 } |
1749 } | 1733 } |
1750 | 1734 |
1751 /** | 1735 /// A generic empty message that you can re-use to avoid defining duplicated |
1752 * A generic empty message that you can re-use to avoid defining duplicated | 1736 /// empty messages in your APIs. A typical example is to use it as the request |
1753 * empty messages in your APIs. A typical example is to use it as the request | 1737 /// or the response type of an API method. For instance: |
1754 * or the response type of an API method. For instance: | 1738 /// |
1755 * | 1739 /// service Foo { |
1756 * service Foo { | 1740 /// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); |
1757 * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); | 1741 /// } |
1758 * } | 1742 /// |
1759 * | 1743 /// The JSON representation for `Empty` is empty JSON object `{}`. |
1760 * The JSON representation for `Empty` is empty JSON object `{}`. | |
1761 */ | |
1762 class Empty { | 1744 class Empty { |
1763 | |
1764 Empty(); | 1745 Empty(); |
1765 | 1746 |
1766 Empty.fromJson(core.Map _json) { | 1747 Empty.fromJson(core.Map _json) {} |
1767 } | |
1768 | 1748 |
1769 core.Map<core.String, core.Object> toJson() { | 1749 core.Map<core.String, core.Object> toJson() { |
1770 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1750 final core.Map<core.String, core.Object> _json = |
| 1751 new core.Map<core.String, core.Object>(); |
1771 return _json; | 1752 return _json; |
1772 } | 1753 } |
1773 } | 1754 } |
1774 | 1755 |
1775 /** | 1756 /// Write-only registration parameters for beacons using Eddystone-EID format. |
1776 * Write-only registration parameters for beacons using Eddystone-EID format. | 1757 /// Two ways of securely registering an Eddystone-EID beacon with the service |
1777 * Two ways of securely registering an Eddystone-EID beacon with the service | 1758 /// are supported: |
1778 * are supported: | 1759 /// |
1779 * | 1760 /// 1. Perform an ECDH key exchange via this API, including a previous call |
1780 * 1. Perform an ECDH key exchange via this API, including a previous call | 1761 /// to `GET /v1beta1/eidparams`. In this case the fields |
1781 * to `GET /v1beta1/eidparams`. In this case the fields | 1762 /// `beacon_ecdh_public_key` and `service_ecdh_public_key` should be |
1782 * `beacon_ecdh_public_key` and `service_ecdh_public_key` should be | 1763 /// populated and `beacon_identity_key` should not be populated. This |
1783 * populated and `beacon_identity_key` should not be populated. This | 1764 /// method ensures that only the two parties in the ECDH key exchange can |
1784 * method ensures that only the two parties in the ECDH key exchange can | 1765 /// compute the identity key, which becomes a secret between them. |
1785 * compute the identity key, which becomes a secret between them. | 1766 /// 2. Derive or obtain the beacon's identity key via other secure means |
1786 * 2. Derive or obtain the beacon's identity key via other secure means | 1767 /// (perhaps an ECDH key exchange between the beacon and a mobile device |
1787 * (perhaps an ECDH key exchange between the beacon and a mobile device | 1768 /// or any other secure method), and then submit the resulting identity key |
1788 * or any other secure method), and then submit the resulting identity key | 1769 /// to the service. In this case `beacon_identity_key` field should be |
1789 * to the service. In this case `beacon_identity_key` field should be | 1770 /// populated, and neither of `beacon_ecdh_public_key` nor |
1790 * populated, and neither of `beacon_ecdh_public_key` nor | 1771 /// `service_ecdh_public_key` fields should be. The security of this method |
1791 * `service_ecdh_public_key` fields should be. The security of this method | 1772 /// depends on how securely the parties involved (in particular the |
1792 * depends on how securely the parties involved (in particular the | 1773 /// bluetooth client) handle the identity key, and obviously on how |
1793 * bluetooth client) handle the identity key, and obviously on how | 1774 /// securely the identity key was generated. |
1794 * securely the identity key was generated. | 1775 /// |
1795 * | 1776 /// See [the Eddystone |
1796 * See [the Eddystone | 1777 /// specification](https://github.com/google/eddystone/tree/master/eddystone-eid
) |
1797 * specification](https://github.com/google/eddystone/tree/master/eddystone-eid) | 1778 /// at GitHub. |
1798 * at GitHub. | |
1799 */ | |
1800 class EphemeralIdRegistration { | 1779 class EphemeralIdRegistration { |
1801 /** | 1780 /// The beacon's public key used for the Elliptic curve Diffie-Hellman |
1802 * The beacon's public key used for the Elliptic curve Diffie-Hellman | 1781 /// key exchange. When this field is populated, `service_ecdh_public_key` |
1803 * key exchange. When this field is populated, `service_ecdh_public_key` | 1782 /// must also be populated, and `beacon_identity_key` must not be. |
1804 * must also be populated, and `beacon_identity_key` must not be. | |
1805 */ | |
1806 core.String beaconEcdhPublicKey; | 1783 core.String beaconEcdhPublicKey; |
1807 core.List<core.int> get beaconEcdhPublicKeyAsBytes { | 1784 core.List<core.int> get beaconEcdhPublicKeyAsBytes { |
1808 return convert.BASE64.decode(beaconEcdhPublicKey); | 1785 return convert.BASE64.decode(beaconEcdhPublicKey); |
1809 } | 1786 } |
1810 | 1787 |
1811 void set beaconEcdhPublicKeyAsBytes(core.List<core.int> _bytes) { | 1788 void set beaconEcdhPublicKeyAsBytes(core.List<core.int> _bytes) { |
1812 beaconEcdhPublicKey = convert.BASE64.encode(_bytes).replaceAll("/", "_").rep
laceAll("+", "-"); | 1789 beaconEcdhPublicKey = |
| 1790 convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-"); |
1813 } | 1791 } |
1814 /** | 1792 |
1815 * The private key of the beacon. If this field is populated, | 1793 /// The private key of the beacon. If this field is populated, |
1816 * `beacon_ecdh_public_key` and `service_ecdh_public_key` must not be | 1794 /// `beacon_ecdh_public_key` and `service_ecdh_public_key` must not be |
1817 * populated. | 1795 /// populated. |
1818 */ | |
1819 core.String beaconIdentityKey; | 1796 core.String beaconIdentityKey; |
1820 core.List<core.int> get beaconIdentityKeyAsBytes { | 1797 core.List<core.int> get beaconIdentityKeyAsBytes { |
1821 return convert.BASE64.decode(beaconIdentityKey); | 1798 return convert.BASE64.decode(beaconIdentityKey); |
1822 } | 1799 } |
1823 | 1800 |
1824 void set beaconIdentityKeyAsBytes(core.List<core.int> _bytes) { | 1801 void set beaconIdentityKeyAsBytes(core.List<core.int> _bytes) { |
1825 beaconIdentityKey = convert.BASE64.encode(_bytes).replaceAll("/", "_").repla
ceAll("+", "-"); | 1802 beaconIdentityKey = |
| 1803 convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-"); |
1826 } | 1804 } |
1827 /** | 1805 |
1828 * The initial clock value of the beacon. The beacon's clock must have | 1806 /// The initial clock value of the beacon. The beacon's clock must have |
1829 * begun counting at this value immediately prior to transmitting this | 1807 /// begun counting at this value immediately prior to transmitting this |
1830 * value to the resolving service. Significant delay in transmitting this | 1808 /// value to the resolving service. Significant delay in transmitting this |
1831 * value to the service risks registration or resolution failures. If a | 1809 /// value to the service risks registration or resolution failures. If a |
1832 * value is not provided, the default is zero. | 1810 /// value is not provided, the default is zero. |
1833 */ | |
1834 core.String initialClockValue; | 1811 core.String initialClockValue; |
1835 /** | 1812 |
1836 * An initial ephemeral ID calculated using the clock value submitted as | 1813 /// An initial ephemeral ID calculated using the clock value submitted as |
1837 * `initial_clock_value`, and the secret key generated by the | 1814 /// `initial_clock_value`, and the secret key generated by the |
1838 * Diffie-Hellman key exchange using `service_ecdh_public_key` and | 1815 /// Diffie-Hellman key exchange using `service_ecdh_public_key` and |
1839 * `service_ecdh_public_key`. This initial EID value will be used by the | 1816 /// `service_ecdh_public_key`. This initial EID value will be used by the |
1840 * service to confirm that the key exchange process was successful. | 1817 /// service to confirm that the key exchange process was successful. |
1841 */ | |
1842 core.String initialEid; | 1818 core.String initialEid; |
1843 core.List<core.int> get initialEidAsBytes { | 1819 core.List<core.int> get initialEidAsBytes { |
1844 return convert.BASE64.decode(initialEid); | 1820 return convert.BASE64.decode(initialEid); |
1845 } | 1821 } |
1846 | 1822 |
1847 void set initialEidAsBytes(core.List<core.int> _bytes) { | 1823 void set initialEidAsBytes(core.List<core.int> _bytes) { |
1848 initialEid = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("
+", "-"); | 1824 initialEid = |
| 1825 convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-"); |
1849 } | 1826 } |
1850 /** | 1827 |
1851 * Indicates the nominal period between each rotation of the beacon's | 1828 /// Indicates the nominal period between each rotation of the beacon's |
1852 * ephemeral ID. "Nominal" because the beacon should randomize the | 1829 /// ephemeral ID. "Nominal" because the beacon should randomize the |
1853 * actual interval. See [the spec at | 1830 /// actual interval. See [the spec at |
1854 * github](https://github.com/google/eddystone/tree/master/eddystone-eid) | 1831 /// github](https://github.com/google/eddystone/tree/master/eddystone-eid) |
1855 * for details. This value corresponds to a power-of-two scaler on the | 1832 /// for details. This value corresponds to a power-of-two scaler on the |
1856 * beacon's clock: when the scaler value is K, the beacon will begin | 1833 /// beacon's clock: when the scaler value is K, the beacon will begin |
1857 * broadcasting a new ephemeral ID on average every 2^K seconds. | 1834 /// broadcasting a new ephemeral ID on average every 2^K seconds. |
1858 */ | |
1859 core.int rotationPeriodExponent; | 1835 core.int rotationPeriodExponent; |
1860 /** | 1836 |
1861 * The service's public key used for the Elliptic curve Diffie-Hellman | 1837 /// The service's public key used for the Elliptic curve Diffie-Hellman |
1862 * key exchange. When this field is populated, `beacon_ecdh_public_key` | 1838 /// key exchange. When this field is populated, `beacon_ecdh_public_key` |
1863 * must also be populated, and `beacon_identity_key` must not be. | 1839 /// must also be populated, and `beacon_identity_key` must not be. |
1864 */ | |
1865 core.String serviceEcdhPublicKey; | 1840 core.String serviceEcdhPublicKey; |
1866 core.List<core.int> get serviceEcdhPublicKeyAsBytes { | 1841 core.List<core.int> get serviceEcdhPublicKeyAsBytes { |
1867 return convert.BASE64.decode(serviceEcdhPublicKey); | 1842 return convert.BASE64.decode(serviceEcdhPublicKey); |
1868 } | 1843 } |
1869 | 1844 |
1870 void set serviceEcdhPublicKeyAsBytes(core.List<core.int> _bytes) { | 1845 void set serviceEcdhPublicKeyAsBytes(core.List<core.int> _bytes) { |
1871 serviceEcdhPublicKey = convert.BASE64.encode(_bytes).replaceAll("/", "_").re
placeAll("+", "-"); | 1846 serviceEcdhPublicKey = |
| 1847 convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-"); |
1872 } | 1848 } |
1873 | 1849 |
1874 EphemeralIdRegistration(); | 1850 EphemeralIdRegistration(); |
1875 | 1851 |
1876 EphemeralIdRegistration.fromJson(core.Map _json) { | 1852 EphemeralIdRegistration.fromJson(core.Map _json) { |
1877 if (_json.containsKey("beaconEcdhPublicKey")) { | 1853 if (_json.containsKey("beaconEcdhPublicKey")) { |
1878 beaconEcdhPublicKey = _json["beaconEcdhPublicKey"]; | 1854 beaconEcdhPublicKey = _json["beaconEcdhPublicKey"]; |
1879 } | 1855 } |
1880 if (_json.containsKey("beaconIdentityKey")) { | 1856 if (_json.containsKey("beaconIdentityKey")) { |
1881 beaconIdentityKey = _json["beaconIdentityKey"]; | 1857 beaconIdentityKey = _json["beaconIdentityKey"]; |
1882 } | 1858 } |
1883 if (_json.containsKey("initialClockValue")) { | 1859 if (_json.containsKey("initialClockValue")) { |
1884 initialClockValue = _json["initialClockValue"]; | 1860 initialClockValue = _json["initialClockValue"]; |
1885 } | 1861 } |
1886 if (_json.containsKey("initialEid")) { | 1862 if (_json.containsKey("initialEid")) { |
1887 initialEid = _json["initialEid"]; | 1863 initialEid = _json["initialEid"]; |
1888 } | 1864 } |
1889 if (_json.containsKey("rotationPeriodExponent")) { | 1865 if (_json.containsKey("rotationPeriodExponent")) { |
1890 rotationPeriodExponent = _json["rotationPeriodExponent"]; | 1866 rotationPeriodExponent = _json["rotationPeriodExponent"]; |
1891 } | 1867 } |
1892 if (_json.containsKey("serviceEcdhPublicKey")) { | 1868 if (_json.containsKey("serviceEcdhPublicKey")) { |
1893 serviceEcdhPublicKey = _json["serviceEcdhPublicKey"]; | 1869 serviceEcdhPublicKey = _json["serviceEcdhPublicKey"]; |
1894 } | 1870 } |
1895 } | 1871 } |
1896 | 1872 |
1897 core.Map<core.String, core.Object> toJson() { | 1873 core.Map<core.String, core.Object> toJson() { |
1898 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1874 final core.Map<core.String, core.Object> _json = |
| 1875 new core.Map<core.String, core.Object>(); |
1899 if (beaconEcdhPublicKey != null) { | 1876 if (beaconEcdhPublicKey != null) { |
1900 _json["beaconEcdhPublicKey"] = beaconEcdhPublicKey; | 1877 _json["beaconEcdhPublicKey"] = beaconEcdhPublicKey; |
1901 } | 1878 } |
1902 if (beaconIdentityKey != null) { | 1879 if (beaconIdentityKey != null) { |
1903 _json["beaconIdentityKey"] = beaconIdentityKey; | 1880 _json["beaconIdentityKey"] = beaconIdentityKey; |
1904 } | 1881 } |
1905 if (initialClockValue != null) { | 1882 if (initialClockValue != null) { |
1906 _json["initialClockValue"] = initialClockValue; | 1883 _json["initialClockValue"] = initialClockValue; |
1907 } | 1884 } |
1908 if (initialEid != null) { | 1885 if (initialEid != null) { |
1909 _json["initialEid"] = initialEid; | 1886 _json["initialEid"] = initialEid; |
1910 } | 1887 } |
1911 if (rotationPeriodExponent != null) { | 1888 if (rotationPeriodExponent != null) { |
1912 _json["rotationPeriodExponent"] = rotationPeriodExponent; | 1889 _json["rotationPeriodExponent"] = rotationPeriodExponent; |
1913 } | 1890 } |
1914 if (serviceEcdhPublicKey != null) { | 1891 if (serviceEcdhPublicKey != null) { |
1915 _json["serviceEcdhPublicKey"] = serviceEcdhPublicKey; | 1892 _json["serviceEcdhPublicKey"] = serviceEcdhPublicKey; |
1916 } | 1893 } |
1917 return _json; | 1894 return _json; |
1918 } | 1895 } |
1919 } | 1896 } |
1920 | 1897 |
1921 /** | 1898 /// Information a client needs to provision and register beacons that |
1922 * Information a client needs to provision and register beacons that | 1899 /// broadcast Eddystone-EID format beacon IDs, using Elliptic curve |
1923 * broadcast Eddystone-EID format beacon IDs, using Elliptic curve | 1900 /// Diffie-Hellman key exchange. See |
1924 * Diffie-Hellman key exchange. See | 1901 /// [the Eddystone |
1925 * [the Eddystone | 1902 /// specification](https://github.com/google/eddystone/tree/master/eddystone-eid
) |
1926 * specification](https://github.com/google/eddystone/tree/master/eddystone-eid) | 1903 /// at GitHub. |
1927 * at GitHub. | |
1928 */ | |
1929 class EphemeralIdRegistrationParams { | 1904 class EphemeralIdRegistrationParams { |
1930 /** | 1905 /// Indicates the maximum rotation period supported by the service. |
1931 * Indicates the maximum rotation period supported by the service. | 1906 /// See EddystoneEidRegistration.rotation_period_exponent |
1932 * See EddystoneEidRegistration.rotation_period_exponent | |
1933 */ | |
1934 core.int maxRotationPeriodExponent; | 1907 core.int maxRotationPeriodExponent; |
1935 /** | 1908 |
1936 * Indicates the minimum rotation period supported by the service. | 1909 /// Indicates the minimum rotation period supported by the service. |
1937 * See EddystoneEidRegistration.rotation_period_exponent | 1910 /// See EddystoneEidRegistration.rotation_period_exponent |
1938 */ | |
1939 core.int minRotationPeriodExponent; | 1911 core.int minRotationPeriodExponent; |
1940 /** | 1912 |
1941 * The beacon service's public key for use by a beacon to derive its | 1913 /// The beacon service's public key for use by a beacon to derive its |
1942 * Identity Key using Elliptic Curve Diffie-Hellman key exchange. | 1914 /// Identity Key using Elliptic Curve Diffie-Hellman key exchange. |
1943 */ | |
1944 core.String serviceEcdhPublicKey; | 1915 core.String serviceEcdhPublicKey; |
1945 core.List<core.int> get serviceEcdhPublicKeyAsBytes { | 1916 core.List<core.int> get serviceEcdhPublicKeyAsBytes { |
1946 return convert.BASE64.decode(serviceEcdhPublicKey); | 1917 return convert.BASE64.decode(serviceEcdhPublicKey); |
1947 } | 1918 } |
1948 | 1919 |
1949 void set serviceEcdhPublicKeyAsBytes(core.List<core.int> _bytes) { | 1920 void set serviceEcdhPublicKeyAsBytes(core.List<core.int> _bytes) { |
1950 serviceEcdhPublicKey = convert.BASE64.encode(_bytes).replaceAll("/", "_").re
placeAll("+", "-"); | 1921 serviceEcdhPublicKey = |
| 1922 convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-"); |
1951 } | 1923 } |
1952 | 1924 |
1953 EphemeralIdRegistrationParams(); | 1925 EphemeralIdRegistrationParams(); |
1954 | 1926 |
1955 EphemeralIdRegistrationParams.fromJson(core.Map _json) { | 1927 EphemeralIdRegistrationParams.fromJson(core.Map _json) { |
1956 if (_json.containsKey("maxRotationPeriodExponent")) { | 1928 if (_json.containsKey("maxRotationPeriodExponent")) { |
1957 maxRotationPeriodExponent = _json["maxRotationPeriodExponent"]; | 1929 maxRotationPeriodExponent = _json["maxRotationPeriodExponent"]; |
1958 } | 1930 } |
1959 if (_json.containsKey("minRotationPeriodExponent")) { | 1931 if (_json.containsKey("minRotationPeriodExponent")) { |
1960 minRotationPeriodExponent = _json["minRotationPeriodExponent"]; | 1932 minRotationPeriodExponent = _json["minRotationPeriodExponent"]; |
1961 } | 1933 } |
1962 if (_json.containsKey("serviceEcdhPublicKey")) { | 1934 if (_json.containsKey("serviceEcdhPublicKey")) { |
1963 serviceEcdhPublicKey = _json["serviceEcdhPublicKey"]; | 1935 serviceEcdhPublicKey = _json["serviceEcdhPublicKey"]; |
1964 } | 1936 } |
1965 } | 1937 } |
1966 | 1938 |
1967 core.Map<core.String, core.Object> toJson() { | 1939 core.Map<core.String, core.Object> toJson() { |
1968 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1940 final core.Map<core.String, core.Object> _json = |
| 1941 new core.Map<core.String, core.Object>(); |
1969 if (maxRotationPeriodExponent != null) { | 1942 if (maxRotationPeriodExponent != null) { |
1970 _json["maxRotationPeriodExponent"] = maxRotationPeriodExponent; | 1943 _json["maxRotationPeriodExponent"] = maxRotationPeriodExponent; |
1971 } | 1944 } |
1972 if (minRotationPeriodExponent != null) { | 1945 if (minRotationPeriodExponent != null) { |
1973 _json["minRotationPeriodExponent"] = minRotationPeriodExponent; | 1946 _json["minRotationPeriodExponent"] = minRotationPeriodExponent; |
1974 } | 1947 } |
1975 if (serviceEcdhPublicKey != null) { | 1948 if (serviceEcdhPublicKey != null) { |
1976 _json["serviceEcdhPublicKey"] = serviceEcdhPublicKey; | 1949 _json["serviceEcdhPublicKey"] = serviceEcdhPublicKey; |
1977 } | 1950 } |
1978 return _json; | 1951 return _json; |
1979 } | 1952 } |
1980 } | 1953 } |
1981 | 1954 |
1982 /** | 1955 /// Request for beacon and attachment information about beacons that |
1983 * Request for beacon and attachment information about beacons that | 1956 /// a mobile client has encountered "in the wild". |
1984 * a mobile client has encountered "in the wild". | |
1985 */ | |
1986 class GetInfoForObservedBeaconsRequest { | 1957 class GetInfoForObservedBeaconsRequest { |
1987 /** | 1958 /// Specifies what kind of attachments to include in the response. |
1988 * Specifies what kind of attachments to include in the response. | 1959 /// When given, the response will include only attachments of the given |
1989 * When given, the response will include only attachments of the given types. | 1960 /// types. |
1990 * When empty, no attachments will be returned. Must be in the format | 1961 /// When empty, no attachments will be returned. Must be in the format |
1991 * <var>namespace/type</var>. Accepts `*` to specify all types in | 1962 /// <var>namespace/type</var>. Accepts `*` to specify all types in |
1992 * all namespaces owned by the client. | 1963 /// all namespaces owned by the client. |
1993 * Optional. | 1964 /// Optional. |
1994 */ | |
1995 core.List<core.String> namespacedTypes; | 1965 core.List<core.String> namespacedTypes; |
1996 /** | 1966 |
1997 * The beacons that the client has encountered. | 1967 /// The beacons that the client has encountered. |
1998 * At least one must be given. | 1968 /// At least one must be given. |
1999 */ | |
2000 core.List<Observation> observations; | 1969 core.List<Observation> observations; |
2001 | 1970 |
2002 GetInfoForObservedBeaconsRequest(); | 1971 GetInfoForObservedBeaconsRequest(); |
2003 | 1972 |
2004 GetInfoForObservedBeaconsRequest.fromJson(core.Map _json) { | 1973 GetInfoForObservedBeaconsRequest.fromJson(core.Map _json) { |
2005 if (_json.containsKey("namespacedTypes")) { | 1974 if (_json.containsKey("namespacedTypes")) { |
2006 namespacedTypes = _json["namespacedTypes"]; | 1975 namespacedTypes = _json["namespacedTypes"]; |
2007 } | 1976 } |
2008 if (_json.containsKey("observations")) { | 1977 if (_json.containsKey("observations")) { |
2009 observations = _json["observations"].map((value) => new Observation.fromJs
on(value)).toList(); | 1978 observations = _json["observations"] |
| 1979 .map((value) => new Observation.fromJson(value)) |
| 1980 .toList(); |
2010 } | 1981 } |
2011 } | 1982 } |
2012 | 1983 |
2013 core.Map<core.String, core.Object> toJson() { | 1984 core.Map<core.String, core.Object> toJson() { |
2014 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1985 final core.Map<core.String, core.Object> _json = |
| 1986 new core.Map<core.String, core.Object>(); |
2015 if (namespacedTypes != null) { | 1987 if (namespacedTypes != null) { |
2016 _json["namespacedTypes"] = namespacedTypes; | 1988 _json["namespacedTypes"] = namespacedTypes; |
2017 } | 1989 } |
2018 if (observations != null) { | 1990 if (observations != null) { |
2019 _json["observations"] = observations.map((value) => (value).toJson()).toLi
st(); | 1991 _json["observations"] = |
| 1992 observations.map((value) => (value).toJson()).toList(); |
2020 } | 1993 } |
2021 return _json; | 1994 return _json; |
2022 } | 1995 } |
2023 } | 1996 } |
2024 | 1997 |
2025 /** | 1998 /// Information about the requested beacons, optionally including attachment |
2026 * Information about the requested beacons, optionally including attachment | 1999 /// data. |
2027 * data. | |
2028 */ | |
2029 class GetInfoForObservedBeaconsResponse { | 2000 class GetInfoForObservedBeaconsResponse { |
2030 /** | 2001 /// Public information about beacons. |
2031 * Public information about beacons. | 2002 /// May be empty if the request matched no beacons. |
2032 * May be empty if the request matched no beacons. | |
2033 */ | |
2034 core.List<BeaconInfo> beacons; | 2003 core.List<BeaconInfo> beacons; |
2035 | 2004 |
2036 GetInfoForObservedBeaconsResponse(); | 2005 GetInfoForObservedBeaconsResponse(); |
2037 | 2006 |
2038 GetInfoForObservedBeaconsResponse.fromJson(core.Map _json) { | 2007 GetInfoForObservedBeaconsResponse.fromJson(core.Map _json) { |
2039 if (_json.containsKey("beacons")) { | 2008 if (_json.containsKey("beacons")) { |
2040 beacons = _json["beacons"].map((value) => new BeaconInfo.fromJson(value)).
toList(); | 2009 beacons = _json["beacons"] |
| 2010 .map((value) => new BeaconInfo.fromJson(value)) |
| 2011 .toList(); |
2041 } | 2012 } |
2042 } | 2013 } |
2043 | 2014 |
2044 core.Map<core.String, core.Object> toJson() { | 2015 core.Map<core.String, core.Object> toJson() { |
2045 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 2016 final core.Map<core.String, core.Object> _json = |
| 2017 new core.Map<core.String, core.Object>(); |
2046 if (beacons != null) { | 2018 if (beacons != null) { |
2047 _json["beacons"] = beacons.map((value) => (value).toJson()).toList(); | 2019 _json["beacons"] = beacons.map((value) => (value).toJson()).toList(); |
2048 } | 2020 } |
2049 return _json; | 2021 return _json; |
2050 } | 2022 } |
2051 } | 2023 } |
2052 | 2024 |
2053 /** | 2025 /// Indoor level, a human-readable string as returned by Google Maps APIs, |
2054 * Indoor level, a human-readable string as returned by Google Maps APIs, | 2026 /// useful to indicate which floor of a building a beacon is located on. |
2055 * useful to indicate which floor of a building a beacon is located on. | |
2056 */ | |
2057 class IndoorLevel { | 2027 class IndoorLevel { |
2058 /** The name of this level. */ | 2028 /// The name of this level. |
2059 core.String name; | 2029 core.String name; |
2060 | 2030 |
2061 IndoorLevel(); | 2031 IndoorLevel(); |
2062 | 2032 |
2063 IndoorLevel.fromJson(core.Map _json) { | 2033 IndoorLevel.fromJson(core.Map _json) { |
2064 if (_json.containsKey("name")) { | 2034 if (_json.containsKey("name")) { |
2065 name = _json["name"]; | 2035 name = _json["name"]; |
2066 } | 2036 } |
2067 } | 2037 } |
2068 | 2038 |
2069 core.Map<core.String, core.Object> toJson() { | 2039 core.Map<core.String, core.Object> toJson() { |
2070 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 2040 final core.Map<core.String, core.Object> _json = |
| 2041 new core.Map<core.String, core.Object>(); |
2071 if (name != null) { | 2042 if (name != null) { |
2072 _json["name"] = name; | 2043 _json["name"] = name; |
2073 } | 2044 } |
2074 return _json; | 2045 return _json; |
2075 } | 2046 } |
2076 } | 2047 } |
2077 | 2048 |
2078 /** | 2049 /// An object representing a latitude/longitude pair. This is expressed as a |
2079 * An object representing a latitude/longitude pair. This is expressed as a pair | 2050 /// pair |
2080 * of doubles representing degrees latitude and degrees longitude. Unless | 2051 /// of doubles representing degrees latitude and degrees longitude. Unless |
2081 * specified otherwise, this must conform to the | 2052 /// specified otherwise, this must conform to the |
2082 * <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84 | 2053 /// <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84 |
2083 * standard</a>. Values must be within normalized ranges. | 2054 /// standard</a>. Values must be within normalized ranges. |
2084 * | 2055 /// |
2085 * Example of normalization code in Python: | 2056 /// Example of normalization code in Python: |
2086 * | 2057 /// |
2087 * def NormalizeLongitude(longitude): | 2058 /// def NormalizeLongitude(longitude): |
2088 * """Wraps decimal degrees longitude to [-180.0, 180.0].""" | 2059 /// """Wraps decimal degrees longitude to [-180.0, 180.0].""" |
2089 * q, r = divmod(longitude, 360.0) | 2060 /// q, r = divmod(longitude, 360.0) |
2090 * if r > 180.0 or (r == 180.0 and q <= -1.0): | 2061 /// if r > 180.0 or (r == 180.0 and q <= -1.0): |
2091 * return r - 360.0 | 2062 /// return r - 360.0 |
2092 * return r | 2063 /// return r |
2093 * | 2064 /// |
2094 * def NormalizeLatLng(latitude, longitude): | 2065 /// def NormalizeLatLng(latitude, longitude): |
2095 * """Wraps decimal degrees latitude and longitude to | 2066 /// """Wraps decimal degrees latitude and longitude to |
2096 * [-90.0, 90.0] and [-180.0, 180.0], respectively.""" | 2067 /// [-90.0, 90.0] and [-180.0, 180.0], respectively.""" |
2097 * r = latitude % 360.0 | 2068 /// r = latitude % 360.0 |
2098 * if r <= 90.0: | 2069 /// if r <= 90.0: |
2099 * return r, NormalizeLongitude(longitude) | 2070 /// return r, NormalizeLongitude(longitude) |
2100 * elif r >= 270.0: | 2071 /// elif r >= 270.0: |
2101 * return r - 360, NormalizeLongitude(longitude) | 2072 /// return r - 360, NormalizeLongitude(longitude) |
2102 * else: | 2073 /// else: |
2103 * return 180 - r, NormalizeLongitude(longitude + 180.0) | 2074 /// return 180 - r, NormalizeLongitude(longitude + 180.0) |
2104 * | 2075 /// |
2105 * assert 180.0 == NormalizeLongitude(180.0) | 2076 /// assert 180.0 == NormalizeLongitude(180.0) |
2106 * assert -180.0 == NormalizeLongitude(-180.0) | 2077 /// assert -180.0 == NormalizeLongitude(-180.0) |
2107 * assert -179.0 == NormalizeLongitude(181.0) | 2078 /// assert -179.0 == NormalizeLongitude(181.0) |
2108 * assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0) | 2079 /// assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0) |
2109 * assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0) | 2080 /// assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0) |
2110 * assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0) | 2081 /// assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0) |
2111 * assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0) | 2082 /// assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0) |
2112 * assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0) | 2083 /// assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0) |
2113 * assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0) | 2084 /// assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0) |
2114 * assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0) | 2085 /// assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0) |
2115 * assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0) | 2086 /// assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0) |
2116 * assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0) | 2087 /// assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0) |
2117 * assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0) | 2088 /// assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0) |
2118 */ | |
2119 class LatLng { | 2089 class LatLng { |
2120 /** The latitude in degrees. It must be in the range [-90.0, +90.0]. */ | 2090 /// The latitude in degrees. It must be in the range [-90.0, +90.0]. |
2121 core.double latitude; | 2091 core.double latitude; |
2122 /** The longitude in degrees. It must be in the range [-180.0, +180.0]. */ | 2092 |
| 2093 /// The longitude in degrees. It must be in the range [-180.0, +180.0]. |
2123 core.double longitude; | 2094 core.double longitude; |
2124 | 2095 |
2125 LatLng(); | 2096 LatLng(); |
2126 | 2097 |
2127 LatLng.fromJson(core.Map _json) { | 2098 LatLng.fromJson(core.Map _json) { |
2128 if (_json.containsKey("latitude")) { | 2099 if (_json.containsKey("latitude")) { |
2129 latitude = _json["latitude"]; | 2100 latitude = _json["latitude"]; |
2130 } | 2101 } |
2131 if (_json.containsKey("longitude")) { | 2102 if (_json.containsKey("longitude")) { |
2132 longitude = _json["longitude"]; | 2103 longitude = _json["longitude"]; |
2133 } | 2104 } |
2134 } | 2105 } |
2135 | 2106 |
2136 core.Map<core.String, core.Object> toJson() { | 2107 core.Map<core.String, core.Object> toJson() { |
2137 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 2108 final core.Map<core.String, core.Object> _json = |
| 2109 new core.Map<core.String, core.Object>(); |
2138 if (latitude != null) { | 2110 if (latitude != null) { |
2139 _json["latitude"] = latitude; | 2111 _json["latitude"] = latitude; |
2140 } | 2112 } |
2141 if (longitude != null) { | 2113 if (longitude != null) { |
2142 _json["longitude"] = longitude; | 2114 _json["longitude"] = longitude; |
2143 } | 2115 } |
2144 return _json; | 2116 return _json; |
2145 } | 2117 } |
2146 } | 2118 } |
2147 | 2119 |
2148 /** | 2120 /// Response to `ListBeaconAttachments` that contains the requested |
2149 * Response to `ListBeaconAttachments` that contains the requested attachments. | 2121 /// attachments. |
2150 */ | |
2151 class ListBeaconAttachmentsResponse { | 2122 class ListBeaconAttachmentsResponse { |
2152 /** The attachments that corresponded to the request params. */ | 2123 /// The attachments that corresponded to the request params. |
2153 core.List<BeaconAttachment> attachments; | 2124 core.List<BeaconAttachment> attachments; |
2154 | 2125 |
2155 ListBeaconAttachmentsResponse(); | 2126 ListBeaconAttachmentsResponse(); |
2156 | 2127 |
2157 ListBeaconAttachmentsResponse.fromJson(core.Map _json) { | 2128 ListBeaconAttachmentsResponse.fromJson(core.Map _json) { |
2158 if (_json.containsKey("attachments")) { | 2129 if (_json.containsKey("attachments")) { |
2159 attachments = _json["attachments"].map((value) => new BeaconAttachment.fro
mJson(value)).toList(); | 2130 attachments = _json["attachments"] |
| 2131 .map((value) => new BeaconAttachment.fromJson(value)) |
| 2132 .toList(); |
2160 } | 2133 } |
2161 } | 2134 } |
2162 | 2135 |
2163 core.Map<core.String, core.Object> toJson() { | 2136 core.Map<core.String, core.Object> toJson() { |
2164 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 2137 final core.Map<core.String, core.Object> _json = |
| 2138 new core.Map<core.String, core.Object>(); |
2165 if (attachments != null) { | 2139 if (attachments != null) { |
2166 _json["attachments"] = attachments.map((value) => (value).toJson()).toList
(); | 2140 _json["attachments"] = |
| 2141 attachments.map((value) => (value).toJson()).toList(); |
2167 } | 2142 } |
2168 return _json; | 2143 return _json; |
2169 } | 2144 } |
2170 } | 2145 } |
2171 | 2146 |
2172 /** Response that contains list beacon results and pagination help. */ | 2147 /// Response that contains list beacon results and pagination help. |
2173 class ListBeaconsResponse { | 2148 class ListBeaconsResponse { |
2174 /** The beacons that matched the search criteria. */ | 2149 /// The beacons that matched the search criteria. |
2175 core.List<Beacon> beacons; | 2150 core.List<Beacon> beacons; |
2176 /** | 2151 |
2177 * An opaque pagination token that the client may provide in their next | 2152 /// An opaque pagination token that the client may provide in their next |
2178 * request to retrieve the next page of results. | 2153 /// request to retrieve the next page of results. |
2179 */ | |
2180 core.String nextPageToken; | 2154 core.String nextPageToken; |
2181 /** | 2155 |
2182 * Estimate of the total number of beacons matched by the query. Higher | 2156 /// Estimate of the total number of beacons matched by the query. Higher |
2183 * values may be less accurate. | 2157 /// values may be less accurate. |
2184 */ | |
2185 core.String totalCount; | 2158 core.String totalCount; |
2186 | 2159 |
2187 ListBeaconsResponse(); | 2160 ListBeaconsResponse(); |
2188 | 2161 |
2189 ListBeaconsResponse.fromJson(core.Map _json) { | 2162 ListBeaconsResponse.fromJson(core.Map _json) { |
2190 if (_json.containsKey("beacons")) { | 2163 if (_json.containsKey("beacons")) { |
2191 beacons = _json["beacons"].map((value) => new Beacon.fromJson(value)).toLi
st(); | 2164 beacons = |
| 2165 _json["beacons"].map((value) => new Beacon.fromJson(value)).toList(); |
2192 } | 2166 } |
2193 if (_json.containsKey("nextPageToken")) { | 2167 if (_json.containsKey("nextPageToken")) { |
2194 nextPageToken = _json["nextPageToken"]; | 2168 nextPageToken = _json["nextPageToken"]; |
2195 } | 2169 } |
2196 if (_json.containsKey("totalCount")) { | 2170 if (_json.containsKey("totalCount")) { |
2197 totalCount = _json["totalCount"]; | 2171 totalCount = _json["totalCount"]; |
2198 } | 2172 } |
2199 } | 2173 } |
2200 | 2174 |
2201 core.Map<core.String, core.Object> toJson() { | 2175 core.Map<core.String, core.Object> toJson() { |
2202 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 2176 final core.Map<core.String, core.Object> _json = |
| 2177 new core.Map<core.String, core.Object>(); |
2203 if (beacons != null) { | 2178 if (beacons != null) { |
2204 _json["beacons"] = beacons.map((value) => (value).toJson()).toList(); | 2179 _json["beacons"] = beacons.map((value) => (value).toJson()).toList(); |
2205 } | 2180 } |
2206 if (nextPageToken != null) { | 2181 if (nextPageToken != null) { |
2207 _json["nextPageToken"] = nextPageToken; | 2182 _json["nextPageToken"] = nextPageToken; |
2208 } | 2183 } |
2209 if (totalCount != null) { | 2184 if (totalCount != null) { |
2210 _json["totalCount"] = totalCount; | 2185 _json["totalCount"] = totalCount; |
2211 } | 2186 } |
2212 return _json; | 2187 return _json; |
2213 } | 2188 } |
2214 } | 2189 } |
2215 | 2190 |
2216 /** Response that contains the requested diagnostics. */ | 2191 /// Response that contains the requested diagnostics. |
2217 class ListDiagnosticsResponse { | 2192 class ListDiagnosticsResponse { |
2218 /** The diagnostics matching the given request. */ | 2193 /// The diagnostics matching the given request. |
2219 core.List<Diagnostics> diagnostics; | 2194 core.List<Diagnostics> diagnostics; |
2220 /** | 2195 |
2221 * Token that can be used for pagination. Returned only if the | 2196 /// Token that can be used for pagination. Returned only if the |
2222 * request matches more beacons than can be returned in this response. | 2197 /// request matches more beacons than can be returned in this response. |
2223 */ | |
2224 core.String nextPageToken; | 2198 core.String nextPageToken; |
2225 | 2199 |
2226 ListDiagnosticsResponse(); | 2200 ListDiagnosticsResponse(); |
2227 | 2201 |
2228 ListDiagnosticsResponse.fromJson(core.Map _json) { | 2202 ListDiagnosticsResponse.fromJson(core.Map _json) { |
2229 if (_json.containsKey("diagnostics")) { | 2203 if (_json.containsKey("diagnostics")) { |
2230 diagnostics = _json["diagnostics"].map((value) => new Diagnostics.fromJson
(value)).toList(); | 2204 diagnostics = _json["diagnostics"] |
| 2205 .map((value) => new Diagnostics.fromJson(value)) |
| 2206 .toList(); |
2231 } | 2207 } |
2232 if (_json.containsKey("nextPageToken")) { | 2208 if (_json.containsKey("nextPageToken")) { |
2233 nextPageToken = _json["nextPageToken"]; | 2209 nextPageToken = _json["nextPageToken"]; |
2234 } | 2210 } |
2235 } | 2211 } |
2236 | 2212 |
2237 core.Map<core.String, core.Object> toJson() { | 2213 core.Map<core.String, core.Object> toJson() { |
2238 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 2214 final core.Map<core.String, core.Object> _json = |
| 2215 new core.Map<core.String, core.Object>(); |
2239 if (diagnostics != null) { | 2216 if (diagnostics != null) { |
2240 _json["diagnostics"] = diagnostics.map((value) => (value).toJson()).toList
(); | 2217 _json["diagnostics"] = |
| 2218 diagnostics.map((value) => (value).toJson()).toList(); |
2241 } | 2219 } |
2242 if (nextPageToken != null) { | 2220 if (nextPageToken != null) { |
2243 _json["nextPageToken"] = nextPageToken; | 2221 _json["nextPageToken"] = nextPageToken; |
2244 } | 2222 } |
2245 return _json; | 2223 return _json; |
2246 } | 2224 } |
2247 } | 2225 } |
2248 | 2226 |
2249 /** | 2227 /// Response to ListNamespacesRequest that contains all the project's |
2250 * Response to ListNamespacesRequest that contains all the project's namespaces. | 2228 /// namespaces. |
2251 */ | |
2252 class ListNamespacesResponse { | 2229 class ListNamespacesResponse { |
2253 /** The attachments that corresponded to the request params. */ | 2230 /// The attachments that corresponded to the request params. |
2254 core.List<Namespace> namespaces; | 2231 core.List<Namespace> namespaces; |
2255 | 2232 |
2256 ListNamespacesResponse(); | 2233 ListNamespacesResponse(); |
2257 | 2234 |
2258 ListNamespacesResponse.fromJson(core.Map _json) { | 2235 ListNamespacesResponse.fromJson(core.Map _json) { |
2259 if (_json.containsKey("namespaces")) { | 2236 if (_json.containsKey("namespaces")) { |
2260 namespaces = _json["namespaces"].map((value) => new Namespace.fromJson(val
ue)).toList(); | 2237 namespaces = _json["namespaces"] |
| 2238 .map((value) => new Namespace.fromJson(value)) |
| 2239 .toList(); |
2261 } | 2240 } |
2262 } | 2241 } |
2263 | 2242 |
2264 core.Map<core.String, core.Object> toJson() { | 2243 core.Map<core.String, core.Object> toJson() { |
2265 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 2244 final core.Map<core.String, core.Object> _json = |
| 2245 new core.Map<core.String, core.Object>(); |
2266 if (namespaces != null) { | 2246 if (namespaces != null) { |
2267 _json["namespaces"] = namespaces.map((value) => (value).toJson()).toList()
; | 2247 _json["namespaces"] = |
| 2248 namespaces.map((value) => (value).toJson()).toList(); |
2268 } | 2249 } |
2269 return _json; | 2250 return _json; |
2270 } | 2251 } |
2271 } | 2252 } |
2272 | 2253 |
2273 /** | 2254 /// An attachment namespace defines read and write access for all the |
2274 * An attachment namespace defines read and write access for all the attachments | 2255 /// attachments |
2275 * created under it. Each namespace is globally unique, and owned by one | 2256 /// created under it. Each namespace is globally unique, and owned by one |
2276 * project which is the only project that can create attachments under it. | 2257 /// project which is the only project that can create attachments under it. |
2277 */ | |
2278 class Namespace { | 2258 class Namespace { |
2279 /** | 2259 /// Resource name of this namespace. Namespaces names have the format: |
2280 * Resource name of this namespace. Namespaces names have the format: | 2260 /// <code>namespaces/<var>namespace</var></code>. |
2281 * <code>namespaces/<var>namespace</var></code>. | |
2282 */ | |
2283 core.String namespaceName; | 2261 core.String namespaceName; |
2284 /** | 2262 |
2285 * Specifies what clients may receive attachments under this namespace | 2263 /// Specifies what clients may receive attachments under this namespace |
2286 * via `beaconinfo.getforobserved`. | 2264 /// via `beaconinfo.getforobserved`. |
2287 * Possible string values are: | 2265 /// Possible string values are: |
2288 * - "VISIBILITY_UNSPECIFIED" : Do not use this value. | 2266 /// - "VISIBILITY_UNSPECIFIED" : Do not use this value. |
2289 * - "UNLISTED" : Served only to the project that owns the namespace. | 2267 /// - "UNLISTED" : Served only to the project that owns the namespace. |
2290 * - "PUBLIC" : Any project can subscribe to attachments under the namespace. | 2268 /// - "PUBLIC" : Any project can subscribe to attachments under the |
2291 */ | 2269 /// namespace. |
2292 core.String servingVisibility; | 2270 core.String servingVisibility; |
2293 | 2271 |
2294 Namespace(); | 2272 Namespace(); |
2295 | 2273 |
2296 Namespace.fromJson(core.Map _json) { | 2274 Namespace.fromJson(core.Map _json) { |
2297 if (_json.containsKey("namespaceName")) { | 2275 if (_json.containsKey("namespaceName")) { |
2298 namespaceName = _json["namespaceName"]; | 2276 namespaceName = _json["namespaceName"]; |
2299 } | 2277 } |
2300 if (_json.containsKey("servingVisibility")) { | 2278 if (_json.containsKey("servingVisibility")) { |
2301 servingVisibility = _json["servingVisibility"]; | 2279 servingVisibility = _json["servingVisibility"]; |
2302 } | 2280 } |
2303 } | 2281 } |
2304 | 2282 |
2305 core.Map<core.String, core.Object> toJson() { | 2283 core.Map<core.String, core.Object> toJson() { |
2306 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 2284 final core.Map<core.String, core.Object> _json = |
| 2285 new core.Map<core.String, core.Object>(); |
2307 if (namespaceName != null) { | 2286 if (namespaceName != null) { |
2308 _json["namespaceName"] = namespaceName; | 2287 _json["namespaceName"] = namespaceName; |
2309 } | 2288 } |
2310 if (servingVisibility != null) { | 2289 if (servingVisibility != null) { |
2311 _json["servingVisibility"] = servingVisibility; | 2290 _json["servingVisibility"] = servingVisibility; |
2312 } | 2291 } |
2313 return _json; | 2292 return _json; |
2314 } | 2293 } |
2315 } | 2294 } |
2316 | 2295 |
2317 /** Represents one beacon observed once. */ | 2296 /// Represents one beacon observed once. |
2318 class Observation { | 2297 class Observation { |
2319 /** | 2298 /// The ID advertised by the beacon the client has encountered. |
2320 * The ID advertised by the beacon the client has encountered. | 2299 /// |
2321 * | 2300 /// If the submitted `advertised_id` type is Eddystone-EID, then the client |
2322 * If the submitted `advertised_id` type is Eddystone-EID, then the client | 2301 /// must be authorized to resolve the given beacon. Otherwise no data will be |
2323 * must be authorized to resolve the given beacon. Otherwise no data will be | 2302 /// returned for that beacon. |
2324 * returned for that beacon. | 2303 /// Required. |
2325 * Required. | |
2326 */ | |
2327 AdvertisedId advertisedId; | 2304 AdvertisedId advertisedId; |
2328 /** | 2305 |
2329 * The array of telemetry bytes received from the beacon. The server is | 2306 /// The array of telemetry bytes received from the beacon. The server is |
2330 * responsible for parsing it. This field may frequently be empty, as | 2307 /// responsible for parsing it. This field may frequently be empty, as |
2331 * with a beacon that transmits telemetry only occasionally. | 2308 /// with a beacon that transmits telemetry only occasionally. |
2332 */ | |
2333 core.String telemetry; | 2309 core.String telemetry; |
2334 core.List<core.int> get telemetryAsBytes { | 2310 core.List<core.int> get telemetryAsBytes { |
2335 return convert.BASE64.decode(telemetry); | 2311 return convert.BASE64.decode(telemetry); |
2336 } | 2312 } |
2337 | 2313 |
2338 void set telemetryAsBytes(core.List<core.int> _bytes) { | 2314 void set telemetryAsBytes(core.List<core.int> _bytes) { |
2339 telemetry = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+
", "-"); | 2315 telemetry = |
| 2316 convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-"); |
2340 } | 2317 } |
2341 /** Time when the beacon was observed. */ | 2318 |
| 2319 /// Time when the beacon was observed. |
2342 core.String timestampMs; | 2320 core.String timestampMs; |
2343 | 2321 |
2344 Observation(); | 2322 Observation(); |
2345 | 2323 |
2346 Observation.fromJson(core.Map _json) { | 2324 Observation.fromJson(core.Map _json) { |
2347 if (_json.containsKey("advertisedId")) { | 2325 if (_json.containsKey("advertisedId")) { |
2348 advertisedId = new AdvertisedId.fromJson(_json["advertisedId"]); | 2326 advertisedId = new AdvertisedId.fromJson(_json["advertisedId"]); |
2349 } | 2327 } |
2350 if (_json.containsKey("telemetry")) { | 2328 if (_json.containsKey("telemetry")) { |
2351 telemetry = _json["telemetry"]; | 2329 telemetry = _json["telemetry"]; |
2352 } | 2330 } |
2353 if (_json.containsKey("timestampMs")) { | 2331 if (_json.containsKey("timestampMs")) { |
2354 timestampMs = _json["timestampMs"]; | 2332 timestampMs = _json["timestampMs"]; |
2355 } | 2333 } |
2356 } | 2334 } |
2357 | 2335 |
2358 core.Map<core.String, core.Object> toJson() { | 2336 core.Map<core.String, core.Object> toJson() { |
2359 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 2337 final core.Map<core.String, core.Object> _json = |
| 2338 new core.Map<core.String, core.Object>(); |
2360 if (advertisedId != null) { | 2339 if (advertisedId != null) { |
2361 _json["advertisedId"] = (advertisedId).toJson(); | 2340 _json["advertisedId"] = (advertisedId).toJson(); |
2362 } | 2341 } |
2363 if (telemetry != null) { | 2342 if (telemetry != null) { |
2364 _json["telemetry"] = telemetry; | 2343 _json["telemetry"] = telemetry; |
2365 } | 2344 } |
2366 if (timestampMs != null) { | 2345 if (timestampMs != null) { |
2367 _json["timestampMs"] = timestampMs; | 2346 _json["timestampMs"] = timestampMs; |
2368 } | 2347 } |
2369 return _json; | 2348 return _json; |
2370 } | 2349 } |
2371 } | 2350 } |
OLD | NEW |