support

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2025 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Overview

Package support is an auto-generated package for the Google Cloud Support API.

Manages Google Cloud technical support cases for Customer Care support offerings.

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/support/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 := support.NewCaseAttachmentClient(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 := &supportpb.ListAttachmentsRequest{
	// TODO: Fill request struct fields.
	// See https://pkg.go.dev/cloud.google.com/go/support/apiv2beta/supportpb#ListAttachmentsRequest.
}
it := c.ListAttachments(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.(*supportpb.ListAttachmentsResponse)
}

Use of Context

The ctx passed to NewCaseAttachmentClient 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 AttachmentIterator

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

AttachmentIterator manages a stream of *supportpb.Attachment.

func (*AttachmentIterator) All

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

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

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

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

type CaseAttachmentCallOptions

type CaseAttachmentCallOptions struct {
	ListAttachments []gax.CallOption
}

CaseAttachmentCallOptions contains the retry settings for each method of CaseAttachmentClient.

type CaseAttachmentClient

type CaseAttachmentClient struct {

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

CaseAttachmentClient is a client for interacting with Google Cloud Support API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

A service to manage file attachments for Google Cloud support cases.

func NewCaseAttachmentClient

func NewCaseAttachmentClient(ctx context.Context, opts ...option.ClientOption) (*CaseAttachmentClient, error)

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

A service to manage file attachments for Google Cloud support cases.

Example
package main

import (
	"context"

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

	// TODO: Use client.
	_ = c
}

func NewCaseAttachmentRESTClient

func NewCaseAttachmentRESTClient(ctx context.Context, opts ...option.ClientOption) (*CaseAttachmentClient, error)

NewCaseAttachmentRESTClient creates a new case attachment service rest client.

A service to manage file attachments for Google Cloud support cases.

Example
package main

import (
	"context"

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

	// TODO: Use client.
	_ = c
}

func (*CaseAttachmentClient) Close

func (c *CaseAttachmentClient) Close() error

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

func (*CaseAttachmentClient) Connection deprecated

func (c *CaseAttachmentClient) 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 (*CaseAttachmentClient) ListAttachments

ListAttachments list all the attachments associated with a support case.

Example
package main

import (
	"context"

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

	req := &supportpb.ListAttachmentsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/support/apiv2beta/supportpb#ListAttachmentsRequest.
	}
	it := c.ListAttachments(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.(*supportpb.ListAttachmentsResponse)
	}
}
Example (All)
package main

import (
	"context"

	support "cloud.google.com/go/support/apiv2beta"
	supportpb "cloud.google.com/go/support/apiv2beta/supportpb"
)

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

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

type CaseCallOptions

type CaseCallOptions struct {
	GetCase                   []gax.CallOption
	ListCases                 []gax.CallOption
	SearchCases               []gax.CallOption
	CreateCase                []gax.CallOption
	UpdateCase                []gax.CallOption
	EscalateCase              []gax.CallOption
	CloseCase                 []gax.CallOption
	SearchCaseClassifications []gax.CallOption
}

CaseCallOptions contains the retry settings for each method of CaseClient.

type CaseClassificationIterator

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

CaseClassificationIterator manages a stream of *supportpb.CaseClassification.

func (*CaseClassificationIterator) All

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

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

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

type CaseClient

type CaseClient struct {

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

CaseClient is a client for interacting with Google Cloud Support API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

A service to manage Google Cloud support cases.

func NewCaseClient

func NewCaseClient(ctx context.Context, opts ...option.ClientOption) (*CaseClient, error)

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

A service to manage Google Cloud support cases.

Example
package main

import (
	"context"

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

	// TODO: Use client.
	_ = c
}

func NewCaseRESTClient

func NewCaseRESTClient(ctx context.Context, opts ...option.ClientOption) (*CaseClient, error)

NewCaseRESTClient creates a new case service rest client.

A service to manage Google Cloud support cases.

Example
package main

import (
	"context"

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

	// TODO: Use client.
	_ = c
}

func (*CaseClient) Close

func (c *CaseClient) Close() error

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

func (*CaseClient) CloseCase

func (c *CaseClient) CloseCase(ctx context.Context, req *supportpb.CloseCaseRequest, opts ...gax.CallOption) (*supportpb.Case, error)

CloseCase close a case.

Example
package main

import (
	"context"

	support "cloud.google.com/go/support/apiv2beta"
	supportpb "cloud.google.com/go/support/apiv2beta/supportpb"
)

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

	req := &supportpb.CloseCaseRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/support/apiv2beta/supportpb#CloseCaseRequest.
	}
	resp, err := c.CloseCase(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*CaseClient) Connection deprecated

func (c *CaseClient) 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 (*CaseClient) CreateCase

func (c *CaseClient) CreateCase(ctx context.Context, req *supportpb.CreateCaseRequest, opts ...gax.CallOption) (*supportpb.Case, error)

CreateCase create a new case and associate it with a parent.

It must have the following fields set: display_name, description, classification, and priority. If you’re just testing the API and don’t want to route your case to an agent, set testCase=true.

Example
package main

import (
	"context"

	support "cloud.google.com/go/support/apiv2beta"
	supportpb "cloud.google.com/go/support/apiv2beta/supportpb"
)

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

	req := &supportpb.CreateCaseRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/support/apiv2beta/supportpb#CreateCaseRequest.
	}
	resp, err := c.CreateCase(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*CaseClient) EscalateCase

func (c *CaseClient) EscalateCase(ctx context.Context, req *supportpb.EscalateCaseRequest, opts ...gax.CallOption) (*supportpb.Case, error)

EscalateCase escalate a case, starting the Google Cloud Support escalation management process.

This operation is only available for some support services. Go to https://cloud.google.com/support (at https://cloud.google.com/support) and look for ‘Technical support escalations’ in the feature list to find out which ones let you do that.

Example
package main

import (
	"context"

	support "cloud.google.com/go/support/apiv2beta"
	supportpb "cloud.google.com/go/support/apiv2beta/supportpb"
)

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

	req := &supportpb.EscalateCaseRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/support/apiv2beta/supportpb#EscalateCaseRequest.
	}
	resp, err := c.EscalateCase(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*CaseClient) GetCase

func (c *CaseClient) GetCase(ctx context.Context, req *supportpb.GetCaseRequest, opts ...gax.CallOption) (*supportpb.Case, error)

GetCase retrieve a case.

Example
package main

import (
	"context"

	support "cloud.google.com/go/support/apiv2beta"
	supportpb "cloud.google.com/go/support/apiv2beta/supportpb"
)

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

	req := &supportpb.GetCaseRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/support/apiv2beta/supportpb#GetCaseRequest.
	}
	resp, err := c.GetCase(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*CaseClient) ListCases

func (c *CaseClient) ListCases(ctx context.Context, req *supportpb.ListCasesRequest, opts ...gax.CallOption) *CaseIterator

ListCases retrieve all cases under a parent, but not its children.

For example, listing cases under an organization only returns the cases that are directly parented by that organization. To retrieve cases under an organization and its projects, use cases.search.

Example
package main

import (
	"context"

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

	req := &supportpb.ListCasesRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/support/apiv2beta/supportpb#ListCasesRequest.
	}
	it := c.ListCases(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.(*supportpb.ListCasesResponse)
	}
}
Example (All)
package main

import (
	"context"

	support "cloud.google.com/go/support/apiv2beta"
	supportpb "cloud.google.com/go/support/apiv2beta/supportpb"
)

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

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

func (*CaseClient) SearchCaseClassifications

SearchCaseClassifications retrieve valid classifications to use when creating a support case.

Classifications are hierarchical. Each classification is a string containing all levels of the hierarchy separated by " > ". For example, "Technical Issue > Compute > Compute Engine".

Classification IDs returned by this endpoint are valid for at least six months. When a classification is deactivated, this endpoint immediately stops returning it. After six months, case.create requests using the classification will fail.

Example
package main

import (
	"context"

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

	req := &supportpb.SearchCaseClassificationsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/support/apiv2beta/supportpb#SearchCaseClassificationsRequest.
	}
	it := c.SearchCaseClassifications(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.(*supportpb.SearchCaseClassificationsResponse)
	}
}
Example (All)
package main

import (
	"context"

	support "cloud.google.com/go/support/apiv2beta"
	supportpb "cloud.google.com/go/support/apiv2beta/supportpb"
)

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

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

func (*CaseClient) SearchCases

func (c *CaseClient) SearchCases(ctx context.Context, req *supportpb.SearchCasesRequest, opts ...gax.CallOption) *CaseIterator

SearchCases search for cases using a query.

Example
package main

import (
	"context"

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

	req := &supportpb.SearchCasesRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/support/apiv2beta/supportpb#SearchCasesRequest.
	}
	it := c.SearchCases(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.(*supportpb.SearchCasesResponse)
	}
}
Example (All)
package main

import (
	"context"

	support "cloud.google.com/go/support/apiv2beta"
	supportpb "cloud.google.com/go/support/apiv2beta/supportpb"
)

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

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

func (*CaseClient) UpdateCase

func (c *CaseClient) UpdateCase(ctx context.Context, req *supportpb.UpdateCaseRequest, opts ...gax.CallOption) (*supportpb.Case, error)

UpdateCase update a case. Only some fields can be updated.

Example
package main

import (
	"context"

	support "cloud.google.com/go/support/apiv2beta"
	supportpb "cloud.google.com/go/support/apiv2beta/supportpb"
)

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

	req := &supportpb.UpdateCaseRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/support/apiv2beta/supportpb#UpdateCaseRequest.
	}
	resp, err := c.UpdateCase(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

type CaseIterator

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

CaseIterator manages a stream of *supportpb.Case.

func (*CaseIterator) All

func (it *CaseIterator) All() iter.Seq2[*supportpb.Case, error]

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

func (*CaseIterator) Next

func (it *CaseIterator) Next() (*supportpb.Case, 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 (*CaseIterator) PageInfo

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

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

type CommentCallOptions

type CommentCallOptions struct {
	ListComments  []gax.CallOption
	CreateComment []gax.CallOption
}

CommentCallOptions contains the retry settings for each method of CommentClient.

type CommentClient

type CommentClient struct {

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

CommentClient is a client for interacting with Google Cloud Support API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

A service to manage comments on cases.

func NewCommentClient

func NewCommentClient(ctx context.Context, opts ...option.ClientOption) (*CommentClient, error)

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

A service to manage comments on cases.

Example
package main

import (
	"context"

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

	// TODO: Use client.
	_ = c
}

func NewCommentRESTClient

func NewCommentRESTClient(ctx context.Context, opts ...option.ClientOption) (*CommentClient, error)

NewCommentRESTClient creates a new comment service rest client.

A service to manage comments on cases.

Example
package main

import (
	"context"

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

	// TODO: Use client.
	_ = c
}

func (*CommentClient) Close

func (c *CommentClient) Close() error

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

func (*CommentClient) Connection deprecated

func (c *CommentClient) 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 (*CommentClient) CreateComment

CreateComment add a new comment to a case.

The comment must have the following fields set: body.

Example
package main

import (
	"context"

	support "cloud.google.com/go/support/apiv2beta"
	supportpb "cloud.google.com/go/support/apiv2beta/supportpb"
)

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

	req := &supportpb.CreateCommentRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/support/apiv2beta/supportpb#CreateCommentRequest.
	}
	resp, err := c.CreateComment(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*CommentClient) ListComments

ListComments list all the comments associated with a case.

Example
package main

import (
	"context"

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

	req := &supportpb.ListCommentsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/support/apiv2beta/supportpb#ListCommentsRequest.
	}
	it := c.ListComments(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.(*supportpb.ListCommentsResponse)
	}
}
Example (All)
package main

import (
	"context"

	support "cloud.google.com/go/support/apiv2beta"
	supportpb "cloud.google.com/go/support/apiv2beta/supportpb"
)

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

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

type CommentIterator

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

CommentIterator manages a stream of *supportpb.Comment.

func (*CommentIterator) All

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

func (*CommentIterator) Next

func (it *CommentIterator) Next() (*supportpb.Comment, 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 (*CommentIterator) PageInfo

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

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

type FeedCallOptions

type FeedCallOptions struct {
	ShowFeed []gax.CallOption
}

FeedCallOptions contains the retry settings for each method of FeedClient.

type FeedClient

type FeedClient struct {

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

FeedClient is a client for interacting with Google Cloud Support API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

A service to view case feed items.

func NewFeedClient

func NewFeedClient(ctx context.Context, opts ...option.ClientOption) (*FeedClient, error)

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

A service to view case feed items.

Example
package main

import (
	"context"

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

	// TODO: Use client.
	_ = c
}

func NewFeedRESTClient

func NewFeedRESTClient(ctx context.Context, opts ...option.ClientOption) (*FeedClient, error)

NewFeedRESTClient creates a new feed service rest client.

A service to view case feed items.

Example
package main

import (
	"context"

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

	// TODO: Use client.
	_ = c
}

func (*FeedClient) Close

func (c *FeedClient) Close() error

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

func (*FeedClient) Connection deprecated

func (c *FeedClient) 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 (*FeedClient) ShowFeed

ShowFeed show items in the feed of this case, including case emails, attachments, and comments.

Example
package main

import (
	"context"

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

	req := &supportpb.ShowFeedRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/support/apiv2beta/supportpb#ShowFeedRequest.
	}
	it := c.ShowFeed(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.(*supportpb.ShowFeedResponse)
	}
}
Example (All)
package main

import (
	"context"

	support "cloud.google.com/go/support/apiv2beta"
	supportpb "cloud.google.com/go/support/apiv2beta/supportpb"
)

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

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

type FeedItemIterator

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

FeedItemIterator manages a stream of *supportpb.FeedItem.

func (*FeedItemIterator) All

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

func (*FeedItemIterator) Next

func (it *FeedItemIterator) Next() (*supportpb.FeedItem, 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 (*FeedItemIterator) PageInfo

func (it *FeedItemIterator) 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