diff --git a/dialogflow/cx/apiv3beta1/auxiliary.go b/dialogflow/cx/apiv3beta1/auxiliary.go index 7abc0dc8b07d..caf3ae6eb05b 100755 --- a/dialogflow/cx/apiv3beta1/auxiliary.go +++ b/dialogflow/cx/apiv3beta1/auxiliary.go @@ -1460,6 +1460,53 @@ func (it *FlowIterator) takeBuf() interface{} { return b } +// GeneratorIterator manages a stream of *cxpb.Generator. +type GeneratorIterator struct { + items []*cxpb.Generator + 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.Generator, nextPageToken string, err error) +} + +// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +func (it *GeneratorIterator) 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 *GeneratorIterator) Next() (*cxpb.Generator, error) { + var item *cxpb.Generator + if err := it.nextFunc(); err != nil { + return item, err + } + item = it.items[0] + it.items = it.items[1:] + return item, nil +} + +func (it *GeneratorIterator) bufLen() int { + return len(it.items) +} + +func (it *GeneratorIterator) takeBuf() interface{} { + b := it.items + it.items = nil + return b +} + // IntentIterator manages a stream of *cxpb.Intent. type IntentIterator struct { items []*cxpb.Intent diff --git a/dialogflow/cx/apiv3beta1/cxpb/audio_config.pb.go b/dialogflow/cx/apiv3beta1/cxpb/audio_config.pb.go index 5853a753fbd6..82587d8b71ab 100755 --- a/dialogflow/cx/apiv3beta1/cxpb/audio_config.pb.go +++ b/dialogflow/cx/apiv3beta1/cxpb/audio_config.pb.go @@ -544,8 +544,8 @@ type InputAudioConfig struct { PhraseHints []string `protobuf:"bytes,4,rep,name=phrase_hints,json=phraseHints,proto3" json:"phrase_hints,omitempty"` // Optional. Which Speech model to select for the given request. Select the // model best suited to your domain to get best results. If a model is not - // explicitly specified, then we auto-select a model based on the parameters - // in the InputAudioConfig. + // explicitly specified, then Dialogflow auto-selects a model based on other + // parameters in the InputAudioConfig and Agent settings. // If enhanced speech model is enabled for the agent and an enhanced // version of the specified model for the language does not exist, then the // speech is recognized using the standard version of the specified model. @@ -558,7 +558,12 @@ type InputAudioConfig struct { // // - phone_call (best for Agent Assist and telephony) // - latest_short (best for Dialogflow non-telephony) - // - command_and_search (best for very short utterances and commands) + // - command_and_search + // + // Leave this field unspecified to use + // [Agent Speech + // settings](https://cloud.google.com/dialogflow/cx/docs/concept/agent#settings-speech) + // for model selection. Model string `protobuf:"bytes,7,opt,name=model,proto3" json:"model,omitempty"` // Optional. Which variant of the [Speech // model][google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.model] to use. diff --git a/dialogflow/cx/apiv3beta1/cxpb/generator.pb.go b/dialogflow/cx/apiv3beta1/cxpb/generator.pb.go new file mode 100755 index 000000000000..21659dd46a6b --- /dev/null +++ b/dialogflow/cx/apiv3beta1/cxpb/generator.pb.go @@ -0,0 +1,1264 @@ +// Copyright 2023 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 protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v4.23.2 +// source: google/cloud/dialogflow/cx/v3beta1/generator.proto + +package cxpb + +import ( + context "context" + reflect "reflect" + sync "sync" + + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" + fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Generators contain prompt to be sent to the LLM model to generate text. The +// prompt can contain parameters which will be resolved before calling the +// model. It can optionally contain banned phrases to ensure the model responses +// are safe. +type Generator struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The unique identifier of the generator. + // Must be set for the + // [Generators.UpdateGenerator][google.cloud.dialogflow.cx.v3beta1.Generators.UpdateGenerator] + // method. [Generators.CreateGenerate][] populates the name automatically. + // Format: `projects//locations//agents//generators/`. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Required. The human-readable name of the generator, unique within the + // agent. The prompt contains pre-defined parameters such as $conversation, + // $last-user-utterance, etc. populated by Dialogflow. It can also contain + // custom placeholders which will be resolved during fulfillment. + DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + // Required. Prompt for the LLM model. + PromptText *Phrase `protobuf:"bytes,3,opt,name=prompt_text,json=promptText,proto3" json:"prompt_text,omitempty"` + // Optional. List of custom placeholders in the prompt text. + Placeholders []*Generator_Placeholder `protobuf:"bytes,5,rep,name=placeholders,proto3" json:"placeholders,omitempty"` +} + +func (x *Generator) Reset() { + *x = Generator{} + if protoimpl.UnsafeEnabled { + mi := &file_google_cloud_dialogflow_cx_v3beta1_generator_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Generator) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Generator) ProtoMessage() {} + +func (x *Generator) ProtoReflect() protoreflect.Message { + mi := &file_google_cloud_dialogflow_cx_v3beta1_generator_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Generator.ProtoReflect.Descriptor instead. +func (*Generator) Descriptor() ([]byte, []int) { + return file_google_cloud_dialogflow_cx_v3beta1_generator_proto_rawDescGZIP(), []int{0} +} + +func (x *Generator) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Generator) GetDisplayName() string { + if x != nil { + return x.DisplayName + } + return "" +} + +func (x *Generator) GetPromptText() *Phrase { + if x != nil { + return x.PromptText + } + return nil +} + +func (x *Generator) GetPlaceholders() []*Generator_Placeholder { + if x != nil { + return x.Placeholders + } + return nil +} + +// Text input which can be used for prompt or banned phrases. +type Phrase struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required. Text input which can be used for prompt or banned phrases. + Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"` +} + +func (x *Phrase) Reset() { + *x = Phrase{} + if protoimpl.UnsafeEnabled { + mi := &file_google_cloud_dialogflow_cx_v3beta1_generator_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Phrase) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Phrase) ProtoMessage() {} + +func (x *Phrase) ProtoReflect() protoreflect.Message { + mi := &file_google_cloud_dialogflow_cx_v3beta1_generator_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Phrase.ProtoReflect.Descriptor instead. +func (*Phrase) Descriptor() ([]byte, []int) { + return file_google_cloud_dialogflow_cx_v3beta1_generator_proto_rawDescGZIP(), []int{1} +} + +func (x *Phrase) GetText() string { + if x != nil { + return x.Text + } + return "" +} + +// The request message for +// [Generators.ListGenerators][google.cloud.dialogflow.cx.v3beta1.Generators.ListGenerators]. +type ListGeneratorsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required. The agent to list all generators for. + // Format: `projects//locations//agents/`. + Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"` + // The language to list generators for. + LanguageCode string `protobuf:"bytes,2,opt,name=language_code,json=languageCode,proto3" json:"language_code,omitempty"` + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + // The next_page_token value returned from a previous list request. + PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` +} + +func (x *ListGeneratorsRequest) Reset() { + *x = ListGeneratorsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_google_cloud_dialogflow_cx_v3beta1_generator_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListGeneratorsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListGeneratorsRequest) ProtoMessage() {} + +func (x *ListGeneratorsRequest) ProtoReflect() protoreflect.Message { + mi := &file_google_cloud_dialogflow_cx_v3beta1_generator_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListGeneratorsRequest.ProtoReflect.Descriptor instead. +func (*ListGeneratorsRequest) Descriptor() ([]byte, []int) { + return file_google_cloud_dialogflow_cx_v3beta1_generator_proto_rawDescGZIP(), []int{2} +} + +func (x *ListGeneratorsRequest) GetParent() string { + if x != nil { + return x.Parent + } + return "" +} + +func (x *ListGeneratorsRequest) GetLanguageCode() string { + if x != nil { + return x.LanguageCode + } + return "" +} + +func (x *ListGeneratorsRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListGeneratorsRequest) GetPageToken() string { + if x != nil { + return x.PageToken + } + return "" +} + +// The response message for +// [Generators.ListGenerators][google.cloud.dialogflow.cx.v3beta1.Generators.ListGenerators]. +type ListGeneratorsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The list of generators. There will be a maximum number of items returned + // based on the page_size field in the request. + Generators []*Generator `protobuf:"bytes,1,rep,name=generators,proto3" json:"generators,omitempty"` + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` +} + +func (x *ListGeneratorsResponse) Reset() { + *x = ListGeneratorsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_google_cloud_dialogflow_cx_v3beta1_generator_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListGeneratorsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListGeneratorsResponse) ProtoMessage() {} + +func (x *ListGeneratorsResponse) ProtoReflect() protoreflect.Message { + mi := &file_google_cloud_dialogflow_cx_v3beta1_generator_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListGeneratorsResponse.ProtoReflect.Descriptor instead. +func (*ListGeneratorsResponse) Descriptor() ([]byte, []int) { + return file_google_cloud_dialogflow_cx_v3beta1_generator_proto_rawDescGZIP(), []int{3} +} + +func (x *ListGeneratorsResponse) GetGenerators() []*Generator { + if x != nil { + return x.Generators + } + return nil +} + +func (x *ListGeneratorsResponse) GetNextPageToken() string { + if x != nil { + return x.NextPageToken + } + return "" +} + +// The request message for +// [Generators.GetGenerator][google.cloud.dialogflow.cx.v3beta1.Generators.GetGenerator]. +type GetGeneratorRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required. The name of the generator. + // Format: `projects//locations//agents//generators/`. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // The language to list generators for. + LanguageCode string `protobuf:"bytes,2,opt,name=language_code,json=languageCode,proto3" json:"language_code,omitempty"` +} + +func (x *GetGeneratorRequest) Reset() { + *x = GetGeneratorRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_google_cloud_dialogflow_cx_v3beta1_generator_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetGeneratorRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetGeneratorRequest) ProtoMessage() {} + +func (x *GetGeneratorRequest) ProtoReflect() protoreflect.Message { + mi := &file_google_cloud_dialogflow_cx_v3beta1_generator_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetGeneratorRequest.ProtoReflect.Descriptor instead. +func (*GetGeneratorRequest) Descriptor() ([]byte, []int) { + return file_google_cloud_dialogflow_cx_v3beta1_generator_proto_rawDescGZIP(), []int{4} +} + +func (x *GetGeneratorRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *GetGeneratorRequest) GetLanguageCode() string { + if x != nil { + return x.LanguageCode + } + return "" +} + +// The request message for +// [Generators.CreateGenerator][google.cloud.dialogflow.cx.v3beta1.Generators.CreateGenerator]. +type CreateGeneratorRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required. The agent to create a generator for. + // Format: `projects//locations//agents/`. + Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"` + // Required. The generator to create. + Generator *Generator `protobuf:"bytes,2,opt,name=generator,proto3" json:"generator,omitempty"` + // The language to create generators for the following fields: + // * `Generator.prompt_text.text` + // If not specified, the agent's default language is used. + LanguageCode string `protobuf:"bytes,3,opt,name=language_code,json=languageCode,proto3" json:"language_code,omitempty"` +} + +func (x *CreateGeneratorRequest) Reset() { + *x = CreateGeneratorRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_google_cloud_dialogflow_cx_v3beta1_generator_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateGeneratorRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateGeneratorRequest) ProtoMessage() {} + +func (x *CreateGeneratorRequest) ProtoReflect() protoreflect.Message { + mi := &file_google_cloud_dialogflow_cx_v3beta1_generator_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateGeneratorRequest.ProtoReflect.Descriptor instead. +func (*CreateGeneratorRequest) Descriptor() ([]byte, []int) { + return file_google_cloud_dialogflow_cx_v3beta1_generator_proto_rawDescGZIP(), []int{5} +} + +func (x *CreateGeneratorRequest) GetParent() string { + if x != nil { + return x.Parent + } + return "" +} + +func (x *CreateGeneratorRequest) GetGenerator() *Generator { + if x != nil { + return x.Generator + } + return nil +} + +func (x *CreateGeneratorRequest) GetLanguageCode() string { + if x != nil { + return x.LanguageCode + } + return "" +} + +// The request message for +// [Generators.UpdateGenerator][google.cloud.dialogflow.cx.v3beta1.Generators.UpdateGenerator]. +type UpdateGeneratorRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required. The generator to update. + Generator *Generator `protobuf:"bytes,1,opt,name=generator,proto3" json:"generator,omitempty"` + // The language to list generators for. + LanguageCode string `protobuf:"bytes,2,opt,name=language_code,json=languageCode,proto3" json:"language_code,omitempty"` + // The mask to control which fields get updated. If the mask is not present, + // all fields will be updated. + UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,3,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` +} + +func (x *UpdateGeneratorRequest) Reset() { + *x = UpdateGeneratorRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_google_cloud_dialogflow_cx_v3beta1_generator_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateGeneratorRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateGeneratorRequest) ProtoMessage() {} + +func (x *UpdateGeneratorRequest) ProtoReflect() protoreflect.Message { + mi := &file_google_cloud_dialogflow_cx_v3beta1_generator_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateGeneratorRequest.ProtoReflect.Descriptor instead. +func (*UpdateGeneratorRequest) Descriptor() ([]byte, []int) { + return file_google_cloud_dialogflow_cx_v3beta1_generator_proto_rawDescGZIP(), []int{6} +} + +func (x *UpdateGeneratorRequest) GetGenerator() *Generator { + if x != nil { + return x.Generator + } + return nil +} + +func (x *UpdateGeneratorRequest) GetLanguageCode() string { + if x != nil { + return x.LanguageCode + } + return "" +} + +func (x *UpdateGeneratorRequest) GetUpdateMask() *fieldmaskpb.FieldMask { + if x != nil { + return x.UpdateMask + } + return nil +} + +// The request message for +// [Generators.DeleteGenerator][google.cloud.dialogflow.cx.v3beta1.Generators.DeleteGenerator]. +type DeleteGeneratorRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required. The name of the generator to delete. + // Format: `projects//locations//agents//generators/`. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // This field has no effect for generators not being used. + // For generators that are used by pages/flows/transition route groups: + // + // * If `force` is set to false, an error will be returned with message + // indicating the referenced resources. + // * If `force` is set to true, Dialogflow will remove the generator, as well + // as any references to the generator (i.e. + // [Generator][Fulfillment.generator]) in fulfillments. + Force bool `protobuf:"varint,2,opt,name=force,proto3" json:"force,omitempty"` +} + +func (x *DeleteGeneratorRequest) Reset() { + *x = DeleteGeneratorRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_google_cloud_dialogflow_cx_v3beta1_generator_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteGeneratorRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteGeneratorRequest) ProtoMessage() {} + +func (x *DeleteGeneratorRequest) ProtoReflect() protoreflect.Message { + mi := &file_google_cloud_dialogflow_cx_v3beta1_generator_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteGeneratorRequest.ProtoReflect.Descriptor instead. +func (*DeleteGeneratorRequest) Descriptor() ([]byte, []int) { + return file_google_cloud_dialogflow_cx_v3beta1_generator_proto_rawDescGZIP(), []int{7} +} + +func (x *DeleteGeneratorRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *DeleteGeneratorRequest) GetForce() bool { + if x != nil { + return x.Force + } + return false +} + +// Represents a custom placeholder in the prompt text. +type Generator_Placeholder struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Unique ID used to map custom placeholder to parameters in fulfillment. + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // Custom placeholder value in the prompt text. + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *Generator_Placeholder) Reset() { + *x = Generator_Placeholder{} + if protoimpl.UnsafeEnabled { + mi := &file_google_cloud_dialogflow_cx_v3beta1_generator_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Generator_Placeholder) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Generator_Placeholder) ProtoMessage() {} + +func (x *Generator_Placeholder) ProtoReflect() protoreflect.Message { + mi := &file_google_cloud_dialogflow_cx_v3beta1_generator_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Generator_Placeholder.ProtoReflect.Descriptor instead. +func (*Generator_Placeholder) Descriptor() ([]byte, []int) { + return file_google_cloud_dialogflow_cx_v3beta1_generator_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *Generator_Placeholder) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Generator_Placeholder) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +var File_google_cloud_dialogflow_cx_v3beta1_generator_proto protoreflect.FileDescriptor + +var file_google_cloud_dialogflow_cx_v3beta1_generator_proto_rawDesc = []byte{ + 0x0a, 0x32, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x64, + 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2f, 0x63, 0x78, 0x2f, 0x76, 0x33, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x22, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, + 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x63, 0x78, + 0x2e, 0x76, 0x33, 0x62, 0x65, 0x74, 0x61, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, + 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, + 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, + 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa9, 0x03, 0x0a, 0x09, 0x47, + 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0c, + 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x50, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x5f, 0x74, + 0x65, 0x78, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, + 0x6c, 0x6f, 0x77, 0x2e, 0x63, 0x78, 0x2e, 0x76, 0x33, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, + 0x68, 0x72, 0x61, 0x73, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x6d, + 0x70, 0x74, 0x54, 0x65, 0x78, 0x74, 0x12, 0x62, 0x0a, 0x0c, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x68, + 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, + 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x63, 0x78, 0x2e, 0x76, 0x33, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x50, 0x6c, 0x61, 0x63, + 0x65, 0x68, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0c, 0x70, 0x6c, + 0x61, 0x63, 0x65, 0x68, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x73, 0x1a, 0x31, 0x0a, 0x0b, 0x50, 0x6c, + 0x61, 0x63, 0x65, 0x68, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x77, 0xea, + 0x41, 0x74, 0x0a, 0x23, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x47, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x4d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x7d, 0x2f, 0x6c, 0x6f, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, + 0x2f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x7b, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x7d, 0x2f, + 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x7b, 0x67, 0x65, 0x6e, 0x65, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x7d, 0x22, 0x21, 0x0a, 0x06, 0x50, 0x68, 0x72, 0x61, 0x73, 0x65, + 0x12, 0x17, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, + 0xe0, 0x41, 0x02, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x22, 0xbd, 0x01, 0x0a, 0x15, 0x4c, 0x69, + 0x73, 0x74, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x43, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x2b, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x25, 0x12, 0x23, 0x64, 0x69, 0x61, + 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, + 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, + 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x6c, 0x61, 0x6e, 0x67, + 0x75, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0c, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1b, 0x0a, + 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, + 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x8f, 0x01, 0x0a, 0x16, 0x4c, 0x69, + 0x73, 0x74, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, + 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, + 0x6f, 0x77, 0x2e, 0x63, 0x78, 0x2e, 0x76, 0x33, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, + 0x6f, 0x72, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, + 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, + 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x7b, 0x0a, 0x13, 0x47, + 0x65, 0x74, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x2b, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x25, 0x0a, 0x23, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, + 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x5f, + 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6c, 0x61, 0x6e, 0x67, + 0x75, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x22, 0xd4, 0x01, 0x0a, 0x16, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x43, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x2b, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x25, 0x12, 0x23, 0x64, 0x69, 0x61, + 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, + 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, + 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x50, 0x0a, 0x09, 0x67, 0x65, 0x6e, 0x65, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, + 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x63, 0x78, 0x2e, 0x76, 0x33, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, + 0x09, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x23, 0x0a, 0x0d, 0x6c, 0x61, + 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0c, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x22, + 0xcc, 0x01, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, + 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x50, 0x0a, 0x09, 0x67, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, + 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x63, 0x78, 0x2e, 0x76, 0x33, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x03, 0xe0, 0x41, + 0x02, 0x52, 0x09, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x23, 0x0a, 0x0d, + 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x64, + 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, + 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x6f, + 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, + 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2b, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x25, 0x0a, 0x23, + 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, + 0x74, 0x6f, 0x72, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x72, + 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x32, + 0xaf, 0x09, 0x0a, 0x0a, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0xd6, + 0x01, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, + 0x73, 0x12, 0x39, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, + 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x63, 0x78, 0x2e, 0x76, + 0x33, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, + 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x63, 0x78, 0x2e, 0x76, 0x33, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4d, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, + 0x65, 0x6e, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3e, 0x12, 0x3c, 0x2f, 0x76, 0x33, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2f, 0x2a, 0x2f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x67, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0xc3, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x47, + 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x37, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, + 0x6f, 0x77, 0x2e, 0x63, 0x78, 0x2e, 0x76, 0x33, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, + 0x74, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x2d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, + 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x63, 0x78, 0x2e, 0x76, + 0x33, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, + 0x22, 0x4b, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3e, 0x12, + 0x3c, 0x2f, 0x76, 0x33, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, + 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x2f, + 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xe0, 0x01, + 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, + 0x72, 0x12, 0x3a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, + 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x63, 0x78, 0x2e, 0x76, + 0x33, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, + 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x63, 0x78, 0x2e, 0x76, 0x33, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x22, 0x62, 0xda, 0x41, + 0x10, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2c, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, + 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x49, 0x3a, 0x09, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, + 0x6f, 0x72, 0x22, 0x3c, 0x2f, 0x76, 0x33, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x70, 0x61, + 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, + 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x61, 0x67, 0x65, 0x6e, + 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x73, + 0x12, 0xef, 0x01, 0x0a, 0x0f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x6f, 0x72, 0x12, 0x3a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x63, + 0x78, 0x2e, 0x76, 0x33, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x2d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, + 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x63, 0x78, 0x2e, 0x76, 0x33, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x22, + 0x71, 0xda, 0x41, 0x15, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x2c, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x53, 0x3a, + 0x09, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x32, 0x46, 0x2f, 0x76, 0x33, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x2e, + 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, + 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x61, 0x67, 0x65, 0x6e, + 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, + 0x2a, 0x7d, 0x12, 0xb2, 0x01, 0x0a, 0x0f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x47, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x3a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, + 0x2e, 0x63, 0x78, 0x2e, 0x76, 0x33, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x4b, 0xda, 0x41, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3e, 0x2a, 0x3c, 0x2f, 0x76, 0x33, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, + 0x2f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, + 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x1a, 0x78, 0xca, 0x41, 0x19, 0x64, 0x69, 0x61, 0x6c, + 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, + 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0xd2, 0x41, 0x59, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, + 0x77, 0x77, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x70, 0x6c, + 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2c, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, + 0x77, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, + 0x77, 0x42, 0x9f, 0x01, 0x0a, 0x26, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, + 0x77, 0x2e, 0x63, 0x78, 0x2e, 0x76, 0x33, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0e, 0x47, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, + 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x67, 0x6f, 0x2f, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2f, 0x63, + 0x78, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x33, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x78, 0x70, + 0x62, 0x3b, 0x63, 0x78, 0x70, 0x62, 0xf8, 0x01, 0x01, 0xa2, 0x02, 0x02, 0x44, 0x46, 0xaa, 0x02, + 0x22, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x44, 0x69, + 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x43, 0x78, 0x2e, 0x56, 0x33, 0x42, 0x65, + 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_google_cloud_dialogflow_cx_v3beta1_generator_proto_rawDescOnce sync.Once + file_google_cloud_dialogflow_cx_v3beta1_generator_proto_rawDescData = file_google_cloud_dialogflow_cx_v3beta1_generator_proto_rawDesc +) + +func file_google_cloud_dialogflow_cx_v3beta1_generator_proto_rawDescGZIP() []byte { + file_google_cloud_dialogflow_cx_v3beta1_generator_proto_rawDescOnce.Do(func() { + file_google_cloud_dialogflow_cx_v3beta1_generator_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_cloud_dialogflow_cx_v3beta1_generator_proto_rawDescData) + }) + return file_google_cloud_dialogflow_cx_v3beta1_generator_proto_rawDescData +} + +var file_google_cloud_dialogflow_cx_v3beta1_generator_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_google_cloud_dialogflow_cx_v3beta1_generator_proto_goTypes = []interface{}{ + (*Generator)(nil), // 0: google.cloud.dialogflow.cx.v3beta1.Generator + (*Phrase)(nil), // 1: google.cloud.dialogflow.cx.v3beta1.Phrase + (*ListGeneratorsRequest)(nil), // 2: google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest + (*ListGeneratorsResponse)(nil), // 3: google.cloud.dialogflow.cx.v3beta1.ListGeneratorsResponse + (*GetGeneratorRequest)(nil), // 4: google.cloud.dialogflow.cx.v3beta1.GetGeneratorRequest + (*CreateGeneratorRequest)(nil), // 5: google.cloud.dialogflow.cx.v3beta1.CreateGeneratorRequest + (*UpdateGeneratorRequest)(nil), // 6: google.cloud.dialogflow.cx.v3beta1.UpdateGeneratorRequest + (*DeleteGeneratorRequest)(nil), // 7: google.cloud.dialogflow.cx.v3beta1.DeleteGeneratorRequest + (*Generator_Placeholder)(nil), // 8: google.cloud.dialogflow.cx.v3beta1.Generator.Placeholder + (*fieldmaskpb.FieldMask)(nil), // 9: google.protobuf.FieldMask + (*emptypb.Empty)(nil), // 10: google.protobuf.Empty +} +var file_google_cloud_dialogflow_cx_v3beta1_generator_proto_depIdxs = []int32{ + 1, // 0: google.cloud.dialogflow.cx.v3beta1.Generator.prompt_text:type_name -> google.cloud.dialogflow.cx.v3beta1.Phrase + 8, // 1: google.cloud.dialogflow.cx.v3beta1.Generator.placeholders:type_name -> google.cloud.dialogflow.cx.v3beta1.Generator.Placeholder + 0, // 2: google.cloud.dialogflow.cx.v3beta1.ListGeneratorsResponse.generators:type_name -> google.cloud.dialogflow.cx.v3beta1.Generator + 0, // 3: google.cloud.dialogflow.cx.v3beta1.CreateGeneratorRequest.generator:type_name -> google.cloud.dialogflow.cx.v3beta1.Generator + 0, // 4: google.cloud.dialogflow.cx.v3beta1.UpdateGeneratorRequest.generator:type_name -> google.cloud.dialogflow.cx.v3beta1.Generator + 9, // 5: google.cloud.dialogflow.cx.v3beta1.UpdateGeneratorRequest.update_mask:type_name -> google.protobuf.FieldMask + 2, // 6: google.cloud.dialogflow.cx.v3beta1.Generators.ListGenerators:input_type -> google.cloud.dialogflow.cx.v3beta1.ListGeneratorsRequest + 4, // 7: google.cloud.dialogflow.cx.v3beta1.Generators.GetGenerator:input_type -> google.cloud.dialogflow.cx.v3beta1.GetGeneratorRequest + 5, // 8: google.cloud.dialogflow.cx.v3beta1.Generators.CreateGenerator:input_type -> google.cloud.dialogflow.cx.v3beta1.CreateGeneratorRequest + 6, // 9: google.cloud.dialogflow.cx.v3beta1.Generators.UpdateGenerator:input_type -> google.cloud.dialogflow.cx.v3beta1.UpdateGeneratorRequest + 7, // 10: google.cloud.dialogflow.cx.v3beta1.Generators.DeleteGenerator:input_type -> google.cloud.dialogflow.cx.v3beta1.DeleteGeneratorRequest + 3, // 11: google.cloud.dialogflow.cx.v3beta1.Generators.ListGenerators:output_type -> google.cloud.dialogflow.cx.v3beta1.ListGeneratorsResponse + 0, // 12: google.cloud.dialogflow.cx.v3beta1.Generators.GetGenerator:output_type -> google.cloud.dialogflow.cx.v3beta1.Generator + 0, // 13: google.cloud.dialogflow.cx.v3beta1.Generators.CreateGenerator:output_type -> google.cloud.dialogflow.cx.v3beta1.Generator + 0, // 14: google.cloud.dialogflow.cx.v3beta1.Generators.UpdateGenerator:output_type -> google.cloud.dialogflow.cx.v3beta1.Generator + 10, // 15: google.cloud.dialogflow.cx.v3beta1.Generators.DeleteGenerator:output_type -> google.protobuf.Empty + 11, // [11:16] is the sub-list for method output_type + 6, // [6:11] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name +} + +func init() { file_google_cloud_dialogflow_cx_v3beta1_generator_proto_init() } +func file_google_cloud_dialogflow_cx_v3beta1_generator_proto_init() { + if File_google_cloud_dialogflow_cx_v3beta1_generator_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_google_cloud_dialogflow_cx_v3beta1_generator_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Generator); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_google_cloud_dialogflow_cx_v3beta1_generator_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Phrase); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_google_cloud_dialogflow_cx_v3beta1_generator_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListGeneratorsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_google_cloud_dialogflow_cx_v3beta1_generator_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListGeneratorsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_google_cloud_dialogflow_cx_v3beta1_generator_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetGeneratorRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_google_cloud_dialogflow_cx_v3beta1_generator_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateGeneratorRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_google_cloud_dialogflow_cx_v3beta1_generator_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateGeneratorRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_google_cloud_dialogflow_cx_v3beta1_generator_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteGeneratorRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_google_cloud_dialogflow_cx_v3beta1_generator_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Generator_Placeholder); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_google_cloud_dialogflow_cx_v3beta1_generator_proto_rawDesc, + NumEnums: 0, + NumMessages: 9, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_google_cloud_dialogflow_cx_v3beta1_generator_proto_goTypes, + DependencyIndexes: file_google_cloud_dialogflow_cx_v3beta1_generator_proto_depIdxs, + MessageInfos: file_google_cloud_dialogflow_cx_v3beta1_generator_proto_msgTypes, + }.Build() + File_google_cloud_dialogflow_cx_v3beta1_generator_proto = out.File + file_google_cloud_dialogflow_cx_v3beta1_generator_proto_rawDesc = nil + file_google_cloud_dialogflow_cx_v3beta1_generator_proto_goTypes = nil + file_google_cloud_dialogflow_cx_v3beta1_generator_proto_depIdxs = nil +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConnInterface + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion6 + +// GeneratorsClient is the client API for Generators service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type GeneratorsClient interface { + // Returns the list of all generators in the specified agent. + ListGenerators(ctx context.Context, in *ListGeneratorsRequest, opts ...grpc.CallOption) (*ListGeneratorsResponse, error) + // Retrieves the specified generator. + GetGenerator(ctx context.Context, in *GetGeneratorRequest, opts ...grpc.CallOption) (*Generator, error) + // Creates a generator in the specified agent. + CreateGenerator(ctx context.Context, in *CreateGeneratorRequest, opts ...grpc.CallOption) (*Generator, error) + // Update the specified generator. + UpdateGenerator(ctx context.Context, in *UpdateGeneratorRequest, opts ...grpc.CallOption) (*Generator, error) + // Deletes the specified generators. + DeleteGenerator(ctx context.Context, in *DeleteGeneratorRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) +} + +type generatorsClient struct { + cc grpc.ClientConnInterface +} + +func NewGeneratorsClient(cc grpc.ClientConnInterface) GeneratorsClient { + return &generatorsClient{cc} +} + +func (c *generatorsClient) ListGenerators(ctx context.Context, in *ListGeneratorsRequest, opts ...grpc.CallOption) (*ListGeneratorsResponse, error) { + out := new(ListGeneratorsResponse) + err := c.cc.Invoke(ctx, "/google.cloud.dialogflow.cx.v3beta1.Generators/ListGenerators", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *generatorsClient) GetGenerator(ctx context.Context, in *GetGeneratorRequest, opts ...grpc.CallOption) (*Generator, error) { + out := new(Generator) + err := c.cc.Invoke(ctx, "/google.cloud.dialogflow.cx.v3beta1.Generators/GetGenerator", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *generatorsClient) CreateGenerator(ctx context.Context, in *CreateGeneratorRequest, opts ...grpc.CallOption) (*Generator, error) { + out := new(Generator) + err := c.cc.Invoke(ctx, "/google.cloud.dialogflow.cx.v3beta1.Generators/CreateGenerator", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *generatorsClient) UpdateGenerator(ctx context.Context, in *UpdateGeneratorRequest, opts ...grpc.CallOption) (*Generator, error) { + out := new(Generator) + err := c.cc.Invoke(ctx, "/google.cloud.dialogflow.cx.v3beta1.Generators/UpdateGenerator", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *generatorsClient) DeleteGenerator(ctx context.Context, in *DeleteGeneratorRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/google.cloud.dialogflow.cx.v3beta1.Generators/DeleteGenerator", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// GeneratorsServer is the server API for Generators service. +type GeneratorsServer interface { + // Returns the list of all generators in the specified agent. + ListGenerators(context.Context, *ListGeneratorsRequest) (*ListGeneratorsResponse, error) + // Retrieves the specified generator. + GetGenerator(context.Context, *GetGeneratorRequest) (*Generator, error) + // Creates a generator in the specified agent. + CreateGenerator(context.Context, *CreateGeneratorRequest) (*Generator, error) + // Update the specified generator. + UpdateGenerator(context.Context, *UpdateGeneratorRequest) (*Generator, error) + // Deletes the specified generators. + DeleteGenerator(context.Context, *DeleteGeneratorRequest) (*emptypb.Empty, error) +} + +// UnimplementedGeneratorsServer can be embedded to have forward compatible implementations. +type UnimplementedGeneratorsServer struct { +} + +func (*UnimplementedGeneratorsServer) ListGenerators(context.Context, *ListGeneratorsRequest) (*ListGeneratorsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListGenerators not implemented") +} +func (*UnimplementedGeneratorsServer) GetGenerator(context.Context, *GetGeneratorRequest) (*Generator, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetGenerator not implemented") +} +func (*UnimplementedGeneratorsServer) CreateGenerator(context.Context, *CreateGeneratorRequest) (*Generator, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateGenerator not implemented") +} +func (*UnimplementedGeneratorsServer) UpdateGenerator(context.Context, *UpdateGeneratorRequest) (*Generator, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateGenerator not implemented") +} +func (*UnimplementedGeneratorsServer) DeleteGenerator(context.Context, *DeleteGeneratorRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteGenerator not implemented") +} + +func RegisterGeneratorsServer(s *grpc.Server, srv GeneratorsServer) { + s.RegisterService(&_Generators_serviceDesc, srv) +} + +func _Generators_ListGenerators_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListGeneratorsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GeneratorsServer).ListGenerators(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.dialogflow.cx.v3beta1.Generators/ListGenerators", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GeneratorsServer).ListGenerators(ctx, req.(*ListGeneratorsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Generators_GetGenerator_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetGeneratorRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GeneratorsServer).GetGenerator(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.dialogflow.cx.v3beta1.Generators/GetGenerator", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GeneratorsServer).GetGenerator(ctx, req.(*GetGeneratorRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Generators_CreateGenerator_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateGeneratorRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GeneratorsServer).CreateGenerator(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.dialogflow.cx.v3beta1.Generators/CreateGenerator", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GeneratorsServer).CreateGenerator(ctx, req.(*CreateGeneratorRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Generators_UpdateGenerator_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateGeneratorRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GeneratorsServer).UpdateGenerator(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.dialogflow.cx.v3beta1.Generators/UpdateGenerator", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GeneratorsServer).UpdateGenerator(ctx, req.(*UpdateGeneratorRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Generators_DeleteGenerator_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteGeneratorRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GeneratorsServer).DeleteGenerator(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.cloud.dialogflow.cx.v3beta1.Generators/DeleteGenerator", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GeneratorsServer).DeleteGenerator(ctx, req.(*DeleteGeneratorRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Generators_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.cloud.dialogflow.cx.v3beta1.Generators", + HandlerType: (*GeneratorsServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListGenerators", + Handler: _Generators_ListGenerators_Handler, + }, + { + MethodName: "GetGenerator", + Handler: _Generators_GetGenerator_Handler, + }, + { + MethodName: "CreateGenerator", + Handler: _Generators_CreateGenerator_Handler, + }, + { + MethodName: "UpdateGenerator", + Handler: _Generators_UpdateGenerator_Handler, + }, + { + MethodName: "DeleteGenerator", + Handler: _Generators_DeleteGenerator_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/cloud/dialogflow/cx/v3beta1/generator.proto", +} diff --git a/dialogflow/cx/apiv3beta1/gapic_metadata.json b/dialogflow/cx/apiv3beta1/gapic_metadata.json index d583e88f993f..faa19c606ae5 100644 --- a/dialogflow/cx/apiv3beta1/gapic_metadata.json +++ b/dialogflow/cx/apiv3beta1/gapic_metadata.json @@ -913,6 +913,120 @@ } } }, + "Generators": { + "clients": { + "grpc": { + "libraryClient": "GeneratorsClient", + "rpcs": { + "CancelOperation": { + "methods": [ + "CancelOperation" + ] + }, + "CreateGenerator": { + "methods": [ + "CreateGenerator" + ] + }, + "DeleteGenerator": { + "methods": [ + "DeleteGenerator" + ] + }, + "GetGenerator": { + "methods": [ + "GetGenerator" + ] + }, + "GetLocation": { + "methods": [ + "GetLocation" + ] + }, + "GetOperation": { + "methods": [ + "GetOperation" + ] + }, + "ListGenerators": { + "methods": [ + "ListGenerators" + ] + }, + "ListLocations": { + "methods": [ + "ListLocations" + ] + }, + "ListOperations": { + "methods": [ + "ListOperations" + ] + }, + "UpdateGenerator": { + "methods": [ + "UpdateGenerator" + ] + } + } + }, + "rest": { + "libraryClient": "GeneratorsClient", + "rpcs": { + "CancelOperation": { + "methods": [ + "CancelOperation" + ] + }, + "CreateGenerator": { + "methods": [ + "CreateGenerator" + ] + }, + "DeleteGenerator": { + "methods": [ + "DeleteGenerator" + ] + }, + "GetGenerator": { + "methods": [ + "GetGenerator" + ] + }, + "GetLocation": { + "methods": [ + "GetLocation" + ] + }, + "GetOperation": { + "methods": [ + "GetOperation" + ] + }, + "ListGenerators": { + "methods": [ + "ListGenerators" + ] + }, + "ListLocations": { + "methods": [ + "ListLocations" + ] + }, + "ListOperations": { + "methods": [ + "ListOperations" + ] + }, + "UpdateGenerator": { + "methods": [ + "UpdateGenerator" + ] + } + } + } + } + }, "Intents": { "clients": { "grpc": { diff --git a/dialogflow/cx/apiv3beta1/generators_client.go b/dialogflow/cx/apiv3beta1/generators_client.go new file mode 100755 index 000000000000..a1627c46f32b --- /dev/null +++ b/dialogflow/cx/apiv3beta1/generators_client.go @@ -0,0 +1,1406 @@ +// Copyright 2023 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 ( + "bytes" + "context" + "fmt" + "io" + "math" + "net/http" + "net/url" + "time" + + cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb" + longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/googleapi" + "google.golang.org/api/iterator" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + gtransport "google.golang.org/api/transport/grpc" + httptransport "google.golang.org/api/transport/http" + locationpb "google.golang.org/genproto/googleapis/cloud/location" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/protobuf/encoding/protojson" + "google.golang.org/protobuf/proto" +) + +var newGeneratorsClientHook clientHook + +// GeneratorsCallOptions contains the retry settings for each method of GeneratorsClient. +type GeneratorsCallOptions struct { + ListGenerators []gax.CallOption + GetGenerator []gax.CallOption + CreateGenerator []gax.CallOption + UpdateGenerator []gax.CallOption + DeleteGenerator []gax.CallOption + GetLocation []gax.CallOption + ListLocations []gax.CallOption + CancelOperation []gax.CallOption + GetOperation []gax.CallOption + ListOperations []gax.CallOption +} + +func defaultGeneratorsGRPCClientOptions() []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.WithDefaultCallOptions( + grpc.MaxCallRecvMsgSize(math.MaxInt32))), + } +} + +func defaultGeneratorsCallOptions() *GeneratorsCallOptions { + return &GeneratorsCallOptions{ + ListGenerators: []gax.CallOption{ + gax.WithTimeout(60000 * time.Millisecond), + 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, + }) + }), + }, + GetGenerator: []gax.CallOption{ + gax.WithTimeout(60000 * time.Millisecond), + 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, + }) + }), + }, + CreateGenerator: []gax.CallOption{ + gax.WithTimeout(60000 * time.Millisecond), + 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, + }) + }), + }, + UpdateGenerator: []gax.CallOption{ + gax.WithTimeout(60000 * time.Millisecond), + 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, + }) + }), + }, + DeleteGenerator: []gax.CallOption{ + gax.WithTimeout(60000 * time.Millisecond), + 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, + }) + }), + }, + GetLocation: []gax.CallOption{}, + ListLocations: []gax.CallOption{}, + CancelOperation: []gax.CallOption{}, + GetOperation: []gax.CallOption{}, + ListOperations: []gax.CallOption{}, + } +} + +func defaultGeneratorsRESTCallOptions() *GeneratorsCallOptions { + return &GeneratorsCallOptions{ + ListGenerators: []gax.CallOption{ + gax.WithTimeout(60000 * time.Millisecond), + gax.WithRetry(func() gax.Retryer { + return gax.OnHTTPCodes(gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }, + http.StatusServiceUnavailable) + }), + }, + GetGenerator: []gax.CallOption{ + gax.WithTimeout(60000 * time.Millisecond), + gax.WithRetry(func() gax.Retryer { + return gax.OnHTTPCodes(gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }, + http.StatusServiceUnavailable) + }), + }, + CreateGenerator: []gax.CallOption{ + gax.WithTimeout(60000 * time.Millisecond), + gax.WithRetry(func() gax.Retryer { + return gax.OnHTTPCodes(gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }, + http.StatusServiceUnavailable) + }), + }, + UpdateGenerator: []gax.CallOption{ + gax.WithTimeout(60000 * time.Millisecond), + gax.WithRetry(func() gax.Retryer { + return gax.OnHTTPCodes(gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }, + http.StatusServiceUnavailable) + }), + }, + DeleteGenerator: []gax.CallOption{ + gax.WithTimeout(60000 * time.Millisecond), + gax.WithRetry(func() gax.Retryer { + return gax.OnHTTPCodes(gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }, + http.StatusServiceUnavailable) + }), + }, + GetLocation: []gax.CallOption{}, + ListLocations: []gax.CallOption{}, + CancelOperation: []gax.CallOption{}, + GetOperation: []gax.CallOption{}, + ListOperations: []gax.CallOption{}, + } +} + +// internalGeneratorsClient is an interface that defines the methods available from Dialogflow API. +type internalGeneratorsClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + ListGenerators(context.Context, *cxpb.ListGeneratorsRequest, ...gax.CallOption) *GeneratorIterator + GetGenerator(context.Context, *cxpb.GetGeneratorRequest, ...gax.CallOption) (*cxpb.Generator, error) + CreateGenerator(context.Context, *cxpb.CreateGeneratorRequest, ...gax.CallOption) (*cxpb.Generator, error) + UpdateGenerator(context.Context, *cxpb.UpdateGeneratorRequest, ...gax.CallOption) (*cxpb.Generator, error) + DeleteGenerator(context.Context, *cxpb.DeleteGeneratorRequest, ...gax.CallOption) error + GetLocation(context.Context, *locationpb.GetLocationRequest, ...gax.CallOption) (*locationpb.Location, error) + ListLocations(context.Context, *locationpb.ListLocationsRequest, ...gax.CallOption) *LocationIterator + CancelOperation(context.Context, *longrunningpb.CancelOperationRequest, ...gax.CallOption) error + GetOperation(context.Context, *longrunningpb.GetOperationRequest, ...gax.CallOption) (*longrunningpb.Operation, error) + ListOperations(context.Context, *longrunningpb.ListOperationsRequest, ...gax.CallOption) *OperationIterator +} + +// GeneratorsClient 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 +// Generators +type GeneratorsClient struct { + // The internal transport-dependent client. + internalClient internalGeneratorsClient + + // The call options for this service. + CallOptions *GeneratorsCallOptions +} + +// 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 *GeneratorsClient) 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 *GeneratorsClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated: Connections are now pooled so this method does not always +// return the same resource. +func (c *GeneratorsClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// ListGenerators returns the list of all generators in the specified agent. +func (c *GeneratorsClient) ListGenerators(ctx context.Context, req *cxpb.ListGeneratorsRequest, opts ...gax.CallOption) *GeneratorIterator { + return c.internalClient.ListGenerators(ctx, req, opts...) +} + +// GetGenerator retrieves the specified generator. +func (c *GeneratorsClient) GetGenerator(ctx context.Context, req *cxpb.GetGeneratorRequest, opts ...gax.CallOption) (*cxpb.Generator, error) { + return c.internalClient.GetGenerator(ctx, req, opts...) +} + +// CreateGenerator creates a generator in the specified agent. +func (c *GeneratorsClient) CreateGenerator(ctx context.Context, req *cxpb.CreateGeneratorRequest, opts ...gax.CallOption) (*cxpb.Generator, error) { + return c.internalClient.CreateGenerator(ctx, req, opts...) +} + +// UpdateGenerator update the specified generator. +func (c *GeneratorsClient) UpdateGenerator(ctx context.Context, req *cxpb.UpdateGeneratorRequest, opts ...gax.CallOption) (*cxpb.Generator, error) { + return c.internalClient.UpdateGenerator(ctx, req, opts...) +} + +// DeleteGenerator deletes the specified generators. +func (c *GeneratorsClient) DeleteGenerator(ctx context.Context, req *cxpb.DeleteGeneratorRequest, opts ...gax.CallOption) error { + return c.internalClient.DeleteGenerator(ctx, req, opts...) +} + +// GetLocation gets information about a location. +func (c *GeneratorsClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error) { + return c.internalClient.GetLocation(ctx, req, opts...) +} + +// ListLocations lists information about the supported locations for this service. +func (c *GeneratorsClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator { + return c.internalClient.ListLocations(ctx, req, opts...) +} + +// CancelOperation is a utility method from google.longrunning.Operations. +func (c *GeneratorsClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error { + return c.internalClient.CancelOperation(ctx, req, opts...) +} + +// GetOperation is a utility method from google.longrunning.Operations. +func (c *GeneratorsClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { + return c.internalClient.GetOperation(ctx, req, opts...) +} + +// ListOperations is a utility method from google.longrunning.Operations. +func (c *GeneratorsClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator { + return c.internalClient.ListOperations(ctx, req, opts...) +} + +// generatorsGRPCClient 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 generatorsGRPCClient struct { + // Connection pool of gRPC connections to the service. + connPool gtransport.ConnPool + + // Points back to the CallOptions field of the containing GeneratorsClient + CallOptions **GeneratorsCallOptions + + // The gRPC API client. + generatorsClient cxpb.GeneratorsClient + + operationsClient longrunningpb.OperationsClient + + locationsClient locationpb.LocationsClient + + // The x-goog-* metadata to be sent with each request. + xGoogHeaders []string +} + +// NewGeneratorsClient creates a new generators 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 +// Generators +func NewGeneratorsClient(ctx context.Context, opts ...option.ClientOption) (*GeneratorsClient, error) { + clientOpts := defaultGeneratorsGRPCClientOptions() + if newGeneratorsClientHook != nil { + hookOpts, err := newGeneratorsClientHook(ctx, clientHookParams{}) + if err != nil { + return nil, err + } + clientOpts = append(clientOpts, hookOpts...) + } + + connPool, err := gtransport.DialPool(ctx, append(clientOpts, opts...)...) + if err != nil { + return nil, err + } + client := GeneratorsClient{CallOptions: defaultGeneratorsCallOptions()} + + c := &generatorsGRPCClient{ + connPool: connPool, + generatorsClient: cxpb.NewGeneratorsClient(connPool), + CallOptions: &client.CallOptions, + operationsClient: longrunningpb.NewOperationsClient(connPool), + locationsClient: locationpb.NewLocationsClient(connPool), + } + c.setGoogleClientInfo() + + client.internalClient = c + + return &client, nil +} + +// Connection returns a connection to the API service. +// +// Deprecated: Connections are now pooled so this method does not always +// return the same resource. +func (c *generatorsGRPCClient) 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 *generatorsGRPCClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", gax.GoVersion}, keyval...) + kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version) + c.xGoogHeaders = []string{"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 *generatorsGRPCClient) Close() error { + return c.connPool.Close() +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type generatorsRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* headers to be sent with each request. + xGoogHeaders []string + + // Points back to the CallOptions field of the containing GeneratorsClient + CallOptions **GeneratorsCallOptions +} + +// NewGeneratorsRESTClient creates a new generators rest client. +// +// Service for managing +// Generators +func NewGeneratorsRESTClient(ctx context.Context, opts ...option.ClientOption) (*GeneratorsClient, error) { + clientOpts := append(defaultGeneratorsRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + callOpts := defaultGeneratorsRESTCallOptions() + c := &generatorsRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + CallOptions: &callOpts, + } + c.setGoogleClientInfo() + + return &GeneratorsClient{internalClient: c, CallOptions: callOpts}, nil +} + +func defaultGeneratorsRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("https://dialogflow.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("https://dialogflow.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://dialogflow.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// 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 *generatorsRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", gax.GoVersion}, keyval...) + kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogHeaders = []string{"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 *generatorsRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated: This method always returns nil. +func (c *generatorsRESTClient) Connection() *grpc.ClientConn { + return nil +} +func (c *generatorsGRPCClient) ListGenerators(ctx context.Context, req *cxpb.ListGeneratorsRequest, opts ...gax.CallOption) *GeneratorIterator { + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} + + hds = append(c.xGoogHeaders, hds...) + ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + opts = append((*c.CallOptions).ListGenerators[0:len((*c.CallOptions).ListGenerators):len((*c.CallOptions).ListGenerators)], opts...) + it := &GeneratorIterator{} + req = proto.Clone(req).(*cxpb.ListGeneratorsRequest) + it.InternalFetch = func(pageSize int, pageToken string) ([]*cxpb.Generator, string, error) { + resp := &cxpb.ListGeneratorsResponse{} + 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.generatorsClient.ListGenerators(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, "", err + } + + it.Response = resp + return resp.GetGenerators(), 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 *generatorsGRPCClient) GetGenerator(ctx context.Context, req *cxpb.GetGeneratorRequest, opts ...gax.CallOption) (*cxpb.Generator, error) { + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} + + hds = append(c.xGoogHeaders, hds...) + ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + opts = append((*c.CallOptions).GetGenerator[0:len((*c.CallOptions).GetGenerator):len((*c.CallOptions).GetGenerator)], opts...) + var resp *cxpb.Generator + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.generatorsClient.GetGenerator(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *generatorsGRPCClient) CreateGenerator(ctx context.Context, req *cxpb.CreateGeneratorRequest, opts ...gax.CallOption) (*cxpb.Generator, error) { + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} + + hds = append(c.xGoogHeaders, hds...) + ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + opts = append((*c.CallOptions).CreateGenerator[0:len((*c.CallOptions).CreateGenerator):len((*c.CallOptions).CreateGenerator)], opts...) + var resp *cxpb.Generator + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.generatorsClient.CreateGenerator(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *generatorsGRPCClient) UpdateGenerator(ctx context.Context, req *cxpb.UpdateGeneratorRequest, opts ...gax.CallOption) (*cxpb.Generator, error) { + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "generator.name", url.QueryEscape(req.GetGenerator().GetName()))} + + hds = append(c.xGoogHeaders, hds...) + ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + opts = append((*c.CallOptions).UpdateGenerator[0:len((*c.CallOptions).UpdateGenerator):len((*c.CallOptions).UpdateGenerator)], opts...) + var resp *cxpb.Generator + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.generatorsClient.UpdateGenerator(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *generatorsGRPCClient) DeleteGenerator(ctx context.Context, req *cxpb.DeleteGeneratorRequest, opts ...gax.CallOption) error { + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} + + hds = append(c.xGoogHeaders, hds...) + ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + opts = append((*c.CallOptions).DeleteGenerator[0:len((*c.CallOptions).DeleteGenerator):len((*c.CallOptions).DeleteGenerator)], opts...) + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + _, err = c.generatorsClient.DeleteGenerator(ctx, req, settings.GRPC...) + return err + }, opts...) + return err +} + +func (c *generatorsGRPCClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error) { + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} + + hds = append(c.xGoogHeaders, hds...) + ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + opts = append((*c.CallOptions).GetLocation[0:len((*c.CallOptions).GetLocation):len((*c.CallOptions).GetLocation)], opts...) + var resp *locationpb.Location + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.locationsClient.GetLocation(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *generatorsGRPCClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator { + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} + + hds = append(c.xGoogHeaders, hds...) + ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + opts = append((*c.CallOptions).ListLocations[0:len((*c.CallOptions).ListLocations):len((*c.CallOptions).ListLocations)], opts...) + it := &LocationIterator{} + req = proto.Clone(req).(*locationpb.ListLocationsRequest) + it.InternalFetch = func(pageSize int, pageToken string) ([]*locationpb.Location, string, error) { + resp := &locationpb.ListLocationsResponse{} + 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.locationsClient.ListLocations(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, "", err + } + + it.Response = resp + return resp.GetLocations(), 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 *generatorsGRPCClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error { + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} + + hds = append(c.xGoogHeaders, hds...) + ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + opts = append((*c.CallOptions).CancelOperation[0:len((*c.CallOptions).CancelOperation):len((*c.CallOptions).CancelOperation)], opts...) + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + _, err = c.operationsClient.CancelOperation(ctx, req, settings.GRPC...) + return err + }, opts...) + return err +} + +func (c *generatorsGRPCClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} + + hds = append(c.xGoogHeaders, hds...) + ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...) + var resp *longrunningpb.Operation + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.operationsClient.GetOperation(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *generatorsGRPCClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator { + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} + + hds = append(c.xGoogHeaders, hds...) + ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + opts = append((*c.CallOptions).ListOperations[0:len((*c.CallOptions).ListOperations):len((*c.CallOptions).ListOperations)], opts...) + it := &OperationIterator{} + req = proto.Clone(req).(*longrunningpb.ListOperationsRequest) + it.InternalFetch = func(pageSize int, pageToken string) ([]*longrunningpb.Operation, string, error) { + resp := &longrunningpb.ListOperationsResponse{} + 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.operationsClient.ListOperations(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, "", err + } + + it.Response = resp + return resp.GetOperations(), 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 +} + +// ListGenerators returns the list of all generators in the specified agent. +func (c *generatorsRESTClient) ListGenerators(ctx context.Context, req *cxpb.ListGeneratorsRequest, opts ...gax.CallOption) *GeneratorIterator { + it := &GeneratorIterator{} + req = proto.Clone(req).(*cxpb.ListGeneratorsRequest) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + it.InternalFetch = func(pageSize int, pageToken string) ([]*cxpb.Generator, string, error) { + resp := &cxpb.ListGeneratorsResponse{} + if pageToken != "" { + req.PageToken = pageToken + } + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else if pageSize != 0 { + req.PageSize = int32(pageSize) + } + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, "", err + } + baseUrl.Path += fmt.Sprintf("/v3beta1/%v/generators", req.GetParent()) + + params := url.Values{} + params.Add("$alt", "json;enum-encoding=int") + if req.GetLanguageCode() != "" { + params.Add("languageCode", fmt.Sprintf("%v", req.GetLanguageCode())) + } + if req.GetPageSize() != 0 { + params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize())) + } + if req.GetPageToken() != "" { + params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken())) + } + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + hds := append(c.xGoogHeaders, "Content-Type", "application/json") + headers := gax.BuildHeaders(ctx, hds...) + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) + if err != nil { + return err + } + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return err + } + defer httpRsp.Body.Close() + + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := io.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return err + } + + return nil + }, opts...) + if e != nil { + return nil, "", e + } + it.Response = resp + return resp.GetGenerators(), 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 +} + +// GetGenerator retrieves the specified generator. +func (c *generatorsRESTClient) GetGenerator(ctx context.Context, req *cxpb.GetGeneratorRequest, opts ...gax.CallOption) (*cxpb.Generator, error) { + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/v3beta1/%v", req.GetName()) + + params := url.Values{} + params.Add("$alt", "json;enum-encoding=int") + if req.GetLanguageCode() != "" { + params.Add("languageCode", fmt.Sprintf("%v", req.GetLanguageCode())) + } + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} + + hds = append(c.xGoogHeaders, hds...) + hds = append(hds, "Content-Type", "application/json") + headers := gax.BuildHeaders(ctx, hds...) + opts = append((*c.CallOptions).GetGenerator[0:len((*c.CallOptions).GetGenerator):len((*c.CallOptions).GetGenerator)], opts...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &cxpb.Generator{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return err + } + defer httpRsp.Body.Close() + + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := io.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return err + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + return resp, nil +} + +// CreateGenerator creates a generator in the specified agent. +func (c *generatorsRESTClient) CreateGenerator(ctx context.Context, req *cxpb.CreateGeneratorRequest, opts ...gax.CallOption) (*cxpb.Generator, error) { + m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} + body := req.GetGenerator() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/v3beta1/%v/generators", req.GetParent()) + + params := url.Values{} + params.Add("$alt", "json;enum-encoding=int") + if req.GetLanguageCode() != "" { + params.Add("languageCode", fmt.Sprintf("%v", req.GetLanguageCode())) + } + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} + + hds = append(c.xGoogHeaders, hds...) + hds = append(hds, "Content-Type", "application/json") + headers := gax.BuildHeaders(ctx, hds...) + opts = append((*c.CallOptions).CreateGenerator[0:len((*c.CallOptions).CreateGenerator):len((*c.CallOptions).CreateGenerator)], opts...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &cxpb.Generator{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return err + } + defer httpRsp.Body.Close() + + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := io.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return err + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + return resp, nil +} + +// UpdateGenerator update the specified generator. +func (c *generatorsRESTClient) UpdateGenerator(ctx context.Context, req *cxpb.UpdateGeneratorRequest, opts ...gax.CallOption) (*cxpb.Generator, error) { + m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} + body := req.GetGenerator() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/v3beta1/%v", req.GetGenerator().GetName()) + + params := url.Values{} + params.Add("$alt", "json;enum-encoding=int") + if req.GetLanguageCode() != "" { + params.Add("languageCode", fmt.Sprintf("%v", req.GetLanguageCode())) + } + if req.GetUpdateMask() != nil { + updateMask, err := protojson.Marshal(req.GetUpdateMask()) + if err != nil { + return nil, err + } + params.Add("updateMask", string(updateMask[1:len(updateMask)-1])) + } + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "generator.name", url.QueryEscape(req.GetGenerator().GetName()))} + + hds = append(c.xGoogHeaders, hds...) + hds = append(hds, "Content-Type", "application/json") + headers := gax.BuildHeaders(ctx, hds...) + opts = append((*c.CallOptions).UpdateGenerator[0:len((*c.CallOptions).UpdateGenerator):len((*c.CallOptions).UpdateGenerator)], opts...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &cxpb.Generator{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return err + } + defer httpRsp.Body.Close() + + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := io.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return err + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + return resp, nil +} + +// DeleteGenerator deletes the specified generators. +func (c *generatorsRESTClient) DeleteGenerator(ctx context.Context, req *cxpb.DeleteGeneratorRequest, opts ...gax.CallOption) error { + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return err + } + baseUrl.Path += fmt.Sprintf("/v3beta1/%v", req.GetName()) + + params := url.Values{} + params.Add("$alt", "json;enum-encoding=int") + if req.GetForce() { + params.Add("force", fmt.Sprintf("%v", req.GetForce())) + } + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} + + hds = append(c.xGoogHeaders, hds...) + hds = append(hds, "Content-Type", "application/json") + headers := gax.BuildHeaders(ctx, hds...) + return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return err + } + defer httpRsp.Body.Close() + + // Returns nil if there is no error, otherwise wraps + // the response code and body into a non-nil error + return googleapi.CheckResponse(httpRsp) + }, opts...) +} + +// GetLocation gets information about a location. +func (c *generatorsRESTClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error) { + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/v3beta1/%v", req.GetName()) + + params := url.Values{} + params.Add("$alt", "json;enum-encoding=int") + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} + + hds = append(c.xGoogHeaders, hds...) + hds = append(hds, "Content-Type", "application/json") + headers := gax.BuildHeaders(ctx, hds...) + opts = append((*c.CallOptions).GetLocation[0:len((*c.CallOptions).GetLocation):len((*c.CallOptions).GetLocation)], opts...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &locationpb.Location{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return err + } + defer httpRsp.Body.Close() + + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := io.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return err + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + return resp, nil +} + +// ListLocations lists information about the supported locations for this service. +func (c *generatorsRESTClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator { + it := &LocationIterator{} + req = proto.Clone(req).(*locationpb.ListLocationsRequest) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + it.InternalFetch = func(pageSize int, pageToken string) ([]*locationpb.Location, string, error) { + resp := &locationpb.ListLocationsResponse{} + if pageToken != "" { + req.PageToken = pageToken + } + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else if pageSize != 0 { + req.PageSize = int32(pageSize) + } + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, "", err + } + baseUrl.Path += fmt.Sprintf("/v3beta1/%v/locations", req.GetName()) + + params := url.Values{} + params.Add("$alt", "json;enum-encoding=int") + if req.GetFilter() != "" { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req.GetPageSize() != 0 { + params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize())) + } + if req.GetPageToken() != "" { + params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken())) + } + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + hds := append(c.xGoogHeaders, "Content-Type", "application/json") + headers := gax.BuildHeaders(ctx, hds...) + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) + if err != nil { + return err + } + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return err + } + defer httpRsp.Body.Close() + + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := io.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return err + } + + return nil + }, opts...) + if e != nil { + return nil, "", e + } + it.Response = resp + return resp.GetLocations(), 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 +} + +// CancelOperation is a utility method from google.longrunning.Operations. +func (c *generatorsRESTClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error { + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return err + } + baseUrl.Path += fmt.Sprintf("/v3beta1/%v:cancel", req.GetName()) + + params := url.Values{} + params.Add("$alt", "json;enum-encoding=int") + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} + + hds = append(c.xGoogHeaders, hds...) + hds = append(hds, "Content-Type", "application/json") + headers := gax.BuildHeaders(ctx, hds...) + return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("POST", baseUrl.String(), nil) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return err + } + defer httpRsp.Body.Close() + + // Returns nil if there is no error, otherwise wraps + // the response code and body into a non-nil error + return googleapi.CheckResponse(httpRsp) + }, opts...) +} + +// GetOperation is a utility method from google.longrunning.Operations. +func (c *generatorsRESTClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/v3beta1/%v", req.GetName()) + + params := url.Values{} + params.Add("$alt", "json;enum-encoding=int") + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} + + hds = append(c.xGoogHeaders, hds...) + hds = append(hds, "Content-Type", "application/json") + headers := gax.BuildHeaders(ctx, hds...) + opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &longrunningpb.Operation{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return err + } + defer httpRsp.Body.Close() + + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := io.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return err + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + return resp, nil +} + +// ListOperations is a utility method from google.longrunning.Operations. +func (c *generatorsRESTClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator { + it := &OperationIterator{} + req = proto.Clone(req).(*longrunningpb.ListOperationsRequest) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + it.InternalFetch = func(pageSize int, pageToken string) ([]*longrunningpb.Operation, string, error) { + resp := &longrunningpb.ListOperationsResponse{} + if pageToken != "" { + req.PageToken = pageToken + } + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else if pageSize != 0 { + req.PageSize = int32(pageSize) + } + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, "", err + } + baseUrl.Path += fmt.Sprintf("/v3beta1/%v/operations", req.GetName()) + + params := url.Values{} + params.Add("$alt", "json;enum-encoding=int") + if req.GetFilter() != "" { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req.GetPageSize() != 0 { + params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize())) + } + if req.GetPageToken() != "" { + params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken())) + } + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + hds := append(c.xGoogHeaders, "Content-Type", "application/json") + headers := gax.BuildHeaders(ctx, hds...) + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) + if err != nil { + return err + } + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return err + } + defer httpRsp.Body.Close() + + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := io.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return err + } + + return nil + }, opts...) + if e != nil { + return nil, "", e + } + it.Response = resp + return resp.GetOperations(), 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 +} diff --git a/dialogflow/cx/apiv3beta1/generators_client_example_test.go b/dialogflow/cx/apiv3beta1/generators_client_example_test.go new file mode 100644 index 000000000000..f107d205d42f --- /dev/null +++ b/dialogflow/cx/apiv3beta1/generators_client_example_test.go @@ -0,0 +1,325 @@ +// Copyright 2023 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" + cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb" + longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" + "google.golang.org/api/iterator" + locationpb "google.golang.org/genproto/googleapis/cloud/location" +) + +func ExampleNewGeneratorsClient() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := cx.NewGeneratorsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleNewGeneratorsRESTClient() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := cx.NewGeneratorsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleGeneratorsClient_CreateGenerator() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := cx.NewGeneratorsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &cxpb.CreateGeneratorRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#CreateGeneratorRequest. + } + resp, err := c.CreateGenerator(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleGeneratorsClient_DeleteGenerator() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := cx.NewGeneratorsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &cxpb.DeleteGeneratorRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#DeleteGeneratorRequest. + } + err = c.DeleteGenerator(ctx, req) + if err != nil { + // TODO: Handle error. + } +} + +func ExampleGeneratorsClient_GetGenerator() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := cx.NewGeneratorsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &cxpb.GetGeneratorRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#GetGeneratorRequest. + } + resp, err := c.GetGenerator(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleGeneratorsClient_ListGenerators() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := cx.NewGeneratorsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &cxpb.ListGeneratorsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListGeneratorsRequest. + } + it := c.ListGenerators(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +func ExampleGeneratorsClient_UpdateGenerator() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := cx.NewGeneratorsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &cxpb.UpdateGeneratorRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#UpdateGeneratorRequest. + } + resp, err := c.UpdateGenerator(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleGeneratorsClient_GetLocation() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := cx.NewGeneratorsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &locationpb.GetLocationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#GetLocationRequest. + } + resp, err := c.GetLocation(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleGeneratorsClient_ListLocations() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := cx.NewGeneratorsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &locationpb.ListLocationsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest. + } + it := c.ListLocations(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +func ExampleGeneratorsClient_CancelOperation() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := cx.NewGeneratorsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.CancelOperationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest. + } + err = c.CancelOperation(ctx, req) + if err != nil { + // TODO: Handle error. + } +} + +func ExampleGeneratorsClient_GetOperation() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := cx.NewGeneratorsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.GetOperationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest. + } + resp, err := c.GetOperation(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleGeneratorsClient_ListOperations() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := cx.NewGeneratorsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.ListOperationsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest. + } + it := c.ListOperations(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} diff --git a/internal/generated/snippets/dialogflow/cx/apiv3beta1/GeneratorsClient/CancelOperation/main.go b/internal/generated/snippets/dialogflow/cx/apiv3beta1/GeneratorsClient/CancelOperation/main.go new file mode 100644 index 000000000000..e3d7a4d1b15b --- /dev/null +++ b/internal/generated/snippets/dialogflow/cx/apiv3beta1/GeneratorsClient/CancelOperation/main.go @@ -0,0 +1,51 @@ +// Copyright 2023 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. + +// [START dialogflow_v3beta1_generated_Generators_CancelOperation_sync] + +package main + +import ( + "context" + + cx "cloud.google.com/go/dialogflow/cx/apiv3beta1" + longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" +) + +func main() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := cx.NewGeneratorsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.CancelOperationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest. + } + err = c.CancelOperation(ctx, req) + if err != nil { + // TODO: Handle error. + } +} + +// [END dialogflow_v3beta1_generated_Generators_CancelOperation_sync] diff --git a/internal/generated/snippets/dialogflow/cx/apiv3beta1/GeneratorsClient/CreateGenerator/main.go b/internal/generated/snippets/dialogflow/cx/apiv3beta1/GeneratorsClient/CreateGenerator/main.go new file mode 100644 index 000000000000..ad0bf048ab88 --- /dev/null +++ b/internal/generated/snippets/dialogflow/cx/apiv3beta1/GeneratorsClient/CreateGenerator/main.go @@ -0,0 +1,53 @@ +// Copyright 2023 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. + +// [START dialogflow_v3beta1_generated_Generators_CreateGenerator_sync] + +package main + +import ( + "context" + + cx "cloud.google.com/go/dialogflow/cx/apiv3beta1" + cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb" +) + +func main() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := cx.NewGeneratorsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &cxpb.CreateGeneratorRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#CreateGeneratorRequest. + } + resp, err := c.CreateGenerator(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END dialogflow_v3beta1_generated_Generators_CreateGenerator_sync] diff --git a/internal/generated/snippets/dialogflow/cx/apiv3beta1/GeneratorsClient/DeleteGenerator/main.go b/internal/generated/snippets/dialogflow/cx/apiv3beta1/GeneratorsClient/DeleteGenerator/main.go new file mode 100644 index 000000000000..eef25aedd2cd --- /dev/null +++ b/internal/generated/snippets/dialogflow/cx/apiv3beta1/GeneratorsClient/DeleteGenerator/main.go @@ -0,0 +1,51 @@ +// Copyright 2023 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. + +// [START dialogflow_v3beta1_generated_Generators_DeleteGenerator_sync] + +package main + +import ( + "context" + + cx "cloud.google.com/go/dialogflow/cx/apiv3beta1" + cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb" +) + +func main() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := cx.NewGeneratorsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &cxpb.DeleteGeneratorRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#DeleteGeneratorRequest. + } + err = c.DeleteGenerator(ctx, req) + if err != nil { + // TODO: Handle error. + } +} + +// [END dialogflow_v3beta1_generated_Generators_DeleteGenerator_sync] diff --git a/internal/generated/snippets/dialogflow/cx/apiv3beta1/GeneratorsClient/GetGenerator/main.go b/internal/generated/snippets/dialogflow/cx/apiv3beta1/GeneratorsClient/GetGenerator/main.go new file mode 100644 index 000000000000..1ca1c29d1f29 --- /dev/null +++ b/internal/generated/snippets/dialogflow/cx/apiv3beta1/GeneratorsClient/GetGenerator/main.go @@ -0,0 +1,53 @@ +// Copyright 2023 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. + +// [START dialogflow_v3beta1_generated_Generators_GetGenerator_sync] + +package main + +import ( + "context" + + cx "cloud.google.com/go/dialogflow/cx/apiv3beta1" + cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb" +) + +func main() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := cx.NewGeneratorsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &cxpb.GetGeneratorRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#GetGeneratorRequest. + } + resp, err := c.GetGenerator(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END dialogflow_v3beta1_generated_Generators_GetGenerator_sync] diff --git a/internal/generated/snippets/dialogflow/cx/apiv3beta1/GeneratorsClient/GetLocation/main.go b/internal/generated/snippets/dialogflow/cx/apiv3beta1/GeneratorsClient/GetLocation/main.go new file mode 100644 index 000000000000..c5cf947b570b --- /dev/null +++ b/internal/generated/snippets/dialogflow/cx/apiv3beta1/GeneratorsClient/GetLocation/main.go @@ -0,0 +1,53 @@ +// Copyright 2023 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. + +// [START dialogflow_v3beta1_generated_Generators_GetLocation_sync] + +package main + +import ( + "context" + + cx "cloud.google.com/go/dialogflow/cx/apiv3beta1" + locationpb "google.golang.org/genproto/googleapis/cloud/location" +) + +func main() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := cx.NewGeneratorsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &locationpb.GetLocationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#GetLocationRequest. + } + resp, err := c.GetLocation(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END dialogflow_v3beta1_generated_Generators_GetLocation_sync] diff --git a/internal/generated/snippets/dialogflow/cx/apiv3beta1/GeneratorsClient/GetOperation/main.go b/internal/generated/snippets/dialogflow/cx/apiv3beta1/GeneratorsClient/GetOperation/main.go new file mode 100644 index 000000000000..0278b90623ef --- /dev/null +++ b/internal/generated/snippets/dialogflow/cx/apiv3beta1/GeneratorsClient/GetOperation/main.go @@ -0,0 +1,53 @@ +// Copyright 2023 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. + +// [START dialogflow_v3beta1_generated_Generators_GetOperation_sync] + +package main + +import ( + "context" + + cx "cloud.google.com/go/dialogflow/cx/apiv3beta1" + longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" +) + +func main() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := cx.NewGeneratorsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.GetOperationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest. + } + resp, err := c.GetOperation(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END dialogflow_v3beta1_generated_Generators_GetOperation_sync] diff --git a/internal/generated/snippets/dialogflow/cx/apiv3beta1/GeneratorsClient/ListGenerators/main.go b/internal/generated/snippets/dialogflow/cx/apiv3beta1/GeneratorsClient/ListGenerators/main.go new file mode 100644 index 000000000000..d695f372f957 --- /dev/null +++ b/internal/generated/snippets/dialogflow/cx/apiv3beta1/GeneratorsClient/ListGenerators/main.go @@ -0,0 +1,60 @@ +// Copyright 2023 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. + +// [START dialogflow_v3beta1_generated_Generators_ListGenerators_sync] + +package main + +import ( + "context" + + cx "cloud.google.com/go/dialogflow/cx/apiv3beta1" + cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb" + "google.golang.org/api/iterator" +) + +func main() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := cx.NewGeneratorsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &cxpb.ListGeneratorsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListGeneratorsRequest. + } + it := c.ListGenerators(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_Generators_ListGenerators_sync] diff --git a/internal/generated/snippets/dialogflow/cx/apiv3beta1/GeneratorsClient/ListLocations/main.go b/internal/generated/snippets/dialogflow/cx/apiv3beta1/GeneratorsClient/ListLocations/main.go new file mode 100644 index 000000000000..29a69ba79f3f --- /dev/null +++ b/internal/generated/snippets/dialogflow/cx/apiv3beta1/GeneratorsClient/ListLocations/main.go @@ -0,0 +1,60 @@ +// Copyright 2023 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. + +// [START dialogflow_v3beta1_generated_Generators_ListLocations_sync] + +package main + +import ( + "context" + + cx "cloud.google.com/go/dialogflow/cx/apiv3beta1" + "google.golang.org/api/iterator" + locationpb "google.golang.org/genproto/googleapis/cloud/location" +) + +func main() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := cx.NewGeneratorsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &locationpb.ListLocationsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest. + } + it := c.ListLocations(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_Generators_ListLocations_sync] diff --git a/internal/generated/snippets/dialogflow/cx/apiv3beta1/GeneratorsClient/ListOperations/main.go b/internal/generated/snippets/dialogflow/cx/apiv3beta1/GeneratorsClient/ListOperations/main.go new file mode 100644 index 000000000000..95e3e3ae9b32 --- /dev/null +++ b/internal/generated/snippets/dialogflow/cx/apiv3beta1/GeneratorsClient/ListOperations/main.go @@ -0,0 +1,60 @@ +// Copyright 2023 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. + +// [START dialogflow_v3beta1_generated_Generators_ListOperations_sync] + +package main + +import ( + "context" + + cx "cloud.google.com/go/dialogflow/cx/apiv3beta1" + longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" + "google.golang.org/api/iterator" +) + +func main() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := cx.NewGeneratorsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.ListOperationsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest. + } + it := c.ListOperations(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_Generators_ListOperations_sync] diff --git a/internal/generated/snippets/dialogflow/cx/apiv3beta1/GeneratorsClient/UpdateGenerator/main.go b/internal/generated/snippets/dialogflow/cx/apiv3beta1/GeneratorsClient/UpdateGenerator/main.go new file mode 100644 index 000000000000..de5e586ce6e4 --- /dev/null +++ b/internal/generated/snippets/dialogflow/cx/apiv3beta1/GeneratorsClient/UpdateGenerator/main.go @@ -0,0 +1,53 @@ +// Copyright 2023 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. + +// [START dialogflow_v3beta1_generated_Generators_UpdateGenerator_sync] + +package main + +import ( + "context" + + cx "cloud.google.com/go/dialogflow/cx/apiv3beta1" + cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb" +) + +func main() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := cx.NewGeneratorsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &cxpb.UpdateGeneratorRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#UpdateGeneratorRequest. + } + resp, err := c.UpdateGenerator(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END dialogflow_v3beta1_generated_Generators_UpdateGenerator_sync] diff --git a/internal/generated/snippets/dialogflow/cx/apiv3beta1/snippet_metadata.google.cloud.dialogflow.cx.v3beta1.json b/internal/generated/snippets/dialogflow/cx/apiv3beta1/snippet_metadata.google.cloud.dialogflow.cx.v3beta1.json index 4bc2dce22efb..5a8d54ce11ad 100644 --- a/internal/generated/snippets/dialogflow/cx/apiv3beta1/snippet_metadata.google.cloud.dialogflow.cx.v3beta1.json +++ b/internal/generated/snippets/dialogflow/cx/apiv3beta1/snippet_metadata.google.cloud.dialogflow.cx.v3beta1.json @@ -3725,6 +3725,464 @@ } ] }, + { + "regionTag": "dialogflow_v3beta1_generated_Generators_CancelOperation_sync", + "title": "dialogflow CancelOperation Sample", + "description": "CancelOperation is a utility method from google.longrunning.Operations.", + "file": "GeneratorsClient/CancelOperation/main.go", + "language": "GO", + "clientMethod": { + "shortName": "CancelOperation", + "fullName": "google.cloud.dialogflow.cx.v3beta1.GeneratorsClient.CancelOperation", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "longrunningpb.CancelOperationRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "client": { + "shortName": "GeneratorsClient", + "fullName": "google.cloud.dialogflow.cx.v3beta1.GeneratorsClient" + }, + "method": { + "shortName": "CancelOperation", + "fullName": "google.longrunning.Operations.CancelOperation", + "service": { + "shortName": "Operations", + "fullName": "google.longrunning.Operations" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 51, + "type": "FULL" + } + ] + }, + { + "regionTag": "dialogflow_v3beta1_generated_Generators_CreateGenerator_sync", + "title": "dialogflow CreateGenerator Sample", + "description": "CreateGenerator creates a generator in the specified agent.", + "file": "GeneratorsClient/CreateGenerator/main.go", + "language": "GO", + "clientMethod": { + "shortName": "CreateGenerator", + "fullName": "google.cloud.dialogflow.cx.v3beta1.GeneratorsClient.CreateGenerator", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "cxpb.CreateGeneratorRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "*cxpb.Generator", + "client": { + "shortName": "GeneratorsClient", + "fullName": "google.cloud.dialogflow.cx.v3beta1.GeneratorsClient" + }, + "method": { + "shortName": "CreateGenerator", + "fullName": "google.cloud.dialogflow.cx.v3beta1.Generators.CreateGenerator", + "service": { + "shortName": "Generators", + "fullName": "google.cloud.dialogflow.cx.v3beta1.Generators" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 53, + "type": "FULL" + } + ] + }, + { + "regionTag": "dialogflow_v3beta1_generated_Generators_DeleteGenerator_sync", + "title": "dialogflow DeleteGenerator Sample", + "description": "DeleteGenerator deletes the specified generators.", + "file": "GeneratorsClient/DeleteGenerator/main.go", + "language": "GO", + "clientMethod": { + "shortName": "DeleteGenerator", + "fullName": "google.cloud.dialogflow.cx.v3beta1.GeneratorsClient.DeleteGenerator", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "cxpb.DeleteGeneratorRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "client": { + "shortName": "GeneratorsClient", + "fullName": "google.cloud.dialogflow.cx.v3beta1.GeneratorsClient" + }, + "method": { + "shortName": "DeleteGenerator", + "fullName": "google.cloud.dialogflow.cx.v3beta1.Generators.DeleteGenerator", + "service": { + "shortName": "Generators", + "fullName": "google.cloud.dialogflow.cx.v3beta1.Generators" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 51, + "type": "FULL" + } + ] + }, + { + "regionTag": "dialogflow_v3beta1_generated_Generators_GetGenerator_sync", + "title": "dialogflow GetGenerator Sample", + "description": "GetGenerator retrieves the specified generator.", + "file": "GeneratorsClient/GetGenerator/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetGenerator", + "fullName": "google.cloud.dialogflow.cx.v3beta1.GeneratorsClient.GetGenerator", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "cxpb.GetGeneratorRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "*cxpb.Generator", + "client": { + "shortName": "GeneratorsClient", + "fullName": "google.cloud.dialogflow.cx.v3beta1.GeneratorsClient" + }, + "method": { + "shortName": "GetGenerator", + "fullName": "google.cloud.dialogflow.cx.v3beta1.Generators.GetGenerator", + "service": { + "shortName": "Generators", + "fullName": "google.cloud.dialogflow.cx.v3beta1.Generators" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 53, + "type": "FULL" + } + ] + }, + { + "regionTag": "dialogflow_v3beta1_generated_Generators_GetLocation_sync", + "title": "dialogflow GetLocation Sample", + "description": "GetLocation gets information about a location.", + "file": "GeneratorsClient/GetLocation/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetLocation", + "fullName": "google.cloud.dialogflow.cx.v3beta1.GeneratorsClient.GetLocation", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "locationpb.GetLocationRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "*locationpb.Location", + "client": { + "shortName": "GeneratorsClient", + "fullName": "google.cloud.dialogflow.cx.v3beta1.GeneratorsClient" + }, + "method": { + "shortName": "GetLocation", + "fullName": "google.cloud.location.Locations.GetLocation", + "service": { + "shortName": "Locations", + "fullName": "google.cloud.location.Locations" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 53, + "type": "FULL" + } + ] + }, + { + "regionTag": "dialogflow_v3beta1_generated_Generators_GetOperation_sync", + "title": "dialogflow GetOperation Sample", + "description": "GetOperation is a utility method from google.longrunning.Operations.", + "file": "GeneratorsClient/GetOperation/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetOperation", + "fullName": "google.cloud.dialogflow.cx.v3beta1.GeneratorsClient.GetOperation", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "longrunningpb.GetOperationRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "*longrunningpb.Operation", + "client": { + "shortName": "GeneratorsClient", + "fullName": "google.cloud.dialogflow.cx.v3beta1.GeneratorsClient" + }, + "method": { + "shortName": "GetOperation", + "fullName": "google.longrunning.Operations.GetOperation", + "service": { + "shortName": "Operations", + "fullName": "google.longrunning.Operations" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 53, + "type": "FULL" + } + ] + }, + { + "regionTag": "dialogflow_v3beta1_generated_Generators_ListGenerators_sync", + "title": "dialogflow ListGenerators Sample", + "description": "ListGenerators returns the list of all generators in the specified agent.", + "file": "GeneratorsClient/ListGenerators/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ListGenerators", + "fullName": "google.cloud.dialogflow.cx.v3beta1.GeneratorsClient.ListGenerators", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "cxpb.ListGeneratorsRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "GeneratorIterator", + "client": { + "shortName": "GeneratorsClient", + "fullName": "google.cloud.dialogflow.cx.v3beta1.GeneratorsClient" + }, + "method": { + "shortName": "ListGenerators", + "fullName": "google.cloud.dialogflow.cx.v3beta1.Generators.ListGenerators", + "service": { + "shortName": "Generators", + "fullName": "google.cloud.dialogflow.cx.v3beta1.Generators" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 60, + "type": "FULL" + } + ] + }, + { + "regionTag": "dialogflow_v3beta1_generated_Generators_ListLocations_sync", + "title": "dialogflow ListLocations Sample", + "description": "ListLocations lists information about the supported locations for this service.", + "file": "GeneratorsClient/ListLocations/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ListLocations", + "fullName": "google.cloud.dialogflow.cx.v3beta1.GeneratorsClient.ListLocations", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "locationpb.ListLocationsRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "LocationIterator", + "client": { + "shortName": "GeneratorsClient", + "fullName": "google.cloud.dialogflow.cx.v3beta1.GeneratorsClient" + }, + "method": { + "shortName": "ListLocations", + "fullName": "google.cloud.location.Locations.ListLocations", + "service": { + "shortName": "Locations", + "fullName": "google.cloud.location.Locations" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 60, + "type": "FULL" + } + ] + }, + { + "regionTag": "dialogflow_v3beta1_generated_Generators_ListOperations_sync", + "title": "dialogflow ListOperations Sample", + "description": "ListOperations is a utility method from google.longrunning.Operations.", + "file": "GeneratorsClient/ListOperations/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ListOperations", + "fullName": "google.cloud.dialogflow.cx.v3beta1.GeneratorsClient.ListOperations", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "longrunningpb.ListOperationsRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "OperationIterator", + "client": { + "shortName": "GeneratorsClient", + "fullName": "google.cloud.dialogflow.cx.v3beta1.GeneratorsClient" + }, + "method": { + "shortName": "ListOperations", + "fullName": "google.longrunning.Operations.ListOperations", + "service": { + "shortName": "Operations", + "fullName": "google.longrunning.Operations" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 60, + "type": "FULL" + } + ] + }, + { + "regionTag": "dialogflow_v3beta1_generated_Generators_UpdateGenerator_sync", + "title": "dialogflow UpdateGenerator Sample", + "description": "UpdateGenerator update the specified generator.", + "file": "GeneratorsClient/UpdateGenerator/main.go", + "language": "GO", + "clientMethod": { + "shortName": "UpdateGenerator", + "fullName": "google.cloud.dialogflow.cx.v3beta1.GeneratorsClient.UpdateGenerator", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "cxpb.UpdateGeneratorRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "*cxpb.Generator", + "client": { + "shortName": "GeneratorsClient", + "fullName": "google.cloud.dialogflow.cx.v3beta1.GeneratorsClient" + }, + "method": { + "shortName": "UpdateGenerator", + "fullName": "google.cloud.dialogflow.cx.v3beta1.Generators.UpdateGenerator", + "service": { + "shortName": "Generators", + "fullName": "google.cloud.dialogflow.cx.v3beta1.Generators" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 53, + "type": "FULL" + } + ] + }, { "regionTag": "dialogflow_v3beta1_generated_Intents_CancelOperation_sync", "title": "dialogflow CancelOperation Sample",