From 587bba5ad792a92f252107aa38c6af50fb09fb58 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 21 Oct 2021 09:38:21 -0700 Subject: [PATCH] chore(all): auto-regenerate gapics (#5010) This is an auto-generated regeneration of the gapic clients by cloud.google.com/go/internal/gapicgen. Once the corresponding genproto PR is submitted, genbot will update this PR with a newer dependency to the newer version of genproto and assign reviewers to this PR. If you have been assigned to review this PR, please: - Ensure that the version of genproto in go.mod has been updated. - Ensure that CI is passing. If it's failing, it requires your manual attention. - Approve and submit this PR if you believe it's ready to ship. Corresponding genproto PR: https://github.com/googleapis/go-genproto/pull/706 Changes: feat(dialogflow/cx): added API for changelogs docs: clarified semantic of the streaming APIs PiperOrigin-RevId: 404659561 Source-Link: https://github.com/googleapis/googleapis/commit/19943c118ea78ba30ed33c39922ec3577670d1e7 feat(dialogflow/cx): added API for changelogs docs: clarified semantic of the streaming APIs PiperOrigin-RevId: 404644767 Source-Link: https://github.com/googleapis/googleapis/commit/55fd11bc3d585b73bd9239daa567b5cfd5b84a3e fix(aiplatform): Remove invalid resource annotations Note: normally removing an annotation is a breaking change. However, the annotation here is invalid as it doesn't refer to a string field. Any generator which actually tried to use it in a meaningful way would either generate invalid code or fail to generate at all. Therefore removing it can't break anything. PiperOrigin-RevId: 404455880 Source-Link: https://github.com/googleapis/googleapis/commit/dc83df85270eeb79b3377d4091cefe99aaf6a21d --- aiplatform/apiv1/doc.go | 2 +- aiplatform/go.mod | 4 +- aiplatform/go.sum | 17 +- dialogflow/cx/apiv3/changelogs_client.go | 329 ++++++++++++++++++ .../apiv3/changelogs_client_example_test.go | 83 +++++ dialogflow/cx/apiv3/doc.go | 2 +- dialogflow/cx/apiv3/gapic_metadata.json | 19 + dialogflow/cx/apiv3beta1/changelogs_client.go | 329 ++++++++++++++++++ .../changelogs_client_example_test.go | 83 +++++ dialogflow/cx/apiv3beta1/doc.go | 2 +- dialogflow/cx/apiv3beta1/gapic_metadata.json | 19 + dialogflow/go.mod | 4 +- dialogflow/go.sum | 17 +- go.mod | 2 +- go.sum | 4 +- .../ChangelogsClient/GetChangelog/main.go | 48 +++ .../ChangelogsClient/ListChangelogs/main.go | 55 +++ .../ChangelogsClient/GetChangelog/main.go | 48 +++ .../ChangelogsClient/ListChangelogs/main.go | 55 +++ internal/generated/snippets/go.mod | 2 +- internal/generated/snippets/go.sum | 3 +- internal/godocfx/go.sum | 4 +- 22 files changed, 1101 insertions(+), 30 deletions(-) create mode 100644 dialogflow/cx/apiv3/changelogs_client.go create mode 100644 dialogflow/cx/apiv3/changelogs_client_example_test.go create mode 100644 dialogflow/cx/apiv3beta1/changelogs_client.go create mode 100644 dialogflow/cx/apiv3beta1/changelogs_client_example_test.go create mode 100644 internal/generated/snippets/dialogflow/cx/apiv3/ChangelogsClient/GetChangelog/main.go create mode 100644 internal/generated/snippets/dialogflow/cx/apiv3/ChangelogsClient/ListChangelogs/main.go create mode 100644 internal/generated/snippets/dialogflow/cx/apiv3beta1/ChangelogsClient/GetChangelog/main.go create mode 100644 internal/generated/snippets/dialogflow/cx/apiv3beta1/ChangelogsClient/ListChangelogs/main.go diff --git a/aiplatform/apiv1/doc.go b/aiplatform/apiv1/doc.go index ec6bfe9eba1..8aef09e7fd1 100644 --- a/aiplatform/apiv1/doc.go +++ b/aiplatform/apiv1/doc.go @@ -90,7 +90,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20211019" +const versionClient = "20211021" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/aiplatform/go.mod b/aiplatform/go.mod index ea1a3c979d4..7a86cdcb842 100644 --- a/aiplatform/go.mod +++ b/aiplatform/go.mod @@ -5,8 +5,8 @@ go 1.16 require ( cloud.google.com/go v0.97.0 github.com/googleapis/gax-go/v2 v2.1.1 - google.golang.org/api v0.58.0 - google.golang.org/genproto v0.0.0-20211019152133-63b7e35f4404 + google.golang.org/api v0.59.0 + google.golang.org/genproto v0.0.0-20211021150943-2b146023228c google.golang.org/grpc v1.40.0 google.golang.org/protobuf v1.27.1 ) diff --git a/aiplatform/go.sum b/aiplatform/go.sum index 3814484de7f..d5b6bd001f7 100644 --- a/aiplatform/go.sum +++ b/aiplatform/go.sum @@ -268,8 +268,9 @@ golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f h1:Qmd2pbz05z7z6lm0DrgQVVPuBm92jqujBKMHMOlOQEw= golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1 h1:B333XXssMuKQeBwiNODx4TupZy7bf4sxFZnN2ZOcvUE= +golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -326,8 +327,8 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210917161153-d61c044b1678 h1:J27LZFQBFoihqXoegpscI10HpjZ7B5WQLLKL2FZXQKw= -golang.org/x/sys v0.0.0-20210917161153-d61c044b1678/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac h1:oN6lz7iLW/YC7un8pq+9bOLyXrprv2+DKfkJY+2LJJw= +golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -426,8 +427,8 @@ google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6 google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= -google.golang.org/api v0.58.0 h1:MDkAbYIB1JpSgCTOCYYoIec/coMlKK4oVbpnBLLcyT0= -google.golang.org/api v0.58.0/go.mod h1:cAbP2FsxoGVNwtgNAmmn3y5G1TWAiVYRmg4yku3lv+E= +google.golang.org/api v0.59.0 h1:fPfFO7gttlXYo2ALuD3HxJzh8vaF++4youI0BkFL6GE= +google.golang.org/api v0.59.0/go.mod h1:sT2boj7M9YJxZzgeZqXogmhfmRWDtPzT31xkieUbuZU= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -491,10 +492,10 @@ google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEc google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210917145530-b395a37504d4/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211019152133-63b7e35f4404 h1:ZB48alYoIN+Soc1OcXirVKYOhOOf6Pek+iN+L+pzQI4= -google.golang.org/genproto v0.0.0-20211019152133-63b7e35f4404/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211008145708-270636b82663/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211021150943-2b146023228c h1:FqrtZMB5Wr+/RecOM3uPJNPfWR8Upb5hAPnt7PU6i4k= +google.golang.org/genproto v0.0.0-20211021150943-2b146023228c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/dialogflow/cx/apiv3/changelogs_client.go b/dialogflow/cx/apiv3/changelogs_client.go new file mode 100644 index 00000000000..b6b420bf971 --- /dev/null +++ b/dialogflow/cx/apiv3/changelogs_client.go @@ -0,0 +1,329 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go_gapic. DO NOT EDIT. + +package cx + +import ( + "context" + "fmt" + "math" + "net/url" + "time" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/iterator" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + gtransport "google.golang.org/api/transport/grpc" + cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" +) + +var newChangelogsClientHook clientHook + +// ChangelogsCallOptions contains the retry settings for each method of ChangelogsClient. +type ChangelogsCallOptions struct { + ListChangelogs []gax.CallOption + GetChangelog []gax.CallOption +} + +func defaultChangelogsGRPCClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("dialogflow.googleapis.com:443"), + internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), + internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), + option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), + option.WithGRPCDialOption(grpc.WithDefaultCallOptions( + grpc.MaxCallRecvMsgSize(math.MaxInt32))), + } +} + +func defaultChangelogsCallOptions() *ChangelogsCallOptions { + return &ChangelogsCallOptions{ + ListChangelogs: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.Unavailable, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, + GetChangelog: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.Unavailable, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, + } +} + +// internalChangelogsClient is an interface that defines the methods availaible from Dialogflow API. +type internalChangelogsClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + ListChangelogs(context.Context, *cxpb.ListChangelogsRequest, ...gax.CallOption) *ChangelogIterator + GetChangelog(context.Context, *cxpb.GetChangelogRequest, ...gax.CallOption) (*cxpb.Changelog, error) +} + +// ChangelogsClient is a client for interacting with Dialogflow API. +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +// +// Service for managing Changelogs. +type ChangelogsClient struct { + // The internal transport-dependent client. + internalClient internalChangelogsClient + + // The call options for this service. + CallOptions *ChangelogsCallOptions +} + +// Wrapper methods routed to the internal client. + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *ChangelogsClient) Close() error { + return c.internalClient.Close() +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *ChangelogsClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *ChangelogsClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// ListChangelogs returns the list of Changelogs. +func (c *ChangelogsClient) ListChangelogs(ctx context.Context, req *cxpb.ListChangelogsRequest, opts ...gax.CallOption) *ChangelogIterator { + return c.internalClient.ListChangelogs(ctx, req, opts...) +} + +// GetChangelog retrieves the specified Changelog. +func (c *ChangelogsClient) GetChangelog(ctx context.Context, req *cxpb.GetChangelogRequest, opts ...gax.CallOption) (*cxpb.Changelog, error) { + return c.internalClient.GetChangelog(ctx, req, opts...) +} + +// changelogsGRPCClient is a client for interacting with Dialogflow API over gRPC transport. +// +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type changelogsGRPCClient struct { + // Connection pool of gRPC connections to the service. + connPool gtransport.ConnPool + + // flag to opt out of default deadlines via GOOGLE_API_GO_EXPERIMENTAL_DISABLE_DEFAULT_DEADLINE + disableDeadlines bool + + // Points back to the CallOptions field of the containing ChangelogsClient + CallOptions **ChangelogsCallOptions + + // The gRPC API client. + changelogsClient cxpb.ChangelogsClient + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewChangelogsClient creates a new changelogs client based on gRPC. +// The returned client must be Closed when it is done being used to clean up its underlying connections. +// +// Service for managing Changelogs. +func NewChangelogsClient(ctx context.Context, opts ...option.ClientOption) (*ChangelogsClient, error) { + clientOpts := defaultChangelogsGRPCClientOptions() + if newChangelogsClientHook != nil { + hookOpts, err := newChangelogsClientHook(ctx, clientHookParams{}) + if err != nil { + return nil, err + } + clientOpts = append(clientOpts, hookOpts...) + } + + disableDeadlines, err := checkDisableDeadlines() + if err != nil { + return nil, err + } + + connPool, err := gtransport.DialPool(ctx, append(clientOpts, opts...)...) + if err != nil { + return nil, err + } + client := ChangelogsClient{CallOptions: defaultChangelogsCallOptions()} + + c := &changelogsGRPCClient{ + connPool: connPool, + disableDeadlines: disableDeadlines, + changelogsClient: cxpb.NewChangelogsClient(connPool), + CallOptions: &client.CallOptions, + } + c.setGoogleClientInfo() + + client.internalClient = c + + return &client, nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *changelogsGRPCClient) Connection() *grpc.ClientConn { + return c.connPool.Conn() +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *changelogsGRPCClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "grpc", grpc.Version) + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *changelogsGRPCClient) Close() error { + return c.connPool.Close() +} + +func (c *changelogsGRPCClient) ListChangelogs(ctx context.Context, req *cxpb.ListChangelogsRequest, opts ...gax.CallOption) *ChangelogIterator { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))) + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).ListChangelogs[0:len((*c.CallOptions).ListChangelogs):len((*c.CallOptions).ListChangelogs)], opts...) + it := &ChangelogIterator{} + req = proto.Clone(req).(*cxpb.ListChangelogsRequest) + it.InternalFetch = func(pageSize int, pageToken string) ([]*cxpb.Changelog, string, error) { + resp := &cxpb.ListChangelogsResponse{} + if pageToken != "" { + req.PageToken = pageToken + } + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else if pageSize != 0 { + req.PageSize = int32(pageSize) + } + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.changelogsClient.ListChangelogs(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, "", err + } + + it.Response = resp + return resp.GetChangelogs(), resp.GetNextPageToken(), nil + } + fetch := func(pageSize int, pageToken string) (string, error) { + items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) + if err != nil { + return "", err + } + it.items = append(it.items, items...) + return nextPageToken, nil + } + + it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) + it.pageInfo.MaxSize = int(req.GetPageSize()) + it.pageInfo.Token = req.GetPageToken() + + return it +} + +func (c *changelogsGRPCClient) GetChangelog(ctx context.Context, req *cxpb.GetChangelogRequest, opts ...gax.CallOption) (*cxpb.Changelog, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).GetChangelog[0:len((*c.CallOptions).GetChangelog):len((*c.CallOptions).GetChangelog)], opts...) + var resp *cxpb.Changelog + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.changelogsClient.GetChangelog(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +// ChangelogIterator manages a stream of *cxpb.Changelog. +type ChangelogIterator struct { + items []*cxpb.Changelog + pageInfo *iterator.PageInfo + nextFunc func() error + + // 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 []*cxpb.Changelog, nextPageToken string, err error) +} + +// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +func (it *ChangelogIterator) PageInfo() *iterator.PageInfo { + return it.pageInfo +} + +// 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 (it *ChangelogIterator) Next() (*cxpb.Changelog, error) { + var item *cxpb.Changelog + if err := it.nextFunc(); err != nil { + return item, err + } + item = it.items[0] + it.items = it.items[1:] + return item, nil +} + +func (it *ChangelogIterator) bufLen() int { + return len(it.items) +} + +func (it *ChangelogIterator) takeBuf() interface{} { + b := it.items + it.items = nil + return b +} diff --git a/dialogflow/cx/apiv3/changelogs_client_example_test.go b/dialogflow/cx/apiv3/changelogs_client_example_test.go new file mode 100644 index 00000000000..1b52dd51997 --- /dev/null +++ b/dialogflow/cx/apiv3/changelogs_client_example_test.go @@ -0,0 +1,83 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go_gapic. DO NOT EDIT. + +package cx_test + +import ( + "context" + + cx "cloud.google.com/go/dialogflow/cx/apiv3" + "google.golang.org/api/iterator" + cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3" +) + +func ExampleNewChangelogsClient() { + ctx := context.Background() + c, err := cx.NewChangelogsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleChangelogsClient_ListChangelogs() { + ctx := context.Background() + c, err := cx.NewChangelogsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &cxpb.ListChangelogsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3#ListChangelogsRequest. + } + it := c.ListChangelogs(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +func ExampleChangelogsClient_GetChangelog() { + ctx := context.Background() + c, err := cx.NewChangelogsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &cxpb.GetChangelogRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3#GetChangelogRequest. + } + resp, err := c.GetChangelog(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/dialogflow/cx/apiv3/doc.go b/dialogflow/cx/apiv3/doc.go index 894979927f0..ffb97d46bf6 100644 --- a/dialogflow/cx/apiv3/doc.go +++ b/dialogflow/cx/apiv3/doc.go @@ -91,7 +91,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20211019" +const versionClient = "20211021" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/dialogflow/cx/apiv3/gapic_metadata.json b/dialogflow/cx/apiv3/gapic_metadata.json index e9acf025930..0c851d91a67 100644 --- a/dialogflow/cx/apiv3/gapic_metadata.json +++ b/dialogflow/cx/apiv3/gapic_metadata.json @@ -59,6 +59,25 @@ } } }, + "Changelogs": { + "clients": { + "grpc": { + "libraryClient": "ChangelogsClient", + "rpcs": { + "GetChangelog": { + "methods": [ + "GetChangelog" + ] + }, + "ListChangelogs": { + "methods": [ + "ListChangelogs" + ] + } + } + } + } + }, "Deployments": { "clients": { "grpc": { diff --git a/dialogflow/cx/apiv3beta1/changelogs_client.go b/dialogflow/cx/apiv3beta1/changelogs_client.go new file mode 100644 index 00000000000..609c7656a55 --- /dev/null +++ b/dialogflow/cx/apiv3beta1/changelogs_client.go @@ -0,0 +1,329 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go_gapic. DO NOT EDIT. + +package cx + +import ( + "context" + "fmt" + "math" + "net/url" + "time" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/iterator" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + gtransport "google.golang.org/api/transport/grpc" + cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" +) + +var newChangelogsClientHook clientHook + +// ChangelogsCallOptions contains the retry settings for each method of ChangelogsClient. +type ChangelogsCallOptions struct { + ListChangelogs []gax.CallOption + GetChangelog []gax.CallOption +} + +func defaultChangelogsGRPCClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("dialogflow.googleapis.com:443"), + internaloption.WithDefaultMTLSEndpoint("dialogflow.mtls.googleapis.com:443"), + internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), + option.WithGRPCDialOption(grpc.WithDisableServiceConfig()), + option.WithGRPCDialOption(grpc.WithDefaultCallOptions( + grpc.MaxCallRecvMsgSize(math.MaxInt32))), + } +} + +func defaultChangelogsCallOptions() *ChangelogsCallOptions { + return &ChangelogsCallOptions{ + ListChangelogs: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.Unavailable, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, + GetChangelog: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.Unavailable, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, + } +} + +// internalChangelogsClient is an interface that defines the methods availaible from Dialogflow API. +type internalChangelogsClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + ListChangelogs(context.Context, *cxpb.ListChangelogsRequest, ...gax.CallOption) *ChangelogIterator + GetChangelog(context.Context, *cxpb.GetChangelogRequest, ...gax.CallOption) (*cxpb.Changelog, error) +} + +// ChangelogsClient is a client for interacting with Dialogflow API. +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +// +// Service for managing Changelogs. +type ChangelogsClient struct { + // The internal transport-dependent client. + internalClient internalChangelogsClient + + // The call options for this service. + CallOptions *ChangelogsCallOptions +} + +// Wrapper methods routed to the internal client. + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *ChangelogsClient) Close() error { + return c.internalClient.Close() +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *ChangelogsClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *ChangelogsClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// ListChangelogs returns the list of Changelogs. +func (c *ChangelogsClient) ListChangelogs(ctx context.Context, req *cxpb.ListChangelogsRequest, opts ...gax.CallOption) *ChangelogIterator { + return c.internalClient.ListChangelogs(ctx, req, opts...) +} + +// GetChangelog retrieves the specified Changelog. +func (c *ChangelogsClient) GetChangelog(ctx context.Context, req *cxpb.GetChangelogRequest, opts ...gax.CallOption) (*cxpb.Changelog, error) { + return c.internalClient.GetChangelog(ctx, req, opts...) +} + +// changelogsGRPCClient is a client for interacting with Dialogflow API over gRPC transport. +// +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type changelogsGRPCClient struct { + // Connection pool of gRPC connections to the service. + connPool gtransport.ConnPool + + // flag to opt out of default deadlines via GOOGLE_API_GO_EXPERIMENTAL_DISABLE_DEFAULT_DEADLINE + disableDeadlines bool + + // Points back to the CallOptions field of the containing ChangelogsClient + CallOptions **ChangelogsCallOptions + + // The gRPC API client. + changelogsClient cxpb.ChangelogsClient + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewChangelogsClient creates a new changelogs client based on gRPC. +// The returned client must be Closed when it is done being used to clean up its underlying connections. +// +// Service for managing Changelogs. +func NewChangelogsClient(ctx context.Context, opts ...option.ClientOption) (*ChangelogsClient, error) { + clientOpts := defaultChangelogsGRPCClientOptions() + if newChangelogsClientHook != nil { + hookOpts, err := newChangelogsClientHook(ctx, clientHookParams{}) + if err != nil { + return nil, err + } + clientOpts = append(clientOpts, hookOpts...) + } + + disableDeadlines, err := checkDisableDeadlines() + if err != nil { + return nil, err + } + + connPool, err := gtransport.DialPool(ctx, append(clientOpts, opts...)...) + if err != nil { + return nil, err + } + client := ChangelogsClient{CallOptions: defaultChangelogsCallOptions()} + + c := &changelogsGRPCClient{ + connPool: connPool, + disableDeadlines: disableDeadlines, + changelogsClient: cxpb.NewChangelogsClient(connPool), + CallOptions: &client.CallOptions, + } + c.setGoogleClientInfo() + + client.internalClient = c + + return &client, nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *changelogsGRPCClient) Connection() *grpc.ClientConn { + return c.connPool.Conn() +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *changelogsGRPCClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", versionClient, "gax", gax.Version, "grpc", grpc.Version) + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *changelogsGRPCClient) Close() error { + return c.connPool.Close() +} + +func (c *changelogsGRPCClient) ListChangelogs(ctx context.Context, req *cxpb.ListChangelogsRequest, opts ...gax.CallOption) *ChangelogIterator { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))) + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).ListChangelogs[0:len((*c.CallOptions).ListChangelogs):len((*c.CallOptions).ListChangelogs)], opts...) + it := &ChangelogIterator{} + req = proto.Clone(req).(*cxpb.ListChangelogsRequest) + it.InternalFetch = func(pageSize int, pageToken string) ([]*cxpb.Changelog, string, error) { + resp := &cxpb.ListChangelogsResponse{} + if pageToken != "" { + req.PageToken = pageToken + } + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else if pageSize != 0 { + req.PageSize = int32(pageSize) + } + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.changelogsClient.ListChangelogs(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, "", err + } + + it.Response = resp + return resp.GetChangelogs(), resp.GetNextPageToken(), nil + } + fetch := func(pageSize int, pageToken string) (string, error) { + items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) + if err != nil { + return "", err + } + it.items = append(it.items, items...) + return nextPageToken, nil + } + + it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) + it.pageInfo.MaxSize = int(req.GetPageSize()) + it.pageInfo.Token = req.GetPageToken() + + return it +} + +func (c *changelogsGRPCClient) GetChangelog(ctx context.Context, req *cxpb.GetChangelogRequest, opts ...gax.CallOption) (*cxpb.Changelog, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).GetChangelog[0:len((*c.CallOptions).GetChangelog):len((*c.CallOptions).GetChangelog)], opts...) + var resp *cxpb.Changelog + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.changelogsClient.GetChangelog(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +// ChangelogIterator manages a stream of *cxpb.Changelog. +type ChangelogIterator struct { + items []*cxpb.Changelog + pageInfo *iterator.PageInfo + nextFunc func() error + + // 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 []*cxpb.Changelog, nextPageToken string, err error) +} + +// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +func (it *ChangelogIterator) PageInfo() *iterator.PageInfo { + return it.pageInfo +} + +// 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 (it *ChangelogIterator) Next() (*cxpb.Changelog, error) { + var item *cxpb.Changelog + if err := it.nextFunc(); err != nil { + return item, err + } + item = it.items[0] + it.items = it.items[1:] + return item, nil +} + +func (it *ChangelogIterator) bufLen() int { + return len(it.items) +} + +func (it *ChangelogIterator) takeBuf() interface{} { + b := it.items + it.items = nil + return b +} diff --git a/dialogflow/cx/apiv3beta1/changelogs_client_example_test.go b/dialogflow/cx/apiv3beta1/changelogs_client_example_test.go new file mode 100644 index 00000000000..82eb587627a --- /dev/null +++ b/dialogflow/cx/apiv3beta1/changelogs_client_example_test.go @@ -0,0 +1,83 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go_gapic. DO NOT EDIT. + +package cx_test + +import ( + "context" + + cx "cloud.google.com/go/dialogflow/cx/apiv3beta1" + "google.golang.org/api/iterator" + cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1" +) + +func ExampleNewChangelogsClient() { + ctx := context.Background() + c, err := cx.NewChangelogsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleChangelogsClient_ListChangelogs() { + ctx := context.Background() + c, err := cx.NewChangelogsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &cxpb.ListChangelogsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1#ListChangelogsRequest. + } + it := c.ListChangelogs(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +func ExampleChangelogsClient_GetChangelog() { + ctx := context.Background() + c, err := cx.NewChangelogsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &cxpb.GetChangelogRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1#GetChangelogRequest. + } + resp, err := c.GetChangelog(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/dialogflow/cx/apiv3beta1/doc.go b/dialogflow/cx/apiv3beta1/doc.go index 2ae93081427..da206b4b167 100644 --- a/dialogflow/cx/apiv3beta1/doc.go +++ b/dialogflow/cx/apiv3beta1/doc.go @@ -93,7 +93,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20211019" +const versionClient = "20211021" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/dialogflow/cx/apiv3beta1/gapic_metadata.json b/dialogflow/cx/apiv3beta1/gapic_metadata.json index 812f1ad0982..63b98af8191 100644 --- a/dialogflow/cx/apiv3beta1/gapic_metadata.json +++ b/dialogflow/cx/apiv3beta1/gapic_metadata.json @@ -59,6 +59,25 @@ } } }, + "Changelogs": { + "clients": { + "grpc": { + "libraryClient": "ChangelogsClient", + "rpcs": { + "GetChangelog": { + "methods": [ + "GetChangelog" + ] + }, + "ListChangelogs": { + "methods": [ + "ListChangelogs" + ] + } + } + } + } + }, "Deployments": { "clients": { "grpc": { diff --git a/dialogflow/go.mod b/dialogflow/go.mod index b268e4c1a04..303b8180879 100644 --- a/dialogflow/go.mod +++ b/dialogflow/go.mod @@ -6,8 +6,8 @@ require ( cloud.google.com/go v0.97.0 github.com/golang/protobuf v1.5.2 github.com/googleapis/gax-go/v2 v2.1.1 - google.golang.org/api v0.58.0 - google.golang.org/genproto v0.0.0-20211019152133-63b7e35f4404 + google.golang.org/api v0.59.0 + google.golang.org/genproto v0.0.0-20211021150943-2b146023228c google.golang.org/grpc v1.40.0 google.golang.org/protobuf v1.27.1 ) diff --git a/dialogflow/go.sum b/dialogflow/go.sum index 3814484de7f..d5b6bd001f7 100644 --- a/dialogflow/go.sum +++ b/dialogflow/go.sum @@ -268,8 +268,9 @@ golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f h1:Qmd2pbz05z7z6lm0DrgQVVPuBm92jqujBKMHMOlOQEw= golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1 h1:B333XXssMuKQeBwiNODx4TupZy7bf4sxFZnN2ZOcvUE= +golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -326,8 +327,8 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210917161153-d61c044b1678 h1:J27LZFQBFoihqXoegpscI10HpjZ7B5WQLLKL2FZXQKw= -golang.org/x/sys v0.0.0-20210917161153-d61c044b1678/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac h1:oN6lz7iLW/YC7un8pq+9bOLyXrprv2+DKfkJY+2LJJw= +golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -426,8 +427,8 @@ google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6 google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= -google.golang.org/api v0.58.0 h1:MDkAbYIB1JpSgCTOCYYoIec/coMlKK4oVbpnBLLcyT0= -google.golang.org/api v0.58.0/go.mod h1:cAbP2FsxoGVNwtgNAmmn3y5G1TWAiVYRmg4yku3lv+E= +google.golang.org/api v0.59.0 h1:fPfFO7gttlXYo2ALuD3HxJzh8vaF++4youI0BkFL6GE= +google.golang.org/api v0.59.0/go.mod h1:sT2boj7M9YJxZzgeZqXogmhfmRWDtPzT31xkieUbuZU= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -491,10 +492,10 @@ google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEc google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210917145530-b395a37504d4/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211019152133-63b7e35f4404 h1:ZB48alYoIN+Soc1OcXirVKYOhOOf6Pek+iN+L+pzQI4= -google.golang.org/genproto v0.0.0-20211019152133-63b7e35f4404/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211008145708-270636b82663/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211021150943-2b146023228c h1:FqrtZMB5Wr+/RecOM3uPJNPfWR8Upb5hAPnt7PU6i4k= +google.golang.org/genproto v0.0.0-20211021150943-2b146023228c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/go.mod b/go.mod index 39b9d249fd7..bc64e8f86e6 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1 golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 google.golang.org/api v0.59.0 - google.golang.org/genproto v0.0.0-20211020151524-b7c3a969101a + google.golang.org/genproto v0.0.0-20211021150943-2b146023228c google.golang.org/grpc v1.40.0 google.golang.org/protobuf v1.27.1 ) diff --git a/go.sum b/go.sum index bfae16732dc..5fe699bd608 100644 --- a/go.sum +++ b/go.sum @@ -497,8 +497,8 @@ google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEc google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211008145708-270636b82663/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211020151524-b7c3a969101a h1:8maMHMQp9NroHXhc3HelFX9Ay2lWlXLcdH5mw5Biz0s= -google.golang.org/genproto v0.0.0-20211020151524-b7c3a969101a/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211021150943-2b146023228c h1:FqrtZMB5Wr+/RecOM3uPJNPfWR8Upb5hAPnt7PU6i4k= +google.golang.org/genproto v0.0.0-20211021150943-2b146023228c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/internal/generated/snippets/dialogflow/cx/apiv3/ChangelogsClient/GetChangelog/main.go b/internal/generated/snippets/dialogflow/cx/apiv3/ChangelogsClient/GetChangelog/main.go new file mode 100644 index 00000000000..ed3aad2c2fe --- /dev/null +++ b/internal/generated/snippets/dialogflow/cx/apiv3/ChangelogsClient/GetChangelog/main.go @@ -0,0 +1,48 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START dialogflow_v3_generated_Changelogs_GetChangelog_sync] + +package main + +import ( + "context" + + cx "cloud.google.com/go/dialogflow/cx/apiv3" + cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3" +) + +func main() { + ctx := context.Background() + c, err := cx.NewChangelogsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &cxpb.GetChangelogRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3#GetChangelogRequest. + } + resp, err := c.GetChangelog(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END dialogflow_v3_generated_Changelogs_GetChangelog_sync] diff --git a/internal/generated/snippets/dialogflow/cx/apiv3/ChangelogsClient/ListChangelogs/main.go b/internal/generated/snippets/dialogflow/cx/apiv3/ChangelogsClient/ListChangelogs/main.go new file mode 100644 index 00000000000..7c8d452a85d --- /dev/null +++ b/internal/generated/snippets/dialogflow/cx/apiv3/ChangelogsClient/ListChangelogs/main.go @@ -0,0 +1,55 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START dialogflow_v3_generated_Changelogs_ListChangelogs_sync] + +package main + +import ( + "context" + + cx "cloud.google.com/go/dialogflow/cx/apiv3" + "google.golang.org/api/iterator" + cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3" +) + +func main() { + ctx := context.Background() + c, err := cx.NewChangelogsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &cxpb.ListChangelogsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3#ListChangelogsRequest. + } + it := c.ListChangelogs(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END dialogflow_v3_generated_Changelogs_ListChangelogs_sync] diff --git a/internal/generated/snippets/dialogflow/cx/apiv3beta1/ChangelogsClient/GetChangelog/main.go b/internal/generated/snippets/dialogflow/cx/apiv3beta1/ChangelogsClient/GetChangelog/main.go new file mode 100644 index 00000000000..e2c255436aa --- /dev/null +++ b/internal/generated/snippets/dialogflow/cx/apiv3beta1/ChangelogsClient/GetChangelog/main.go @@ -0,0 +1,48 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START dialogflow_v3beta1_generated_Changelogs_GetChangelog_sync] + +package main + +import ( + "context" + + cx "cloud.google.com/go/dialogflow/cx/apiv3beta1" + cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1" +) + +func main() { + ctx := context.Background() + c, err := cx.NewChangelogsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &cxpb.GetChangelogRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1#GetChangelogRequest. + } + resp, err := c.GetChangelog(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END dialogflow_v3beta1_generated_Changelogs_GetChangelog_sync] diff --git a/internal/generated/snippets/dialogflow/cx/apiv3beta1/ChangelogsClient/ListChangelogs/main.go b/internal/generated/snippets/dialogflow/cx/apiv3beta1/ChangelogsClient/ListChangelogs/main.go new file mode 100644 index 00000000000..1a80bddc6c0 --- /dev/null +++ b/internal/generated/snippets/dialogflow/cx/apiv3beta1/ChangelogsClient/ListChangelogs/main.go @@ -0,0 +1,55 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START dialogflow_v3beta1_generated_Changelogs_ListChangelogs_sync] + +package main + +import ( + "context" + + cx "cloud.google.com/go/dialogflow/cx/apiv3beta1" + "google.golang.org/api/iterator" + cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1" +) + +func main() { + ctx := context.Background() + c, err := cx.NewChangelogsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &cxpb.ListChangelogsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1#ListChangelogsRequest. + } + it := c.ListChangelogs(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END dialogflow_v3beta1_generated_Changelogs_ListChangelogs_sync] diff --git a/internal/generated/snippets/go.mod b/internal/generated/snippets/go.mod index 7571204e6d9..240a23359f5 100644 --- a/internal/generated/snippets/go.mod +++ b/internal/generated/snippets/go.mod @@ -125,7 +125,7 @@ require ( cloud.google.com/go/websecurityscanner v0.1.0 cloud.google.com/go/workflows v0.1.0 google.golang.org/api v0.59.0 - google.golang.org/genproto v0.0.0-20211020151524-b7c3a969101a + google.golang.org/genproto v0.0.0-20211021150943-2b146023228c ) replace cloud.google.com/go/storagetransfer => ../../../storagetransfer diff --git a/internal/generated/snippets/go.sum b/internal/generated/snippets/go.sum index af7b86c49d5..fbd9c158157 100644 --- a/internal/generated/snippets/go.sum +++ b/internal/generated/snippets/go.sum @@ -160,8 +160,9 @@ google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEc google.golang.org/genproto v0.0.0-20210917145530-b395a37504d4/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20211008145708-270636b82663/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211019152133-63b7e35f4404/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211020151524-b7c3a969101a h1:8maMHMQp9NroHXhc3HelFX9Ay2lWlXLcdH5mw5Biz0s= google.golang.org/genproto v0.0.0-20211020151524-b7c3a969101a/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211021150943-2b146023228c h1:FqrtZMB5Wr+/RecOM3uPJNPfWR8Upb5hAPnt7PU6i4k= +google.golang.org/genproto v0.0.0-20211021150943-2b146023228c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= diff --git a/internal/godocfx/go.sum b/internal/godocfx/go.sum index daa41447d97..74c579bd7d8 100644 --- a/internal/godocfx/go.sum +++ b/internal/godocfx/go.sum @@ -314,8 +314,8 @@ google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEc google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20211008145708-270636b82663/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211020151524-b7c3a969101a h1:8maMHMQp9NroHXhc3HelFX9Ay2lWlXLcdH5mw5Biz0s= -google.golang.org/genproto v0.0.0-20211020151524-b7c3a969101a/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211021150943-2b146023228c h1:FqrtZMB5Wr+/RecOM3uPJNPfWR8Upb5hAPnt7PU6i4k= +google.golang.org/genproto v0.0.0-20211021150943-2b146023228c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=