Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

4173 linhas
157 KiB

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