You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

2648 lines
107 KiB

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