support

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 21 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.

General documentation

For information that is relevant for all client libraries please reference https://pkg.go.dev/cloud.google.com/go#pkg-overview. Some information on this page includes:

Example usage

To get started with this package, create a client.

ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := 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.

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/apiv2/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
}

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) 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 attachment 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 attachment for Google Cloud support cases.

Example
package main

import (
	"context"

	support "cloud.google.com/go/support/apiv2"
)

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
}
Output:

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 attachment for Google Cloud support cases.

Example
package main

import (
	"context"

	support "cloud.google.com/go/support/apiv2"
)

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
}
Output:

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 retrieve all attachments associated with a support case.

Example
package main

import (
	"context"

	support "cloud.google.com/go/support/apiv2"
	supportpb "cloud.google.com/go/support/apiv2/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/apiv2/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
	}
}
Output:

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) 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/apiv2"
)

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
}
Output:

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/apiv2"
)

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
}
Output:

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 the specified case.

Example
package main

import (
	"context"

	support "cloud.google.com/go/support/apiv2"
	supportpb "cloud.google.com/go/support/apiv2/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/apiv2/supportpb#CloseCaseRequest.
	}
	resp, err := c.CloseCase(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

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 the given Google Cloud Resource. The case object must have the following fields set: display_name, description, classification, and priority.

Example
package main

import (
	"context"

	support "cloud.google.com/go/support/apiv2"
	supportpb "cloud.google.com/go/support/apiv2/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/apiv2/supportpb#CreateCaseRequest.
	}
	resp, err := c.CreateCase(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*CaseClient) EscalateCase

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

EscalateCase escalate a case. Escalating a case will initiate the Google Cloud Support escalation management process.

This operation is only available to certain Customer Care tiers. 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 tiers are able to perform escalations.

Example
package main

import (
	"context"

	support "cloud.google.com/go/support/apiv2"
	supportpb "cloud.google.com/go/support/apiv2/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/apiv2/supportpb#EscalateCaseRequest.
	}
	resp, err := c.EscalateCase(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*CaseClient) GetCase

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

GetCase retrieve the specified case.

Example
package main

import (
	"context"

	support "cloud.google.com/go/support/apiv2"
	supportpb "cloud.google.com/go/support/apiv2/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/apiv2/supportpb#GetCaseRequest.
	}
	resp, err := c.GetCase(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*CaseClient) ListCases

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

ListCases retrieve all cases under the specified parent.

Note: Listing cases under an Organization returns only the cases directly parented by that organization. To retrieve all cases under an organization, including cases parented by projects under that organization, use cases.search.

Example
package main

import (
	"context"

	support "cloud.google.com/go/support/apiv2"
	supportpb "cloud.google.com/go/support/apiv2/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/apiv2/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
	}
}
Output:

func (*CaseClient) SearchCaseClassifications

SearchCaseClassifications retrieve valid classifications to be used when creating a support case. The classications are hierarchical, with each classification containing all levels of the hierarchy, separated by " > ". For example “Technical Issue > Compute > Compute Engine”.

Example
package main

import (
	"context"

	support "cloud.google.com/go/support/apiv2"
	supportpb "cloud.google.com/go/support/apiv2/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/apiv2/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
	}
}
Output:

func (*CaseClient) SearchCases

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

SearchCases search cases using the specified query.

Example
package main

import (
	"context"

	support "cloud.google.com/go/support/apiv2"
	supportpb "cloud.google.com/go/support/apiv2/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/apiv2/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
	}
}
Output:

func (*CaseClient) UpdateCase

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

UpdateCase update the specified case. Only a subset of fields can be updated.

Example
package main

import (
	"context"

	support "cloud.google.com/go/support/apiv2"
	supportpb "cloud.google.com/go/support/apiv2/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/apiv2/supportpb#UpdateCaseRequest.
	}
	resp, err := c.UpdateCase(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

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) 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/apiv2"
)

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
}
Output:

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/apiv2"
)

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
}
Output:

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 the specified Case. The comment object must have the following fields set: body.

Example
package main

import (
	"context"

	support "cloud.google.com/go/support/apiv2"
	supportpb "cloud.google.com/go/support/apiv2/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/apiv2/supportpb#CreateCommentRequest.
	}
	resp, err := c.CreateComment(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*CommentClient) ListComments

ListComments retrieve all Comments associated with the Case object.

Example
package main

import (
	"context"

	support "cloud.google.com/go/support/apiv2"
	supportpb "cloud.google.com/go/support/apiv2/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/apiv2/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
	}
}
Output:

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) 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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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