1 // Copyright 2021 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 playablelocations provides access to the Playable Locations API. 8 // 9 // For product documentation, see: https://developers.google.com/maps/contact-sales/ 10 // 11 // # Creating a client 12 // 13 // Usage example: 14 // 15 // import "google.golang.org/api/playablelocations/v3" 16 // ... 17 // ctx := context.Background() 18 // playablelocationsService, err := playablelocations.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 // playablelocationsService, err := playablelocations.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 // playablelocationsService, err := playablelocations.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 playablelocations // import "google.golang.org/api/playablelocations/v3" 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 internaloption "google.golang.org/api/option/internaloption" 56 htransport "google.golang.org/api/transport/http" 57 ) 58 59 // Always reference these packages, just in case the auto-generated code 60 // below doesn't. 61 var _ = bytes.NewBuffer 62 var _ = strconv.Itoa 63 var _ = fmt.Sprintf 64 var _ = json.NewDecoder 65 var _ = io.Copy 66 var _ = url.Parse 67 var _ = gensupport.MarshalJSON 68 var _ = googleapi.Version 69 var _ = errors.New 70 var _ = strings.Replace 71 var _ = context.Canceled 72 var _ = internaloption.WithDefaultEndpoint 73 74 const apiId = "playablelocations:v3" 75 const apiName = "playablelocations" 76 const apiVersion = "v3" 77 const basePath = "https://playablelocations.googleapis.com/" 78 const mtlsBasePath = "https://playablelocations.mtls.googleapis.com/" 79 80 // NewService creates a new Service. 81 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 82 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 83 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 84 client, endpoint, err := htransport.NewClient(ctx, opts...) 85 if err != nil { 86 return nil, err 87 } 88 s, err := New(client) 89 if err != nil { 90 return nil, err 91 } 92 if endpoint != "" { 93 s.BasePath = endpoint 94 } 95 return s, nil 96 } 97 98 // New creates a new Service. It uses the provided http.Client for requests. 99 // 100 // Deprecated: please use NewService instead. 101 // To provide a custom HTTP client, use option.WithHTTPClient. 102 // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 103 func New(client *http.Client) (*Service, error) { 104 if client == nil { 105 return nil, errors.New("client is nil") 106 } 107 s := &Service{client: client, BasePath: basePath} 108 s.V3 = NewV3Service(s) 109 return s, nil 110 } 111 112 type Service struct { 113 client *http.Client 114 BasePath string // API endpoint base URL 115 UserAgent string // optional additional User-Agent fragment 116 117 V3 *V3Service 118 } 119 120 func (s *Service) userAgent() string { 121 if s.UserAgent == "" { 122 return googleapi.UserAgent 123 } 124 return googleapi.UserAgent + " " + s.UserAgent 125 } 126 127 func NewV3Service(s *Service) *V3Service { 128 rs := &V3Service{s: s} 129 return rs 130 } 131 132 type V3Service struct { 133 s *Service 134 } 135 136 // GoogleMapsPlayablelocationsV3Impression: Encapsulates impression 137 // event details. 138 type GoogleMapsPlayablelocationsV3Impression struct { 139 // GameObjectType: An arbitrary, developer-defined type identifier for 140 // each type of game object used in your game. Since players interact 141 // with differ types of game objects in different ways, this field 142 // allows you to segregate impression data by type for analysis. You 143 // should assign a unique `game_object_type` ID to represent a distinct 144 // type of game object in your game. For example, 1=monster location, 145 // 2=powerup location. 146 GameObjectType int64 `json:"gameObjectType,omitempty"` 147 148 // ImpressionType: Required. The type of impression event. 149 // 150 // Possible values: 151 // "IMPRESSION_TYPE_UNSPECIFIED" - Unspecified type. Do not use. 152 // "PRESENTED" - The playable location was presented to a player. 153 // "INTERACTED" - A player interacted with the playable location. 154 ImpressionType string `json:"impressionType,omitempty"` 155 156 // LocationName: Required. The name of the playable location. 157 LocationName string `json:"locationName,omitempty"` 158 159 // ForceSendFields is a list of field names (e.g. "GameObjectType") to 160 // unconditionally include in API requests. By default, fields with 161 // empty or default values are omitted from API requests. However, any 162 // non-pointer, non-interface field appearing in ForceSendFields will be 163 // sent to the server regardless of whether the field is empty or not. 164 // This may be used to include empty fields in Patch requests. 165 ForceSendFields []string `json:"-"` 166 167 // NullFields is a list of field names (e.g. "GameObjectType") to 168 // include in API requests with the JSON null value. By default, fields 169 // with empty values are omitted from API requests. However, any field 170 // with an empty value appearing in NullFields will be sent to the 171 // server as null. It is an error if a field in this list has a 172 // non-empty value. This may be used to include null fields in Patch 173 // requests. 174 NullFields []string `json:"-"` 175 } 176 177 func (s *GoogleMapsPlayablelocationsV3Impression) MarshalJSON() ([]byte, error) { 178 type NoMethod GoogleMapsPlayablelocationsV3Impression 179 raw := NoMethod(*s) 180 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 181 } 182 183 // GoogleMapsPlayablelocationsV3LogImpressionsRequest: A request for 184 // logging impressions. 185 type GoogleMapsPlayablelocationsV3LogImpressionsRequest struct { 186 // ClientInfo: Required. Information about the client device. For 187 // example, device model and operating system. 188 ClientInfo *GoogleMapsUnityClientInfo `json:"clientInfo,omitempty"` 189 190 // Impressions: Required. Impression event details. The maximum number 191 // of impression reports that you can log at once is 50. 192 Impressions []*GoogleMapsPlayablelocationsV3Impression `json:"impressions,omitempty"` 193 194 // RequestId: Required. A string that uniquely identifies the log 195 // impressions request. This allows you to detect duplicate requests. We 196 // recommend that you use UUIDs for this value. The value must not 197 // exceed 50 characters. You should reuse the `request_id` only when 198 // retrying a request in case of failure. In this case, the request must 199 // be identical to the one that failed. 200 RequestId string `json:"requestId,omitempty"` 201 202 // ForceSendFields is a list of field names (e.g. "ClientInfo") to 203 // unconditionally include in API requests. By default, fields with 204 // empty or default values are omitted from API requests. However, any 205 // non-pointer, non-interface field appearing in ForceSendFields will be 206 // sent to the server regardless of whether the field is empty or not. 207 // This may be used to include empty fields in Patch requests. 208 ForceSendFields []string `json:"-"` 209 210 // NullFields is a list of field names (e.g. "ClientInfo") to include in 211 // API requests with the JSON null value. By default, fields with empty 212 // values are omitted from API requests. However, any field with an 213 // empty value appearing in NullFields will be sent to the server as 214 // null. It is an error if a field in this list has a non-empty value. 215 // This may be used to include null fields in Patch requests. 216 NullFields []string `json:"-"` 217 } 218 219 func (s *GoogleMapsPlayablelocationsV3LogImpressionsRequest) MarshalJSON() ([]byte, error) { 220 type NoMethod GoogleMapsPlayablelocationsV3LogImpressionsRequest 221 raw := NoMethod(*s) 222 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 223 } 224 225 // GoogleMapsPlayablelocationsV3LogImpressionsResponse: A response for 226 // the LogImpressions method. This method returns no data upon success. 227 type GoogleMapsPlayablelocationsV3LogImpressionsResponse struct { 228 // ServerResponse contains the HTTP response code and headers from the 229 // server. 230 googleapi.ServerResponse `json:"-"` 231 } 232 233 // GoogleMapsPlayablelocationsV3LogPlayerReportsRequest: A request for 234 // logging your player's bad location reports. 235 type GoogleMapsPlayablelocationsV3LogPlayerReportsRequest struct { 236 // ClientInfo: Required. Information about the client device (for 237 // example, device model and operating system). 238 ClientInfo *GoogleMapsUnityClientInfo `json:"clientInfo,omitempty"` 239 240 // PlayerReports: Required. Player reports. The maximum number of player 241 // reports that you can log at once is 50. 242 PlayerReports []*GoogleMapsPlayablelocationsV3PlayerReport `json:"playerReports,omitempty"` 243 244 // RequestId: Required. A string that uniquely identifies the log player 245 // reports request. This allows you to detect duplicate requests. We 246 // recommend that you use UUIDs for this value. The value must not 247 // exceed 50 characters. You should reuse the `request_id` only when 248 // retrying a request in the case of a failure. In that case, the 249 // request must be identical to the one that failed. 250 RequestId string `json:"requestId,omitempty"` 251 252 // ForceSendFields is a list of field names (e.g. "ClientInfo") to 253 // unconditionally include in API requests. By default, fields with 254 // empty or default values are omitted from API requests. However, any 255 // non-pointer, non-interface field appearing in ForceSendFields will be 256 // sent to the server regardless of whether the field is empty or not. 257 // This may be used to include empty fields in Patch requests. 258 ForceSendFields []string `json:"-"` 259 260 // NullFields is a list of field names (e.g. "ClientInfo") to include in 261 // API requests with the JSON null value. By default, fields with empty 262 // values are omitted from API requests. However, any field with an 263 // empty value appearing in NullFields will be sent to the server as 264 // null. It is an error if a field in this list has a non-empty value. 265 // This may be used to include null fields in Patch requests. 266 NullFields []string `json:"-"` 267 } 268 269 func (s *GoogleMapsPlayablelocationsV3LogPlayerReportsRequest) MarshalJSON() ([]byte, error) { 270 type NoMethod GoogleMapsPlayablelocationsV3LogPlayerReportsRequest 271 raw := NoMethod(*s) 272 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 273 } 274 275 // GoogleMapsPlayablelocationsV3LogPlayerReportsResponse: A response for 276 // the LogPlayerReports method. This method returns no data upon 277 // success. 278 type GoogleMapsPlayablelocationsV3LogPlayerReportsResponse struct { 279 // ServerResponse contains the HTTP response code and headers from the 280 // server. 281 googleapi.ServerResponse `json:"-"` 282 } 283 284 // GoogleMapsPlayablelocationsV3PlayerReport: A report submitted by a 285 // player about a playable location that is considered inappropriate for 286 // use in the game. 287 type GoogleMapsPlayablelocationsV3PlayerReport struct { 288 // LanguageCode: Language code (in BCP-47 format) indicating the 289 // language of the freeform description provided in `reason_details`. 290 // Examples are "en", "en-US" or "ja-Latn". For more information, see 291 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 292 LanguageCode string `json:"languageCode,omitempty"` 293 294 // LocationName: Required. The name of the playable location. 295 LocationName string `json:"locationName,omitempty"` 296 297 // ReasonDetails: Required. A free-form description detailing why the 298 // playable location is considered bad. 299 ReasonDetails string `json:"reasonDetails,omitempty"` 300 301 // Reasons: Required. One or more reasons why this playable location is 302 // considered bad. 303 // 304 // Possible values: 305 // "BAD_LOCATION_REASON_UNSPECIFIED" - Unspecified reason. Do not use. 306 // "OTHER" - The reason isn't one of the reasons in this enumeration. 307 // "NOT_PEDESTRIAN_ACCESSIBLE" - The playable location isn't 308 // accessible to pedestrians. For example, if it's in the middle of a 309 // highway. 310 // "NOT_OPEN_TO_PUBLIC" - The playable location isn't open to the 311 // public. For example, a private office building. 312 // "PERMANENTLY_CLOSED" - The playable location is permanently closed. 313 // For example, when a business has been shut down. 314 // "TEMPORARILY_INACCESSIBLE" - The playable location is temporarily 315 // inaccessible. For example, when a business has closed for 316 // renovations. 317 Reasons []string `json:"reasons,omitempty"` 318 319 // ForceSendFields is a list of field names (e.g. "LanguageCode") to 320 // unconditionally include in API requests. By default, fields with 321 // empty or default values are omitted from API requests. However, any 322 // non-pointer, non-interface field appearing in ForceSendFields will be 323 // sent to the server regardless of whether the field is empty or not. 324 // This may be used to include empty fields in Patch requests. 325 ForceSendFields []string `json:"-"` 326 327 // NullFields is a list of field names (e.g. "LanguageCode") to include 328 // in API requests with the JSON null value. By default, fields with 329 // empty values are omitted from API requests. However, any field with 330 // an empty value appearing in NullFields will be sent to the server as 331 // null. It is an error if a field in this list has a non-empty value. 332 // This may be used to include null fields in Patch requests. 333 NullFields []string `json:"-"` 334 } 335 336 func (s *GoogleMapsPlayablelocationsV3PlayerReport) MarshalJSON() ([]byte, error) { 337 type NoMethod GoogleMapsPlayablelocationsV3PlayerReport 338 raw := NoMethod(*s) 339 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 340 } 341 342 // GoogleMapsPlayablelocationsV3SampleAreaFilter: Specifies the area to 343 // search for playable locations. 344 type GoogleMapsPlayablelocationsV3SampleAreaFilter struct { 345 // S2CellId: Required. The S2 cell ID of the area you want. This must be 346 // between cell level 11 and 14 (inclusive). S2 cells are 64-bit 347 // integers that identify areas on the Earth. They are hierarchical, and 348 // can therefore be used for spatial indexing. The S2 geometry library 349 // is available in a number of languages: * C++ 350 // (https://github.com/google/s2geometry) * Java 351 // (https://github.com/google/s2-geometry-library-java) * Go 352 // (https://github.com/golang/geo) * Python 353 // (https://github.com/google/s2geometry/tree/master/src/python) 354 S2CellId uint64 `json:"s2CellId,omitempty,string"` 355 356 // ForceSendFields is a list of field names (e.g. "S2CellId") to 357 // unconditionally include in API requests. By default, fields with 358 // empty or default values are omitted from API requests. However, any 359 // non-pointer, non-interface field appearing in ForceSendFields will be 360 // sent to the server regardless of whether the field is empty or not. 361 // This may be used to include empty fields in Patch requests. 362 ForceSendFields []string `json:"-"` 363 364 // NullFields is a list of field names (e.g. "S2CellId") to include in 365 // API requests with the JSON null value. By default, fields with empty 366 // values are omitted from API requests. However, any field with an 367 // empty value appearing in NullFields will be sent to the server as 368 // null. It is an error if a field in this list has a non-empty value. 369 // This may be used to include null fields in Patch requests. 370 NullFields []string `json:"-"` 371 } 372 373 func (s *GoogleMapsPlayablelocationsV3SampleAreaFilter) MarshalJSON() ([]byte, error) { 374 type NoMethod GoogleMapsPlayablelocationsV3SampleAreaFilter 375 raw := NoMethod(*s) 376 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 377 } 378 379 // GoogleMapsPlayablelocationsV3SampleCriterion: Encapsulates a filter 380 // criterion for searching for a set of playable locations. 381 type GoogleMapsPlayablelocationsV3SampleCriterion struct { 382 // FieldsToReturn: Specifies which `PlayableLocation` fields are 383 // returned. `name` (which is used for logging impressions), 384 // `center_point` and `place_id` (or `plus_code`) are always returned. 385 // The following fields are omitted unless you specify them here: * 386 // snapped_point * types Note: The more fields you include, the more 387 // expensive in terms of data and associated latency your query will be. 388 FieldsToReturn string `json:"fieldsToReturn,omitempty"` 389 390 // Filter: Specifies filtering options, and specifies what will be 391 // included in the result set. 392 Filter *GoogleMapsPlayablelocationsV3SampleFilter `json:"filter,omitempty"` 393 394 // GameObjectType: Required. An arbitrary, developer-defined identifier 395 // of the type of game object that the playable location is used for. 396 // This field allows you to specify criteria per game object type when 397 // searching for playable locations. You should assign a unique 398 // `game_object_type` ID across all `request_criteria` to represent a 399 // distinct type of game object. For example, 1=monster location, 400 // 2=powerup location. The response contains a map. 401 GameObjectType int64 `json:"gameObjectType,omitempty"` 402 403 // ForceSendFields is a list of field names (e.g. "FieldsToReturn") to 404 // unconditionally include in API requests. By default, fields with 405 // empty or default values are omitted from API requests. However, any 406 // non-pointer, non-interface field appearing in ForceSendFields will be 407 // sent to the server regardless of whether the field is empty or not. 408 // This may be used to include empty fields in Patch requests. 409 ForceSendFields []string `json:"-"` 410 411 // NullFields is a list of field names (e.g. "FieldsToReturn") to 412 // include in API requests with the JSON null value. By default, fields 413 // with empty values are omitted from API requests. However, any field 414 // with an empty value appearing in NullFields will be sent to the 415 // server as null. It is an error if a field in this list has a 416 // non-empty value. This may be used to include null fields in Patch 417 // requests. 418 NullFields []string `json:"-"` 419 } 420 421 func (s *GoogleMapsPlayablelocationsV3SampleCriterion) MarshalJSON() ([]byte, error) { 422 type NoMethod GoogleMapsPlayablelocationsV3SampleCriterion 423 raw := NoMethod(*s) 424 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 425 } 426 427 // GoogleMapsPlayablelocationsV3SampleFilter: Specifies the filters to 428 // use when searching for playable locations. 429 type GoogleMapsPlayablelocationsV3SampleFilter struct { 430 // IncludedTypes: Restricts the set of playable locations to just the 431 // types (/maps/documentation/gaming/tt/types) that you want. 432 IncludedTypes []string `json:"includedTypes,omitempty"` 433 434 // MaxLocationCount: Specifies the maximum number of playable locations 435 // to return. This value must not be greater than 1000. The default 436 // value is 100. Only the top-ranking playable locations are returned. 437 MaxLocationCount int64 `json:"maxLocationCount,omitempty"` 438 439 // Spacing: A set of options that control the spacing between playable 440 // locations. By default the minimum distance between locations is 200m. 441 Spacing *GoogleMapsPlayablelocationsV3SampleSpacingOptions `json:"spacing,omitempty"` 442 443 // ForceSendFields is a list of field names (e.g. "IncludedTypes") to 444 // unconditionally include in API requests. By default, fields with 445 // empty or default values are omitted from API requests. However, any 446 // non-pointer, non-interface field appearing in ForceSendFields will be 447 // sent to the server regardless of whether the field is empty or not. 448 // This may be used to include empty fields in Patch requests. 449 ForceSendFields []string `json:"-"` 450 451 // NullFields is a list of field names (e.g. "IncludedTypes") to include 452 // in API requests with the JSON null value. By default, fields with 453 // empty values are omitted from API requests. However, any field with 454 // an empty value appearing in NullFields will be sent to the server as 455 // null. It is an error if a field in this list has a non-empty value. 456 // This may be used to include null fields in Patch requests. 457 NullFields []string `json:"-"` 458 } 459 460 func (s *GoogleMapsPlayablelocationsV3SampleFilter) MarshalJSON() ([]byte, error) { 461 type NoMethod GoogleMapsPlayablelocationsV3SampleFilter 462 raw := NoMethod(*s) 463 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 464 } 465 466 // GoogleMapsPlayablelocationsV3SamplePlayableLocation: A geographical 467 // point suitable for placing game objects in location-based games. 468 type GoogleMapsPlayablelocationsV3SamplePlayableLocation struct { 469 // CenterPoint: Required. The latitude and longitude associated with the 470 // center of the playable location. By default, the set of playable 471 // locations returned from SamplePlayableLocations use center-point 472 // coordinates. 473 CenterPoint *GoogleTypeLatLng `json:"centerPoint,omitempty"` 474 475 // Name: Required. The name of this playable location. 476 Name string `json:"name,omitempty"` 477 478 // PlaceId: A [place ID] (https://developers.google.com/places/place-id) 479 PlaceId string `json:"placeId,omitempty"` 480 481 // PlusCode: A [plus code] (http://openlocationcode.com) 482 PlusCode string `json:"plusCode,omitempty"` 483 484 // SnappedPoint: The playable location's coordinates, snapped to the 485 // sidewalk of the nearest road, if a nearby road exists. 486 SnappedPoint *GoogleTypeLatLng `json:"snappedPoint,omitempty"` 487 488 // Types: A collection of Playable Location Types 489 // (/maps/documentation/gaming/tt/types) for this playable location. The 490 // first type in the collection is the primary type. Type information 491 // might not be available for all playable locations. 492 Types []string `json:"types,omitempty"` 493 494 // ForceSendFields is a list of field names (e.g. "CenterPoint") to 495 // unconditionally include in API requests. By default, fields with 496 // empty or default values are omitted from API requests. However, any 497 // non-pointer, non-interface field appearing in ForceSendFields will be 498 // sent to the server regardless of whether the field is empty or not. 499 // This may be used to include empty fields in Patch requests. 500 ForceSendFields []string `json:"-"` 501 502 // NullFields is a list of field names (e.g. "CenterPoint") to include 503 // in API requests with the JSON null value. By default, fields with 504 // empty values are omitted from API requests. However, any field with 505 // an empty value appearing in NullFields will be sent to the server as 506 // null. It is an error if a field in this list has a non-empty value. 507 // This may be used to include null fields in Patch requests. 508 NullFields []string `json:"-"` 509 } 510 511 func (s *GoogleMapsPlayablelocationsV3SamplePlayableLocation) MarshalJSON() ([]byte, error) { 512 type NoMethod GoogleMapsPlayablelocationsV3SamplePlayableLocation 513 raw := NoMethod(*s) 514 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 515 } 516 517 // GoogleMapsPlayablelocationsV3SamplePlayableLocationList: A list of 518 // PlayableLocation objects that satisfies a single Criterion. 519 type GoogleMapsPlayablelocationsV3SamplePlayableLocationList struct { 520 // Locations: A list of playable locations for this game object type. 521 Locations []*GoogleMapsPlayablelocationsV3SamplePlayableLocation `json:"locations,omitempty"` 522 523 // ForceSendFields is a list of field names (e.g. "Locations") to 524 // unconditionally include in API requests. By default, fields with 525 // empty or default values are omitted from API requests. However, any 526 // non-pointer, non-interface field appearing in ForceSendFields will be 527 // sent to the server regardless of whether the field is empty or not. 528 // This may be used to include empty fields in Patch requests. 529 ForceSendFields []string `json:"-"` 530 531 // NullFields is a list of field names (e.g. "Locations") to include in 532 // API requests with the JSON null value. By default, fields with empty 533 // values are omitted from API requests. However, any field with an 534 // empty value appearing in NullFields will be sent to the server as 535 // null. It is an error if a field in this list has a non-empty value. 536 // This may be used to include null fields in Patch requests. 537 NullFields []string `json:"-"` 538 } 539 540 func (s *GoogleMapsPlayablelocationsV3SamplePlayableLocationList) MarshalJSON() ([]byte, error) { 541 type NoMethod GoogleMapsPlayablelocationsV3SamplePlayableLocationList 542 raw := NoMethod(*s) 543 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 544 } 545 546 // GoogleMapsPlayablelocationsV3SamplePlayableLocationsRequest: Life of 547 // a query: - When a game starts in a new location, your game server 548 // issues a SamplePlayableLocations request. The request specifies the 549 // S2 cell, and contains one or more "criteria" for filtering: - 550 // Criterion 0: i locations for long-lived bases, or level 0 monsters, 551 // or... - Criterion 1: j locations for short-lived bases, or level 1 552 // monsters, ... - Criterion 2: k locations for random objects. - etc 553 // (up to 5 criterion may be specified). `PlayableLocationList` will 554 // then contain mutually exclusive lists of `PlayableLocation` objects 555 // that satisfy each of the criteria. Think of it as a collection of 556 // real-world locations that you can then associate with your game 557 // state. Note: These points are impermanent in nature. E.g, parks can 558 // close, and places can be removed. The response specifies how long you 559 // can expect the playable locations to last. Once they expire, you 560 // should query the `samplePlayableLocations` API again to get a fresh 561 // view of the real world. 562 type GoogleMapsPlayablelocationsV3SamplePlayableLocationsRequest struct { 563 // AreaFilter: Required. Specifies the area to search within for 564 // playable locations. 565 AreaFilter *GoogleMapsPlayablelocationsV3SampleAreaFilter `json:"areaFilter,omitempty"` 566 567 // Criteria: Required. Specifies one or more (up to 5) criteria for 568 // filtering the returned playable locations. 569 Criteria []*GoogleMapsPlayablelocationsV3SampleCriterion `json:"criteria,omitempty"` 570 571 // ForceSendFields is a list of field names (e.g. "AreaFilter") to 572 // unconditionally include in API requests. By default, fields with 573 // empty or default values are omitted from API requests. However, any 574 // non-pointer, non-interface field appearing in ForceSendFields will be 575 // sent to the server regardless of whether the field is empty or not. 576 // This may be used to include empty fields in Patch requests. 577 ForceSendFields []string `json:"-"` 578 579 // NullFields is a list of field names (e.g. "AreaFilter") to include in 580 // API requests with the JSON null value. By default, fields with empty 581 // values are omitted from API requests. However, any field with an 582 // empty value appearing in NullFields will be sent to the server as 583 // null. It is an error if a field in this list has a non-empty value. 584 // This may be used to include null fields in Patch requests. 585 NullFields []string `json:"-"` 586 } 587 588 func (s *GoogleMapsPlayablelocationsV3SamplePlayableLocationsRequest) MarshalJSON() ([]byte, error) { 589 type NoMethod GoogleMapsPlayablelocationsV3SamplePlayableLocationsRequest 590 raw := NoMethod(*s) 591 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 592 } 593 594 // GoogleMapsPlayablelocationsV3SamplePlayableLocationsResponse: 595 // Response for the SamplePlayableLocations method. 596 type GoogleMapsPlayablelocationsV3SamplePlayableLocationsResponse struct { 597 // LocationsPerGameObjectType: Each PlayableLocation object corresponds 598 // to a game_object_type specified in the request. 599 LocationsPerGameObjectType map[string]GoogleMapsPlayablelocationsV3SamplePlayableLocationList `json:"locationsPerGameObjectType,omitempty"` 600 601 // Ttl: Required. Specifies the "time-to-live" for the set of playable 602 // locations. You can use this value to determine how long to cache the 603 // set of playable locations. After this length of time, your back-end 604 // game server should issue a new SamplePlayableLocations request to get 605 // a fresh set of playable locations (because for example, they might 606 // have been removed, a park might have closed for the day, a business 607 // might have closed permanently). 608 Ttl string `json:"ttl,omitempty"` 609 610 // ServerResponse contains the HTTP response code and headers from the 611 // server. 612 googleapi.ServerResponse `json:"-"` 613 614 // ForceSendFields is a list of field names (e.g. 615 // "LocationsPerGameObjectType") to unconditionally include in API 616 // requests. By default, fields with empty or default values are omitted 617 // from API requests. However, any non-pointer, non-interface field 618 // appearing in ForceSendFields will be sent to the server regardless of 619 // whether the field is empty or not. This may be used to include empty 620 // fields in Patch requests. 621 ForceSendFields []string `json:"-"` 622 623 // NullFields is a list of field names (e.g. 624 // "LocationsPerGameObjectType") to include in API requests with the 625 // JSON null value. By default, fields with empty values are omitted 626 // from API requests. However, any field with an empty value appearing 627 // in NullFields will be sent to the server as null. It is an error if a 628 // field in this list has a non-empty value. This may be used to include 629 // null fields in Patch requests. 630 NullFields []string `json:"-"` 631 } 632 633 func (s *GoogleMapsPlayablelocationsV3SamplePlayableLocationsResponse) MarshalJSON() ([]byte, error) { 634 type NoMethod GoogleMapsPlayablelocationsV3SamplePlayableLocationsResponse 635 raw := NoMethod(*s) 636 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 637 } 638 639 // GoogleMapsPlayablelocationsV3SampleSpacingOptions: A set of options 640 // that specifies the separation between playable locations. 641 type GoogleMapsPlayablelocationsV3SampleSpacingOptions struct { 642 // MinSpacingMeters: Required. The minimum spacing between any two 643 // playable locations, measured in meters. The minimum value is 30. The 644 // maximum value is 1000. Inputs will be rounded up to the next 10 meter 645 // interval. The default value is 200m. Set this field to remove tight 646 // clusters of playable locations. Note: The spacing is a greedy 647 // algorithm. It optimizes for selecting the highest ranking locations 648 // first, not to maximize the number of locations selected. Consider the 649 // following scenario: * Rank: A: 2, B: 1, C: 3. * Distance: 650 // A--200m--B--200m--C If spacing=250, it will pick the highest ranked 651 // location [B], not [A, C]. Note: Spacing works within the game object 652 // type itself, as well as the previous ones. Suppose three game object 653 // types, each with the following spacing: * X: 400m, Y: undefined, Z: 654 // 200m. 1. Add locations for X, within 400m of each other. 2. Add 655 // locations for Y, without any spacing. 3. Finally, add locations for Z 656 // within 200m of each other as well X and Y. The distance diagram 657 // between those locations end up as: * From->To. * X->X: 400m * Y->X, 658 // Y->Y: unspecified. * Z->X, Z->Y, Z->Z: 200m. 659 MinSpacingMeters float64 `json:"minSpacingMeters,omitempty"` 660 661 // PointType: Specifies whether the minimum spacing constraint applies 662 // to the center-point or to the snapped point of playable locations. 663 // The default value is `CENTER_POINT`. If a snapped point is not 664 // available for a playable location, its center-point is used instead. 665 // Set this to the point type used in your game. 666 // 667 // Possible values: 668 // "POINT_TYPE_UNSPECIFIED" - Unspecified point type. Do not use this 669 // value. 670 // "CENTER_POINT" - The geographic coordinates correspond to the 671 // center of the location. 672 // "SNAPPED_POINT" - The geographic coordinates correspond to the 673 // location snapped to the sidewalk of the nearest road (when a nearby 674 // road exists). 675 PointType string `json:"pointType,omitempty"` 676 677 // ForceSendFields is a list of field names (e.g. "MinSpacingMeters") to 678 // unconditionally include in API requests. By default, fields with 679 // empty or default values are omitted from API requests. However, any 680 // non-pointer, non-interface field appearing in ForceSendFields will be 681 // sent to the server regardless of whether the field is empty or not. 682 // This may be used to include empty fields in Patch requests. 683 ForceSendFields []string `json:"-"` 684 685 // NullFields is a list of field names (e.g. "MinSpacingMeters") to 686 // include in API requests with the JSON null value. By default, fields 687 // with empty values are omitted from API requests. However, any field 688 // with an empty value appearing in NullFields will be sent to the 689 // server as null. It is an error if a field in this list has a 690 // non-empty value. This may be used to include null fields in Patch 691 // requests. 692 NullFields []string `json:"-"` 693 } 694 695 func (s *GoogleMapsPlayablelocationsV3SampleSpacingOptions) MarshalJSON() ([]byte, error) { 696 type NoMethod GoogleMapsPlayablelocationsV3SampleSpacingOptions 697 raw := NoMethod(*s) 698 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 699 } 700 701 func (s *GoogleMapsPlayablelocationsV3SampleSpacingOptions) UnmarshalJSON(data []byte) error { 702 type NoMethod GoogleMapsPlayablelocationsV3SampleSpacingOptions 703 var s1 struct { 704 MinSpacingMeters gensupport.JSONFloat64 `json:"minSpacingMeters"` 705 *NoMethod 706 } 707 s1.NoMethod = (*NoMethod)(s) 708 if err := json.Unmarshal(data, &s1); err != nil { 709 return err 710 } 711 s.MinSpacingMeters = float64(s1.MinSpacingMeters) 712 return nil 713 } 714 715 // GoogleMapsUnityClientInfo: Client information. 716 type GoogleMapsUnityClientInfo struct { 717 // ApiClient: API client name and version. For example, the SDK calling 718 // the API. The exact format is up to the client. 719 ApiClient string `json:"apiClient,omitempty"` 720 721 // ApplicationId: Application ID, such as the package name on Android 722 // and the bundle identifier on iOS platforms. 723 ApplicationId string `json:"applicationId,omitempty"` 724 725 // ApplicationVersion: Application version number, such as "1.2.3". The 726 // exact format is application-dependent. 727 ApplicationVersion string `json:"applicationVersion,omitempty"` 728 729 // DeviceModel: Device model as reported by the device. The exact format 730 // is platform-dependent. 731 DeviceModel string `json:"deviceModel,omitempty"` 732 733 // LanguageCode: Language code (in BCP-47 format) indicating the UI 734 // language of the client. Examples are "en", "en-US" or "ja-Latn". For 735 // more information, see 736 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 737 LanguageCode string `json:"languageCode,omitempty"` 738 739 // OperatingSystem: Operating system name and version as reported by the 740 // OS. For example, "Mac OS X 10.10.4". The exact format is 741 // platform-dependent. 742 OperatingSystem string `json:"operatingSystem,omitempty"` 743 744 // OperatingSystemBuild: Build number/version of the operating system. 745 // e.g., the contents of android.os.Build.ID in Android, or the contents 746 // of sysctl "kern.osversion" in iOS. 747 OperatingSystemBuild string `json:"operatingSystemBuild,omitempty"` 748 749 // Platform: Platform where the application is running. 750 // 751 // Possible values: 752 // "PLATFORM_UNSPECIFIED" - Unspecified or unknown OS. 753 // "EDITOR" - Development environment. 754 // "MAC_OS" - macOS. 755 // "WINDOWS" - Windows. 756 // "LINUX" - Linux 757 // "ANDROID" - Android 758 // "IOS" - iOS 759 // "WEB_GL" - WebGL. 760 Platform string `json:"platform,omitempty"` 761 762 // ForceSendFields is a list of field names (e.g. "ApiClient") to 763 // unconditionally include in API requests. By default, fields with 764 // empty or default values are omitted from API requests. However, any 765 // non-pointer, non-interface field appearing in ForceSendFields will be 766 // sent to the server regardless of whether the field is empty or not. 767 // This may be used to include empty fields in Patch requests. 768 ForceSendFields []string `json:"-"` 769 770 // NullFields is a list of field names (e.g. "ApiClient") to include in 771 // API requests with the JSON null value. By default, fields with empty 772 // values are omitted from API requests. However, any field with an 773 // empty value appearing in NullFields will be sent to the server as 774 // null. It is an error if a field in this list has a non-empty value. 775 // This may be used to include null fields in Patch requests. 776 NullFields []string `json:"-"` 777 } 778 779 func (s *GoogleMapsUnityClientInfo) MarshalJSON() ([]byte, error) { 780 type NoMethod GoogleMapsUnityClientInfo 781 raw := NoMethod(*s) 782 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 783 } 784 785 // GoogleTypeLatLng: An object that represents a latitude/longitude 786 // pair. This is expressed as a pair of doubles to represent degrees 787 // latitude and degrees longitude. Unless specified otherwise, this 788 // object must conform to the WGS84 standard. Values must be within 789 // normalized ranges. 790 type GoogleTypeLatLng struct { 791 // Latitude: The latitude in degrees. It must be in the range [-90.0, 792 // +90.0]. 793 Latitude float64 `json:"latitude,omitempty"` 794 795 // Longitude: The longitude in degrees. It must be in the range [-180.0, 796 // +180.0]. 797 Longitude float64 `json:"longitude,omitempty"` 798 799 // ForceSendFields is a list of field names (e.g. "Latitude") to 800 // unconditionally include in API requests. By default, fields with 801 // empty or default values are omitted from API requests. However, any 802 // non-pointer, non-interface field appearing in ForceSendFields will be 803 // sent to the server regardless of whether the field is empty or not. 804 // This may be used to include empty fields in Patch requests. 805 ForceSendFields []string `json:"-"` 806 807 // NullFields is a list of field names (e.g. "Latitude") to include in 808 // API requests with the JSON null value. By default, fields with empty 809 // values are omitted from API requests. However, any field with an 810 // empty value appearing in NullFields will be sent to the server as 811 // null. It is an error if a field in this list has a non-empty value. 812 // This may be used to include null fields in Patch requests. 813 NullFields []string `json:"-"` 814 } 815 816 func (s *GoogleTypeLatLng) MarshalJSON() ([]byte, error) { 817 type NoMethod GoogleTypeLatLng 818 raw := NoMethod(*s) 819 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 820 } 821 822 func (s *GoogleTypeLatLng) UnmarshalJSON(data []byte) error { 823 type NoMethod GoogleTypeLatLng 824 var s1 struct { 825 Latitude gensupport.JSONFloat64 `json:"latitude"` 826 Longitude gensupport.JSONFloat64 `json:"longitude"` 827 *NoMethod 828 } 829 s1.NoMethod = (*NoMethod)(s) 830 if err := json.Unmarshal(data, &s1); err != nil { 831 return err 832 } 833 s.Latitude = float64(s1.Latitude) 834 s.Longitude = float64(s1.Longitude) 835 return nil 836 } 837 838 // method id "playablelocations.logImpressions": 839 840 type V3LogImpressionsCall struct { 841 s *Service 842 googlemapsplayablelocationsv3logimpressionsrequest *GoogleMapsPlayablelocationsV3LogImpressionsRequest 843 urlParams_ gensupport.URLParams 844 ctx_ context.Context 845 header_ http.Header 846 } 847 848 // LogImpressions: Logs new events when playable locations are 849 // displayed, and when they are interacted with. Impressions are not 850 // partially saved; either all impressions are saved and this request 851 // succeeds, or no impressions are saved, and this request fails. 852 func (r *V3Service) LogImpressions(googlemapsplayablelocationsv3logimpressionsrequest *GoogleMapsPlayablelocationsV3LogImpressionsRequest) *V3LogImpressionsCall { 853 c := &V3LogImpressionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 854 c.googlemapsplayablelocationsv3logimpressionsrequest = googlemapsplayablelocationsv3logimpressionsrequest 855 return c 856 } 857 858 // Fields allows partial responses to be retrieved. See 859 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 860 // for more information. 861 func (c *V3LogImpressionsCall) Fields(s ...googleapi.Field) *V3LogImpressionsCall { 862 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 863 return c 864 } 865 866 // Context sets the context to be used in this call's Do method. Any 867 // pending HTTP request will be aborted if the provided context is 868 // canceled. 869 func (c *V3LogImpressionsCall) Context(ctx context.Context) *V3LogImpressionsCall { 870 c.ctx_ = ctx 871 return c 872 } 873 874 // Header returns an http.Header that can be modified by the caller to 875 // add HTTP headers to the request. 876 func (c *V3LogImpressionsCall) Header() http.Header { 877 if c.header_ == nil { 878 c.header_ = make(http.Header) 879 } 880 return c.header_ 881 } 882 883 func (c *V3LogImpressionsCall) doRequest(alt string) (*http.Response, error) { 884 reqHeaders := make(http.Header) 885 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210929") 886 for k, v := range c.header_ { 887 reqHeaders[k] = v 888 } 889 reqHeaders.Set("User-Agent", c.s.userAgent()) 890 var body io.Reader = nil 891 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlemapsplayablelocationsv3logimpressionsrequest) 892 if err != nil { 893 return nil, err 894 } 895 reqHeaders.Set("Content-Type", "application/json") 896 c.urlParams_.Set("alt", alt) 897 c.urlParams_.Set("prettyPrint", "false") 898 urls := googleapi.ResolveRelative(c.s.BasePath, "v3:logImpressions") 899 urls += "?" + c.urlParams_.Encode() 900 req, err := http.NewRequest("POST", urls, body) 901 if err != nil { 902 return nil, err 903 } 904 req.Header = reqHeaders 905 return gensupport.SendRequest(c.ctx_, c.s.client, req) 906 } 907 908 // Do executes the "playablelocations.logImpressions" call. 909 // Exactly one of *GoogleMapsPlayablelocationsV3LogImpressionsResponse 910 // or error will be non-nil. Any non-2xx status code is an error. 911 // Response headers are in either 912 // *GoogleMapsPlayablelocationsV3LogImpressionsResponse.ServerResponse.He 913 // ader or (if a response was returned at all) in 914 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 915 // whether the returned error was because http.StatusNotModified was 916 // returned. 917 func (c *V3LogImpressionsCall) Do(opts ...googleapi.CallOption) (*GoogleMapsPlayablelocationsV3LogImpressionsResponse, error) { 918 gensupport.SetOptions(c.urlParams_, opts...) 919 res, err := c.doRequest("json") 920 if res != nil && res.StatusCode == http.StatusNotModified { 921 if res.Body != nil { 922 res.Body.Close() 923 } 924 return nil, &googleapi.Error{ 925 Code: res.StatusCode, 926 Header: res.Header, 927 } 928 } 929 if err != nil { 930 return nil, err 931 } 932 defer googleapi.CloseBody(res) 933 if err := googleapi.CheckResponse(res); err != nil { 934 return nil, err 935 } 936 ret := &GoogleMapsPlayablelocationsV3LogImpressionsResponse{ 937 ServerResponse: googleapi.ServerResponse{ 938 Header: res.Header, 939 HTTPStatusCode: res.StatusCode, 940 }, 941 } 942 target := &ret 943 if err := gensupport.DecodeResponse(target, res); err != nil { 944 return nil, err 945 } 946 return ret, nil 947 // { 948 // "description": "Logs new events when playable locations are displayed, and when they are interacted with. Impressions are not partially saved; either all impressions are saved and this request succeeds, or no impressions are saved, and this request fails.", 949 // "flatPath": "v3:logImpressions", 950 // "httpMethod": "POST", 951 // "id": "playablelocations.logImpressions", 952 // "parameterOrder": [], 953 // "parameters": {}, 954 // "path": "v3:logImpressions", 955 // "request": { 956 // "$ref": "GoogleMapsPlayablelocationsV3LogImpressionsRequest" 957 // }, 958 // "response": { 959 // "$ref": "GoogleMapsPlayablelocationsV3LogImpressionsResponse" 960 // } 961 // } 962 963 } 964 965 // method id "playablelocations.logPlayerReports": 966 967 type V3LogPlayerReportsCall struct { 968 s *Service 969 googlemapsplayablelocationsv3logplayerreportsrequest *GoogleMapsPlayablelocationsV3LogPlayerReportsRequest 970 urlParams_ gensupport.URLParams 971 ctx_ context.Context 972 header_ http.Header 973 } 974 975 // LogPlayerReports: Logs bad playable location reports submitted by 976 // players. Reports are not partially saved; either all reports are 977 // saved and this request succeeds, or no reports are saved, and this 978 // request fails. 979 func (r *V3Service) LogPlayerReports(googlemapsplayablelocationsv3logplayerreportsrequest *GoogleMapsPlayablelocationsV3LogPlayerReportsRequest) *V3LogPlayerReportsCall { 980 c := &V3LogPlayerReportsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 981 c.googlemapsplayablelocationsv3logplayerreportsrequest = googlemapsplayablelocationsv3logplayerreportsrequest 982 return c 983 } 984 985 // Fields allows partial responses to be retrieved. See 986 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 987 // for more information. 988 func (c *V3LogPlayerReportsCall) Fields(s ...googleapi.Field) *V3LogPlayerReportsCall { 989 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 990 return c 991 } 992 993 // Context sets the context to be used in this call's Do method. Any 994 // pending HTTP request will be aborted if the provided context is 995 // canceled. 996 func (c *V3LogPlayerReportsCall) Context(ctx context.Context) *V3LogPlayerReportsCall { 997 c.ctx_ = ctx 998 return c 999 } 1000 1001 // Header returns an http.Header that can be modified by the caller to 1002 // add HTTP headers to the request. 1003 func (c *V3LogPlayerReportsCall) Header() http.Header { 1004 if c.header_ == nil { 1005 c.header_ = make(http.Header) 1006 } 1007 return c.header_ 1008 } 1009 1010 func (c *V3LogPlayerReportsCall) doRequest(alt string) (*http.Response, error) { 1011 reqHeaders := make(http.Header) 1012 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210929") 1013 for k, v := range c.header_ { 1014 reqHeaders[k] = v 1015 } 1016 reqHeaders.Set("User-Agent", c.s.userAgent()) 1017 var body io.Reader = nil 1018 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlemapsplayablelocationsv3logplayerreportsrequest) 1019 if err != nil { 1020 return nil, err 1021 } 1022 reqHeaders.Set("Content-Type", "application/json") 1023 c.urlParams_.Set("alt", alt) 1024 c.urlParams_.Set("prettyPrint", "false") 1025 urls := googleapi.ResolveRelative(c.s.BasePath, "v3:logPlayerReports") 1026 urls += "?" + c.urlParams_.Encode() 1027 req, err := http.NewRequest("POST", urls, body) 1028 if err != nil { 1029 return nil, err 1030 } 1031 req.Header = reqHeaders 1032 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1033 } 1034 1035 // Do executes the "playablelocations.logPlayerReports" call. 1036 // Exactly one of *GoogleMapsPlayablelocationsV3LogPlayerReportsResponse 1037 // or error will be non-nil. Any non-2xx status code is an error. 1038 // Response headers are in either 1039 // *GoogleMapsPlayablelocationsV3LogPlayerReportsResponse.ServerResponse. 1040 // Header or (if a response was returned at all) in 1041 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 1042 // whether the returned error was because http.StatusNotModified was 1043 // returned. 1044 func (c *V3LogPlayerReportsCall) Do(opts ...googleapi.CallOption) (*GoogleMapsPlayablelocationsV3LogPlayerReportsResponse, error) { 1045 gensupport.SetOptions(c.urlParams_, opts...) 1046 res, err := c.doRequest("json") 1047 if res != nil && res.StatusCode == http.StatusNotModified { 1048 if res.Body != nil { 1049 res.Body.Close() 1050 } 1051 return nil, &googleapi.Error{ 1052 Code: res.StatusCode, 1053 Header: res.Header, 1054 } 1055 } 1056 if err != nil { 1057 return nil, err 1058 } 1059 defer googleapi.CloseBody(res) 1060 if err := googleapi.CheckResponse(res); err != nil { 1061 return nil, err 1062 } 1063 ret := &GoogleMapsPlayablelocationsV3LogPlayerReportsResponse{ 1064 ServerResponse: googleapi.ServerResponse{ 1065 Header: res.Header, 1066 HTTPStatusCode: res.StatusCode, 1067 }, 1068 } 1069 target := &ret 1070 if err := gensupport.DecodeResponse(target, res); err != nil { 1071 return nil, err 1072 } 1073 return ret, nil 1074 // { 1075 // "description": "Logs bad playable location reports submitted by players. Reports are not partially saved; either all reports are saved and this request succeeds, or no reports are saved, and this request fails.", 1076 // "flatPath": "v3:logPlayerReports", 1077 // "httpMethod": "POST", 1078 // "id": "playablelocations.logPlayerReports", 1079 // "parameterOrder": [], 1080 // "parameters": {}, 1081 // "path": "v3:logPlayerReports", 1082 // "request": { 1083 // "$ref": "GoogleMapsPlayablelocationsV3LogPlayerReportsRequest" 1084 // }, 1085 // "response": { 1086 // "$ref": "GoogleMapsPlayablelocationsV3LogPlayerReportsResponse" 1087 // } 1088 // } 1089 1090 } 1091 1092 // method id "playablelocations.samplePlayableLocations": 1093 1094 type V3SamplePlayableLocationsCall struct { 1095 s *Service 1096 googlemapsplayablelocationsv3sampleplayablelocationsrequest *GoogleMapsPlayablelocationsV3SamplePlayableLocationsRequest 1097 urlParams_ gensupport.URLParams 1098 ctx_ context.Context 1099 header_ http.Header 1100 } 1101 1102 // SamplePlayableLocations: Returns a set of playable locations that lie 1103 // within a specified area, that satisfy optional filter criteria. Note: 1104 // Identical `SamplePlayableLocations` requests can return different 1105 // results as the state of the world changes over time. 1106 func (r *V3Service) SamplePlayableLocations(googlemapsplayablelocationsv3sampleplayablelocationsrequest *GoogleMapsPlayablelocationsV3SamplePlayableLocationsRequest) *V3SamplePlayableLocationsCall { 1107 c := &V3SamplePlayableLocationsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1108 c.googlemapsplayablelocationsv3sampleplayablelocationsrequest = googlemapsplayablelocationsv3sampleplayablelocationsrequest 1109 return c 1110 } 1111 1112 // Fields allows partial responses to be retrieved. See 1113 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1114 // for more information. 1115 func (c *V3SamplePlayableLocationsCall) Fields(s ...googleapi.Field) *V3SamplePlayableLocationsCall { 1116 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1117 return c 1118 } 1119 1120 // Context sets the context to be used in this call's Do method. Any 1121 // pending HTTP request will be aborted if the provided context is 1122 // canceled. 1123 func (c *V3SamplePlayableLocationsCall) Context(ctx context.Context) *V3SamplePlayableLocationsCall { 1124 c.ctx_ = ctx 1125 return c 1126 } 1127 1128 // Header returns an http.Header that can be modified by the caller to 1129 // add HTTP headers to the request. 1130 func (c *V3SamplePlayableLocationsCall) Header() http.Header { 1131 if c.header_ == nil { 1132 c.header_ = make(http.Header) 1133 } 1134 return c.header_ 1135 } 1136 1137 func (c *V3SamplePlayableLocationsCall) doRequest(alt string) (*http.Response, error) { 1138 reqHeaders := make(http.Header) 1139 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210929") 1140 for k, v := range c.header_ { 1141 reqHeaders[k] = v 1142 } 1143 reqHeaders.Set("User-Agent", c.s.userAgent()) 1144 var body io.Reader = nil 1145 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlemapsplayablelocationsv3sampleplayablelocationsrequest) 1146 if err != nil { 1147 return nil, err 1148 } 1149 reqHeaders.Set("Content-Type", "application/json") 1150 c.urlParams_.Set("alt", alt) 1151 c.urlParams_.Set("prettyPrint", "false") 1152 urls := googleapi.ResolveRelative(c.s.BasePath, "v3:samplePlayableLocations") 1153 urls += "?" + c.urlParams_.Encode() 1154 req, err := http.NewRequest("POST", urls, body) 1155 if err != nil { 1156 return nil, err 1157 } 1158 req.Header = reqHeaders 1159 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1160 } 1161 1162 // Do executes the "playablelocations.samplePlayableLocations" call. 1163 // Exactly one of 1164 // *GoogleMapsPlayablelocationsV3SamplePlayableLocationsResponse or 1165 // error will be non-nil. Any non-2xx status code is an error. Response 1166 // headers are in either 1167 // *GoogleMapsPlayablelocationsV3SamplePlayableLocationsResponse.ServerRe 1168 // sponse.Header or (if a response was returned at all) in 1169 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 1170 // whether the returned error was because http.StatusNotModified was 1171 // returned. 1172 func (c *V3SamplePlayableLocationsCall) Do(opts ...googleapi.CallOption) (*GoogleMapsPlayablelocationsV3SamplePlayableLocationsResponse, error) { 1173 gensupport.SetOptions(c.urlParams_, opts...) 1174 res, err := c.doRequest("json") 1175 if res != nil && res.StatusCode == http.StatusNotModified { 1176 if res.Body != nil { 1177 res.Body.Close() 1178 } 1179 return nil, &googleapi.Error{ 1180 Code: res.StatusCode, 1181 Header: res.Header, 1182 } 1183 } 1184 if err != nil { 1185 return nil, err 1186 } 1187 defer googleapi.CloseBody(res) 1188 if err := googleapi.CheckResponse(res); err != nil { 1189 return nil, err 1190 } 1191 ret := &GoogleMapsPlayablelocationsV3SamplePlayableLocationsResponse{ 1192 ServerResponse: googleapi.ServerResponse{ 1193 Header: res.Header, 1194 HTTPStatusCode: res.StatusCode, 1195 }, 1196 } 1197 target := &ret 1198 if err := gensupport.DecodeResponse(target, res); err != nil { 1199 return nil, err 1200 } 1201 return ret, nil 1202 // { 1203 // "description": "Returns a set of playable locations that lie within a specified area, that satisfy optional filter criteria. Note: Identical `SamplePlayableLocations` requests can return different results as the state of the world changes over time.", 1204 // "flatPath": "v3:samplePlayableLocations", 1205 // "httpMethod": "POST", 1206 // "id": "playablelocations.samplePlayableLocations", 1207 // "parameterOrder": [], 1208 // "parameters": {}, 1209 // "path": "v3:samplePlayableLocations", 1210 // "request": { 1211 // "$ref": "GoogleMapsPlayablelocationsV3SamplePlayableLocationsRequest" 1212 // }, 1213 // "response": { 1214 // "$ref": "GoogleMapsPlayablelocationsV3SamplePlayableLocationsResponse" 1215 // } 1216 // } 1217 1218 } 1219