schemaregistry

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2025 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Overview

Package schemaregistry is an auto-generated package for the Managed Service for Apache Kafka API.

Manage Apache Kafka clusters and resources.

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:

Example usage

To get started with this package, create a client.

// go get cloud.google.com/go/managedkafka/schemaregistry/apiv1@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 := schemaregistry.NewManagedSchemaRegistryClient(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 := &schemaregistrypb.CheckCompatibilityRequest{
	// TODO: Fill request struct fields.
	// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#CheckCompatibilityRequest.
}
resp, err := c.CheckCompatibility(ctx, req)
if err != nil {
	// TODO: Handle error.
}
// TODO: Use resp.
_ = resp

Use of Context

The ctx passed to NewManagedSchemaRegistryClient 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 LocationIterator

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

LocationIterator manages a stream of *locationpb.Location.

func (*LocationIterator) All

All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.

func (*LocationIterator) Next

func (it *LocationIterator) Next() (*locationpb.Location, 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 (*LocationIterator) PageInfo

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

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

type ManagedSchemaRegistryCallOptions

type ManagedSchemaRegistryCallOptions struct {
	GetSchemaRegistry      []gax.CallOption
	ListSchemaRegistries   []gax.CallOption
	CreateSchemaRegistry   []gax.CallOption
	DeleteSchemaRegistry   []gax.CallOption
	GetContext             []gax.CallOption
	ListContexts           []gax.CallOption
	GetSchema              []gax.CallOption
	GetRawSchema           []gax.CallOption
	ListSchemaVersions     []gax.CallOption
	ListSchemaTypes        []gax.CallOption
	ListSubjects           []gax.CallOption
	ListSubjectsBySchemaId []gax.CallOption
	DeleteSubject          []gax.CallOption
	LookupVersion          []gax.CallOption
	GetVersion             []gax.CallOption
	GetRawSchemaVersion    []gax.CallOption
	ListVersions           []gax.CallOption
	CreateVersion          []gax.CallOption
	DeleteVersion          []gax.CallOption
	ListReferencedSchemas  []gax.CallOption
	CheckCompatibility     []gax.CallOption
	GetSchemaConfig        []gax.CallOption
	UpdateSchemaConfig     []gax.CallOption
	DeleteSchemaConfig     []gax.CallOption
	GetSchemaMode          []gax.CallOption
	UpdateSchemaMode       []gax.CallOption
	DeleteSchemaMode       []gax.CallOption
	GetLocation            []gax.CallOption
	ListLocations          []gax.CallOption
	CancelOperation        []gax.CallOption
	DeleteOperation        []gax.CallOption
	GetOperation           []gax.CallOption
	ListOperations         []gax.CallOption
}

ManagedSchemaRegistryCallOptions contains the retry settings for each method of ManagedSchemaRegistryClient.

type ManagedSchemaRegistryClient

type ManagedSchemaRegistryClient struct {

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

ManagedSchemaRegistryClient is a client for interacting with Managed Service for Apache Kafka API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

SchemaRegistry is a service that allows users to manage schemas for their Kafka clusters. It provides APIs to register, list, and delete schemas, as well as to get the schema for a given schema id or a given version id under a subject, to update the global or subject-specific compatibility mode, and to check the compatibility of a schema against a subject or a version. The main resource hierarchy is as follows:

SchemaRegistry

SchemaRegistry/Context

SchemaRegistry/Context/Schema

SchemaRegistry/Context/Subject

SchemaRegistry/Context/Subject/Version

SchemaRegistry/Config

SchemaRegistry/Mode

SchemaRegistry is the root resource to represent a schema registry instance. A customer can have multiple schema registry instances in a project.

Context is a context resource that represents a group of schemas, subjects and versions. A schema registry instance can have multiple contexts and always has a ‘default’ context. Contexts are independent of each other. Context is optional and if not specified, it falls back to the ‘default’ context.

Schema is a schema resource that represents a unique schema in a context of a schema registry instance. Each schema has a unique schema id, and can be referenced by a version of a subject.

Subject refers to the name under which the schema is registered. A typical subject is the Kafka topic name. A schema registry instance can have multiple subjects.

Version represents a version of a subject. A subject can have multiple versions. Creation of new version of a subject is guarded by the compatibility mode configured globally or for the subject specifically.

Config represents a config at global level cross all registry instances or at subject level. Currently, only compatibility is supported in config.

Mode represents the mode of a schema registry or a specific subject. Three modes are supported:

READONLY: The schema registry is in read-only mode, no write operations
allowed…

READWRITE: The schema registry is in read-write mode, which allows limited
write operations on the schema.

IMPORT: The schema registry is in import mode, which allows more editing
operations on the schema for data importing purposes.

func NewManagedSchemaRegistryClient

func NewManagedSchemaRegistryClient(ctx context.Context, opts ...option.ClientOption) (*ManagedSchemaRegistryClient, error)

NewManagedSchemaRegistryClient creates a new managed schema registry client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.

SchemaRegistry is a service that allows users to manage schemas for their Kafka clusters. It provides APIs to register, list, and delete schemas, as well as to get the schema for a given schema id or a given version id under a subject, to update the global or subject-specific compatibility mode, and to check the compatibility of a schema against a subject or a version. The main resource hierarchy is as follows:

SchemaRegistry

SchemaRegistry/Context

SchemaRegistry/Context/Schema

SchemaRegistry/Context/Subject

SchemaRegistry/Context/Subject/Version

SchemaRegistry/Config

SchemaRegistry/Mode

SchemaRegistry is the root resource to represent a schema registry instance. A customer can have multiple schema registry instances in a project.

Context is a context resource that represents a group of schemas, subjects and versions. A schema registry instance can have multiple contexts and always has a ‘default’ context. Contexts are independent of each other. Context is optional and if not specified, it falls back to the ‘default’ context.

Schema is a schema resource that represents a unique schema in a context of a schema registry instance. Each schema has a unique schema id, and can be referenced by a version of a subject.

Subject refers to the name under which the schema is registered. A typical subject is the Kafka topic name. A schema registry instance can have multiple subjects.

Version represents a version of a subject. A subject can have multiple versions. Creation of new version of a subject is guarded by the compatibility mode configured globally or for the subject specifically.

Config represents a config at global level cross all registry instances or at subject level. Currently, only compatibility is supported in config.

Mode represents the mode of a schema registry or a specific subject. Three modes are supported:

READONLY: The schema registry is in read-only mode, no write operations
allowed…

READWRITE: The schema registry is in read-write mode, which allows limited
write operations on the schema.

IMPORT: The schema registry is in import mode, which allows more editing
operations on the schema for data importing purposes.
Example
package main

import (
	"context"

	schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
)

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

	// TODO: Use client.
	_ = c
}

func NewManagedSchemaRegistryRESTClient

func NewManagedSchemaRegistryRESTClient(ctx context.Context, opts ...option.ClientOption) (*ManagedSchemaRegistryClient, error)

NewManagedSchemaRegistryRESTClient creates a new managed schema registry rest client.

SchemaRegistry is a service that allows users to manage schemas for their Kafka clusters. It provides APIs to register, list, and delete schemas, as well as to get the schema for a given schema id or a given version id under a subject, to update the global or subject-specific compatibility mode, and to check the compatibility of a schema against a subject or a version. The main resource hierarchy is as follows:

SchemaRegistry

SchemaRegistry/Context

SchemaRegistry/Context/Schema

SchemaRegistry/Context/Subject

SchemaRegistry/Context/Subject/Version

SchemaRegistry/Config

SchemaRegistry/Mode

SchemaRegistry is the root resource to represent a schema registry instance. A customer can have multiple schema registry instances in a project.

Context is a context resource that represents a group of schemas, subjects and versions. A schema registry instance can have multiple contexts and always has a ‘default’ context. Contexts are independent of each other. Context is optional and if not specified, it falls back to the ‘default’ context.

Schema is a schema resource that represents a unique schema in a context of a schema registry instance. Each schema has a unique schema id, and can be referenced by a version of a subject.

Subject refers to the name under which the schema is registered. A typical subject is the Kafka topic name. A schema registry instance can have multiple subjects.

Version represents a version of a subject. A subject can have multiple versions. Creation of new version of a subject is guarded by the compatibility mode configured globally or for the subject specifically.

Config represents a config at global level cross all registry instances or at subject level. Currently, only compatibility is supported in config.

Mode represents the mode of a schema registry or a specific subject. Three modes are supported:

READONLY: The schema registry is in read-only mode, no write operations
allowed…

READWRITE: The schema registry is in read-write mode, which allows limited
write operations on the schema.

IMPORT: The schema registry is in import mode, which allows more editing
operations on the schema for data importing purposes.
Example
package main

import (
	"context"

	schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
)

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

	// TODO: Use client.
	_ = c
}

func (*ManagedSchemaRegistryClient) CancelOperation

CancelOperation is a utility method from google.longrunning.Operations.

Example
package main

import (
	"context"

	longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
	schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
)

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

	req := &longrunningpb.CancelOperationRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
	}
	err = c.CancelOperation(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
}

func (*ManagedSchemaRegistryClient) CheckCompatibility

CheckCompatibility check compatibility of a schema with all versions or a specific version of a subject.

Example
package main

import (
	"context"

	schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"

	schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)

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

	req := &schemaregistrypb.CheckCompatibilityRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#CheckCompatibilityRequest.
	}
	resp, err := c.CheckCompatibility(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*ManagedSchemaRegistryClient) Close

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

func (*ManagedSchemaRegistryClient) Connection deprecated

func (c *ManagedSchemaRegistryClient) Connection() *grpc.ClientConn

Connection returns a connection to the API service.

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

func (*ManagedSchemaRegistryClient) CreateSchemaRegistry

CreateSchemaRegistry create a schema registry instance.

Example
package main

import (
	"context"

	schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"

	schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)

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

	req := &schemaregistrypb.CreateSchemaRegistryRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#CreateSchemaRegistryRequest.
	}
	resp, err := c.CreateSchemaRegistry(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*ManagedSchemaRegistryClient) CreateVersion

CreateVersion register a new version under a given subject with the given schema.

Example
package main

import (
	"context"

	schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"

	schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)

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

	req := &schemaregistrypb.CreateVersionRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#CreateVersionRequest.
	}
	resp, err := c.CreateVersion(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*ManagedSchemaRegistryClient) DeleteOperation

DeleteOperation is a utility method from google.longrunning.Operations.

Example
package main

import (
	"context"

	longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
	schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
)

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

	req := &longrunningpb.DeleteOperationRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.
	}
	err = c.DeleteOperation(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
}

func (*ManagedSchemaRegistryClient) DeleteSchemaConfig

DeleteSchemaConfig delete schema config for a subject.

Example
package main

import (
	"context"

	schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"

	schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)

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

	req := &schemaregistrypb.DeleteSchemaConfigRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#DeleteSchemaConfigRequest.
	}
	resp, err := c.DeleteSchemaConfig(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*ManagedSchemaRegistryClient) DeleteSchemaMode

DeleteSchemaMode delete schema mode for a subject.

Example
package main

import (
	"context"

	schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"

	schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)

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

	req := &schemaregistrypb.DeleteSchemaModeRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#DeleteSchemaModeRequest.
	}
	resp, err := c.DeleteSchemaMode(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*ManagedSchemaRegistryClient) DeleteSchemaRegistry

DeleteSchemaRegistry delete a schema registry instance.

Example
package main

import (
	"context"

	schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"

	schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)

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

	req := &schemaregistrypb.DeleteSchemaRegistryRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#DeleteSchemaRegistryRequest.
	}
	err = c.DeleteSchemaRegistry(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
}

func (*ManagedSchemaRegistryClient) DeleteSubject

DeleteSubject delete a subject. The response will be an array of versions of the deleted subject.

Example
package main

import (
	"context"

	schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"

	schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)

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

	req := &schemaregistrypb.DeleteSubjectRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#DeleteSubjectRequest.
	}
	resp, err := c.DeleteSubject(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*ManagedSchemaRegistryClient) DeleteVersion

DeleteVersion delete a version of a subject. The response will be the deleted version id.

Example
package main

import (
	"context"

	schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"

	schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)

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

	req := &schemaregistrypb.DeleteVersionRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#DeleteVersionRequest.
	}
	resp, err := c.DeleteVersion(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*ManagedSchemaRegistryClient) GetContext

GetContext get the context.

Example
package main

import (
	"context"

	schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"

	schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)

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

	req := &schemaregistrypb.GetContextRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#GetContextRequest.
	}
	resp, err := c.GetContext(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*ManagedSchemaRegistryClient) GetLocation

GetLocation gets information about a location.

Example
package main

import (
	"context"

	schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"

	locationpb "google.golang.org/genproto/googleapis/cloud/location"
)

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

	req := &locationpb.GetLocationRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#GetLocationRequest.
	}
	resp, err := c.GetLocation(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*ManagedSchemaRegistryClient) GetOperation

GetOperation is a utility method from google.longrunning.Operations.

Example
package main

import (
	"context"

	longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
	schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
)

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

	req := &longrunningpb.GetOperationRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
	}
	resp, err := c.GetOperation(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*ManagedSchemaRegistryClient) GetRawSchema

GetRawSchema get the schema string for the given schema id. The response will be the schema string.

Example
package main

import (
	"context"

	schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"

	schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)

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

	req := &schemaregistrypb.GetSchemaRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#GetSchemaRequest.
	}
	resp, err := c.GetRawSchema(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*ManagedSchemaRegistryClient) GetRawSchemaVersion

GetRawSchemaVersion get the schema string only for a version of a subject. The response will be the schema string.

Example
package main

import (
	"context"

	schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"

	schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)

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

	req := &schemaregistrypb.GetVersionRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#GetVersionRequest.
	}
	resp, err := c.GetRawSchemaVersion(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*ManagedSchemaRegistryClient) GetSchema

GetSchema get the schema for the given schema id.

Example
package main

import (
	"context"

	schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"

	schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)

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

	req := &schemaregistrypb.GetSchemaRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#GetSchemaRequest.
	}
	resp, err := c.GetSchema(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*ManagedSchemaRegistryClient) GetSchemaConfig

GetSchemaConfig get schema config at global level or for a subject.

Example
package main

import (
	"context"

	schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"

	schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)

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

	req := &schemaregistrypb.GetSchemaConfigRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#GetSchemaConfigRequest.
	}
	resp, err := c.GetSchemaConfig(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*ManagedSchemaRegistryClient) GetSchemaMode

GetSchemaMode get mode at global level or for a subject.

Example
package main

import (
	"context"

	schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"

	schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)

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

	req := &schemaregistrypb.GetSchemaModeRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#GetSchemaModeRequest.
	}
	resp, err := c.GetSchemaMode(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*ManagedSchemaRegistryClient) GetSchemaRegistry

GetSchemaRegistry get the schema registry instance.

Example
package main

import (
	"context"

	schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"

	schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)

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

	req := &schemaregistrypb.GetSchemaRegistryRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#GetSchemaRegistryRequest.
	}
	resp, err := c.GetSchemaRegistry(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*ManagedSchemaRegistryClient) GetVersion

GetVersion get a versioned schema (schema with subject/version) of a subject.

Example
package main

import (
	"context"

	schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"

	schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)

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

	req := &schemaregistrypb.GetVersionRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#GetVersionRequest.
	}
	resp, err := c.GetVersion(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*ManagedSchemaRegistryClient) ListContexts

ListContexts list contexts for a schema registry.

Example
package main

import (
	"context"

	schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"

	schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)

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

	req := &schemaregistrypb.ListContextsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#ListContextsRequest.
	}
	resp, err := c.ListContexts(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*ManagedSchemaRegistryClient) ListLocations

ListLocations lists information about the supported locations for this service.

Example
package main

import (
	"context"

	schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
	"google.golang.org/api/iterator"

	locationpb "google.golang.org/genproto/googleapis/cloud/location"
)

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

	req := &locationpb.ListLocationsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
	}
	it := c.ListLocations(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.(*locationpb.ListLocationsResponse)
	}
}
Example (All)
package main

import (
	"context"

	schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"

	locationpb "google.golang.org/genproto/googleapis/cloud/location"
)

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

	req := &locationpb.ListLocationsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
	}
	for resp, err := range c.ListLocations(ctx, req).All() {
		if err != nil {
			// TODO: Handle error and break/return/continue. Iteration will stop after any error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

func (*ManagedSchemaRegistryClient) ListOperations

ListOperations is a utility method from google.longrunning.Operations.

Example
package main

import (
	"context"

	longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
	schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
	"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 := schemaregistry.NewManagedSchemaRegistryClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &longrunningpb.ListOperationsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
	}
	it := c.ListOperations(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.(*longrunningpb.ListOperationsResponse)
	}
}
Example (All)
package main

import (
	"context"

	longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
	schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
)

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

	req := &longrunningpb.ListOperationsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
	}
	for resp, err := range c.ListOperations(ctx, req).All() {
		if err != nil {
			// TODO: Handle error and break/return/continue. Iteration will stop after any error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

func (*ManagedSchemaRegistryClient) ListReferencedSchemas

ListReferencedSchemas get a list of IDs of schemas that reference the schema with the given subject and version.

Example
package main

import (
	"context"

	schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"

	schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)

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

	req := &schemaregistrypb.ListReferencedSchemasRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#ListReferencedSchemasRequest.
	}
	resp, err := c.ListReferencedSchemas(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*ManagedSchemaRegistryClient) ListSchemaRegistries

ListSchemaRegistries list schema registries.

Example
package main

import (
	"context"

	schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"

	schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)

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

	req := &schemaregistrypb.ListSchemaRegistriesRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#ListSchemaRegistriesRequest.
	}
	resp, err := c.ListSchemaRegistries(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*ManagedSchemaRegistryClient) ListSchemaTypes

ListSchemaTypes list the supported schema types. The response will be an array of schema types.

Example
package main

import (
	"context"

	schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"

	schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)

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

	req := &schemaregistrypb.ListSchemaTypesRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#ListSchemaTypesRequest.
	}
	resp, err := c.ListSchemaTypes(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*ManagedSchemaRegistryClient) ListSchemaVersions

ListSchemaVersions list the schema versions for the given schema id. The response will be an array of subject-version pairs as: [{“subject”:“subject1”, “version”:1}, {“subject”:“subject2”, “version”:2}].

Example
package main

import (
	"context"

	schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"

	schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)

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

	req := &schemaregistrypb.ListSchemaVersionsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#ListSchemaVersionsRequest.
	}
	resp, err := c.ListSchemaVersions(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*ManagedSchemaRegistryClient) ListSubjects

ListSubjects list subjects in the schema registry. The response will be an array of subject names.

Example
package main

import (
	"context"

	schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"

	schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)

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

	req := &schemaregistrypb.ListSubjectsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#ListSubjectsRequest.
	}
	resp, err := c.ListSubjects(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*ManagedSchemaRegistryClient) ListSubjectsBySchemaId

ListSubjectsBySchemaId list subjects which reference a particular schema id. The response will be an array of subject names.

Example
package main

import (
	"context"

	schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"

	schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)

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

	req := &schemaregistrypb.ListSubjectsBySchemaIdRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#ListSubjectsBySchemaIdRequest.
	}
	resp, err := c.ListSubjectsBySchemaId(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*ManagedSchemaRegistryClient) ListVersions

ListVersions get all versions of a subject. The response will be an array of versions of the subject.

Example
package main

import (
	"context"

	schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"

	schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)

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

	req := &schemaregistrypb.ListVersionsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#ListVersionsRequest.
	}
	resp, err := c.ListVersions(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*ManagedSchemaRegistryClient) LookupVersion

LookupVersion lookup a schema under the specified subject.

Example
package main

import (
	"context"

	schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"

	schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)

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

	req := &schemaregistrypb.LookupVersionRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#LookupVersionRequest.
	}
	resp, err := c.LookupVersion(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*ManagedSchemaRegistryClient) UpdateSchemaConfig

UpdateSchemaConfig update config at global level or for a subject. Creates a SchemaSubject-level SchemaConfig if it does not exist.

Example
package main

import (
	"context"

	schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"

	schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)

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

	req := &schemaregistrypb.UpdateSchemaConfigRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#UpdateSchemaConfigRequest.
	}
	resp, err := c.UpdateSchemaConfig(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*ManagedSchemaRegistryClient) UpdateSchemaMode

UpdateSchemaMode update mode at global level or for a subject.

Example
package main

import (
	"context"

	schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"

	schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)

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

	req := &schemaregistrypb.UpdateSchemaModeRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#UpdateSchemaModeRequest.
	}
	resp, err := c.UpdateSchemaMode(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

type OperationIterator

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

OperationIterator manages a stream of *longrunningpb.Operation.

func (*OperationIterator) All

All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.

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

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

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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