Documentation ¶
Overview ¶
Package issuetracker is an auto-generated package for the Private Issue Tracker API.
The Private Issue Tracker API is a service that provides Issue Tracker data to internal clients.
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:
- Authentication and Authorization
- Timeouts and Cancellation
- Testing against Client Libraries
- Debugging Client Libraries
- Inspecting errors
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 := issuetracker.NewClient(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 := issuetracker.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &issuetrackerpb.BatchGetIssuesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/google.golang.org/genproto/googleapis/devtools/issuetracker/v1#BatchGetIssuesRequest. } resp, err := c.BatchGetIssues(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp
Use of Context ¶
The ctx passed to NewClient 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 ¶
- func DefaultAuthScopes() []string
- type CallOptions
- type Client
- func (c *Client) BatchGetIssues(ctx context.Context, req *issuetrackerpb.BatchGetIssuesRequest, ...) (*issuetrackerpb.BatchGetIssuesResponse, error)
- func (c *Client) Close() error
- func (c *Client) Connection() *grpc.ClientConndeprecated
- func (c *Client) CreateHotlistEntry(ctx context.Context, req *issuetrackerpb.CreateHotlistEntryRequest, ...) (*issuetrackerpb.HotlistEntry, error)
- func (c *Client) CreateIssue(ctx context.Context, req *issuetrackerpb.CreateIssueRequest, ...) (*issuetrackerpb.Issue, error)
- func (c *Client) CreateIssueComment(ctx context.Context, req *issuetrackerpb.CreateIssueCommentRequest, ...) (*issuetrackerpb.IssueComment, error)
- func (c *Client) CreateIssueRelationship(ctx context.Context, req *issuetrackerpb.CreateIssueRelationshipRequest, ...) (*issuetrackerpb.IssueRelationship, error)
- func (c *Client) DeleteHotlistEntry(ctx context.Context, req *issuetrackerpb.DeleteHotlistEntryRequest, ...) error
- func (c *Client) GetAutomationAccess(ctx context.Context, req *issuetrackerpb.GetAutomationAccessRequest, ...) (*issuetrackerpb.GetAutomationAccessResponse, error)
- func (c *Client) GetComponent(ctx context.Context, req *issuetrackerpb.GetComponentRequest, ...) (*issuetrackerpb.Component, error)
- func (c *Client) GetIssue(ctx context.Context, req *issuetrackerpb.GetIssueRequest, ...) (*issuetrackerpb.Issue, error)
- func (c *Client) ListAttachments(ctx context.Context, req *issuetrackerpb.ListAttachmentsRequest, ...) (*issuetrackerpb.ListAttachmentsResponse, error)
- func (c *Client) ListIssueComments(ctx context.Context, req *issuetrackerpb.ListIssueCommentsRequest, ...) *IssueCommentIterator
- func (c *Client) ListIssueRelationships(ctx context.Context, req *issuetrackerpb.ListIssueRelationshipsRequest, ...) (*issuetrackerpb.ListIssueRelationshipsResponse, error)
- func (c *Client) ListIssueUpdates(ctx context.Context, req *issuetrackerpb.ListIssueUpdatesRequest, ...) *IssueUpdateIterator
- func (c *Client) ListIssues(ctx context.Context, req *issuetrackerpb.ListIssuesRequest, ...) *IssueIterator
- func (c *Client) ModifyIssue(ctx context.Context, req *issuetrackerpb.ModifyIssueRequest, ...) (*issuetrackerpb.Issue, error)
- func (c *Client) UpdateIssueComment(ctx context.Context, req *issuetrackerpb.UpdateIssueCommentRequest, ...) (*issuetrackerpb.IssueComment, error)
- type IssueCommentIterator
- type IssueIterator
- type IssueUpdateIterator
Examples ¶
- Client.BatchGetIssues
- Client.CreateHotlistEntry
- Client.CreateIssue
- Client.CreateIssueComment
- Client.CreateIssueRelationship
- Client.DeleteHotlistEntry
- Client.GetAutomationAccess
- Client.GetComponent
- Client.GetIssue
- Client.ListAttachments
- Client.ListIssueComments
- Client.ListIssueRelationships
- Client.ListIssueUpdates
- Client.ListIssues
- Client.ModifyIssue
- Client.UpdateIssueComment
- NewClient
- NewRESTClient
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 CallOptions ¶
type CallOptions struct { GetComponent []gax.CallOption ListIssues []gax.CallOption BatchGetIssues []gax.CallOption GetIssue []gax.CallOption CreateIssue []gax.CallOption ModifyIssue []gax.CallOption CreateIssueRelationship []gax.CallOption ListIssueRelationships []gax.CallOption ListIssueUpdates []gax.CallOption CreateIssueComment []gax.CallOption ListIssueComments []gax.CallOption UpdateIssueComment []gax.CallOption ListAttachments []gax.CallOption CreateHotlistEntry []gax.CallOption DeleteHotlistEntry []gax.CallOption GetAutomationAccess []gax.CallOption }
CallOptions contains the retry settings for each method of Client.
type Client ¶
type Client struct { // The call options for this service. CallOptions *CallOptions // contains filtered or unexported fields }
Client is a client for interacting with Private Issue Tracker API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Manages issue and bug data, organized by a hierarchy of components.
func NewClient ¶
NewClient creates a new issue tracker client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Manages issue and bug data, organized by a hierarchy of components.
Example ¶
package main import ( "context" issuetracker "go.chromium.org/luci/third_party/google.golang.org/google/devtools/issuetracker/v1" ) 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 := issuetracker.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func NewRESTClient ¶
NewRESTClient creates a new issue tracker rest client.
Manages issue and bug data, organized by a hierarchy of components.
Example ¶
package main import ( "context" issuetracker "go.chromium.org/luci/third_party/google.golang.org/google/devtools/issuetracker/v1" ) 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 := issuetracker.NewRESTClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*Client) BatchGetIssues ¶
func (c *Client) BatchGetIssues(ctx context.Context, req *issuetrackerpb.BatchGetIssuesRequest, opts ...gax.CallOption) (*issuetrackerpb.BatchGetIssuesResponse, error)
BatchGetIssues gets multiple issues with their current state by their ID. Non-existing issues, or issues that the caller does not have access to, are silently ignored. Note: The maximum number of issues that can be retrieved in one call is limited to 100.
Example ¶
package main import ( "context" issuetrackerpb "go.chromium.org/luci/third_party/google.golang.org/genproto/googleapis/devtools/issuetracker/v1" issuetracker "go.chromium.org/luci/third_party/google.golang.org/google/devtools/issuetracker/v1" ) 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 := issuetracker.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &issuetrackerpb.BatchGetIssuesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/google.golang.org/genproto/googleapis/devtools/issuetracker/v1#BatchGetIssuesRequest. } resp, err := c.BatchGetIssues(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) Close ¶
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*Client) Connection
deprecated
func (c *Client) 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 (*Client) CreateHotlistEntry ¶
func (c *Client) CreateHotlistEntry(ctx context.Context, req *issuetrackerpb.CreateHotlistEntryRequest, opts ...gax.CallOption) (*issuetrackerpb.HotlistEntry, error)
CreateHotlistEntry adds an issue to a hotlist by creating a HotlistEntry. Returns the created HotlistEntry. Requires hotlist APPEND and issue VIEW permission
Example ¶
package main import ( "context" issuetrackerpb "go.chromium.org/luci/third_party/google.golang.org/genproto/googleapis/devtools/issuetracker/v1" issuetracker "go.chromium.org/luci/third_party/google.golang.org/google/devtools/issuetracker/v1" ) 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 := issuetracker.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &issuetrackerpb.CreateHotlistEntryRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/google.golang.org/genproto/googleapis/devtools/issuetracker/v1#CreateHotlistEntryRequest. } resp, err := c.CreateHotlistEntry(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) CreateIssue ¶
func (c *Client) CreateIssue(ctx context.Context, req *issuetrackerpb.CreateIssueRequest, opts ...gax.CallOption) (*issuetrackerpb.Issue, error)
CreateIssue creates a new issue within a component, and returns the new object.
Example ¶
package main import ( "context" issuetrackerpb "go.chromium.org/luci/third_party/google.golang.org/genproto/googleapis/devtools/issuetracker/v1" issuetracker "go.chromium.org/luci/third_party/google.golang.org/google/devtools/issuetracker/v1" ) 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 := issuetracker.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &issuetrackerpb.CreateIssueRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/google.golang.org/genproto/googleapis/devtools/issuetracker/v1#CreateIssueRequest. } resp, err := c.CreateIssue(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) CreateIssueComment ¶
func (c *Client) CreateIssueComment(ctx context.Context, req *issuetrackerpb.CreateIssueCommentRequest, opts ...gax.CallOption) (*issuetrackerpb.IssueComment, error)
CreateIssueComment creates a new issue comment in an issue
Example ¶
package main import ( "context" issuetrackerpb "go.chromium.org/luci/third_party/google.golang.org/genproto/googleapis/devtools/issuetracker/v1" issuetracker "go.chromium.org/luci/third_party/google.golang.org/google/devtools/issuetracker/v1" ) 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 := issuetracker.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &issuetrackerpb.CreateIssueCommentRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/google.golang.org/genproto/googleapis/devtools/issuetracker/v1#CreateIssueCommentRequest. } resp, err := c.CreateIssueComment(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) CreateIssueRelationship ¶
func (c *Client) CreateIssueRelationship(ctx context.Context, req *issuetrackerpb.CreateIssueRelationshipRequest, opts ...gax.CallOption) (*issuetrackerpb.IssueRelationship, error)
CreateIssueRelationship creates a new issue relationship. Requires issue EDIT on the source issue and issue VIEW on the target issue. For relationship_type = CHILD, requires issue EDIT on the source issue and issue VIEW on the target issue.
Example ¶
package main import ( "context" issuetrackerpb "go.chromium.org/luci/third_party/google.golang.org/genproto/googleapis/devtools/issuetracker/v1" issuetracker "go.chromium.org/luci/third_party/google.golang.org/google/devtools/issuetracker/v1" ) 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 := issuetracker.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &issuetrackerpb.CreateIssueRelationshipRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/google.golang.org/genproto/googleapis/devtools/issuetracker/v1#CreateIssueRelationshipRequest. } resp, err := c.CreateIssueRelationship(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) DeleteHotlistEntry ¶
func (c *Client) DeleteHotlistEntry(ctx context.Context, req *issuetrackerpb.DeleteHotlistEntryRequest, opts ...gax.CallOption) error
DeleteHotlistEntry removes an issue from a hotlist by deleting hotlistEntry. Removing an issue from a hotlist it does not belong to will do nothing and return. Requires hotlist APPEND and issue VIEW permission
Example ¶
package main import ( "context" issuetrackerpb "go.chromium.org/luci/third_party/google.golang.org/genproto/googleapis/devtools/issuetracker/v1" issuetracker "go.chromium.org/luci/third_party/google.golang.org/google/devtools/issuetracker/v1" ) 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 := issuetracker.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &issuetrackerpb.DeleteHotlistEntryRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/google.golang.org/genproto/googleapis/devtools/issuetracker/v1#DeleteHotlistEntryRequest. } err = c.DeleteHotlistEntry(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*Client) GetAutomationAccess ¶
func (c *Client) GetAutomationAccess(ctx context.Context, req *issuetrackerpb.GetAutomationAccessRequest, opts ...gax.CallOption) (*issuetrackerpb.GetAutomationAccessResponse, error)
GetAutomationAccess checks that automation has permission on a resource. Does not require any permission on the resource
Example ¶
package main import ( "context" issuetrackerpb "go.chromium.org/luci/third_party/google.golang.org/genproto/googleapis/devtools/issuetracker/v1" issuetracker "go.chromium.org/luci/third_party/google.golang.org/google/devtools/issuetracker/v1" ) 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 := issuetracker.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &issuetrackerpb.GetAutomationAccessRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/google.golang.org/genproto/googleapis/devtools/issuetracker/v1#GetAutomationAccessRequest. } resp, err := c.GetAutomationAccess(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) GetComponent ¶
func (c *Client) GetComponent(ctx context.Context, req *issuetrackerpb.GetComponentRequest, opts ...gax.CallOption) (*issuetrackerpb.Component, error)
GetComponent gets a component, including its parent hierarchy info.
Example ¶
package main import ( "context" issuetrackerpb "go.chromium.org/luci/third_party/google.golang.org/genproto/googleapis/devtools/issuetracker/v1" issuetracker "go.chromium.org/luci/third_party/google.golang.org/google/devtools/issuetracker/v1" ) 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 := issuetracker.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &issuetrackerpb.GetComponentRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/google.golang.org/genproto/googleapis/devtools/issuetracker/v1#GetComponentRequest. } resp, err := c.GetComponent(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) GetIssue ¶
func (c *Client) GetIssue(ctx context.Context, req *issuetrackerpb.GetIssueRequest, opts ...gax.CallOption) (*issuetrackerpb.Issue, error)
GetIssue gets an issue with its current state.
Example ¶
package main import ( "context" issuetrackerpb "go.chromium.org/luci/third_party/google.golang.org/genproto/googleapis/devtools/issuetracker/v1" issuetracker "go.chromium.org/luci/third_party/google.golang.org/google/devtools/issuetracker/v1" ) 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 := issuetracker.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &issuetrackerpb.GetIssueRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/google.golang.org/genproto/googleapis/devtools/issuetracker/v1#GetIssueRequest. } resp, err := c.GetIssue(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) ListAttachments ¶
func (c *Client) ListAttachments(ctx context.Context, req *issuetrackerpb.ListAttachmentsRequest, opts ...gax.CallOption) (*issuetrackerpb.ListAttachmentsResponse, error)
ListAttachments list attachments that belong to an issue. Only returns attachment metadata.
Example ¶
package main import ( "context" issuetrackerpb "go.chromium.org/luci/third_party/google.golang.org/genproto/googleapis/devtools/issuetracker/v1" issuetracker "go.chromium.org/luci/third_party/google.golang.org/google/devtools/issuetracker/v1" ) 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 := issuetracker.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &issuetrackerpb.ListAttachmentsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/google.golang.org/genproto/googleapis/devtools/issuetracker/v1#ListAttachmentsRequest. } resp, err := c.ListAttachments(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) ListIssueComments ¶
func (c *Client) ListIssueComments(ctx context.Context, req *issuetrackerpb.ListIssueCommentsRequest, opts ...gax.CallOption) *IssueCommentIterator
ListIssueComments fetches a list of IssueComment objects.
Example ¶
package main import ( "context" issuetrackerpb "go.chromium.org/luci/third_party/google.golang.org/genproto/googleapis/devtools/issuetracker/v1" issuetracker "go.chromium.org/luci/third_party/google.golang.org/google/devtools/issuetracker/v1" "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 := issuetracker.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &issuetrackerpb.ListIssueCommentsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/google.golang.org/genproto/googleapis/devtools/issuetracker/v1#ListIssueCommentsRequest. } it := c.ListIssueComments(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.(*issuetrackerpb.ListIssueCommentsResponse) } }
Output:
func (*Client) ListIssueRelationships ¶
func (c *Client) ListIssueRelationships(ctx context.Context, req *issuetrackerpb.ListIssueRelationshipsRequest, opts ...gax.CallOption) (*issuetrackerpb.ListIssueRelationshipsResponse, error)
ListIssueRelationships lists issue relationships under an issue of a type. Requires issue VIEW on the source issue. All target issues are included regardless of the caller’s issue view access. target_issue_id is always set. target_issue is set only if the caller has issue VIEW access to the target issue.
Example ¶
package main import ( "context" issuetrackerpb "go.chromium.org/luci/third_party/google.golang.org/genproto/googleapis/devtools/issuetracker/v1" issuetracker "go.chromium.org/luci/third_party/google.golang.org/google/devtools/issuetracker/v1" ) 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 := issuetracker.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &issuetrackerpb.ListIssueRelationshipsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/google.golang.org/genproto/googleapis/devtools/issuetracker/v1#ListIssueRelationshipsRequest. } resp, err := c.ListIssueRelationships(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) ListIssueUpdates ¶
func (c *Client) ListIssueUpdates(ctx context.Context, req *issuetrackerpb.ListIssueUpdatesRequest, opts ...gax.CallOption) *IssueUpdateIterator
ListIssueUpdates fetch a collection of IssueUpdate objects representing the change history of an issue, ordered by IssueUpdate.version.
Example ¶
package main import ( "context" issuetrackerpb "go.chromium.org/luci/third_party/google.golang.org/genproto/googleapis/devtools/issuetracker/v1" issuetracker "go.chromium.org/luci/third_party/google.golang.org/google/devtools/issuetracker/v1" "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 := issuetracker.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &issuetrackerpb.ListIssueUpdatesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/google.golang.org/genproto/googleapis/devtools/issuetracker/v1#ListIssueUpdatesRequest. } it := c.ListIssueUpdates(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.(*issuetrackerpb.ListIssueUpdatesResponse) } }
Output:
func (*Client) ListIssues ¶
func (c *Client) ListIssues(ctx context.Context, req *issuetrackerpb.ListIssuesRequest, opts ...gax.CallOption) *IssueIterator
ListIssues searches issues in the search cache (which may be stale), then returns the current state of the matched issues (which may no longer match ListIssuesRequest.query and may no longer be in the order indicated by ListIssuesRequest.order_by).
Example ¶
package main import ( "context" issuetrackerpb "go.chromium.org/luci/third_party/google.golang.org/genproto/googleapis/devtools/issuetracker/v1" issuetracker "go.chromium.org/luci/third_party/google.golang.org/google/devtools/issuetracker/v1" "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 := issuetracker.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &issuetrackerpb.ListIssuesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/google.golang.org/genproto/googleapis/devtools/issuetracker/v1#ListIssuesRequest. } it := c.ListIssues(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.(*issuetrackerpb.ListIssuesResponse) } }
Output:
func (*Client) ModifyIssue ¶
func (c *Client) ModifyIssue(ctx context.Context, req *issuetrackerpb.ModifyIssueRequest, opts ...gax.CallOption) (*issuetrackerpb.Issue, error)
ModifyIssue updates an issue based on add and remove IssueState. Returns the modified issue.
Example ¶
package main import ( "context" issuetrackerpb "go.chromium.org/luci/third_party/google.golang.org/genproto/googleapis/devtools/issuetracker/v1" issuetracker "go.chromium.org/luci/third_party/google.golang.org/google/devtools/issuetracker/v1" ) 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 := issuetracker.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &issuetrackerpb.ModifyIssueRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/google.golang.org/genproto/googleapis/devtools/issuetracker/v1#ModifyIssueRequest. } resp, err := c.ModifyIssue(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) UpdateIssueComment ¶
func (c *Client) UpdateIssueComment(ctx context.Context, req *issuetrackerpb.UpdateIssueCommentRequest, opts ...gax.CallOption) (*issuetrackerpb.IssueComment, error)
UpdateIssueComment updates an issue comment. NB: The comment manipulation methods does not use the attachment field in IssueComment.
Example ¶
package main import ( "context" issuetrackerpb "go.chromium.org/luci/third_party/google.golang.org/genproto/googleapis/devtools/issuetracker/v1" issuetracker "go.chromium.org/luci/third_party/google.golang.org/google/devtools/issuetracker/v1" ) 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 := issuetracker.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &issuetrackerpb.UpdateIssueCommentRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/google.golang.org/genproto/googleapis/devtools/issuetracker/v1#UpdateIssueCommentRequest. } resp, err := c.UpdateIssueComment(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
type IssueCommentIterator ¶
type IssueCommentIterator 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 []*issuetrackerpb.IssueComment, nextPageToken string, err error) // contains filtered or unexported fields }
IssueCommentIterator manages a stream of *issuetrackerpb.IssueComment.
func (*IssueCommentIterator) Next ¶
func (it *IssueCommentIterator) Next() (*issuetrackerpb.IssueComment, 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 (*IssueCommentIterator) PageInfo ¶
func (it *IssueCommentIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type IssueIterator ¶
type IssueIterator 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 []*issuetrackerpb.Issue, nextPageToken string, err error) // contains filtered or unexported fields }
IssueIterator manages a stream of *issuetrackerpb.Issue.
func (*IssueIterator) Next ¶
func (it *IssueIterator) Next() (*issuetrackerpb.Issue, 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 (*IssueIterator) PageInfo ¶
func (it *IssueIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type IssueUpdateIterator ¶
type IssueUpdateIterator 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 []*issuetrackerpb.IssueUpdate, nextPageToken string, err error) // contains filtered or unexported fields }
IssueUpdateIterator manages a stream of *issuetrackerpb.IssueUpdate.
func (*IssueUpdateIterator) Next ¶
func (it *IssueUpdateIterator) Next() (*issuetrackerpb.IssueUpdate, 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 (*IssueUpdateIterator) PageInfo ¶
func (it *IssueUpdateIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.