Class: Google::Apis::ProximitybeaconV1beta1::Beacon
- Inherits:
-
Object
- Object
- Google::Apis::ProximitybeaconV1beta1::Beacon
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- generated/google/apis/proximitybeacon_v1beta1/classes.rb,
generated/google/apis/proximitybeacon_v1beta1/representations.rb,
generated/google/apis/proximitybeacon_v1beta1/representations.rb
Overview
Details of a beacon device.
Instance Attribute Summary collapse
-
#advertised_id ⇒ Google::Apis::ProximitybeaconV1beta1::AdvertisedId
Defines a unique identifier of a beacon as broadcast by the device.
-
#beacon_name ⇒ String
Resource name of this beacon.
-
#description ⇒ String
Free text used to identify and describe the beacon.
-
#ephemeral_id_registration ⇒ Google::Apis::ProximitybeaconV1beta1::EphemeralIdRegistration
Write-only registration parameters for beacons using Eddystone-EID format.
-
#expected_stability ⇒ String
Expected location stability.
-
#indoor_level ⇒ Google::Apis::ProximitybeaconV1beta1::IndoorLevel
Indoor level, a human-readable string as returned by Google Maps APIs, useful to indicate which floor of a building a beacon is located on.
-
#lat_lng ⇒ Google::Apis::ProximitybeaconV1beta1::LatLng
An object representing a latitude/longitude pair.
-
#place_id ⇒ String
The Google Places API Place ID of the place where the beacon is deployed.
-
#properties ⇒ Hash<String,String>
Properties of the beacon device, for example battery type or firmware version.
-
#provisioning_key ⇒ String
Some beacons may require a user to provide an authorization key before changing any of its configuration (e.g. broadcast frames, transmit power).
-
#status ⇒ String
Current status of the beacon.
Instance Method Summary collapse
-
#initialize(**args) ⇒ Beacon
constructor
A new instance of Beacon.
-
#update!(**args) ⇒ Object
Update properties of this object.
Methods included from Core::JsonObjectSupport
Methods included from Core::Hashable
Constructor Details
#initialize(**args) ⇒ Beacon
Returns a new instance of Beacon
727 728 729 |
# File 'generated/google/apis/proximitybeacon_v1beta1/classes.rb', line 727 def initialize(**args) update!(**args) end |
Instance Attribute Details
#advertised_id ⇒ Google::Apis::ProximitybeaconV1beta1::AdvertisedId
Defines a unique identifier of a beacon as broadcast by the device.
Corresponds to the JSON property advertisedId
597 598 599 |
# File 'generated/google/apis/proximitybeacon_v1beta1/classes.rb', line 597 def advertised_id @advertised_id end |
#beacon_name ⇒ String
Resource name of this beacon. A beacon name has the format
"beacons/N!beaconId" where the beaconId is the base16 ID broadcast by
the beacon and N is a code for the beacon's type. Possible values are
3 for Eddystone, 1 for iBeacon, or 5 for AltBeacon.
This field must be left empty when registering. After reading a beacon,
clients can use the name for future operations.
Corresponds to the JSON property beaconName
718 719 720 |
# File 'generated/google/apis/proximitybeacon_v1beta1/classes.rb', line 718 def beacon_name @beacon_name end |
#description ⇒ String
Free text used to identify and describe the beacon. Maximum length 140
characters.
Optional.
Corresponds to the JSON property description
640 641 642 |
# File 'generated/google/apis/proximitybeacon_v1beta1/classes.rb', line 640 def description @description end |
#ephemeral_id_registration ⇒ Google::Apis::ProximitybeaconV1beta1::EphemeralIdRegistration
Write-only registration parameters for beacons using Eddystone-EID format. Two ways of securely registering an Eddystone-EID beacon with the service are supported:
- Perform an ECDH key exchange via this API, including a previous call
to
GET /v1beta1/eidparams. In this case the fieldsbeacon_ecdh_public_keyandservice_ecdh_public_keyshould be populated andbeacon_identity_keyshould not be populated. This method ensures that only the two parties in the ECDH key exchange can compute the identity key, which becomes a secret between them. - Derive or obtain the beacon's identity key via other secure means
(perhaps an ECDH key exchange between the beacon and a mobile device
or any other secure method), and then submit the resulting identity key
to the service. In this case
beacon_identity_keyfield should be populated, and neither ofbeacon_ecdh_public_keynorservice_ecdh_public_keyfields should be. The security of this method depends on how securely the parties involved (in particular the bluetooth client) handle the identity key, and obviously on how securely the identity key was generated. See the Eddystone specification at GitHub. Corresponds to the JSON propertyephemeralIdRegistration
621 622 623 |
# File 'generated/google/apis/proximitybeacon_v1beta1/classes.rb', line 621 def ephemeral_id_registration @ephemeral_id_registration end |
#expected_stability ⇒ String
Expected location stability. This is set when the beacon is registered or
updated, not automatically detected in any way.
Optional.
Corresponds to the JSON property expectedStability
725 726 727 |
# File 'generated/google/apis/proximitybeacon_v1beta1/classes.rb', line 725 def expected_stability @expected_stability end |
#indoor_level ⇒ Google::Apis::ProximitybeaconV1beta1::IndoorLevel
Indoor level, a human-readable string as returned by Google Maps APIs,
useful to indicate which floor of a building a beacon is located on.
Corresponds to the JSON property indoorLevel
708 709 710 |
# File 'generated/google/apis/proximitybeacon_v1beta1/classes.rb', line 708 def indoor_level @indoor_level end |
#lat_lng ⇒ Google::Apis::ProximitybeaconV1beta1::LatLng
An object representing a latitude/longitude pair. This is expressed as a pair
of doubles representing degrees latitude and degrees longitude. Unless
specified otherwise, this must conform to the
WGS84
standard. Values must be within normalized ranges.
Example of normalization code in Python:
def NormalizeLongitude(longitude):
"""Wraps decimal degrees longitude to [-180.0, 180.0]."""
q, r = divmod(longitude, 360.0)
if r > 180.0 or (r == 180.0 and q <= -1.0):
return r - 360.0
return r
def NormalizeLatLng(latitude, longitude):
"""Wraps decimal degrees latitude and longitude to
[-90.0, 90.0] and [-180.0, 180.0], respectively."""
r = latitude % 360.0
if r <= 90.0:
return r, NormalizeLongitude(longitude)
elif r >= 270.0:
return r - 360, NormalizeLongitude(longitude)
else:
return 180 - r, NormalizeLongitude(longitude + 180.0)
assert 180.0 == NormalizeLongitude(180.0)
assert -180.0 == NormalizeLongitude(-180.0)
assert -179.0 == NormalizeLongitude(181.0)
assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
The code in logs/storage/validator/logs_validator_traits.cc treats this type
as if it were annotated as ST_LOCATION.
Corresponds to the JSON property latLng
681 682 683 |
# File 'generated/google/apis/proximitybeacon_v1beta1/classes.rb', line 681 def lat_lng @lat_lng end |
#place_id ⇒ String
The Google Places API Place ID of the place where
the beacon is deployed. This is given when the beacon is registered or
updated, not automatically detected in any way.
Optional.
Corresponds to the JSON property placeId
689 690 691 |
# File 'generated/google/apis/proximitybeacon_v1beta1/classes.rb', line 689 def place_id @place_id end |
#properties ⇒ Hash<String,String>
Properties of the beacon device, for example battery type or firmware
version.
Optional.
Corresponds to the JSON property properties
696 697 698 |
# File 'generated/google/apis/proximitybeacon_v1beta1/classes.rb', line 696 def properties @properties end |
#provisioning_key ⇒ String
Some beacons may require a user to provide an authorization key before
changing any of its configuration (e.g. broadcast frames, transmit power).
This field provides a place to store and control access to that key.
This field is populated in responses to GET /v1beta1/beacons/3!beaconId
from users with write access to the given beacon. That is to say: If the
user is authorized to write the beacon's confidential data in the service,
the service considers them authorized to configure the beacon. Note
that this key grants nothing on the service, only on the beacon itself.
Corresponds to the JSON property provisioningKey
633 634 635 |
# File 'generated/google/apis/proximitybeacon_v1beta1/classes.rb', line 633 def provisioning_key @provisioning_key end |
#status ⇒ String
Current status of the beacon.
Required.
Corresponds to the JSON property status
702 703 704 |
# File 'generated/google/apis/proximitybeacon_v1beta1/classes.rb', line 702 def status @status end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
732 733 734 735 736 737 738 739 740 741 742 743 744 |
# File 'generated/google/apis/proximitybeacon_v1beta1/classes.rb', line 732 def update!(**args) @advertised_id = args[:advertised_id] if args.key?(:advertised_id) @ephemeral_id_registration = args[:ephemeral_id_registration] if args.key?(:ephemeral_id_registration) @provisioning_key = args[:provisioning_key] if args.key?(:provisioning_key) @description = args[:description] if args.key?(:description) @lat_lng = args[:lat_lng] if args.key?(:lat_lng) @place_id = args[:place_id] if args.key?(:place_id) @properties = args[:properties] if args.key?(:properties) @status = args[:status] if args.key?(:status) @indoor_level = args[:indoor_level] if args.key?(:indoor_level) @beacon_name = args[:beacon_name] if args.key?(:beacon_name) @expected_stability = args[:expected_stability] if args.key?(:expected_stability) end |