productstudio

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2025 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package productstudio is an auto-generated package for the Merchant API.

Programmatically manage your Merchant Center Accounts.

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/shopping/merchant/productstudio/apiv1alpha@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 := productstudio.NewImageClient(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 := &productstudiopb.GenerateProductImageBackgroundRequest{
	// TODO: Fill request struct fields.
	// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/productstudio/apiv1alpha/productstudiopb#GenerateProductImageBackgroundRequest.
}
resp, err := c.GenerateProductImageBackground(ctx, req)
if err != nil {
	// TODO: Handle error.
}
// TODO: Use resp.
_ = resp

Use of Context

The ctx passed to NewImageClient 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 ImageCallOptions

type ImageCallOptions struct {
	GenerateProductImageBackground []gax.CallOption
	RemoveProductImageBackground   []gax.CallOption
	UpscaleProductImage            []gax.CallOption
}

ImageCallOptions contains the retry settings for each method of ImageClient.

type ImageClient

type ImageClient struct {

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

ImageClient is a client for interacting with Merchant API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

Service that exposes Generative AI (GenAI) endpoints for creating and enhancing product image content.

func NewImageClient

func NewImageClient(ctx context.Context, opts ...option.ClientOption) (*ImageClient, error)

NewImageClient creates a new image service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.

Service that exposes Generative AI (GenAI) endpoints for creating and enhancing product image content.

Example
package main

import (
	"context"

	productstudio "cloud.google.com/go/shopping/merchant/productstudio/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 := productstudio.NewImageClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func NewImageRESTClient

func NewImageRESTClient(ctx context.Context, opts ...option.ClientOption) (*ImageClient, error)

NewImageRESTClient creates a new image service rest client.

Service that exposes Generative AI (GenAI) endpoints for creating and enhancing product image content.

Example
package main

import (
	"context"

	productstudio "cloud.google.com/go/shopping/merchant/productstudio/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 := productstudio.NewImageRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func (*ImageClient) Close

func (c *ImageClient) Close() error

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

func (*ImageClient) Connection deprecated

func (c *ImageClient) 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 (*ImageClient) GenerateProductImageBackground

GenerateProductImageBackground generateProductImageBackground generates a new image where the background of the original image is replaced by an AI generated scene based on provided product information and a text prompt.

Example
package main

import (
	"context"

	productstudio "cloud.google.com/go/shopping/merchant/productstudio/apiv1alpha"
	productstudiopb "cloud.google.com/go/shopping/merchant/productstudio/apiv1alpha/productstudiopb"
)

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

	req := &productstudiopb.GenerateProductImageBackgroundRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/productstudio/apiv1alpha/productstudiopb#GenerateProductImageBackgroundRequest.
	}
	resp, err := c.GenerateProductImageBackground(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*ImageClient) RemoveProductImageBackground

RemoveProductImageBackground removeProductImageBackground generates a new image where the background of the original image is removed.

Example
package main

import (
	"context"

	productstudio "cloud.google.com/go/shopping/merchant/productstudio/apiv1alpha"
	productstudiopb "cloud.google.com/go/shopping/merchant/productstudio/apiv1alpha/productstudiopb"
)

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

	req := &productstudiopb.RemoveProductImageBackgroundRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/productstudio/apiv1alpha/productstudiopb#RemoveProductImageBackgroundRequest.
	}
	resp, err := c.RemoveProductImageBackground(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*ImageClient) UpscaleProductImage

UpscaleProductImage upscaleProductImage generates a new image where the resolution of the original image is enhanced.

Example
package main

import (
	"context"

	productstudio "cloud.google.com/go/shopping/merchant/productstudio/apiv1alpha"
	productstudiopb "cloud.google.com/go/shopping/merchant/productstudio/apiv1alpha/productstudiopb"
)

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

	req := &productstudiopb.UpscaleProductImageRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/productstudio/apiv1alpha/productstudiopb#UpscaleProductImageRequest.
	}
	resp, err := c.UpscaleProductImage(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

type TextSuggestionsCallOptions

type TextSuggestionsCallOptions struct {
	GenerateProductTextSuggestions []gax.CallOption
}

TextSuggestionsCallOptions contains the retry settings for each method of TextSuggestionsClient.

type TextSuggestionsClient

type TextSuggestionsClient struct {

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

TextSuggestionsClient is a client for interacting with Merchant API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

Service that exposes Generative AI (GenAI) endpoints for creating and enhancing product text content, such as titles, descriptions, etc.

func NewTextSuggestionsClient

func NewTextSuggestionsClient(ctx context.Context, opts ...option.ClientOption) (*TextSuggestionsClient, error)

NewTextSuggestionsClient creates a new text suggestions service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.

Service that exposes Generative AI (GenAI) endpoints for creating and enhancing product text content, such as titles, descriptions, etc.

Example
package main

import (
	"context"

	productstudio "cloud.google.com/go/shopping/merchant/productstudio/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 := productstudio.NewTextSuggestionsClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func NewTextSuggestionsRESTClient

func NewTextSuggestionsRESTClient(ctx context.Context, opts ...option.ClientOption) (*TextSuggestionsClient, error)

NewTextSuggestionsRESTClient creates a new text suggestions service rest client.

Service that exposes Generative AI (GenAI) endpoints for creating and enhancing product text content, such as titles, descriptions, etc.

Example
package main

import (
	"context"

	productstudio "cloud.google.com/go/shopping/merchant/productstudio/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 := productstudio.NewTextSuggestionsRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func (*TextSuggestionsClient) Close

func (c *TextSuggestionsClient) Close() error

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

func (*TextSuggestionsClient) Connection deprecated

func (c *TextSuggestionsClient) 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 (*TextSuggestionsClient) GenerateProductTextSuggestions

GenerateProductTextSuggestions generateProductTextSuggestions generates a set of candidate text completions (e.g., product titles, descriptions) based on provided product information. This endpoint leverages GenAI models to create suggestions for improving existing product text or generating new content.

Example
package main

import (
	"context"

	productstudio "cloud.google.com/go/shopping/merchant/productstudio/apiv1alpha"
	productstudiopb "cloud.google.com/go/shopping/merchant/productstudio/apiv1alpha/productstudiopb"
)

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

	req := &productstudiopb.GenerateProductTextSuggestionsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/productstudio/apiv1alpha/productstudiopb#GenerateProductTextSuggestionsRequest.
	}
	resp, err := c.GenerateProductTextSuggestions(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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