Package mapmanagement is an auto-generated package for the Map Management API.
The Map Management API is a RESTful service that accepts HTTP requests for map styling data through a variety of methods. It returns formatted configuration data about map styling resources so that you can programmatically manage your Cloud-based map styles.
NOTE: This package is in beta. It is not stable, and may be subject to changes.
General documentation
For information that is relevant for all client libraries please reference https://pkg.go.dev/cloud.google.com/go#pkg-overview. Some information on this page includes:
- Authentication and Authorization
- Timeouts and Cancellation
- Testing against Client Libraries
- Debugging Client Libraries
- Inspecting errors
Example usage
To get started with this package, create a client.
// go get cloud.google.com/go/maps/mapmanagement/apiv2beta@latest ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := mapmanagement.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close()
The client will use your default application credentials. Clients should be reused instead of created as needed. The methods of Client are safe for concurrent use by multiple goroutines. The returned client must be Closed when it is done being used.
Using the Client
The following is an example of making an API call with the newly created client, mentioned above.
req := &mapmanagementpb.CreateMapConfigRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/maps/mapmanagement/apiv2beta/mapmanagementpb#CreateMapConfigRequest. } resp, err := c.CreateMapConfig(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp
Use of Context
The ctx passed to NewClient is used for authentication requests and for creating the underlying connection, but is not used for subsequent calls. Individual methods on the client use the ctx given to them.
To close the open connection, use the Close() method.
Functions
func DefaultAuthScopes
func DefaultAuthScopes() []stringDefaultAuthScopes reports the default set of authentication scopes to use with this package.
CallOptions
type CallOptions struct {
CreateMapConfig []gax.CallOption
GetMapConfig []gax.CallOption
ListMapConfigs []gax.CallOption
UpdateMapConfig []gax.CallOption
DeleteMapConfig []gax.CallOption
CreateStyleConfig []gax.CallOption
GetStyleConfig []gax.CallOption
ListStyleConfigs []gax.CallOption
UpdateStyleConfig []gax.CallOption
DeleteStyleConfig []gax.CallOption
CreateMapContextConfig []gax.CallOption
GetMapContextConfig []gax.CallOption
ListMapContextConfigs []gax.CallOption
UpdateMapContextConfig []gax.CallOption
DeleteMapContextConfig []gax.CallOption
}CallOptions contains the retry settings for each method of Client.
Client
type Client struct {
// The call options for this service.
CallOptions *CallOptions
// contains filtered or unexported fields
}Client is a client for interacting with Map Management API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The Map Management API uses your inputs to create and manage Google Cloud based styling resources for Google Maps.
Using this API, you can can create and manage MapConfigs (Map IDs), StyleConfigs (JSON-based styling), and MapContextConfigs (associations between styles, datasets, and map variants).
This API offers features through three channels:
v2alpha: Experimental features.
v2beta: Preview features, recommended for early adoption.
v2: General Availability (GA) features.
Capabilities described here are generally available across both the v2alpha and v2beta endpoints.
func NewClient
NewClient creates a new map management client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
The Map Management API uses your inputs to create and manage Google Cloud based styling resources for Google Maps.
Using this API, you can can create and manage MapConfigs (Map IDs), StyleConfigs (JSON-based styling), and MapContextConfigs (associations between styles, datasets, and map variants).
This API offers features through three channels:
v2alpha: Experimental features.
v2beta: Preview features, recommended for early adoption.
v2: General Availability (GA) features.
Capabilities described here are generally available across both the v2alpha and v2beta endpoints.
Example
package main
import (
"context"
mapmanagement "cloud.google.com/go/maps/mapmanagement/apiv2beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := mapmanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewRESTClient
NewRESTClient creates a new map management rest client.
The Map Management API uses your inputs to create and manage Google Cloud based styling resources for Google Maps.
Using this API, you can can create and manage MapConfigs (Map IDs), StyleConfigs (JSON-based styling), and MapContextConfigs (associations between styles, datasets, and map variants).
This API offers features through three channels:
v2alpha: Experimental features.
v2beta: Preview features, recommended for early adoption.
v2: General Availability (GA) features.
Capabilities described here are generally available across both the v2alpha and v2beta endpoints.
Example
package main
import (
"context"
mapmanagement "cloud.google.com/go/maps/mapmanagement/apiv2beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := mapmanagement.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*Client) Close
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*Client) Connection (deprecated)
func (c *Client) Connection() *grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*Client) CreateMapConfig
func (c *Client) CreateMapConfig(ctx context.Context, req *mapmanagementpb.CreateMapConfigRequest, opts ...gax.CallOption) (*mapmanagementpb.MapConfig, error)CreateMapConfig creates a MapConfig in a project.
Example
package main
import (
"context"
mapmanagement "cloud.google.com/go/maps/mapmanagement/apiv2beta"
mapmanagementpb "cloud.google.com/go/maps/mapmanagement/apiv2beta/mapmanagementpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := mapmanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &mapmanagementpb.CreateMapConfigRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/maps/mapmanagement/apiv2beta/mapmanagementpb#CreateMapConfigRequest.
}
resp, err := c.CreateMapConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) CreateMapContextConfig
func (c *Client) CreateMapContextConfig(ctx context.Context, req *mapmanagementpb.CreateMapContextConfigRequest, opts ...gax.CallOption) (*mapmanagementpb.MapContextConfig, error)CreateMapContextConfig creates a MapContextConfig.
Example
package main
import (
"context"
mapmanagement "cloud.google.com/go/maps/mapmanagement/apiv2beta"
mapmanagementpb "cloud.google.com/go/maps/mapmanagement/apiv2beta/mapmanagementpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := mapmanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &mapmanagementpb.CreateMapContextConfigRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/maps/mapmanagement/apiv2beta/mapmanagementpb#CreateMapContextConfigRequest.
}
resp, err := c.CreateMapContextConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) CreateStyleConfig
func (c *Client) CreateStyleConfig(ctx context.Context, req *mapmanagementpb.CreateStyleConfigRequest, opts ...gax.CallOption) (*mapmanagementpb.StyleConfig, error)CreateStyleConfig creates a StyleConfig.
Example
package main
import (
"context"
mapmanagement "cloud.google.com/go/maps/mapmanagement/apiv2beta"
mapmanagementpb "cloud.google.com/go/maps/mapmanagement/apiv2beta/mapmanagementpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := mapmanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &mapmanagementpb.CreateStyleConfigRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/maps/mapmanagement/apiv2beta/mapmanagementpb#CreateStyleConfigRequest.
}
resp, err := c.CreateStyleConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) DeleteMapConfig
func (c *Client) DeleteMapConfig(ctx context.Context, req *mapmanagementpb.DeleteMapConfigRequest, opts ...gax.CallOption) errorDeleteMapConfig deletes a MapConfig.
Example
package main
import (
"context"
mapmanagement "cloud.google.com/go/maps/mapmanagement/apiv2beta"
mapmanagementpb "cloud.google.com/go/maps/mapmanagement/apiv2beta/mapmanagementpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := mapmanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &mapmanagementpb.DeleteMapConfigRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/maps/mapmanagement/apiv2beta/mapmanagementpb#DeleteMapConfigRequest.
}
err = c.DeleteMapConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*Client) DeleteMapContextConfig
func (c *Client) DeleteMapContextConfig(ctx context.Context, req *mapmanagementpb.DeleteMapContextConfigRequest, opts ...gax.CallOption) errorDeleteMapContextConfig deletes a MapContextConfig.
Example
package main
import (
"context"
mapmanagement "cloud.google.com/go/maps/mapmanagement/apiv2beta"
mapmanagementpb "cloud.google.com/go/maps/mapmanagement/apiv2beta/mapmanagementpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := mapmanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &mapmanagementpb.DeleteMapContextConfigRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/maps/mapmanagement/apiv2beta/mapmanagementpb#DeleteMapContextConfigRequest.
}
err = c.DeleteMapContextConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*Client) DeleteStyleConfig
func (c *Client) DeleteStyleConfig(ctx context.Context, req *mapmanagementpb.DeleteStyleConfigRequest, opts ...gax.CallOption) errorDeleteStyleConfig deletes a StyleConfig.
Example
package main
import (
"context"
mapmanagement "cloud.google.com/go/maps/mapmanagement/apiv2beta"
mapmanagementpb "cloud.google.com/go/maps/mapmanagement/apiv2beta/mapmanagementpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := mapmanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &mapmanagementpb.DeleteStyleConfigRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/maps/mapmanagement/apiv2beta/mapmanagementpb#DeleteStyleConfigRequest.
}
err = c.DeleteStyleConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*Client) GetMapConfig
func (c *Client) GetMapConfig(ctx context.Context, req *mapmanagementpb.GetMapConfigRequest, opts ...gax.CallOption) (*mapmanagementpb.MapConfig, error)GetMapConfig gets a MapConfig.
Example
package main
import (
"context"
mapmanagement "cloud.google.com/go/maps/mapmanagement/apiv2beta"
mapmanagementpb "cloud.google.com/go/maps/mapmanagement/apiv2beta/mapmanagementpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := mapmanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &mapmanagementpb.GetMapConfigRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/maps/mapmanagement/apiv2beta/mapmanagementpb#GetMapConfigRequest.
}
resp, err := c.GetMapConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) GetMapContextConfig
func (c *Client) GetMapContextConfig(ctx context.Context, req *mapmanagementpb.GetMapContextConfigRequest, opts ...gax.CallOption) (*mapmanagementpb.MapContextConfig, error)GetMapContextConfig gets a MapContextConfig.
Example
package main
import (
"context"
mapmanagement "cloud.google.com/go/maps/mapmanagement/apiv2beta"
mapmanagementpb "cloud.google.com/go/maps/mapmanagement/apiv2beta/mapmanagementpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := mapmanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &mapmanagementpb.GetMapContextConfigRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/maps/mapmanagement/apiv2beta/mapmanagementpb#GetMapContextConfigRequest.
}
resp, err := c.GetMapContextConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) GetStyleConfig
func (c *Client) GetStyleConfig(ctx context.Context, req *mapmanagementpb.GetStyleConfigRequest, opts ...gax.CallOption) (*mapmanagementpb.StyleConfig, error)GetStyleConfig gets a StyleConfig.
Example
package main
import (
"context"
mapmanagement "cloud.google.com/go/maps/mapmanagement/apiv2beta"
mapmanagementpb "cloud.google.com/go/maps/mapmanagement/apiv2beta/mapmanagementpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := mapmanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &mapmanagementpb.GetStyleConfigRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/maps/mapmanagement/apiv2beta/mapmanagementpb#GetStyleConfigRequest.
}
resp, err := c.GetStyleConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) ListMapConfigs
func (c *Client) ListMapConfigs(ctx context.Context, req *mapmanagementpb.ListMapConfigsRequest, opts ...gax.CallOption) *MapConfigIteratorListMapConfigs lists MapConfigs for a project.
Examples
package main
import (
"context"
mapmanagement "cloud.google.com/go/maps/mapmanagement/apiv2beta"
mapmanagementpb "cloud.google.com/go/maps/mapmanagement/apiv2beta/mapmanagementpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := mapmanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &mapmanagementpb.ListMapConfigsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/maps/mapmanagement/apiv2beta/mapmanagementpb#ListMapConfigsRequest.
}
it := c.ListMapConfigs(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*mapmanagementpb.ListMapConfigsResponse)
}
}
all
package main
import (
"context"
mapmanagement "cloud.google.com/go/maps/mapmanagement/apiv2beta"
mapmanagementpb "cloud.google.com/go/maps/mapmanagement/apiv2beta/mapmanagementpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := mapmanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &mapmanagementpb.ListMapConfigsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/maps/mapmanagement/apiv2beta/mapmanagementpb#ListMapConfigsRequest.
}
for resp, err := range c.ListMapConfigs(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*Client) ListMapContextConfigs
func (c *Client) ListMapContextConfigs(ctx context.Context, req *mapmanagementpb.ListMapContextConfigsRequest, opts ...gax.CallOption) *MapContextConfigIteratorListMapContextConfigs lists MapContextConfigs.
Examples
package main
import (
"context"
mapmanagement "cloud.google.com/go/maps/mapmanagement/apiv2beta"
mapmanagementpb "cloud.google.com/go/maps/mapmanagement/apiv2beta/mapmanagementpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := mapmanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &mapmanagementpb.ListMapContextConfigsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/maps/mapmanagement/apiv2beta/mapmanagementpb#ListMapContextConfigsRequest.
}
it := c.ListMapContextConfigs(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*mapmanagementpb.ListMapContextConfigsResponse)
}
}
all
package main
import (
"context"
mapmanagement "cloud.google.com/go/maps/mapmanagement/apiv2beta"
mapmanagementpb "cloud.google.com/go/maps/mapmanagement/apiv2beta/mapmanagementpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := mapmanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &mapmanagementpb.ListMapContextConfigsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/maps/mapmanagement/apiv2beta/mapmanagementpb#ListMapContextConfigsRequest.
}
for resp, err := range c.ListMapContextConfigs(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*Client) ListStyleConfigs
func (c *Client) ListStyleConfigs(ctx context.Context, req *mapmanagementpb.ListStyleConfigsRequest, opts ...gax.CallOption) *StyleConfigIteratorListStyleConfigs lists StyleConfigs.
Examples
package main
import (
"context"
mapmanagement "cloud.google.com/go/maps/mapmanagement/apiv2beta"
mapmanagementpb "cloud.google.com/go/maps/mapmanagement/apiv2beta/mapmanagementpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := mapmanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &mapmanagementpb.ListStyleConfigsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/maps/mapmanagement/apiv2beta/mapmanagementpb#ListStyleConfigsRequest.
}
it := c.ListStyleConfigs(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*mapmanagementpb.ListStyleConfigsResponse)
}
}
all
package main
import (
"context"
mapmanagement "cloud.google.com/go/maps/mapmanagement/apiv2beta"
mapmanagementpb "cloud.google.com/go/maps/mapmanagement/apiv2beta/mapmanagementpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := mapmanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &mapmanagementpb.ListStyleConfigsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/maps/mapmanagement/apiv2beta/mapmanagementpb#ListStyleConfigsRequest.
}
for resp, err := range c.ListStyleConfigs(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*Client) UpdateMapConfig
func (c *Client) UpdateMapConfig(ctx context.Context, req *mapmanagementpb.UpdateMapConfigRequest, opts ...gax.CallOption) (*mapmanagementpb.MapConfig, error)UpdateMapConfig updates a MapConfig.
Example
package main
import (
"context"
mapmanagement "cloud.google.com/go/maps/mapmanagement/apiv2beta"
mapmanagementpb "cloud.google.com/go/maps/mapmanagement/apiv2beta/mapmanagementpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := mapmanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &mapmanagementpb.UpdateMapConfigRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/maps/mapmanagement/apiv2beta/mapmanagementpb#UpdateMapConfigRequest.
}
resp, err := c.UpdateMapConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) UpdateMapContextConfig
func (c *Client) UpdateMapContextConfig(ctx context.Context, req *mapmanagementpb.UpdateMapContextConfigRequest, opts ...gax.CallOption) (*mapmanagementpb.MapContextConfig, error)UpdateMapContextConfig updates a MapContextConfig.
Example
package main
import (
"context"
mapmanagement "cloud.google.com/go/maps/mapmanagement/apiv2beta"
mapmanagementpb "cloud.google.com/go/maps/mapmanagement/apiv2beta/mapmanagementpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := mapmanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &mapmanagementpb.UpdateMapContextConfigRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/maps/mapmanagement/apiv2beta/mapmanagementpb#UpdateMapContextConfigRequest.
}
resp, err := c.UpdateMapContextConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) UpdateStyleConfig
func (c *Client) UpdateStyleConfig(ctx context.Context, req *mapmanagementpb.UpdateStyleConfigRequest, opts ...gax.CallOption) (*mapmanagementpb.StyleConfig, error)UpdateStyleConfig updates a StyleConfig.
Example
package main
import (
"context"
mapmanagement "cloud.google.com/go/maps/mapmanagement/apiv2beta"
mapmanagementpb "cloud.google.com/go/maps/mapmanagement/apiv2beta/mapmanagementpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := mapmanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &mapmanagementpb.UpdateStyleConfigRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/maps/mapmanagement/apiv2beta/mapmanagementpb#UpdateStyleConfigRequest.
}
resp, err := c.UpdateStyleConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
MapConfigIterator
type MapConfigIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*mapmanagementpb.MapConfig, nextPageToken string, err error)
// contains filtered or unexported fields
}MapConfigIterator manages a stream of *mapmanagementpb.MapConfig.
func (*MapConfigIterator) All
func (it *MapConfigIterator) All() iter.Seq2[*mapmanagementpb.MapConfig, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*MapConfigIterator) Next
func (it *MapConfigIterator) Next() (*mapmanagementpb.MapConfig, error)Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*MapConfigIterator) PageInfo
func (it *MapConfigIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
MapContextConfigIterator
type MapContextConfigIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*mapmanagementpb.MapContextConfig, nextPageToken string, err error)
// contains filtered or unexported fields
}MapContextConfigIterator manages a stream of *mapmanagementpb.MapContextConfig.
func (*MapContextConfigIterator) All
func (it *MapContextConfigIterator) All() iter.Seq2[*mapmanagementpb.MapContextConfig, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*MapContextConfigIterator) Next
func (it *MapContextConfigIterator) Next() (*mapmanagementpb.MapContextConfig, error)Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*MapContextConfigIterator) PageInfo
func (it *MapContextConfigIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
StyleConfigIterator
type StyleConfigIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*mapmanagementpb.StyleConfig, nextPageToken string, err error)
// contains filtered or unexported fields
}StyleConfigIterator manages a stream of *mapmanagementpb.StyleConfig.
func (*StyleConfigIterator) All
func (it *StyleConfigIterator) All() iter.Seq2[*mapmanagementpb.StyleConfig, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*StyleConfigIterator) Next
func (it *StyleConfigIterator) Next() (*mapmanagementpb.StyleConfig, error)Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*StyleConfigIterator) PageInfo
func (it *StyleConfigIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.