1// Copyright 2020 Google LLC. 2// Use of this source code is governed by a BSD-style 3// license that can be found in the LICENSE file. 4 5// Code generated file. DO NOT EDIT. 6 7// Package proximitybeacon provides access to the Proximity Beacon API. 8// 9// For product documentation, see: https://developers.google.com/beacons/proximity/ 10// 11// Creating a client 12// 13// Usage example: 14// 15// import "google.golang.org/api/proximitybeacon/v1beta1" 16// ... 17// ctx := context.Background() 18// proximitybeaconService, err := proximitybeacon.NewService(ctx) 19// 20// In this example, Google Application Default Credentials are used for authentication. 21// 22// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 23// 24// Other authentication options 25// 26// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: 27// 28// proximitybeaconService, err := proximitybeacon.NewService(ctx, option.WithAPIKey("AIza...")) 29// 30// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: 31// 32// config := &oauth2.Config{...} 33// // ... 34// token, err := config.Exchange(ctx, ...) 35// proximitybeaconService, err := proximitybeacon.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 36// 37// See https://godoc.org/google.golang.org/api/option/ for details on options. 38package proximitybeacon // import "google.golang.org/api/proximitybeacon/v1beta1" 39 40import ( 41 "bytes" 42 "context" 43 "encoding/json" 44 "errors" 45 "fmt" 46 "io" 47 "net/http" 48 "net/url" 49 "strconv" 50 "strings" 51 52 googleapi "google.golang.org/api/googleapi" 53 gensupport "google.golang.org/api/internal/gensupport" 54 option "google.golang.org/api/option" 55 internaloption "google.golang.org/api/option/internaloption" 56 htransport "google.golang.org/api/transport/http" 57) 58 59// Always reference these packages, just in case the auto-generated code 60// below doesn't. 61var _ = bytes.NewBuffer 62var _ = strconv.Itoa 63var _ = fmt.Sprintf 64var _ = json.NewDecoder 65var _ = io.Copy 66var _ = url.Parse 67var _ = gensupport.MarshalJSON 68var _ = googleapi.Version 69var _ = errors.New 70var _ = strings.Replace 71var _ = context.Canceled 72var _ = internaloption.WithDefaultEndpoint 73 74const apiId = "proximitybeacon:v1beta1" 75const apiName = "proximitybeacon" 76const apiVersion = "v1beta1" 77const basePath = "https://proximitybeacon.googleapis.com/" 78 79// OAuth2 scopes used by this API. 80const ( 81 // View and modify your beacons 82 UserlocationBeaconRegistryScope = "https://www.googleapis.com/auth/userlocation.beacon.registry" 83) 84 85// NewService creates a new Service. 86func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 87 scopesOption := option.WithScopes( 88 "https://www.googleapis.com/auth/userlocation.beacon.registry", 89 ) 90 // NOTE: prepend, so we don't override user-specified scopes. 91 opts = append([]option.ClientOption{scopesOption}, opts...) 92 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 93 client, endpoint, err := htransport.NewClient(ctx, opts...) 94 if err != nil { 95 return nil, err 96 } 97 s, err := New(client) 98 if err != nil { 99 return nil, err 100 } 101 if endpoint != "" { 102 s.BasePath = endpoint 103 } 104 return s, nil 105} 106 107// New creates a new Service. It uses the provided http.Client for requests. 108// 109// Deprecated: please use NewService instead. 110// To provide a custom HTTP client, use option.WithHTTPClient. 111// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 112func New(client *http.Client) (*Service, error) { 113 if client == nil { 114 return nil, errors.New("client is nil") 115 } 116 s := &Service{client: client, BasePath: basePath} 117 s.Beaconinfo = NewBeaconinfoService(s) 118 s.Beacons = NewBeaconsService(s) 119 s.Namespaces = NewNamespacesService(s) 120 s.V1beta1 = NewV1beta1Service(s) 121 return s, nil 122} 123 124type Service struct { 125 client *http.Client 126 BasePath string // API endpoint base URL 127 UserAgent string // optional additional User-Agent fragment 128 129 Beaconinfo *BeaconinfoService 130 131 Beacons *BeaconsService 132 133 Namespaces *NamespacesService 134 135 V1beta1 *V1beta1Service 136} 137 138func (s *Service) userAgent() string { 139 if s.UserAgent == "" { 140 return googleapi.UserAgent 141 } 142 return googleapi.UserAgent + " " + s.UserAgent 143} 144 145func NewBeaconinfoService(s *Service) *BeaconinfoService { 146 rs := &BeaconinfoService{s: s} 147 return rs 148} 149 150type BeaconinfoService struct { 151 s *Service 152} 153 154func NewBeaconsService(s *Service) *BeaconsService { 155 rs := &BeaconsService{s: s} 156 rs.Attachments = NewBeaconsAttachmentsService(s) 157 rs.Diagnostics = NewBeaconsDiagnosticsService(s) 158 return rs 159} 160 161type BeaconsService struct { 162 s *Service 163 164 Attachments *BeaconsAttachmentsService 165 166 Diagnostics *BeaconsDiagnosticsService 167} 168 169func NewBeaconsAttachmentsService(s *Service) *BeaconsAttachmentsService { 170 rs := &BeaconsAttachmentsService{s: s} 171 return rs 172} 173 174type BeaconsAttachmentsService struct { 175 s *Service 176} 177 178func NewBeaconsDiagnosticsService(s *Service) *BeaconsDiagnosticsService { 179 rs := &BeaconsDiagnosticsService{s: s} 180 return rs 181} 182 183type BeaconsDiagnosticsService struct { 184 s *Service 185} 186 187func NewNamespacesService(s *Service) *NamespacesService { 188 rs := &NamespacesService{s: s} 189 return rs 190} 191 192type NamespacesService struct { 193 s *Service 194} 195 196func NewV1beta1Service(s *Service) *V1beta1Service { 197 rs := &V1beta1Service{s: s} 198 return rs 199} 200 201type V1beta1Service struct { 202 s *Service 203} 204 205// AdvertisedId: Defines a unique identifier of a beacon as broadcast by 206// the device. 207type AdvertisedId struct { 208 // Id: The actual beacon identifier, as broadcast by the beacon 209 // hardware. Must 210 // be 211 // [base64](http://tools.ietf.org/html/rfc4648#section-4) encoded in 212 // HTTP 213 // requests, and will be so encoded (with padding) in responses. The 214 // base64 215 // encoding should be of the binary byte-stream and not any textual 216 // (such as 217 // hex) representation thereof. 218 // Required. 219 Id string `json:"id,omitempty"` 220 221 // Type: Specifies the identifier type. 222 // Required. 223 // 224 // Possible values: 225 // "TYPE_UNSPECIFIED" - Do not use this value. 226 // "EDDYSTONE" - Eddystone, an open beacon format that supports 227 // Android and iOS 228 // devices 229 // https://github.com/google/eddystone/wiki/Beacon-Specification 230 // "IBEACON" - Apple iBeacon compatible beacon 231 // "ALTBEACON" - See http://altbeacon.org and/or 232 // https://github.com/AltBeacon/spec. 233 // "EDDYSTONE_EID" - Eddystone Ephemeral ID 234 Type string `json:"type,omitempty"` 235 236 // ForceSendFields is a list of field names (e.g. "Id") to 237 // unconditionally include in API requests. By default, fields with 238 // empty values are omitted from API requests. However, any non-pointer, 239 // non-interface field appearing in ForceSendFields will be sent to the 240 // server regardless of whether the field is empty or not. This may be 241 // used to include empty fields in Patch requests. 242 ForceSendFields []string `json:"-"` 243 244 // NullFields is a list of field names (e.g. "Id") to include in API 245 // requests with the JSON null value. By default, fields with empty 246 // values are omitted from API requests. However, any field with an 247 // empty value appearing in NullFields will be sent to the server as 248 // null. It is an error if a field in this list has a non-empty value. 249 // This may be used to include null fields in Patch requests. 250 NullFields []string `json:"-"` 251} 252 253func (s *AdvertisedId) MarshalJSON() ([]byte, error) { 254 type NoMethod AdvertisedId 255 raw := NoMethod(*s) 256 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 257} 258 259// AttachmentInfo: A subset of attachment information served via 260// the 261// `beaconinfo.getforobserved` method, used when your users encounter 262// your 263// beacons. 264type AttachmentInfo struct { 265 // Data: An opaque data container for client-provided data. 266 Data string `json:"data,omitempty"` 267 268 // MaxDistanceMeters: The distance away from the beacon at which this 269 // attachment should be 270 // delivered to a mobile app. 271 // 272 // Setting this to a value greater than zero indicates that the app 273 // should 274 // behave as if the beacon is "seen" when the mobile device is less than 275 // this 276 // distance away from the beacon. 277 // 278 // Different attachments on the same beacon can have different max 279 // distances. 280 // 281 // Note that even though this value is expressed with fractional 282 // meter 283 // precision, real-world behavior is likley to be much less precise than 284 // one 285 // meter, due to the nature of current Bluetooth radio 286 // technology. 287 // 288 // Optional. When not set or zero, the attachment should be delivered at 289 // the 290 // beacon's outer limit of detection. 291 MaxDistanceMeters float64 `json:"maxDistanceMeters,omitempty"` 292 293 // NamespacedType: Specifies what kind of attachment this is. Tells a 294 // client how to 295 // interpret the `data` field. Format is <var>namespace/type</var>, 296 // for 297 // example <code>scrupulous-wombat-12345/welcome-message</code> 298 NamespacedType string `json:"namespacedType,omitempty"` 299 300 // ForceSendFields is a list of field names (e.g. "Data") to 301 // unconditionally include in API requests. By default, fields with 302 // empty values are omitted from API requests. However, any non-pointer, 303 // non-interface field appearing in ForceSendFields will be sent to the 304 // server regardless of whether the field is empty or not. This may be 305 // used to include empty fields in Patch requests. 306 ForceSendFields []string `json:"-"` 307 308 // NullFields is a list of field names (e.g. "Data") to include in API 309 // requests with the JSON null value. By default, fields with empty 310 // values are omitted from API requests. However, any field with an 311 // empty value appearing in NullFields will be sent to the server as 312 // null. It is an error if a field in this list has a non-empty value. 313 // This may be used to include null fields in Patch requests. 314 NullFields []string `json:"-"` 315} 316 317func (s *AttachmentInfo) MarshalJSON() ([]byte, error) { 318 type NoMethod AttachmentInfo 319 raw := NoMethod(*s) 320 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 321} 322 323func (s *AttachmentInfo) UnmarshalJSON(data []byte) error { 324 type NoMethod AttachmentInfo 325 var s1 struct { 326 MaxDistanceMeters gensupport.JSONFloat64 `json:"maxDistanceMeters"` 327 *NoMethod 328 } 329 s1.NoMethod = (*NoMethod)(s) 330 if err := json.Unmarshal(data, &s1); err != nil { 331 return err 332 } 333 s.MaxDistanceMeters = float64(s1.MaxDistanceMeters) 334 return nil 335} 336 337// Beacon: Details of a beacon device. 338type Beacon struct { 339 // AdvertisedId: The identifier of a beacon as advertised by it. This 340 // field must be 341 // populated when registering. It may be empty when updating a 342 // beacon 343 // record because it is ignored in updates. 344 // 345 // When registering a beacon that broadcasts Eddystone-EID, this 346 // field 347 // should contain a "stable" Eddystone-UID that identifies the beacon 348 // and 349 // links it to its attachments. The stable Eddystone-UID is only used 350 // for 351 // administering the beacon. 352 AdvertisedId *AdvertisedId `json:"advertisedId,omitempty"` 353 354 // BeaconName: Resource name of this beacon. A beacon name has the 355 // format 356 // "beacons/N!beaconId" where the beaconId is the base16 ID broadcast 357 // by 358 // the beacon and N is a code for the beacon's type. Possible values 359 // are 360 // `3` for Eddystone, `1` for iBeacon, or `5` for AltBeacon. 361 // 362 // This field must be left empty when registering. After reading a 363 // beacon, 364 // clients can use the name for future operations. 365 BeaconName string `json:"beaconName,omitempty"` 366 367 // Description: Free text used to identify and describe the beacon. 368 // Maximum length 140 369 // characters. 370 // Optional. 371 Description string `json:"description,omitempty"` 372 373 // EphemeralIdRegistration: Write-only registration parameters for 374 // beacons using Eddystone-EID 375 // (remotely resolved ephemeral ID) format. This information will not 376 // be 377 // populated in API responses. When submitting this data, the 378 // `advertised_id` 379 // field must contain an ID of type Eddystone-UID. Any other ID type 380 // will 381 // result in an error. 382 EphemeralIdRegistration *EphemeralIdRegistration `json:"ephemeralIdRegistration,omitempty"` 383 384 // ExpectedStability: Expected location stability. This is set when the 385 // beacon is registered or 386 // updated, not automatically detected in any way. 387 // Optional. 388 // 389 // Possible values: 390 // "STABILITY_UNSPECIFIED" - Do not use this value. 391 // "STABLE" - Not expected to move, for example a store's front door. 392 // "PORTABLE" - Usually stable but may move rarely, usually within a 393 // single place, 394 // for example a store display. 395 // "MOBILE" - Moves frequently, for example a personal item or food 396 // truck. 397 // "ROVING" - Moves continuously in service, for example a bus or 398 // train. 399 ExpectedStability string `json:"expectedStability,omitempty"` 400 401 // IndoorLevel: The indoor level information for this beacon, if known. 402 // As returned by the 403 // Google Maps API. 404 // Optional. 405 IndoorLevel *IndoorLevel `json:"indoorLevel,omitempty"` 406 407 // LatLng: The location of the beacon, expressed as a latitude and 408 // longitude pair. 409 // This location is given when the beacon is registered or updated. It 410 // does 411 // not necessarily indicate the actual current location of the 412 // beacon. 413 // Optional. 414 LatLng *LatLng `json:"latLng,omitempty"` 415 416 // PlaceId: The [Google Places API](/places/place-id) Place ID of the 417 // place where 418 // the beacon is deployed. This is given when the beacon is registered 419 // or 420 // updated, not automatically detected in any way. 421 // Optional. 422 PlaceId string `json:"placeId,omitempty"` 423 424 // Properties: Properties of the beacon device, for example battery type 425 // or firmware 426 // version. 427 // Optional. 428 Properties map[string]string `json:"properties,omitempty"` 429 430 // ProvisioningKey: Some beacons may require a user to provide an 431 // authorization key before 432 // changing any of its configuration (e.g. broadcast frames, transmit 433 // power). 434 // This field provides a place to store and control access to that 435 // key. 436 // This field is populated in responses to `GET 437 // /v1beta1/beacons/3!beaconId` 438 // from users with write access to the given beacon. That is to say: If 439 // the 440 // user is authorized to write the beacon's confidential data in the 441 // service, 442 // the service considers them authorized to configure the beacon. 443 // Note 444 // that this key grants nothing on the service, only on the beacon 445 // itself. 446 ProvisioningKey string `json:"provisioningKey,omitempty"` 447 448 // Status: Current status of the beacon. 449 // Required. 450 // 451 // Possible values: 452 // "STATUS_UNSPECIFIED" - Do not use this value. 453 // "ACTIVE" - The "normal" in-use state of a beacon. 454 // "DECOMMISSIONED" - Beacon should no longer be used for any purpose. 455 // This is irreversible. 456 // "INACTIVE" - The beacon should not be visible to mobile devices. 457 // This is reversible. 458 Status string `json:"status,omitempty"` 459 460 // ServerResponse contains the HTTP response code and headers from the 461 // server. 462 googleapi.ServerResponse `json:"-"` 463 464 // ForceSendFields is a list of field names (e.g. "AdvertisedId") to 465 // unconditionally include in API requests. By default, fields with 466 // empty values are omitted from API requests. However, any non-pointer, 467 // non-interface field appearing in ForceSendFields will be sent to the 468 // server regardless of whether the field is empty or not. This may be 469 // used to include empty fields in Patch requests. 470 ForceSendFields []string `json:"-"` 471 472 // NullFields is a list of field names (e.g. "AdvertisedId") to include 473 // in API requests with the JSON null value. By default, fields with 474 // empty values are omitted from API requests. However, any field with 475 // an empty value appearing in NullFields will be sent to the server as 476 // null. It is an error if a field in this list has a non-empty value. 477 // This may be used to include null fields in Patch requests. 478 NullFields []string `json:"-"` 479} 480 481func (s *Beacon) MarshalJSON() ([]byte, error) { 482 type NoMethod Beacon 483 raw := NoMethod(*s) 484 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 485} 486 487// BeaconAttachment: Project-specific data associated with a beacon. 488type BeaconAttachment struct { 489 // AttachmentName: Resource name of this attachment. Attachment names 490 // have the 491 // format: 492 // <code>beacons/<var>beacon_id</var>/attachments/<var>attachment 493 // _id</var></code>. 494 // Leave this empty on creation. 495 AttachmentName string `json:"attachmentName,omitempty"` 496 497 // CreationTimeMs: The UTC time when this attachment was created, in 498 // milliseconds since the 499 // UNIX epoch. 500 CreationTimeMs string `json:"creationTimeMs,omitempty"` 501 502 // Data: An opaque data container for client-provided data. Must 503 // be 504 // [base64](http://tools.ietf.org/html/rfc4648#section-4) encoded in 505 // HTTP 506 // requests, and will be so encoded (with padding) in 507 // responses. 508 // Required. 509 Data string `json:"data,omitempty"` 510 511 // MaxDistanceMeters: The distance away from the beacon at which this 512 // attachment should be 513 // delivered to a mobile app. 514 // 515 // Setting this to a value greater than zero indicates that the app 516 // should 517 // behave as if the beacon is "seen" when the mobile device is less than 518 // this 519 // distance away from the beacon. 520 // 521 // Different attachments on the same beacon can have different max 522 // distances. 523 // 524 // Note that even though this value is expressed with fractional 525 // meter 526 // precision, real-world behavior is likley to be much less precise than 527 // one 528 // meter, due to the nature of current Bluetooth radio 529 // technology. 530 // 531 // Optional. When not set or zero, the attachment should be delivered at 532 // the 533 // beacon's outer limit of detection. 534 // 535 // Negative values are invalid and return an error. 536 MaxDistanceMeters float64 `json:"maxDistanceMeters,omitempty"` 537 538 // NamespacedType: Specifies what kind of attachment this is. Tells a 539 // client how to 540 // interpret the `data` field. Format is <var>namespace/type</var>. 541 // Namespace 542 // provides type separation between clients. Type describes the type 543 // of 544 // `data`, for use by the client when parsing the `data` 545 // field. 546 // Required. 547 NamespacedType string `json:"namespacedType,omitempty"` 548 549 // ServerResponse contains the HTTP response code and headers from the 550 // server. 551 googleapi.ServerResponse `json:"-"` 552 553 // ForceSendFields is a list of field names (e.g. "AttachmentName") to 554 // unconditionally include in API requests. By default, fields with 555 // empty values are omitted from API requests. However, any non-pointer, 556 // non-interface field appearing in ForceSendFields will be sent to the 557 // server regardless of whether the field is empty or not. This may be 558 // used to include empty fields in Patch requests. 559 ForceSendFields []string `json:"-"` 560 561 // NullFields is a list of field names (e.g. "AttachmentName") to 562 // include in API requests with the JSON null value. By default, fields 563 // with empty values are omitted from API requests. However, any field 564 // with an empty value appearing in NullFields will be sent to the 565 // server as null. It is an error if a field in this list has a 566 // non-empty value. This may be used to include null fields in Patch 567 // requests. 568 NullFields []string `json:"-"` 569} 570 571func (s *BeaconAttachment) MarshalJSON() ([]byte, error) { 572 type NoMethod BeaconAttachment 573 raw := NoMethod(*s) 574 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 575} 576 577func (s *BeaconAttachment) UnmarshalJSON(data []byte) error { 578 type NoMethod BeaconAttachment 579 var s1 struct { 580 MaxDistanceMeters gensupport.JSONFloat64 `json:"maxDistanceMeters"` 581 *NoMethod 582 } 583 s1.NoMethod = (*NoMethod)(s) 584 if err := json.Unmarshal(data, &s1); err != nil { 585 return err 586 } 587 s.MaxDistanceMeters = float64(s1.MaxDistanceMeters) 588 return nil 589} 590 591// BeaconInfo: A subset of beacon information served via the 592// `beaconinfo.getforobserved` 593// method, which you call when users of your app encounter your beacons. 594type BeaconInfo struct { 595 // AdvertisedId: The ID advertised by the beacon. 596 AdvertisedId *AdvertisedId `json:"advertisedId,omitempty"` 597 598 // Attachments: Attachments matching the type(s) requested. 599 // May be empty if no attachment types were requested. 600 Attachments []*AttachmentInfo `json:"attachments,omitempty"` 601 602 // BeaconName: The name under which the beacon is registered. 603 BeaconName string `json:"beaconName,omitempty"` 604 605 // ForceSendFields is a list of field names (e.g. "AdvertisedId") to 606 // unconditionally include in API requests. By default, fields with 607 // empty values are omitted from API requests. However, any non-pointer, 608 // non-interface field appearing in ForceSendFields will be sent to the 609 // server regardless of whether the field is empty or not. This may be 610 // used to include empty fields in Patch requests. 611 ForceSendFields []string `json:"-"` 612 613 // NullFields is a list of field names (e.g. "AdvertisedId") to include 614 // in API requests with the JSON null value. By default, fields with 615 // empty values are omitted from API requests. However, any field with 616 // an empty value appearing in NullFields will be sent to the server as 617 // null. It is an error if a field in this list has a non-empty value. 618 // This may be used to include null fields in Patch requests. 619 NullFields []string `json:"-"` 620} 621 622func (s *BeaconInfo) MarshalJSON() ([]byte, error) { 623 type NoMethod BeaconInfo 624 raw := NoMethod(*s) 625 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 626} 627 628// Date: Represents a whole or partial calendar date, e.g. a birthday. 629// The time of day 630// and time zone are either specified elsewhere or are not significant. 631// The date 632// is relative to the Proleptic Gregorian Calendar. This can 633// represent: 634// 635// * A full date, with non-zero year, month and day values 636// * A month and day value, with a zero year, e.g. an anniversary 637// * A year on its own, with zero month and day values 638// * A year and month value, with a zero day, e.g. a credit card 639// expiration date 640// 641// Related types are google.type.TimeOfDay and 642// `google.protobuf.Timestamp`. 643type Date struct { 644 // Day: Day of month. Must be from 1 to 31 and valid for the year and 645 // month, or 0 646 // if specifying a year by itself or a year and month where the day is 647 // not 648 // significant. 649 Day int64 `json:"day,omitempty"` 650 651 // Month: Month of year. Must be from 1 to 12, or 0 if specifying a year 652 // without a 653 // month and day. 654 Month int64 `json:"month,omitempty"` 655 656 // Year: Year of date. Must be from 1 to 9999, or 0 if specifying a date 657 // without 658 // a year. 659 Year int64 `json:"year,omitempty"` 660 661 // ForceSendFields is a list of field names (e.g. "Day") to 662 // unconditionally include in API requests. By default, fields with 663 // empty values are omitted from API requests. However, any non-pointer, 664 // non-interface field appearing in ForceSendFields will be sent to the 665 // server regardless of whether the field is empty or not. This may be 666 // used to include empty fields in Patch requests. 667 ForceSendFields []string `json:"-"` 668 669 // NullFields is a list of field names (e.g. "Day") to include in API 670 // requests with the JSON null value. By default, fields with empty 671 // values are omitted from API requests. However, any field with an 672 // empty value appearing in NullFields will be sent to the server as 673 // null. It is an error if a field in this list has a non-empty value. 674 // This may be used to include null fields in Patch requests. 675 NullFields []string `json:"-"` 676} 677 678func (s *Date) MarshalJSON() ([]byte, error) { 679 type NoMethod Date 680 raw := NoMethod(*s) 681 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 682} 683 684// DeleteAttachmentsResponse: Response for a request to delete 685// attachments. 686type DeleteAttachmentsResponse struct { 687 // NumDeleted: The number of attachments that were deleted. 688 NumDeleted int64 `json:"numDeleted,omitempty"` 689 690 // ServerResponse contains the HTTP response code and headers from the 691 // server. 692 googleapi.ServerResponse `json:"-"` 693 694 // ForceSendFields is a list of field names (e.g. "NumDeleted") to 695 // unconditionally include in API requests. By default, fields with 696 // empty values are omitted from API requests. However, any non-pointer, 697 // non-interface field appearing in ForceSendFields will be sent to the 698 // server regardless of whether the field is empty or not. This may be 699 // used to include empty fields in Patch requests. 700 ForceSendFields []string `json:"-"` 701 702 // NullFields is a list of field names (e.g. "NumDeleted") to include in 703 // API requests with the JSON null value. By default, fields with empty 704 // values are omitted from API requests. However, any field with an 705 // empty value appearing in NullFields will be sent to the server as 706 // null. It is an error if a field in this list has a non-empty value. 707 // This may be used to include null fields in Patch requests. 708 NullFields []string `json:"-"` 709} 710 711func (s *DeleteAttachmentsResponse) MarshalJSON() ([]byte, error) { 712 type NoMethod DeleteAttachmentsResponse 713 raw := NoMethod(*s) 714 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 715} 716 717// Diagnostics: Diagnostics for a single beacon. 718type Diagnostics struct { 719 // Alerts: An unordered list of Alerts that the beacon has. 720 // 721 // Possible values: 722 // "ALERT_UNSPECIFIED" - Invalid value. Should never appear. 723 // "WRONG_LOCATION" - The beacon has been reported far from its 724 // expected location (the beacon's 725 // lat_lng field if populated, otherwise, if the beacon's place_id field 726 // is 727 // present, the center of that place). This may indicate that the beacon 728 // has 729 // been moved. This signal is not 100% accurate, but indicates that 730 // further 731 // investigation is worthwhile. 732 // "LOW_BATTERY" - The battery level for the beacon is low enough 733 // that, given the beacon's 734 // current use, its battery will run out with in the next 60 days. 735 // This 736 // indicates that the battery should be replaced soon. 737 // "LOW_ACTIVITY" - The beacon has been reported at a very low rate or 738 // not at all. This may 739 // indicate that the beacon is broken or just that no one has gone near 740 // the 741 // beacon in recent days. If this status appears unexpectedly, the 742 // beacon 743 // owner should investigate further. 744 Alerts []string `json:"alerts,omitempty"` 745 746 // BeaconName: Resource name of the beacon. For Eddystone-EID beacons, 747 // this may 748 // be the beacon's current EID, or the beacon's "stable" Eddystone-UID. 749 BeaconName string `json:"beaconName,omitempty"` 750 751 // EstimatedLowBatteryDate: The date when the battery is expected to be 752 // low. If the value is missing 753 // then there is no estimate for when the battery will be low. 754 // This value is only an estimate, not an exact date. 755 EstimatedLowBatteryDate *Date `json:"estimatedLowBatteryDate,omitempty"` 756 757 // ForceSendFields is a list of field names (e.g. "Alerts") to 758 // unconditionally include in API requests. By default, fields with 759 // empty values are omitted from API requests. However, any non-pointer, 760 // non-interface field appearing in ForceSendFields will be sent to the 761 // server regardless of whether the field is empty or not. This may be 762 // used to include empty fields in Patch requests. 763 ForceSendFields []string `json:"-"` 764 765 // NullFields is a list of field names (e.g. "Alerts") to include in API 766 // requests with the JSON null value. By default, fields with empty 767 // values are omitted from API requests. However, any field with an 768 // empty value appearing in NullFields will be sent to the server as 769 // null. It is an error if a field in this list has a non-empty value. 770 // This may be used to include null fields in Patch requests. 771 NullFields []string `json:"-"` 772} 773 774func (s *Diagnostics) MarshalJSON() ([]byte, error) { 775 type NoMethod Diagnostics 776 raw := NoMethod(*s) 777 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 778} 779 780// Empty: A generic empty message that you can re-use to avoid defining 781// duplicated 782// empty messages in your APIs. A typical example is to use it as the 783// request 784// or the response type of an API method. For instance: 785// 786// service Foo { 787// rpc Bar(google.protobuf.Empty) returns 788// (google.protobuf.Empty); 789// } 790// 791// The JSON representation for `Empty` is empty JSON object `{}`. 792type Empty struct { 793 // ServerResponse contains the HTTP response code and headers from the 794 // server. 795 googleapi.ServerResponse `json:"-"` 796} 797 798// EphemeralIdRegistration: Write-only registration parameters for 799// beacons using Eddystone-EID format. 800// Two ways of securely registering an Eddystone-EID beacon with the 801// service 802// are supported: 803// 804// 1. Perform an ECDH key exchange via this API, including a previous 805// call 806// to `GET /v1beta1/eidparams`. In this case the fields 807// `beacon_ecdh_public_key` and `service_ecdh_public_key` should be 808// populated and `beacon_identity_key` should not be populated. This 809// method ensures that only the two parties in the ECDH key exchange 810// can 811// compute the identity key, which becomes a secret between them. 812// 2. Derive or obtain the beacon's identity key via other secure means 813// (perhaps an ECDH key exchange between the beacon and a mobile 814// device 815// or any other secure method), and then submit the resulting 816// identity key 817// to the service. In this case `beacon_identity_key` field should 818// be 819// populated, and neither of `beacon_ecdh_public_key` nor 820// `service_ecdh_public_key` fields should be. The security of this 821// method 822// depends on how securely the parties involved (in particular the 823// bluetooth client) handle the identity key, and obviously on how 824// securely the identity key was generated. 825// 826// See [the 827// Eddystone 828// specification](https://github.com/google/eddystone/tree/mast 829// er/eddystone-eid) 830// at GitHub. 831type EphemeralIdRegistration struct { 832 // BeaconEcdhPublicKey: The beacon's public key used for the Elliptic 833 // curve Diffie-Hellman 834 // key exchange. When this field is populated, 835 // `service_ecdh_public_key` 836 // must also be populated, and `beacon_identity_key` must not be. 837 BeaconEcdhPublicKey string `json:"beaconEcdhPublicKey,omitempty"` 838 839 // BeaconIdentityKey: The private key of the beacon. If this field is 840 // populated, 841 // `beacon_ecdh_public_key` and `service_ecdh_public_key` must not 842 // be 843 // populated. 844 BeaconIdentityKey string `json:"beaconIdentityKey,omitempty"` 845 846 // InitialClockValue: The initial clock value of the beacon. The 847 // beacon's clock must have 848 // begun counting at this value immediately prior to transmitting 849 // this 850 // value to the resolving service. Significant delay in transmitting 851 // this 852 // value to the service risks registration or resolution failures. If 853 // a 854 // value is not provided, the default is zero. 855 InitialClockValue uint64 `json:"initialClockValue,omitempty,string"` 856 857 // InitialEid: An initial ephemeral ID calculated using the clock value 858 // submitted as 859 // `initial_clock_value`, and the secret key generated by 860 // the 861 // Diffie-Hellman key exchange using `service_ecdh_public_key` 862 // and 863 // `service_ecdh_public_key`. This initial EID value will be used by 864 // the 865 // service to confirm that the key exchange process was successful. 866 InitialEid string `json:"initialEid,omitempty"` 867 868 // RotationPeriodExponent: Indicates the nominal period between each 869 // rotation of the beacon's 870 // ephemeral ID. "Nominal" because the beacon should randomize 871 // the 872 // actual interval. See [the spec 873 // at 874 // github](https://github.com/google/eddystone/tree/master/eddystone-e 875 // id) 876 // for details. This value corresponds to a power-of-two scaler on 877 // the 878 // beacon's clock: when the scaler value is K, the beacon will 879 // begin 880 // broadcasting a new ephemeral ID on average every 2^K seconds. 881 RotationPeriodExponent int64 `json:"rotationPeriodExponent,omitempty"` 882 883 // ServiceEcdhPublicKey: The service's public key used for the Elliptic 884 // curve Diffie-Hellman 885 // key exchange. When this field is populated, 886 // `beacon_ecdh_public_key` 887 // must also be populated, and `beacon_identity_key` must not be. 888 ServiceEcdhPublicKey string `json:"serviceEcdhPublicKey,omitempty"` 889 890 // ForceSendFields is a list of field names (e.g. "BeaconEcdhPublicKey") 891 // to unconditionally include in API requests. By default, fields with 892 // empty values are omitted from API requests. However, any non-pointer, 893 // non-interface field appearing in ForceSendFields will be sent to the 894 // server regardless of whether the field is empty or not. This may be 895 // used to include empty fields in Patch requests. 896 ForceSendFields []string `json:"-"` 897 898 // NullFields is a list of field names (e.g. "BeaconEcdhPublicKey") to 899 // include in API requests with the JSON null value. By default, fields 900 // with empty values are omitted from API requests. However, any field 901 // with an empty value appearing in NullFields will be sent to the 902 // server as null. It is an error if a field in this list has a 903 // non-empty value. This may be used to include null fields in Patch 904 // requests. 905 NullFields []string `json:"-"` 906} 907 908func (s *EphemeralIdRegistration) MarshalJSON() ([]byte, error) { 909 type NoMethod EphemeralIdRegistration 910 raw := NoMethod(*s) 911 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 912} 913 914// EphemeralIdRegistrationParams: Information a client needs to 915// provision and register beacons that 916// broadcast Eddystone-EID format beacon IDs, using Elliptic 917// curve 918// Diffie-Hellman key exchange. See 919// [the 920// Eddystone 921// specification](https://github.com/google/eddystone/tree/mast 922// er/eddystone-eid) 923// at GitHub. 924type EphemeralIdRegistrationParams struct { 925 // MaxRotationPeriodExponent: Indicates the maximum rotation period 926 // supported by the 927 // service. 928 // See 929 // EddystoneEidRegistration.rotation_period_exponent 930 MaxRotationPeriodExponent int64 `json:"maxRotationPeriodExponent,omitempty"` 931 932 // MinRotationPeriodExponent: Indicates the minimum rotation period 933 // supported by the 934 // service. 935 // See 936 // EddystoneEidRegistration.rotation_period_exponent 937 MinRotationPeriodExponent int64 `json:"minRotationPeriodExponent,omitempty"` 938 939 // ServiceEcdhPublicKey: The beacon service's public key for use by a 940 // beacon to derive its 941 // Identity Key using Elliptic Curve Diffie-Hellman key exchange. 942 ServiceEcdhPublicKey string `json:"serviceEcdhPublicKey,omitempty"` 943 944 // ServerResponse contains the HTTP response code and headers from the 945 // server. 946 googleapi.ServerResponse `json:"-"` 947 948 // ForceSendFields is a list of field names (e.g. 949 // "MaxRotationPeriodExponent") to unconditionally include in API 950 // requests. By default, fields with empty values are omitted from API 951 // requests. However, any non-pointer, non-interface field appearing in 952 // ForceSendFields will be sent to the server regardless of whether the 953 // field is empty or not. This may be used to include empty fields in 954 // Patch requests. 955 ForceSendFields []string `json:"-"` 956 957 // NullFields is a list of field names (e.g. 958 // "MaxRotationPeriodExponent") to include in API requests with the JSON 959 // null value. By default, fields with empty values are omitted from API 960 // requests. However, any field with an empty value appearing in 961 // NullFields will be sent to the server as null. It is an error if a 962 // field in this list has a non-empty value. This may be used to include 963 // null fields in Patch requests. 964 NullFields []string `json:"-"` 965} 966 967func (s *EphemeralIdRegistrationParams) MarshalJSON() ([]byte, error) { 968 type NoMethod EphemeralIdRegistrationParams 969 raw := NoMethod(*s) 970 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 971} 972 973// GetInfoForObservedBeaconsRequest: Request for beacon and attachment 974// information about beacons that 975// a mobile client has encountered "in the wild". 976type GetInfoForObservedBeaconsRequest struct { 977 // NamespacedTypes: Specifies what kind of attachments to include in the 978 // response. 979 // When given, the response will include only attachments of the given 980 // types. 981 // When empty, no attachments will be returned. Must be in the 982 // format 983 // <var>namespace/type</var>. Accepts `*` to specify all types in 984 // all namespaces owned by the client. 985 // Optional. 986 NamespacedTypes []string `json:"namespacedTypes,omitempty"` 987 988 // Observations: The beacons that the client has encountered. 989 // At least one must be given. 990 Observations []*Observation `json:"observations,omitempty"` 991 992 // ForceSendFields is a list of field names (e.g. "NamespacedTypes") to 993 // unconditionally include in API requests. By default, fields with 994 // empty values are omitted from API requests. However, any non-pointer, 995 // non-interface field appearing in ForceSendFields will be sent to the 996 // server regardless of whether the field is empty or not. This may be 997 // used to include empty fields in Patch requests. 998 ForceSendFields []string `json:"-"` 999 1000 // NullFields is a list of field names (e.g. "NamespacedTypes") to 1001 // include in API requests with the JSON null value. By default, fields 1002 // with empty values are omitted from API requests. However, any field 1003 // with an empty value appearing in NullFields will be sent to the 1004 // server as null. It is an error if a field in this list has a 1005 // non-empty value. This may be used to include null fields in Patch 1006 // requests. 1007 NullFields []string `json:"-"` 1008} 1009 1010func (s *GetInfoForObservedBeaconsRequest) MarshalJSON() ([]byte, error) { 1011 type NoMethod GetInfoForObservedBeaconsRequest 1012 raw := NoMethod(*s) 1013 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1014} 1015 1016// GetInfoForObservedBeaconsResponse: Information about the requested 1017// beacons, optionally including attachment 1018// data. 1019type GetInfoForObservedBeaconsResponse struct { 1020 // Beacons: Public information about beacons. 1021 // May be empty if the request matched no beacons. 1022 Beacons []*BeaconInfo `json:"beacons,omitempty"` 1023 1024 // ServerResponse contains the HTTP response code and headers from the 1025 // server. 1026 googleapi.ServerResponse `json:"-"` 1027 1028 // ForceSendFields is a list of field names (e.g. "Beacons") to 1029 // unconditionally include in API requests. By default, fields with 1030 // empty values are omitted from API requests. However, any non-pointer, 1031 // non-interface field appearing in ForceSendFields will be sent to the 1032 // server regardless of whether the field is empty or not. This may be 1033 // used to include empty fields in Patch requests. 1034 ForceSendFields []string `json:"-"` 1035 1036 // NullFields is a list of field names (e.g. "Beacons") to include in 1037 // API requests with the JSON null value. By default, fields with empty 1038 // values are omitted from API requests. However, any field with an 1039 // empty value appearing in NullFields will be sent to the server as 1040 // null. It is an error if a field in this list has a non-empty value. 1041 // This may be used to include null fields in Patch requests. 1042 NullFields []string `json:"-"` 1043} 1044 1045func (s *GetInfoForObservedBeaconsResponse) MarshalJSON() ([]byte, error) { 1046 type NoMethod GetInfoForObservedBeaconsResponse 1047 raw := NoMethod(*s) 1048 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1049} 1050 1051// IndoorLevel: Indoor level, a human-readable string as returned by 1052// Google Maps APIs, 1053// useful to indicate which floor of a building a beacon is located on. 1054type IndoorLevel struct { 1055 // Name: The name of this level. 1056 Name string `json:"name,omitempty"` 1057 1058 // ForceSendFields is a list of field names (e.g. "Name") to 1059 // unconditionally include in API requests. By default, fields with 1060 // empty values are omitted from API requests. However, any non-pointer, 1061 // non-interface field appearing in ForceSendFields will be sent to the 1062 // server regardless of whether the field is empty or not. This may be 1063 // used to include empty fields in Patch requests. 1064 ForceSendFields []string `json:"-"` 1065 1066 // NullFields is a list of field names (e.g. "Name") to include in API 1067 // requests with the JSON null value. By default, fields with empty 1068 // values are omitted from API requests. However, any field with an 1069 // empty value appearing in NullFields will be sent to the server as 1070 // null. It is an error if a field in this list has a non-empty value. 1071 // This may be used to include null fields in Patch requests. 1072 NullFields []string `json:"-"` 1073} 1074 1075func (s *IndoorLevel) MarshalJSON() ([]byte, error) { 1076 type NoMethod IndoorLevel 1077 raw := NoMethod(*s) 1078 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1079} 1080 1081// LatLng: An object representing a latitude/longitude pair. This is 1082// expressed as a pair 1083// of doubles representing degrees latitude and degrees longitude. 1084// Unless 1085// specified otherwise, this must conform to the 1086// <a 1087// href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84 1088// st 1089// andard</a>. Values must be within normalized ranges. 1090type LatLng struct { 1091 // Latitude: The latitude in degrees. It must be in the range [-90.0, 1092 // +90.0]. 1093 Latitude float64 `json:"latitude,omitempty"` 1094 1095 // Longitude: The longitude in degrees. It must be in the range [-180.0, 1096 // +180.0]. 1097 Longitude float64 `json:"longitude,omitempty"` 1098 1099 // ForceSendFields is a list of field names (e.g. "Latitude") to 1100 // unconditionally include in API requests. By default, fields with 1101 // empty values are omitted from API requests. However, any non-pointer, 1102 // non-interface field appearing in ForceSendFields will be sent to the 1103 // server regardless of whether the field is empty or not. This may be 1104 // used to include empty fields in Patch requests. 1105 ForceSendFields []string `json:"-"` 1106 1107 // NullFields is a list of field names (e.g. "Latitude") to include in 1108 // API requests with the JSON null value. By default, fields with empty 1109 // values are omitted from API requests. However, any field with an 1110 // empty value appearing in NullFields will be sent to the server as 1111 // null. It is an error if a field in this list has a non-empty value. 1112 // This may be used to include null fields in Patch requests. 1113 NullFields []string `json:"-"` 1114} 1115 1116func (s *LatLng) MarshalJSON() ([]byte, error) { 1117 type NoMethod LatLng 1118 raw := NoMethod(*s) 1119 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1120} 1121 1122func (s *LatLng) UnmarshalJSON(data []byte) error { 1123 type NoMethod LatLng 1124 var s1 struct { 1125 Latitude gensupport.JSONFloat64 `json:"latitude"` 1126 Longitude gensupport.JSONFloat64 `json:"longitude"` 1127 *NoMethod 1128 } 1129 s1.NoMethod = (*NoMethod)(s) 1130 if err := json.Unmarshal(data, &s1); err != nil { 1131 return err 1132 } 1133 s.Latitude = float64(s1.Latitude) 1134 s.Longitude = float64(s1.Longitude) 1135 return nil 1136} 1137 1138// ListBeaconAttachmentsResponse: Response to `ListBeaconAttachments` 1139// that contains the requested attachments. 1140type ListBeaconAttachmentsResponse struct { 1141 // Attachments: The attachments that corresponded to the request params. 1142 Attachments []*BeaconAttachment `json:"attachments,omitempty"` 1143 1144 // ServerResponse contains the HTTP response code and headers from the 1145 // server. 1146 googleapi.ServerResponse `json:"-"` 1147 1148 // ForceSendFields is a list of field names (e.g. "Attachments") to 1149 // unconditionally include in API requests. By default, fields with 1150 // empty values are omitted from API requests. However, any non-pointer, 1151 // non-interface field appearing in ForceSendFields will be sent to the 1152 // server regardless of whether the field is empty or not. This may be 1153 // used to include empty fields in Patch requests. 1154 ForceSendFields []string `json:"-"` 1155 1156 // NullFields is a list of field names (e.g. "Attachments") to include 1157 // in API requests with the JSON null value. By default, fields with 1158 // empty values are omitted from API requests. However, any field with 1159 // an empty value appearing in NullFields will be sent to the server as 1160 // null. It is an error if a field in this list has a non-empty value. 1161 // This may be used to include null fields in Patch requests. 1162 NullFields []string `json:"-"` 1163} 1164 1165func (s *ListBeaconAttachmentsResponse) MarshalJSON() ([]byte, error) { 1166 type NoMethod ListBeaconAttachmentsResponse 1167 raw := NoMethod(*s) 1168 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1169} 1170 1171// ListBeaconsResponse: Response that contains list beacon results and 1172// pagination help. 1173type ListBeaconsResponse struct { 1174 // Beacons: The beacons that matched the search criteria. 1175 Beacons []*Beacon `json:"beacons,omitempty"` 1176 1177 // NextPageToken: An opaque pagination token that the client may provide 1178 // in their next 1179 // request to retrieve the next page of results. 1180 NextPageToken string `json:"nextPageToken,omitempty"` 1181 1182 // TotalCount: Estimate of the total number of beacons matched by the 1183 // query. Higher 1184 // values may be less accurate. 1185 TotalCount int64 `json:"totalCount,omitempty,string"` 1186 1187 // ServerResponse contains the HTTP response code and headers from the 1188 // server. 1189 googleapi.ServerResponse `json:"-"` 1190 1191 // ForceSendFields is a list of field names (e.g. "Beacons") to 1192 // unconditionally include in API requests. By default, fields with 1193 // empty values are omitted from API requests. However, any non-pointer, 1194 // non-interface field appearing in ForceSendFields will be sent to the 1195 // server regardless of whether the field is empty or not. This may be 1196 // used to include empty fields in Patch requests. 1197 ForceSendFields []string `json:"-"` 1198 1199 // NullFields is a list of field names (e.g. "Beacons") to include in 1200 // API requests with the JSON null value. By default, fields with empty 1201 // values are omitted from API requests. However, any field with an 1202 // empty value appearing in NullFields will be sent to the server as 1203 // null. It is an error if a field in this list has a non-empty value. 1204 // This may be used to include null fields in Patch requests. 1205 NullFields []string `json:"-"` 1206} 1207 1208func (s *ListBeaconsResponse) MarshalJSON() ([]byte, error) { 1209 type NoMethod ListBeaconsResponse 1210 raw := NoMethod(*s) 1211 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1212} 1213 1214// ListDiagnosticsResponse: Response that contains the requested 1215// diagnostics. 1216type ListDiagnosticsResponse struct { 1217 // Diagnostics: The diagnostics matching the given request. 1218 Diagnostics []*Diagnostics `json:"diagnostics,omitempty"` 1219 1220 // NextPageToken: Token that can be used for pagination. Returned only 1221 // if the 1222 // request matches more beacons than can be returned in this response. 1223 NextPageToken string `json:"nextPageToken,omitempty"` 1224 1225 // ServerResponse contains the HTTP response code and headers from the 1226 // server. 1227 googleapi.ServerResponse `json:"-"` 1228 1229 // ForceSendFields is a list of field names (e.g. "Diagnostics") to 1230 // unconditionally include in API requests. By default, fields with 1231 // empty values are omitted from API requests. However, any non-pointer, 1232 // non-interface field appearing in ForceSendFields will be sent to the 1233 // server regardless of whether the field is empty or not. This may be 1234 // used to include empty fields in Patch requests. 1235 ForceSendFields []string `json:"-"` 1236 1237 // NullFields is a list of field names (e.g. "Diagnostics") to include 1238 // in API requests with the JSON null value. By default, fields with 1239 // empty values are omitted from API requests. However, any field with 1240 // an empty value appearing in NullFields will be sent to the server as 1241 // null. It is an error if a field in this list has a non-empty value. 1242 // This may be used to include null fields in Patch requests. 1243 NullFields []string `json:"-"` 1244} 1245 1246func (s *ListDiagnosticsResponse) MarshalJSON() ([]byte, error) { 1247 type NoMethod ListDiagnosticsResponse 1248 raw := NoMethod(*s) 1249 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1250} 1251 1252// ListNamespacesResponse: Response to ListNamespacesRequest that 1253// contains all the project's namespaces. 1254type ListNamespacesResponse struct { 1255 // Namespaces: The attachments that corresponded to the request params. 1256 Namespaces []*Namespace `json:"namespaces,omitempty"` 1257 1258 // ServerResponse contains the HTTP response code and headers from the 1259 // server. 1260 googleapi.ServerResponse `json:"-"` 1261 1262 // ForceSendFields is a list of field names (e.g. "Namespaces") to 1263 // unconditionally include in API requests. By default, fields with 1264 // empty values are omitted from API requests. However, any non-pointer, 1265 // non-interface field appearing in ForceSendFields will be sent to the 1266 // server regardless of whether the field is empty or not. This may be 1267 // used to include empty fields in Patch requests. 1268 ForceSendFields []string `json:"-"` 1269 1270 // NullFields is a list of field names (e.g. "Namespaces") to include in 1271 // API requests with the JSON null value. By default, fields with empty 1272 // values are omitted from API requests. However, any field with an 1273 // empty value appearing in NullFields will be sent to the server as 1274 // null. It is an error if a field in this list has a non-empty value. 1275 // This may be used to include null fields in Patch requests. 1276 NullFields []string `json:"-"` 1277} 1278 1279func (s *ListNamespacesResponse) MarshalJSON() ([]byte, error) { 1280 type NoMethod ListNamespacesResponse 1281 raw := NoMethod(*s) 1282 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1283} 1284 1285// Namespace: An attachment namespace defines read and write access for 1286// all the attachments 1287// created under it. Each namespace is globally unique, and owned by 1288// one 1289// project which is the only project that can create attachments under 1290// it. 1291type Namespace struct { 1292 // NamespaceName: Resource name of this namespace. Namespaces names have 1293 // the format: 1294 // <code>namespaces/<var>namespace</var></code>. 1295 NamespaceName string `json:"namespaceName,omitempty"` 1296 1297 // ServingVisibility: Specifies what clients may receive attachments 1298 // under this namespace 1299 // via `beaconinfo.getforobserved`. 1300 // 1301 // Possible values: 1302 // "VISIBILITY_UNSPECIFIED" - Do not use this value. 1303 // "UNLISTED" - Served only to the project that owns the namespace. 1304 // "PUBLIC" - Any project can subscribe to attachments under the 1305 // namespace. 1306 ServingVisibility string `json:"servingVisibility,omitempty"` 1307 1308 // ServerResponse contains the HTTP response code and headers from the 1309 // server. 1310 googleapi.ServerResponse `json:"-"` 1311 1312 // ForceSendFields is a list of field names (e.g. "NamespaceName") to 1313 // unconditionally include in API requests. By default, fields with 1314 // empty values are omitted from API requests. However, any non-pointer, 1315 // non-interface field appearing in ForceSendFields will be sent to the 1316 // server regardless of whether the field is empty or not. This may be 1317 // used to include empty fields in Patch requests. 1318 ForceSendFields []string `json:"-"` 1319 1320 // NullFields is a list of field names (e.g. "NamespaceName") to include 1321 // in API requests with the JSON null value. By default, fields with 1322 // empty values are omitted from API requests. However, any field with 1323 // an empty value appearing in NullFields will be sent to the server as 1324 // null. It is an error if a field in this list has a non-empty value. 1325 // This may be used to include null fields in Patch requests. 1326 NullFields []string `json:"-"` 1327} 1328 1329func (s *Namespace) MarshalJSON() ([]byte, error) { 1330 type NoMethod Namespace 1331 raw := NoMethod(*s) 1332 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1333} 1334 1335// Observation: Represents one beacon observed once. 1336type Observation struct { 1337 // AdvertisedId: The ID advertised by the beacon the client has 1338 // encountered. 1339 // 1340 // If the submitted `advertised_id` type is Eddystone-EID, then the 1341 // client 1342 // must be authorized to resolve the given beacon. Otherwise no data 1343 // will be 1344 // returned for that beacon. 1345 // Required. 1346 AdvertisedId *AdvertisedId `json:"advertisedId,omitempty"` 1347 1348 // Telemetry: The array of telemetry bytes received from the beacon. The 1349 // server is 1350 // responsible for parsing it. This field may frequently be empty, 1351 // as 1352 // with a beacon that transmits telemetry only occasionally. 1353 Telemetry string `json:"telemetry,omitempty"` 1354 1355 // TimestampMs: Time when the beacon was observed. 1356 TimestampMs string `json:"timestampMs,omitempty"` 1357 1358 // ForceSendFields is a list of field names (e.g. "AdvertisedId") to 1359 // unconditionally include in API requests. By default, fields with 1360 // empty values are omitted from API requests. However, any non-pointer, 1361 // non-interface field appearing in ForceSendFields will be sent to the 1362 // server regardless of whether the field is empty or not. This may be 1363 // used to include empty fields in Patch requests. 1364 ForceSendFields []string `json:"-"` 1365 1366 // NullFields is a list of field names (e.g. "AdvertisedId") to include 1367 // in API requests with the JSON null value. By default, fields with 1368 // empty values are omitted from API requests. However, any field with 1369 // an empty value appearing in NullFields will be sent to the server as 1370 // null. It is an error if a field in this list has a non-empty value. 1371 // This may be used to include null fields in Patch requests. 1372 NullFields []string `json:"-"` 1373} 1374 1375func (s *Observation) MarshalJSON() ([]byte, error) { 1376 type NoMethod Observation 1377 raw := NoMethod(*s) 1378 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1379} 1380 1381// method id "proximitybeacon.beaconinfo.getforobserved": 1382 1383type BeaconinfoGetforobservedCall struct { 1384 s *Service 1385 getinfoforobservedbeaconsrequest *GetInfoForObservedBeaconsRequest 1386 urlParams_ gensupport.URLParams 1387 ctx_ context.Context 1388 header_ http.Header 1389} 1390 1391// Getforobserved: Given one or more beacon observations, returns any 1392// beacon information 1393// and attachments accessible to your application. Authorize by using 1394// the 1395// [API 1396// key](https://developers.google.com/beacons/proximity/get-star 1397// ted#request_a_browser_api_key) 1398// for the application. 1399func (r *BeaconinfoService) Getforobserved(getinfoforobservedbeaconsrequest *GetInfoForObservedBeaconsRequest) *BeaconinfoGetforobservedCall { 1400 c := &BeaconinfoGetforobservedCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1401 c.getinfoforobservedbeaconsrequest = getinfoforobservedbeaconsrequest 1402 return c 1403} 1404 1405// Fields allows partial responses to be retrieved. See 1406// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1407// for more information. 1408func (c *BeaconinfoGetforobservedCall) Fields(s ...googleapi.Field) *BeaconinfoGetforobservedCall { 1409 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1410 return c 1411} 1412 1413// Context sets the context to be used in this call's Do method. Any 1414// pending HTTP request will be aborted if the provided context is 1415// canceled. 1416func (c *BeaconinfoGetforobservedCall) Context(ctx context.Context) *BeaconinfoGetforobservedCall { 1417 c.ctx_ = ctx 1418 return c 1419} 1420 1421// Header returns an http.Header that can be modified by the caller to 1422// add HTTP headers to the request. 1423func (c *BeaconinfoGetforobservedCall) Header() http.Header { 1424 if c.header_ == nil { 1425 c.header_ = make(http.Header) 1426 } 1427 return c.header_ 1428} 1429 1430func (c *BeaconinfoGetforobservedCall) doRequest(alt string) (*http.Response, error) { 1431 reqHeaders := make(http.Header) 1432 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317") 1433 for k, v := range c.header_ { 1434 reqHeaders[k] = v 1435 } 1436 reqHeaders.Set("User-Agent", c.s.userAgent()) 1437 var body io.Reader = nil 1438 body, err := googleapi.WithoutDataWrapper.JSONReader(c.getinfoforobservedbeaconsrequest) 1439 if err != nil { 1440 return nil, err 1441 } 1442 reqHeaders.Set("Content-Type", "application/json") 1443 c.urlParams_.Set("alt", alt) 1444 c.urlParams_.Set("prettyPrint", "false") 1445 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/beaconinfo:getforobserved") 1446 urls += "?" + c.urlParams_.Encode() 1447 req, err := http.NewRequest("POST", urls, body) 1448 if err != nil { 1449 return nil, err 1450 } 1451 req.Header = reqHeaders 1452 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1453} 1454 1455// Do executes the "proximitybeacon.beaconinfo.getforobserved" call. 1456// Exactly one of *GetInfoForObservedBeaconsResponse or error will be 1457// non-nil. Any non-2xx status code is an error. Response headers are in 1458// either *GetInfoForObservedBeaconsResponse.ServerResponse.Header or 1459// (if a response was returned at all) in 1460// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 1461// whether the returned error was because http.StatusNotModified was 1462// returned. 1463func (c *BeaconinfoGetforobservedCall) Do(opts ...googleapi.CallOption) (*GetInfoForObservedBeaconsResponse, error) { 1464 gensupport.SetOptions(c.urlParams_, opts...) 1465 res, err := c.doRequest("json") 1466 if res != nil && res.StatusCode == http.StatusNotModified { 1467 if res.Body != nil { 1468 res.Body.Close() 1469 } 1470 return nil, &googleapi.Error{ 1471 Code: res.StatusCode, 1472 Header: res.Header, 1473 } 1474 } 1475 if err != nil { 1476 return nil, err 1477 } 1478 defer googleapi.CloseBody(res) 1479 if err := googleapi.CheckResponse(res); err != nil { 1480 return nil, err 1481 } 1482 ret := &GetInfoForObservedBeaconsResponse{ 1483 ServerResponse: googleapi.ServerResponse{ 1484 Header: res.Header, 1485 HTTPStatusCode: res.StatusCode, 1486 }, 1487 } 1488 target := &ret 1489 if err := gensupport.DecodeResponse(target, res); err != nil { 1490 return nil, err 1491 } 1492 return ret, nil 1493 // { 1494 // "description": "Given one or more beacon observations, returns any beacon information\nand attachments accessible to your application. Authorize by using the\n[API\nkey](https://developers.google.com/beacons/proximity/get-started#request_a_browser_api_key)\nfor the application.", 1495 // "flatPath": "v1beta1/beaconinfo:getforobserved", 1496 // "httpMethod": "POST", 1497 // "id": "proximitybeacon.beaconinfo.getforobserved", 1498 // "parameterOrder": [], 1499 // "parameters": {}, 1500 // "path": "v1beta1/beaconinfo:getforobserved", 1501 // "request": { 1502 // "$ref": "GetInfoForObservedBeaconsRequest" 1503 // }, 1504 // "response": { 1505 // "$ref": "GetInfoForObservedBeaconsResponse" 1506 // } 1507 // } 1508 1509} 1510 1511// method id "proximitybeacon.beacons.activate": 1512 1513type BeaconsActivateCall struct { 1514 s *Service 1515 beaconName string 1516 urlParams_ gensupport.URLParams 1517 ctx_ context.Context 1518 header_ http.Header 1519} 1520 1521// Activate: Activates a beacon. A beacon that is active will return 1522// information 1523// and attachment data when queried via 1524// `beaconinfo.getforobserved`. 1525// Calling this method on an already active beacon will do nothing 1526// (but 1527// will return a successful response code). 1528// 1529// Authenticate using an [OAuth 1530// access 1531// token](https://developers.google.com/identity/protocols/OAuth2) 1532// from a 1533// signed-in user with **Is owner** or **Can edit** permissions in the 1534// Google 1535// Developers Console project. 1536func (r *BeaconsService) Activate(beaconName string) *BeaconsActivateCall { 1537 c := &BeaconsActivateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1538 c.beaconName = beaconName 1539 return c 1540} 1541 1542// ProjectId sets the optional parameter "projectId": The project id of 1543// the beacon to activate. If the project id is not 1544// specified then the project making the request is used. The project 1545// id 1546// must match the project that owns the beacon. 1547func (c *BeaconsActivateCall) ProjectId(projectId string) *BeaconsActivateCall { 1548 c.urlParams_.Set("projectId", projectId) 1549 return c 1550} 1551 1552// Fields allows partial responses to be retrieved. See 1553// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1554// for more information. 1555func (c *BeaconsActivateCall) Fields(s ...googleapi.Field) *BeaconsActivateCall { 1556 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1557 return c 1558} 1559 1560// Context sets the context to be used in this call's Do method. Any 1561// pending HTTP request will be aborted if the provided context is 1562// canceled. 1563func (c *BeaconsActivateCall) Context(ctx context.Context) *BeaconsActivateCall { 1564 c.ctx_ = ctx 1565 return c 1566} 1567 1568// Header returns an http.Header that can be modified by the caller to 1569// add HTTP headers to the request. 1570func (c *BeaconsActivateCall) Header() http.Header { 1571 if c.header_ == nil { 1572 c.header_ = make(http.Header) 1573 } 1574 return c.header_ 1575} 1576 1577func (c *BeaconsActivateCall) doRequest(alt string) (*http.Response, error) { 1578 reqHeaders := make(http.Header) 1579 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317") 1580 for k, v := range c.header_ { 1581 reqHeaders[k] = v 1582 } 1583 reqHeaders.Set("User-Agent", c.s.userAgent()) 1584 var body io.Reader = nil 1585 c.urlParams_.Set("alt", alt) 1586 c.urlParams_.Set("prettyPrint", "false") 1587 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+beaconName}:activate") 1588 urls += "?" + c.urlParams_.Encode() 1589 req, err := http.NewRequest("POST", urls, body) 1590 if err != nil { 1591 return nil, err 1592 } 1593 req.Header = reqHeaders 1594 googleapi.Expand(req.URL, map[string]string{ 1595 "beaconName": c.beaconName, 1596 }) 1597 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1598} 1599 1600// Do executes the "proximitybeacon.beacons.activate" call. 1601// Exactly one of *Empty or error will be non-nil. Any non-2xx status 1602// code is an error. Response headers are in either 1603// *Empty.ServerResponse.Header or (if a response was returned at all) 1604// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 1605// check whether the returned error was because http.StatusNotModified 1606// was returned. 1607func (c *BeaconsActivateCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 1608 gensupport.SetOptions(c.urlParams_, opts...) 1609 res, err := c.doRequest("json") 1610 if res != nil && res.StatusCode == http.StatusNotModified { 1611 if res.Body != nil { 1612 res.Body.Close() 1613 } 1614 return nil, &googleapi.Error{ 1615 Code: res.StatusCode, 1616 Header: res.Header, 1617 } 1618 } 1619 if err != nil { 1620 return nil, err 1621 } 1622 defer googleapi.CloseBody(res) 1623 if err := googleapi.CheckResponse(res); err != nil { 1624 return nil, err 1625 } 1626 ret := &Empty{ 1627 ServerResponse: googleapi.ServerResponse{ 1628 Header: res.Header, 1629 HTTPStatusCode: res.StatusCode, 1630 }, 1631 } 1632 target := &ret 1633 if err := gensupport.DecodeResponse(target, res); err != nil { 1634 return nil, err 1635 } 1636 return ret, nil 1637 // { 1638 // "description": "Activates a beacon. A beacon that is active will return information\nand attachment data when queried via `beaconinfo.getforobserved`.\nCalling this method on an already active beacon will do nothing (but\nwill return a successful response code).\n\nAuthenticate using an [OAuth access\ntoken](https://developers.google.com/identity/protocols/OAuth2) from a\nsigned-in user with **Is owner** or **Can edit** permissions in the Google\nDevelopers Console project.", 1639 // "flatPath": "v1beta1/beacons/{beaconsId}:activate", 1640 // "httpMethod": "POST", 1641 // "id": "proximitybeacon.beacons.activate", 1642 // "parameterOrder": [ 1643 // "beaconName" 1644 // ], 1645 // "parameters": { 1646 // "beaconName": { 1647 // "description": "Beacon that should be activated. A beacon name has the format\n\"beacons/N!beaconId\" where the beaconId is the base16 ID broadcast by\nthe beacon and N is a code for the beacon's type. Possible values are\n`3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5`\nfor AltBeacon. For Eddystone-EID beacons, you may use either the\ncurrent EID or the beacon's \"stable\" UID.\nRequired.", 1648 // "location": "path", 1649 // "pattern": "^beacons/[^/]+$", 1650 // "required": true, 1651 // "type": "string" 1652 // }, 1653 // "projectId": { 1654 // "description": "The project id of the beacon to activate. If the project id is not\nspecified then the project making the request is used. The project id\nmust match the project that owns the beacon.\nOptional.", 1655 // "location": "query", 1656 // "type": "string" 1657 // } 1658 // }, 1659 // "path": "v1beta1/{+beaconName}:activate", 1660 // "response": { 1661 // "$ref": "Empty" 1662 // }, 1663 // "scopes": [ 1664 // "https://www.googleapis.com/auth/userlocation.beacon.registry" 1665 // ] 1666 // } 1667 1668} 1669 1670// method id "proximitybeacon.beacons.deactivate": 1671 1672type BeaconsDeactivateCall struct { 1673 s *Service 1674 beaconName string 1675 urlParams_ gensupport.URLParams 1676 ctx_ context.Context 1677 header_ http.Header 1678} 1679 1680// Deactivate: Deactivates a beacon. Once deactivated, the API will not 1681// return 1682// information nor attachment data for the beacon when queried 1683// via 1684// `beaconinfo.getforobserved`. Calling this method on an already 1685// inactive 1686// beacon will do nothing (but will return a successful response 1687// code). 1688// 1689// Authenticate using an [OAuth 1690// access 1691// token](https://developers.google.com/identity/protocols/OAuth2) 1692// from a 1693// signed-in user with **Is owner** or **Can edit** permissions in the 1694// Google 1695// Developers Console project. 1696func (r *BeaconsService) Deactivate(beaconName string) *BeaconsDeactivateCall { 1697 c := &BeaconsDeactivateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1698 c.beaconName = beaconName 1699 return c 1700} 1701 1702// ProjectId sets the optional parameter "projectId": The project id of 1703// the beacon to deactivate. If the project id is not 1704// specified then the project making the request is used. The project id 1705// must 1706// match the project that owns the beacon. 1707func (c *BeaconsDeactivateCall) ProjectId(projectId string) *BeaconsDeactivateCall { 1708 c.urlParams_.Set("projectId", projectId) 1709 return c 1710} 1711 1712// Fields allows partial responses to be retrieved. See 1713// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1714// for more information. 1715func (c *BeaconsDeactivateCall) Fields(s ...googleapi.Field) *BeaconsDeactivateCall { 1716 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1717 return c 1718} 1719 1720// Context sets the context to be used in this call's Do method. Any 1721// pending HTTP request will be aborted if the provided context is 1722// canceled. 1723func (c *BeaconsDeactivateCall) Context(ctx context.Context) *BeaconsDeactivateCall { 1724 c.ctx_ = ctx 1725 return c 1726} 1727 1728// Header returns an http.Header that can be modified by the caller to 1729// add HTTP headers to the request. 1730func (c *BeaconsDeactivateCall) Header() http.Header { 1731 if c.header_ == nil { 1732 c.header_ = make(http.Header) 1733 } 1734 return c.header_ 1735} 1736 1737func (c *BeaconsDeactivateCall) doRequest(alt string) (*http.Response, error) { 1738 reqHeaders := make(http.Header) 1739 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317") 1740 for k, v := range c.header_ { 1741 reqHeaders[k] = v 1742 } 1743 reqHeaders.Set("User-Agent", c.s.userAgent()) 1744 var body io.Reader = nil 1745 c.urlParams_.Set("alt", alt) 1746 c.urlParams_.Set("prettyPrint", "false") 1747 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+beaconName}:deactivate") 1748 urls += "?" + c.urlParams_.Encode() 1749 req, err := http.NewRequest("POST", urls, body) 1750 if err != nil { 1751 return nil, err 1752 } 1753 req.Header = reqHeaders 1754 googleapi.Expand(req.URL, map[string]string{ 1755 "beaconName": c.beaconName, 1756 }) 1757 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1758} 1759 1760// Do executes the "proximitybeacon.beacons.deactivate" call. 1761// Exactly one of *Empty or error will be non-nil. Any non-2xx status 1762// code is an error. Response headers are in either 1763// *Empty.ServerResponse.Header or (if a response was returned at all) 1764// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 1765// check whether the returned error was because http.StatusNotModified 1766// was returned. 1767func (c *BeaconsDeactivateCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 1768 gensupport.SetOptions(c.urlParams_, opts...) 1769 res, err := c.doRequest("json") 1770 if res != nil && res.StatusCode == http.StatusNotModified { 1771 if res.Body != nil { 1772 res.Body.Close() 1773 } 1774 return nil, &googleapi.Error{ 1775 Code: res.StatusCode, 1776 Header: res.Header, 1777 } 1778 } 1779 if err != nil { 1780 return nil, err 1781 } 1782 defer googleapi.CloseBody(res) 1783 if err := googleapi.CheckResponse(res); err != nil { 1784 return nil, err 1785 } 1786 ret := &Empty{ 1787 ServerResponse: googleapi.ServerResponse{ 1788 Header: res.Header, 1789 HTTPStatusCode: res.StatusCode, 1790 }, 1791 } 1792 target := &ret 1793 if err := gensupport.DecodeResponse(target, res); err != nil { 1794 return nil, err 1795 } 1796 return ret, nil 1797 // { 1798 // "description": "Deactivates a beacon. Once deactivated, the API will not return\ninformation nor attachment data for the beacon when queried via\n`beaconinfo.getforobserved`. Calling this method on an already inactive\nbeacon will do nothing (but will return a successful response code).\n\nAuthenticate using an [OAuth access\ntoken](https://developers.google.com/identity/protocols/OAuth2) from a\nsigned-in user with **Is owner** or **Can edit** permissions in the Google\nDevelopers Console project.", 1799 // "flatPath": "v1beta1/beacons/{beaconsId}:deactivate", 1800 // "httpMethod": "POST", 1801 // "id": "proximitybeacon.beacons.deactivate", 1802 // "parameterOrder": [ 1803 // "beaconName" 1804 // ], 1805 // "parameters": { 1806 // "beaconName": { 1807 // "description": "Beacon that should be deactivated. A beacon name has the format\n\"beacons/N!beaconId\" where the beaconId is the base16 ID broadcast by\nthe beacon and N is a code for the beacon's type. Possible values are\n`3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5`\nfor AltBeacon. For Eddystone-EID beacons, you may use either the\ncurrent EID or the beacon's \"stable\" UID.\nRequired.", 1808 // "location": "path", 1809 // "pattern": "^beacons/[^/]+$", 1810 // "required": true, 1811 // "type": "string" 1812 // }, 1813 // "projectId": { 1814 // "description": "The project id of the beacon to deactivate. If the project id is not\nspecified then the project making the request is used. The project id must\nmatch the project that owns the beacon.\nOptional.", 1815 // "location": "query", 1816 // "type": "string" 1817 // } 1818 // }, 1819 // "path": "v1beta1/{+beaconName}:deactivate", 1820 // "response": { 1821 // "$ref": "Empty" 1822 // }, 1823 // "scopes": [ 1824 // "https://www.googleapis.com/auth/userlocation.beacon.registry" 1825 // ] 1826 // } 1827 1828} 1829 1830// method id "proximitybeacon.beacons.decommission": 1831 1832type BeaconsDecommissionCall struct { 1833 s *Service 1834 beaconName string 1835 urlParams_ gensupport.URLParams 1836 ctx_ context.Context 1837 header_ http.Header 1838} 1839 1840// Decommission: Decommissions the specified beacon in the service. This 1841// beacon will no 1842// longer be returned from `beaconinfo.getforobserved`. This operation 1843// is 1844// permanent -- you will not be able to re-register a beacon with this 1845// ID 1846// again. 1847// 1848// Authenticate using an [OAuth 1849// access 1850// token](https://developers.google.com/identity/protocols/OAuth2) 1851// from a 1852// signed-in user with **Is owner** or **Can edit** permissions in the 1853// Google 1854// Developers Console project. 1855func (r *BeaconsService) Decommission(beaconName string) *BeaconsDecommissionCall { 1856 c := &BeaconsDecommissionCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1857 c.beaconName = beaconName 1858 return c 1859} 1860 1861// ProjectId sets the optional parameter "projectId": The project id of 1862// the beacon to decommission. If the project id is not 1863// specified then the project making the request is used. The project 1864// id 1865// must match the project that owns the beacon. 1866func (c *BeaconsDecommissionCall) ProjectId(projectId string) *BeaconsDecommissionCall { 1867 c.urlParams_.Set("projectId", projectId) 1868 return c 1869} 1870 1871// Fields allows partial responses to be retrieved. See 1872// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1873// for more information. 1874func (c *BeaconsDecommissionCall) Fields(s ...googleapi.Field) *BeaconsDecommissionCall { 1875 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1876 return c 1877} 1878 1879// Context sets the context to be used in this call's Do method. Any 1880// pending HTTP request will be aborted if the provided context is 1881// canceled. 1882func (c *BeaconsDecommissionCall) Context(ctx context.Context) *BeaconsDecommissionCall { 1883 c.ctx_ = ctx 1884 return c 1885} 1886 1887// Header returns an http.Header that can be modified by the caller to 1888// add HTTP headers to the request. 1889func (c *BeaconsDecommissionCall) Header() http.Header { 1890 if c.header_ == nil { 1891 c.header_ = make(http.Header) 1892 } 1893 return c.header_ 1894} 1895 1896func (c *BeaconsDecommissionCall) doRequest(alt string) (*http.Response, error) { 1897 reqHeaders := make(http.Header) 1898 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317") 1899 for k, v := range c.header_ { 1900 reqHeaders[k] = v 1901 } 1902 reqHeaders.Set("User-Agent", c.s.userAgent()) 1903 var body io.Reader = nil 1904 c.urlParams_.Set("alt", alt) 1905 c.urlParams_.Set("prettyPrint", "false") 1906 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+beaconName}:decommission") 1907 urls += "?" + c.urlParams_.Encode() 1908 req, err := http.NewRequest("POST", urls, body) 1909 if err != nil { 1910 return nil, err 1911 } 1912 req.Header = reqHeaders 1913 googleapi.Expand(req.URL, map[string]string{ 1914 "beaconName": c.beaconName, 1915 }) 1916 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1917} 1918 1919// Do executes the "proximitybeacon.beacons.decommission" call. 1920// Exactly one of *Empty or error will be non-nil. Any non-2xx status 1921// code is an error. Response headers are in either 1922// *Empty.ServerResponse.Header or (if a response was returned at all) 1923// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 1924// check whether the returned error was because http.StatusNotModified 1925// was returned. 1926func (c *BeaconsDecommissionCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 1927 gensupport.SetOptions(c.urlParams_, opts...) 1928 res, err := c.doRequest("json") 1929 if res != nil && res.StatusCode == http.StatusNotModified { 1930 if res.Body != nil { 1931 res.Body.Close() 1932 } 1933 return nil, &googleapi.Error{ 1934 Code: res.StatusCode, 1935 Header: res.Header, 1936 } 1937 } 1938 if err != nil { 1939 return nil, err 1940 } 1941 defer googleapi.CloseBody(res) 1942 if err := googleapi.CheckResponse(res); err != nil { 1943 return nil, err 1944 } 1945 ret := &Empty{ 1946 ServerResponse: googleapi.ServerResponse{ 1947 Header: res.Header, 1948 HTTPStatusCode: res.StatusCode, 1949 }, 1950 } 1951 target := &ret 1952 if err := gensupport.DecodeResponse(target, res); err != nil { 1953 return nil, err 1954 } 1955 return ret, nil 1956 // { 1957 // "description": "Decommissions the specified beacon in the service. This beacon will no\nlonger be returned from `beaconinfo.getforobserved`. This operation is\npermanent -- you will not be able to re-register a beacon with this ID\nagain.\n\nAuthenticate using an [OAuth access\ntoken](https://developers.google.com/identity/protocols/OAuth2) from a\nsigned-in user with **Is owner** or **Can edit** permissions in the Google\nDevelopers Console project.", 1958 // "flatPath": "v1beta1/beacons/{beaconsId}:decommission", 1959 // "httpMethod": "POST", 1960 // "id": "proximitybeacon.beacons.decommission", 1961 // "parameterOrder": [ 1962 // "beaconName" 1963 // ], 1964 // "parameters": { 1965 // "beaconName": { 1966 // "description": "Beacon that should be decommissioned. A beacon name has the format\n\"beacons/N!beaconId\" where the beaconId is the base16 ID broadcast by\nthe beacon and N is a code for the beacon's type. Possible values are\n`3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5`\nfor AltBeacon. For Eddystone-EID beacons, you may use either the\ncurrent EID of the beacon's \"stable\" UID.\nRequired.", 1967 // "location": "path", 1968 // "pattern": "^beacons/[^/]+$", 1969 // "required": true, 1970 // "type": "string" 1971 // }, 1972 // "projectId": { 1973 // "description": "The project id of the beacon to decommission. If the project id is not\nspecified then the project making the request is used. The project id\nmust match the project that owns the beacon.\nOptional.", 1974 // "location": "query", 1975 // "type": "string" 1976 // } 1977 // }, 1978 // "path": "v1beta1/{+beaconName}:decommission", 1979 // "response": { 1980 // "$ref": "Empty" 1981 // }, 1982 // "scopes": [ 1983 // "https://www.googleapis.com/auth/userlocation.beacon.registry" 1984 // ] 1985 // } 1986 1987} 1988 1989// method id "proximitybeacon.beacons.delete": 1990 1991type BeaconsDeleteCall struct { 1992 s *Service 1993 beaconName string 1994 urlParams_ gensupport.URLParams 1995 ctx_ context.Context 1996 header_ http.Header 1997} 1998 1999// Delete: Deletes the specified beacon including all diagnostics data 2000// for the beacon 2001// as well as any attachments on the beacon (including those belonging 2002// to 2003// other projects). This operation cannot be undone. 2004// 2005// Authenticate using an [OAuth 2006// access 2007// token](https://developers.google.com/identity/protocols/OAuth2) 2008// from a 2009// signed-in user with **Is owner** or **Can edit** permissions in the 2010// Google 2011// Developers Console project. 2012func (r *BeaconsService) Delete(beaconName string) *BeaconsDeleteCall { 2013 c := &BeaconsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2014 c.beaconName = beaconName 2015 return c 2016} 2017 2018// ProjectId sets the optional parameter "projectId": The project id of 2019// the beacon to delete. If not provided, the project 2020// that is making the request is used. 2021func (c *BeaconsDeleteCall) ProjectId(projectId string) *BeaconsDeleteCall { 2022 c.urlParams_.Set("projectId", projectId) 2023 return c 2024} 2025 2026// Fields allows partial responses to be retrieved. See 2027// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2028// for more information. 2029func (c *BeaconsDeleteCall) Fields(s ...googleapi.Field) *BeaconsDeleteCall { 2030 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2031 return c 2032} 2033 2034// Context sets the context to be used in this call's Do method. Any 2035// pending HTTP request will be aborted if the provided context is 2036// canceled. 2037func (c *BeaconsDeleteCall) Context(ctx context.Context) *BeaconsDeleteCall { 2038 c.ctx_ = ctx 2039 return c 2040} 2041 2042// Header returns an http.Header that can be modified by the caller to 2043// add HTTP headers to the request. 2044func (c *BeaconsDeleteCall) Header() http.Header { 2045 if c.header_ == nil { 2046 c.header_ = make(http.Header) 2047 } 2048 return c.header_ 2049} 2050 2051func (c *BeaconsDeleteCall) doRequest(alt string) (*http.Response, error) { 2052 reqHeaders := make(http.Header) 2053 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317") 2054 for k, v := range c.header_ { 2055 reqHeaders[k] = v 2056 } 2057 reqHeaders.Set("User-Agent", c.s.userAgent()) 2058 var body io.Reader = nil 2059 c.urlParams_.Set("alt", alt) 2060 c.urlParams_.Set("prettyPrint", "false") 2061 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+beaconName}") 2062 urls += "?" + c.urlParams_.Encode() 2063 req, err := http.NewRequest("DELETE", urls, body) 2064 if err != nil { 2065 return nil, err 2066 } 2067 req.Header = reqHeaders 2068 googleapi.Expand(req.URL, map[string]string{ 2069 "beaconName": c.beaconName, 2070 }) 2071 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2072} 2073 2074// Do executes the "proximitybeacon.beacons.delete" call. 2075// Exactly one of *Empty or error will be non-nil. Any non-2xx status 2076// code is an error. Response headers are in either 2077// *Empty.ServerResponse.Header or (if a response was returned at all) 2078// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2079// check whether the returned error was because http.StatusNotModified 2080// was returned. 2081func (c *BeaconsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 2082 gensupport.SetOptions(c.urlParams_, opts...) 2083 res, err := c.doRequest("json") 2084 if res != nil && res.StatusCode == http.StatusNotModified { 2085 if res.Body != nil { 2086 res.Body.Close() 2087 } 2088 return nil, &googleapi.Error{ 2089 Code: res.StatusCode, 2090 Header: res.Header, 2091 } 2092 } 2093 if err != nil { 2094 return nil, err 2095 } 2096 defer googleapi.CloseBody(res) 2097 if err := googleapi.CheckResponse(res); err != nil { 2098 return nil, err 2099 } 2100 ret := &Empty{ 2101 ServerResponse: googleapi.ServerResponse{ 2102 Header: res.Header, 2103 HTTPStatusCode: res.StatusCode, 2104 }, 2105 } 2106 target := &ret 2107 if err := gensupport.DecodeResponse(target, res); err != nil { 2108 return nil, err 2109 } 2110 return ret, nil 2111 // { 2112 // "description": "Deletes the specified beacon including all diagnostics data for the beacon\nas well as any attachments on the beacon (including those belonging to\nother projects). This operation cannot be undone.\n\nAuthenticate using an [OAuth access\ntoken](https://developers.google.com/identity/protocols/OAuth2) from a\nsigned-in user with **Is owner** or **Can edit** permissions in the Google\nDevelopers Console project.", 2113 // "flatPath": "v1beta1/beacons/{beaconsId}", 2114 // "httpMethod": "DELETE", 2115 // "id": "proximitybeacon.beacons.delete", 2116 // "parameterOrder": [ 2117 // "beaconName" 2118 // ], 2119 // "parameters": { 2120 // "beaconName": { 2121 // "description": "Beacon that should be deleted. A beacon name has the format\n\"beacons/N!beaconId\" where the beaconId is the base16 ID broadcast by\nthe beacon and N is a code for the beacon's type. Possible values are\n`3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5`\nfor AltBeacon. For Eddystone-EID beacons, you may use either the\ncurrent EID or the beacon's \"stable\" UID.\nRequired.", 2122 // "location": "path", 2123 // "pattern": "^beacons/[^/]+$", 2124 // "required": true, 2125 // "type": "string" 2126 // }, 2127 // "projectId": { 2128 // "description": "The project id of the beacon to delete. If not provided, the project\nthat is making the request is used.\nOptional.", 2129 // "location": "query", 2130 // "type": "string" 2131 // } 2132 // }, 2133 // "path": "v1beta1/{+beaconName}", 2134 // "response": { 2135 // "$ref": "Empty" 2136 // }, 2137 // "scopes": [ 2138 // "https://www.googleapis.com/auth/userlocation.beacon.registry" 2139 // ] 2140 // } 2141 2142} 2143 2144// method id "proximitybeacon.beacons.get": 2145 2146type BeaconsGetCall struct { 2147 s *Service 2148 beaconName string 2149 urlParams_ gensupport.URLParams 2150 ifNoneMatch_ string 2151 ctx_ context.Context 2152 header_ http.Header 2153} 2154 2155// Get: Returns detailed information about the specified 2156// beacon. 2157// 2158// Authenticate using an [OAuth 2159// access 2160// token](https://developers.google.com/identity/protocols/OAuth2) 2161// from a 2162// signed-in user with **viewer**, **Is owner** or **Can edit** 2163// permissions in 2164// the Google Developers Console project. 2165// 2166// Requests may supply an Eddystone-EID beacon name in the 2167// form: 2168// `beacons/4!beaconId` where the `beaconId` is the base16 ephemeral 2169// ID 2170// broadcast by the beacon. The returned `Beacon` object will contain 2171// the 2172// beacon's stable Eddystone-UID. Clients not authorized to resolve 2173// the 2174// beacon's ephemeral Eddystone-EID broadcast will receive an error. 2175func (r *BeaconsService) Get(beaconName string) *BeaconsGetCall { 2176 c := &BeaconsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2177 c.beaconName = beaconName 2178 return c 2179} 2180 2181// ProjectId sets the optional parameter "projectId": The project id of 2182// the beacon to request. If the project id is not specified 2183// then the project making the request is used. The project id must 2184// match the 2185// project that owns the beacon. 2186func (c *BeaconsGetCall) ProjectId(projectId string) *BeaconsGetCall { 2187 c.urlParams_.Set("projectId", projectId) 2188 return c 2189} 2190 2191// Fields allows partial responses to be retrieved. See 2192// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2193// for more information. 2194func (c *BeaconsGetCall) Fields(s ...googleapi.Field) *BeaconsGetCall { 2195 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2196 return c 2197} 2198 2199// IfNoneMatch sets the optional parameter which makes the operation 2200// fail if the object's ETag matches the given value. This is useful for 2201// getting updates only after the object has changed since the last 2202// request. Use googleapi.IsNotModified to check whether the response 2203// error from Do is the result of In-None-Match. 2204func (c *BeaconsGetCall) IfNoneMatch(entityTag string) *BeaconsGetCall { 2205 c.ifNoneMatch_ = entityTag 2206 return c 2207} 2208 2209// Context sets the context to be used in this call's Do method. Any 2210// pending HTTP request will be aborted if the provided context is 2211// canceled. 2212func (c *BeaconsGetCall) Context(ctx context.Context) *BeaconsGetCall { 2213 c.ctx_ = ctx 2214 return c 2215} 2216 2217// Header returns an http.Header that can be modified by the caller to 2218// add HTTP headers to the request. 2219func (c *BeaconsGetCall) Header() http.Header { 2220 if c.header_ == nil { 2221 c.header_ = make(http.Header) 2222 } 2223 return c.header_ 2224} 2225 2226func (c *BeaconsGetCall) doRequest(alt string) (*http.Response, error) { 2227 reqHeaders := make(http.Header) 2228 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317") 2229 for k, v := range c.header_ { 2230 reqHeaders[k] = v 2231 } 2232 reqHeaders.Set("User-Agent", c.s.userAgent()) 2233 if c.ifNoneMatch_ != "" { 2234 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2235 } 2236 var body io.Reader = nil 2237 c.urlParams_.Set("alt", alt) 2238 c.urlParams_.Set("prettyPrint", "false") 2239 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+beaconName}") 2240 urls += "?" + c.urlParams_.Encode() 2241 req, err := http.NewRequest("GET", urls, body) 2242 if err != nil { 2243 return nil, err 2244 } 2245 req.Header = reqHeaders 2246 googleapi.Expand(req.URL, map[string]string{ 2247 "beaconName": c.beaconName, 2248 }) 2249 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2250} 2251 2252// Do executes the "proximitybeacon.beacons.get" call. 2253// Exactly one of *Beacon or error will be non-nil. Any non-2xx status 2254// code is an error. Response headers are in either 2255// *Beacon.ServerResponse.Header or (if a response was returned at all) 2256// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2257// check whether the returned error was because http.StatusNotModified 2258// was returned. 2259func (c *BeaconsGetCall) Do(opts ...googleapi.CallOption) (*Beacon, error) { 2260 gensupport.SetOptions(c.urlParams_, opts...) 2261 res, err := c.doRequest("json") 2262 if res != nil && res.StatusCode == http.StatusNotModified { 2263 if res.Body != nil { 2264 res.Body.Close() 2265 } 2266 return nil, &googleapi.Error{ 2267 Code: res.StatusCode, 2268 Header: res.Header, 2269 } 2270 } 2271 if err != nil { 2272 return nil, err 2273 } 2274 defer googleapi.CloseBody(res) 2275 if err := googleapi.CheckResponse(res); err != nil { 2276 return nil, err 2277 } 2278 ret := &Beacon{ 2279 ServerResponse: googleapi.ServerResponse{ 2280 Header: res.Header, 2281 HTTPStatusCode: res.StatusCode, 2282 }, 2283 } 2284 target := &ret 2285 if err := gensupport.DecodeResponse(target, res); err != nil { 2286 return nil, err 2287 } 2288 return ret, nil 2289 // { 2290 // "description": "Returns detailed information about the specified beacon.\n\nAuthenticate using an [OAuth access\ntoken](https://developers.google.com/identity/protocols/OAuth2) from a\nsigned-in user with **viewer**, **Is owner** or **Can edit** permissions in\nthe Google Developers Console project.\n\nRequests may supply an Eddystone-EID beacon name in the form:\n`beacons/4!beaconId` where the `beaconId` is the base16 ephemeral ID\nbroadcast by the beacon. The returned `Beacon` object will contain the\nbeacon's stable Eddystone-UID. Clients not authorized to resolve the\nbeacon's ephemeral Eddystone-EID broadcast will receive an error.", 2291 // "flatPath": "v1beta1/beacons/{beaconsId}", 2292 // "httpMethod": "GET", 2293 // "id": "proximitybeacon.beacons.get", 2294 // "parameterOrder": [ 2295 // "beaconName" 2296 // ], 2297 // "parameters": { 2298 // "beaconName": { 2299 // "description": "Resource name of this beacon. A beacon name has the format\n\"beacons/N!beaconId\" where the beaconId is the base16 ID broadcast by\nthe beacon and N is a code for the beacon's type. Possible values are\n`3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5`\nfor AltBeacon. For Eddystone-EID beacons, you may use either the\ncurrent EID or the beacon's \"stable\" UID.\nRequired.", 2300 // "location": "path", 2301 // "pattern": "^beacons/[^/]+$", 2302 // "required": true, 2303 // "type": "string" 2304 // }, 2305 // "projectId": { 2306 // "description": "The project id of the beacon to request. If the project id is not specified\nthen the project making the request is used. The project id must match the\nproject that owns the beacon.\nOptional.", 2307 // "location": "query", 2308 // "type": "string" 2309 // } 2310 // }, 2311 // "path": "v1beta1/{+beaconName}", 2312 // "response": { 2313 // "$ref": "Beacon" 2314 // }, 2315 // "scopes": [ 2316 // "https://www.googleapis.com/auth/userlocation.beacon.registry" 2317 // ] 2318 // } 2319 2320} 2321 2322// method id "proximitybeacon.beacons.list": 2323 2324type BeaconsListCall struct { 2325 s *Service 2326 urlParams_ gensupport.URLParams 2327 ifNoneMatch_ string 2328 ctx_ context.Context 2329 header_ http.Header 2330} 2331 2332// List: Searches the beacon registry for beacons that match the given 2333// search 2334// criteria. Only those beacons that the client has permission to 2335// list 2336// will be returned. 2337// 2338// Authenticate using an [OAuth 2339// access 2340// token](https://developers.google.com/identity/protocols/OAuth2) 2341// from a 2342// signed-in user with **viewer**, **Is owner** or **Can edit** 2343// permissions in 2344// the Google Developers Console project. 2345func (r *BeaconsService) List() *BeaconsListCall { 2346 c := &BeaconsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2347 return c 2348} 2349 2350// PageSize sets the optional parameter "pageSize": The maximum number 2351// of records to return for this request, up to a 2352// server-defined upper limit. 2353func (c *BeaconsListCall) PageSize(pageSize int64) *BeaconsListCall { 2354 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 2355 return c 2356} 2357 2358// PageToken sets the optional parameter "pageToken": A pagination token 2359// obtained from a previous request to list beacons. 2360func (c *BeaconsListCall) PageToken(pageToken string) *BeaconsListCall { 2361 c.urlParams_.Set("pageToken", pageToken) 2362 return c 2363} 2364 2365// ProjectId sets the optional parameter "projectId": The project id to 2366// list beacons under. If not present then the project 2367// credential that made the request is used as the project. 2368func (c *BeaconsListCall) ProjectId(projectId string) *BeaconsListCall { 2369 c.urlParams_.Set("projectId", projectId) 2370 return c 2371} 2372 2373// Q sets the optional parameter "q": Filter query string that supports 2374// the following field filters: 2375// 2376// * **description:"<string>"** 2377// For example: **description:"Room 3"** 2378// Returns beacons whose description matches tokens in the string 2379// "Room 3" 2380// (not necessarily that exact string). 2381// The string must be double-quoted. 2382// * **status:`<enum>`** 2383// For example: **status:active** 2384// Returns beacons whose status matches the given value. Values must 2385// be 2386// one of the Beacon.Status enum values (case insensitive). Accepts 2387// multiple filters which will be combined with OR logic. 2388// * **stability:`<enum>`** 2389// For example: **stability:mobile** 2390// Returns beacons whose expected stability matches the given value. 2391// Values must be one of the Beacon.Stability enum values (case 2392// insensitive). Accepts multiple filters which will be combined with 2393// OR logic. 2394// * **place\_id:"<string>"** 2395// For example: **place\_id:"ChIJVSZzVR8FdkgRXGmmm6SslKw="** 2396// Returns beacons explicitly registered at the given place, expressed 2397// as 2398// a Place ID obtained from [Google Places API](/places/place-id). 2399// Does not 2400// match places inside the given place. Does not consider the 2401// beacon's 2402// actual location (which may be different from its registered 2403// place). 2404// Accepts multiple filters that will be combined with OR logic. The 2405// place 2406// ID must be double-quoted. 2407// * **registration\_time`[<|>|<=|>=]<integer>`** 2408// For example: **registration\_time>=1433116800** 2409// Returns beacons whose registration time matches the given filter. 2410// Supports the operators: <, >, <=, and >=. Timestamp must be 2411// expressed as 2412// an integer number of seconds since midnight January 1, 1970 UTC. 2413// Accepts 2414// at most two filters that will be combined with AND logic, to 2415// support 2416// "between" semantics. If more than two are supplied, the latter ones 2417// are 2418// ignored. 2419// * **lat:`<double> lng:<double> radius:<integer>`** 2420// For example: **lat:51.1232343 lng:-1.093852 radius:1000** 2421// Returns beacons whose registered location is within the given 2422// circle. 2423// When any of these fields are given, all are required. Latitude and 2424// longitude must be decimal degrees between -90.0 and 90.0 and 2425// between 2426// -180.0 and 180.0 respectively. Radius must be an integer number of 2427// meters between 10 and 1,000,000 (1000 km). 2428// * **property:"<string>=<string>"** 2429// For example: **property:"battery-type=CR2032"** 2430// Returns beacons which have a property of the given name and value. 2431// Supports multiple filters which will be combined with OR logic. 2432// The entire name=value string must be double-quoted as one string. 2433// * **attachment\_type:"<string>"** 2434// For example: **attachment_type:"my-namespace/my-type"** 2435// Returns beacons having at least one attachment of the given 2436// namespaced 2437// type. Supports "any within this namespace" via the partial 2438// wildcard 2439// syntax: "my-namespace/*". Supports multiple filters which will be 2440// combined with OR logic. The string must be double-quoted. 2441// * **indoor\_level:"<string>"** 2442// For example: **indoor\_level:"1"** 2443// Returns beacons which are located on the given indoor level. 2444// Accepts 2445// multiple filters that will be combined with OR logic. 2446// 2447// Multiple filters on the same field are combined with OR logic 2448// (except 2449// registration_time which is combined with AND logic). 2450// Multiple filters on different fields are combined with AND 2451// logic. 2452// Filters should be separated by spaces. 2453// 2454// As with any HTTP query string parameter, the whole filter expression 2455// must 2456// be URL-encoded. 2457// 2458// Example REST 2459// request: 2460// `GET 2461// /v1beta1/beacons?q=status:active%20lat:51.123%20lng:-1.0 2462// 95%20radius:1000` 2463func (c *BeaconsListCall) Q(q string) *BeaconsListCall { 2464 c.urlParams_.Set("q", q) 2465 return c 2466} 2467 2468// Fields allows partial responses to be retrieved. See 2469// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2470// for more information. 2471func (c *BeaconsListCall) Fields(s ...googleapi.Field) *BeaconsListCall { 2472 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2473 return c 2474} 2475 2476// IfNoneMatch sets the optional parameter which makes the operation 2477// fail if the object's ETag matches the given value. This is useful for 2478// getting updates only after the object has changed since the last 2479// request. Use googleapi.IsNotModified to check whether the response 2480// error from Do is the result of In-None-Match. 2481func (c *BeaconsListCall) IfNoneMatch(entityTag string) *BeaconsListCall { 2482 c.ifNoneMatch_ = entityTag 2483 return c 2484} 2485 2486// Context sets the context to be used in this call's Do method. Any 2487// pending HTTP request will be aborted if the provided context is 2488// canceled. 2489func (c *BeaconsListCall) Context(ctx context.Context) *BeaconsListCall { 2490 c.ctx_ = ctx 2491 return c 2492} 2493 2494// Header returns an http.Header that can be modified by the caller to 2495// add HTTP headers to the request. 2496func (c *BeaconsListCall) Header() http.Header { 2497 if c.header_ == nil { 2498 c.header_ = make(http.Header) 2499 } 2500 return c.header_ 2501} 2502 2503func (c *BeaconsListCall) doRequest(alt string) (*http.Response, error) { 2504 reqHeaders := make(http.Header) 2505 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317") 2506 for k, v := range c.header_ { 2507 reqHeaders[k] = v 2508 } 2509 reqHeaders.Set("User-Agent", c.s.userAgent()) 2510 if c.ifNoneMatch_ != "" { 2511 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2512 } 2513 var body io.Reader = nil 2514 c.urlParams_.Set("alt", alt) 2515 c.urlParams_.Set("prettyPrint", "false") 2516 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/beacons") 2517 urls += "?" + c.urlParams_.Encode() 2518 req, err := http.NewRequest("GET", urls, body) 2519 if err != nil { 2520 return nil, err 2521 } 2522 req.Header = reqHeaders 2523 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2524} 2525 2526// Do executes the "proximitybeacon.beacons.list" call. 2527// Exactly one of *ListBeaconsResponse or error will be non-nil. Any 2528// non-2xx status code is an error. Response headers are in either 2529// *ListBeaconsResponse.ServerResponse.Header or (if a response was 2530// returned at all) in error.(*googleapi.Error).Header. Use 2531// googleapi.IsNotModified to check whether the returned error was 2532// because http.StatusNotModified was returned. 2533func (c *BeaconsListCall) Do(opts ...googleapi.CallOption) (*ListBeaconsResponse, error) { 2534 gensupport.SetOptions(c.urlParams_, opts...) 2535 res, err := c.doRequest("json") 2536 if res != nil && res.StatusCode == http.StatusNotModified { 2537 if res.Body != nil { 2538 res.Body.Close() 2539 } 2540 return nil, &googleapi.Error{ 2541 Code: res.StatusCode, 2542 Header: res.Header, 2543 } 2544 } 2545 if err != nil { 2546 return nil, err 2547 } 2548 defer googleapi.CloseBody(res) 2549 if err := googleapi.CheckResponse(res); err != nil { 2550 return nil, err 2551 } 2552 ret := &ListBeaconsResponse{ 2553 ServerResponse: googleapi.ServerResponse{ 2554 Header: res.Header, 2555 HTTPStatusCode: res.StatusCode, 2556 }, 2557 } 2558 target := &ret 2559 if err := gensupport.DecodeResponse(target, res); err != nil { 2560 return nil, err 2561 } 2562 return ret, nil 2563 // { 2564 // "description": "Searches the beacon registry for beacons that match the given search\ncriteria. Only those beacons that the client has permission to list\nwill be returned.\n\nAuthenticate using an [OAuth access\ntoken](https://developers.google.com/identity/protocols/OAuth2) from a\nsigned-in user with **viewer**, **Is owner** or **Can edit** permissions in\nthe Google Developers Console project.", 2565 // "flatPath": "v1beta1/beacons", 2566 // "httpMethod": "GET", 2567 // "id": "proximitybeacon.beacons.list", 2568 // "parameterOrder": [], 2569 // "parameters": { 2570 // "pageSize": { 2571 // "description": "The maximum number of records to return for this request, up to a\nserver-defined upper limit.", 2572 // "format": "int32", 2573 // "location": "query", 2574 // "type": "integer" 2575 // }, 2576 // "pageToken": { 2577 // "description": "A pagination token obtained from a previous request to list beacons.", 2578 // "location": "query", 2579 // "type": "string" 2580 // }, 2581 // "projectId": { 2582 // "description": "The project id to list beacons under. If not present then the project\ncredential that made the request is used as the project.\nOptional.", 2583 // "location": "query", 2584 // "type": "string" 2585 // }, 2586 // "q": { 2587 // "description": "Filter query string that supports the following field filters:\n\n* **description:`\"\u003cstring\u003e\"`**\n For example: **description:\"Room 3\"**\n Returns beacons whose description matches tokens in the string \"Room 3\"\n (not necessarily that exact string).\n The string must be double-quoted.\n* **status:`\u003cenum\u003e`**\n For example: **status:active**\n Returns beacons whose status matches the given value. Values must be\n one of the Beacon.Status enum values (case insensitive). Accepts\n multiple filters which will be combined with OR logic.\n* **stability:`\u003cenum\u003e`**\n For example: **stability:mobile**\n Returns beacons whose expected stability matches the given value.\n Values must be one of the Beacon.Stability enum values (case\n insensitive). Accepts multiple filters which will be combined with\n OR logic.\n* **place\\_id:`\"\u003cstring\u003e\"`**\n For example: **place\\_id:\"ChIJVSZzVR8FdkgRXGmmm6SslKw=\"**\n Returns beacons explicitly registered at the given place, expressed as\n a Place ID obtained from [Google Places API](/places/place-id). Does not\n match places inside the given place. Does not consider the beacon's\n actual location (which may be different from its registered place).\n Accepts multiple filters that will be combined with OR logic. The place\n ID must be double-quoted.\n* **registration\\_time`[\u003c|\u003e|\u003c=|\u003e=]\u003cinteger\u003e`**\n For example: **registration\\_time\u003e=1433116800**\n Returns beacons whose registration time matches the given filter.\n Supports the operators: \u003c, \u003e, \u003c=, and \u003e=. Timestamp must be expressed as\n an integer number of seconds since midnight January 1, 1970 UTC. Accepts\n at most two filters that will be combined with AND logic, to support\n \"between\" semantics. If more than two are supplied, the latter ones are\n ignored.\n* **lat:`\u003cdouble\u003e lng:\u003cdouble\u003e radius:\u003cinteger\u003e`**\n For example: **lat:51.1232343 lng:-1.093852 radius:1000**\n Returns beacons whose registered location is within the given circle.\n When any of these fields are given, all are required. Latitude and\n longitude must be decimal degrees between -90.0 and 90.0 and between\n -180.0 and 180.0 respectively. Radius must be an integer number of\n meters between 10 and 1,000,000 (1000 km).\n* **property:`\"\u003cstring\u003e=\u003cstring\u003e\"`**\n For example: **property:\"battery-type=CR2032\"**\n Returns beacons which have a property of the given name and value.\n Supports multiple filters which will be combined with OR logic.\n The entire name=value string must be double-quoted as one string.\n* **attachment\\_type:`\"\u003cstring\u003e\"`**\n For example: **attachment_type:\"my-namespace/my-type\"**\n Returns beacons having at least one attachment of the given namespaced\n type. Supports \"any within this namespace\" via the partial wildcard\n syntax: \"my-namespace/*\". Supports multiple filters which will be\n combined with OR logic. The string must be double-quoted.\n* **indoor\\_level:`\"\u003cstring\u003e\"`**\n For example: **indoor\\_level:\"1\"**\n Returns beacons which are located on the given indoor level. Accepts\n multiple filters that will be combined with OR logic.\n\nMultiple filters on the same field are combined with OR logic (except\nregistration_time which is combined with AND logic).\nMultiple filters on different fields are combined with AND logic.\nFilters should be separated by spaces.\n\nAs with any HTTP query string parameter, the whole filter expression must\nbe URL-encoded.\n\nExample REST request:\n`GET\n/v1beta1/beacons?q=status:active%20lat:51.123%20lng:-1.095%20radius:1000`", 2588 // "location": "query", 2589 // "type": "string" 2590 // } 2591 // }, 2592 // "path": "v1beta1/beacons", 2593 // "response": { 2594 // "$ref": "ListBeaconsResponse" 2595 // }, 2596 // "scopes": [ 2597 // "https://www.googleapis.com/auth/userlocation.beacon.registry" 2598 // ] 2599 // } 2600 2601} 2602 2603// Pages invokes f for each page of results. 2604// A non-nil error returned from f will halt the iteration. 2605// The provided context supersedes any context provided to the Context method. 2606func (c *BeaconsListCall) Pages(ctx context.Context, f func(*ListBeaconsResponse) error) error { 2607 c.ctx_ = ctx 2608 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 2609 for { 2610 x, err := c.Do() 2611 if err != nil { 2612 return err 2613 } 2614 if err := f(x); err != nil { 2615 return err 2616 } 2617 if x.NextPageToken == "" { 2618 return nil 2619 } 2620 c.PageToken(x.NextPageToken) 2621 } 2622} 2623 2624// method id "proximitybeacon.beacons.register": 2625 2626type BeaconsRegisterCall struct { 2627 s *Service 2628 beacon *Beacon 2629 urlParams_ gensupport.URLParams 2630 ctx_ context.Context 2631 header_ http.Header 2632} 2633 2634// Register: Registers a previously unregistered beacon given its 2635// `advertisedId`. 2636// These IDs are unique within the system. An ID can be registered only 2637// once. 2638// 2639// Authenticate using an [OAuth 2640// access 2641// token](https://developers.google.com/identity/protocols/OAuth2) 2642// from a 2643// signed-in user with **Is owner** or **Can edit** permissions in the 2644// Google 2645// Developers Console project. 2646func (r *BeaconsService) Register(beacon *Beacon) *BeaconsRegisterCall { 2647 c := &BeaconsRegisterCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2648 c.beacon = beacon 2649 return c 2650} 2651 2652// ProjectId sets the optional parameter "projectId": The project id of 2653// the project the beacon will be registered to. If 2654// the project id is not specified then the project making the 2655// request 2656// is used. 2657func (c *BeaconsRegisterCall) ProjectId(projectId string) *BeaconsRegisterCall { 2658 c.urlParams_.Set("projectId", projectId) 2659 return c 2660} 2661 2662// Fields allows partial responses to be retrieved. See 2663// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2664// for more information. 2665func (c *BeaconsRegisterCall) Fields(s ...googleapi.Field) *BeaconsRegisterCall { 2666 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2667 return c 2668} 2669 2670// Context sets the context to be used in this call's Do method. Any 2671// pending HTTP request will be aborted if the provided context is 2672// canceled. 2673func (c *BeaconsRegisterCall) Context(ctx context.Context) *BeaconsRegisterCall { 2674 c.ctx_ = ctx 2675 return c 2676} 2677 2678// Header returns an http.Header that can be modified by the caller to 2679// add HTTP headers to the request. 2680func (c *BeaconsRegisterCall) Header() http.Header { 2681 if c.header_ == nil { 2682 c.header_ = make(http.Header) 2683 } 2684 return c.header_ 2685} 2686 2687func (c *BeaconsRegisterCall) doRequest(alt string) (*http.Response, error) { 2688 reqHeaders := make(http.Header) 2689 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317") 2690 for k, v := range c.header_ { 2691 reqHeaders[k] = v 2692 } 2693 reqHeaders.Set("User-Agent", c.s.userAgent()) 2694 var body io.Reader = nil 2695 body, err := googleapi.WithoutDataWrapper.JSONReader(c.beacon) 2696 if err != nil { 2697 return nil, err 2698 } 2699 reqHeaders.Set("Content-Type", "application/json") 2700 c.urlParams_.Set("alt", alt) 2701 c.urlParams_.Set("prettyPrint", "false") 2702 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/beacons:register") 2703 urls += "?" + c.urlParams_.Encode() 2704 req, err := http.NewRequest("POST", urls, body) 2705 if err != nil { 2706 return nil, err 2707 } 2708 req.Header = reqHeaders 2709 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2710} 2711 2712// Do executes the "proximitybeacon.beacons.register" call. 2713// Exactly one of *Beacon or error will be non-nil. Any non-2xx status 2714// code is an error. Response headers are in either 2715// *Beacon.ServerResponse.Header or (if a response was returned at all) 2716// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2717// check whether the returned error was because http.StatusNotModified 2718// was returned. 2719func (c *BeaconsRegisterCall) Do(opts ...googleapi.CallOption) (*Beacon, error) { 2720 gensupport.SetOptions(c.urlParams_, opts...) 2721 res, err := c.doRequest("json") 2722 if res != nil && res.StatusCode == http.StatusNotModified { 2723 if res.Body != nil { 2724 res.Body.Close() 2725 } 2726 return nil, &googleapi.Error{ 2727 Code: res.StatusCode, 2728 Header: res.Header, 2729 } 2730 } 2731 if err != nil { 2732 return nil, err 2733 } 2734 defer googleapi.CloseBody(res) 2735 if err := googleapi.CheckResponse(res); err != nil { 2736 return nil, err 2737 } 2738 ret := &Beacon{ 2739 ServerResponse: googleapi.ServerResponse{ 2740 Header: res.Header, 2741 HTTPStatusCode: res.StatusCode, 2742 }, 2743 } 2744 target := &ret 2745 if err := gensupport.DecodeResponse(target, res); err != nil { 2746 return nil, err 2747 } 2748 return ret, nil 2749 // { 2750 // "description": "Registers a previously unregistered beacon given its `advertisedId`.\nThese IDs are unique within the system. An ID can be registered only once.\n\nAuthenticate using an [OAuth access\ntoken](https://developers.google.com/identity/protocols/OAuth2) from a\nsigned-in user with **Is owner** or **Can edit** permissions in the Google\nDevelopers Console project.", 2751 // "flatPath": "v1beta1/beacons:register", 2752 // "httpMethod": "POST", 2753 // "id": "proximitybeacon.beacons.register", 2754 // "parameterOrder": [], 2755 // "parameters": { 2756 // "projectId": { 2757 // "description": "The project id of the project the beacon will be registered to. If\nthe project id is not specified then the project making the request\nis used.\nOptional.", 2758 // "location": "query", 2759 // "type": "string" 2760 // } 2761 // }, 2762 // "path": "v1beta1/beacons:register", 2763 // "request": { 2764 // "$ref": "Beacon" 2765 // }, 2766 // "response": { 2767 // "$ref": "Beacon" 2768 // }, 2769 // "scopes": [ 2770 // "https://www.googleapis.com/auth/userlocation.beacon.registry" 2771 // ] 2772 // } 2773 2774} 2775 2776// method id "proximitybeacon.beacons.update": 2777 2778type BeaconsUpdateCall struct { 2779 s *Service 2780 beaconName string 2781 beacon *Beacon 2782 urlParams_ gensupport.URLParams 2783 ctx_ context.Context 2784 header_ http.Header 2785} 2786 2787// Update: Updates the information about the specified beacon. **Any 2788// field that you do 2789// not populate in the submitted beacon will be permanently erased**, so 2790// you 2791// should follow the "read, modify, write" pattern to avoid 2792// inadvertently 2793// destroying data. 2794// 2795// Changes to the beacon status via this method will be silently 2796// ignored. 2797// To update beacon status, use the separate methods on this API 2798// for 2799// activation, deactivation, and decommissioning. 2800// Authenticate using an [OAuth 2801// access 2802// token](https://developers.google.com/identity/protocols/OAuth2) 2803// from a 2804// signed-in user with **Is owner** or **Can edit** permissions in the 2805// Google 2806// Developers Console project. 2807func (r *BeaconsService) Update(beaconName string, beacon *Beacon) *BeaconsUpdateCall { 2808 c := &BeaconsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2809 c.beaconName = beaconName 2810 c.beacon = beacon 2811 return c 2812} 2813 2814// ProjectId sets the optional parameter "projectId": The project id of 2815// the beacon to update. If the project id is not 2816// specified then the project making the request is used. The project 2817// id 2818// must match the project that owns the beacon. 2819func (c *BeaconsUpdateCall) ProjectId(projectId string) *BeaconsUpdateCall { 2820 c.urlParams_.Set("projectId", projectId) 2821 return c 2822} 2823 2824// Fields allows partial responses to be retrieved. See 2825// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2826// for more information. 2827func (c *BeaconsUpdateCall) Fields(s ...googleapi.Field) *BeaconsUpdateCall { 2828 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2829 return c 2830} 2831 2832// Context sets the context to be used in this call's Do method. Any 2833// pending HTTP request will be aborted if the provided context is 2834// canceled. 2835func (c *BeaconsUpdateCall) Context(ctx context.Context) *BeaconsUpdateCall { 2836 c.ctx_ = ctx 2837 return c 2838} 2839 2840// Header returns an http.Header that can be modified by the caller to 2841// add HTTP headers to the request. 2842func (c *BeaconsUpdateCall) Header() http.Header { 2843 if c.header_ == nil { 2844 c.header_ = make(http.Header) 2845 } 2846 return c.header_ 2847} 2848 2849func (c *BeaconsUpdateCall) doRequest(alt string) (*http.Response, error) { 2850 reqHeaders := make(http.Header) 2851 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317") 2852 for k, v := range c.header_ { 2853 reqHeaders[k] = v 2854 } 2855 reqHeaders.Set("User-Agent", c.s.userAgent()) 2856 var body io.Reader = nil 2857 body, err := googleapi.WithoutDataWrapper.JSONReader(c.beacon) 2858 if err != nil { 2859 return nil, err 2860 } 2861 reqHeaders.Set("Content-Type", "application/json") 2862 c.urlParams_.Set("alt", alt) 2863 c.urlParams_.Set("prettyPrint", "false") 2864 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+beaconName}") 2865 urls += "?" + c.urlParams_.Encode() 2866 req, err := http.NewRequest("PUT", urls, body) 2867 if err != nil { 2868 return nil, err 2869 } 2870 req.Header = reqHeaders 2871 googleapi.Expand(req.URL, map[string]string{ 2872 "beaconName": c.beaconName, 2873 }) 2874 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2875} 2876 2877// Do executes the "proximitybeacon.beacons.update" call. 2878// Exactly one of *Beacon or error will be non-nil. Any non-2xx status 2879// code is an error. Response headers are in either 2880// *Beacon.ServerResponse.Header or (if a response was returned at all) 2881// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2882// check whether the returned error was because http.StatusNotModified 2883// was returned. 2884func (c *BeaconsUpdateCall) Do(opts ...googleapi.CallOption) (*Beacon, error) { 2885 gensupport.SetOptions(c.urlParams_, opts...) 2886 res, err := c.doRequest("json") 2887 if res != nil && res.StatusCode == http.StatusNotModified { 2888 if res.Body != nil { 2889 res.Body.Close() 2890 } 2891 return nil, &googleapi.Error{ 2892 Code: res.StatusCode, 2893 Header: res.Header, 2894 } 2895 } 2896 if err != nil { 2897 return nil, err 2898 } 2899 defer googleapi.CloseBody(res) 2900 if err := googleapi.CheckResponse(res); err != nil { 2901 return nil, err 2902 } 2903 ret := &Beacon{ 2904 ServerResponse: googleapi.ServerResponse{ 2905 Header: res.Header, 2906 HTTPStatusCode: res.StatusCode, 2907 }, 2908 } 2909 target := &ret 2910 if err := gensupport.DecodeResponse(target, res); err != nil { 2911 return nil, err 2912 } 2913 return ret, nil 2914 // { 2915 // "description": "Updates the information about the specified beacon. **Any field that you do\nnot populate in the submitted beacon will be permanently erased**, so you\nshould follow the \"read, modify, write\" pattern to avoid inadvertently\ndestroying data.\n\nChanges to the beacon status via this method will be silently ignored.\nTo update beacon status, use the separate methods on this API for\nactivation, deactivation, and decommissioning.\nAuthenticate using an [OAuth access\ntoken](https://developers.google.com/identity/protocols/OAuth2) from a\nsigned-in user with **Is owner** or **Can edit** permissions in the Google\nDevelopers Console project.", 2916 // "flatPath": "v1beta1/beacons/{beaconsId}", 2917 // "httpMethod": "PUT", 2918 // "id": "proximitybeacon.beacons.update", 2919 // "parameterOrder": [ 2920 // "beaconName" 2921 // ], 2922 // "parameters": { 2923 // "beaconName": { 2924 // "description": "Resource name of this beacon. A beacon name has the format\n\"beacons/N!beaconId\" where the beaconId is the base16 ID broadcast by\nthe beacon and N is a code for the beacon's type. Possible values are\n`3` for Eddystone, `1` for iBeacon, or `5` for AltBeacon.\n\nThis field must be left empty when registering. After reading a beacon,\nclients can use the name for future operations.", 2925 // "location": "path", 2926 // "pattern": "^beacons/[^/]+$", 2927 // "required": true, 2928 // "type": "string" 2929 // }, 2930 // "projectId": { 2931 // "description": "The project id of the beacon to update. If the project id is not\nspecified then the project making the request is used. The project id\nmust match the project that owns the beacon.\nOptional.", 2932 // "location": "query", 2933 // "type": "string" 2934 // } 2935 // }, 2936 // "path": "v1beta1/{+beaconName}", 2937 // "request": { 2938 // "$ref": "Beacon" 2939 // }, 2940 // "response": { 2941 // "$ref": "Beacon" 2942 // }, 2943 // "scopes": [ 2944 // "https://www.googleapis.com/auth/userlocation.beacon.registry" 2945 // ] 2946 // } 2947 2948} 2949 2950// method id "proximitybeacon.beacons.attachments.batchDelete": 2951 2952type BeaconsAttachmentsBatchDeleteCall struct { 2953 s *Service 2954 beaconName string 2955 urlParams_ gensupport.URLParams 2956 ctx_ context.Context 2957 header_ http.Header 2958} 2959 2960// BatchDelete: Deletes multiple attachments on a given beacon. This 2961// operation is 2962// permanent and cannot be undone. 2963// 2964// You can optionally specify `namespacedType` to choose which 2965// attachments 2966// should be deleted. If you do not specify `namespacedType`, all 2967// your 2968// attachments on the given beacon will be deleted. You also may 2969// explicitly 2970// specify `*/*` to delete all. 2971// 2972// Authenticate using an [OAuth 2973// access 2974// token](https://developers.google.com/identity/protocols/OAuth2) 2975// from a 2976// signed-in user with **Is owner** or **Can edit** permissions in the 2977// Google 2978// Developers Console project. 2979func (r *BeaconsAttachmentsService) BatchDelete(beaconName string) *BeaconsAttachmentsBatchDeleteCall { 2980 c := &BeaconsAttachmentsBatchDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2981 c.beaconName = beaconName 2982 return c 2983} 2984 2985// NamespacedType sets the optional parameter "namespacedType": 2986// Specifies the namespace and type of attachments to delete 2987// in 2988// `namespace/type` format. Accepts `*/*` to specify 2989// "all types in all namespaces". 2990func (c *BeaconsAttachmentsBatchDeleteCall) NamespacedType(namespacedType string) *BeaconsAttachmentsBatchDeleteCall { 2991 c.urlParams_.Set("namespacedType", namespacedType) 2992 return c 2993} 2994 2995// ProjectId sets the optional parameter "projectId": The project id to 2996// delete beacon attachments under. This field can be 2997// used when "*" is specified to mean all attachment namespaces. 2998// Projects 2999// may have multiple attachments with multiple namespaces. If "*" 3000// is 3001// specified and the projectId string is empty, then the project 3002// making the request is used. 3003func (c *BeaconsAttachmentsBatchDeleteCall) ProjectId(projectId string) *BeaconsAttachmentsBatchDeleteCall { 3004 c.urlParams_.Set("projectId", projectId) 3005 return c 3006} 3007 3008// Fields allows partial responses to be retrieved. See 3009// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3010// for more information. 3011func (c *BeaconsAttachmentsBatchDeleteCall) Fields(s ...googleapi.Field) *BeaconsAttachmentsBatchDeleteCall { 3012 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3013 return c 3014} 3015 3016// Context sets the context to be used in this call's Do method. Any 3017// pending HTTP request will be aborted if the provided context is 3018// canceled. 3019func (c *BeaconsAttachmentsBatchDeleteCall) Context(ctx context.Context) *BeaconsAttachmentsBatchDeleteCall { 3020 c.ctx_ = ctx 3021 return c 3022} 3023 3024// Header returns an http.Header that can be modified by the caller to 3025// add HTTP headers to the request. 3026func (c *BeaconsAttachmentsBatchDeleteCall) Header() http.Header { 3027 if c.header_ == nil { 3028 c.header_ = make(http.Header) 3029 } 3030 return c.header_ 3031} 3032 3033func (c *BeaconsAttachmentsBatchDeleteCall) doRequest(alt string) (*http.Response, error) { 3034 reqHeaders := make(http.Header) 3035 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317") 3036 for k, v := range c.header_ { 3037 reqHeaders[k] = v 3038 } 3039 reqHeaders.Set("User-Agent", c.s.userAgent()) 3040 var body io.Reader = nil 3041 c.urlParams_.Set("alt", alt) 3042 c.urlParams_.Set("prettyPrint", "false") 3043 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+beaconName}/attachments:batchDelete") 3044 urls += "?" + c.urlParams_.Encode() 3045 req, err := http.NewRequest("POST", urls, body) 3046 if err != nil { 3047 return nil, err 3048 } 3049 req.Header = reqHeaders 3050 googleapi.Expand(req.URL, map[string]string{ 3051 "beaconName": c.beaconName, 3052 }) 3053 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3054} 3055 3056// Do executes the "proximitybeacon.beacons.attachments.batchDelete" call. 3057// Exactly one of *DeleteAttachmentsResponse or error will be non-nil. 3058// Any non-2xx status code is an error. Response headers are in either 3059// *DeleteAttachmentsResponse.ServerResponse.Header or (if a response 3060// was returned at all) in error.(*googleapi.Error).Header. Use 3061// googleapi.IsNotModified to check whether the returned error was 3062// because http.StatusNotModified was returned. 3063func (c *BeaconsAttachmentsBatchDeleteCall) Do(opts ...googleapi.CallOption) (*DeleteAttachmentsResponse, error) { 3064 gensupport.SetOptions(c.urlParams_, opts...) 3065 res, err := c.doRequest("json") 3066 if res != nil && res.StatusCode == http.StatusNotModified { 3067 if res.Body != nil { 3068 res.Body.Close() 3069 } 3070 return nil, &googleapi.Error{ 3071 Code: res.StatusCode, 3072 Header: res.Header, 3073 } 3074 } 3075 if err != nil { 3076 return nil, err 3077 } 3078 defer googleapi.CloseBody(res) 3079 if err := googleapi.CheckResponse(res); err != nil { 3080 return nil, err 3081 } 3082 ret := &DeleteAttachmentsResponse{ 3083 ServerResponse: googleapi.ServerResponse{ 3084 Header: res.Header, 3085 HTTPStatusCode: res.StatusCode, 3086 }, 3087 } 3088 target := &ret 3089 if err := gensupport.DecodeResponse(target, res); err != nil { 3090 return nil, err 3091 } 3092 return ret, nil 3093 // { 3094 // "description": "Deletes multiple attachments on a given beacon. This operation is\npermanent and cannot be undone.\n\nYou can optionally specify `namespacedType` to choose which attachments\nshould be deleted. If you do not specify `namespacedType`, all your\nattachments on the given beacon will be deleted. You also may explicitly\nspecify `*/*` to delete all.\n\nAuthenticate using an [OAuth access\ntoken](https://developers.google.com/identity/protocols/OAuth2) from a\nsigned-in user with **Is owner** or **Can edit** permissions in the Google\nDevelopers Console project.", 3095 // "flatPath": "v1beta1/beacons/{beaconsId}/attachments:batchDelete", 3096 // "httpMethod": "POST", 3097 // "id": "proximitybeacon.beacons.attachments.batchDelete", 3098 // "parameterOrder": [ 3099 // "beaconName" 3100 // ], 3101 // "parameters": { 3102 // "beaconName": { 3103 // "description": "The beacon whose attachments should be deleted. A beacon name has the\nformat \"beacons/N!beaconId\" where the beaconId is the base16 ID broadcast\nby the beacon and N is a code for the beacon's type. Possible values are\n`3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5`\nfor AltBeacon. For Eddystone-EID beacons, you may use either the\ncurrent EID or the beacon's \"stable\" UID.\nRequired.", 3104 // "location": "path", 3105 // "pattern": "^beacons/[^/]+$", 3106 // "required": true, 3107 // "type": "string" 3108 // }, 3109 // "namespacedType": { 3110 // "description": "Specifies the namespace and type of attachments to delete in\n`namespace/type` format. Accepts `*/*` to specify\n\"all types in all namespaces\".\nOptional.", 3111 // "location": "query", 3112 // "type": "string" 3113 // }, 3114 // "projectId": { 3115 // "description": "The project id to delete beacon attachments under. This field can be\nused when \"*\" is specified to mean all attachment namespaces. Projects\nmay have multiple attachments with multiple namespaces. If \"*\" is\nspecified and the projectId string is empty, then the project\nmaking the request is used.\nOptional.", 3116 // "location": "query", 3117 // "type": "string" 3118 // } 3119 // }, 3120 // "path": "v1beta1/{+beaconName}/attachments:batchDelete", 3121 // "response": { 3122 // "$ref": "DeleteAttachmentsResponse" 3123 // }, 3124 // "scopes": [ 3125 // "https://www.googleapis.com/auth/userlocation.beacon.registry" 3126 // ] 3127 // } 3128 3129} 3130 3131// method id "proximitybeacon.beacons.attachments.create": 3132 3133type BeaconsAttachmentsCreateCall struct { 3134 s *Service 3135 beaconName string 3136 beaconattachment *BeaconAttachment 3137 urlParams_ gensupport.URLParams 3138 ctx_ context.Context 3139 header_ http.Header 3140} 3141 3142// Create: Associates the given data with the specified beacon. 3143// Attachment data must 3144// contain two parts: 3145// <ul> 3146// <li>A namespaced type.</li> 3147// <li>The actual attachment data itself.</li> 3148// </ul> 3149// The namespaced type consists of two parts, the namespace and the 3150// type. 3151// The namespace must be one of the values returned by the 3152// `namespaces` 3153// endpoint, while the type can be a string of any characters except for 3154// the 3155// forward slash (`/`) up to 100 characters in length. 3156// 3157// Attachment data can be up to 1024 bytes long. 3158// 3159// Authenticate using an [OAuth 3160// access 3161// token](https://developers.google.com/identity/protocols/OAuth2) 3162// from a 3163// signed-in user with **Is owner** or **Can edit** permissions in the 3164// Google 3165// Developers Console project. 3166func (r *BeaconsAttachmentsService) Create(beaconName string, beaconattachment *BeaconAttachment) *BeaconsAttachmentsCreateCall { 3167 c := &BeaconsAttachmentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3168 c.beaconName = beaconName 3169 c.beaconattachment = beaconattachment 3170 return c 3171} 3172 3173// ProjectId sets the optional parameter "projectId": The project id of 3174// the project the attachment will belong to. If 3175// the project id is not specified then the project making the 3176// request 3177// is used. 3178func (c *BeaconsAttachmentsCreateCall) ProjectId(projectId string) *BeaconsAttachmentsCreateCall { 3179 c.urlParams_.Set("projectId", projectId) 3180 return c 3181} 3182 3183// Fields allows partial responses to be retrieved. See 3184// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3185// for more information. 3186func (c *BeaconsAttachmentsCreateCall) Fields(s ...googleapi.Field) *BeaconsAttachmentsCreateCall { 3187 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3188 return c 3189} 3190 3191// Context sets the context to be used in this call's Do method. Any 3192// pending HTTP request will be aborted if the provided context is 3193// canceled. 3194func (c *BeaconsAttachmentsCreateCall) Context(ctx context.Context) *BeaconsAttachmentsCreateCall { 3195 c.ctx_ = ctx 3196 return c 3197} 3198 3199// Header returns an http.Header that can be modified by the caller to 3200// add HTTP headers to the request. 3201func (c *BeaconsAttachmentsCreateCall) Header() http.Header { 3202 if c.header_ == nil { 3203 c.header_ = make(http.Header) 3204 } 3205 return c.header_ 3206} 3207 3208func (c *BeaconsAttachmentsCreateCall) doRequest(alt string) (*http.Response, error) { 3209 reqHeaders := make(http.Header) 3210 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317") 3211 for k, v := range c.header_ { 3212 reqHeaders[k] = v 3213 } 3214 reqHeaders.Set("User-Agent", c.s.userAgent()) 3215 var body io.Reader = nil 3216 body, err := googleapi.WithoutDataWrapper.JSONReader(c.beaconattachment) 3217 if err != nil { 3218 return nil, err 3219 } 3220 reqHeaders.Set("Content-Type", "application/json") 3221 c.urlParams_.Set("alt", alt) 3222 c.urlParams_.Set("prettyPrint", "false") 3223 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+beaconName}/attachments") 3224 urls += "?" + c.urlParams_.Encode() 3225 req, err := http.NewRequest("POST", urls, body) 3226 if err != nil { 3227 return nil, err 3228 } 3229 req.Header = reqHeaders 3230 googleapi.Expand(req.URL, map[string]string{ 3231 "beaconName": c.beaconName, 3232 }) 3233 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3234} 3235 3236// Do executes the "proximitybeacon.beacons.attachments.create" call. 3237// Exactly one of *BeaconAttachment or error will be non-nil. Any 3238// non-2xx status code is an error. Response headers are in either 3239// *BeaconAttachment.ServerResponse.Header or (if a response was 3240// returned at all) in error.(*googleapi.Error).Header. Use 3241// googleapi.IsNotModified to check whether the returned error was 3242// because http.StatusNotModified was returned. 3243func (c *BeaconsAttachmentsCreateCall) Do(opts ...googleapi.CallOption) (*BeaconAttachment, error) { 3244 gensupport.SetOptions(c.urlParams_, opts...) 3245 res, err := c.doRequest("json") 3246 if res != nil && res.StatusCode == http.StatusNotModified { 3247 if res.Body != nil { 3248 res.Body.Close() 3249 } 3250 return nil, &googleapi.Error{ 3251 Code: res.StatusCode, 3252 Header: res.Header, 3253 } 3254 } 3255 if err != nil { 3256 return nil, err 3257 } 3258 defer googleapi.CloseBody(res) 3259 if err := googleapi.CheckResponse(res); err != nil { 3260 return nil, err 3261 } 3262 ret := &BeaconAttachment{ 3263 ServerResponse: googleapi.ServerResponse{ 3264 Header: res.Header, 3265 HTTPStatusCode: res.StatusCode, 3266 }, 3267 } 3268 target := &ret 3269 if err := gensupport.DecodeResponse(target, res); err != nil { 3270 return nil, err 3271 } 3272 return ret, nil 3273 // { 3274 // "description": "Associates the given data with the specified beacon. Attachment data must\ncontain two parts:\n\u003cul\u003e\n\u003cli\u003eA namespaced type.\u003c/li\u003e\n\u003cli\u003eThe actual attachment data itself.\u003c/li\u003e\n\u003c/ul\u003e\nThe namespaced type consists of two parts, the namespace and the type.\nThe namespace must be one of the values returned by the `namespaces`\nendpoint, while the type can be a string of any characters except for the\nforward slash (`/`) up to 100 characters in length.\n\nAttachment data can be up to 1024 bytes long.\n\nAuthenticate using an [OAuth access\ntoken](https://developers.google.com/identity/protocols/OAuth2) from a\nsigned-in user with **Is owner** or **Can edit** permissions in the Google\nDevelopers Console project.", 3275 // "flatPath": "v1beta1/beacons/{beaconsId}/attachments", 3276 // "httpMethod": "POST", 3277 // "id": "proximitybeacon.beacons.attachments.create", 3278 // "parameterOrder": [ 3279 // "beaconName" 3280 // ], 3281 // "parameters": { 3282 // "beaconName": { 3283 // "description": "Beacon on which the attachment should be created. A beacon name has the\nformat \"beacons/N!beaconId\" where the beaconId is the base16 ID broadcast\nby the beacon and N is a code for the beacon's type. Possible values are\n`3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5`\nfor AltBeacon. For Eddystone-EID beacons, you may use either the\ncurrent EID or the beacon's \"stable\" UID.\nRequired.", 3284 // "location": "path", 3285 // "pattern": "^beacons/[^/]+$", 3286 // "required": true, 3287 // "type": "string" 3288 // }, 3289 // "projectId": { 3290 // "description": "The project id of the project the attachment will belong to. If\nthe project id is not specified then the project making the request\nis used.\nOptional.", 3291 // "location": "query", 3292 // "type": "string" 3293 // } 3294 // }, 3295 // "path": "v1beta1/{+beaconName}/attachments", 3296 // "request": { 3297 // "$ref": "BeaconAttachment" 3298 // }, 3299 // "response": { 3300 // "$ref": "BeaconAttachment" 3301 // }, 3302 // "scopes": [ 3303 // "https://www.googleapis.com/auth/userlocation.beacon.registry" 3304 // ] 3305 // } 3306 3307} 3308 3309// method id "proximitybeacon.beacons.attachments.delete": 3310 3311type BeaconsAttachmentsDeleteCall struct { 3312 s *Service 3313 attachmentName string 3314 urlParams_ gensupport.URLParams 3315 ctx_ context.Context 3316 header_ http.Header 3317} 3318 3319// Delete: Deletes the specified attachment for the given beacon. Each 3320// attachment has 3321// a unique attachment name (`attachmentName`) which is returned when 3322// you 3323// fetch the attachment data via this API. You specify this with the 3324// delete 3325// request to control which attachment is removed. This operation cannot 3326// be 3327// undone. 3328// 3329// Authenticate using an [OAuth 3330// access 3331// token](https://developers.google.com/identity/protocols/OAuth2) 3332// from a 3333// signed-in user with **Is owner** or **Can edit** permissions in the 3334// Google 3335// Developers Console project. 3336func (r *BeaconsAttachmentsService) Delete(attachmentName string) *BeaconsAttachmentsDeleteCall { 3337 c := &BeaconsAttachmentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3338 c.attachmentName = attachmentName 3339 return c 3340} 3341 3342// ProjectId sets the optional parameter "projectId": The project id of 3343// the attachment to delete. If not provided, the project 3344// that is making the request is used. 3345func (c *BeaconsAttachmentsDeleteCall) ProjectId(projectId string) *BeaconsAttachmentsDeleteCall { 3346 c.urlParams_.Set("projectId", projectId) 3347 return c 3348} 3349 3350// Fields allows partial responses to be retrieved. See 3351// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3352// for more information. 3353func (c *BeaconsAttachmentsDeleteCall) Fields(s ...googleapi.Field) *BeaconsAttachmentsDeleteCall { 3354 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3355 return c 3356} 3357 3358// Context sets the context to be used in this call's Do method. Any 3359// pending HTTP request will be aborted if the provided context is 3360// canceled. 3361func (c *BeaconsAttachmentsDeleteCall) Context(ctx context.Context) *BeaconsAttachmentsDeleteCall { 3362 c.ctx_ = ctx 3363 return c 3364} 3365 3366// Header returns an http.Header that can be modified by the caller to 3367// add HTTP headers to the request. 3368func (c *BeaconsAttachmentsDeleteCall) Header() http.Header { 3369 if c.header_ == nil { 3370 c.header_ = make(http.Header) 3371 } 3372 return c.header_ 3373} 3374 3375func (c *BeaconsAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) { 3376 reqHeaders := make(http.Header) 3377 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317") 3378 for k, v := range c.header_ { 3379 reqHeaders[k] = v 3380 } 3381 reqHeaders.Set("User-Agent", c.s.userAgent()) 3382 var body io.Reader = nil 3383 c.urlParams_.Set("alt", alt) 3384 c.urlParams_.Set("prettyPrint", "false") 3385 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+attachmentName}") 3386 urls += "?" + c.urlParams_.Encode() 3387 req, err := http.NewRequest("DELETE", urls, body) 3388 if err != nil { 3389 return nil, err 3390 } 3391 req.Header = reqHeaders 3392 googleapi.Expand(req.URL, map[string]string{ 3393 "attachmentName": c.attachmentName, 3394 }) 3395 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3396} 3397 3398// Do executes the "proximitybeacon.beacons.attachments.delete" call. 3399// Exactly one of *Empty or error will be non-nil. Any non-2xx status 3400// code is an error. Response headers are in either 3401// *Empty.ServerResponse.Header or (if a response was returned at all) 3402// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3403// check whether the returned error was because http.StatusNotModified 3404// was returned. 3405func (c *BeaconsAttachmentsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 3406 gensupport.SetOptions(c.urlParams_, opts...) 3407 res, err := c.doRequest("json") 3408 if res != nil && res.StatusCode == http.StatusNotModified { 3409 if res.Body != nil { 3410 res.Body.Close() 3411 } 3412 return nil, &googleapi.Error{ 3413 Code: res.StatusCode, 3414 Header: res.Header, 3415 } 3416 } 3417 if err != nil { 3418 return nil, err 3419 } 3420 defer googleapi.CloseBody(res) 3421 if err := googleapi.CheckResponse(res); err != nil { 3422 return nil, err 3423 } 3424 ret := &Empty{ 3425 ServerResponse: googleapi.ServerResponse{ 3426 Header: res.Header, 3427 HTTPStatusCode: res.StatusCode, 3428 }, 3429 } 3430 target := &ret 3431 if err := gensupport.DecodeResponse(target, res); err != nil { 3432 return nil, err 3433 } 3434 return ret, nil 3435 // { 3436 // "description": "Deletes the specified attachment for the given beacon. Each attachment has\na unique attachment name (`attachmentName`) which is returned when you\nfetch the attachment data via this API. You specify this with the delete\nrequest to control which attachment is removed. This operation cannot be\nundone.\n\nAuthenticate using an [OAuth access\ntoken](https://developers.google.com/identity/protocols/OAuth2) from a\nsigned-in user with **Is owner** or **Can edit** permissions in the Google\nDevelopers Console project.", 3437 // "flatPath": "v1beta1/beacons/{beaconsId}/attachments/{attachmentsId}", 3438 // "httpMethod": "DELETE", 3439 // "id": "proximitybeacon.beacons.attachments.delete", 3440 // "parameterOrder": [ 3441 // "attachmentName" 3442 // ], 3443 // "parameters": { 3444 // "attachmentName": { 3445 // "description": "The attachment name (`attachmentName`) of\nthe attachment to remove. For example:\n`beacons/3!893737abc9/attachments/c5e937-af0-494-959-ec49d12738`. For\nEddystone-EID beacons, the beacon ID portion (`3!893737abc9`) may be the\nbeacon's current EID, or its \"stable\" Eddystone-UID.\nRequired.", 3446 // "location": "path", 3447 // "pattern": "^beacons/[^/]+/attachments/[^/]+$", 3448 // "required": true, 3449 // "type": "string" 3450 // }, 3451 // "projectId": { 3452 // "description": "The project id of the attachment to delete. If not provided, the project\nthat is making the request is used.\nOptional.", 3453 // "location": "query", 3454 // "type": "string" 3455 // } 3456 // }, 3457 // "path": "v1beta1/{+attachmentName}", 3458 // "response": { 3459 // "$ref": "Empty" 3460 // }, 3461 // "scopes": [ 3462 // "https://www.googleapis.com/auth/userlocation.beacon.registry" 3463 // ] 3464 // } 3465 3466} 3467 3468// method id "proximitybeacon.beacons.attachments.list": 3469 3470type BeaconsAttachmentsListCall struct { 3471 s *Service 3472 beaconName string 3473 urlParams_ gensupport.URLParams 3474 ifNoneMatch_ string 3475 ctx_ context.Context 3476 header_ http.Header 3477} 3478 3479// List: Returns the attachments for the specified beacon that match the 3480// specified 3481// namespaced-type pattern. 3482// 3483// To control which namespaced types are returned, you add 3484// the 3485// `namespacedType` query parameter to the request. You must either 3486// use 3487// `*/*`, to return all attachments, or the namespace must be one of 3488// the ones returned from the `namespaces` endpoint. 3489// 3490// Authenticate using an [OAuth 3491// access 3492// token](https://developers.google.com/identity/protocols/OAuth2) 3493// from a 3494// signed-in user with **viewer**, **Is owner** or **Can edit** 3495// permissions in 3496// the Google Developers Console project. 3497func (r *BeaconsAttachmentsService) List(beaconName string) *BeaconsAttachmentsListCall { 3498 c := &BeaconsAttachmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3499 c.beaconName = beaconName 3500 return c 3501} 3502 3503// NamespacedType sets the optional parameter "namespacedType": 3504// Specifies the namespace and type of attachment to include in response 3505// in 3506// <var>namespace/type</var> format. Accepts `*/*` to specify 3507// "all types in all namespaces". 3508func (c *BeaconsAttachmentsListCall) NamespacedType(namespacedType string) *BeaconsAttachmentsListCall { 3509 c.urlParams_.Set("namespacedType", namespacedType) 3510 return c 3511} 3512 3513// ProjectId sets the optional parameter "projectId": The project id to 3514// list beacon attachments under. This field can be 3515// used when "*" is specified to mean all attachment namespaces. 3516// Projects 3517// may have multiple attachments with multiple namespaces. If "*" 3518// is 3519// specified and the projectId string is empty, then the project 3520// making the request is used. 3521func (c *BeaconsAttachmentsListCall) ProjectId(projectId string) *BeaconsAttachmentsListCall { 3522 c.urlParams_.Set("projectId", projectId) 3523 return c 3524} 3525 3526// Fields allows partial responses to be retrieved. See 3527// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3528// for more information. 3529func (c *BeaconsAttachmentsListCall) Fields(s ...googleapi.Field) *BeaconsAttachmentsListCall { 3530 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3531 return c 3532} 3533 3534// IfNoneMatch sets the optional parameter which makes the operation 3535// fail if the object's ETag matches the given value. This is useful for 3536// getting updates only after the object has changed since the last 3537// request. Use googleapi.IsNotModified to check whether the response 3538// error from Do is the result of In-None-Match. 3539func (c *BeaconsAttachmentsListCall) IfNoneMatch(entityTag string) *BeaconsAttachmentsListCall { 3540 c.ifNoneMatch_ = entityTag 3541 return c 3542} 3543 3544// Context sets the context to be used in this call's Do method. Any 3545// pending HTTP request will be aborted if the provided context is 3546// canceled. 3547func (c *BeaconsAttachmentsListCall) Context(ctx context.Context) *BeaconsAttachmentsListCall { 3548 c.ctx_ = ctx 3549 return c 3550} 3551 3552// Header returns an http.Header that can be modified by the caller to 3553// add HTTP headers to the request. 3554func (c *BeaconsAttachmentsListCall) Header() http.Header { 3555 if c.header_ == nil { 3556 c.header_ = make(http.Header) 3557 } 3558 return c.header_ 3559} 3560 3561func (c *BeaconsAttachmentsListCall) doRequest(alt string) (*http.Response, error) { 3562 reqHeaders := make(http.Header) 3563 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317") 3564 for k, v := range c.header_ { 3565 reqHeaders[k] = v 3566 } 3567 reqHeaders.Set("User-Agent", c.s.userAgent()) 3568 if c.ifNoneMatch_ != "" { 3569 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3570 } 3571 var body io.Reader = nil 3572 c.urlParams_.Set("alt", alt) 3573 c.urlParams_.Set("prettyPrint", "false") 3574 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+beaconName}/attachments") 3575 urls += "?" + c.urlParams_.Encode() 3576 req, err := http.NewRequest("GET", urls, body) 3577 if err != nil { 3578 return nil, err 3579 } 3580 req.Header = reqHeaders 3581 googleapi.Expand(req.URL, map[string]string{ 3582 "beaconName": c.beaconName, 3583 }) 3584 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3585} 3586 3587// Do executes the "proximitybeacon.beacons.attachments.list" call. 3588// Exactly one of *ListBeaconAttachmentsResponse or error will be 3589// non-nil. Any non-2xx status code is an error. Response headers are in 3590// either *ListBeaconAttachmentsResponse.ServerResponse.Header or (if a 3591// response was returned at all) in error.(*googleapi.Error).Header. Use 3592// googleapi.IsNotModified to check whether the returned error was 3593// because http.StatusNotModified was returned. 3594func (c *BeaconsAttachmentsListCall) Do(opts ...googleapi.CallOption) (*ListBeaconAttachmentsResponse, error) { 3595 gensupport.SetOptions(c.urlParams_, opts...) 3596 res, err := c.doRequest("json") 3597 if res != nil && res.StatusCode == http.StatusNotModified { 3598 if res.Body != nil { 3599 res.Body.Close() 3600 } 3601 return nil, &googleapi.Error{ 3602 Code: res.StatusCode, 3603 Header: res.Header, 3604 } 3605 } 3606 if err != nil { 3607 return nil, err 3608 } 3609 defer googleapi.CloseBody(res) 3610 if err := googleapi.CheckResponse(res); err != nil { 3611 return nil, err 3612 } 3613 ret := &ListBeaconAttachmentsResponse{ 3614 ServerResponse: googleapi.ServerResponse{ 3615 Header: res.Header, 3616 HTTPStatusCode: res.StatusCode, 3617 }, 3618 } 3619 target := &ret 3620 if err := gensupport.DecodeResponse(target, res); err != nil { 3621 return nil, err 3622 } 3623 return ret, nil 3624 // { 3625 // "description": "Returns the attachments for the specified beacon that match the specified\nnamespaced-type pattern.\n\nTo control which namespaced types are returned, you add the\n`namespacedType` query parameter to the request. You must either use\n`*/*`, to return all attachments, or the namespace must be one of\nthe ones returned from the `namespaces` endpoint.\n\nAuthenticate using an [OAuth access\ntoken](https://developers.google.com/identity/protocols/OAuth2) from a\nsigned-in user with **viewer**, **Is owner** or **Can edit** permissions in\nthe Google Developers Console project.", 3626 // "flatPath": "v1beta1/beacons/{beaconsId}/attachments", 3627 // "httpMethod": "GET", 3628 // "id": "proximitybeacon.beacons.attachments.list", 3629 // "parameterOrder": [ 3630 // "beaconName" 3631 // ], 3632 // "parameters": { 3633 // "beaconName": { 3634 // "description": "Beacon whose attachments should be fetched. A beacon name has the\nformat \"beacons/N!beaconId\" where the beaconId is the base16 ID broadcast\nby the beacon and N is a code for the beacon's type. Possible values are\n`3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5`\nfor AltBeacon. For Eddystone-EID beacons, you may use either the\ncurrent EID or the beacon's \"stable\" UID.\nRequired.", 3635 // "location": "path", 3636 // "pattern": "^beacons/[^/]+$", 3637 // "required": true, 3638 // "type": "string" 3639 // }, 3640 // "namespacedType": { 3641 // "description": "Specifies the namespace and type of attachment to include in response in\n\u003cvar\u003enamespace/type\u003c/var\u003e format. Accepts `*/*` to specify\n\"all types in all namespaces\".", 3642 // "location": "query", 3643 // "type": "string" 3644 // }, 3645 // "projectId": { 3646 // "description": "The project id to list beacon attachments under. This field can be\nused when \"*\" is specified to mean all attachment namespaces. Projects\nmay have multiple attachments with multiple namespaces. If \"*\" is\nspecified and the projectId string is empty, then the project\nmaking the request is used.\nOptional.", 3647 // "location": "query", 3648 // "type": "string" 3649 // } 3650 // }, 3651 // "path": "v1beta1/{+beaconName}/attachments", 3652 // "response": { 3653 // "$ref": "ListBeaconAttachmentsResponse" 3654 // }, 3655 // "scopes": [ 3656 // "https://www.googleapis.com/auth/userlocation.beacon.registry" 3657 // ] 3658 // } 3659 3660} 3661 3662// method id "proximitybeacon.beacons.diagnostics.list": 3663 3664type BeaconsDiagnosticsListCall struct { 3665 s *Service 3666 beaconName string 3667 urlParams_ gensupport.URLParams 3668 ifNoneMatch_ string 3669 ctx_ context.Context 3670 header_ http.Header 3671} 3672 3673// List: List the diagnostics for a single beacon. You can also list 3674// diagnostics for 3675// all the beacons owned by your Google Developers Console project by 3676// using 3677// the beacon name `beacons/-`. 3678// 3679// Authenticate using an [OAuth 3680// access 3681// token](https://developers.google.com/identity/protocols/OAuth2) 3682// from a 3683// signed-in user with **viewer**, **Is owner** or **Can edit** 3684// permissions in 3685// the Google Developers Console project. 3686func (r *BeaconsDiagnosticsService) List(beaconName string) *BeaconsDiagnosticsListCall { 3687 c := &BeaconsDiagnosticsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3688 c.beaconName = beaconName 3689 return c 3690} 3691 3692// AlertFilter sets the optional parameter "alertFilter": Requests only 3693// beacons that have the given alert. For example, to find 3694// beacons that have low batteries use `alert_filter=LOW_BATTERY`. 3695// 3696// Possible values: 3697// "ALERT_UNSPECIFIED" 3698// "WRONG_LOCATION" 3699// "LOW_BATTERY" 3700// "LOW_ACTIVITY" 3701func (c *BeaconsDiagnosticsListCall) AlertFilter(alertFilter string) *BeaconsDiagnosticsListCall { 3702 c.urlParams_.Set("alertFilter", alertFilter) 3703 return c 3704} 3705 3706// PageSize sets the optional parameter "pageSize": Specifies the 3707// maximum number of results to return. Defaults to 3708// 10. Maximum 1000. 3709func (c *BeaconsDiagnosticsListCall) PageSize(pageSize int64) *BeaconsDiagnosticsListCall { 3710 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 3711 return c 3712} 3713 3714// PageToken sets the optional parameter "pageToken": Requests results 3715// that occur after the `page_token`, obtained from the 3716// response to a previous request. 3717func (c *BeaconsDiagnosticsListCall) PageToken(pageToken string) *BeaconsDiagnosticsListCall { 3718 c.urlParams_.Set("pageToken", pageToken) 3719 return c 3720} 3721 3722// ProjectId sets the optional parameter "projectId": Requests only 3723// diagnostic records for the given project id. If not set, 3724// then the project making the request will be used for looking 3725// up 3726// diagnostic records. 3727func (c *BeaconsDiagnosticsListCall) ProjectId(projectId string) *BeaconsDiagnosticsListCall { 3728 c.urlParams_.Set("projectId", projectId) 3729 return c 3730} 3731 3732// Fields allows partial responses to be retrieved. See 3733// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3734// for more information. 3735func (c *BeaconsDiagnosticsListCall) Fields(s ...googleapi.Field) *BeaconsDiagnosticsListCall { 3736 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3737 return c 3738} 3739 3740// IfNoneMatch sets the optional parameter which makes the operation 3741// fail if the object's ETag matches the given value. This is useful for 3742// getting updates only after the object has changed since the last 3743// request. Use googleapi.IsNotModified to check whether the response 3744// error from Do is the result of In-None-Match. 3745func (c *BeaconsDiagnosticsListCall) IfNoneMatch(entityTag string) *BeaconsDiagnosticsListCall { 3746 c.ifNoneMatch_ = entityTag 3747 return c 3748} 3749 3750// Context sets the context to be used in this call's Do method. Any 3751// pending HTTP request will be aborted if the provided context is 3752// canceled. 3753func (c *BeaconsDiagnosticsListCall) Context(ctx context.Context) *BeaconsDiagnosticsListCall { 3754 c.ctx_ = ctx 3755 return c 3756} 3757 3758// Header returns an http.Header that can be modified by the caller to 3759// add HTTP headers to the request. 3760func (c *BeaconsDiagnosticsListCall) Header() http.Header { 3761 if c.header_ == nil { 3762 c.header_ = make(http.Header) 3763 } 3764 return c.header_ 3765} 3766 3767func (c *BeaconsDiagnosticsListCall) doRequest(alt string) (*http.Response, error) { 3768 reqHeaders := make(http.Header) 3769 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317") 3770 for k, v := range c.header_ { 3771 reqHeaders[k] = v 3772 } 3773 reqHeaders.Set("User-Agent", c.s.userAgent()) 3774 if c.ifNoneMatch_ != "" { 3775 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3776 } 3777 var body io.Reader = nil 3778 c.urlParams_.Set("alt", alt) 3779 c.urlParams_.Set("prettyPrint", "false") 3780 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+beaconName}/diagnostics") 3781 urls += "?" + c.urlParams_.Encode() 3782 req, err := http.NewRequest("GET", urls, body) 3783 if err != nil { 3784 return nil, err 3785 } 3786 req.Header = reqHeaders 3787 googleapi.Expand(req.URL, map[string]string{ 3788 "beaconName": c.beaconName, 3789 }) 3790 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3791} 3792 3793// Do executes the "proximitybeacon.beacons.diagnostics.list" call. 3794// Exactly one of *ListDiagnosticsResponse or error will be non-nil. Any 3795// non-2xx status code is an error. Response headers are in either 3796// *ListDiagnosticsResponse.ServerResponse.Header or (if a response was 3797// returned at all) in error.(*googleapi.Error).Header. Use 3798// googleapi.IsNotModified to check whether the returned error was 3799// because http.StatusNotModified was returned. 3800func (c *BeaconsDiagnosticsListCall) Do(opts ...googleapi.CallOption) (*ListDiagnosticsResponse, error) { 3801 gensupport.SetOptions(c.urlParams_, opts...) 3802 res, err := c.doRequest("json") 3803 if res != nil && res.StatusCode == http.StatusNotModified { 3804 if res.Body != nil { 3805 res.Body.Close() 3806 } 3807 return nil, &googleapi.Error{ 3808 Code: res.StatusCode, 3809 Header: res.Header, 3810 } 3811 } 3812 if err != nil { 3813 return nil, err 3814 } 3815 defer googleapi.CloseBody(res) 3816 if err := googleapi.CheckResponse(res); err != nil { 3817 return nil, err 3818 } 3819 ret := &ListDiagnosticsResponse{ 3820 ServerResponse: googleapi.ServerResponse{ 3821 Header: res.Header, 3822 HTTPStatusCode: res.StatusCode, 3823 }, 3824 } 3825 target := &ret 3826 if err := gensupport.DecodeResponse(target, res); err != nil { 3827 return nil, err 3828 } 3829 return ret, nil 3830 // { 3831 // "description": "List the diagnostics for a single beacon. You can also list diagnostics for\nall the beacons owned by your Google Developers Console project by using\nthe beacon name `beacons/-`.\n\nAuthenticate using an [OAuth access\ntoken](https://developers.google.com/identity/protocols/OAuth2) from a\nsigned-in user with **viewer**, **Is owner** or **Can edit** permissions in\nthe Google Developers Console project.", 3832 // "flatPath": "v1beta1/beacons/{beaconsId}/diagnostics", 3833 // "httpMethod": "GET", 3834 // "id": "proximitybeacon.beacons.diagnostics.list", 3835 // "parameterOrder": [ 3836 // "beaconName" 3837 // ], 3838 // "parameters": { 3839 // "alertFilter": { 3840 // "description": "Requests only beacons that have the given alert. For example, to find\nbeacons that have low batteries use `alert_filter=LOW_BATTERY`.", 3841 // "enum": [ 3842 // "ALERT_UNSPECIFIED", 3843 // "WRONG_LOCATION", 3844 // "LOW_BATTERY", 3845 // "LOW_ACTIVITY" 3846 // ], 3847 // "location": "query", 3848 // "type": "string" 3849 // }, 3850 // "beaconName": { 3851 // "description": "Beacon that the diagnostics are for.", 3852 // "location": "path", 3853 // "pattern": "^beacons/[^/]+$", 3854 // "required": true, 3855 // "type": "string" 3856 // }, 3857 // "pageSize": { 3858 // "description": "Specifies the maximum number of results to return. Defaults to\n10. Maximum 1000. Optional.", 3859 // "format": "int32", 3860 // "location": "query", 3861 // "type": "integer" 3862 // }, 3863 // "pageToken": { 3864 // "description": "Requests results that occur after the `page_token`, obtained from the\nresponse to a previous request. Optional.", 3865 // "location": "query", 3866 // "type": "string" 3867 // }, 3868 // "projectId": { 3869 // "description": "Requests only diagnostic records for the given project id. If not set,\nthen the project making the request will be used for looking up\ndiagnostic records. Optional.", 3870 // "location": "query", 3871 // "type": "string" 3872 // } 3873 // }, 3874 // "path": "v1beta1/{+beaconName}/diagnostics", 3875 // "response": { 3876 // "$ref": "ListDiagnosticsResponse" 3877 // }, 3878 // "scopes": [ 3879 // "https://www.googleapis.com/auth/userlocation.beacon.registry" 3880 // ] 3881 // } 3882 3883} 3884 3885// Pages invokes f for each page of results. 3886// A non-nil error returned from f will halt the iteration. 3887// The provided context supersedes any context provided to the Context method. 3888func (c *BeaconsDiagnosticsListCall) Pages(ctx context.Context, f func(*ListDiagnosticsResponse) error) error { 3889 c.ctx_ = ctx 3890 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 3891 for { 3892 x, err := c.Do() 3893 if err != nil { 3894 return err 3895 } 3896 if err := f(x); err != nil { 3897 return err 3898 } 3899 if x.NextPageToken == "" { 3900 return nil 3901 } 3902 c.PageToken(x.NextPageToken) 3903 } 3904} 3905 3906// method id "proximitybeacon.namespaces.list": 3907 3908type NamespacesListCall struct { 3909 s *Service 3910 urlParams_ gensupport.URLParams 3911 ifNoneMatch_ string 3912 ctx_ context.Context 3913 header_ http.Header 3914} 3915 3916// List: Lists all attachment namespaces owned by your Google Developers 3917// Console 3918// project. Attachment data associated with a beacon must include 3919// a 3920// namespaced type, and the namespace must be owned by your 3921// project. 3922// 3923// Authenticate using an [OAuth 3924// access 3925// token](https://developers.google.com/identity/protocols/OAuth2) 3926// from a 3927// signed-in user with **viewer**, **Is owner** or **Can edit** 3928// permissions in 3929// the Google Developers Console project. 3930func (r *NamespacesService) List() *NamespacesListCall { 3931 c := &NamespacesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3932 return c 3933} 3934 3935// ProjectId sets the optional parameter "projectId": The project id to 3936// list namespaces under. 3937func (c *NamespacesListCall) ProjectId(projectId string) *NamespacesListCall { 3938 c.urlParams_.Set("projectId", projectId) 3939 return c 3940} 3941 3942// Fields allows partial responses to be retrieved. See 3943// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3944// for more information. 3945func (c *NamespacesListCall) Fields(s ...googleapi.Field) *NamespacesListCall { 3946 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3947 return c 3948} 3949 3950// IfNoneMatch sets the optional parameter which makes the operation 3951// fail if the object's ETag matches the given value. This is useful for 3952// getting updates only after the object has changed since the last 3953// request. Use googleapi.IsNotModified to check whether the response 3954// error from Do is the result of In-None-Match. 3955func (c *NamespacesListCall) IfNoneMatch(entityTag string) *NamespacesListCall { 3956 c.ifNoneMatch_ = entityTag 3957 return c 3958} 3959 3960// Context sets the context to be used in this call's Do method. Any 3961// pending HTTP request will be aborted if the provided context is 3962// canceled. 3963func (c *NamespacesListCall) Context(ctx context.Context) *NamespacesListCall { 3964 c.ctx_ = ctx 3965 return c 3966} 3967 3968// Header returns an http.Header that can be modified by the caller to 3969// add HTTP headers to the request. 3970func (c *NamespacesListCall) Header() http.Header { 3971 if c.header_ == nil { 3972 c.header_ = make(http.Header) 3973 } 3974 return c.header_ 3975} 3976 3977func (c *NamespacesListCall) doRequest(alt string) (*http.Response, error) { 3978 reqHeaders := make(http.Header) 3979 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317") 3980 for k, v := range c.header_ { 3981 reqHeaders[k] = v 3982 } 3983 reqHeaders.Set("User-Agent", c.s.userAgent()) 3984 if c.ifNoneMatch_ != "" { 3985 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3986 } 3987 var body io.Reader = nil 3988 c.urlParams_.Set("alt", alt) 3989 c.urlParams_.Set("prettyPrint", "false") 3990 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/namespaces") 3991 urls += "?" + c.urlParams_.Encode() 3992 req, err := http.NewRequest("GET", urls, body) 3993 if err != nil { 3994 return nil, err 3995 } 3996 req.Header = reqHeaders 3997 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3998} 3999 4000// Do executes the "proximitybeacon.namespaces.list" call. 4001// Exactly one of *ListNamespacesResponse or error will be non-nil. Any 4002// non-2xx status code is an error. Response headers are in either 4003// *ListNamespacesResponse.ServerResponse.Header or (if a response was 4004// returned at all) in error.(*googleapi.Error).Header. Use 4005// googleapi.IsNotModified to check whether the returned error was 4006// because http.StatusNotModified was returned. 4007func (c *NamespacesListCall) Do(opts ...googleapi.CallOption) (*ListNamespacesResponse, error) { 4008 gensupport.SetOptions(c.urlParams_, opts...) 4009 res, err := c.doRequest("json") 4010 if res != nil && res.StatusCode == http.StatusNotModified { 4011 if res.Body != nil { 4012 res.Body.Close() 4013 } 4014 return nil, &googleapi.Error{ 4015 Code: res.StatusCode, 4016 Header: res.Header, 4017 } 4018 } 4019 if err != nil { 4020 return nil, err 4021 } 4022 defer googleapi.CloseBody(res) 4023 if err := googleapi.CheckResponse(res); err != nil { 4024 return nil, err 4025 } 4026 ret := &ListNamespacesResponse{ 4027 ServerResponse: googleapi.ServerResponse{ 4028 Header: res.Header, 4029 HTTPStatusCode: res.StatusCode, 4030 }, 4031 } 4032 target := &ret 4033 if err := gensupport.DecodeResponse(target, res); err != nil { 4034 return nil, err 4035 } 4036 return ret, nil 4037 // { 4038 // "description": "Lists all attachment namespaces owned by your Google Developers Console\nproject. Attachment data associated with a beacon must include a\nnamespaced type, and the namespace must be owned by your project.\n\nAuthenticate using an [OAuth access\ntoken](https://developers.google.com/identity/protocols/OAuth2) from a\nsigned-in user with **viewer**, **Is owner** or **Can edit** permissions in\nthe Google Developers Console project.", 4039 // "flatPath": "v1beta1/namespaces", 4040 // "httpMethod": "GET", 4041 // "id": "proximitybeacon.namespaces.list", 4042 // "parameterOrder": [], 4043 // "parameters": { 4044 // "projectId": { 4045 // "description": "The project id to list namespaces under.\nOptional.", 4046 // "location": "query", 4047 // "type": "string" 4048 // } 4049 // }, 4050 // "path": "v1beta1/namespaces", 4051 // "response": { 4052 // "$ref": "ListNamespacesResponse" 4053 // }, 4054 // "scopes": [ 4055 // "https://www.googleapis.com/auth/userlocation.beacon.registry" 4056 // ] 4057 // } 4058 4059} 4060 4061// method id "proximitybeacon.namespaces.update": 4062 4063type NamespacesUpdateCall struct { 4064 s *Service 4065 namespaceName string 4066 namespace *Namespace 4067 urlParams_ gensupport.URLParams 4068 ctx_ context.Context 4069 header_ http.Header 4070} 4071 4072// Update: Updates the information about the specified namespace. Only 4073// the namespace 4074// visibility can be updated. 4075func (r *NamespacesService) Update(namespaceName string, namespace *Namespace) *NamespacesUpdateCall { 4076 c := &NamespacesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4077 c.namespaceName = namespaceName 4078 c.namespace = namespace 4079 return c 4080} 4081 4082// ProjectId sets the optional parameter "projectId": The project id of 4083// the namespace to update. If the project id is not 4084// specified then the project making the request is used. The project 4085// id 4086// must match the project that owns the beacon. 4087func (c *NamespacesUpdateCall) ProjectId(projectId string) *NamespacesUpdateCall { 4088 c.urlParams_.Set("projectId", projectId) 4089 return c 4090} 4091 4092// Fields allows partial responses to be retrieved. See 4093// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4094// for more information. 4095func (c *NamespacesUpdateCall) Fields(s ...googleapi.Field) *NamespacesUpdateCall { 4096 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4097 return c 4098} 4099 4100// Context sets the context to be used in this call's Do method. Any 4101// pending HTTP request will be aborted if the provided context is 4102// canceled. 4103func (c *NamespacesUpdateCall) Context(ctx context.Context) *NamespacesUpdateCall { 4104 c.ctx_ = ctx 4105 return c 4106} 4107 4108// Header returns an http.Header that can be modified by the caller to 4109// add HTTP headers to the request. 4110func (c *NamespacesUpdateCall) Header() http.Header { 4111 if c.header_ == nil { 4112 c.header_ = make(http.Header) 4113 } 4114 return c.header_ 4115} 4116 4117func (c *NamespacesUpdateCall) doRequest(alt string) (*http.Response, error) { 4118 reqHeaders := make(http.Header) 4119 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317") 4120 for k, v := range c.header_ { 4121 reqHeaders[k] = v 4122 } 4123 reqHeaders.Set("User-Agent", c.s.userAgent()) 4124 var body io.Reader = nil 4125 body, err := googleapi.WithoutDataWrapper.JSONReader(c.namespace) 4126 if err != nil { 4127 return nil, err 4128 } 4129 reqHeaders.Set("Content-Type", "application/json") 4130 c.urlParams_.Set("alt", alt) 4131 c.urlParams_.Set("prettyPrint", "false") 4132 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+namespaceName}") 4133 urls += "?" + c.urlParams_.Encode() 4134 req, err := http.NewRequest("PUT", urls, body) 4135 if err != nil { 4136 return nil, err 4137 } 4138 req.Header = reqHeaders 4139 googleapi.Expand(req.URL, map[string]string{ 4140 "namespaceName": c.namespaceName, 4141 }) 4142 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4143} 4144 4145// Do executes the "proximitybeacon.namespaces.update" call. 4146// Exactly one of *Namespace or error will be non-nil. Any non-2xx 4147// status code is an error. Response headers are in either 4148// *Namespace.ServerResponse.Header or (if a response was returned at 4149// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4150// to check whether the returned error was because 4151// http.StatusNotModified was returned. 4152func (c *NamespacesUpdateCall) Do(opts ...googleapi.CallOption) (*Namespace, error) { 4153 gensupport.SetOptions(c.urlParams_, opts...) 4154 res, err := c.doRequest("json") 4155 if res != nil && res.StatusCode == http.StatusNotModified { 4156 if res.Body != nil { 4157 res.Body.Close() 4158 } 4159 return nil, &googleapi.Error{ 4160 Code: res.StatusCode, 4161 Header: res.Header, 4162 } 4163 } 4164 if err != nil { 4165 return nil, err 4166 } 4167 defer googleapi.CloseBody(res) 4168 if err := googleapi.CheckResponse(res); err != nil { 4169 return nil, err 4170 } 4171 ret := &Namespace{ 4172 ServerResponse: googleapi.ServerResponse{ 4173 Header: res.Header, 4174 HTTPStatusCode: res.StatusCode, 4175 }, 4176 } 4177 target := &ret 4178 if err := gensupport.DecodeResponse(target, res); err != nil { 4179 return nil, err 4180 } 4181 return ret, nil 4182 // { 4183 // "description": "Updates the information about the specified namespace. Only the namespace\nvisibility can be updated.", 4184 // "flatPath": "v1beta1/namespaces/{namespacesId}", 4185 // "httpMethod": "PUT", 4186 // "id": "proximitybeacon.namespaces.update", 4187 // "parameterOrder": [ 4188 // "namespaceName" 4189 // ], 4190 // "parameters": { 4191 // "namespaceName": { 4192 // "description": "Resource name of this namespace. Namespaces names have the format:\n\u003ccode\u003enamespaces/\u003cvar\u003enamespace\u003c/var\u003e\u003c/code\u003e.", 4193 // "location": "path", 4194 // "pattern": "^namespaces/[^/]+$", 4195 // "required": true, 4196 // "type": "string" 4197 // }, 4198 // "projectId": { 4199 // "description": "The project id of the namespace to update. If the project id is not\nspecified then the project making the request is used. The project id\nmust match the project that owns the beacon.\nOptional.", 4200 // "location": "query", 4201 // "type": "string" 4202 // } 4203 // }, 4204 // "path": "v1beta1/{+namespaceName}", 4205 // "request": { 4206 // "$ref": "Namespace" 4207 // }, 4208 // "response": { 4209 // "$ref": "Namespace" 4210 // }, 4211 // "scopes": [ 4212 // "https://www.googleapis.com/auth/userlocation.beacon.registry" 4213 // ] 4214 // } 4215 4216} 4217 4218// method id "proximitybeacon.getEidparams": 4219 4220type V1beta1GetEidparamsCall struct { 4221 s *Service 4222 urlParams_ gensupport.URLParams 4223 ifNoneMatch_ string 4224 ctx_ context.Context 4225 header_ http.Header 4226} 4227 4228// GetEidparams: Gets the Proximity Beacon API's current public key and 4229// associated 4230// parameters used to initiate the Diffie-Hellman key exchange required 4231// to 4232// register a beacon that broadcasts the Eddystone-EID format. This 4233// key 4234// changes periodically; clients may cache it and re-use the same public 4235// key 4236// to provision and register multiple beacons. However, clients should 4237// be 4238// prepared to refresh this key when they encounter an error registering 4239// an 4240// Eddystone-EID beacon. 4241func (r *V1beta1Service) GetEidparams() *V1beta1GetEidparamsCall { 4242 c := &V1beta1GetEidparamsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4243 return c 4244} 4245 4246// Fields allows partial responses to be retrieved. See 4247// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4248// for more information. 4249func (c *V1beta1GetEidparamsCall) Fields(s ...googleapi.Field) *V1beta1GetEidparamsCall { 4250 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4251 return c 4252} 4253 4254// IfNoneMatch sets the optional parameter which makes the operation 4255// fail if the object's ETag matches the given value. This is useful for 4256// getting updates only after the object has changed since the last 4257// request. Use googleapi.IsNotModified to check whether the response 4258// error from Do is the result of In-None-Match. 4259func (c *V1beta1GetEidparamsCall) IfNoneMatch(entityTag string) *V1beta1GetEidparamsCall { 4260 c.ifNoneMatch_ = entityTag 4261 return c 4262} 4263 4264// Context sets the context to be used in this call's Do method. Any 4265// pending HTTP request will be aborted if the provided context is 4266// canceled. 4267func (c *V1beta1GetEidparamsCall) Context(ctx context.Context) *V1beta1GetEidparamsCall { 4268 c.ctx_ = ctx 4269 return c 4270} 4271 4272// Header returns an http.Header that can be modified by the caller to 4273// add HTTP headers to the request. 4274func (c *V1beta1GetEidparamsCall) Header() http.Header { 4275 if c.header_ == nil { 4276 c.header_ = make(http.Header) 4277 } 4278 return c.header_ 4279} 4280 4281func (c *V1beta1GetEidparamsCall) doRequest(alt string) (*http.Response, error) { 4282 reqHeaders := make(http.Header) 4283 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317") 4284 for k, v := range c.header_ { 4285 reqHeaders[k] = v 4286 } 4287 reqHeaders.Set("User-Agent", c.s.userAgent()) 4288 if c.ifNoneMatch_ != "" { 4289 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4290 } 4291 var body io.Reader = nil 4292 c.urlParams_.Set("alt", alt) 4293 c.urlParams_.Set("prettyPrint", "false") 4294 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/eidparams") 4295 urls += "?" + c.urlParams_.Encode() 4296 req, err := http.NewRequest("GET", urls, body) 4297 if err != nil { 4298 return nil, err 4299 } 4300 req.Header = reqHeaders 4301 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4302} 4303 4304// Do executes the "proximitybeacon.getEidparams" call. 4305// Exactly one of *EphemeralIdRegistrationParams or error will be 4306// non-nil. Any non-2xx status code is an error. Response headers are in 4307// either *EphemeralIdRegistrationParams.ServerResponse.Header or (if a 4308// response was returned at all) in error.(*googleapi.Error).Header. Use 4309// googleapi.IsNotModified to check whether the returned error was 4310// because http.StatusNotModified was returned. 4311func (c *V1beta1GetEidparamsCall) Do(opts ...googleapi.CallOption) (*EphemeralIdRegistrationParams, error) { 4312 gensupport.SetOptions(c.urlParams_, opts...) 4313 res, err := c.doRequest("json") 4314 if res != nil && res.StatusCode == http.StatusNotModified { 4315 if res.Body != nil { 4316 res.Body.Close() 4317 } 4318 return nil, &googleapi.Error{ 4319 Code: res.StatusCode, 4320 Header: res.Header, 4321 } 4322 } 4323 if err != nil { 4324 return nil, err 4325 } 4326 defer googleapi.CloseBody(res) 4327 if err := googleapi.CheckResponse(res); err != nil { 4328 return nil, err 4329 } 4330 ret := &EphemeralIdRegistrationParams{ 4331 ServerResponse: googleapi.ServerResponse{ 4332 Header: res.Header, 4333 HTTPStatusCode: res.StatusCode, 4334 }, 4335 } 4336 target := &ret 4337 if err := gensupport.DecodeResponse(target, res); err != nil { 4338 return nil, err 4339 } 4340 return ret, nil 4341 // { 4342 // "description": "Gets the Proximity Beacon API's current public key and associated\nparameters used to initiate the Diffie-Hellman key exchange required to\nregister a beacon that broadcasts the Eddystone-EID format. This key\nchanges periodically; clients may cache it and re-use the same public key\nto provision and register multiple beacons. However, clients should be\nprepared to refresh this key when they encounter an error registering an\nEddystone-EID beacon.", 4343 // "flatPath": "v1beta1/eidparams", 4344 // "httpMethod": "GET", 4345 // "id": "proximitybeacon.getEidparams", 4346 // "parameterOrder": [], 4347 // "parameters": {}, 4348 // "path": "v1beta1/eidparams", 4349 // "response": { 4350 // "$ref": "EphemeralIdRegistrationParams" 4351 // }, 4352 // "scopes": [ 4353 // "https://www.googleapis.com/auth/userlocation.beacon.registry" 4354 // ] 4355 // } 4356 4357} 4358