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 vectortile provides access to the Semantic Tile 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/vectortile/v1" 16 // ... 17 // ctx := context.Background() 18 // vectortileService, err := vectortile.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 // vectortileService, err := vectortile.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 // vectortileService, err := vectortile.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 vectortile // import "google.golang.org/api/vectortile/v1" 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 = "vectortile:v1" 75 const apiName = "vectortile" 76 const apiVersion = "v1" 77 const basePath = "https://vectortile.googleapis.com/" 78 const mtlsBasePath = "https://vectortile.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.Featuretiles = NewFeaturetilesService(s) 109 s.Terraintiles = NewTerraintilesService(s) 110 return s, nil 111 } 112 113 type Service struct { 114 client *http.Client 115 BasePath string // API endpoint base URL 116 UserAgent string // optional additional User-Agent fragment 117 118 Featuretiles *FeaturetilesService 119 120 Terraintiles *TerraintilesService 121 } 122 123 func (s *Service) userAgent() string { 124 if s.UserAgent == "" { 125 return googleapi.UserAgent 126 } 127 return googleapi.UserAgent + " " + s.UserAgent 128 } 129 130 func NewFeaturetilesService(s *Service) *FeaturetilesService { 131 rs := &FeaturetilesService{s: s} 132 return rs 133 } 134 135 type FeaturetilesService struct { 136 s *Service 137 } 138 139 func NewTerraintilesService(s *Service) *TerraintilesService { 140 rs := &TerraintilesService{s: s} 141 return rs 142 } 143 144 type TerraintilesService struct { 145 s *Service 146 } 147 148 // Area: Represents an area. Used to represent regions such as water, 149 // parks, etc. Next ID: 10 150 type Area struct { 151 // BasemapZOrder: The z-order of this geometry when rendered on a flat 152 // basemap. Geometry with a lower z-order should be rendered beneath 153 // geometry with a higher z-order. This z-ordering does not imply 154 // anything about the altitude of the area relative to the ground, but 155 // it can be used to prevent z-fighting. Unlike Area.z_order this can be 156 // used to compare with Line.basemap_z_order, and in fact may yield more 157 // accurate rendering (where a line may be rendered beneath an area). 158 BasemapZOrder *BasemapZOrder `json:"basemapZOrder,omitempty"` 159 160 // HasExternalEdges: True if the polygon is not entirely internal to the 161 // feature that it belongs to: that is, some of the edges are bordering 162 // another feature. 163 HasExternalEdges bool `json:"hasExternalEdges,omitempty"` 164 165 // InternalEdges: When has_external_edges is true, the polygon has some 166 // edges that border another feature. This field indicates the internal 167 // edges that do not border another feature. Each value is an index into 168 // the vertices array, and denotes the start vertex of the internal edge 169 // (the next vertex in the boundary loop is the end of the edge). If the 170 // selected vertex is the last vertex in the boundary loop, then the 171 // edge between that vertex and the starting vertex of the loop is 172 // internal. This field may be used for styling. For example, building 173 // parapets could be placed only on the external edges of a building 174 // polygon, or water could be lighter colored near the external edges of 175 // a body of water. If has_external_edges is false, all edges are 176 // internal and this field will be empty. 177 InternalEdges []int64 `json:"internalEdges,omitempty"` 178 179 // LoopBreaks: Identifies the boundary loops of the polygon. Only set 180 // for INDEXED_TRIANGLE polygons. Each value is an index into the 181 // vertices array indicating the beginning of a loop. For instance, 182 // values of [2, 5] would indicate loop_data contained 3 loops with 183 // indices 0-1, 2-4, and 5-end. This may be used in conjunction with the 184 // internal_edges field for styling polygon boundaries. Note that an 185 // edge may be on a polygon boundary but still internal to the feature. 186 // For example, a feature split across multiple tiles will have an 187 // internal polygon boundary edge along the edge of the tile. 188 LoopBreaks []int64 `json:"loopBreaks,omitempty"` 189 190 // TriangleIndices: When the polygon encoding is of type 191 // INDEXED_TRIANGLES, this contains the indices of the triangle vertices 192 // in the vertex_offsets field. There are 3 vertex indices per triangle. 193 TriangleIndices []int64 `json:"triangleIndices,omitempty"` 194 195 // Type: The polygon encoding type used for this area. 196 // 197 // Possible values: 198 // "TRIANGLE_FAN" - The first vertex in vertex_offset is the center of 199 // a triangle fan. The other vertices are arranged around this vertex in 200 // a fan shape. The following diagram showes a triangle fan polygon with 201 // the vertices labelled with their indices in the vertex_offset list. 202 // Triangle fan polygons always have a single boundary loop. Vertices 203 // may be in either a clockwise or counterclockwise order. (1) / \ / \ / 204 // \ (0)-----(2) / \ / / \ / / \ / (4)-----(3) 205 // "INDEXED_TRIANGLES" - The polygon is a set of triangles with three 206 // vertex indices per triangle. The vertex indices can be found in the 207 // triangle_indices field. Indexed triangle polygons also contain 208 // information about boundary loops. These identify the loops at the 209 // boundary of the polygon and may be used in conjunction with the 210 // internal_edges field for styling. Boundary loops may represent either 211 // a hole or a disconnected component of the polygon. The following 212 // diagram shows an indexed triangle polygon with two boundary loops. 213 // (0) (4) / \ / \ / \ / \ (1)----(2) (3)----(5) 214 // "TRIANGLE_STRIP" - A strip of triangles, where each triangle uses 215 // the last edge of the previous triangle. Vertices may be in either a 216 // clockwise or counterclockwise order. Only polygons without the 217 // has_external_edges flag set will use triangle strips. (0) / \ / \ / \ 218 // (2)-----(1) / \ / / \ / / \ / (4)-----(3) 219 Type string `json:"type,omitempty"` 220 221 // VertexOffsets: The vertices present in the polygon defining the area. 222 VertexOffsets *Vertex2DList `json:"vertexOffsets,omitempty"` 223 224 // ZOrder: The z-ordering of this area. Areas with a lower z-order 225 // should be rendered beneath areas with a higher z-order. This 226 // z-ordering does not imply anything about the altitude of the line 227 // relative to the ground, but it can be used to prevent z-fighting 228 // during rendering on the client. This z-ordering can only be used to 229 // compare areas, and cannot be compared with the z_order field in the 230 // Line message. The z-order may be negative or zero. Prefer 231 // Area.basemap_z_order. 232 ZOrder int64 `json:"zOrder,omitempty"` 233 234 // ForceSendFields is a list of field names (e.g. "BasemapZOrder") to 235 // unconditionally include in API requests. By default, fields with 236 // empty or default values are omitted from API requests. However, any 237 // non-pointer, non-interface field appearing in ForceSendFields will be 238 // sent to the server regardless of whether the field is empty or not. 239 // This may be used to include empty fields in Patch requests. 240 ForceSendFields []string `json:"-"` 241 242 // NullFields is a list of field names (e.g. "BasemapZOrder") to include 243 // in API requests with the JSON null value. By default, fields with 244 // empty values are omitted from API requests. However, any field with 245 // an empty value appearing in NullFields will be sent to the server as 246 // null. It is an error if a field in this list has a non-empty value. 247 // This may be used to include null fields in Patch requests. 248 NullFields []string `json:"-"` 249 } 250 251 func (s *Area) MarshalJSON() ([]byte, error) { 252 type NoMethod Area 253 raw := NoMethod(*s) 254 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 255 } 256 257 // BasemapZOrder: Metadata necessary to determine the ordering of a 258 // particular basemap element relative to others. To render the basemap 259 // correctly, sort by z-plane, then z-grade, then z-within-grade. 260 type BasemapZOrder struct { 261 // ZGrade: The second most significant component of the ordering of a 262 // component to be rendered onto the basemap. 263 ZGrade int64 `json:"zGrade,omitempty"` 264 265 // ZPlane: The most significant component of the ordering of a component 266 // to be rendered onto the basemap. 267 ZPlane int64 `json:"zPlane,omitempty"` 268 269 // ZWithinGrade: The least significant component of the ordering of a 270 // component to be rendered onto the basemap. 271 ZWithinGrade int64 `json:"zWithinGrade,omitempty"` 272 273 // ForceSendFields is a list of field names (e.g. "ZGrade") to 274 // unconditionally include in API requests. By default, fields with 275 // empty or default values are omitted from API requests. However, any 276 // non-pointer, non-interface field appearing in ForceSendFields will be 277 // sent to the server regardless of whether the field is empty or not. 278 // This may be used to include empty fields in Patch requests. 279 ForceSendFields []string `json:"-"` 280 281 // NullFields is a list of field names (e.g. "ZGrade") to include in API 282 // requests with the JSON null value. By default, fields with empty 283 // values are omitted from API requests. However, any field with an 284 // empty value appearing in NullFields will be sent to the server as 285 // null. It is an error if a field in this list has a non-empty value. 286 // This may be used to include null fields in Patch requests. 287 NullFields []string `json:"-"` 288 } 289 290 func (s *BasemapZOrder) MarshalJSON() ([]byte, error) { 291 type NoMethod BasemapZOrder 292 raw := NoMethod(*s) 293 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 294 } 295 296 // ExtrudedArea: Represents a height-extruded area: a 3D prism with a 297 // constant X-Y plane cross section. Used to represent extruded 298 // buildings. A single building may consist of several extruded areas. 299 // The min_z and max_z fields are scaled to the size of the tile. An 300 // extruded area with a max_z value of 4096 has the same height as the 301 // width of the tile that it is on. 302 type ExtrudedArea struct { 303 // Area: The area representing the footprint of the extruded area. 304 Area *Area `json:"area,omitempty"` 305 306 // MaxZ: The z-value in local tile coordinates where the extruded area 307 // ends. 308 MaxZ int64 `json:"maxZ,omitempty"` 309 310 // MinZ: The z-value in local tile coordinates where the extruded area 311 // begins. This is non-zero for extruded areas that begin off the 312 // ground. For example, a building with a skybridge may have an extruded 313 // area component with a non-zero min_z. 314 MinZ int64 `json:"minZ,omitempty"` 315 316 // ForceSendFields is a list of field names (e.g. "Area") to 317 // unconditionally include in API requests. By default, fields with 318 // empty or default values are omitted from API requests. However, any 319 // non-pointer, non-interface field appearing in ForceSendFields will be 320 // sent to the server regardless of whether the field is empty or not. 321 // This may be used to include empty fields in Patch requests. 322 ForceSendFields []string `json:"-"` 323 324 // NullFields is a list of field names (e.g. "Area") to include in API 325 // requests with the JSON null value. By default, fields with empty 326 // values are omitted from API requests. However, any field with an 327 // empty value appearing in NullFields will be sent to the server as 328 // null. It is an error if a field in this list has a non-empty value. 329 // This may be used to include null fields in Patch requests. 330 NullFields []string `json:"-"` 331 } 332 333 func (s *ExtrudedArea) MarshalJSON() ([]byte, error) { 334 type NoMethod ExtrudedArea 335 raw := NoMethod(*s) 336 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 337 } 338 339 // Feature: A feature representing a single geographic entity. 340 type Feature struct { 341 // DisplayName: The localized name of this feature. Currently only 342 // returned for roads. 343 DisplayName string `json:"displayName,omitempty"` 344 345 // Geometry: The geometry of this feature, representing the space that 346 // it occupies in the world. 347 Geometry *Geometry `json:"geometry,omitempty"` 348 349 // PlaceId: Place ID of this feature, suitable for use in Places API 350 // details requests. 351 PlaceId string `json:"placeId,omitempty"` 352 353 // Relations: Relations to other features. 354 Relations []*Relation `json:"relations,omitempty"` 355 356 // SegmentInfo: Metadata for features with the SEGMENT FeatureType. 357 SegmentInfo *SegmentInfo `json:"segmentInfo,omitempty"` 358 359 // Type: The type of this feature. 360 // 361 // Possible values: 362 // "FEATURE_TYPE_UNSPECIFIED" - Unknown feature type. 363 // "STRUCTURE" - Structures such as buildings and bridges. 364 // "BAR" - A business serving alcoholic drinks to be consumed onsite. 365 // "BANK" - A financial institution that offers services to the 366 // general public. 367 // "LODGING" - A place that provides any type of lodging for 368 // travelers. 369 // "CAFE" - A business that sells coffee, tea, and sometimes small 370 // meals. 371 // "RESTAURANT" - A business that prepares meals on-site for service 372 // to customers. 373 // "EVENT_VENUE" - A venue for private and public events. 374 // "TOURIST_DESTINATION" - Place of interest to tourists, typically 375 // for natural or cultural value. 376 // "SHOPPING" - A structure containing a business or businesses that 377 // sell goods. 378 // "SCHOOL" - Institution where young people receive general (not 379 // vocation or professional) education. 380 // "SEGMENT" - Segments such as roads and train lines. 381 // "ROAD" - A way leading from one place to another intended for use 382 // by vehicles. 383 // "LOCAL_ROAD" - A small city street, typically for travel in a 384 // residential neighborhood. 385 // "ARTERIAL_ROAD" - Major through road that's expected to carry large 386 // volumes of traffic. 387 // "HIGHWAY" - A major road including freeways and state highways. 388 // "CONTROLLED_ACCESS_HIGHWAY" - A highway with grade-separated 389 // crossings that is accessed exclusively by ramps. These are usually 390 // called "freeways" or "motorways". The enable_detailed_highway_types 391 // request flag must be set in order for this type to be returned. 392 // "FOOTPATH" - A path that's primarily intended for use by 393 // pedestrians and/or cyclists. 394 // "RAIL" - Tracks intended for use by trains. 395 // "FERRY" - Services which are part of the road network but are not 396 // roads. 397 // "REGION" - Non-water areas such as parks and forest. 398 // "PARK" - Outdoor areas such as parks and botanical gardens. 399 // "BEACH" - A pebbly or sandy shore along the edge of a sea or lake. 400 // "FOREST" - Area of land covered by trees. 401 // "POLITICAL" - Political entities, such as provinces and districts. 402 // "ADMINISTRATIVE_AREA1" - Top-level divisions within a country, such 403 // as prefectures or states. 404 // "LOCALITY" - Cities, towns, and other municipalities. 405 // "SUBLOCALITY" - Divisions within a locality like a borough or ward. 406 // "WATER" - Water features such as rivers and lakes. 407 Type string `json:"type,omitempty"` 408 409 // ForceSendFields is a list of field names (e.g. "DisplayName") to 410 // unconditionally include in API requests. By default, fields with 411 // empty or default values are omitted from API requests. However, any 412 // non-pointer, non-interface field appearing in ForceSendFields will be 413 // sent to the server regardless of whether the field is empty or not. 414 // This may be used to include empty fields in Patch requests. 415 ForceSendFields []string `json:"-"` 416 417 // NullFields is a list of field names (e.g. "DisplayName") to include 418 // in API requests with the JSON null value. By default, fields with 419 // empty values are omitted from API requests. However, any field with 420 // an empty value appearing in NullFields will be sent to the server as 421 // null. It is an error if a field in this list has a non-empty value. 422 // This may be used to include null fields in Patch requests. 423 NullFields []string `json:"-"` 424 } 425 426 func (s *Feature) MarshalJSON() ([]byte, error) { 427 type NoMethod Feature 428 raw := NoMethod(*s) 429 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 430 } 431 432 // FeatureTile: A tile containing information about the map features 433 // located in the region it covers. 434 type FeatureTile struct { 435 // Coordinates: The global tile coordinates that uniquely identify this 436 // tile. 437 Coordinates *TileCoordinates `json:"coordinates,omitempty"` 438 439 // Features: Features present on this map tile. 440 Features []*Feature `json:"features,omitempty"` 441 442 // Name: Resource name of the tile. The tile resource name is prefixed 443 // by its collection ID `tiles/` followed by the resource ID, which 444 // encodes the tile's global x and y coordinates and zoom level as 445 // `@,,z`. For example, `tiles/@1,2,3z`. 446 Name string `json:"name,omitempty"` 447 448 // Providers: Data providers for the data contained in this tile. 449 Providers []*ProviderInfo `json:"providers,omitempty"` 450 451 // Status: Tile response status code to support tile caching. 452 // 453 // Possible values: 454 // "STATUS_OK" - Everything worked out OK. The cache-control header 455 // determines how long this Tile response may be cached by the client. 456 // See also version_id and STATUS_OK_DATA_UNCHANGED. 457 // "STATUS_OK_DATA_UNCHANGED" - Indicates that the request was 458 // processed successfully and that the tile data that would have been 459 // returned are identical to the data already in the client's cache, as 460 // specified by the value of client_tile_version_id contained in 461 // GetFeatureTileRequest. In particular, the tile's features and 462 // providers will not be populated when the tile data is identical. 463 // However, the cache-control header and version_id can still change 464 // even when the tile contents itself does not, so clients should always 465 // use the most recent values returned by the API. 466 Status string `json:"status,omitempty"` 467 468 // VersionId: An opaque value, usually less than 30 characters, that 469 // contains version info about this tile and the data that was used to 470 // generate it. The client should store this value in its tile cache and 471 // pass it back to the API in the client_tile_version_id field of 472 // subsequent tile requests in order to enable the API to detect when 473 // the new tile would be the same as the one the client already has in 474 // its cache. Also see STATUS_OK_DATA_UNCHANGED. 475 VersionId string `json:"versionId,omitempty"` 476 477 // ServerResponse contains the HTTP response code and headers from the 478 // server. 479 googleapi.ServerResponse `json:"-"` 480 481 // ForceSendFields is a list of field names (e.g. "Coordinates") to 482 // unconditionally include in API requests. By default, fields with 483 // empty or default values are omitted from API requests. However, any 484 // non-pointer, non-interface field appearing in ForceSendFields will be 485 // sent to the server regardless of whether the field is empty or not. 486 // This may be used to include empty fields in Patch requests. 487 ForceSendFields []string `json:"-"` 488 489 // NullFields is a list of field names (e.g. "Coordinates") to include 490 // in API requests with the JSON null value. By default, fields with 491 // empty values are omitted from API requests. However, any field with 492 // an empty value appearing in NullFields will be sent to the server as 493 // null. It is an error if a field in this list has a non-empty value. 494 // This may be used to include null fields in Patch requests. 495 NullFields []string `json:"-"` 496 } 497 498 func (s *FeatureTile) MarshalJSON() ([]byte, error) { 499 type NoMethod FeatureTile 500 raw := NoMethod(*s) 501 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 502 } 503 504 // FirstDerivativeElevationGrid: A packed representation of a 2D grid of 505 // uniformly spaced points containing elevation data. Each point within 506 // the grid represents the altitude in meters above average sea level at 507 // that location within the tile. Elevations provided are (generally) 508 // relative to the EGM96 geoid, however some areas will be relative to 509 // NAVD88. EGM96 and NAVD88 are off by no more than 2 meters. The grid 510 // is oriented north-west to south-east, as illustrated: rows[0].a[0] 511 // rows[0].a[m] +-----------------+ | | | N | | ^ | | | | | W <-----> E 512 // | | | | | v | | S | | | +-----------------+ rows[n].a[0] rows[n].a[m] 513 // Rather than storing the altitudes directly, we store the diffs 514 // between them as integers at some requested level of precision to take 515 // advantage of integer packing. The actual altitude values a[] can be 516 // reconstructed using the scale and each row's first_altitude and 517 // altitude_diff fields. More details in 518 // go/elevation-encoding-options-for-enduro under "Recommended 519 // implementation". 520 type FirstDerivativeElevationGrid struct { 521 // AltitudeMultiplier: A multiplier applied to the altitude fields below 522 // to extract the actual altitudes in meters from the elevation grid. 523 AltitudeMultiplier float64 `json:"altitudeMultiplier,omitempty"` 524 525 // Rows: Rows of points containing altitude data making up the elevation 526 // grid. Each row is the same length. Rows are ordered from north to 527 // south. E.g: rows[0] is the north-most row, and rows[n] is the 528 // south-most row. 529 Rows []*Row `json:"rows,omitempty"` 530 531 // ForceSendFields is a list of field names (e.g. "AltitudeMultiplier") 532 // to unconditionally include in API requests. By default, fields with 533 // empty or default values are omitted from API requests. However, any 534 // non-pointer, non-interface field appearing in ForceSendFields will be 535 // sent to the server regardless of whether the field is empty or not. 536 // This may be used to include empty fields in Patch requests. 537 ForceSendFields []string `json:"-"` 538 539 // NullFields is a list of field names (e.g. "AltitudeMultiplier") to 540 // include in API requests with the JSON null value. By default, fields 541 // with empty values are omitted from API requests. However, any field 542 // with an empty value appearing in NullFields will be sent to the 543 // server as null. It is an error if a field in this list has a 544 // non-empty value. This may be used to include null fields in Patch 545 // requests. 546 NullFields []string `json:"-"` 547 } 548 549 func (s *FirstDerivativeElevationGrid) MarshalJSON() ([]byte, error) { 550 type NoMethod FirstDerivativeElevationGrid 551 raw := NoMethod(*s) 552 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 553 } 554 555 func (s *FirstDerivativeElevationGrid) UnmarshalJSON(data []byte) error { 556 type NoMethod FirstDerivativeElevationGrid 557 var s1 struct { 558 AltitudeMultiplier gensupport.JSONFloat64 `json:"altitudeMultiplier"` 559 *NoMethod 560 } 561 s1.NoMethod = (*NoMethod)(s) 562 if err := json.Unmarshal(data, &s1); err != nil { 563 return err 564 } 565 s.AltitudeMultiplier = float64(s1.AltitudeMultiplier) 566 return nil 567 } 568 569 // Geometry: Represents the geometry of a feature, that is, the shape 570 // that it has on the map. The local tile coordinate system has the 571 // origin at the north-west (upper-left) corner of the tile, and is 572 // scaled to 4096 units across each edge. The height (Z) axis has the 573 // same scale factor: an extruded area with a max_z value of 4096 has 574 // the same height as the width of the tile that it is on. There is no 575 // clipping boundary, so it is possible that some coordinates will lie 576 // outside the tile boundaries. 577 type Geometry struct { 578 // Areas: The areas present in this geometry. 579 Areas []*Area `json:"areas,omitempty"` 580 581 // ExtrudedAreas: The extruded areas present in this geometry. Not 582 // populated if modeled_volumes are included in this geometry unless 583 // always_include_building_footprints is set in GetFeatureTileRequest, 584 // in which case the client should decide which (extruded areas or 585 // modeled volumes) should be used (they should not be rendered 586 // together). 587 ExtrudedAreas []*ExtrudedArea `json:"extrudedAreas,omitempty"` 588 589 // Lines: The lines present in this geometry. 590 Lines []*Line `json:"lines,omitempty"` 591 592 // ModeledVolumes: The modeled volumes present in this geometry. Not 593 // populated unless enable_modeled_volumes has been set in 594 // GetFeatureTileRequest. 595 ModeledVolumes []*ModeledVolume `json:"modeledVolumes,omitempty"` 596 597 // ForceSendFields is a list of field names (e.g. "Areas") to 598 // unconditionally include in API requests. By default, fields with 599 // empty or default values are omitted from API requests. However, any 600 // non-pointer, non-interface field appearing in ForceSendFields will be 601 // sent to the server regardless of whether the field is empty or not. 602 // This may be used to include empty fields in Patch requests. 603 ForceSendFields []string `json:"-"` 604 605 // NullFields is a list of field names (e.g. "Areas") to include in API 606 // requests with the JSON null value. By default, fields with empty 607 // values are omitted from API requests. However, any field with an 608 // empty value appearing in NullFields will be sent to the server as 609 // null. It is an error if a field in this list has a non-empty value. 610 // This may be used to include null fields in Patch requests. 611 NullFields []string `json:"-"` 612 } 613 614 func (s *Geometry) MarshalJSON() ([]byte, error) { 615 type NoMethod Geometry 616 raw := NoMethod(*s) 617 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 618 } 619 620 // Line: Represents a 2D polyline. Used to represent segments such as 621 // roads, train tracks, etc. 622 type Line struct { 623 // BasemapZOrder: The z-order of this geometry when rendered on a flat 624 // basemap. Geometry with a lower z-order should be rendered beneath 625 // geometry with a higher z-order. This z-ordering does not imply 626 // anything about the altitude of the area relative to the ground, but 627 // it can be used to prevent z-fighting. Unlike Line.z_order this can be 628 // used to compare with Area.basemap_z_order, and in fact may yield more 629 // accurate rendering (where a line may be rendered beneath an area). 630 BasemapZOrder *BasemapZOrder `json:"basemapZOrder,omitempty"` 631 632 // VertexOffsets: The vertices present in the polyline. 633 VertexOffsets *Vertex2DList `json:"vertexOffsets,omitempty"` 634 635 // ZOrder: The z-order of the line. Lines with a lower z-order should be 636 // rendered beneath lines with a higher z-order. This z-ordering does 637 // not imply anything about the altitude of the area relative to the 638 // ground, but it can be used to prevent z-fighting during rendering on 639 // the client. In general, larger and more important road features will 640 // have a higher z-order line associated with them. This z-ordering can 641 // only be used to compare lines, and cannot be compared with the 642 // z_order field in the Area message. The z-order may be negative or 643 // zero. Prefer Line.basemap_z_order. 644 ZOrder int64 `json:"zOrder,omitempty"` 645 646 // ForceSendFields is a list of field names (e.g. "BasemapZOrder") to 647 // unconditionally include in API requests. By default, fields with 648 // empty or default values are omitted from API requests. However, any 649 // non-pointer, non-interface field appearing in ForceSendFields will be 650 // sent to the server regardless of whether the field is empty or not. 651 // This may be used to include empty fields in Patch requests. 652 ForceSendFields []string `json:"-"` 653 654 // NullFields is a list of field names (e.g. "BasemapZOrder") to include 655 // in API requests with the JSON null value. By default, fields with 656 // empty values are omitted from API requests. However, any field with 657 // an empty value appearing in NullFields will be sent to the server as 658 // null. It is an error if a field in this list has a non-empty value. 659 // This may be used to include null fields in Patch requests. 660 NullFields []string `json:"-"` 661 } 662 663 func (s *Line) MarshalJSON() ([]byte, error) { 664 type NoMethod Line 665 raw := NoMethod(*s) 666 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 667 } 668 669 // ModeledVolume: Represents a modeled volume in 3D space. Used to 670 // represent 3D buildings. 671 type ModeledVolume struct { 672 // Strips: The triangle strips present in this mesh. 673 Strips []*TriangleStrip `json:"strips,omitempty"` 674 675 // VertexOffsets: The vertices present in the mesh defining the modeled 676 // volume. 677 VertexOffsets *Vertex3DList `json:"vertexOffsets,omitempty"` 678 679 // ForceSendFields is a list of field names (e.g. "Strips") to 680 // unconditionally include in API requests. By default, fields with 681 // empty or default values are omitted from API requests. However, any 682 // non-pointer, non-interface field appearing in ForceSendFields will be 683 // sent to the server regardless of whether the field is empty or not. 684 // This may be used to include empty fields in Patch requests. 685 ForceSendFields []string `json:"-"` 686 687 // NullFields is a list of field names (e.g. "Strips") to include in API 688 // requests with the JSON null value. By default, fields with empty 689 // values are omitted from API requests. However, any field with an 690 // empty value appearing in NullFields will be sent to the server as 691 // null. It is an error if a field in this list has a non-empty value. 692 // This may be used to include null fields in Patch requests. 693 NullFields []string `json:"-"` 694 } 695 696 func (s *ModeledVolume) MarshalJSON() ([]byte, error) { 697 type NoMethod ModeledVolume 698 raw := NoMethod(*s) 699 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 700 } 701 702 // ProviderInfo: Information about the data providers that should be 703 // included in the attribution string shown by the client. 704 type ProviderInfo struct { 705 // Description: Attribution string for this provider. This string is not 706 // localized. 707 Description string `json:"description,omitempty"` 708 709 // ForceSendFields is a list of field names (e.g. "Description") to 710 // unconditionally include in API requests. By default, fields with 711 // empty or default values are omitted from API requests. However, any 712 // non-pointer, non-interface field appearing in ForceSendFields will be 713 // sent to the server regardless of whether the field is empty or not. 714 // This may be used to include empty fields in Patch requests. 715 ForceSendFields []string `json:"-"` 716 717 // NullFields is a list of field names (e.g. "Description") to include 718 // in API requests with the JSON null value. By default, fields with 719 // empty values are omitted from API requests. However, any field with 720 // an empty value appearing in NullFields will be sent to the server as 721 // null. It is an error if a field in this list has a non-empty value. 722 // This may be used to include null fields in Patch requests. 723 NullFields []string `json:"-"` 724 } 725 726 func (s *ProviderInfo) MarshalJSON() ([]byte, error) { 727 type NoMethod ProviderInfo 728 raw := NoMethod(*s) 729 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 730 } 731 732 // Relation: Represents a relation to another feature in the tile. For 733 // example, a building might be occupied by a given POI. The related 734 // feature can be retrieved using the related feature index. 735 type Relation struct { 736 // RelatedFeatureIndex: Zero-based index to look up the related feature 737 // from the list of features in the tile. 738 RelatedFeatureIndex int64 `json:"relatedFeatureIndex,omitempty"` 739 740 // RelationType: Relation type between the origin feature to the related 741 // feature. 742 // 743 // Possible values: 744 // "RELATION_TYPE_UNSPECIFIED" - Unspecified relation type. Should 745 // never happen. 746 // "OCCUPIES" - The origin feature occupies the related feature. 747 // "PRIMARILY_OCCUPIED_BY" - The origin feature is primarily occupied 748 // by the related feature. 749 RelationType string `json:"relationType,omitempty"` 750 751 // ForceSendFields is a list of field names (e.g. "RelatedFeatureIndex") 752 // to unconditionally include in API requests. By default, fields with 753 // empty or default values are omitted from API requests. However, any 754 // non-pointer, non-interface field appearing in ForceSendFields will be 755 // sent to the server regardless of whether the field is empty or not. 756 // This may be used to include empty fields in Patch requests. 757 ForceSendFields []string `json:"-"` 758 759 // NullFields is a list of field names (e.g. "RelatedFeatureIndex") to 760 // include in API requests with the JSON null value. By default, fields 761 // with empty values are omitted from API requests. However, any field 762 // with an empty value appearing in NullFields will be sent to the 763 // server as null. It is an error if a field in this list has a 764 // non-empty value. This may be used to include null fields in Patch 765 // requests. 766 NullFields []string `json:"-"` 767 } 768 769 func (s *Relation) MarshalJSON() ([]byte, error) { 770 type NoMethod Relation 771 raw := NoMethod(*s) 772 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 773 } 774 775 // RoadInfo: Extra metadata relating to roads. 776 type RoadInfo struct { 777 // IsPrivate: Road has signage discouraging or prohibiting use by the 778 // general public. E.g., roads with signs that say "Private", or "No 779 // trespassing." 780 IsPrivate bool `json:"isPrivate,omitempty"` 781 782 // ForceSendFields is a list of field names (e.g. "IsPrivate") to 783 // unconditionally include in API requests. By default, fields with 784 // empty or default values are omitted from API requests. However, any 785 // non-pointer, non-interface field appearing in ForceSendFields will be 786 // sent to the server regardless of whether the field is empty or not. 787 // This may be used to include empty fields in Patch requests. 788 ForceSendFields []string `json:"-"` 789 790 // NullFields is a list of field names (e.g. "IsPrivate") to include in 791 // API requests with the JSON null value. By default, fields with empty 792 // values are omitted from API requests. However, any field with an 793 // empty value appearing in NullFields will be sent to the server as 794 // null. It is an error if a field in this list has a non-empty value. 795 // This may be used to include null fields in Patch requests. 796 NullFields []string `json:"-"` 797 } 798 799 func (s *RoadInfo) MarshalJSON() ([]byte, error) { 800 type NoMethod RoadInfo 801 raw := NoMethod(*s) 802 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 803 } 804 805 // Row: A row of altitude points in the elevation grid, ordered from 806 // west to east. 807 type Row struct { 808 // AltitudeDiffs: The difference between each successive pair of 809 // altitudes, from west to east. The first, westmost point, is just the 810 // altitude rather than a diff. The units are specified by the 811 // altitude_multiplier parameter above; the value in meters is given by 812 // altitude_multiplier * altitude_diffs[n]. The altitude row (in metres 813 // above sea level) can be reconstructed with: a[0] = altitude_diffs[0] 814 // * altitude_multiplier when n > 0, a[n] = a[n-1] + altitude_diffs[n-1] 815 // * altitude_multiplier. 816 AltitudeDiffs []int64 `json:"altitudeDiffs,omitempty"` 817 818 // ForceSendFields is a list of field names (e.g. "AltitudeDiffs") to 819 // unconditionally include in API requests. By default, fields with 820 // empty or default values are omitted from API requests. However, any 821 // non-pointer, non-interface field appearing in ForceSendFields will be 822 // sent to the server regardless of whether the field is empty or not. 823 // This may be used to include empty fields in Patch requests. 824 ForceSendFields []string `json:"-"` 825 826 // NullFields is a list of field names (e.g. "AltitudeDiffs") to include 827 // in API requests with the JSON null value. By default, fields with 828 // empty values are omitted from API requests. However, any field with 829 // an empty value appearing in NullFields will be sent to the server as 830 // null. It is an error if a field in this list has a non-empty value. 831 // This may be used to include null fields in Patch requests. 832 NullFields []string `json:"-"` 833 } 834 835 func (s *Row) MarshalJSON() ([]byte, error) { 836 type NoMethod Row 837 raw := NoMethod(*s) 838 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 839 } 840 841 // SecondDerivativeElevationGrid: A packed representation of a 2D grid 842 // of uniformly spaced points containing elevation data. Each point 843 // within the grid represents the altitude in meters above average sea 844 // level at that location within the tile. Elevations provided are 845 // (generally) relative to the EGM96 geoid, however some areas will be 846 // relative to NAVD88. EGM96 and NAVD88 are off by no more than 2 847 // meters. The grid is oriented north-west to south-east, as 848 // illustrated: rows[0].a[0] rows[0].a[m] +-----------------+ | | | N | 849 // | ^ | | | | | W <-----> E | | | | | v | | S | | | +-----------------+ 850 // rows[n].a[0] rows[n].a[m] Rather than storing the altitudes directly, 851 // we store the diffs of the diffs between them as integers at some 852 // requested level of precision to take advantage of integer packing. 853 // Note that the data is packed in such a way that is fast to decode in 854 // Unity and that further optimizes wire size. 855 type SecondDerivativeElevationGrid struct { 856 // AltitudeMultiplier: A multiplier applied to the elements in the 857 // encoded data to extract the actual altitudes in meters. 858 AltitudeMultiplier float64 `json:"altitudeMultiplier,omitempty"` 859 860 // ColumnCount: The number of columns included in the encoded elevation 861 // data (i.e. the horizontal resolution of the grid). 862 ColumnCount int64 `json:"columnCount,omitempty"` 863 864 // EncodedData: A stream of elements each representing a point on the 865 // tile running across each row from left to right, top to bottom. There 866 // will be precisely horizontal_resolution * vertical_resolution 867 // elements in the stream. The elements are not the heights, rather the 868 // second order derivative of the values one would expect in a stream of 869 // height data. Each element is a varint with the following encoding: 870 // ---------------------------------------------------------------------- 871 // --| | Head Nibble | 872 // ---------------------------------------------------------------------- 873 // --| | Bit 0 | Bit 1 | Bits 2-3 | | Terminator| Sign (1=neg) | Least 874 // significant 2 bits of absolute error | 875 // ---------------------------------------------------------------------- 876 // --| | Tail Nibble #1 | 877 // ---------------------------------------------------------------------- 878 // --| | Bit 0 | Bit 1-3 | | Terminator| Least significant 3 bits of 879 // absolute error | 880 // ---------------------------------------------------------------------- 881 // --| | ... | Tail Nibble #n | 882 // ---------------------------------------------------------------------- 883 // --| | Bit 0 | Bit 1-3 | | Terminator| Least significant 3 bits of 884 // absolute error | 885 // ---------------------------------------------------------------------- 886 // --| 887 EncodedData string `json:"encodedData,omitempty"` 888 889 // RowCount: The number of rows included in the encoded elevation data 890 // (i.e. the vertical resolution of the grid). 891 RowCount int64 `json:"rowCount,omitempty"` 892 893 // ForceSendFields is a list of field names (e.g. "AltitudeMultiplier") 894 // to unconditionally include in API requests. By default, fields with 895 // empty or default values are omitted from API requests. However, any 896 // non-pointer, non-interface field appearing in ForceSendFields will be 897 // sent to the server regardless of whether the field is empty or not. 898 // This may be used to include empty fields in Patch requests. 899 ForceSendFields []string `json:"-"` 900 901 // NullFields is a list of field names (e.g. "AltitudeMultiplier") to 902 // include in API requests with the JSON null value. By default, fields 903 // with empty values are omitted from API requests. However, any field 904 // with an empty value appearing in NullFields will be sent to the 905 // server as null. It is an error if a field in this list has a 906 // non-empty value. This may be used to include null fields in Patch 907 // requests. 908 NullFields []string `json:"-"` 909 } 910 911 func (s *SecondDerivativeElevationGrid) MarshalJSON() ([]byte, error) { 912 type NoMethod SecondDerivativeElevationGrid 913 raw := NoMethod(*s) 914 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 915 } 916 917 func (s *SecondDerivativeElevationGrid) UnmarshalJSON(data []byte) error { 918 type NoMethod SecondDerivativeElevationGrid 919 var s1 struct { 920 AltitudeMultiplier gensupport.JSONFloat64 `json:"altitudeMultiplier"` 921 *NoMethod 922 } 923 s1.NoMethod = (*NoMethod)(s) 924 if err := json.Unmarshal(data, &s1); err != nil { 925 return err 926 } 927 s.AltitudeMultiplier = float64(s1.AltitudeMultiplier) 928 return nil 929 } 930 931 // SegmentInfo: Extra metadata relating to segments. 932 type SegmentInfo struct { 933 // RoadInfo: Metadata for features with the ROAD FeatureType. 934 RoadInfo *RoadInfo `json:"roadInfo,omitempty"` 935 936 // ForceSendFields is a list of field names (e.g. "RoadInfo") to 937 // unconditionally include in API requests. By default, fields with 938 // empty or default values are omitted from API requests. However, any 939 // non-pointer, non-interface field appearing in ForceSendFields will be 940 // sent to the server regardless of whether the field is empty or not. 941 // This may be used to include empty fields in Patch requests. 942 ForceSendFields []string `json:"-"` 943 944 // NullFields is a list of field names (e.g. "RoadInfo") to include in 945 // API requests with the JSON null value. By default, fields with empty 946 // values are omitted from API requests. However, any field with an 947 // empty value appearing in NullFields will be sent to the server as 948 // null. It is an error if a field in this list has a non-empty value. 949 // This may be used to include null fields in Patch requests. 950 NullFields []string `json:"-"` 951 } 952 953 func (s *SegmentInfo) MarshalJSON() ([]byte, error) { 954 type NoMethod SegmentInfo 955 raw := NoMethod(*s) 956 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 957 } 958 959 // TerrainTile: A tile containing information about the terrain located 960 // in the region it covers. 961 type TerrainTile struct { 962 // Coordinates: The global tile coordinates that uniquely identify this 963 // tile. 964 Coordinates *TileCoordinates `json:"coordinates,omitempty"` 965 966 // FirstDerivative: Terrain elevation data encoded as a 967 // FirstDerivativeElevationGrid. cs/symbol:FirstDerivativeElevationGrid. 968 FirstDerivative *FirstDerivativeElevationGrid `json:"firstDerivative,omitempty"` 969 970 // Name: Resource name of the tile. The tile resource name is prefixed 971 // by its collection ID `terrain/` followed by the resource ID, which 972 // encodes the tile's global x and y coordinates and zoom level as 973 // `@,,z`. For example, `terrain/@1,2,3z`. 974 Name string `json:"name,omitempty"` 975 976 // SecondDerivative: Terrain elevation data encoded as a 977 // SecondDerivativeElevationGrid. 978 // cs/symbol:SecondDerivativeElevationGrid. See go/byte-encoded-terrain 979 // for more details. 980 SecondDerivative *SecondDerivativeElevationGrid `json:"secondDerivative,omitempty"` 981 982 // ServerResponse contains the HTTP response code and headers from the 983 // server. 984 googleapi.ServerResponse `json:"-"` 985 986 // ForceSendFields is a list of field names (e.g. "Coordinates") to 987 // unconditionally include in API requests. By default, fields with 988 // empty or default values are omitted from API requests. However, any 989 // non-pointer, non-interface field appearing in ForceSendFields will be 990 // sent to the server regardless of whether the field is empty or not. 991 // This may be used to include empty fields in Patch requests. 992 ForceSendFields []string `json:"-"` 993 994 // NullFields is a list of field names (e.g. "Coordinates") to include 995 // in API requests with the JSON null value. By default, fields with 996 // empty values are omitted from API requests. However, any field with 997 // an empty value appearing in NullFields will be sent to the server as 998 // null. It is an error if a field in this list has a non-empty value. 999 // This may be used to include null fields in Patch requests. 1000 NullFields []string `json:"-"` 1001 } 1002 1003 func (s *TerrainTile) MarshalJSON() ([]byte, error) { 1004 type NoMethod TerrainTile 1005 raw := NoMethod(*s) 1006 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1007 } 1008 1009 // TileCoordinates: Global tile coordinates. Global tile coordinates 1010 // reference a specific tile on the map at a specific zoom level. The 1011 // origin of this coordinate system is always at the northwest corner of 1012 // the map, with x values increasing from west to east and y values 1013 // increasing from north to south. Tiles are indexed using x, y 1014 // coordinates from that origin. The zoom level containing the entire 1015 // world in a tile is 0, and it increases as you zoom in. Zoom level n + 1016 // 1 will contain 4 times as many tiles as zoom level n. The zoom level 1017 // controls the level of detail of the data that is returned. In 1018 // particular, this affects the set of feature types returned, their 1019 // density, and geometry simplification. The exact tile contents may 1020 // change over time, but care will be taken to keep supporting the most 1021 // important use cases. For example, zoom level 15 shows roads for 1022 // orientation and planning in the local neighborhood and zoom level 17 1023 // shows buildings to give users on foot a sense of situational 1024 // awareness. 1025 type TileCoordinates struct { 1026 // X: Required. The x coordinate. 1027 X int64 `json:"x,omitempty"` 1028 1029 // Y: Required. The y coordinate. 1030 Y int64 `json:"y,omitempty"` 1031 1032 // Zoom: Required. The Google Maps API zoom level. 1033 Zoom int64 `json:"zoom,omitempty"` 1034 1035 // ForceSendFields is a list of field names (e.g. "X") to 1036 // unconditionally include in API requests. By default, fields with 1037 // empty or default values are omitted from API requests. However, any 1038 // non-pointer, non-interface field appearing in ForceSendFields will be 1039 // sent to the server regardless of whether the field is empty or not. 1040 // This may be used to include empty fields in Patch requests. 1041 ForceSendFields []string `json:"-"` 1042 1043 // NullFields is a list of field names (e.g. "X") to include in API 1044 // requests with the JSON null value. By default, fields with empty 1045 // values are omitted from API requests. However, any field with an 1046 // empty value appearing in NullFields will be sent to the server as 1047 // null. It is an error if a field in this list has a non-empty value. 1048 // This may be used to include null fields in Patch requests. 1049 NullFields []string `json:"-"` 1050 } 1051 1052 func (s *TileCoordinates) MarshalJSON() ([]byte, error) { 1053 type NoMethod TileCoordinates 1054 raw := NoMethod(*s) 1055 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1056 } 1057 1058 // TriangleStrip: Represents a strip of triangles. Each triangle uses 1059 // the last edge of the previous one. The following diagram shows an 1060 // example of a triangle strip, with each vertex labeled with its index 1061 // in the vertex_index array. (1)-----(3) / \ / \ / \ / \ / \ / \ 1062 // (0)-----(2)-----(4) Vertices may be in either clockwise or 1063 // counter-clockwise order. 1064 type TriangleStrip struct { 1065 // VertexIndices: Index into the vertex_offset array representing the 1066 // next vertex in the triangle strip. 1067 VertexIndices []int64 `json:"vertexIndices,omitempty"` 1068 1069 // ForceSendFields is a list of field names (e.g. "VertexIndices") to 1070 // unconditionally include in API requests. By default, fields with 1071 // empty or default values are omitted from API requests. However, any 1072 // non-pointer, non-interface field appearing in ForceSendFields will be 1073 // sent to the server regardless of whether the field is empty or not. 1074 // This may be used to include empty fields in Patch requests. 1075 ForceSendFields []string `json:"-"` 1076 1077 // NullFields is a list of field names (e.g. "VertexIndices") to include 1078 // in API requests with the JSON null value. By default, fields with 1079 // empty values are omitted from API requests. However, any field with 1080 // an empty value appearing in NullFields will be sent to the server as 1081 // null. It is an error if a field in this list has a non-empty value. 1082 // This may be used to include null fields in Patch requests. 1083 NullFields []string `json:"-"` 1084 } 1085 1086 func (s *TriangleStrip) MarshalJSON() ([]byte, error) { 1087 type NoMethod TriangleStrip 1088 raw := NoMethod(*s) 1089 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1090 } 1091 1092 // Vertex2DList: 2D vertex list used for lines and areas. Each entry 1093 // represents an offset from the previous one in local tile coordinates. 1094 // The first entry is offset from (0, 0). For example, the list of 1095 // vertices [(1,1), (2, 2), (1, 2)] would be encoded in vertex offsets 1096 // as [(1, 1), (1, 1), (-1, 0)]. 1097 type Vertex2DList struct { 1098 // XOffsets: List of x-offsets in local tile coordinates. 1099 XOffsets []int64 `json:"xOffsets,omitempty"` 1100 1101 // YOffsets: List of y-offsets in local tile coordinates. 1102 YOffsets []int64 `json:"yOffsets,omitempty"` 1103 1104 // ForceSendFields is a list of field names (e.g. "XOffsets") to 1105 // unconditionally include in API requests. By default, fields with 1106 // empty or default values are omitted from API requests. However, any 1107 // non-pointer, non-interface field appearing in ForceSendFields will be 1108 // sent to the server regardless of whether the field is empty or not. 1109 // This may be used to include empty fields in Patch requests. 1110 ForceSendFields []string `json:"-"` 1111 1112 // NullFields is a list of field names (e.g. "XOffsets") to include in 1113 // API requests with the JSON null value. By default, fields with empty 1114 // values are omitted from API requests. However, any field with an 1115 // empty value appearing in NullFields will be sent to the server as 1116 // null. It is an error if a field in this list has a non-empty value. 1117 // This may be used to include null fields in Patch requests. 1118 NullFields []string `json:"-"` 1119 } 1120 1121 func (s *Vertex2DList) MarshalJSON() ([]byte, error) { 1122 type NoMethod Vertex2DList 1123 raw := NoMethod(*s) 1124 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1125 } 1126 1127 // Vertex3DList: 3D vertex list used for modeled volumes. Each entry 1128 // represents an offset from the previous one in local tile coordinates. 1129 // The first coordinate is offset from (0, 0, 0). 1130 type Vertex3DList struct { 1131 // XOffsets: List of x-offsets in local tile coordinates. 1132 XOffsets []int64 `json:"xOffsets,omitempty"` 1133 1134 // YOffsets: List of y-offsets in local tile coordinates. 1135 YOffsets []int64 `json:"yOffsets,omitempty"` 1136 1137 // ZOffsets: List of z-offsets in local tile coordinates. 1138 ZOffsets []int64 `json:"zOffsets,omitempty"` 1139 1140 // ForceSendFields is a list of field names (e.g. "XOffsets") to 1141 // unconditionally include in API requests. By default, fields with 1142 // empty or default values are omitted from API requests. However, any 1143 // non-pointer, non-interface field appearing in ForceSendFields will be 1144 // sent to the server regardless of whether the field is empty or not. 1145 // This may be used to include empty fields in Patch requests. 1146 ForceSendFields []string `json:"-"` 1147 1148 // NullFields is a list of field names (e.g. "XOffsets") to include in 1149 // API requests with the JSON null value. By default, fields with empty 1150 // values are omitted from API requests. However, any field with an 1151 // empty value appearing in NullFields will be sent to the server as 1152 // null. It is an error if a field in this list has a non-empty value. 1153 // This may be used to include null fields in Patch requests. 1154 NullFields []string `json:"-"` 1155 } 1156 1157 func (s *Vertex3DList) MarshalJSON() ([]byte, error) { 1158 type NoMethod Vertex3DList 1159 raw := NoMethod(*s) 1160 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1161 } 1162 1163 // method id "vectortile.featuretiles.get": 1164 1165 type FeaturetilesGetCall struct { 1166 s *Service 1167 name string 1168 urlParams_ gensupport.URLParams 1169 ifNoneMatch_ string 1170 ctx_ context.Context 1171 header_ http.Header 1172 } 1173 1174 // Get: Gets a feature tile by its tile resource name. 1175 // 1176 // - name: Resource name of the tile. The tile resource name is prefixed 1177 // by its collection ID `tiles/` followed by the resource ID, which 1178 // encodes the tile's global x and y coordinates and zoom level as 1179 // `@,,z`. For example, `tiles/@1,2,3z`. 1180 func (r *FeaturetilesService) Get(name string) *FeaturetilesGetCall { 1181 c := &FeaturetilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1182 c.name = name 1183 return c 1184 } 1185 1186 // AlwaysIncludeBuildingFootprints sets the optional parameter 1187 // "alwaysIncludeBuildingFootprints": Flag indicating whether the 1188 // returned tile will always contain 2.5D footprints for structures. If 1189 // enabled_modeled_volumes is set, this will mean that structures will 1190 // have both their 3D models and 2.5D footprints returned. 1191 func (c *FeaturetilesGetCall) AlwaysIncludeBuildingFootprints(alwaysIncludeBuildingFootprints bool) *FeaturetilesGetCall { 1192 c.urlParams_.Set("alwaysIncludeBuildingFootprints", fmt.Sprint(alwaysIncludeBuildingFootprints)) 1193 return c 1194 } 1195 1196 // ClientInfoApiClient sets the optional parameter 1197 // "clientInfo.apiClient": API client name and version. For example, the 1198 // SDK calling the API. The exact format is up to the client. 1199 func (c *FeaturetilesGetCall) ClientInfoApiClient(clientInfoApiClient string) *FeaturetilesGetCall { 1200 c.urlParams_.Set("clientInfo.apiClient", clientInfoApiClient) 1201 return c 1202 } 1203 1204 // ClientInfoApplicationId sets the optional parameter 1205 // "clientInfo.applicationId": Application ID, such as the package name 1206 // on Android and the bundle identifier on iOS platforms. 1207 func (c *FeaturetilesGetCall) ClientInfoApplicationId(clientInfoApplicationId string) *FeaturetilesGetCall { 1208 c.urlParams_.Set("clientInfo.applicationId", clientInfoApplicationId) 1209 return c 1210 } 1211 1212 // ClientInfoApplicationVersion sets the optional parameter 1213 // "clientInfo.applicationVersion": Application version number, such as 1214 // "1.2.3". The exact format is application-dependent. 1215 func (c *FeaturetilesGetCall) ClientInfoApplicationVersion(clientInfoApplicationVersion string) *FeaturetilesGetCall { 1216 c.urlParams_.Set("clientInfo.applicationVersion", clientInfoApplicationVersion) 1217 return c 1218 } 1219 1220 // ClientInfoDeviceModel sets the optional parameter 1221 // "clientInfo.deviceModel": Device model as reported by the device. The 1222 // exact format is platform-dependent. 1223 func (c *FeaturetilesGetCall) ClientInfoDeviceModel(clientInfoDeviceModel string) *FeaturetilesGetCall { 1224 c.urlParams_.Set("clientInfo.deviceModel", clientInfoDeviceModel) 1225 return c 1226 } 1227 1228 // ClientInfoOperatingSystem sets the optional parameter 1229 // "clientInfo.operatingSystem": Operating system name and version as 1230 // reported by the OS. For example, "Mac OS X 10.10.4". The exact format 1231 // is platform-dependent. 1232 func (c *FeaturetilesGetCall) ClientInfoOperatingSystem(clientInfoOperatingSystem string) *FeaturetilesGetCall { 1233 c.urlParams_.Set("clientInfo.operatingSystem", clientInfoOperatingSystem) 1234 return c 1235 } 1236 1237 // ClientInfoPlatform sets the optional parameter "clientInfo.platform": 1238 // Platform where the application is running. 1239 // 1240 // Possible values: 1241 // 1242 // "PLATFORM_UNSPECIFIED" - Unspecified or unknown OS. 1243 // "EDITOR" - Development environment. 1244 // "MAC_OS" - macOS. 1245 // "WINDOWS" - Windows. 1246 // "LINUX" - Linux 1247 // "ANDROID" - Android 1248 // "IOS" - iOS 1249 // "WEB_GL" - WebGL. 1250 func (c *FeaturetilesGetCall) ClientInfoPlatform(clientInfoPlatform string) *FeaturetilesGetCall { 1251 c.urlParams_.Set("clientInfo.platform", clientInfoPlatform) 1252 return c 1253 } 1254 1255 // ClientInfoUserId sets the optional parameter "clientInfo.userId": 1256 // Required. A client-generated user ID. The ID should be generated and 1257 // persisted during the first user session or whenever a pre-existing ID 1258 // is not found. The exact format is up to the client. This must be 1259 // non-empty in a GetFeatureTileRequest (whether via the header or 1260 // GetFeatureTileRequest.client_info). 1261 func (c *FeaturetilesGetCall) ClientInfoUserId(clientInfoUserId string) *FeaturetilesGetCall { 1262 c.urlParams_.Set("clientInfo.userId", clientInfoUserId) 1263 return c 1264 } 1265 1266 // ClientTileVersionId sets the optional parameter 1267 // "clientTileVersionId": Optional version id identifying the tile that 1268 // is already in the client's cache. This field should be populated with 1269 // the most recent version_id value returned by the API for the 1270 // requested tile. If the version id is empty the server always returns 1271 // a newly rendered tile. If it is provided the server checks if the 1272 // tile contents would be identical to one that's already on the client, 1273 // and if so, returns a stripped-down response tile with 1274 // STATUS_OK_DATA_UNCHANGED instead. 1275 func (c *FeaturetilesGetCall) ClientTileVersionId(clientTileVersionId string) *FeaturetilesGetCall { 1276 c.urlParams_.Set("clientTileVersionId", clientTileVersionId) 1277 return c 1278 } 1279 1280 // EnableDetailedHighwayTypes sets the optional parameter 1281 // "enableDetailedHighwayTypes": Flag indicating whether detailed 1282 // highway types should be returned. If this is set, the 1283 // CONTROLLED_ACCESS_HIGHWAY type may be returned. If not, then these 1284 // highways will have the generic HIGHWAY type. This exists for 1285 // backwards compatibility reasons. 1286 func (c *FeaturetilesGetCall) EnableDetailedHighwayTypes(enableDetailedHighwayTypes bool) *FeaturetilesGetCall { 1287 c.urlParams_.Set("enableDetailedHighwayTypes", fmt.Sprint(enableDetailedHighwayTypes)) 1288 return c 1289 } 1290 1291 // EnableFeatureNames sets the optional parameter "enableFeatureNames": 1292 // Flag indicating whether human-readable names should be returned for 1293 // features. If this is set, the display_name field on the feature will 1294 // be filled out. 1295 func (c *FeaturetilesGetCall) EnableFeatureNames(enableFeatureNames bool) *FeaturetilesGetCall { 1296 c.urlParams_.Set("enableFeatureNames", fmt.Sprint(enableFeatureNames)) 1297 return c 1298 } 1299 1300 // EnableModeledVolumes sets the optional parameter 1301 // "enableModeledVolumes": Flag indicating whether 3D building models 1302 // should be enabled. If this is set structures will be returned as 3D 1303 // modeled volumes rather than 2.5D extruded areas where possible. 1304 func (c *FeaturetilesGetCall) EnableModeledVolumes(enableModeledVolumes bool) *FeaturetilesGetCall { 1305 c.urlParams_.Set("enableModeledVolumes", fmt.Sprint(enableModeledVolumes)) 1306 return c 1307 } 1308 1309 // EnablePoliticalFeatures sets the optional parameter 1310 // "enablePoliticalFeatures": Flag indicating whether political features 1311 // should be returned. 1312 func (c *FeaturetilesGetCall) EnablePoliticalFeatures(enablePoliticalFeatures bool) *FeaturetilesGetCall { 1313 c.urlParams_.Set("enablePoliticalFeatures", fmt.Sprint(enablePoliticalFeatures)) 1314 return c 1315 } 1316 1317 // EnablePrivateRoads sets the optional parameter "enablePrivateRoads": 1318 // Flag indicating whether the returned tile will contain road features 1319 // that are marked private. Private roads are indicated by the 1320 // Feature.segment_info.road_info.is_private field. 1321 func (c *FeaturetilesGetCall) EnablePrivateRoads(enablePrivateRoads bool) *FeaturetilesGetCall { 1322 c.urlParams_.Set("enablePrivateRoads", fmt.Sprint(enablePrivateRoads)) 1323 return c 1324 } 1325 1326 // EnableUnclippedBuildings sets the optional parameter 1327 // "enableUnclippedBuildings": Flag indicating whether unclipped 1328 // buildings should be returned. If this is set, building render ops 1329 // will extend beyond the tile boundary. Buildings will only be returned 1330 // on the tile that contains their centroid. 1331 func (c *FeaturetilesGetCall) EnableUnclippedBuildings(enableUnclippedBuildings bool) *FeaturetilesGetCall { 1332 c.urlParams_.Set("enableUnclippedBuildings", fmt.Sprint(enableUnclippedBuildings)) 1333 return c 1334 } 1335 1336 // LanguageCode sets the optional parameter "languageCode": Required. 1337 // The BCP-47 language code corresponding to the language in which the 1338 // name was requested, such as "en-US" or "sr-Latn". For more 1339 // information, see 1340 // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. 1341 func (c *FeaturetilesGetCall) LanguageCode(languageCode string) *FeaturetilesGetCall { 1342 c.urlParams_.Set("languageCode", languageCode) 1343 return c 1344 } 1345 1346 // RegionCode sets the optional parameter "regionCode": Required. The 1347 // Unicode country/region code (CLDR) of the location from which the 1348 // request is coming from, such as "US" and "419". For more information, 1349 // see http://www.unicode.org/reports/tr35/#unicode_region_subtag. 1350 func (c *FeaturetilesGetCall) RegionCode(regionCode string) *FeaturetilesGetCall { 1351 c.urlParams_.Set("regionCode", regionCode) 1352 return c 1353 } 1354 1355 // Fields allows partial responses to be retrieved. See 1356 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1357 // for more information. 1358 func (c *FeaturetilesGetCall) Fields(s ...googleapi.Field) *FeaturetilesGetCall { 1359 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1360 return c 1361 } 1362 1363 // IfNoneMatch sets the optional parameter which makes the operation 1364 // fail if the object's ETag matches the given value. This is useful for 1365 // getting updates only after the object has changed since the last 1366 // request. Use googleapi.IsNotModified to check whether the response 1367 // error from Do is the result of In-None-Match. 1368 func (c *FeaturetilesGetCall) IfNoneMatch(entityTag string) *FeaturetilesGetCall { 1369 c.ifNoneMatch_ = entityTag 1370 return c 1371 } 1372 1373 // Context sets the context to be used in this call's Do method. Any 1374 // pending HTTP request will be aborted if the provided context is 1375 // canceled. 1376 func (c *FeaturetilesGetCall) Context(ctx context.Context) *FeaturetilesGetCall { 1377 c.ctx_ = ctx 1378 return c 1379 } 1380 1381 // Header returns an http.Header that can be modified by the caller to 1382 // add HTTP headers to the request. 1383 func (c *FeaturetilesGetCall) Header() http.Header { 1384 if c.header_ == nil { 1385 c.header_ = make(http.Header) 1386 } 1387 return c.header_ 1388 } 1389 1390 func (c *FeaturetilesGetCall) doRequest(alt string) (*http.Response, error) { 1391 reqHeaders := make(http.Header) 1392 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210929") 1393 for k, v := range c.header_ { 1394 reqHeaders[k] = v 1395 } 1396 reqHeaders.Set("User-Agent", c.s.userAgent()) 1397 if c.ifNoneMatch_ != "" { 1398 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1399 } 1400 var body io.Reader = nil 1401 c.urlParams_.Set("alt", alt) 1402 c.urlParams_.Set("prettyPrint", "false") 1403 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 1404 urls += "?" + c.urlParams_.Encode() 1405 req, err := http.NewRequest("GET", urls, body) 1406 if err != nil { 1407 return nil, err 1408 } 1409 req.Header = reqHeaders 1410 googleapi.Expand(req.URL, map[string]string{ 1411 "name": c.name, 1412 }) 1413 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1414 } 1415 1416 // Do executes the "vectortile.featuretiles.get" call. 1417 // Exactly one of *FeatureTile or error will be non-nil. Any non-2xx 1418 // status code is an error. Response headers are in either 1419 // *FeatureTile.ServerResponse.Header or (if a response was returned at 1420 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 1421 // to check whether the returned error was because 1422 // http.StatusNotModified was returned. 1423 func (c *FeaturetilesGetCall) Do(opts ...googleapi.CallOption) (*FeatureTile, error) { 1424 gensupport.SetOptions(c.urlParams_, opts...) 1425 res, err := c.doRequest("json") 1426 if res != nil && res.StatusCode == http.StatusNotModified { 1427 if res.Body != nil { 1428 res.Body.Close() 1429 } 1430 return nil, &googleapi.Error{ 1431 Code: res.StatusCode, 1432 Header: res.Header, 1433 } 1434 } 1435 if err != nil { 1436 return nil, err 1437 } 1438 defer googleapi.CloseBody(res) 1439 if err := googleapi.CheckResponse(res); err != nil { 1440 return nil, err 1441 } 1442 ret := &FeatureTile{ 1443 ServerResponse: googleapi.ServerResponse{ 1444 Header: res.Header, 1445 HTTPStatusCode: res.StatusCode, 1446 }, 1447 } 1448 target := &ret 1449 if err := gensupport.DecodeResponse(target, res); err != nil { 1450 return nil, err 1451 } 1452 return ret, nil 1453 // { 1454 // "description": "Gets a feature tile by its tile resource name.", 1455 // "flatPath": "v1/featuretiles/{featuretilesId}", 1456 // "httpMethod": "GET", 1457 // "id": "vectortile.featuretiles.get", 1458 // "parameterOrder": [ 1459 // "name" 1460 // ], 1461 // "parameters": { 1462 // "alwaysIncludeBuildingFootprints": { 1463 // "description": "Flag indicating whether the returned tile will always contain 2.5D footprints for structures. If enabled_modeled_volumes is set, this will mean that structures will have both their 3D models and 2.5D footprints returned.", 1464 // "location": "query", 1465 // "type": "boolean" 1466 // }, 1467 // "clientInfo.apiClient": { 1468 // "description": "API client name and version. For example, the SDK calling the API. The exact format is up to the client.", 1469 // "location": "query", 1470 // "type": "string" 1471 // }, 1472 // "clientInfo.applicationId": { 1473 // "description": "Application ID, such as the package name on Android and the bundle identifier on iOS platforms.", 1474 // "location": "query", 1475 // "type": "string" 1476 // }, 1477 // "clientInfo.applicationVersion": { 1478 // "description": "Application version number, such as \"1.2.3\". The exact format is application-dependent.", 1479 // "location": "query", 1480 // "type": "string" 1481 // }, 1482 // "clientInfo.deviceModel": { 1483 // "description": "Device model as reported by the device. The exact format is platform-dependent.", 1484 // "location": "query", 1485 // "type": "string" 1486 // }, 1487 // "clientInfo.operatingSystem": { 1488 // "description": "Operating system name and version as reported by the OS. For example, \"Mac OS X 10.10.4\". The exact format is platform-dependent.", 1489 // "location": "query", 1490 // "type": "string" 1491 // }, 1492 // "clientInfo.platform": { 1493 // "description": "Platform where the application is running.", 1494 // "enum": [ 1495 // "PLATFORM_UNSPECIFIED", 1496 // "EDITOR", 1497 // "MAC_OS", 1498 // "WINDOWS", 1499 // "LINUX", 1500 // "ANDROID", 1501 // "IOS", 1502 // "WEB_GL" 1503 // ], 1504 // "enumDescriptions": [ 1505 // "Unspecified or unknown OS.", 1506 // "Development environment.", 1507 // "macOS.", 1508 // "Windows.", 1509 // "Linux", 1510 // "Android", 1511 // "iOS", 1512 // "WebGL." 1513 // ], 1514 // "location": "query", 1515 // "type": "string" 1516 // }, 1517 // "clientInfo.userId": { 1518 // "description": "Required. A client-generated user ID. The ID should be generated and persisted during the first user session or whenever a pre-existing ID is not found. The exact format is up to the client. This must be non-empty in a GetFeatureTileRequest (whether via the header or GetFeatureTileRequest.client_info).", 1519 // "location": "query", 1520 // "type": "string" 1521 // }, 1522 // "clientTileVersionId": { 1523 // "description": "Optional version id identifying the tile that is already in the client's cache. This field should be populated with the most recent version_id value returned by the API for the requested tile. If the version id is empty the server always returns a newly rendered tile. If it is provided the server checks if the tile contents would be identical to one that's already on the client, and if so, returns a stripped-down response tile with STATUS_OK_DATA_UNCHANGED instead.", 1524 // "location": "query", 1525 // "type": "string" 1526 // }, 1527 // "enableDetailedHighwayTypes": { 1528 // "description": "Flag indicating whether detailed highway types should be returned. If this is set, the CONTROLLED_ACCESS_HIGHWAY type may be returned. If not, then these highways will have the generic HIGHWAY type. This exists for backwards compatibility reasons.", 1529 // "location": "query", 1530 // "type": "boolean" 1531 // }, 1532 // "enableFeatureNames": { 1533 // "description": "Flag indicating whether human-readable names should be returned for features. If this is set, the display_name field on the feature will be filled out.", 1534 // "location": "query", 1535 // "type": "boolean" 1536 // }, 1537 // "enableModeledVolumes": { 1538 // "description": "Flag indicating whether 3D building models should be enabled. If this is set structures will be returned as 3D modeled volumes rather than 2.5D extruded areas where possible.", 1539 // "location": "query", 1540 // "type": "boolean" 1541 // }, 1542 // "enablePoliticalFeatures": { 1543 // "description": "Flag indicating whether political features should be returned.", 1544 // "location": "query", 1545 // "type": "boolean" 1546 // }, 1547 // "enablePrivateRoads": { 1548 // "description": "Flag indicating whether the returned tile will contain road features that are marked private. Private roads are indicated by the Feature.segment_info.road_info.is_private field.", 1549 // "location": "query", 1550 // "type": "boolean" 1551 // }, 1552 // "enableUnclippedBuildings": { 1553 // "description": "Flag indicating whether unclipped buildings should be returned. If this is set, building render ops will extend beyond the tile boundary. Buildings will only be returned on the tile that contains their centroid.", 1554 // "location": "query", 1555 // "type": "boolean" 1556 // }, 1557 // "languageCode": { 1558 // "description": "Required. The BCP-47 language code corresponding to the language in which the name was requested, such as \"en-US\" or \"sr-Latn\". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.", 1559 // "location": "query", 1560 // "type": "string" 1561 // }, 1562 // "name": { 1563 // "description": "Required. Resource name of the tile. The tile resource name is prefixed by its collection ID `tiles/` followed by the resource ID, which encodes the tile's global x and y coordinates and zoom level as `@,,z`. For example, `tiles/@1,2,3z`.", 1564 // "location": "path", 1565 // "pattern": "^featuretiles/[^/]+$", 1566 // "required": true, 1567 // "type": "string" 1568 // }, 1569 // "regionCode": { 1570 // "description": "Required. The Unicode country/region code (CLDR) of the location from which the request is coming from, such as \"US\" and \"419\". For more information, see http://www.unicode.org/reports/tr35/#unicode_region_subtag.", 1571 // "location": "query", 1572 // "type": "string" 1573 // } 1574 // }, 1575 // "path": "v1/{+name}", 1576 // "response": { 1577 // "$ref": "FeatureTile" 1578 // } 1579 // } 1580 1581 } 1582 1583 // method id "vectortile.terraintiles.get": 1584 1585 type TerraintilesGetCall struct { 1586 s *Service 1587 name string 1588 urlParams_ gensupport.URLParams 1589 ifNoneMatch_ string 1590 ctx_ context.Context 1591 header_ http.Header 1592 } 1593 1594 // Get: Gets a terrain tile by its tile resource name. 1595 // 1596 // - name: Resource name of the tile. The tile resource name is prefixed 1597 // by its collection ID `terraintiles/` followed by the resource ID, 1598 // which encodes the tile's global x and y coordinates and zoom level 1599 // as `@,,z`. For example, `terraintiles/@1,2,3z`. 1600 func (r *TerraintilesService) Get(name string) *TerraintilesGetCall { 1601 c := &TerraintilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1602 c.name = name 1603 return c 1604 } 1605 1606 // AltitudePrecisionCentimeters sets the optional parameter 1607 // "altitudePrecisionCentimeters": The precision of terrain altitudes in 1608 // centimeters. Possible values: between 1 (cm level precision) and 1609 // 1,000,000 (10-kilometer level precision). 1610 func (c *TerraintilesGetCall) AltitudePrecisionCentimeters(altitudePrecisionCentimeters int64) *TerraintilesGetCall { 1611 c.urlParams_.Set("altitudePrecisionCentimeters", fmt.Sprint(altitudePrecisionCentimeters)) 1612 return c 1613 } 1614 1615 // ClientInfoApiClient sets the optional parameter 1616 // "clientInfo.apiClient": API client name and version. For example, the 1617 // SDK calling the API. The exact format is up to the client. 1618 func (c *TerraintilesGetCall) ClientInfoApiClient(clientInfoApiClient string) *TerraintilesGetCall { 1619 c.urlParams_.Set("clientInfo.apiClient", clientInfoApiClient) 1620 return c 1621 } 1622 1623 // ClientInfoApplicationId sets the optional parameter 1624 // "clientInfo.applicationId": Application ID, such as the package name 1625 // on Android and the bundle identifier on iOS platforms. 1626 func (c *TerraintilesGetCall) ClientInfoApplicationId(clientInfoApplicationId string) *TerraintilesGetCall { 1627 c.urlParams_.Set("clientInfo.applicationId", clientInfoApplicationId) 1628 return c 1629 } 1630 1631 // ClientInfoApplicationVersion sets the optional parameter 1632 // "clientInfo.applicationVersion": Application version number, such as 1633 // "1.2.3". The exact format is application-dependent. 1634 func (c *TerraintilesGetCall) ClientInfoApplicationVersion(clientInfoApplicationVersion string) *TerraintilesGetCall { 1635 c.urlParams_.Set("clientInfo.applicationVersion", clientInfoApplicationVersion) 1636 return c 1637 } 1638 1639 // ClientInfoDeviceModel sets the optional parameter 1640 // "clientInfo.deviceModel": Device model as reported by the device. The 1641 // exact format is platform-dependent. 1642 func (c *TerraintilesGetCall) ClientInfoDeviceModel(clientInfoDeviceModel string) *TerraintilesGetCall { 1643 c.urlParams_.Set("clientInfo.deviceModel", clientInfoDeviceModel) 1644 return c 1645 } 1646 1647 // ClientInfoOperatingSystem sets the optional parameter 1648 // "clientInfo.operatingSystem": Operating system name and version as 1649 // reported by the OS. For example, "Mac OS X 10.10.4". The exact format 1650 // is platform-dependent. 1651 func (c *TerraintilesGetCall) ClientInfoOperatingSystem(clientInfoOperatingSystem string) *TerraintilesGetCall { 1652 c.urlParams_.Set("clientInfo.operatingSystem", clientInfoOperatingSystem) 1653 return c 1654 } 1655 1656 // ClientInfoPlatform sets the optional parameter "clientInfo.platform": 1657 // Platform where the application is running. 1658 // 1659 // Possible values: 1660 // 1661 // "PLATFORM_UNSPECIFIED" - Unspecified or unknown OS. 1662 // "EDITOR" - Development environment. 1663 // "MAC_OS" - macOS. 1664 // "WINDOWS" - Windows. 1665 // "LINUX" - Linux 1666 // "ANDROID" - Android 1667 // "IOS" - iOS 1668 // "WEB_GL" - WebGL. 1669 func (c *TerraintilesGetCall) ClientInfoPlatform(clientInfoPlatform string) *TerraintilesGetCall { 1670 c.urlParams_.Set("clientInfo.platform", clientInfoPlatform) 1671 return c 1672 } 1673 1674 // ClientInfoUserId sets the optional parameter "clientInfo.userId": 1675 // Required. A client-generated user ID. The ID should be generated and 1676 // persisted during the first user session or whenever a pre-existing ID 1677 // is not found. The exact format is up to the client. This must be 1678 // non-empty in a GetFeatureTileRequest (whether via the header or 1679 // GetFeatureTileRequest.client_info). 1680 func (c *TerraintilesGetCall) ClientInfoUserId(clientInfoUserId string) *TerraintilesGetCall { 1681 c.urlParams_.Set("clientInfo.userId", clientInfoUserId) 1682 return c 1683 } 1684 1685 // MaxElevationResolutionCells sets the optional parameter 1686 // "maxElevationResolutionCells": The maximum allowed resolution for the 1687 // returned elevation heightmap. Possible values: between 1 and 1024 1688 // (and not less than min_elevation_resolution_cells). Over-sized 1689 // heightmaps will be non-uniformly down-sampled such that each edge is 1690 // no longer than this value. Non-uniformity is chosen to maximise the 1691 // amount of preserved data. For example: Original resolution: 100px 1692 // (width) * 30px (height) max_elevation_resolution: 30 New resolution: 1693 // 30px (width) * 30px (height) 1694 func (c *TerraintilesGetCall) MaxElevationResolutionCells(maxElevationResolutionCells int64) *TerraintilesGetCall { 1695 c.urlParams_.Set("maxElevationResolutionCells", fmt.Sprint(maxElevationResolutionCells)) 1696 return c 1697 } 1698 1699 // MinElevationResolutionCells sets the optional parameter 1700 // "minElevationResolutionCells": api-linter: 1701 // core::0131::request-unknown-fields=disabled aip.dev/not-precedent: 1702 // Maintaining existing request parameter pattern. The minimum allowed 1703 // resolution for the returned elevation heightmap. Possible values: 1704 // between 0 and 1024 (and not more than 1705 // max_elevation_resolution_cells). Zero is supported for backward 1706 // compatibility. Under-sized heightmaps will be non-uniformly 1707 // up-sampled such that each edge is no shorter than this value. 1708 // Non-uniformity is chosen to maximise the amount of preserved data. 1709 // For example: Original resolution: 30px (width) * 10px (height) 1710 // min_elevation_resolution: 30 New resolution: 30px (width) * 30px 1711 // (height) 1712 func (c *TerraintilesGetCall) MinElevationResolutionCells(minElevationResolutionCells int64) *TerraintilesGetCall { 1713 c.urlParams_.Set("minElevationResolutionCells", fmt.Sprint(minElevationResolutionCells)) 1714 return c 1715 } 1716 1717 // TerrainFormats sets the optional parameter "terrainFormats": Terrain 1718 // formats that the client understands. 1719 // 1720 // Possible values: 1721 // 1722 // "TERRAIN_FORMAT_UNKNOWN" - An unknown or unspecified terrain 1723 // 1724 // format. 1725 // 1726 // "FIRST_DERIVATIVE" - Terrain elevation data encoded as a 1727 // 1728 // FirstDerivativeElevationGrid. . 1729 // 1730 // "SECOND_DERIVATIVE" - Terrain elevation data encoded as a 1731 // 1732 // SecondDerivativeElevationGrid. 1733 func (c *TerraintilesGetCall) TerrainFormats(terrainFormats ...string) *TerraintilesGetCall { 1734 c.urlParams_.SetMulti("terrainFormats", append([]string{}, terrainFormats...)) 1735 return c 1736 } 1737 1738 // Fields allows partial responses to be retrieved. See 1739 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1740 // for more information. 1741 func (c *TerraintilesGetCall) Fields(s ...googleapi.Field) *TerraintilesGetCall { 1742 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1743 return c 1744 } 1745 1746 // IfNoneMatch sets the optional parameter which makes the operation 1747 // fail if the object's ETag matches the given value. This is useful for 1748 // getting updates only after the object has changed since the last 1749 // request. Use googleapi.IsNotModified to check whether the response 1750 // error from Do is the result of In-None-Match. 1751 func (c *TerraintilesGetCall) IfNoneMatch(entityTag string) *TerraintilesGetCall { 1752 c.ifNoneMatch_ = entityTag 1753 return c 1754 } 1755 1756 // Context sets the context to be used in this call's Do method. Any 1757 // pending HTTP request will be aborted if the provided context is 1758 // canceled. 1759 func (c *TerraintilesGetCall) Context(ctx context.Context) *TerraintilesGetCall { 1760 c.ctx_ = ctx 1761 return c 1762 } 1763 1764 // Header returns an http.Header that can be modified by the caller to 1765 // add HTTP headers to the request. 1766 func (c *TerraintilesGetCall) Header() http.Header { 1767 if c.header_ == nil { 1768 c.header_ = make(http.Header) 1769 } 1770 return c.header_ 1771 } 1772 1773 func (c *TerraintilesGetCall) doRequest(alt string) (*http.Response, error) { 1774 reqHeaders := make(http.Header) 1775 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210929") 1776 for k, v := range c.header_ { 1777 reqHeaders[k] = v 1778 } 1779 reqHeaders.Set("User-Agent", c.s.userAgent()) 1780 if c.ifNoneMatch_ != "" { 1781 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1782 } 1783 var body io.Reader = nil 1784 c.urlParams_.Set("alt", alt) 1785 c.urlParams_.Set("prettyPrint", "false") 1786 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 1787 urls += "?" + c.urlParams_.Encode() 1788 req, err := http.NewRequest("GET", urls, body) 1789 if err != nil { 1790 return nil, err 1791 } 1792 req.Header = reqHeaders 1793 googleapi.Expand(req.URL, map[string]string{ 1794 "name": c.name, 1795 }) 1796 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1797 } 1798 1799 // Do executes the "vectortile.terraintiles.get" call. 1800 // Exactly one of *TerrainTile or error will be non-nil. Any non-2xx 1801 // status code is an error. Response headers are in either 1802 // *TerrainTile.ServerResponse.Header or (if a response was returned at 1803 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 1804 // to check whether the returned error was because 1805 // http.StatusNotModified was returned. 1806 func (c *TerraintilesGetCall) Do(opts ...googleapi.CallOption) (*TerrainTile, error) { 1807 gensupport.SetOptions(c.urlParams_, opts...) 1808 res, err := c.doRequest("json") 1809 if res != nil && res.StatusCode == http.StatusNotModified { 1810 if res.Body != nil { 1811 res.Body.Close() 1812 } 1813 return nil, &googleapi.Error{ 1814 Code: res.StatusCode, 1815 Header: res.Header, 1816 } 1817 } 1818 if err != nil { 1819 return nil, err 1820 } 1821 defer googleapi.CloseBody(res) 1822 if err := googleapi.CheckResponse(res); err != nil { 1823 return nil, err 1824 } 1825 ret := &TerrainTile{ 1826 ServerResponse: googleapi.ServerResponse{ 1827 Header: res.Header, 1828 HTTPStatusCode: res.StatusCode, 1829 }, 1830 } 1831 target := &ret 1832 if err := gensupport.DecodeResponse(target, res); err != nil { 1833 return nil, err 1834 } 1835 return ret, nil 1836 // { 1837 // "description": "Gets a terrain tile by its tile resource name.", 1838 // "flatPath": "v1/terraintiles/{terraintilesId}", 1839 // "httpMethod": "GET", 1840 // "id": "vectortile.terraintiles.get", 1841 // "parameterOrder": [ 1842 // "name" 1843 // ], 1844 // "parameters": { 1845 // "altitudePrecisionCentimeters": { 1846 // "description": "The precision of terrain altitudes in centimeters. Possible values: between 1 (cm level precision) and 1,000,000 (10-kilometer level precision).", 1847 // "format": "int32", 1848 // "location": "query", 1849 // "type": "integer" 1850 // }, 1851 // "clientInfo.apiClient": { 1852 // "description": "API client name and version. For example, the SDK calling the API. The exact format is up to the client.", 1853 // "location": "query", 1854 // "type": "string" 1855 // }, 1856 // "clientInfo.applicationId": { 1857 // "description": "Application ID, such as the package name on Android and the bundle identifier on iOS platforms.", 1858 // "location": "query", 1859 // "type": "string" 1860 // }, 1861 // "clientInfo.applicationVersion": { 1862 // "description": "Application version number, such as \"1.2.3\". The exact format is application-dependent.", 1863 // "location": "query", 1864 // "type": "string" 1865 // }, 1866 // "clientInfo.deviceModel": { 1867 // "description": "Device model as reported by the device. The exact format is platform-dependent.", 1868 // "location": "query", 1869 // "type": "string" 1870 // }, 1871 // "clientInfo.operatingSystem": { 1872 // "description": "Operating system name and version as reported by the OS. For example, \"Mac OS X 10.10.4\". The exact format is platform-dependent.", 1873 // "location": "query", 1874 // "type": "string" 1875 // }, 1876 // "clientInfo.platform": { 1877 // "description": "Platform where the application is running.", 1878 // "enum": [ 1879 // "PLATFORM_UNSPECIFIED", 1880 // "EDITOR", 1881 // "MAC_OS", 1882 // "WINDOWS", 1883 // "LINUX", 1884 // "ANDROID", 1885 // "IOS", 1886 // "WEB_GL" 1887 // ], 1888 // "enumDescriptions": [ 1889 // "Unspecified or unknown OS.", 1890 // "Development environment.", 1891 // "macOS.", 1892 // "Windows.", 1893 // "Linux", 1894 // "Android", 1895 // "iOS", 1896 // "WebGL." 1897 // ], 1898 // "location": "query", 1899 // "type": "string" 1900 // }, 1901 // "clientInfo.userId": { 1902 // "description": "Required. A client-generated user ID. The ID should be generated and persisted during the first user session or whenever a pre-existing ID is not found. The exact format is up to the client. This must be non-empty in a GetFeatureTileRequest (whether via the header or GetFeatureTileRequest.client_info).", 1903 // "location": "query", 1904 // "type": "string" 1905 // }, 1906 // "maxElevationResolutionCells": { 1907 // "description": "The maximum allowed resolution for the returned elevation heightmap. Possible values: between 1 and 1024 (and not less than min_elevation_resolution_cells). Over-sized heightmaps will be non-uniformly down-sampled such that each edge is no longer than this value. Non-uniformity is chosen to maximise the amount of preserved data. For example: Original resolution: 100px (width) * 30px (height) max_elevation_resolution: 30 New resolution: 30px (width) * 30px (height)", 1908 // "format": "int32", 1909 // "location": "query", 1910 // "type": "integer" 1911 // }, 1912 // "minElevationResolutionCells": { 1913 // "description": " api-linter: core::0131::request-unknown-fields=disabled aip.dev/not-precedent: Maintaining existing request parameter pattern. The minimum allowed resolution for the returned elevation heightmap. Possible values: between 0 and 1024 (and not more than max_elevation_resolution_cells). Zero is supported for backward compatibility. Under-sized heightmaps will be non-uniformly up-sampled such that each edge is no shorter than this value. Non-uniformity is chosen to maximise the amount of preserved data. For example: Original resolution: 30px (width) * 10px (height) min_elevation_resolution: 30 New resolution: 30px (width) * 30px (height)", 1914 // "format": "int32", 1915 // "location": "query", 1916 // "type": "integer" 1917 // }, 1918 // "name": { 1919 // "description": "Required. Resource name of the tile. The tile resource name is prefixed by its collection ID `terraintiles/` followed by the resource ID, which encodes the tile's global x and y coordinates and zoom level as `@,,z`. For example, `terraintiles/@1,2,3z`.", 1920 // "location": "path", 1921 // "pattern": "^terraintiles/[^/]+$", 1922 // "required": true, 1923 // "type": "string" 1924 // }, 1925 // "terrainFormats": { 1926 // "description": "Terrain formats that the client understands.", 1927 // "enum": [ 1928 // "TERRAIN_FORMAT_UNKNOWN", 1929 // "FIRST_DERIVATIVE", 1930 // "SECOND_DERIVATIVE" 1931 // ], 1932 // "enumDescriptions": [ 1933 // "An unknown or unspecified terrain format.", 1934 // "Terrain elevation data encoded as a FirstDerivativeElevationGrid. .", 1935 // "Terrain elevation data encoded as a SecondDerivativeElevationGrid." 1936 // ], 1937 // "location": "query", 1938 // "repeated": true, 1939 // "type": "string" 1940 // } 1941 // }, 1942 // "path": "v1/{+name}", 1943 // "response": { 1944 // "$ref": "TerrainTile" 1945 // } 1946 // } 1947 1948 } 1949