mapsplatformdatasets

package
v1.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package mapsplatformdatasets is an auto-generated package for the Maps Platform Datasets API.

The Maps Platform Datasets API enables developers to ingest geospatially-tied datasets that they can use to enrich their experience of Maps Platform solutions (e.g. styling, routing).

NOTE: This package is in alpha. It is not stable, and is likely to change.

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:

Example usage

To get started with this package, create a client.

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 := mapsplatformdatasets.NewMapsPlatformDatasetsV1AlphaClient(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.

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 := mapsplatformdatasets.NewMapsPlatformDatasetsV1AlphaClient(ctx)
if err != nil {
	// TODO: Handle error.
}
defer c.Close()

req := &mapsplatformdatasetspb.CreateDatasetRequest{
	// TODO: Fill request struct fields.
	// See https://pkg.go.dev/cloud.google.com/go/maps/mapsplatformdatasets/apiv1alpha/mapsplatformdatasetspb#CreateDatasetRequest.
}
resp, err := c.CreateDataset(ctx, req)
if err != nil {
	// TODO: Handle error.
}
// TODO: Use resp.
_ = resp

Use of Context

The ctx passed to NewMapsPlatformDatasetsV1AlphaClient 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.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultAuthScopes

func DefaultAuthScopes() []string

DefaultAuthScopes reports the default set of authentication scopes to use with this package.

Types

type DatasetIterator

type DatasetIterator 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 []*mapsplatformdatasetspb.Dataset, nextPageToken string, err error)
	// contains filtered or unexported fields
}

DatasetIterator manages a stream of *mapsplatformdatasetspb.Dataset.

func (*DatasetIterator) Next

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 (*DatasetIterator) PageInfo

func (it *DatasetIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type MapsPlatformDatasetsV1AlphaCallOptions

type MapsPlatformDatasetsV1AlphaCallOptions struct {
	CreateDataset         []gax.CallOption
	UpdateDatasetMetadata []gax.CallOption
	GetDataset            []gax.CallOption
	ListDatasetVersions   []gax.CallOption
	ListDatasets          []gax.CallOption
	DeleteDataset         []gax.CallOption
	DeleteDatasetVersion  []gax.CallOption
}

MapsPlatformDatasetsV1AlphaCallOptions contains the retry settings for each method of MapsPlatformDatasetsV1AlphaClient.

type MapsPlatformDatasetsV1AlphaClient

type MapsPlatformDatasetsV1AlphaClient struct {

	// The call options for this service.
	CallOptions *MapsPlatformDatasetsV1AlphaCallOptions
	// contains filtered or unexported fields
}

MapsPlatformDatasetsV1AlphaClient is a client for interacting with Maps Platform Datasets API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

Service definition for the Maps Platform Datasets API.

func NewMapsPlatformDatasetsV1AlphaClient

func NewMapsPlatformDatasetsV1AlphaClient(ctx context.Context, opts ...option.ClientOption) (*MapsPlatformDatasetsV1AlphaClient, error)

NewMapsPlatformDatasetsV1AlphaClient creates a new maps platform datasets v1 alpha client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.

Service definition for the Maps Platform Datasets API.

Example
package main

import (
	"context"

	mapsplatformdatasets "cloud.google.com/go/maps/mapsplatformdatasets/apiv1alpha"
)

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 := mapsplatformdatasets.NewMapsPlatformDatasetsV1AlphaClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}
Output:

func NewMapsPlatformDatasetsV1AlphaRESTClient

func NewMapsPlatformDatasetsV1AlphaRESTClient(ctx context.Context, opts ...option.ClientOption) (*MapsPlatformDatasetsV1AlphaClient, error)

NewMapsPlatformDatasetsV1AlphaRESTClient creates a new maps platform datasets v1 alpha rest client.

Service definition for the Maps Platform Datasets API.

Example
package main

import (
	"context"

	mapsplatformdatasets "cloud.google.com/go/maps/mapsplatformdatasets/apiv1alpha"
)

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 := mapsplatformdatasets.NewMapsPlatformDatasetsV1AlphaRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}
Output:

func (*MapsPlatformDatasetsV1AlphaClient) Close

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*MapsPlatformDatasetsV1AlphaClient) Connection deprecated

Connection returns a connection to the API service.

Deprecated: Connections are now pooled so this method does not always return the same resource.

func (*MapsPlatformDatasetsV1AlphaClient) CreateDataset

CreateDataset create a new dataset for the specified project.

Example
package main

import (
	"context"

	mapsplatformdatasets "cloud.google.com/go/maps/mapsplatformdatasets/apiv1alpha"
	mapsplatformdatasetspb "cloud.google.com/go/maps/mapsplatformdatasets/apiv1alpha/mapsplatformdatasetspb"
)

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 := mapsplatformdatasets.NewMapsPlatformDatasetsV1AlphaClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &mapsplatformdatasetspb.CreateDatasetRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/maps/mapsplatformdatasets/apiv1alpha/mapsplatformdatasetspb#CreateDatasetRequest.
	}
	resp, err := c.CreateDataset(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*MapsPlatformDatasetsV1AlphaClient) DeleteDataset

DeleteDataset delete the specified dataset and optionally all its corresponding versions.

Example
package main

import (
	"context"

	mapsplatformdatasets "cloud.google.com/go/maps/mapsplatformdatasets/apiv1alpha"
	mapsplatformdatasetspb "cloud.google.com/go/maps/mapsplatformdatasets/apiv1alpha/mapsplatformdatasetspb"
)

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 := mapsplatformdatasets.NewMapsPlatformDatasetsV1AlphaClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &mapsplatformdatasetspb.DeleteDatasetRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/maps/mapsplatformdatasets/apiv1alpha/mapsplatformdatasetspb#DeleteDatasetRequest.
	}
	err = c.DeleteDataset(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
}
Output:

func (*MapsPlatformDatasetsV1AlphaClient) DeleteDatasetVersion

DeleteDatasetVersion delete a specific version of the dataset.

Example
package main

import (
	"context"

	mapsplatformdatasets "cloud.google.com/go/maps/mapsplatformdatasets/apiv1alpha"
	mapsplatformdatasetspb "cloud.google.com/go/maps/mapsplatformdatasets/apiv1alpha/mapsplatformdatasetspb"
)

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 := mapsplatformdatasets.NewMapsPlatformDatasetsV1AlphaClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &mapsplatformdatasetspb.DeleteDatasetVersionRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/maps/mapsplatformdatasets/apiv1alpha/mapsplatformdatasetspb#DeleteDatasetVersionRequest.
	}
	err = c.DeleteDatasetVersion(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
}
Output:

func (*MapsPlatformDatasetsV1AlphaClient) GetDataset

GetDataset get the published or latest version of the dataset.

Example
package main

import (
	"context"

	mapsplatformdatasets "cloud.google.com/go/maps/mapsplatformdatasets/apiv1alpha"
	mapsplatformdatasetspb "cloud.google.com/go/maps/mapsplatformdatasets/apiv1alpha/mapsplatformdatasetspb"
)

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 := mapsplatformdatasets.NewMapsPlatformDatasetsV1AlphaClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &mapsplatformdatasetspb.GetDatasetRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/maps/mapsplatformdatasets/apiv1alpha/mapsplatformdatasetspb#GetDatasetRequest.
	}
	resp, err := c.GetDataset(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*MapsPlatformDatasetsV1AlphaClient) ListDatasetVersions

ListDatasetVersions list all the versions of a dataset.

Example
package main

import (
	"context"

	mapsplatformdatasets "cloud.google.com/go/maps/mapsplatformdatasets/apiv1alpha"
	mapsplatformdatasetspb "cloud.google.com/go/maps/mapsplatformdatasets/apiv1alpha/mapsplatformdatasetspb"
	"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 := mapsplatformdatasets.NewMapsPlatformDatasetsV1AlphaClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &mapsplatformdatasetspb.ListDatasetVersionsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/maps/mapsplatformdatasets/apiv1alpha/mapsplatformdatasetspb#ListDatasetVersionsRequest.
	}
	it := c.ListDatasetVersions(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.(*mapsplatformdatasetspb.ListDatasetVersionsResponse)
	}
}
Output:

func (*MapsPlatformDatasetsV1AlphaClient) ListDatasets

ListDatasets list all the datasets for the specified project.

Example
package main

import (
	"context"

	mapsplatformdatasets "cloud.google.com/go/maps/mapsplatformdatasets/apiv1alpha"
	mapsplatformdatasetspb "cloud.google.com/go/maps/mapsplatformdatasets/apiv1alpha/mapsplatformdatasetspb"
	"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 := mapsplatformdatasets.NewMapsPlatformDatasetsV1AlphaClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &mapsplatformdatasetspb.ListDatasetsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/maps/mapsplatformdatasets/apiv1alpha/mapsplatformdatasetspb#ListDatasetsRequest.
	}
	it := c.ListDatasets(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.(*mapsplatformdatasetspb.ListDatasetsResponse)
	}
}
Output:

func (*MapsPlatformDatasetsV1AlphaClient) UpdateDatasetMetadata

UpdateDatasetMetadata update the metadata for the dataset. To update the data use: UploadDataset.

Example
package main

import (
	"context"

	mapsplatformdatasets "cloud.google.com/go/maps/mapsplatformdatasets/apiv1alpha"
	mapsplatformdatasetspb "cloud.google.com/go/maps/mapsplatformdatasets/apiv1alpha/mapsplatformdatasetspb"
)

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 := mapsplatformdatasets.NewMapsPlatformDatasetsV1AlphaClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &mapsplatformdatasetspb.UpdateDatasetMetadataRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/maps/mapsplatformdatasets/apiv1alpha/mapsplatformdatasetspb#UpdateDatasetMetadataRequest.
	}
	resp, err := c.UpdateDatasetMetadata(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL