25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 

2653 satır
108 KiB

  1. // Copyright 2018 Google Inc. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // AUTO-GENERATED CODE. DO NOT EDIT.
  5. // Package spectrum provides access to the Google Spectrum Database API.
  6. //
  7. // See http://developers.google.com/spectrum
  8. //
  9. // Usage example:
  10. //
  11. // import "google.golang.org/api/spectrum/v1explorer"
  12. // ...
  13. // spectrumService, err := spectrum.New(oauthHttpClient)
  14. package spectrum // import "google.golang.org/api/spectrum/v1explorer"
  15. import (
  16. "bytes"
  17. "context"
  18. "encoding/json"
  19. "errors"
  20. "fmt"
  21. "io"
  22. "net/http"
  23. "net/url"
  24. "strconv"
  25. "strings"
  26. gensupport "google.golang.org/api/gensupport"
  27. googleapi "google.golang.org/api/googleapi"
  28. )
  29. // Always reference these packages, just in case the auto-generated code
  30. // below doesn't.
  31. var _ = bytes.NewBuffer
  32. var _ = strconv.Itoa
  33. var _ = fmt.Sprintf
  34. var _ = json.NewDecoder
  35. var _ = io.Copy
  36. var _ = url.Parse
  37. var _ = gensupport.MarshalJSON
  38. var _ = googleapi.Version
  39. var _ = errors.New
  40. var _ = strings.Replace
  41. var _ = context.Canceled
  42. const apiId = "spectrum:v1explorer"
  43. const apiName = "spectrum"
  44. const apiVersion = "v1explorer"
  45. const basePath = "https://www.googleapis.com/spectrum/v1explorer/paws/"
  46. func New(client *http.Client) (*Service, error) {
  47. if client == nil {
  48. return nil, errors.New("client is nil")
  49. }
  50. s := &Service{client: client, BasePath: basePath}
  51. s.Paws = NewPawsService(s)
  52. return s, nil
  53. }
  54. type Service struct {
  55. client *http.Client
  56. BasePath string // API endpoint base URL
  57. UserAgent string // optional additional User-Agent fragment
  58. Paws *PawsService
  59. }
  60. func (s *Service) userAgent() string {
  61. if s.UserAgent == "" {
  62. return googleapi.UserAgent
  63. }
  64. return googleapi.UserAgent + " " + s.UserAgent
  65. }
  66. func NewPawsService(s *Service) *PawsService {
  67. rs := &PawsService{s: s}
  68. return rs
  69. }
  70. type PawsService struct {
  71. s *Service
  72. }
  73. // AntennaCharacteristics: Antenna characteristics provide additional
  74. // information, such as the antenna height, antenna type, etc. Whether
  75. // antenna characteristics must be provided in a request depends on the
  76. // device type and regulatory domain.
  77. type AntennaCharacteristics struct {
  78. // Height: The antenna height in meters. Whether the antenna height is
  79. // required depends on the device type and the regulatory domain. Note
  80. // that the height may be negative.
  81. Height float64 `json:"height,omitempty"`
  82. // HeightType: If the height is required, then the height type (AGL for
  83. // above ground level or AMSL for above mean sea level) is also
  84. // required. The default is AGL.
  85. HeightType string `json:"heightType,omitempty"`
  86. // HeightUncertainty: The height uncertainty in meters. Whether this is
  87. // required depends on the regulatory domain.
  88. HeightUncertainty float64 `json:"heightUncertainty,omitempty"`
  89. // ForceSendFields is a list of field names (e.g. "Height") to
  90. // unconditionally include in API requests. By default, fields with
  91. // empty values are omitted from API requests. However, any non-pointer,
  92. // non-interface field appearing in ForceSendFields will be sent to the
  93. // server regardless of whether the field is empty or not. This may be
  94. // used to include empty fields in Patch requests.
  95. ForceSendFields []string `json:"-"`
  96. // NullFields is a list of field names (e.g. "Height") to include in API
  97. // requests with the JSON null value. By default, fields with empty
  98. // values are omitted from API requests. However, any field with an
  99. // empty value appearing in NullFields will be sent to the server as
  100. // null. It is an error if a field in this list has a non-empty value.
  101. // This may be used to include null fields in Patch requests.
  102. NullFields []string `json:"-"`
  103. }
  104. func (s *AntennaCharacteristics) MarshalJSON() ([]byte, error) {
  105. type NoMethod AntennaCharacteristics
  106. raw := NoMethod(*s)
  107. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  108. }
  109. func (s *AntennaCharacteristics) UnmarshalJSON(data []byte) error {
  110. type NoMethod AntennaCharacteristics
  111. var s1 struct {
  112. Height gensupport.JSONFloat64 `json:"height"`
  113. HeightUncertainty gensupport.JSONFloat64 `json:"heightUncertainty"`
  114. *NoMethod
  115. }
  116. s1.NoMethod = (*NoMethod)(s)
  117. if err := json.Unmarshal(data, &s1); err != nil {
  118. return err
  119. }
  120. s.Height = float64(s1.Height)
  121. s.HeightUncertainty = float64(s1.HeightUncertainty)
  122. return nil
  123. }
  124. // DatabaseSpec: This message contains the name and URI of a database.
  125. type DatabaseSpec struct {
  126. // Name: The display name for a database.
  127. Name string `json:"name,omitempty"`
  128. // Uri: The corresponding URI of the database.
  129. Uri string `json:"uri,omitempty"`
  130. // ForceSendFields is a list of field names (e.g. "Name") to
  131. // unconditionally include in API requests. By default, fields with
  132. // empty values are omitted from API requests. However, any non-pointer,
  133. // non-interface field appearing in ForceSendFields will be sent to the
  134. // server regardless of whether the field is empty or not. This may be
  135. // used to include empty fields in Patch requests.
  136. ForceSendFields []string `json:"-"`
  137. // NullFields is a list of field names (e.g. "Name") to include in API
  138. // requests with the JSON null value. By default, fields with empty
  139. // values are omitted from API requests. However, any field with an
  140. // empty value appearing in NullFields will be sent to the server as
  141. // null. It is an error if a field in this list has a non-empty value.
  142. // This may be used to include null fields in Patch requests.
  143. NullFields []string `json:"-"`
  144. }
  145. func (s *DatabaseSpec) MarshalJSON() ([]byte, error) {
  146. type NoMethod DatabaseSpec
  147. raw := NoMethod(*s)
  148. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  149. }
  150. // DbUpdateSpec: This message is provided by the database to notify
  151. // devices of an upcoming change to the database URI.
  152. type DbUpdateSpec struct {
  153. // Databases: A required list of one or more databases. A device should
  154. // update its preconfigured list of databases to replace (only) the
  155. // database that provided the response with the specified entries.
  156. Databases []*DatabaseSpec `json:"databases,omitempty"`
  157. // ForceSendFields is a list of field names (e.g. "Databases") to
  158. // unconditionally include in API requests. By default, fields with
  159. // empty values are omitted from API requests. However, any non-pointer,
  160. // non-interface field appearing in ForceSendFields will be sent to the
  161. // server regardless of whether the field is empty or not. This may be
  162. // used to include empty fields in Patch requests.
  163. ForceSendFields []string `json:"-"`
  164. // NullFields is a list of field names (e.g. "Databases") to include in
  165. // API requests with the JSON null value. By default, fields with empty
  166. // values are omitted from API requests. However, any field with an
  167. // empty value appearing in NullFields will be sent to the server as
  168. // null. It is an error if a field in this list has a non-empty value.
  169. // This may be used to include null fields in Patch requests.
  170. NullFields []string `json:"-"`
  171. }
  172. func (s *DbUpdateSpec) MarshalJSON() ([]byte, error) {
  173. type NoMethod DbUpdateSpec
  174. raw := NoMethod(*s)
  175. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  176. }
  177. // DeviceCapabilities: Device capabilities provide additional
  178. // information that may be used by a device to provide additional
  179. // information to the database that may help it to determine available
  180. // spectrum. If the database does not support device capabilities it
  181. // will ignore the parameter altogether.
  182. type DeviceCapabilities struct {
  183. // FrequencyRanges: An optional list of frequency ranges supported by
  184. // the device. Each element must contain start and stop frequencies in
  185. // which the device can operate. Channel identifiers are optional. When
  186. // specified, the database should not return available spectrum that
  187. // falls outside these ranges or channel IDs.
  188. FrequencyRanges []*FrequencyRange `json:"frequencyRanges,omitempty"`
  189. // ForceSendFields is a list of field names (e.g. "FrequencyRanges") to
  190. // unconditionally include in API requests. By default, fields with
  191. // empty values are omitted from API requests. However, any non-pointer,
  192. // non-interface field appearing in ForceSendFields will be sent to the
  193. // server regardless of whether the field is empty or not. This may be
  194. // used to include empty fields in Patch requests.
  195. ForceSendFields []string `json:"-"`
  196. // NullFields is a list of field names (e.g. "FrequencyRanges") to
  197. // include in API requests with the JSON null value. By default, fields
  198. // with empty values are omitted from API requests. However, any field
  199. // with an empty value appearing in NullFields will be sent to the
  200. // server as null. It is an error if a field in this list has a
  201. // non-empty value. This may be used to include null fields in Patch
  202. // requests.
  203. NullFields []string `json:"-"`
  204. }
  205. func (s *DeviceCapabilities) MarshalJSON() ([]byte, error) {
  206. type NoMethod DeviceCapabilities
  207. raw := NoMethod(*s)
  208. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  209. }
  210. // DeviceDescriptor: The device descriptor contains parameters that
  211. // identify the specific device, such as its manufacturer serial number,
  212. // regulatory-specific identifier (e.g., FCC ID), and any other device
  213. // characteristics required by regulatory domains.
  214. type DeviceDescriptor struct {
  215. // EtsiEnDeviceCategory: Specifies the ETSI white space device category.
  216. // Valid values are the strings master and slave. This field is
  217. // case-insensitive. Consult the ETSI documentation for details about
  218. // the device types.
  219. EtsiEnDeviceCategory string `json:"etsiEnDeviceCategory,omitempty"`
  220. // EtsiEnDeviceEmissionsClass: Specifies the ETSI white space device
  221. // emissions class. The values are represented by numeric strings, such
  222. // as 1, 2, etc. Consult the ETSI documentation for details about the
  223. // device types.
  224. EtsiEnDeviceEmissionsClass string `json:"etsiEnDeviceEmissionsClass,omitempty"`
  225. // EtsiEnDeviceType: Specifies the ETSI white space device type. Valid
  226. // values are single-letter strings, such as A, B, etc. Consult the ETSI
  227. // documentation for details about the device types.
  228. EtsiEnDeviceType string `json:"etsiEnDeviceType,omitempty"`
  229. // EtsiEnTechnologyId: Specifies the ETSI white space device technology
  230. // identifier. The string value must not exceed 64 characters in length.
  231. // Consult the ETSI documentation for details about the device types.
  232. EtsiEnTechnologyId string `json:"etsiEnTechnologyId,omitempty"`
  233. // FccId: Specifies the device's FCC certification identifier. The value
  234. // is an identifier string whose length should not exceed 32 characters.
  235. // Note that, in practice, a valid FCC ID may be limited to 19
  236. // characters.
  237. FccId string `json:"fccId,omitempty"`
  238. // FccTvbdDeviceType: Specifies the TV Band White Space device type, as
  239. // defined by the FCC. Valid values are FIXED, MODE_1, MODE_2.
  240. FccTvbdDeviceType string `json:"fccTvbdDeviceType,omitempty"`
  241. // ManufacturerId: The manufacturer's ID may be required by the
  242. // regulatory domain. This should represent the name of the device
  243. // manufacturer, should be consistent across all devices from the same
  244. // manufacturer, and should be distinct from that of other
  245. // manufacturers. The string value must not exceed 64 characters in
  246. // length.
  247. ManufacturerId string `json:"manufacturerId,omitempty"`
  248. // ModelId: The device's model ID may be required by the regulatory
  249. // domain. The string value must not exceed 64 characters in length.
  250. ModelId string `json:"modelId,omitempty"`
  251. // RulesetIds: The list of identifiers for rulesets supported by the
  252. // device. A database may require that the device provide this list
  253. // before servicing the device requests. If the database does not
  254. // support any of the rulesets specified in the list, the database may
  255. // refuse to service the device requests. If present, the list must
  256. // contain at least one entry.
  257. //
  258. // For information about the valid requests, see section 9.2 of the PAWS
  259. // specification. Currently, FccTvBandWhiteSpace-2010 is the only
  260. // supported ruleset.
  261. RulesetIds []string `json:"rulesetIds,omitempty"`
  262. // SerialNumber: The manufacturer's device serial number; required by
  263. // the applicable regulatory domain. The length of the value must not
  264. // exceed 64 characters.
  265. SerialNumber string `json:"serialNumber,omitempty"`
  266. // ForceSendFields is a list of field names (e.g.
  267. // "EtsiEnDeviceCategory") to unconditionally include in API requests.
  268. // By default, fields with empty values are omitted from API requests.
  269. // However, any non-pointer, non-interface field appearing in
  270. // ForceSendFields will be sent to the server regardless of whether the
  271. // field is empty or not. This may be used to include empty fields in
  272. // Patch requests.
  273. ForceSendFields []string `json:"-"`
  274. // NullFields is a list of field names (e.g. "EtsiEnDeviceCategory") to
  275. // include in API requests with the JSON null value. By default, fields
  276. // with empty values are omitted from API requests. However, any field
  277. // with an empty value appearing in NullFields will be sent to the
  278. // server as null. It is an error if a field in this list has a
  279. // non-empty value. This may be used to include null fields in Patch
  280. // requests.
  281. NullFields []string `json:"-"`
  282. }
  283. func (s *DeviceDescriptor) MarshalJSON() ([]byte, error) {
  284. type NoMethod DeviceDescriptor
  285. raw := NoMethod(*s)
  286. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  287. }
  288. // DeviceOwner: This parameter contains device-owner information
  289. // required as part of device registration. The regulatory domains may
  290. // require additional parameters.
  291. //
  292. // All contact information must be expressed using the structure defined
  293. // by the vCard format specification. Only the contact fields of vCard
  294. // are supported:
  295. // - fn: Full name of an individual
  296. // - org: Name of the organization
  297. // - adr: Address fields
  298. // - tel: Telephone numbers
  299. // - email: Email addresses
  300. //
  301. // Note that the vCard specification defines maximum lengths for each
  302. // field.
  303. type DeviceOwner struct {
  304. // Operator: The vCard contact information for the device operator is
  305. // optional, but may be required by specific regulatory domains.
  306. Operator *Vcard `json:"operator,omitempty"`
  307. // Owner: The vCard contact information for the individual or business
  308. // that owns the device is required.
  309. Owner *Vcard `json:"owner,omitempty"`
  310. // ForceSendFields is a list of field names (e.g. "Operator") to
  311. // unconditionally include in API requests. By default, fields with
  312. // empty values are omitted from API requests. However, any non-pointer,
  313. // non-interface field appearing in ForceSendFields will be sent to the
  314. // server regardless of whether the field is empty or not. This may be
  315. // used to include empty fields in Patch requests.
  316. ForceSendFields []string `json:"-"`
  317. // NullFields is a list of field names (e.g. "Operator") to include in
  318. // API requests with the JSON null value. By default, fields with empty
  319. // values are omitted from API requests. However, any field with an
  320. // empty value appearing in NullFields will be sent to the server as
  321. // null. It is an error if a field in this list has a non-empty value.
  322. // This may be used to include null fields in Patch requests.
  323. NullFields []string `json:"-"`
  324. }
  325. func (s *DeviceOwner) MarshalJSON() ([]byte, error) {
  326. type NoMethod DeviceOwner
  327. raw := NoMethod(*s)
  328. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  329. }
  330. // DeviceValidity: The device validity element describes whether a
  331. // particular device is valid to operate in the regulatory domain.
  332. type DeviceValidity struct {
  333. // DeviceDesc: The descriptor of the device for which the validity check
  334. // was requested. It will always be present.
  335. DeviceDesc *DeviceDescriptor `json:"deviceDesc,omitempty"`
  336. // IsValid: The validity status: true if the device is valid for
  337. // operation, false otherwise. It will always be present.
  338. IsValid bool `json:"isValid,omitempty"`
  339. // Reason: If the device identifier is not valid, the database may
  340. // include a reason. The reason may be in any language. The length of
  341. // the value should not exceed 128 characters.
  342. Reason string `json:"reason,omitempty"`
  343. // ForceSendFields is a list of field names (e.g. "DeviceDesc") to
  344. // unconditionally include in API requests. By default, fields with
  345. // empty values are omitted from API requests. However, any non-pointer,
  346. // non-interface field appearing in ForceSendFields will be sent to the
  347. // server regardless of whether the field is empty or not. This may be
  348. // used to include empty fields in Patch requests.
  349. ForceSendFields []string `json:"-"`
  350. // NullFields is a list of field names (e.g. "DeviceDesc") to include in
  351. // API requests with the JSON null value. By default, fields with empty
  352. // values are omitted from API requests. However, any field with an
  353. // empty value appearing in NullFields will be sent to the server as
  354. // null. It is an error if a field in this list has a non-empty value.
  355. // This may be used to include null fields in Patch requests.
  356. NullFields []string `json:"-"`
  357. }
  358. func (s *DeviceValidity) MarshalJSON() ([]byte, error) {
  359. type NoMethod DeviceValidity
  360. raw := NoMethod(*s)
  361. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  362. }
  363. // EventTime: The start and stop times of an event. This is used to
  364. // indicate the time period for which a spectrum profile is valid.
  365. //
  366. // Both times are expressed using the format, YYYY-MM-DDThh:mm:ssZ, as
  367. // defined in RFC3339. The times must be expressed using UTC.
  368. type EventTime struct {
  369. // StartTime: The inclusive start of the event. It will be present.
  370. StartTime string `json:"startTime,omitempty"`
  371. // StopTime: The exclusive end of the event. It will be present.
  372. StopTime string `json:"stopTime,omitempty"`
  373. // ForceSendFields is a list of field names (e.g. "StartTime") to
  374. // unconditionally include in API requests. By default, fields with
  375. // empty values are omitted from API requests. However, any non-pointer,
  376. // non-interface field appearing in ForceSendFields will be sent to the
  377. // server regardless of whether the field is empty or not. This may be
  378. // used to include empty fields in Patch requests.
  379. ForceSendFields []string `json:"-"`
  380. // NullFields is a list of field names (e.g. "StartTime") to include in
  381. // API requests with the JSON null value. By default, fields with empty
  382. // values are omitted from API requests. However, any field with an
  383. // empty value appearing in NullFields will be sent to the server as
  384. // null. It is an error if a field in this list has a non-empty value.
  385. // This may be used to include null fields in Patch requests.
  386. NullFields []string `json:"-"`
  387. }
  388. func (s *EventTime) MarshalJSON() ([]byte, error) {
  389. type NoMethod EventTime
  390. raw := NoMethod(*s)
  391. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  392. }
  393. // FrequencyRange: A specific range of frequencies together with the
  394. // associated maximum power level and channel identifier.
  395. type FrequencyRange struct {
  396. // ChannelId: The database may include a channel identifier, when
  397. // applicable. When it is included, the device should treat it as
  398. // informative. The length of the identifier should not exceed 16
  399. // characters.
  400. ChannelId string `json:"channelId,omitempty"`
  401. // MaxPowerDBm: The maximum total power level (EIRP)—computed over the
  402. // corresponding operating bandwidth—that is permitted within the
  403. // frequency range. Depending on the context in which the
  404. // frequency-range element appears, this value may be required. For
  405. // example, it is required in the available-spectrum response,
  406. // available-spectrum-batch response, and spectrum-use notification
  407. // message, but it should not be present (it is not applicable) when the
  408. // frequency range appears inside a device-capabilities message.
  409. MaxPowerDBm float64 `json:"maxPowerDBm,omitempty"`
  410. // StartHz: The required inclusive start of the frequency range (in
  411. // Hertz).
  412. StartHz float64 `json:"startHz,omitempty"`
  413. // StopHz: The required exclusive end of the frequency range (in Hertz).
  414. StopHz float64 `json:"stopHz,omitempty"`
  415. // ForceSendFields is a list of field names (e.g. "ChannelId") to
  416. // unconditionally include in API requests. By default, fields with
  417. // empty values are omitted from API requests. However, any non-pointer,
  418. // non-interface field appearing in ForceSendFields will be sent to the
  419. // server regardless of whether the field is empty or not. This may be
  420. // used to include empty fields in Patch requests.
  421. ForceSendFields []string `json:"-"`
  422. // NullFields is a list of field names (e.g. "ChannelId") to include in
  423. // API requests with the JSON null value. By default, fields with empty
  424. // values are omitted from API requests. However, any field with an
  425. // empty value appearing in NullFields will be sent to the server as
  426. // null. It is an error if a field in this list has a non-empty value.
  427. // This may be used to include null fields in Patch requests.
  428. NullFields []string `json:"-"`
  429. }
  430. func (s *FrequencyRange) MarshalJSON() ([]byte, error) {
  431. type NoMethod FrequencyRange
  432. raw := NoMethod(*s)
  433. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  434. }
  435. func (s *FrequencyRange) UnmarshalJSON(data []byte) error {
  436. type NoMethod FrequencyRange
  437. var s1 struct {
  438. MaxPowerDBm gensupport.JSONFloat64 `json:"maxPowerDBm"`
  439. StartHz gensupport.JSONFloat64 `json:"startHz"`
  440. StopHz gensupport.JSONFloat64 `json:"stopHz"`
  441. *NoMethod
  442. }
  443. s1.NoMethod = (*NoMethod)(s)
  444. if err := json.Unmarshal(data, &s1); err != nil {
  445. return err
  446. }
  447. s.MaxPowerDBm = float64(s1.MaxPowerDBm)
  448. s.StartHz = float64(s1.StartHz)
  449. s.StopHz = float64(s1.StopHz)
  450. return nil
  451. }
  452. // GeoLocation: This parameter is used to specify the geolocation of the
  453. // device.
  454. type GeoLocation struct {
  455. // Confidence: The location confidence level, as an integer percentage,
  456. // may be required, depending on the regulatory domain. When the
  457. // parameter is optional and not provided, its value is assumed to be
  458. // 95. Valid values range from 0 to 99, since, in practice, 100-percent
  459. // confidence is not achievable. The confidence value is meaningful only
  460. // when geolocation refers to a point with uncertainty.
  461. Confidence int64 `json:"confidence,omitempty"`
  462. // Point: If present, indicates that the geolocation represents a point.
  463. // Paradoxically, a point is parameterized using an ellipse, where the
  464. // center represents the location of the point and the distances along
  465. // the major and minor axes represent the uncertainty. The uncertainty
  466. // values may be required, depending on the regulatory domain.
  467. Point *GeoLocationEllipse `json:"point,omitempty"`
  468. // Region: If present, indicates that the geolocation represents a
  469. // region. Database support for regions is optional.
  470. Region *GeoLocationPolygon `json:"region,omitempty"`
  471. // ForceSendFields is a list of field names (e.g. "Confidence") to
  472. // unconditionally include in API requests. By default, fields with
  473. // empty values are omitted from API requests. However, any non-pointer,
  474. // non-interface field appearing in ForceSendFields will be sent to the
  475. // server regardless of whether the field is empty or not. This may be
  476. // used to include empty fields in Patch requests.
  477. ForceSendFields []string `json:"-"`
  478. // NullFields is a list of field names (e.g. "Confidence") to include in
  479. // API requests with the JSON null value. By default, fields with empty
  480. // values are omitted from API requests. However, any field with an
  481. // empty value appearing in NullFields will be sent to the server as
  482. // null. It is an error if a field in this list has a non-empty value.
  483. // This may be used to include null fields in Patch requests.
  484. NullFields []string `json:"-"`
  485. }
  486. func (s *GeoLocation) MarshalJSON() ([]byte, error) {
  487. type NoMethod GeoLocation
  488. raw := NoMethod(*s)
  489. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  490. }
  491. // GeoLocationEllipse: A "point" with uncertainty is represented using
  492. // the Ellipse shape.
  493. type GeoLocationEllipse struct {
  494. // Center: A required geo-spatial point representing the center of the
  495. // ellipse.
  496. Center *GeoLocationPoint `json:"center,omitempty"`
  497. // Orientation: A floating-point number that expresses the orientation
  498. // of the ellipse, representing the rotation, in degrees, of the
  499. // semi-major axis from North towards the East. For example, when the
  500. // uncertainty is greatest along the North-South direction, orientation
  501. // is 0 degrees; conversely, if the uncertainty is greatest along the
  502. // East-West direction, orientation is 90 degrees. When orientation is
  503. // not present, the orientation is assumed to be 0.
  504. Orientation float64 `json:"orientation,omitempty"`
  505. // SemiMajorAxis: A floating-point number that expresses the location
  506. // uncertainty along the major axis of the ellipse. May be required by
  507. // the regulatory domain. When the uncertainty is optional, the default
  508. // value is 0.
  509. SemiMajorAxis float64 `json:"semiMajorAxis,omitempty"`
  510. // SemiMinorAxis: A floating-point number that expresses the location
  511. // uncertainty along the minor axis of the ellipse. May be required by
  512. // the regulatory domain. When the uncertainty is optional, the default
  513. // value is 0.
  514. SemiMinorAxis float64 `json:"semiMinorAxis,omitempty"`
  515. // ForceSendFields is a list of field names (e.g. "Center") to
  516. // unconditionally include in API requests. By default, fields with
  517. // empty values are omitted from API requests. However, any non-pointer,
  518. // non-interface field appearing in ForceSendFields will be sent to the
  519. // server regardless of whether the field is empty or not. This may be
  520. // used to include empty fields in Patch requests.
  521. ForceSendFields []string `json:"-"`
  522. // NullFields is a list of field names (e.g. "Center") to include in API
  523. // requests with the JSON null value. By default, fields with empty
  524. // values are omitted from API requests. However, any field with an
  525. // empty value appearing in NullFields will be sent to the server as
  526. // null. It is an error if a field in this list has a non-empty value.
  527. // This may be used to include null fields in Patch requests.
  528. NullFields []string `json:"-"`
  529. }
  530. func (s *GeoLocationEllipse) MarshalJSON() ([]byte, error) {
  531. type NoMethod GeoLocationEllipse
  532. raw := NoMethod(*s)
  533. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  534. }
  535. func (s *GeoLocationEllipse) UnmarshalJSON(data []byte) error {
  536. type NoMethod GeoLocationEllipse
  537. var s1 struct {
  538. Orientation gensupport.JSONFloat64 `json:"orientation"`
  539. SemiMajorAxis gensupport.JSONFloat64 `json:"semiMajorAxis"`
  540. SemiMinorAxis gensupport.JSONFloat64 `json:"semiMinorAxis"`
  541. *NoMethod
  542. }
  543. s1.NoMethod = (*NoMethod)(s)
  544. if err := json.Unmarshal(data, &s1); err != nil {
  545. return err
  546. }
  547. s.Orientation = float64(s1.Orientation)
  548. s.SemiMajorAxis = float64(s1.SemiMajorAxis)
  549. s.SemiMinorAxis = float64(s1.SemiMinorAxis)
  550. return nil
  551. }
  552. // GeoLocationPoint: A single geolocation on the globe.
  553. type GeoLocationPoint struct {
  554. // Latitude: A required floating-point number that expresses the
  555. // latitude in degrees using the WGS84 datum. For details on this
  556. // encoding, see the National Imagery and Mapping Agency's Technical
  557. // Report TR8350.2.
  558. Latitude float64 `json:"latitude,omitempty"`
  559. // Longitude: A required floating-point number that expresses the
  560. // longitude in degrees using the WGS84 datum. For details on this
  561. // encoding, see the National Imagery and Mapping Agency's Technical
  562. // Report TR8350.2.
  563. Longitude float64 `json:"longitude,omitempty"`
  564. // ForceSendFields is a list of field names (e.g. "Latitude") to
  565. // unconditionally include in API requests. By default, fields with
  566. // empty values are omitted from API requests. However, any non-pointer,
  567. // non-interface field appearing in ForceSendFields will be sent to the
  568. // server regardless of whether the field is empty or not. This may be
  569. // used to include empty fields in Patch requests.
  570. ForceSendFields []string `json:"-"`
  571. // NullFields is a list of field names (e.g. "Latitude") to include in
  572. // API requests with the JSON null value. By default, fields with empty
  573. // values are omitted from API requests. However, any field with an
  574. // empty value appearing in NullFields will be sent to the server as
  575. // null. It is an error if a field in this list has a non-empty value.
  576. // This may be used to include null fields in Patch requests.
  577. NullFields []string `json:"-"`
  578. }
  579. func (s *GeoLocationPoint) MarshalJSON() ([]byte, error) {
  580. type NoMethod GeoLocationPoint
  581. raw := NoMethod(*s)
  582. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  583. }
  584. func (s *GeoLocationPoint) UnmarshalJSON(data []byte) error {
  585. type NoMethod GeoLocationPoint
  586. var s1 struct {
  587. Latitude gensupport.JSONFloat64 `json:"latitude"`
  588. Longitude gensupport.JSONFloat64 `json:"longitude"`
  589. *NoMethod
  590. }
  591. s1.NoMethod = (*NoMethod)(s)
  592. if err := json.Unmarshal(data, &s1); err != nil {
  593. return err
  594. }
  595. s.Latitude = float64(s1.Latitude)
  596. s.Longitude = float64(s1.Longitude)
  597. return nil
  598. }
  599. // GeoLocationPolygon: A region is represented using the polygonal
  600. // shape.
  601. type GeoLocationPolygon struct {
  602. // Exterior: When the geolocation describes a region, the exterior field
  603. // refers to a list of latitude/longitude points that represent the
  604. // vertices of a polygon. The first and last points must be the same.
  605. // Thus, a minimum of four points is required. The following polygon
  606. // restrictions from RFC5491 apply:
  607. // - A connecting line shall not cross another connecting line of the
  608. // same polygon.
  609. // - The vertices must be defined in a counterclockwise order.
  610. // - The edges of a polygon are defined by the shortest path between two
  611. // points in space (not a geodesic curve). Consequently, the length
  612. // between two adjacent vertices should be restricted to a maximum of
  613. // 130 km.
  614. // - All vertices are assumed to be at the same altitude.
  615. // - Polygon shapes should be restricted to a maximum of 15 vertices (16
  616. // points that include the repeated vertex).
  617. Exterior []*GeoLocationPoint `json:"exterior,omitempty"`
  618. // ForceSendFields is a list of field names (e.g. "Exterior") to
  619. // unconditionally include in API requests. By default, fields with
  620. // empty values are omitted from API requests. However, any non-pointer,
  621. // non-interface field appearing in ForceSendFields will be sent to the
  622. // server regardless of whether the field is empty or not. This may be
  623. // used to include empty fields in Patch requests.
  624. ForceSendFields []string `json:"-"`
  625. // NullFields is a list of field names (e.g. "Exterior") to include in
  626. // API requests with the JSON null value. By default, fields with empty
  627. // values are omitted from API requests. However, any field with an
  628. // empty value appearing in NullFields will be sent to the server as
  629. // null. It is an error if a field in this list has a non-empty value.
  630. // This may be used to include null fields in Patch requests.
  631. NullFields []string `json:"-"`
  632. }
  633. func (s *GeoLocationPolygon) MarshalJSON() ([]byte, error) {
  634. type NoMethod GeoLocationPolygon
  635. raw := NoMethod(*s)
  636. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  637. }
  638. // GeoSpectrumSchedule: The schedule of spectrum profiles available at a
  639. // particular geolocation.
  640. type GeoSpectrumSchedule struct {
  641. // Location: The geolocation identifies the location at which the
  642. // spectrum schedule applies. It will always be present.
  643. Location *GeoLocation `json:"location,omitempty"`
  644. // SpectrumSchedules: A list of available spectrum profiles and
  645. // associated times. It will always be present, and at least one
  646. // schedule must be included (though it may be empty if there is no
  647. // available spectrum). More than one schedule may be included to
  648. // represent future changes to the available spectrum.
  649. SpectrumSchedules []*SpectrumSchedule `json:"spectrumSchedules,omitempty"`
  650. // ForceSendFields is a list of field names (e.g. "Location") to
  651. // unconditionally include in API requests. By default, fields with
  652. // empty values are omitted from API requests. However, any non-pointer,
  653. // non-interface field appearing in ForceSendFields will be sent to the
  654. // server regardless of whether the field is empty or not. This may be
  655. // used to include empty fields in Patch requests.
  656. ForceSendFields []string `json:"-"`
  657. // NullFields is a list of field names (e.g. "Location") to include in
  658. // API requests with the JSON null value. By default, fields with empty
  659. // values are omitted from API requests. However, any field with an
  660. // empty value appearing in NullFields will be sent to the server as
  661. // null. It is an error if a field in this list has a non-empty value.
  662. // This may be used to include null fields in Patch requests.
  663. NullFields []string `json:"-"`
  664. }
  665. func (s *GeoSpectrumSchedule) MarshalJSON() ([]byte, error) {
  666. type NoMethod GeoSpectrumSchedule
  667. raw := NoMethod(*s)
  668. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  669. }
  670. // PawsGetSpectrumBatchRequest: The request message for a batch
  671. // available spectrum query protocol.
  672. type PawsGetSpectrumBatchRequest struct {
  673. // Antenna: Depending on device type and regulatory domain, antenna
  674. // characteristics may be required.
  675. Antenna *AntennaCharacteristics `json:"antenna,omitempty"`
  676. // Capabilities: The master device may include its device capabilities
  677. // to limit the available-spectrum batch response to the spectrum that
  678. // is compatible with its capabilities. The database should not return
  679. // spectrum that is incompatible with the specified capabilities.
  680. Capabilities *DeviceCapabilities `json:"capabilities,omitempty"`
  681. // DeviceDesc: When the available spectrum request is made on behalf of
  682. // a specific device (a master or slave device), device descriptor
  683. // information for the device on whose behalf the request is made is
  684. // required (in such cases, the requestType parameter must be empty).
  685. // When a requestType value is specified, device descriptor information
  686. // may be optional or required according to the rules of the applicable
  687. // regulatory domain.
  688. DeviceDesc *DeviceDescriptor `json:"deviceDesc,omitempty"`
  689. // Locations: A geolocation list is required. This allows a device to
  690. // specify its current location plus additional anticipated locations
  691. // when allowed by the regulatory domain. At least one location must be
  692. // included. Geolocation must be given as the location of the radiation
  693. // center of the device's antenna. If a location specifies a region,
  694. // rather than a point, the database may return an UNIMPLEMENTED error
  695. // if it does not support query by region.
  696. //
  697. // There is no upper limit on the number of locations included in a
  698. // available spectrum batch request, but the database may restrict the
  699. // number of locations it supports by returning a response with fewer
  700. // locations than specified in the batch request. Note that geolocations
  701. // must be those of the master device (a device with geolocation
  702. // capability that makes an available spectrum batch request), whether
  703. // the master device is making the request on its own behalf or on
  704. // behalf of a slave device (one without geolocation capability).
  705. Locations []*GeoLocation `json:"locations,omitempty"`
  706. // MasterDeviceDesc: When an available spectrum batch request is made by
  707. // the master device (a device with geolocation capability) on behalf of
  708. // a slave device (a device without geolocation capability), the rules
  709. // of the applicable regulatory domain may require the master device to
  710. // provide its own device descriptor information (in addition to device
  711. // descriptor information for the slave device in a separate parameter).
  712. MasterDeviceDesc *DeviceDescriptor `json:"masterDeviceDesc,omitempty"`
  713. // Owner: Depending on device type and regulatory domain, device owner
  714. // information may be included in an available spectrum batch request.
  715. // This allows the device to register and get spectrum-availability
  716. // information in a single request.
  717. Owner *DeviceOwner `json:"owner,omitempty"`
  718. // RequestType: The request type parameter is an optional parameter that
  719. // can be used to modify an available spectrum batch request, but its
  720. // use depends on applicable regulatory rules. For example, It may be
  721. // used to request generic slave device parameters without having to
  722. // specify the device descriptor for a specific device. When the
  723. // requestType parameter is missing, the request is for a specific
  724. // device (master or slave), and the device descriptor parameter for the
  725. // device on whose behalf the batch request is made is required.
  726. RequestType string `json:"requestType,omitempty"`
  727. // Type: The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ,
  728. // ...).
  729. //
  730. // Required field.
  731. Type string `json:"type,omitempty"`
  732. // Version: The PAWS version. Must be exactly 1.0.
  733. //
  734. // Required field.
  735. Version string `json:"version,omitempty"`
  736. // ForceSendFields is a list of field names (e.g. "Antenna") to
  737. // unconditionally include in API requests. By default, fields with
  738. // empty values are omitted from API requests. However, any non-pointer,
  739. // non-interface field appearing in ForceSendFields will be sent to the
  740. // server regardless of whether the field is empty or not. This may be
  741. // used to include empty fields in Patch requests.
  742. ForceSendFields []string `json:"-"`
  743. // NullFields is a list of field names (e.g. "Antenna") to include in
  744. // API requests with the JSON null value. By default, fields with empty
  745. // values are omitted from API requests. However, any field with an
  746. // empty value appearing in NullFields will be sent to the server as
  747. // null. It is an error if a field in this list has a non-empty value.
  748. // This may be used to include null fields in Patch requests.
  749. NullFields []string `json:"-"`
  750. }
  751. func (s *PawsGetSpectrumBatchRequest) MarshalJSON() ([]byte, error) {
  752. type NoMethod PawsGetSpectrumBatchRequest
  753. raw := NoMethod(*s)
  754. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  755. }
  756. // PawsGetSpectrumBatchResponse: The response message for the batch
  757. // available spectrum query contains a schedule of available spectrum
  758. // for the device at multiple locations.
  759. type PawsGetSpectrumBatchResponse struct {
  760. // DatabaseChange: A database may include the databaseChange parameter
  761. // to notify a device of a change to its database URI, providing one or
  762. // more alternate database URIs. The device should use this information
  763. // to update its list of pre-configured databases by (only) replacing
  764. // its entry for the responding database with the list of alternate
  765. // URIs.
  766. DatabaseChange *DbUpdateSpec `json:"databaseChange,omitempty"`
  767. // DeviceDesc: The database must return in its available spectrum
  768. // response the device descriptor information it received in the master
  769. // device's available spectrum batch request.
  770. DeviceDesc *DeviceDescriptor `json:"deviceDesc,omitempty"`
  771. // GeoSpectrumSchedules: The available spectrum batch response must
  772. // contain a geo-spectrum schedule list, The list may be empty if
  773. // spectrum is not available. The database may return more than one
  774. // geo-spectrum schedule to represent future changes to the available
  775. // spectrum. How far in advance a schedule may be provided depends upon
  776. // the applicable regulatory domain. The database may return available
  777. // spectrum for fewer geolocations than requested. The device must not
  778. // make assumptions about the order of the entries in the list, and must
  779. // use the geolocation value in each geo-spectrum schedule entry to
  780. // match available spectrum to a location.
  781. GeoSpectrumSchedules []*GeoSpectrumSchedule `json:"geoSpectrumSchedules,omitempty"`
  782. // Kind: Identifies what kind of resource this is. Value: the fixed
  783. // string "spectrum#pawsGetSpectrumBatchResponse".
  784. Kind string `json:"kind,omitempty"`
  785. // MaxContiguousBwHz: The database may return a constraint on the
  786. // allowed maximum contiguous bandwidth (in Hertz). A regulatory domain
  787. // may require the database to return this parameter. When this
  788. // parameter is present in the response, the device must apply this
  789. // constraint to its spectrum-selection logic to ensure that no single
  790. // block of spectrum has bandwidth that exceeds this value.
  791. MaxContiguousBwHz float64 `json:"maxContiguousBwHz,omitempty"`
  792. // MaxTotalBwHz: The database may return a constraint on the allowed
  793. // maximum total bandwidth (in Hertz), which does not need to be
  794. // contiguous. A regulatory domain may require the database to return
  795. // this parameter. When this parameter is present in the available
  796. // spectrum batch response, the device must apply this constraint to its
  797. // spectrum-selection logic to ensure that total bandwidth does not
  798. // exceed this value.
  799. MaxTotalBwHz float64 `json:"maxTotalBwHz,omitempty"`
  800. // NeedsSpectrumReport: For regulatory domains that require a
  801. // spectrum-usage report from devices, the database must return true for
  802. // this parameter if the geo-spectrum schedules list is not empty;
  803. // otherwise, the database should either return false or omit this
  804. // parameter. If this parameter is present and its value is true, the
  805. // device must send a spectrum use notify message to the database;
  806. // otherwise, the device should not send the notification.
  807. NeedsSpectrumReport bool `json:"needsSpectrumReport,omitempty"`
  808. // RulesetInfo: The database should return ruleset information, which
  809. // identifies the applicable regulatory authority and ruleset for the
  810. // available spectrum batch response. If included, the device must use
  811. // the corresponding ruleset to interpret the response. Values provided
  812. // in the returned ruleset information, such as maxLocationChange, take
  813. // precedence over any conflicting values provided in the ruleset
  814. // information returned in a prior initialization response sent by the
  815. // database to the device.
  816. RulesetInfo *RulesetInfo `json:"rulesetInfo,omitempty"`
  817. // Timestamp: The database includes a timestamp of the form,
  818. // YYYY-MM-DDThh:mm:ssZ (Internet timestamp format per RFC3339), in its
  819. // available spectrum batch response. The timestamp should be used by
  820. // the device as a reference for the start and stop times specified in
  821. // the response spectrum schedules.
  822. Timestamp string `json:"timestamp,omitempty"`
  823. // Type: The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ,
  824. // ...).
  825. //
  826. // Required field.
  827. Type string `json:"type,omitempty"`
  828. // Version: The PAWS version. Must be exactly 1.0.
  829. //
  830. // Required field.
  831. Version string `json:"version,omitempty"`
  832. // ServerResponse contains the HTTP response code and headers from the
  833. // server.
  834. googleapi.ServerResponse `json:"-"`
  835. // ForceSendFields is a list of field names (e.g. "DatabaseChange") to
  836. // unconditionally include in API requests. By default, fields with
  837. // empty values are omitted from API requests. However, any non-pointer,
  838. // non-interface field appearing in ForceSendFields will be sent to the
  839. // server regardless of whether the field is empty or not. This may be
  840. // used to include empty fields in Patch requests.
  841. ForceSendFields []string `json:"-"`
  842. // NullFields is a list of field names (e.g. "DatabaseChange") to
  843. // include in API requests with the JSON null value. By default, fields
  844. // with empty values are omitted from API requests. However, any field
  845. // with an empty value appearing in NullFields will be sent to the
  846. // server as null. It is an error if a field in this list has a
  847. // non-empty value. This may be used to include null fields in Patch
  848. // requests.
  849. NullFields []string `json:"-"`
  850. }
  851. func (s *PawsGetSpectrumBatchResponse) MarshalJSON() ([]byte, error) {
  852. type NoMethod PawsGetSpectrumBatchResponse
  853. raw := NoMethod(*s)
  854. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  855. }
  856. func (s *PawsGetSpectrumBatchResponse) UnmarshalJSON(data []byte) error {
  857. type NoMethod PawsGetSpectrumBatchResponse
  858. var s1 struct {
  859. MaxContiguousBwHz gensupport.JSONFloat64 `json:"maxContiguousBwHz"`
  860. MaxTotalBwHz gensupport.JSONFloat64 `json:"maxTotalBwHz"`
  861. *NoMethod
  862. }
  863. s1.NoMethod = (*NoMethod)(s)
  864. if err := json.Unmarshal(data, &s1); err != nil {
  865. return err
  866. }
  867. s.MaxContiguousBwHz = float64(s1.MaxContiguousBwHz)
  868. s.MaxTotalBwHz = float64(s1.MaxTotalBwHz)
  869. return nil
  870. }
  871. // PawsGetSpectrumRequest: The request message for the available
  872. // spectrum query protocol which must include the device's geolocation.
  873. type PawsGetSpectrumRequest struct {
  874. // Antenna: Depending on device type and regulatory domain, the
  875. // characteristics of the antenna may be required.
  876. Antenna *AntennaCharacteristics `json:"antenna,omitempty"`
  877. // Capabilities: The master device may include its device capabilities
  878. // to limit the available-spectrum response to the spectrum that is
  879. // compatible with its capabilities. The database should not return
  880. // spectrum that is incompatible with the specified capabilities.
  881. Capabilities *DeviceCapabilities `json:"capabilities,omitempty"`
  882. // DeviceDesc: When the available spectrum request is made on behalf of
  883. // a specific device (a master or slave device), device descriptor
  884. // information for that device is required (in such cases, the
  885. // requestType parameter must be empty). When a requestType value is
  886. // specified, device descriptor information may be optional or required
  887. // according to the rules of the applicable regulatory domain.
  888. DeviceDesc *DeviceDescriptor `json:"deviceDesc,omitempty"`
  889. // Location: The geolocation of the master device (a device with
  890. // geolocation capability that makes an available spectrum request) is
  891. // required whether the master device is making the request on its own
  892. // behalf or on behalf of a slave device (one without geolocation
  893. // capability). The location must be the location of the radiation
  894. // center of the master device's antenna. To support mobile devices, a
  895. // regulatory domain may allow the anticipated position of the master
  896. // device to be given instead. If the location specifies a region,
  897. // rather than a point, the database may return an UNIMPLEMENTED error
  898. // code if it does not support query by region.
  899. Location *GeoLocation `json:"location,omitempty"`
  900. // MasterDeviceDesc: When an available spectrum request is made by the
  901. // master device (a device with geolocation capability) on behalf of a
  902. // slave device (a device without geolocation capability), the rules of
  903. // the applicable regulatory domain may require the master device to
  904. // provide its own device descriptor information (in addition to device
  905. // descriptor information for the slave device, which is provided in a
  906. // separate parameter).
  907. MasterDeviceDesc *DeviceDescriptor `json:"masterDeviceDesc,omitempty"`
  908. // Owner: Depending on device type and regulatory domain, device owner
  909. // information may be included in an available spectrum request. This
  910. // allows the device to register and get spectrum-availability
  911. // information in a single request.
  912. Owner *DeviceOwner `json:"owner,omitempty"`
  913. // RequestType: The request type parameter is an optional parameter that
  914. // can be used to modify an available spectrum request, but its use
  915. // depends on applicable regulatory rules. It may be used, for example,
  916. // to request generic slave device parameters without having to specify
  917. // the device descriptor for a specific device. When the requestType
  918. // parameter is missing, the request is for a specific device (master or
  919. // slave), and the deviceDesc parameter for the device on whose behalf
  920. // the request is made is required.
  921. RequestType string `json:"requestType,omitempty"`
  922. // Type: The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ,
  923. // ...).
  924. //
  925. // Required field.
  926. Type string `json:"type,omitempty"`
  927. // Version: The PAWS version. Must be exactly 1.0.
  928. //
  929. // Required field.
  930. Version string `json:"version,omitempty"`
  931. // ForceSendFields is a list of field names (e.g. "Antenna") to
  932. // unconditionally include in API requests. By default, fields with
  933. // empty values are omitted from API requests. However, any non-pointer,
  934. // non-interface field appearing in ForceSendFields will be sent to the
  935. // server regardless of whether the field is empty or not. This may be
  936. // used to include empty fields in Patch requests.
  937. ForceSendFields []string `json:"-"`
  938. // NullFields is a list of field names (e.g. "Antenna") to include in
  939. // API requests with the JSON null value. By default, fields with empty
  940. // values are omitted from API requests. However, any field with an
  941. // empty value appearing in NullFields will be sent to the server as
  942. // null. It is an error if a field in this list has a non-empty value.
  943. // This may be used to include null fields in Patch requests.
  944. NullFields []string `json:"-"`
  945. }
  946. func (s *PawsGetSpectrumRequest) MarshalJSON() ([]byte, error) {
  947. type NoMethod PawsGetSpectrumRequest
  948. raw := NoMethod(*s)
  949. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  950. }
  951. // PawsGetSpectrumResponse: The response message for the available
  952. // spectrum query which contains a schedule of available spectrum for
  953. // the device.
  954. type PawsGetSpectrumResponse struct {
  955. // DatabaseChange: A database may include the databaseChange parameter
  956. // to notify a device of a change to its database URI, providing one or
  957. // more alternate database URIs. The device should use this information
  958. // to update its list of pre-configured databases by (only) replacing
  959. // its entry for the responding database with the list of alternate
  960. // URIs.
  961. DatabaseChange *DbUpdateSpec `json:"databaseChange,omitempty"`
  962. // DeviceDesc: The database must return, in its available spectrum
  963. // response, the device descriptor information it received in the master
  964. // device's available spectrum request.
  965. DeviceDesc *DeviceDescriptor `json:"deviceDesc,omitempty"`
  966. // Kind: Identifies what kind of resource this is. Value: the fixed
  967. // string "spectrum#pawsGetSpectrumResponse".
  968. Kind string `json:"kind,omitempty"`
  969. // MaxContiguousBwHz: The database may return a constraint on the
  970. // allowed maximum contiguous bandwidth (in Hertz). A regulatory domain
  971. // may require the database to return this parameter. When this
  972. // parameter is present in the response, the device must apply this
  973. // constraint to its spectrum-selection logic to ensure that no single
  974. // block of spectrum has bandwidth that exceeds this value.
  975. MaxContiguousBwHz float64 `json:"maxContiguousBwHz,omitempty"`
  976. // MaxTotalBwHz: The database may return a constraint on the allowed
  977. // maximum total bandwidth (in Hertz), which need not be contiguous. A
  978. // regulatory domain may require the database to return this parameter.
  979. // When this parameter is present in the available spectrum response,
  980. // the device must apply this constraint to its spectrum-selection logic
  981. // to ensure that total bandwidth does not exceed this value.
  982. MaxTotalBwHz float64 `json:"maxTotalBwHz,omitempty"`
  983. // NeedsSpectrumReport: For regulatory domains that require a
  984. // spectrum-usage report from devices, the database must return true for
  985. // this parameter if the spectrum schedule list is not empty; otherwise,
  986. // the database will either return false or omit this parameter. If this
  987. // parameter is present and its value is true, the device must send a
  988. // spectrum use notify message to the database; otherwise, the device
  989. // must not send the notification.
  990. NeedsSpectrumReport bool `json:"needsSpectrumReport,omitempty"`
  991. // RulesetInfo: The database should return ruleset information, which
  992. // identifies the applicable regulatory authority and ruleset for the
  993. // available spectrum response. If included, the device must use the
  994. // corresponding ruleset to interpret the response. Values provided in
  995. // the returned ruleset information, such as maxLocationChange, take
  996. // precedence over any conflicting values provided in the ruleset
  997. // information returned in a prior initialization response sent by the
  998. // database to the device.
  999. RulesetInfo *RulesetInfo `json:"rulesetInfo,omitempty"`
  1000. // SpectrumSchedules: The available spectrum response must contain a
  1001. // spectrum schedule list. The list may be empty if spectrum is not
  1002. // available. The database may return more than one spectrum schedule to
  1003. // represent future changes to the available spectrum. How far in
  1004. // advance a schedule may be provided depends on the applicable
  1005. // regulatory domain.
  1006. SpectrumSchedules []*SpectrumSchedule `json:"spectrumSchedules,omitempty"`
  1007. // Timestamp: The database includes a timestamp of the form
  1008. // YYYY-MM-DDThh:mm:ssZ (Internet timestamp format per RFC3339) in its
  1009. // available spectrum response. The timestamp should be used by the
  1010. // device as a reference for the start and stop times specified in the
  1011. // response spectrum schedules.
  1012. Timestamp string `json:"timestamp,omitempty"`
  1013. // Type: The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ,
  1014. // ...).
  1015. //
  1016. // Required field.
  1017. Type string `json:"type,omitempty"`
  1018. // Version: The PAWS version. Must be exactly 1.0.
  1019. //
  1020. // Required field.
  1021. Version string `json:"version,omitempty"`
  1022. // ServerResponse contains the HTTP response code and headers from the
  1023. // server.
  1024. googleapi.ServerResponse `json:"-"`
  1025. // ForceSendFields is a list of field names (e.g. "DatabaseChange") to
  1026. // unconditionally include in API requests. By default, fields with
  1027. // empty values are omitted from API requests. However, any non-pointer,
  1028. // non-interface field appearing in ForceSendFields will be sent to the
  1029. // server regardless of whether the field is empty or not. This may be
  1030. // used to include empty fields in Patch requests.
  1031. ForceSendFields []string `json:"-"`
  1032. // NullFields is a list of field names (e.g. "DatabaseChange") to
  1033. // include in API requests with the JSON null value. By default, fields
  1034. // with empty values are omitted from API requests. However, any field
  1035. // with an empty value appearing in NullFields will be sent to the
  1036. // server as null. It is an error if a field in this list has a
  1037. // non-empty value. This may be used to include null fields in Patch
  1038. // requests.
  1039. NullFields []string `json:"-"`
  1040. }
  1041. func (s *PawsGetSpectrumResponse) MarshalJSON() ([]byte, error) {
  1042. type NoMethod PawsGetSpectrumResponse
  1043. raw := NoMethod(*s)
  1044. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1045. }
  1046. func (s *PawsGetSpectrumResponse) UnmarshalJSON(data []byte) error {
  1047. type NoMethod PawsGetSpectrumResponse
  1048. var s1 struct {
  1049. MaxContiguousBwHz gensupport.JSONFloat64 `json:"maxContiguousBwHz"`
  1050. MaxTotalBwHz gensupport.JSONFloat64 `json:"maxTotalBwHz"`
  1051. *NoMethod
  1052. }
  1053. s1.NoMethod = (*NoMethod)(s)
  1054. if err := json.Unmarshal(data, &s1); err != nil {
  1055. return err
  1056. }
  1057. s.MaxContiguousBwHz = float64(s1.MaxContiguousBwHz)
  1058. s.MaxTotalBwHz = float64(s1.MaxTotalBwHz)
  1059. return nil
  1060. }
  1061. // PawsInitRequest: The initialization request message allows the master
  1062. // device to initiate exchange of capabilities with the database.
  1063. type PawsInitRequest struct {
  1064. // DeviceDesc: The DeviceDescriptor parameter is required. If the
  1065. // database does not support the device or any of the rulesets specified
  1066. // in the device descriptor, it must return an UNSUPPORTED error code in
  1067. // the error response.
  1068. DeviceDesc *DeviceDescriptor `json:"deviceDesc,omitempty"`
  1069. // Location: A device's geolocation is required.
  1070. Location *GeoLocation `json:"location,omitempty"`
  1071. // Type: The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ,
  1072. // ...).
  1073. //
  1074. // Required field.
  1075. Type string `json:"type,omitempty"`
  1076. // Version: The PAWS version. Must be exactly 1.0.
  1077. //
  1078. // Required field.
  1079. Version string `json:"version,omitempty"`
  1080. // ForceSendFields is a list of field names (e.g. "DeviceDesc") to
  1081. // unconditionally include in API requests. By default, fields with
  1082. // empty values are omitted from API requests. However, any non-pointer,
  1083. // non-interface field appearing in ForceSendFields will be sent to the
  1084. // server regardless of whether the field is empty or not. This may be
  1085. // used to include empty fields in Patch requests.
  1086. ForceSendFields []string `json:"-"`
  1087. // NullFields is a list of field names (e.g. "DeviceDesc") to include in
  1088. // API requests with the JSON null value. By default, fields with empty
  1089. // values are omitted from API requests. However, any field with an
  1090. // empty value appearing in NullFields will be sent to the server as
  1091. // null. It is an error if a field in this list has a non-empty value.
  1092. // This may be used to include null fields in Patch requests.
  1093. NullFields []string `json:"-"`
  1094. }
  1095. func (s *PawsInitRequest) MarshalJSON() ([]byte, error) {
  1096. type NoMethod PawsInitRequest
  1097. raw := NoMethod(*s)
  1098. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1099. }
  1100. // PawsInitResponse: The initialization response message communicates
  1101. // database parameters to the requesting device.
  1102. type PawsInitResponse struct {
  1103. // DatabaseChange: A database may include the databaseChange parameter
  1104. // to notify a device of a change to its database URI, providing one or
  1105. // more alternate database URIs. The device should use this information
  1106. // to update its list of pre-configured databases by (only) replacing
  1107. // its entry for the responding database with the list of alternate
  1108. // URIs.
  1109. DatabaseChange *DbUpdateSpec `json:"databaseChange,omitempty"`
  1110. // Kind: Identifies what kind of resource this is. Value: the fixed
  1111. // string "spectrum#pawsInitResponse".
  1112. Kind string `json:"kind,omitempty"`
  1113. // RulesetInfo: The rulesetInfo parameter must be included in the
  1114. // response. This parameter specifies the regulatory domain and
  1115. // parameters applicable to that domain. The database must include the
  1116. // authority field, which defines the regulatory domain for the location
  1117. // specified in the INIT_REQ message.
  1118. RulesetInfo *RulesetInfo `json:"rulesetInfo,omitempty"`
  1119. // Type: The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ,
  1120. // ...).
  1121. //
  1122. // Required field.
  1123. Type string `json:"type,omitempty"`
  1124. // Version: The PAWS version. Must be exactly 1.0.
  1125. //
  1126. // Required field.
  1127. Version string `json:"version,omitempty"`
  1128. // ServerResponse contains the HTTP response code and headers from the
  1129. // server.
  1130. googleapi.ServerResponse `json:"-"`
  1131. // ForceSendFields is a list of field names (e.g. "DatabaseChange") to
  1132. // unconditionally include in API requests. By default, fields with
  1133. // empty values are omitted from API requests. However, any non-pointer,
  1134. // non-interface field appearing in ForceSendFields will be sent to the
  1135. // server regardless of whether the field is empty or not. This may be
  1136. // used to include empty fields in Patch requests.
  1137. ForceSendFields []string `json:"-"`
  1138. // NullFields is a list of field names (e.g. "DatabaseChange") to
  1139. // include in API requests with the JSON null value. By default, fields
  1140. // with empty values are omitted from API requests. However, any field
  1141. // with an empty value appearing in NullFields will be sent to the
  1142. // server as null. It is an error if a field in this list has a
  1143. // non-empty value. This may be used to include null fields in Patch
  1144. // requests.
  1145. NullFields []string `json:"-"`
  1146. }
  1147. func (s *PawsInitResponse) MarshalJSON() ([]byte, error) {
  1148. type NoMethod PawsInitResponse
  1149. raw := NoMethod(*s)
  1150. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1151. }
  1152. // PawsNotifySpectrumUseRequest: The spectrum-use notification message
  1153. // which must contain the geolocation of the Device and parameters
  1154. // required by the regulatory domain.
  1155. type PawsNotifySpectrumUseRequest struct {
  1156. // DeviceDesc: Device descriptor information is required in the
  1157. // spectrum-use notification message.
  1158. DeviceDesc *DeviceDescriptor `json:"deviceDesc,omitempty"`
  1159. // Location: The geolocation of the master device (the device that is
  1160. // sending the spectrum-use notification) to the database is required in
  1161. // the spectrum-use notification message.
  1162. Location *GeoLocation `json:"location,omitempty"`
  1163. // Spectra: A spectrum list is required in the spectrum-use
  1164. // notification. The list specifies the spectrum that the device expects
  1165. // to use, which includes frequency ranges and maximum power levels. The
  1166. // list may be empty if the device decides not to use any of spectrum.
  1167. // For consistency, the psdBandwidthHz value should match that from one
  1168. // of the spectrum elements in the corresponding available spectrum
  1169. // response previously sent to the device by the database. Note that
  1170. // maximum power levels in the spectrum element must be expressed as
  1171. // power spectral density over the specified psdBandwidthHz value. The
  1172. // actual bandwidth to be used (as computed from the start and stop
  1173. // frequencies) may be different from the psdBandwidthHz value. As an
  1174. // example, when regulatory rules express maximum power spectral density
  1175. // in terms of maximum power over any 100 kHz band, then the
  1176. // psdBandwidthHz value should be set to 100 kHz, even though the actual
  1177. // bandwidth used can be 20 kHz.
  1178. Spectra []*SpectrumMessage `json:"spectra,omitempty"`
  1179. // Type: The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ,
  1180. // ...).
  1181. //
  1182. // Required field.
  1183. Type string `json:"type,omitempty"`
  1184. // Version: The PAWS version. Must be exactly 1.0.
  1185. //
  1186. // Required field.
  1187. Version string `json:"version,omitempty"`
  1188. // ForceSendFields is a list of field names (e.g. "DeviceDesc") to
  1189. // unconditionally include in API requests. By default, fields with
  1190. // empty values are omitted from API requests. However, any non-pointer,
  1191. // non-interface field appearing in ForceSendFields will be sent to the
  1192. // server regardless of whether the field is empty or not. This may be
  1193. // used to include empty fields in Patch requests.
  1194. ForceSendFields []string `json:"-"`
  1195. // NullFields is a list of field names (e.g. "DeviceDesc") to include in
  1196. // API requests with the JSON null value. By default, fields with empty
  1197. // values are omitted from API requests. However, any field with an
  1198. // empty value appearing in NullFields will be sent to the server as
  1199. // null. It is an error if a field in this list has a non-empty value.
  1200. // This may be used to include null fields in Patch requests.
  1201. NullFields []string `json:"-"`
  1202. }
  1203. func (s *PawsNotifySpectrumUseRequest) MarshalJSON() ([]byte, error) {
  1204. type NoMethod PawsNotifySpectrumUseRequest
  1205. raw := NoMethod(*s)
  1206. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1207. }
  1208. // PawsNotifySpectrumUseResponse: An empty response to the notification.
  1209. type PawsNotifySpectrumUseResponse struct {
  1210. // Kind: Identifies what kind of resource this is. Value: the fixed
  1211. // string "spectrum#pawsNotifySpectrumUseResponse".
  1212. Kind string `json:"kind,omitempty"`
  1213. // Type: The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ,
  1214. // ...).
  1215. //
  1216. // Required field.
  1217. Type string `json:"type,omitempty"`
  1218. // Version: The PAWS version. Must be exactly 1.0.
  1219. //
  1220. // Required field.
  1221. Version string `json:"version,omitempty"`
  1222. // ServerResponse contains the HTTP response code and headers from the
  1223. // server.
  1224. googleapi.ServerResponse `json:"-"`
  1225. // ForceSendFields is a list of field names (e.g. "Kind") to
  1226. // unconditionally include in API requests. By default, fields with
  1227. // empty values are omitted from API requests. However, any non-pointer,
  1228. // non-interface field appearing in ForceSendFields will be sent to the
  1229. // server regardless of whether the field is empty or not. This may be
  1230. // used to include empty fields in Patch requests.
  1231. ForceSendFields []string `json:"-"`
  1232. // NullFields is a list of field names (e.g. "Kind") to include in API
  1233. // requests with the JSON null value. By default, fields with empty
  1234. // values are omitted from API requests. However, any field with an
  1235. // empty value appearing in NullFields will be sent to the server as
  1236. // null. It is an error if a field in this list has a non-empty value.
  1237. // This may be used to include null fields in Patch requests.
  1238. NullFields []string `json:"-"`
  1239. }
  1240. func (s *PawsNotifySpectrumUseResponse) MarshalJSON() ([]byte, error) {
  1241. type NoMethod PawsNotifySpectrumUseResponse
  1242. raw := NoMethod(*s)
  1243. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1244. }
  1245. // PawsRegisterRequest: The registration request message contains the
  1246. // required registration parameters.
  1247. type PawsRegisterRequest struct {
  1248. // Antenna: Antenna characteristics, including its height and height
  1249. // type.
  1250. Antenna *AntennaCharacteristics `json:"antenna,omitempty"`
  1251. // DeviceDesc: A DeviceDescriptor is required.
  1252. DeviceDesc *DeviceDescriptor `json:"deviceDesc,omitempty"`
  1253. // DeviceOwner: Device owner information is required.
  1254. DeviceOwner *DeviceOwner `json:"deviceOwner,omitempty"`
  1255. // Location: A device's geolocation is required.
  1256. Location *GeoLocation `json:"location,omitempty"`
  1257. // Type: The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ,
  1258. // ...).
  1259. //
  1260. // Required field.
  1261. Type string `json:"type,omitempty"`
  1262. // Version: The PAWS version. Must be exactly 1.0.
  1263. //
  1264. // Required field.
  1265. Version string `json:"version,omitempty"`
  1266. // ForceSendFields is a list of field names (e.g. "Antenna") to
  1267. // unconditionally include in API requests. By default, fields with
  1268. // empty values are omitted from API requests. However, any non-pointer,
  1269. // non-interface field appearing in ForceSendFields will be sent to the
  1270. // server regardless of whether the field is empty or not. This may be
  1271. // used to include empty fields in Patch requests.
  1272. ForceSendFields []string `json:"-"`
  1273. // NullFields is a list of field names (e.g. "Antenna") to include in
  1274. // API requests with the JSON null value. By default, fields with empty
  1275. // values are omitted from API requests. However, any field with an
  1276. // empty value appearing in NullFields will be sent to the server as
  1277. // null. It is an error if a field in this list has a non-empty value.
  1278. // This may be used to include null fields in Patch requests.
  1279. NullFields []string `json:"-"`
  1280. }
  1281. func (s *PawsRegisterRequest) MarshalJSON() ([]byte, error) {
  1282. type NoMethod PawsRegisterRequest
  1283. raw := NoMethod(*s)
  1284. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1285. }
  1286. // PawsRegisterResponse: The registration response message simply
  1287. // acknowledges receipt of the request and is otherwise empty.
  1288. type PawsRegisterResponse struct {
  1289. // DatabaseChange: A database may include the databaseChange parameter
  1290. // to notify a device of a change to its database URI, providing one or
  1291. // more alternate database URIs. The device should use this information
  1292. // to update its list of pre-configured databases by (only) replacing
  1293. // its entry for the responding database with the list of alternate
  1294. // URIs.
  1295. DatabaseChange *DbUpdateSpec `json:"databaseChange,omitempty"`
  1296. // Kind: Identifies what kind of resource this is. Value: the fixed
  1297. // string "spectrum#pawsRegisterResponse".
  1298. Kind string `json:"kind,omitempty"`
  1299. // Type: The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ,
  1300. // ...).
  1301. //
  1302. // Required field.
  1303. Type string `json:"type,omitempty"`
  1304. // Version: The PAWS version. Must be exactly 1.0.
  1305. //
  1306. // Required field.
  1307. Version string `json:"version,omitempty"`
  1308. // ServerResponse contains the HTTP response code and headers from the
  1309. // server.
  1310. googleapi.ServerResponse `json:"-"`
  1311. // ForceSendFields is a list of field names (e.g. "DatabaseChange") to
  1312. // unconditionally include in API requests. By default, fields with
  1313. // empty values are omitted from API requests. However, any non-pointer,
  1314. // non-interface field appearing in ForceSendFields will be sent to the
  1315. // server regardless of whether the field is empty or not. This may be
  1316. // used to include empty fields in Patch requests.
  1317. ForceSendFields []string `json:"-"`
  1318. // NullFields is a list of field names (e.g. "DatabaseChange") to
  1319. // include in API requests with the JSON null value. By default, fields
  1320. // with empty values are omitted from API requests. However, any field
  1321. // with an empty value appearing in NullFields will be sent to the
  1322. // server as null. It is an error if a field in this list has a
  1323. // non-empty value. This may be used to include null fields in Patch
  1324. // requests.
  1325. NullFields []string `json:"-"`
  1326. }
  1327. func (s *PawsRegisterResponse) MarshalJSON() ([]byte, error) {
  1328. type NoMethod PawsRegisterResponse
  1329. raw := NoMethod(*s)
  1330. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1331. }
  1332. // PawsVerifyDeviceRequest: The device validation request message.
  1333. type PawsVerifyDeviceRequest struct {
  1334. // DeviceDescs: A list of device descriptors, which specifies the slave
  1335. // devices to be validated, is required.
  1336. DeviceDescs []*DeviceDescriptor `json:"deviceDescs,omitempty"`
  1337. // Type: The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ,
  1338. // ...).
  1339. //
  1340. // Required field.
  1341. Type string `json:"type,omitempty"`
  1342. // Version: The PAWS version. Must be exactly 1.0.
  1343. //
  1344. // Required field.
  1345. Version string `json:"version,omitempty"`
  1346. // ForceSendFields is a list of field names (e.g. "DeviceDescs") to
  1347. // unconditionally include in API requests. By default, fields with
  1348. // empty values are omitted from API requests. However, any non-pointer,
  1349. // non-interface field appearing in ForceSendFields will be sent to the
  1350. // server regardless of whether the field is empty or not. This may be
  1351. // used to include empty fields in Patch requests.
  1352. ForceSendFields []string `json:"-"`
  1353. // NullFields is a list of field names (e.g. "DeviceDescs") to include
  1354. // in API requests with the JSON null value. By default, fields with
  1355. // empty values are omitted from API requests. However, any field with
  1356. // an empty value appearing in NullFields will be sent to the server as
  1357. // null. It is an error if a field in this list has a non-empty value.
  1358. // This may be used to include null fields in Patch requests.
  1359. NullFields []string `json:"-"`
  1360. }
  1361. func (s *PawsVerifyDeviceRequest) MarshalJSON() ([]byte, error) {
  1362. type NoMethod PawsVerifyDeviceRequest
  1363. raw := NoMethod(*s)
  1364. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1365. }
  1366. // PawsVerifyDeviceResponse: The device validation response message.
  1367. type PawsVerifyDeviceResponse struct {
  1368. // DatabaseChange: A database may include the databaseChange parameter
  1369. // to notify a device of a change to its database URI, providing one or
  1370. // more alternate database URIs. The device should use this information
  1371. // to update its list of pre-configured databases by (only) replacing
  1372. // its entry for the responding database with the list of alternate
  1373. // URIs.
  1374. DatabaseChange *DbUpdateSpec `json:"databaseChange,omitempty"`
  1375. // DeviceValidities: A device validities list is required in the device
  1376. // validation response to report whether each slave device listed in a
  1377. // previous device validation request is valid. The number of entries
  1378. // must match the number of device descriptors listed in the previous
  1379. // device validation request.
  1380. DeviceValidities []*DeviceValidity `json:"deviceValidities,omitempty"`
  1381. // Kind: Identifies what kind of resource this is. Value: the fixed
  1382. // string "spectrum#pawsVerifyDeviceResponse".
  1383. Kind string `json:"kind,omitempty"`
  1384. // Type: The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ,
  1385. // ...).
  1386. //
  1387. // Required field.
  1388. Type string `json:"type,omitempty"`
  1389. // Version: The PAWS version. Must be exactly 1.0.
  1390. //
  1391. // Required field.
  1392. Version string `json:"version,omitempty"`
  1393. // ServerResponse contains the HTTP response code and headers from the
  1394. // server.
  1395. googleapi.ServerResponse `json:"-"`
  1396. // ForceSendFields is a list of field names (e.g. "DatabaseChange") to
  1397. // unconditionally include in API requests. By default, fields with
  1398. // empty values are omitted from API requests. However, any non-pointer,
  1399. // non-interface field appearing in ForceSendFields will be sent to the
  1400. // server regardless of whether the field is empty or not. This may be
  1401. // used to include empty fields in Patch requests.
  1402. ForceSendFields []string `json:"-"`
  1403. // NullFields is a list of field names (e.g. "DatabaseChange") to
  1404. // include in API requests with the JSON null value. By default, fields
  1405. // with empty values are omitted from API requests. However, any field
  1406. // with an empty value appearing in NullFields will be sent to the
  1407. // server as null. It is an error if a field in this list has a
  1408. // non-empty value. This may be used to include null fields in Patch
  1409. // requests.
  1410. NullFields []string `json:"-"`
  1411. }
  1412. func (s *PawsVerifyDeviceResponse) MarshalJSON() ([]byte, error) {
  1413. type NoMethod PawsVerifyDeviceResponse
  1414. raw := NoMethod(*s)
  1415. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1416. }
  1417. // RulesetInfo: This contains parameters for the ruleset of a regulatory
  1418. // domain that is communicated using the initialization and
  1419. // available-spectrum processes.
  1420. type RulesetInfo struct {
  1421. // Authority: The regulatory domain to which the ruleset belongs is
  1422. // required. It must be a 2-letter country code. The device should use
  1423. // this to determine additional device behavior required by the
  1424. // associated regulatory domain.
  1425. Authority string `json:"authority,omitempty"`
  1426. // MaxLocationChange: The maximum location change in meters is required
  1427. // in the initialization response, but optional otherwise. When the
  1428. // device changes location by more than this specified distance, it must
  1429. // contact the database to get the available spectrum for the new
  1430. // location. If the device is using spectrum that is no longer
  1431. // available, it must immediately cease use of the spectrum under rules
  1432. // for database-managed spectrum. If this value is provided within the
  1433. // context of an available-spectrum response, it takes precedence over
  1434. // the value within the initialization response.
  1435. MaxLocationChange float64 `json:"maxLocationChange,omitempty"`
  1436. // MaxPollingSecs: The maximum duration, in seconds, between requests
  1437. // for available spectrum. It is required in the initialization
  1438. // response, but optional otherwise. The device must contact the
  1439. // database to get available spectrum no less frequently than this
  1440. // duration. If the new spectrum information indicates that the device
  1441. // is using spectrum that is no longer available, it must immediately
  1442. // cease use of those frequencies under rules for database-managed
  1443. // spectrum. If this value is provided within the context of an
  1444. // available-spectrum response, it takes precedence over the value
  1445. // within the initialization response.
  1446. MaxPollingSecs int64 `json:"maxPollingSecs,omitempty"`
  1447. // RulesetIds: The identifiers of the rulesets supported for the
  1448. // device's location. The database should include at least one
  1449. // applicable ruleset in the initialization response. The device may use
  1450. // the ruleset identifiers to determine parameters to include in
  1451. // subsequent requests. Within the context of the available-spectrum
  1452. // responses, the database should include the identifier of the ruleset
  1453. // that it used to determine the available-spectrum response. If
  1454. // included, the device must use the specified ruleset to interpret the
  1455. // response. If the device does not support the indicated ruleset, it
  1456. // must not operate in the spectrum governed by the ruleset.
  1457. RulesetIds []string `json:"rulesetIds,omitempty"`
  1458. // ForceSendFields is a list of field names (e.g. "Authority") to
  1459. // unconditionally include in API requests. By default, fields with
  1460. // empty values are omitted from API requests. However, any non-pointer,
  1461. // non-interface field appearing in ForceSendFields will be sent to the
  1462. // server regardless of whether the field is empty or not. This may be
  1463. // used to include empty fields in Patch requests.
  1464. ForceSendFields []string `json:"-"`
  1465. // NullFields is a list of field names (e.g. "Authority") to include in
  1466. // API requests with the JSON null value. By default, fields with empty
  1467. // values are omitted from API requests. However, any field with an
  1468. // empty value appearing in NullFields will be sent to the server as
  1469. // null. It is an error if a field in this list has a non-empty value.
  1470. // This may be used to include null fields in Patch requests.
  1471. NullFields []string `json:"-"`
  1472. }
  1473. func (s *RulesetInfo) MarshalJSON() ([]byte, error) {
  1474. type NoMethod RulesetInfo
  1475. raw := NoMethod(*s)
  1476. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1477. }
  1478. func (s *RulesetInfo) UnmarshalJSON(data []byte) error {
  1479. type NoMethod RulesetInfo
  1480. var s1 struct {
  1481. MaxLocationChange gensupport.JSONFloat64 `json:"maxLocationChange"`
  1482. *NoMethod
  1483. }
  1484. s1.NoMethod = (*NoMethod)(s)
  1485. if err := json.Unmarshal(data, &s1); err != nil {
  1486. return err
  1487. }
  1488. s.MaxLocationChange = float64(s1.MaxLocationChange)
  1489. return nil
  1490. }
  1491. // SpectrumMessage: Available spectrum can be logically characterized by
  1492. // a list of frequency ranges and permissible power levels for each
  1493. // range.
  1494. type SpectrumMessage struct {
  1495. // Bandwidth: The bandwidth (in Hertz) for which permissible power
  1496. // levels are specified. For example, FCC regulation would require only
  1497. // one spectrum specification at 6MHz bandwidth, but Ofcom regulation
  1498. // would require two specifications, at 0.1MHz and 8MHz. This parameter
  1499. // may be empty if there is no available spectrum. It will be present
  1500. // otherwise.
  1501. Bandwidth float64 `json:"bandwidth,omitempty"`
  1502. // FrequencyRanges: The list of frequency ranges and permissible power
  1503. // levels. The list may be empty if there is no available spectrum,
  1504. // otherwise it will be present.
  1505. FrequencyRanges []*FrequencyRange `json:"frequencyRanges,omitempty"`
  1506. // ForceSendFields is a list of field names (e.g. "Bandwidth") to
  1507. // unconditionally include in API requests. By default, fields with
  1508. // empty values are omitted from API requests. However, any non-pointer,
  1509. // non-interface field appearing in ForceSendFields will be sent to the
  1510. // server regardless of whether the field is empty or not. This may be
  1511. // used to include empty fields in Patch requests.
  1512. ForceSendFields []string `json:"-"`
  1513. // NullFields is a list of field names (e.g. "Bandwidth") to include in
  1514. // API requests with the JSON null value. By default, fields with empty
  1515. // values are omitted from API requests. However, any field with an
  1516. // empty value appearing in NullFields will be sent to the server as
  1517. // null. It is an error if a field in this list has a non-empty value.
  1518. // This may be used to include null fields in Patch requests.
  1519. NullFields []string `json:"-"`
  1520. }
  1521. func (s *SpectrumMessage) MarshalJSON() ([]byte, error) {
  1522. type NoMethod SpectrumMessage
  1523. raw := NoMethod(*s)
  1524. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1525. }
  1526. func (s *SpectrumMessage) UnmarshalJSON(data []byte) error {
  1527. type NoMethod SpectrumMessage
  1528. var s1 struct {
  1529. Bandwidth gensupport.JSONFloat64 `json:"bandwidth"`
  1530. *NoMethod
  1531. }
  1532. s1.NoMethod = (*NoMethod)(s)
  1533. if err := json.Unmarshal(data, &s1); err != nil {
  1534. return err
  1535. }
  1536. s.Bandwidth = float64(s1.Bandwidth)
  1537. return nil
  1538. }
  1539. // SpectrumSchedule: The spectrum schedule element combines an event
  1540. // time with spectrum profile to define a time period in which the
  1541. // profile is valid.
  1542. type SpectrumSchedule struct {
  1543. // EventTime: The event time expresses when the spectrum profile is
  1544. // valid. It will always be present.
  1545. EventTime *EventTime `json:"eventTime,omitempty"`
  1546. // Spectra: A list of spectrum messages representing the usable profile.
  1547. // It will always be present, but may be empty when there is no
  1548. // available spectrum.
  1549. Spectra []*SpectrumMessage `json:"spectra,omitempty"`
  1550. // ForceSendFields is a list of field names (e.g. "EventTime") to
  1551. // unconditionally include in API requests. By default, fields with
  1552. // empty values are omitted from API requests. However, any non-pointer,
  1553. // non-interface field appearing in ForceSendFields will be sent to the
  1554. // server regardless of whether the field is empty or not. This may be
  1555. // used to include empty fields in Patch requests.
  1556. ForceSendFields []string `json:"-"`
  1557. // NullFields is a list of field names (e.g. "EventTime") to include in
  1558. // API requests with the JSON null value. By default, fields with empty
  1559. // values are omitted from API requests. However, any field with an
  1560. // empty value appearing in NullFields will be sent to the server as
  1561. // null. It is an error if a field in this list has a non-empty value.
  1562. // This may be used to include null fields in Patch requests.
  1563. NullFields []string `json:"-"`
  1564. }
  1565. func (s *SpectrumSchedule) MarshalJSON() ([]byte, error) {
  1566. type NoMethod SpectrumSchedule
  1567. raw := NoMethod(*s)
  1568. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1569. }
  1570. // Vcard: A vCard-in-JSON message that contains only the fields needed
  1571. // for PAWS:
  1572. // - fn: Full name of an individual
  1573. // - org: Name of the organization
  1574. // - adr: Address fields
  1575. // - tel: Telephone numbers
  1576. // - email: Email addresses
  1577. type Vcard struct {
  1578. // Adr: The street address of the entity.
  1579. Adr *VcardAddress `json:"adr,omitempty"`
  1580. // Email: An email address that can be used to reach the contact.
  1581. Email *VcardTypedText `json:"email,omitempty"`
  1582. // Fn: The full name of the contact person. For example: John A. Smith.
  1583. Fn string `json:"fn,omitempty"`
  1584. // Org: The organization associated with the registering entity.
  1585. Org *VcardTypedText `json:"org,omitempty"`
  1586. // Tel: A telephone number that can be used to call the contact.
  1587. Tel *VcardTelephone `json:"tel,omitempty"`
  1588. // ForceSendFields is a list of field names (e.g. "Adr") to
  1589. // unconditionally include in API requests. By default, fields with
  1590. // empty values are omitted from API requests. However, any non-pointer,
  1591. // non-interface field appearing in ForceSendFields will be sent to the
  1592. // server regardless of whether the field is empty or not. This may be
  1593. // used to include empty fields in Patch requests.
  1594. ForceSendFields []string `json:"-"`
  1595. // NullFields is a list of field names (e.g. "Adr") to include in API
  1596. // requests with the JSON null value. By default, fields with empty
  1597. // values are omitted from API requests. However, any field with an
  1598. // empty value appearing in NullFields will be sent to the server as
  1599. // null. It is an error if a field in this list has a non-empty value.
  1600. // This may be used to include null fields in Patch requests.
  1601. NullFields []string `json:"-"`
  1602. }
  1603. func (s *Vcard) MarshalJSON() ([]byte, error) {
  1604. type NoMethod Vcard
  1605. raw := NoMethod(*s)
  1606. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1607. }
  1608. // VcardAddress: The structure used to represent a street address.
  1609. type VcardAddress struct {
  1610. // Code: The postal code associated with the address. For example:
  1611. // 94423.
  1612. Code string `json:"code,omitempty"`
  1613. // Country: The country name. For example: US.
  1614. Country string `json:"country,omitempty"`
  1615. // Locality: The city or local equivalent portion of the address. For
  1616. // example: San Jose.
  1617. Locality string `json:"locality,omitempty"`
  1618. // Pobox: An optional post office box number.
  1619. Pobox string `json:"pobox,omitempty"`
  1620. // Region: The state or local equivalent portion of the address. For
  1621. // example: CA.
  1622. Region string `json:"region,omitempty"`
  1623. // Street: The street number and name. For example: 123 Any St.
  1624. Street string `json:"street,omitempty"`
  1625. // ForceSendFields is a list of field names (e.g. "Code") to
  1626. // unconditionally include in API requests. By default, fields with
  1627. // empty values are omitted from API requests. However, any non-pointer,
  1628. // non-interface field appearing in ForceSendFields will be sent to the
  1629. // server regardless of whether the field is empty or not. This may be
  1630. // used to include empty fields in Patch requests.
  1631. ForceSendFields []string `json:"-"`
  1632. // NullFields is a list of field names (e.g. "Code") to include in API
  1633. // requests with the JSON null value. By default, fields with empty
  1634. // values are omitted from API requests. However, any field with an
  1635. // empty value appearing in NullFields will be sent to the server as
  1636. // null. It is an error if a field in this list has a non-empty value.
  1637. // This may be used to include null fields in Patch requests.
  1638. NullFields []string `json:"-"`
  1639. }
  1640. func (s *VcardAddress) MarshalJSON() ([]byte, error) {
  1641. type NoMethod VcardAddress
  1642. raw := NoMethod(*s)
  1643. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1644. }
  1645. // VcardTelephone: The structure used to represent a telephone number.
  1646. type VcardTelephone struct {
  1647. // Uri: A nested telephone URI of the form: tel:+1-123-456-7890.
  1648. Uri string `json:"uri,omitempty"`
  1649. // ForceSendFields is a list of field names (e.g. "Uri") to
  1650. // unconditionally include in API requests. By default, fields with
  1651. // empty values are omitted from API requests. However, any non-pointer,
  1652. // non-interface field appearing in ForceSendFields will be sent to the
  1653. // server regardless of whether the field is empty or not. This may be
  1654. // used to include empty fields in Patch requests.
  1655. ForceSendFields []string `json:"-"`
  1656. // NullFields is a list of field names (e.g. "Uri") to include in API
  1657. // requests with the JSON null value. By default, fields with empty
  1658. // values are omitted from API requests. However, any field with an
  1659. // empty value appearing in NullFields will be sent to the server as
  1660. // null. It is an error if a field in this list has a non-empty value.
  1661. // This may be used to include null fields in Patch requests.
  1662. NullFields []string `json:"-"`
  1663. }
  1664. func (s *VcardTelephone) MarshalJSON() ([]byte, error) {
  1665. type NoMethod VcardTelephone
  1666. raw := NoMethod(*s)
  1667. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1668. }
  1669. // VcardTypedText: The structure used to represent an organization and
  1670. // an email address.
  1671. type VcardTypedText struct {
  1672. // Text: The text string associated with this item. For example, for an
  1673. // org field: ACME, inc. For an email field: smith@example.com.
  1674. Text string `json:"text,omitempty"`
  1675. // ForceSendFields is a list of field names (e.g. "Text") to
  1676. // unconditionally include in API requests. By default, fields with
  1677. // empty values are omitted from API requests. However, any non-pointer,
  1678. // non-interface field appearing in ForceSendFields will be sent to the
  1679. // server regardless of whether the field is empty or not. This may be
  1680. // used to include empty fields in Patch requests.
  1681. ForceSendFields []string `json:"-"`
  1682. // NullFields is a list of field names (e.g. "Text") to include in API
  1683. // requests with the JSON null value. By default, fields with empty
  1684. // values are omitted from API requests. However, any field with an
  1685. // empty value appearing in NullFields will be sent to the server as
  1686. // null. It is an error if a field in this list has a non-empty value.
  1687. // This may be used to include null fields in Patch requests.
  1688. NullFields []string `json:"-"`
  1689. }
  1690. func (s *VcardTypedText) MarshalJSON() ([]byte, error) {
  1691. type NoMethod VcardTypedText
  1692. raw := NoMethod(*s)
  1693. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1694. }
  1695. // method id "spectrum.paws.getSpectrum":
  1696. type PawsGetSpectrumCall struct {
  1697. s *Service
  1698. pawsgetspectrumrequest *PawsGetSpectrumRequest
  1699. urlParams_ gensupport.URLParams
  1700. ctx_ context.Context
  1701. header_ http.Header
  1702. }
  1703. // GetSpectrum: Requests information about the available spectrum for a
  1704. // device at a location. Requests from a fixed-mode device must include
  1705. // owner information so the device can be registered with the database.
  1706. func (r *PawsService) GetSpectrum(pawsgetspectrumrequest *PawsGetSpectrumRequest) *PawsGetSpectrumCall {
  1707. c := &PawsGetSpectrumCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1708. c.pawsgetspectrumrequest = pawsgetspectrumrequest
  1709. return c
  1710. }
  1711. // Fields allows partial responses to be retrieved. See
  1712. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1713. // for more information.
  1714. func (c *PawsGetSpectrumCall) Fields(s ...googleapi.Field) *PawsGetSpectrumCall {
  1715. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1716. return c
  1717. }
  1718. // Context sets the context to be used in this call's Do method. Any
  1719. // pending HTTP request will be aborted if the provided context is
  1720. // canceled.
  1721. func (c *PawsGetSpectrumCall) Context(ctx context.Context) *PawsGetSpectrumCall {
  1722. c.ctx_ = ctx
  1723. return c
  1724. }
  1725. // Header returns an http.Header that can be modified by the caller to
  1726. // add HTTP headers to the request.
  1727. func (c *PawsGetSpectrumCall) Header() http.Header {
  1728. if c.header_ == nil {
  1729. c.header_ = make(http.Header)
  1730. }
  1731. return c.header_
  1732. }
  1733. func (c *PawsGetSpectrumCall) doRequest(alt string) (*http.Response, error) {
  1734. reqHeaders := make(http.Header)
  1735. for k, v := range c.header_ {
  1736. reqHeaders[k] = v
  1737. }
  1738. reqHeaders.Set("User-Agent", c.s.userAgent())
  1739. var body io.Reader = nil
  1740. body, err := googleapi.WithoutDataWrapper.JSONReader(c.pawsgetspectrumrequest)
  1741. if err != nil {
  1742. return nil, err
  1743. }
  1744. reqHeaders.Set("Content-Type", "application/json")
  1745. c.urlParams_.Set("alt", alt)
  1746. urls := googleapi.ResolveRelative(c.s.BasePath, "getSpectrum")
  1747. urls += "?" + c.urlParams_.Encode()
  1748. req, _ := http.NewRequest("POST", urls, body)
  1749. req.Header = reqHeaders
  1750. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1751. }
  1752. // Do executes the "spectrum.paws.getSpectrum" call.
  1753. // Exactly one of *PawsGetSpectrumResponse or error will be non-nil. Any
  1754. // non-2xx status code is an error. Response headers are in either
  1755. // *PawsGetSpectrumResponse.ServerResponse.Header or (if a response was
  1756. // returned at all) in error.(*googleapi.Error).Header. Use
  1757. // googleapi.IsNotModified to check whether the returned error was
  1758. // because http.StatusNotModified was returned.
  1759. func (c *PawsGetSpectrumCall) Do(opts ...googleapi.CallOption) (*PawsGetSpectrumResponse, error) {
  1760. gensupport.SetOptions(c.urlParams_, opts...)
  1761. res, err := c.doRequest("json")
  1762. if res != nil && res.StatusCode == http.StatusNotModified {
  1763. if res.Body != nil {
  1764. res.Body.Close()
  1765. }
  1766. return nil, &googleapi.Error{
  1767. Code: res.StatusCode,
  1768. Header: res.Header,
  1769. }
  1770. }
  1771. if err != nil {
  1772. return nil, err
  1773. }
  1774. defer googleapi.CloseBody(res)
  1775. if err := googleapi.CheckResponse(res); err != nil {
  1776. return nil, err
  1777. }
  1778. ret := &PawsGetSpectrumResponse{
  1779. ServerResponse: googleapi.ServerResponse{
  1780. Header: res.Header,
  1781. HTTPStatusCode: res.StatusCode,
  1782. },
  1783. }
  1784. target := &ret
  1785. if err := gensupport.DecodeResponse(target, res); err != nil {
  1786. return nil, err
  1787. }
  1788. return ret, nil
  1789. // {
  1790. // "description": "Requests information about the available spectrum for a device at a location. Requests from a fixed-mode device must include owner information so the device can be registered with the database.",
  1791. // "httpMethod": "POST",
  1792. // "id": "spectrum.paws.getSpectrum",
  1793. // "path": "getSpectrum",
  1794. // "request": {
  1795. // "$ref": "PawsGetSpectrumRequest"
  1796. // },
  1797. // "response": {
  1798. // "$ref": "PawsGetSpectrumResponse"
  1799. // }
  1800. // }
  1801. }
  1802. // method id "spectrum.paws.getSpectrumBatch":
  1803. type PawsGetSpectrumBatchCall struct {
  1804. s *Service
  1805. pawsgetspectrumbatchrequest *PawsGetSpectrumBatchRequest
  1806. urlParams_ gensupport.URLParams
  1807. ctx_ context.Context
  1808. header_ http.Header
  1809. }
  1810. // GetSpectrumBatch: The Google Spectrum Database does not support batch
  1811. // requests, so this method always yields an UNIMPLEMENTED error.
  1812. func (r *PawsService) GetSpectrumBatch(pawsgetspectrumbatchrequest *PawsGetSpectrumBatchRequest) *PawsGetSpectrumBatchCall {
  1813. c := &PawsGetSpectrumBatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1814. c.pawsgetspectrumbatchrequest = pawsgetspectrumbatchrequest
  1815. return c
  1816. }
  1817. // Fields allows partial responses to be retrieved. See
  1818. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1819. // for more information.
  1820. func (c *PawsGetSpectrumBatchCall) Fields(s ...googleapi.Field) *PawsGetSpectrumBatchCall {
  1821. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1822. return c
  1823. }
  1824. // Context sets the context to be used in this call's Do method. Any
  1825. // pending HTTP request will be aborted if the provided context is
  1826. // canceled.
  1827. func (c *PawsGetSpectrumBatchCall) Context(ctx context.Context) *PawsGetSpectrumBatchCall {
  1828. c.ctx_ = ctx
  1829. return c
  1830. }
  1831. // Header returns an http.Header that can be modified by the caller to
  1832. // add HTTP headers to the request.
  1833. func (c *PawsGetSpectrumBatchCall) Header() http.Header {
  1834. if c.header_ == nil {
  1835. c.header_ = make(http.Header)
  1836. }
  1837. return c.header_
  1838. }
  1839. func (c *PawsGetSpectrumBatchCall) doRequest(alt string) (*http.Response, error) {
  1840. reqHeaders := make(http.Header)
  1841. for k, v := range c.header_ {
  1842. reqHeaders[k] = v
  1843. }
  1844. reqHeaders.Set("User-Agent", c.s.userAgent())
  1845. var body io.Reader = nil
  1846. body, err := googleapi.WithoutDataWrapper.JSONReader(c.pawsgetspectrumbatchrequest)
  1847. if err != nil {
  1848. return nil, err
  1849. }
  1850. reqHeaders.Set("Content-Type", "application/json")
  1851. c.urlParams_.Set("alt", alt)
  1852. urls := googleapi.ResolveRelative(c.s.BasePath, "getSpectrumBatch")
  1853. urls += "?" + c.urlParams_.Encode()
  1854. req, _ := http.NewRequest("POST", urls, body)
  1855. req.Header = reqHeaders
  1856. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1857. }
  1858. // Do executes the "spectrum.paws.getSpectrumBatch" call.
  1859. // Exactly one of *PawsGetSpectrumBatchResponse or error will be
  1860. // non-nil. Any non-2xx status code is an error. Response headers are in
  1861. // either *PawsGetSpectrumBatchResponse.ServerResponse.Header or (if a
  1862. // response was returned at all) in error.(*googleapi.Error).Header. Use
  1863. // googleapi.IsNotModified to check whether the returned error was
  1864. // because http.StatusNotModified was returned.
  1865. func (c *PawsGetSpectrumBatchCall) Do(opts ...googleapi.CallOption) (*PawsGetSpectrumBatchResponse, error) {
  1866. gensupport.SetOptions(c.urlParams_, opts...)
  1867. res, err := c.doRequest("json")
  1868. if res != nil && res.StatusCode == http.StatusNotModified {
  1869. if res.Body != nil {
  1870. res.Body.Close()
  1871. }
  1872. return nil, &googleapi.Error{
  1873. Code: res.StatusCode,
  1874. Header: res.Header,
  1875. }
  1876. }
  1877. if err != nil {
  1878. return nil, err
  1879. }
  1880. defer googleapi.CloseBody(res)
  1881. if err := googleapi.CheckResponse(res); err != nil {
  1882. return nil, err
  1883. }
  1884. ret := &PawsGetSpectrumBatchResponse{
  1885. ServerResponse: googleapi.ServerResponse{
  1886. Header: res.Header,
  1887. HTTPStatusCode: res.StatusCode,
  1888. },
  1889. }
  1890. target := &ret
  1891. if err := gensupport.DecodeResponse(target, res); err != nil {
  1892. return nil, err
  1893. }
  1894. return ret, nil
  1895. // {
  1896. // "description": "The Google Spectrum Database does not support batch requests, so this method always yields an UNIMPLEMENTED error.",
  1897. // "httpMethod": "POST",
  1898. // "id": "spectrum.paws.getSpectrumBatch",
  1899. // "path": "getSpectrumBatch",
  1900. // "request": {
  1901. // "$ref": "PawsGetSpectrumBatchRequest"
  1902. // },
  1903. // "response": {
  1904. // "$ref": "PawsGetSpectrumBatchResponse"
  1905. // }
  1906. // }
  1907. }
  1908. // method id "spectrum.paws.init":
  1909. type PawsInitCall struct {
  1910. s *Service
  1911. pawsinitrequest *PawsInitRequest
  1912. urlParams_ gensupport.URLParams
  1913. ctx_ context.Context
  1914. header_ http.Header
  1915. }
  1916. // Init: Initializes the connection between a white space device and the
  1917. // database.
  1918. func (r *PawsService) Init(pawsinitrequest *PawsInitRequest) *PawsInitCall {
  1919. c := &PawsInitCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1920. c.pawsinitrequest = pawsinitrequest
  1921. return c
  1922. }
  1923. // Fields allows partial responses to be retrieved. See
  1924. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1925. // for more information.
  1926. func (c *PawsInitCall) Fields(s ...googleapi.Field) *PawsInitCall {
  1927. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1928. return c
  1929. }
  1930. // Context sets the context to be used in this call's Do method. Any
  1931. // pending HTTP request will be aborted if the provided context is
  1932. // canceled.
  1933. func (c *PawsInitCall) Context(ctx context.Context) *PawsInitCall {
  1934. c.ctx_ = ctx
  1935. return c
  1936. }
  1937. // Header returns an http.Header that can be modified by the caller to
  1938. // add HTTP headers to the request.
  1939. func (c *PawsInitCall) Header() http.Header {
  1940. if c.header_ == nil {
  1941. c.header_ = make(http.Header)
  1942. }
  1943. return c.header_
  1944. }
  1945. func (c *PawsInitCall) doRequest(alt string) (*http.Response, error) {
  1946. reqHeaders := make(http.Header)
  1947. for k, v := range c.header_ {
  1948. reqHeaders[k] = v
  1949. }
  1950. reqHeaders.Set("User-Agent", c.s.userAgent())
  1951. var body io.Reader = nil
  1952. body, err := googleapi.WithoutDataWrapper.JSONReader(c.pawsinitrequest)
  1953. if err != nil {
  1954. return nil, err
  1955. }
  1956. reqHeaders.Set("Content-Type", "application/json")
  1957. c.urlParams_.Set("alt", alt)
  1958. urls := googleapi.ResolveRelative(c.s.BasePath, "init")
  1959. urls += "?" + c.urlParams_.Encode()
  1960. req, _ := http.NewRequest("POST", urls, body)
  1961. req.Header = reqHeaders
  1962. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1963. }
  1964. // Do executes the "spectrum.paws.init" call.
  1965. // Exactly one of *PawsInitResponse or error will be non-nil. Any
  1966. // non-2xx status code is an error. Response headers are in either
  1967. // *PawsInitResponse.ServerResponse.Header or (if a response was
  1968. // returned at all) in error.(*googleapi.Error).Header. Use
  1969. // googleapi.IsNotModified to check whether the returned error was
  1970. // because http.StatusNotModified was returned.
  1971. func (c *PawsInitCall) Do(opts ...googleapi.CallOption) (*PawsInitResponse, error) {
  1972. gensupport.SetOptions(c.urlParams_, opts...)
  1973. res, err := c.doRequest("json")
  1974. if res != nil && res.StatusCode == http.StatusNotModified {
  1975. if res.Body != nil {
  1976. res.Body.Close()
  1977. }
  1978. return nil, &googleapi.Error{
  1979. Code: res.StatusCode,
  1980. Header: res.Header,
  1981. }
  1982. }
  1983. if err != nil {
  1984. return nil, err
  1985. }
  1986. defer googleapi.CloseBody(res)
  1987. if err := googleapi.CheckResponse(res); err != nil {
  1988. return nil, err
  1989. }
  1990. ret := &PawsInitResponse{
  1991. ServerResponse: googleapi.ServerResponse{
  1992. Header: res.Header,
  1993. HTTPStatusCode: res.StatusCode,
  1994. },
  1995. }
  1996. target := &ret
  1997. if err := gensupport.DecodeResponse(target, res); err != nil {
  1998. return nil, err
  1999. }
  2000. return ret, nil
  2001. // {
  2002. // "description": "Initializes the connection between a white space device and the database.",
  2003. // "httpMethod": "POST",
  2004. // "id": "spectrum.paws.init",
  2005. // "path": "init",
  2006. // "request": {
  2007. // "$ref": "PawsInitRequest"
  2008. // },
  2009. // "response": {
  2010. // "$ref": "PawsInitResponse"
  2011. // }
  2012. // }
  2013. }
  2014. // method id "spectrum.paws.notifySpectrumUse":
  2015. type PawsNotifySpectrumUseCall struct {
  2016. s *Service
  2017. pawsnotifyspectrumuserequest *PawsNotifySpectrumUseRequest
  2018. urlParams_ gensupport.URLParams
  2019. ctx_ context.Context
  2020. header_ http.Header
  2021. }
  2022. // NotifySpectrumUse: Notifies the database that the device has selected
  2023. // certain frequency ranges for transmission. Only to be invoked when
  2024. // required by the regulator. The Google Spectrum Database does not
  2025. // operate in domains that require notification, so this always yields
  2026. // an UNIMPLEMENTED error.
  2027. func (r *PawsService) NotifySpectrumUse(pawsnotifyspectrumuserequest *PawsNotifySpectrumUseRequest) *PawsNotifySpectrumUseCall {
  2028. c := &PawsNotifySpectrumUseCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2029. c.pawsnotifyspectrumuserequest = pawsnotifyspectrumuserequest
  2030. return c
  2031. }
  2032. // Fields allows partial responses to be retrieved. See
  2033. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2034. // for more information.
  2035. func (c *PawsNotifySpectrumUseCall) Fields(s ...googleapi.Field) *PawsNotifySpectrumUseCall {
  2036. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2037. return c
  2038. }
  2039. // Context sets the context to be used in this call's Do method. Any
  2040. // pending HTTP request will be aborted if the provided context is
  2041. // canceled.
  2042. func (c *PawsNotifySpectrumUseCall) Context(ctx context.Context) *PawsNotifySpectrumUseCall {
  2043. c.ctx_ = ctx
  2044. return c
  2045. }
  2046. // Header returns an http.Header that can be modified by the caller to
  2047. // add HTTP headers to the request.
  2048. func (c *PawsNotifySpectrumUseCall) Header() http.Header {
  2049. if c.header_ == nil {
  2050. c.header_ = make(http.Header)
  2051. }
  2052. return c.header_
  2053. }
  2054. func (c *PawsNotifySpectrumUseCall) doRequest(alt string) (*http.Response, error) {
  2055. reqHeaders := make(http.Header)
  2056. for k, v := range c.header_ {
  2057. reqHeaders[k] = v
  2058. }
  2059. reqHeaders.Set("User-Agent", c.s.userAgent())
  2060. var body io.Reader = nil
  2061. body, err := googleapi.WithoutDataWrapper.JSONReader(c.pawsnotifyspectrumuserequest)
  2062. if err != nil {
  2063. return nil, err
  2064. }
  2065. reqHeaders.Set("Content-Type", "application/json")
  2066. c.urlParams_.Set("alt", alt)
  2067. urls := googleapi.ResolveRelative(c.s.BasePath, "notifySpectrumUse")
  2068. urls += "?" + c.urlParams_.Encode()
  2069. req, _ := http.NewRequest("POST", urls, body)
  2070. req.Header = reqHeaders
  2071. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2072. }
  2073. // Do executes the "spectrum.paws.notifySpectrumUse" call.
  2074. // Exactly one of *PawsNotifySpectrumUseResponse or error will be
  2075. // non-nil. Any non-2xx status code is an error. Response headers are in
  2076. // either *PawsNotifySpectrumUseResponse.ServerResponse.Header or (if a
  2077. // response was returned at all) in error.(*googleapi.Error).Header. Use
  2078. // googleapi.IsNotModified to check whether the returned error was
  2079. // because http.StatusNotModified was returned.
  2080. func (c *PawsNotifySpectrumUseCall) Do(opts ...googleapi.CallOption) (*PawsNotifySpectrumUseResponse, error) {
  2081. gensupport.SetOptions(c.urlParams_, opts...)
  2082. res, err := c.doRequest("json")
  2083. if res != nil && res.StatusCode == http.StatusNotModified {
  2084. if res.Body != nil {
  2085. res.Body.Close()
  2086. }
  2087. return nil, &googleapi.Error{
  2088. Code: res.StatusCode,
  2089. Header: res.Header,
  2090. }
  2091. }
  2092. if err != nil {
  2093. return nil, err
  2094. }
  2095. defer googleapi.CloseBody(res)
  2096. if err := googleapi.CheckResponse(res); err != nil {
  2097. return nil, err
  2098. }
  2099. ret := &PawsNotifySpectrumUseResponse{
  2100. ServerResponse: googleapi.ServerResponse{
  2101. Header: res.Header,
  2102. HTTPStatusCode: res.StatusCode,
  2103. },
  2104. }
  2105. target := &ret
  2106. if err := gensupport.DecodeResponse(target, res); err != nil {
  2107. return nil, err
  2108. }
  2109. return ret, nil
  2110. // {
  2111. // "description": "Notifies the database that the device has selected certain frequency ranges for transmission. Only to be invoked when required by the regulator. The Google Spectrum Database does not operate in domains that require notification, so this always yields an UNIMPLEMENTED error.",
  2112. // "httpMethod": "POST",
  2113. // "id": "spectrum.paws.notifySpectrumUse",
  2114. // "path": "notifySpectrumUse",
  2115. // "request": {
  2116. // "$ref": "PawsNotifySpectrumUseRequest"
  2117. // },
  2118. // "response": {
  2119. // "$ref": "PawsNotifySpectrumUseResponse"
  2120. // }
  2121. // }
  2122. }
  2123. // method id "spectrum.paws.register":
  2124. type PawsRegisterCall struct {
  2125. s *Service
  2126. pawsregisterrequest *PawsRegisterRequest
  2127. urlParams_ gensupport.URLParams
  2128. ctx_ context.Context
  2129. header_ http.Header
  2130. }
  2131. // Register: The Google Spectrum Database implements registration in the
  2132. // getSpectrum method. As such this always returns an UNIMPLEMENTED
  2133. // error.
  2134. func (r *PawsService) Register(pawsregisterrequest *PawsRegisterRequest) *PawsRegisterCall {
  2135. c := &PawsRegisterCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2136. c.pawsregisterrequest = pawsregisterrequest
  2137. return c
  2138. }
  2139. // Fields allows partial responses to be retrieved. See
  2140. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2141. // for more information.
  2142. func (c *PawsRegisterCall) Fields(s ...googleapi.Field) *PawsRegisterCall {
  2143. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2144. return c
  2145. }
  2146. // Context sets the context to be used in this call's Do method. Any
  2147. // pending HTTP request will be aborted if the provided context is
  2148. // canceled.
  2149. func (c *PawsRegisterCall) Context(ctx context.Context) *PawsRegisterCall {
  2150. c.ctx_ = ctx
  2151. return c
  2152. }
  2153. // Header returns an http.Header that can be modified by the caller to
  2154. // add HTTP headers to the request.
  2155. func (c *PawsRegisterCall) Header() http.Header {
  2156. if c.header_ == nil {
  2157. c.header_ = make(http.Header)
  2158. }
  2159. return c.header_
  2160. }
  2161. func (c *PawsRegisterCall) doRequest(alt string) (*http.Response, error) {
  2162. reqHeaders := make(http.Header)
  2163. for k, v := range c.header_ {
  2164. reqHeaders[k] = v
  2165. }
  2166. reqHeaders.Set("User-Agent", c.s.userAgent())
  2167. var body io.Reader = nil
  2168. body, err := googleapi.WithoutDataWrapper.JSONReader(c.pawsregisterrequest)
  2169. if err != nil {
  2170. return nil, err
  2171. }
  2172. reqHeaders.Set("Content-Type", "application/json")
  2173. c.urlParams_.Set("alt", alt)
  2174. urls := googleapi.ResolveRelative(c.s.BasePath, "register")
  2175. urls += "?" + c.urlParams_.Encode()
  2176. req, _ := http.NewRequest("POST", urls, body)
  2177. req.Header = reqHeaders
  2178. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2179. }
  2180. // Do executes the "spectrum.paws.register" call.
  2181. // Exactly one of *PawsRegisterResponse or error will be non-nil. Any
  2182. // non-2xx status code is an error. Response headers are in either
  2183. // *PawsRegisterResponse.ServerResponse.Header or (if a response was
  2184. // returned at all) in error.(*googleapi.Error).Header. Use
  2185. // googleapi.IsNotModified to check whether the returned error was
  2186. // because http.StatusNotModified was returned.
  2187. func (c *PawsRegisterCall) Do(opts ...googleapi.CallOption) (*PawsRegisterResponse, error) {
  2188. gensupport.SetOptions(c.urlParams_, opts...)
  2189. res, err := c.doRequest("json")
  2190. if res != nil && res.StatusCode == http.StatusNotModified {
  2191. if res.Body != nil {
  2192. res.Body.Close()
  2193. }
  2194. return nil, &googleapi.Error{
  2195. Code: res.StatusCode,
  2196. Header: res.Header,
  2197. }
  2198. }
  2199. if err != nil {
  2200. return nil, err
  2201. }
  2202. defer googleapi.CloseBody(res)
  2203. if err := googleapi.CheckResponse(res); err != nil {
  2204. return nil, err
  2205. }
  2206. ret := &PawsRegisterResponse{
  2207. ServerResponse: googleapi.ServerResponse{
  2208. Header: res.Header,
  2209. HTTPStatusCode: res.StatusCode,
  2210. },
  2211. }
  2212. target := &ret
  2213. if err := gensupport.DecodeResponse(target, res); err != nil {
  2214. return nil, err
  2215. }
  2216. return ret, nil
  2217. // {
  2218. // "description": "The Google Spectrum Database implements registration in the getSpectrum method. As such this always returns an UNIMPLEMENTED error.",
  2219. // "httpMethod": "POST",
  2220. // "id": "spectrum.paws.register",
  2221. // "path": "register",
  2222. // "request": {
  2223. // "$ref": "PawsRegisterRequest"
  2224. // },
  2225. // "response": {
  2226. // "$ref": "PawsRegisterResponse"
  2227. // }
  2228. // }
  2229. }
  2230. // method id "spectrum.paws.verifyDevice":
  2231. type PawsVerifyDeviceCall struct {
  2232. s *Service
  2233. pawsverifydevicerequest *PawsVerifyDeviceRequest
  2234. urlParams_ gensupport.URLParams
  2235. ctx_ context.Context
  2236. header_ http.Header
  2237. }
  2238. // VerifyDevice: Validates a device for white space use in accordance
  2239. // with regulatory rules. The Google Spectrum Database does not support
  2240. // master/slave configurations, so this always yields an UNIMPLEMENTED
  2241. // error.
  2242. func (r *PawsService) VerifyDevice(pawsverifydevicerequest *PawsVerifyDeviceRequest) *PawsVerifyDeviceCall {
  2243. c := &PawsVerifyDeviceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2244. c.pawsverifydevicerequest = pawsverifydevicerequest
  2245. return c
  2246. }
  2247. // Fields allows partial responses to be retrieved. See
  2248. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2249. // for more information.
  2250. func (c *PawsVerifyDeviceCall) Fields(s ...googleapi.Field) *PawsVerifyDeviceCall {
  2251. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2252. return c
  2253. }
  2254. // Context sets the context to be used in this call's Do method. Any
  2255. // pending HTTP request will be aborted if the provided context is
  2256. // canceled.
  2257. func (c *PawsVerifyDeviceCall) Context(ctx context.Context) *PawsVerifyDeviceCall {
  2258. c.ctx_ = ctx
  2259. return c
  2260. }
  2261. // Header returns an http.Header that can be modified by the caller to
  2262. // add HTTP headers to the request.
  2263. func (c *PawsVerifyDeviceCall) Header() http.Header {
  2264. if c.header_ == nil {
  2265. c.header_ = make(http.Header)
  2266. }
  2267. return c.header_
  2268. }
  2269. func (c *PawsVerifyDeviceCall) doRequest(alt string) (*http.Response, error) {
  2270. reqHeaders := make(http.Header)
  2271. for k, v := range c.header_ {
  2272. reqHeaders[k] = v
  2273. }
  2274. reqHeaders.Set("User-Agent", c.s.userAgent())
  2275. var body io.Reader = nil
  2276. body, err := googleapi.WithoutDataWrapper.JSONReader(c.pawsverifydevicerequest)
  2277. if err != nil {
  2278. return nil, err
  2279. }
  2280. reqHeaders.Set("Content-Type", "application/json")
  2281. c.urlParams_.Set("alt", alt)
  2282. urls := googleapi.ResolveRelative(c.s.BasePath, "verifyDevice")
  2283. urls += "?" + c.urlParams_.Encode()
  2284. req, _ := http.NewRequest("POST", urls, body)
  2285. req.Header = reqHeaders
  2286. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2287. }
  2288. // Do executes the "spectrum.paws.verifyDevice" call.
  2289. // Exactly one of *PawsVerifyDeviceResponse or error will be non-nil.
  2290. // Any non-2xx status code is an error. Response headers are in either
  2291. // *PawsVerifyDeviceResponse.ServerResponse.Header or (if a response was
  2292. // returned at all) in error.(*googleapi.Error).Header. Use
  2293. // googleapi.IsNotModified to check whether the returned error was
  2294. // because http.StatusNotModified was returned.
  2295. func (c *PawsVerifyDeviceCall) Do(opts ...googleapi.CallOption) (*PawsVerifyDeviceResponse, error) {
  2296. gensupport.SetOptions(c.urlParams_, opts...)
  2297. res, err := c.doRequest("json")
  2298. if res != nil && res.StatusCode == http.StatusNotModified {
  2299. if res.Body != nil {
  2300. res.Body.Close()
  2301. }
  2302. return nil, &googleapi.Error{
  2303. Code: res.StatusCode,
  2304. Header: res.Header,
  2305. }
  2306. }
  2307. if err != nil {
  2308. return nil, err
  2309. }
  2310. defer googleapi.CloseBody(res)
  2311. if err := googleapi.CheckResponse(res); err != nil {
  2312. return nil, err
  2313. }
  2314. ret := &PawsVerifyDeviceResponse{
  2315. ServerResponse: googleapi.ServerResponse{
  2316. Header: res.Header,
  2317. HTTPStatusCode: res.StatusCode,
  2318. },
  2319. }
  2320. target := &ret
  2321. if err := gensupport.DecodeResponse(target, res); err != nil {
  2322. return nil, err
  2323. }
  2324. return ret, nil
  2325. // {
  2326. // "description": "Validates a device for white space use in accordance with regulatory rules. The Google Spectrum Database does not support master/slave configurations, so this always yields an UNIMPLEMENTED error.",
  2327. // "httpMethod": "POST",
  2328. // "id": "spectrum.paws.verifyDevice",
  2329. // "path": "verifyDevice",
  2330. // "request": {
  2331. // "$ref": "PawsVerifyDeviceRequest"
  2332. // },
  2333. // "response": {
  2334. // "$ref": "PawsVerifyDeviceResponse"
  2335. // }
  2336. // }
  2337. }