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