diff --git a/dialogflow/go.mod b/dialogflow/go.mod index 05c1e987f63e..2bb1f8749ed1 100644 --- a/dialogflow/go.mod +++ b/dialogflow/go.mod @@ -7,7 +7,7 @@ require ( github.com/golang/protobuf v1.5.2 github.com/googleapis/gax-go/v2 v2.2.0 google.golang.org/api v0.73.0 - google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6 + google.golang.org/genproto v0.0.0-20220329135034-5a5e19f58d62 google.golang.org/grpc v1.45.0 google.golang.org/protobuf v1.28.0 ) diff --git a/dialogflow/go.sum b/dialogflow/go.sum index c42e86ef06b8..8edb52ee2ae7 100644 --- a/dialogflow/go.sum +++ b/dialogflow/go.sum @@ -535,8 +535,9 @@ google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ6 google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6 h1:FglFEfyj61zP3c6LgjmVHxYxZWXYul9oiS1EZqD5gLc= google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220329135034-5a5e19f58d62 h1:IPy3YJ7uYPB1sDNJRs/b7Dgs6KxwMyGYgtIgDnKgEyw= +google.golang.org/genproto v0.0.0-20220329135034-5a5e19f58d62/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= 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/dlp/go.mod b/dlp/go.mod index f6012b5756b6..a5de159d5140 100644 --- a/dlp/go.mod +++ b/dlp/go.mod @@ -6,7 +6,7 @@ require ( github.com/golang/protobuf v1.5.2 github.com/googleapis/gax-go/v2 v2.2.0 google.golang.org/api v0.73.0 - google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6 + google.golang.org/genproto v0.0.0-20220329135034-5a5e19f58d62 google.golang.org/grpc v1.45.0 google.golang.org/protobuf v1.28.0 ) diff --git a/dlp/go.sum b/dlp/go.sum index c42e86ef06b8..8edb52ee2ae7 100644 --- a/dlp/go.sum +++ b/dlp/go.sum @@ -535,8 +535,9 @@ google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ6 google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6 h1:FglFEfyj61zP3c6LgjmVHxYxZWXYul9oiS1EZqD5gLc= google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220329135034-5a5e19f58d62 h1:IPy3YJ7uYPB1sDNJRs/b7Dgs6KxwMyGYgtIgDnKgEyw= +google.golang.org/genproto v0.0.0-20220329135034-5a5e19f58d62/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= 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/gaming/go.mod b/gaming/go.mod index da2b0af5d29a..fbec88d813dc 100644 --- a/gaming/go.mod +++ b/gaming/go.mod @@ -6,7 +6,7 @@ require ( cloud.google.com/go v0.100.2 github.com/googleapis/gax-go/v2 v2.2.0 google.golang.org/api v0.73.0 - google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6 + google.golang.org/genproto v0.0.0-20220329135034-5a5e19f58d62 google.golang.org/grpc v1.45.0 google.golang.org/protobuf v1.28.0 ) diff --git a/gaming/go.sum b/gaming/go.sum index c42e86ef06b8..8edb52ee2ae7 100644 --- a/gaming/go.sum +++ b/gaming/go.sum @@ -535,8 +535,9 @@ google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ6 google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6 h1:FglFEfyj61zP3c6LgjmVHxYxZWXYul9oiS1EZqD5gLc= google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220329135034-5a5e19f58d62 h1:IPy3YJ7uYPB1sDNJRs/b7Dgs6KxwMyGYgtIgDnKgEyw= +google.golang.org/genproto v0.0.0-20220329135034-5a5e19f58d62/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= 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 9a5abce83e1b..13322666c0a2 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 google.golang.org/api v0.73.0 - google.golang.org/genproto v0.0.0-20220328180837-c47567c462d1 + google.golang.org/genproto v0.0.0-20220329135034-5a5e19f58d62 google.golang.org/grpc v1.45.0 google.golang.org/protobuf v1.28.0 ) diff --git a/go.sum b/go.sum index 2d20187c5814..ffc2c6e46eef 100644 --- a/go.sum +++ b/go.sum @@ -556,8 +556,8 @@ google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2 google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220328180837-c47567c462d1 h1:t2YeOD7KxzUL6g5yg4+aCD/Fc0gk+O31HMo09I/QVIM= -google.golang.org/genproto v0.0.0-20220328180837-c47567c462d1/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220329135034-5a5e19f58d62 h1:IPy3YJ7uYPB1sDNJRs/b7Dgs6KxwMyGYgtIgDnKgEyw= +google.golang.org/genproto v0.0.0-20220329135034-5a5e19f58d62/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= 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/go.mod b/internal/generated/snippets/go.mod index bb47dbb5711e..d055e9ac0803 100644 --- a/internal/generated/snippets/go.mod +++ b/internal/generated/snippets/go.mod @@ -113,7 +113,7 @@ require ( cloud.google.com/go/workflows v1.1.0 github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect google.golang.org/api v0.73.0 - google.golang.org/genproto v0.0.0-20220328180837-c47567c462d1 + google.golang.org/genproto v0.0.0-20220329135034-5a5e19f58d62 ) replace cloud.google.com/go/storagetransfer => ../../../storagetransfer diff --git a/internal/generated/snippets/go.sum b/internal/generated/snippets/go.sum index 7b2a2968b3c7..c9a3e4221cc7 100644 --- a/internal/generated/snippets/go.sum +++ b/internal/generated/snippets/go.sum @@ -189,8 +189,9 @@ google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2I google.golang.org/genproto v0.0.0-20220317150908-0efb43f6373e/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= google.golang.org/genproto v0.0.0-20220322021311-435b647f9ef2/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= google.golang.org/genproto v0.0.0-20220323144105-ec3c684e5b14/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20220328180837-c47567c462d1 h1:t2YeOD7KxzUL6g5yg4+aCD/Fc0gk+O31HMo09I/QVIM= google.golang.org/genproto v0.0.0-20220328180837-c47567c462d1/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220329135034-5a5e19f58d62 h1:IPy3YJ7uYPB1sDNJRs/b7Dgs6KxwMyGYgtIgDnKgEyw= +google.golang.org/genproto v0.0.0-20220329135034-5a5e19f58d62/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= 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/generated/snippets/retail/apiv2/ProductClient/AddLocalInventories/main.go b/internal/generated/snippets/retail/apiv2/ProductClient/AddLocalInventories/main.go new file mode 100644 index 000000000000..0d567b06ca22 --- /dev/null +++ b/internal/generated/snippets/retail/apiv2/ProductClient/AddLocalInventories/main.go @@ -0,0 +1,53 @@ +// Copyright 2022 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 retail_v2_generated_ProductService_AddLocalInventories_sync] + +package main + +import ( + "context" + + retail "cloud.google.com/go/retail/apiv2" + retailpb "google.golang.org/genproto/googleapis/cloud/retail/v2" +) + +func main() { + ctx := context.Background() + c, err := retail.NewProductClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &retailpb.AddLocalInventoriesRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/retail/v2#AddLocalInventoriesRequest. + } + op, err := c.AddLocalInventories(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END retail_v2_generated_ProductService_AddLocalInventories_sync] diff --git a/internal/generated/snippets/retail/apiv2/ProductClient/RemoveLocalInventories/main.go b/internal/generated/snippets/retail/apiv2/ProductClient/RemoveLocalInventories/main.go new file mode 100644 index 000000000000..afe08e018b2a --- /dev/null +++ b/internal/generated/snippets/retail/apiv2/ProductClient/RemoveLocalInventories/main.go @@ -0,0 +1,53 @@ +// Copyright 2022 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 retail_v2_generated_ProductService_RemoveLocalInventories_sync] + +package main + +import ( + "context" + + retail "cloud.google.com/go/retail/apiv2" + retailpb "google.golang.org/genproto/googleapis/cloud/retail/v2" +) + +func main() { + ctx := context.Background() + c, err := retail.NewProductClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &retailpb.RemoveLocalInventoriesRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/retail/v2#RemoveLocalInventoriesRequest. + } + op, err := c.RemoveLocalInventories(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END retail_v2_generated_ProductService_RemoveLocalInventories_sync] diff --git a/internal/godocfx/go.sum b/internal/godocfx/go.sum index fadc8b7c73e0..33d1d5e346a9 100644 --- a/internal/godocfx/go.sum +++ b/internal/godocfx/go.sum @@ -222,8 +222,8 @@ google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2 google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220328180837-c47567c462d1 h1:t2YeOD7KxzUL6g5yg4+aCD/Fc0gk+O31HMo09I/QVIM= -google.golang.org/genproto v0.0.0-20220328180837-c47567c462d1/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220329135034-5a5e19f58d62 h1:IPy3YJ7uYPB1sDNJRs/b7Dgs6KxwMyGYgtIgDnKgEyw= +google.golang.org/genproto v0.0.0-20220329135034-5a5e19f58d62/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= 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/retail/apiv2/catalog_client.go b/retail/apiv2/catalog_client.go index 5e8bb992b1e7..49b3a6a365a0 100644 --- a/retail/apiv2/catalog_client.go +++ b/retail/apiv2/catalog_client.go @@ -201,10 +201,6 @@ func (c *CatalogClient) UpdateCatalog(ctx context.Context, req *retailpb.UpdateC // // UserEventService will only join events with products from branch // {newBranch}. -// -// This feature is only available for users who have Retail Search enabled. -// Please submit a form here (at https://cloud.google.com/contact) to contact -// cloud sales if you are interested in using Retail Search. func (c *CatalogClient) SetDefaultBranch(ctx context.Context, req *retailpb.SetDefaultBranchRequest, opts ...gax.CallOption) error { return c.internalClient.SetDefaultBranch(ctx, req, opts...) } @@ -212,10 +208,6 @@ func (c *CatalogClient) SetDefaultBranch(ctx context.Context, req *retailpb.SetD // GetDefaultBranch get which branch is currently default branch set by // CatalogService.SetDefaultBranch // method under a specified parent catalog. -// -// This feature is only available for users who have Retail Search enabled. -// Please submit a form here (at https://cloud.google.com/contact) to contact -// cloud sales if you are interested in using Retail Search. func (c *CatalogClient) GetDefaultBranch(ctx context.Context, req *retailpb.GetDefaultBranchRequest, opts ...gax.CallOption) (*retailpb.GetDefaultBranchResponse, error) { return c.internalClient.GetDefaultBranch(ctx, req, opts...) } diff --git a/retail/apiv2/completion_client.go b/retail/apiv2/completion_client.go index 4d1299d63546..9784d093d7dc 100644 --- a/retail/apiv2/completion_client.go +++ b/retail/apiv2/completion_client.go @@ -101,8 +101,7 @@ type internalCompletionClient interface { // Auto-completion service for retail. // // This feature is only available for users who have Retail Search enabled. -// Please submit a form here (at https://cloud.google.com/contact) to contact -// cloud sales if you are interested in using Retail Search. +// Please enable Retail Search on Cloud Console before using this feature. type CompletionClient struct { // The internal transport-dependent client. internalClient internalCompletionClient @@ -141,19 +140,20 @@ func (c *CompletionClient) Connection() *grpc.ClientConn { // CompleteQuery completes the specified prefix with keyword suggestions. // // This feature is only available for users who have Retail Search enabled. -// Please submit a form here (at https://cloud.google.com/contact) to contact -// cloud sales if you are interested in using Retail Search. +// Please enable Retail Search on Cloud Console before using this feature. func (c *CompletionClient) CompleteQuery(ctx context.Context, req *retailpb.CompleteQueryRequest, opts ...gax.CallOption) (*retailpb.CompleteQueryResponse, error) { return c.internalClient.CompleteQuery(ctx, req, opts...) } // ImportCompletionData bulk import of processed completion dataset. // -// Request processing may be synchronous. Partial updating is not supported. +// Request processing is asynchronous. Partial updating is not supported. +// +// The operation is successfully finished only after the imported suggestions +// are indexed successfully and ready for serving. The process takes hours. // // This feature is only available for users who have Retail Search enabled. -// Please submit a form here (at https://cloud.google.com/contact) to contact -// cloud sales if you are interested in using Retail Search. +// Please enable Retail Search on Cloud Console before using this feature. func (c *CompletionClient) ImportCompletionData(ctx context.Context, req *retailpb.ImportCompletionDataRequest, opts ...gax.CallOption) (*ImportCompletionDataOperation, error) { return c.internalClient.ImportCompletionData(ctx, req, opts...) } @@ -195,8 +195,7 @@ type completionGRPCClient struct { // Auto-completion service for retail. // // This feature is only available for users who have Retail Search enabled. -// Please submit a form here (at https://cloud.google.com/contact) to contact -// cloud sales if you are interested in using Retail Search. +// Please enable Retail Search on Cloud Console before using this feature. func NewCompletionClient(ctx context.Context, opts ...option.ClientOption) (*CompletionClient, error) { clientOpts := defaultCompletionGRPCClientOptions() if newCompletionClientHook != nil { diff --git a/retail/apiv2/gapic_metadata.json b/retail/apiv2/gapic_metadata.json index 244d44dc550d..ab18ecfd24d8 100644 --- a/retail/apiv2/gapic_metadata.json +++ b/retail/apiv2/gapic_metadata.json @@ -77,6 +77,11 @@ "AddFulfillmentPlaces" ] }, + "AddLocalInventories": { + "methods": [ + "AddLocalInventories" + ] + }, "CreateProduct": { "methods": [ "CreateProduct" @@ -107,6 +112,11 @@ "RemoveFulfillmentPlaces" ] }, + "RemoveLocalInventories": { + "methods": [ + "RemoveLocalInventories" + ] + }, "SetInventory": { "methods": [ "SetInventory" diff --git a/retail/apiv2/product_client.go b/retail/apiv2/product_client.go index 302e64c1b809..a14b0303dbcf 100644 --- a/retail/apiv2/product_client.go +++ b/retail/apiv2/product_client.go @@ -51,6 +51,8 @@ type ProductCallOptions struct { SetInventory []gax.CallOption AddFulfillmentPlaces []gax.CallOption RemoveFulfillmentPlaces []gax.CallOption + AddLocalInventories []gax.CallOption + RemoveLocalInventories []gax.CallOption } func defaultProductGRPCClientOptions() []option.ClientOption { @@ -175,6 +177,30 @@ func defaultProductCallOptions() *ProductCallOptions { }) }), }, + AddLocalInventories: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.Unavailable, + codes.DeadlineExceeded, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 30000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, + RemoveLocalInventories: []gax.CallOption{ + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.Unavailable, + codes.DeadlineExceeded, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 30000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, } } @@ -196,6 +222,10 @@ type internalProductClient interface { AddFulfillmentPlacesOperation(name string) *AddFulfillmentPlacesOperation RemoveFulfillmentPlaces(context.Context, *retailpb.RemoveFulfillmentPlacesRequest, ...gax.CallOption) (*RemoveFulfillmentPlacesOperation, error) RemoveFulfillmentPlacesOperation(name string) *RemoveFulfillmentPlacesOperation + AddLocalInventories(context.Context, *retailpb.AddLocalInventoriesRequest, ...gax.CallOption) (*AddLocalInventoriesOperation, error) + AddLocalInventoriesOperation(name string) *AddLocalInventoriesOperation + RemoveLocalInventories(context.Context, *retailpb.RemoveLocalInventoriesRequest, ...gax.CallOption) (*RemoveLocalInventoriesOperation, error) + RemoveLocalInventoriesOperation(name string) *RemoveLocalInventoriesOperation } // ProductClient is a client for interacting with Retail API. @@ -308,7 +338,8 @@ func (c *ProductClient) ImportProductsOperation(name string) *ImportProductsOper // CreateProductRequest.product, // then any pre-existing inventory information for this product will be used. // -// If no inventory fields are set in UpdateProductRequest.set_mask, +// If no inventory fields are set in +// SetInventoryRequest.set_mask, // then any existing inventory information will be preserved. // // Pre-existing inventory information can only be updated with @@ -318,8 +349,7 @@ func (c *ProductClient) ImportProductsOperation(name string) *ImportProductsOper // RemoveFulfillmentPlaces. // // This feature is only available for users who have Retail Search enabled. -// Please submit a form here (at https://cloud.google.com/contact) to contact -// cloud sales if you are interested in using Retail Search. +// Please enable Retail Search on Cloud Console before using this feature. func (c *ProductClient) SetInventory(ctx context.Context, req *retailpb.SetInventoryRequest, opts ...gax.CallOption) (*SetInventoryOperation, error) { return c.internalClient.SetInventory(ctx, req, opts...) } @@ -343,8 +373,7 @@ func (c *ProductClient) SetInventoryOperation(name string) *SetInventoryOperatio // ListProducts. // // This feature is only available for users who have Retail Search enabled. -// Please submit a form here (at https://cloud.google.com/contact) to contact -// cloud sales if you are interested in using Retail Search. +// Please enable Retail Search on Cloud Console before using this feature. func (c *ProductClient) AddFulfillmentPlaces(ctx context.Context, req *retailpb.AddFulfillmentPlacesRequest, opts ...gax.CallOption) (*AddFulfillmentPlacesOperation, error) { return c.internalClient.AddFulfillmentPlaces(ctx, req, opts...) } @@ -368,8 +397,7 @@ func (c *ProductClient) AddFulfillmentPlacesOperation(name string) *AddFulfillme // ListProducts. // // This feature is only available for users who have Retail Search enabled. -// Please submit a form here (at https://cloud.google.com/contact) to contact -// cloud sales if you are interested in using Retail Search. +// Please enable Retail Search on Cloud Console before using this feature. func (c *ProductClient) RemoveFulfillmentPlaces(ctx context.Context, req *retailpb.RemoveFulfillmentPlacesRequest, opts ...gax.CallOption) (*RemoveFulfillmentPlacesOperation, error) { return c.internalClient.RemoveFulfillmentPlaces(ctx, req, opts...) } @@ -380,6 +408,64 @@ func (c *ProductClient) RemoveFulfillmentPlacesOperation(name string) *RemoveFul return c.internalClient.RemoveFulfillmentPlacesOperation(name) } +// AddLocalInventories updates local inventory information for a +// Product at a list of places, while +// respecting the last update timestamps of each inventory field. +// +// This process is asynchronous and does not require the +// Product to exist before updating +// inventory information. If the request is valid, the update will be enqueued +// and processed downstream. As a consequence, when a response is returned, +// updates are not immediately manifested in the +// Product queried by +// GetProduct or +// ListProducts. +// +// Local inventory information can only be modified using this method. +// CreateProduct and +// UpdateProduct has no +// effect on local inventories. +// +// This feature is only available for users who have Retail Search enabled. +// Please enable Retail Search on Cloud Console before using this feature. +func (c *ProductClient) AddLocalInventories(ctx context.Context, req *retailpb.AddLocalInventoriesRequest, opts ...gax.CallOption) (*AddLocalInventoriesOperation, error) { + return c.internalClient.AddLocalInventories(ctx, req, opts...) +} + +// AddLocalInventoriesOperation returns a new AddLocalInventoriesOperation from a given name. +// The name must be that of a previously created AddLocalInventoriesOperation, possibly from a different process. +func (c *ProductClient) AddLocalInventoriesOperation(name string) *AddLocalInventoriesOperation { + return c.internalClient.AddLocalInventoriesOperation(name) +} + +// RemoveLocalInventories remove local inventory information for a +// Product at a list of places at a removal +// timestamp. +// +// This process is asynchronous. If the request is valid, the removal will be +// enqueued and processed downstream. As a consequence, when a response is +// returned, removals are not immediately manifested in the +// Product queried by +// GetProduct or +// ListProducts. +// +// Local inventory information can only be removed using this method. +// CreateProduct and +// UpdateProduct has no +// effect on local inventories. +// +// This feature is only available for users who have Retail Search enabled. +// Please enable Retail Search on Cloud Console before using this feature. +func (c *ProductClient) RemoveLocalInventories(ctx context.Context, req *retailpb.RemoveLocalInventoriesRequest, opts ...gax.CallOption) (*RemoveLocalInventoriesOperation, error) { + return c.internalClient.RemoveLocalInventories(ctx, req, opts...) +} + +// RemoveLocalInventoriesOperation returns a new RemoveLocalInventoriesOperation from a given name. +// The name must be that of a previously created RemoveLocalInventoriesOperation, possibly from a different process. +func (c *ProductClient) RemoveLocalInventoriesOperation(name string) *RemoveLocalInventoriesOperation { + return c.internalClient.RemoveLocalInventoriesOperation(name) +} + // productGRPCClient is a client for interacting with Retail API over gRPC transport. // // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. @@ -702,6 +788,54 @@ func (c *productGRPCClient) RemoveFulfillmentPlaces(ctx context.Context, req *re }, nil } +func (c *productGRPCClient) AddLocalInventories(ctx context.Context, req *retailpb.AddLocalInventoriesRequest, opts ...gax.CallOption) (*AddLocalInventoriesOperation, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 30000*time.Millisecond) + defer cancel() + ctx = cctx + } + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "product", url.QueryEscape(req.GetProduct()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).AddLocalInventories[0:len((*c.CallOptions).AddLocalInventories):len((*c.CallOptions).AddLocalInventories)], opts...) + var resp *longrunningpb.Operation + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.productClient.AddLocalInventories(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return &AddLocalInventoriesOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, resp), + }, nil +} + +func (c *productGRPCClient) RemoveLocalInventories(ctx context.Context, req *retailpb.RemoveLocalInventoriesRequest, opts ...gax.CallOption) (*RemoveLocalInventoriesOperation, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 30000*time.Millisecond) + defer cancel() + ctx = cctx + } + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "product", url.QueryEscape(req.GetProduct()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).RemoveLocalInventories[0:len((*c.CallOptions).RemoveLocalInventories):len((*c.CallOptions).RemoveLocalInventories)], opts...) + var resp *longrunningpb.Operation + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.productClient.RemoveLocalInventories(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return &RemoveLocalInventoriesOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, resp), + }, nil +} + // AddFulfillmentPlacesOperation manages a long-running operation from AddFulfillmentPlaces. type AddFulfillmentPlacesOperation struct { lro *longrunning.Operation @@ -771,6 +905,75 @@ func (op *AddFulfillmentPlacesOperation) Name() string { return op.lro.Name() } +// AddLocalInventoriesOperation manages a long-running operation from AddLocalInventories. +type AddLocalInventoriesOperation struct { + lro *longrunning.Operation +} + +// AddLocalInventoriesOperation returns a new AddLocalInventoriesOperation from a given name. +// The name must be that of a previously created AddLocalInventoriesOperation, possibly from a different process. +func (c *productGRPCClient) AddLocalInventoriesOperation(name string) *AddLocalInventoriesOperation { + return &AddLocalInventoriesOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), + } +} + +// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. +// +// See documentation of Poll for error-handling information. +func (op *AddLocalInventoriesOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*retailpb.AddLocalInventoriesResponse, error) { + var resp retailpb.AddLocalInventoriesResponse + if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { + return nil, err + } + return &resp, nil +} + +// Poll fetches the latest state of the long-running operation. +// +// Poll also fetches the latest metadata, which can be retrieved by Metadata. +// +// If Poll fails, the error is returned and op is unmodified. If Poll succeeds and +// the operation has completed with failure, the error is returned and op.Done will return true. +// If Poll succeeds and the operation has completed successfully, +// op.Done will return true, and the response of the operation is returned. +// If Poll succeeds and the operation has not completed, the returned response and error are both nil. +func (op *AddLocalInventoriesOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*retailpb.AddLocalInventoriesResponse, error) { + var resp retailpb.AddLocalInventoriesResponse + if err := op.lro.Poll(ctx, &resp, opts...); err != nil { + return nil, err + } + if !op.Done() { + return nil, nil + } + return &resp, nil +} + +// Metadata returns metadata associated with the long-running operation. +// Metadata itself does not contact the server, but Poll does. +// To get the latest metadata, call this method after a successful call to Poll. +// If the metadata is not available, the returned metadata and error are both nil. +func (op *AddLocalInventoriesOperation) Metadata() (*retailpb.AddLocalInventoriesMetadata, error) { + var meta retailpb.AddLocalInventoriesMetadata + if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { + return nil, nil + } else if err != nil { + return nil, err + } + return &meta, nil +} + +// Done reports whether the long-running operation has completed. +func (op *AddLocalInventoriesOperation) Done() bool { + return op.lro.Done() +} + +// Name returns the name of the long-running operation. +// The name is assigned by the server and is unique within the service from which the operation is created. +func (op *AddLocalInventoriesOperation) Name() string { + return op.lro.Name() +} + // ImportProductsOperation manages a long-running operation from ImportProducts. type ImportProductsOperation struct { lro *longrunning.Operation @@ -909,6 +1112,75 @@ func (op *RemoveFulfillmentPlacesOperation) Name() string { return op.lro.Name() } +// RemoveLocalInventoriesOperation manages a long-running operation from RemoveLocalInventories. +type RemoveLocalInventoriesOperation struct { + lro *longrunning.Operation +} + +// RemoveLocalInventoriesOperation returns a new RemoveLocalInventoriesOperation from a given name. +// The name must be that of a previously created RemoveLocalInventoriesOperation, possibly from a different process. +func (c *productGRPCClient) RemoveLocalInventoriesOperation(name string) *RemoveLocalInventoriesOperation { + return &RemoveLocalInventoriesOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), + } +} + +// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. +// +// See documentation of Poll for error-handling information. +func (op *RemoveLocalInventoriesOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*retailpb.RemoveLocalInventoriesResponse, error) { + var resp retailpb.RemoveLocalInventoriesResponse + if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { + return nil, err + } + return &resp, nil +} + +// Poll fetches the latest state of the long-running operation. +// +// Poll also fetches the latest metadata, which can be retrieved by Metadata. +// +// If Poll fails, the error is returned and op is unmodified. If Poll succeeds and +// the operation has completed with failure, the error is returned and op.Done will return true. +// If Poll succeeds and the operation has completed successfully, +// op.Done will return true, and the response of the operation is returned. +// If Poll succeeds and the operation has not completed, the returned response and error are both nil. +func (op *RemoveLocalInventoriesOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*retailpb.RemoveLocalInventoriesResponse, error) { + var resp retailpb.RemoveLocalInventoriesResponse + if err := op.lro.Poll(ctx, &resp, opts...); err != nil { + return nil, err + } + if !op.Done() { + return nil, nil + } + return &resp, nil +} + +// Metadata returns metadata associated with the long-running operation. +// Metadata itself does not contact the server, but Poll does. +// To get the latest metadata, call this method after a successful call to Poll. +// If the metadata is not available, the returned metadata and error are both nil. +func (op *RemoveLocalInventoriesOperation) Metadata() (*retailpb.RemoveLocalInventoriesMetadata, error) { + var meta retailpb.RemoveLocalInventoriesMetadata + if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { + return nil, nil + } else if err != nil { + return nil, err + } + return &meta, nil +} + +// Done reports whether the long-running operation has completed. +func (op *RemoveLocalInventoriesOperation) Done() bool { + return op.lro.Done() +} + +// Name returns the name of the long-running operation. +// The name is assigned by the server and is unique within the service from which the operation is created. +func (op *RemoveLocalInventoriesOperation) Name() string { + return op.lro.Name() +} + // SetInventoryOperation manages a long-running operation from SetInventory. type SetInventoryOperation struct { lro *longrunning.Operation diff --git a/retail/apiv2/product_client_example_test.go b/retail/apiv2/product_client_example_test.go index 30b6e0e4470a..4905ec1cc375 100644 --- a/retail/apiv2/product_client_example_test.go +++ b/retail/apiv2/product_client_example_test.go @@ -239,3 +239,53 @@ func ExampleProductClient_RemoveFulfillmentPlaces() { // TODO: Use resp. _ = resp } + +func ExampleProductClient_AddLocalInventories() { + ctx := context.Background() + c, err := retail.NewProductClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &retailpb.AddLocalInventoriesRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/retail/v2#AddLocalInventoriesRequest. + } + op, err := c.AddLocalInventories(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleProductClient_RemoveLocalInventories() { + ctx := context.Background() + c, err := retail.NewProductClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &retailpb.RemoveLocalInventoriesRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/retail/v2#RemoveLocalInventoriesRequest. + } + op, err := c.RemoveLocalInventories(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/retail/apiv2/search_client.go b/retail/apiv2/search_client.go index ff59702e7d7d..ec375bf1d86d 100644 --- a/retail/apiv2/search_client.go +++ b/retail/apiv2/search_client.go @@ -85,8 +85,7 @@ type internalSearchClient interface { // Service for search. // // This feature is only available for users who have Retail Search enabled. -// Please submit a form here (at https://cloud.google.com/contact) to contact -// cloud sales if you are interested in using Retail Search. +// Please enable Retail Search on Cloud Console before using this feature. type SearchClient struct { // The internal transport-dependent client. internalClient internalSearchClient @@ -120,8 +119,7 @@ func (c *SearchClient) Connection() *grpc.ClientConn { // Search performs a search. // // This feature is only available for users who have Retail Search enabled. -// Please submit a form here (at https://cloud.google.com/contact) to contact -// cloud sales if you are interested in using Retail Search. +// Please enable Retail Search on Cloud Console before using this feature. func (c *SearchClient) Search(ctx context.Context, req *retailpb.SearchRequest, opts ...gax.CallOption) *SearchResponse_SearchResultIterator { return c.internalClient.Search(ctx, req, opts...) } @@ -152,8 +150,7 @@ type searchGRPCClient struct { // Service for search. // // This feature is only available for users who have Retail Search enabled. -// Please submit a form here (at https://cloud.google.com/contact) to contact -// cloud sales if you are interested in using Retail Search. +// Please enable Retail Search on Cloud Console before using this feature. func NewSearchClient(ctx context.Context, opts ...option.ClientOption) (*SearchClient, error) { clientOpts := defaultSearchGRPCClientOptions() if newSearchClientHook != nil { diff --git a/retail/apiv2/user_event_client.go b/retail/apiv2/user_event_client.go index cdeafe53e754..2574179fc9f2 100644 --- a/retail/apiv2/user_event_client.go +++ b/retail/apiv2/user_event_client.go @@ -224,13 +224,14 @@ func (c *UserEventClient) ImportUserEventsOperation(name string) *ImportUserEven return c.internalClient.ImportUserEventsOperation(name) } -// RejoinUserEvents triggers a user event rejoin operation with latest product catalog. Events +// RejoinUserEvents starts a user event rejoin operation with latest product catalog. Events // will not be annotated with detailed product information if product is // missing from the catalog at the time the user event is ingested, and these // events are stored as unjoined events with a limited usage on training and -// serving. This API can be used to trigger a ‘join’ operation on specified +// serving. This method can be used to start a join operation on specified // events with latest version of product catalog. It can also be used to -// correct events joined with wrong product catalog. +// correct events joined with the wrong product catalog. A rejoin operation +// can take hours or days to complete. func (c *UserEventClient) RejoinUserEvents(ctx context.Context, req *retailpb.RejoinUserEventsRequest, opts ...gax.CallOption) (*RejoinUserEventsOperation, error) { return c.internalClient.RejoinUserEvents(ctx, req, opts...) } diff --git a/retail/go.mod b/retail/go.mod index 87f9db271db2..01dde70f8e67 100644 --- a/retail/go.mod +++ b/retail/go.mod @@ -6,7 +6,7 @@ require ( cloud.google.com/go v0.100.2 github.com/googleapis/gax-go/v2 v2.2.0 google.golang.org/api v0.73.0 - google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6 + google.golang.org/genproto v0.0.0-20220329135034-5a5e19f58d62 google.golang.org/grpc v1.45.0 google.golang.org/protobuf v1.28.0 ) diff --git a/retail/go.sum b/retail/go.sum index c42e86ef06b8..8edb52ee2ae7 100644 --- a/retail/go.sum +++ b/retail/go.sum @@ -535,8 +535,9 @@ google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ6 google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6 h1:FglFEfyj61zP3c6LgjmVHxYxZWXYul9oiS1EZqD5gLc= google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220329135034-5a5e19f58d62 h1:IPy3YJ7uYPB1sDNJRs/b7Dgs6KxwMyGYgtIgDnKgEyw= +google.golang.org/genproto v0.0.0-20220329135034-5a5e19f58d62/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= 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=