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