1// Copyright 2019 Google LLC. 2// Use of this source code is governed by a BSD-style 3// license that can be found in the LICENSE file. 4 5// Code generated file. DO NOT EDIT. 6 7// Package dialogflow provides access to the Dialogflow API. 8// 9// This package is DEPRECATED. Use package cloud.google.com/go/dialogflow/apiv2 instead. 10// 11// For product documentation, see: https://cloud.google.com/dialogflow/ 12// 13// Creating a client 14// 15// Usage example: 16// 17// import "google.golang.org/api/dialogflow/v2" 18// ... 19// ctx := context.Background() 20// dialogflowService, err := dialogflow.NewService(ctx) 21// 22// In this example, Google Application Default Credentials are used for authentication. 23// 24// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 25// 26// Other authentication options 27// 28// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes: 29// 30// dialogflowService, err := dialogflow.NewService(ctx, option.WithScopes(dialogflow.DialogflowScope)) 31// 32// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: 33// 34// dialogflowService, err := dialogflow.NewService(ctx, option.WithAPIKey("AIza...")) 35// 36// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: 37// 38// config := &oauth2.Config{...} 39// // ... 40// token, err := config.Exchange(ctx, ...) 41// dialogflowService, err := dialogflow.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 42// 43// See https://godoc.org/google.golang.org/api/option/ for details on options. 44package dialogflow // import "google.golang.org/api/dialogflow/v2" 45 46import ( 47 "bytes" 48 "context" 49 "encoding/json" 50 "errors" 51 "fmt" 52 "io" 53 "net/http" 54 "net/url" 55 "strconv" 56 "strings" 57 58 gensupport "google.golang.org/api/gensupport" 59 googleapi "google.golang.org/api/googleapi" 60 option "google.golang.org/api/option" 61 htransport "google.golang.org/api/transport/http" 62) 63 64// Always reference these packages, just in case the auto-generated code 65// below doesn't. 66var _ = bytes.NewBuffer 67var _ = strconv.Itoa 68var _ = fmt.Sprintf 69var _ = json.NewDecoder 70var _ = io.Copy 71var _ = url.Parse 72var _ = gensupport.MarshalJSON 73var _ = googleapi.Version 74var _ = errors.New 75var _ = strings.Replace 76var _ = context.Canceled 77 78const apiId = "dialogflow:v2" 79const apiName = "dialogflow" 80const apiVersion = "v2" 81const basePath = "https://dialogflow.googleapis.com/" 82 83// OAuth2 scopes used by this API. 84const ( 85 // View and manage your data across Google Cloud Platform services 86 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 87 88 // View, manage and query your Dialogflow agents 89 DialogflowScope = "https://www.googleapis.com/auth/dialogflow" 90) 91 92// NewService creates a new Service. 93func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 94 scopesOption := option.WithScopes( 95 "https://www.googleapis.com/auth/cloud-platform", 96 "https://www.googleapis.com/auth/dialogflow", 97 ) 98 // NOTE: prepend, so we don't override user-specified scopes. 99 opts = append([]option.ClientOption{scopesOption}, opts...) 100 client, endpoint, err := htransport.NewClient(ctx, opts...) 101 if err != nil { 102 return nil, err 103 } 104 s, err := New(client) 105 if err != nil { 106 return nil, err 107 } 108 if endpoint != "" { 109 s.BasePath = endpoint 110 } 111 return s, nil 112} 113 114// New creates a new Service. It uses the provided http.Client for requests. 115// 116// Deprecated: please use NewService instead. 117// To provide a custom HTTP client, use option.WithHTTPClient. 118// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 119func New(client *http.Client) (*Service, error) { 120 if client == nil { 121 return nil, errors.New("client is nil") 122 } 123 s := &Service{client: client, BasePath: basePath} 124 s.Projects = NewProjectsService(s) 125 return s, nil 126} 127 128type Service struct { 129 client *http.Client 130 BasePath string // API endpoint base URL 131 UserAgent string // optional additional User-Agent fragment 132 133 Projects *ProjectsService 134} 135 136func (s *Service) userAgent() string { 137 if s.UserAgent == "" { 138 return googleapi.UserAgent 139 } 140 return googleapi.UserAgent + " " + s.UserAgent 141} 142 143func NewProjectsService(s *Service) *ProjectsService { 144 rs := &ProjectsService{s: s} 145 rs.Agent_ = NewProjectsAgentService(s) 146 rs.Operations = NewProjectsOperationsService(s) 147 return rs 148} 149 150type ProjectsService struct { 151 s *Service 152 153 Agent_ *ProjectsAgentService 154 155 Operations *ProjectsOperationsService 156} 157 158func NewProjectsAgentService(s *Service) *ProjectsAgentService { 159 rs := &ProjectsAgentService{s: s} 160 rs.EntityTypes = NewProjectsAgentEntityTypesService(s) 161 rs.Intents = NewProjectsAgentIntentsService(s) 162 rs.Sessions = NewProjectsAgentSessionsService(s) 163 return rs 164} 165 166type ProjectsAgentService struct { 167 s *Service 168 169 EntityTypes *ProjectsAgentEntityTypesService 170 171 Intents *ProjectsAgentIntentsService 172 173 Sessions *ProjectsAgentSessionsService 174} 175 176func NewProjectsAgentEntityTypesService(s *Service) *ProjectsAgentEntityTypesService { 177 rs := &ProjectsAgentEntityTypesService{s: s} 178 rs.Entities = NewProjectsAgentEntityTypesEntitiesService(s) 179 return rs 180} 181 182type ProjectsAgentEntityTypesService struct { 183 s *Service 184 185 Entities *ProjectsAgentEntityTypesEntitiesService 186} 187 188func NewProjectsAgentEntityTypesEntitiesService(s *Service) *ProjectsAgentEntityTypesEntitiesService { 189 rs := &ProjectsAgentEntityTypesEntitiesService{s: s} 190 return rs 191} 192 193type ProjectsAgentEntityTypesEntitiesService struct { 194 s *Service 195} 196 197func NewProjectsAgentIntentsService(s *Service) *ProjectsAgentIntentsService { 198 rs := &ProjectsAgentIntentsService{s: s} 199 return rs 200} 201 202type ProjectsAgentIntentsService struct { 203 s *Service 204} 205 206func NewProjectsAgentSessionsService(s *Service) *ProjectsAgentSessionsService { 207 rs := &ProjectsAgentSessionsService{s: s} 208 rs.Contexts = NewProjectsAgentSessionsContextsService(s) 209 rs.EntityTypes = NewProjectsAgentSessionsEntityTypesService(s) 210 return rs 211} 212 213type ProjectsAgentSessionsService struct { 214 s *Service 215 216 Contexts *ProjectsAgentSessionsContextsService 217 218 EntityTypes *ProjectsAgentSessionsEntityTypesService 219} 220 221func NewProjectsAgentSessionsContextsService(s *Service) *ProjectsAgentSessionsContextsService { 222 rs := &ProjectsAgentSessionsContextsService{s: s} 223 return rs 224} 225 226type ProjectsAgentSessionsContextsService struct { 227 s *Service 228} 229 230func NewProjectsAgentSessionsEntityTypesService(s *Service) *ProjectsAgentSessionsEntityTypesService { 231 rs := &ProjectsAgentSessionsEntityTypesService{s: s} 232 return rs 233} 234 235type ProjectsAgentSessionsEntityTypesService struct { 236 s *Service 237} 238 239func NewProjectsOperationsService(s *Service) *ProjectsOperationsService { 240 rs := &ProjectsOperationsService{s: s} 241 return rs 242} 243 244type ProjectsOperationsService struct { 245 s *Service 246} 247 248// GoogleCloudDialogflowV2Agent: Represents a conversational agent. 249type GoogleCloudDialogflowV2Agent struct { 250 // ApiVersion: Optional. API version displayed in Dialogflow console. If 251 // not specified, 252 // V2 API is assumed. Clients are free to query different service 253 // endpoints 254 // for different API versions. However, bots connectors and webhook 255 // calls will 256 // follow the specified API version. 257 // 258 // Possible values: 259 // "API_VERSION_UNSPECIFIED" - Not specified. 260 // "API_VERSION_V1" - Legacy V1 API. 261 // "API_VERSION_V2" - V2 API. 262 // "API_VERSION_V2_BETA_1" - V2beta1 API. 263 ApiVersion string `json:"apiVersion,omitempty"` 264 265 // AvatarUri: Optional. The URI of the agent's avatar. 266 // Avatars are used throughout the Dialogflow console and in the 267 // self-hosted 268 // [Web 269 // Demo](https://cloud.google.com/dialogflow/docs/integr 270 // ations/web-demo) 271 // integration. 272 AvatarUri string `json:"avatarUri,omitempty"` 273 274 // ClassificationThreshold: Optional. To filter out false positive 275 // results and still get variety in 276 // matched natural language inputs for your agent, you can tune the 277 // machine 278 // learning classification threshold. If the returned score value is 279 // less than 280 // the threshold value, then a fallback intent will be triggered or, if 281 // there 282 // are no fallback intents defined, no intent will be triggered. The 283 // score 284 // values range from 0.0 (completely uncertain) to 1.0 (completely 285 // certain). 286 // If set to 0.0, the default of 0.3 is used. 287 ClassificationThreshold float64 `json:"classificationThreshold,omitempty"` 288 289 // DefaultLanguageCode: Required. The default language of the agent as a 290 // language tag. 291 // See 292 // [Language 293 // Support](https://cloud.google.com/dialogflow/docs/refere 294 // nce/language) 295 // for a list of the currently supported language codes. This field 296 // cannot be 297 // set by the `Update` method. 298 DefaultLanguageCode string `json:"defaultLanguageCode,omitempty"` 299 300 // Description: Optional. The description of this agent. 301 // The maximum length is 500 characters. If exceeded, the request is 302 // rejected. 303 Description string `json:"description,omitempty"` 304 305 // DisplayName: Required. The name of this agent. 306 DisplayName string `json:"displayName,omitempty"` 307 308 // EnableLogging: Optional. Determines whether this agent should log 309 // conversation queries. 310 EnableLogging bool `json:"enableLogging,omitempty"` 311 312 // MatchMode: Optional. Determines how intents are detected from user 313 // queries. 314 // 315 // Possible values: 316 // "MATCH_MODE_UNSPECIFIED" - Not specified. 317 // "MATCH_MODE_HYBRID" - Best for agents with a small number of 318 // examples in intents and/or wide 319 // use of templates syntax and composite entities. 320 // "MATCH_MODE_ML_ONLY" - Can be used for agents with a large number 321 // of examples in intents, 322 // especially the ones using @sys.any or very large developer entities. 323 MatchMode string `json:"matchMode,omitempty"` 324 325 // Parent: Required. The project of this agent. 326 // Format: `projects/<Project ID>`. 327 Parent string `json:"parent,omitempty"` 328 329 // SupportedLanguageCodes: Optional. The list of all languages supported 330 // by this agent (except for the 331 // `default_language_code`). 332 SupportedLanguageCodes []string `json:"supportedLanguageCodes,omitempty"` 333 334 // Tier: Optional. The agent tier. If not specified, TIER_STANDARD is 335 // assumed. 336 // 337 // Possible values: 338 // "TIER_UNSPECIFIED" - Not specified. This value should never be 339 // used. 340 // "TIER_STANDARD" - Standard tier. 341 // "TIER_ENTERPRISE" - Enterprise tier (Essentials). 342 // "TIER_ENTERPRISE_PLUS" - Enterprise tier (Plus). 343 Tier string `json:"tier,omitempty"` 344 345 // TimeZone: Required. The time zone of this agent from the 346 // [time zone database](https://www.iana.org/time-zones), 347 // e.g., 348 // America/New_York, Europe/Paris. 349 TimeZone string `json:"timeZone,omitempty"` 350 351 // ServerResponse contains the HTTP response code and headers from the 352 // server. 353 googleapi.ServerResponse `json:"-"` 354 355 // ForceSendFields is a list of field names (e.g. "ApiVersion") to 356 // unconditionally include in API requests. By default, fields with 357 // empty values are omitted from API requests. However, any non-pointer, 358 // non-interface field appearing in ForceSendFields will be sent to the 359 // server regardless of whether the field is empty or not. This may be 360 // used to include empty fields in Patch requests. 361 ForceSendFields []string `json:"-"` 362 363 // NullFields is a list of field names (e.g. "ApiVersion") to include in 364 // API requests with the JSON null value. By default, fields with empty 365 // values are omitted from API requests. However, any field with an 366 // empty value appearing in NullFields will be sent to the server as 367 // null. It is an error if a field in this list has a non-empty value. 368 // This may be used to include null fields in Patch requests. 369 NullFields []string `json:"-"` 370} 371 372func (s *GoogleCloudDialogflowV2Agent) MarshalJSON() ([]byte, error) { 373 type NoMethod GoogleCloudDialogflowV2Agent 374 raw := NoMethod(*s) 375 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 376} 377 378func (s *GoogleCloudDialogflowV2Agent) UnmarshalJSON(data []byte) error { 379 type NoMethod GoogleCloudDialogflowV2Agent 380 var s1 struct { 381 ClassificationThreshold gensupport.JSONFloat64 `json:"classificationThreshold"` 382 *NoMethod 383 } 384 s1.NoMethod = (*NoMethod)(s) 385 if err := json.Unmarshal(data, &s1); err != nil { 386 return err 387 } 388 s.ClassificationThreshold = float64(s1.ClassificationThreshold) 389 return nil 390} 391 392// GoogleCloudDialogflowV2BatchCreateEntitiesRequest: The request 393// message for EntityTypes.BatchCreateEntities. 394type GoogleCloudDialogflowV2BatchCreateEntitiesRequest struct { 395 // Entities: Required. The entities to create. 396 Entities []*GoogleCloudDialogflowV2EntityTypeEntity `json:"entities,omitempty"` 397 398 // LanguageCode: Optional. The language of entity synonyms defined in 399 // `entities`. If not 400 // specified, the agent's default language is 401 // used. 402 // [Many 403 // languages](https://cloud.google.com/dialogflow/docs/refere 404 // nce/language) 405 // are supported. Note: languages must be enabled in the agent before 406 // they can 407 // be used. 408 LanguageCode string `json:"languageCode,omitempty"` 409 410 // ForceSendFields is a list of field names (e.g. "Entities") to 411 // unconditionally include in API requests. By default, fields with 412 // empty values are omitted from API requests. However, any non-pointer, 413 // non-interface field appearing in ForceSendFields will be sent to the 414 // server regardless of whether the field is empty or not. This may be 415 // used to include empty fields in Patch requests. 416 ForceSendFields []string `json:"-"` 417 418 // NullFields is a list of field names (e.g. "Entities") to include in 419 // API requests with the JSON null value. By default, fields with empty 420 // values are omitted from API requests. However, any field with an 421 // empty value appearing in NullFields will be sent to the server as 422 // null. It is an error if a field in this list has a non-empty value. 423 // This may be used to include null fields in Patch requests. 424 NullFields []string `json:"-"` 425} 426 427func (s *GoogleCloudDialogflowV2BatchCreateEntitiesRequest) MarshalJSON() ([]byte, error) { 428 type NoMethod GoogleCloudDialogflowV2BatchCreateEntitiesRequest 429 raw := NoMethod(*s) 430 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 431} 432 433// GoogleCloudDialogflowV2BatchDeleteEntitiesRequest: The request 434// message for EntityTypes.BatchDeleteEntities. 435type GoogleCloudDialogflowV2BatchDeleteEntitiesRequest struct { 436 // EntityValues: Required. The canonical `values` of the entities to 437 // delete. Note that 438 // these are not fully-qualified names, i.e. they don't start 439 // with 440 // `projects/<Project ID>`. 441 EntityValues []string `json:"entityValues,omitempty"` 442 443 // LanguageCode: Optional. The language of entity synonyms defined in 444 // `entities`. If not 445 // specified, the agent's default language is 446 // used. 447 // [Many 448 // languages](https://cloud.google.com/dialogflow/docs/refere 449 // nce/language) 450 // are supported. Note: languages must be enabled in the agent before 451 // they can 452 // be used. 453 LanguageCode string `json:"languageCode,omitempty"` 454 455 // ForceSendFields is a list of field names (e.g. "EntityValues") to 456 // unconditionally include in API requests. By default, fields with 457 // empty values are omitted from API requests. However, any non-pointer, 458 // non-interface field appearing in ForceSendFields will be sent to the 459 // server regardless of whether the field is empty or not. This may be 460 // used to include empty fields in Patch requests. 461 ForceSendFields []string `json:"-"` 462 463 // NullFields is a list of field names (e.g. "EntityValues") to include 464 // in API requests with the JSON null value. By default, fields with 465 // empty values are omitted from API requests. However, any field with 466 // an empty value appearing in NullFields will be sent to the server as 467 // null. It is an error if a field in this list has a non-empty value. 468 // This may be used to include null fields in Patch requests. 469 NullFields []string `json:"-"` 470} 471 472func (s *GoogleCloudDialogflowV2BatchDeleteEntitiesRequest) MarshalJSON() ([]byte, error) { 473 type NoMethod GoogleCloudDialogflowV2BatchDeleteEntitiesRequest 474 raw := NoMethod(*s) 475 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 476} 477 478// GoogleCloudDialogflowV2BatchDeleteEntityTypesRequest: The request 479// message for EntityTypes.BatchDeleteEntityTypes. 480type GoogleCloudDialogflowV2BatchDeleteEntityTypesRequest struct { 481 // EntityTypeNames: Required. The names entity types to delete. All 482 // names must point to the 483 // same agent as `parent`. 484 EntityTypeNames []string `json:"entityTypeNames,omitempty"` 485 486 // ForceSendFields is a list of field names (e.g. "EntityTypeNames") to 487 // unconditionally include in API requests. By default, fields with 488 // empty values are omitted from API requests. However, any non-pointer, 489 // non-interface field appearing in ForceSendFields will be sent to the 490 // server regardless of whether the field is empty or not. This may be 491 // used to include empty fields in Patch requests. 492 ForceSendFields []string `json:"-"` 493 494 // NullFields is a list of field names (e.g. "EntityTypeNames") to 495 // include in API requests with the JSON null value. By default, fields 496 // with empty values are omitted from API requests. However, any field 497 // with an empty value appearing in NullFields will be sent to the 498 // server as null. It is an error if a field in this list has a 499 // non-empty value. This may be used to include null fields in Patch 500 // requests. 501 NullFields []string `json:"-"` 502} 503 504func (s *GoogleCloudDialogflowV2BatchDeleteEntityTypesRequest) MarshalJSON() ([]byte, error) { 505 type NoMethod GoogleCloudDialogflowV2BatchDeleteEntityTypesRequest 506 raw := NoMethod(*s) 507 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 508} 509 510// GoogleCloudDialogflowV2BatchDeleteIntentsRequest: The request message 511// for Intents.BatchDeleteIntents. 512type GoogleCloudDialogflowV2BatchDeleteIntentsRequest struct { 513 // Intents: Required. The collection of intents to delete. Only intent 514 // `name` must be 515 // filled in. 516 Intents []*GoogleCloudDialogflowV2Intent `json:"intents,omitempty"` 517 518 // ForceSendFields is a list of field names (e.g. "Intents") to 519 // unconditionally include in API requests. By default, fields with 520 // empty values are omitted from API requests. However, any non-pointer, 521 // non-interface field appearing in ForceSendFields will be sent to the 522 // server regardless of whether the field is empty or not. This may be 523 // used to include empty fields in Patch requests. 524 ForceSendFields []string `json:"-"` 525 526 // NullFields is a list of field names (e.g. "Intents") to include in 527 // API requests with the JSON null value. By default, fields with empty 528 // values are omitted from API requests. However, any field with an 529 // empty value appearing in NullFields will be sent to the server as 530 // null. It is an error if a field in this list has a non-empty value. 531 // This may be used to include null fields in Patch requests. 532 NullFields []string `json:"-"` 533} 534 535func (s *GoogleCloudDialogflowV2BatchDeleteIntentsRequest) MarshalJSON() ([]byte, error) { 536 type NoMethod GoogleCloudDialogflowV2BatchDeleteIntentsRequest 537 raw := NoMethod(*s) 538 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 539} 540 541// GoogleCloudDialogflowV2BatchUpdateEntitiesRequest: The request 542// message for EntityTypes.BatchUpdateEntities. 543type GoogleCloudDialogflowV2BatchUpdateEntitiesRequest struct { 544 // Entities: Required. The entities to update or create. 545 Entities []*GoogleCloudDialogflowV2EntityTypeEntity `json:"entities,omitempty"` 546 547 // LanguageCode: Optional. The language of entity synonyms defined in 548 // `entities`. If not 549 // specified, the agent's default language is 550 // used. 551 // [Many 552 // languages](https://cloud.google.com/dialogflow/docs/refere 553 // nce/language) 554 // are supported. Note: languages must be enabled in the agent before 555 // they can 556 // be used. 557 LanguageCode string `json:"languageCode,omitempty"` 558 559 // UpdateMask: Optional. The mask to control which fields get updated. 560 UpdateMask string `json:"updateMask,omitempty"` 561 562 // ForceSendFields is a list of field names (e.g. "Entities") to 563 // unconditionally include in API requests. By default, fields with 564 // empty values are omitted from API requests. However, any non-pointer, 565 // non-interface field appearing in ForceSendFields will be sent to the 566 // server regardless of whether the field is empty or not. This may be 567 // used to include empty fields in Patch requests. 568 ForceSendFields []string `json:"-"` 569 570 // NullFields is a list of field names (e.g. "Entities") to include in 571 // API requests with the JSON null value. By default, fields with empty 572 // values are omitted from API requests. However, any field with an 573 // empty value appearing in NullFields will be sent to the server as 574 // null. It is an error if a field in this list has a non-empty value. 575 // This may be used to include null fields in Patch requests. 576 NullFields []string `json:"-"` 577} 578 579func (s *GoogleCloudDialogflowV2BatchUpdateEntitiesRequest) MarshalJSON() ([]byte, error) { 580 type NoMethod GoogleCloudDialogflowV2BatchUpdateEntitiesRequest 581 raw := NoMethod(*s) 582 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 583} 584 585// GoogleCloudDialogflowV2BatchUpdateEntityTypesRequest: The request 586// message for EntityTypes.BatchUpdateEntityTypes. 587type GoogleCloudDialogflowV2BatchUpdateEntityTypesRequest struct { 588 // EntityTypeBatchInline: The collection of entity types to update or 589 // create. 590 EntityTypeBatchInline *GoogleCloudDialogflowV2EntityTypeBatch `json:"entityTypeBatchInline,omitempty"` 591 592 // EntityTypeBatchUri: The URI to a Google Cloud Storage file containing 593 // entity types to update 594 // or create. The file format can either be a serialized proto 595 // (of 596 // EntityBatch type) or a JSON object. Note: The URI must start 597 // with 598 // "gs://". 599 EntityTypeBatchUri string `json:"entityTypeBatchUri,omitempty"` 600 601 // LanguageCode: Optional. The language of entity synonyms defined in 602 // `entity_types`. If not 603 // specified, the agent's default language is 604 // used. 605 // [Many 606 // languages](https://cloud.google.com/dialogflow/docs/refere 607 // nce/language) 608 // are supported. Note: languages must be enabled in the agent before 609 // they can 610 // be used. 611 LanguageCode string `json:"languageCode,omitempty"` 612 613 // UpdateMask: Optional. The mask to control which fields get updated. 614 UpdateMask string `json:"updateMask,omitempty"` 615 616 // ForceSendFields is a list of field names (e.g. 617 // "EntityTypeBatchInline") to unconditionally include in API requests. 618 // By default, fields with empty values are omitted from API requests. 619 // However, any non-pointer, non-interface field appearing in 620 // ForceSendFields will be sent to the server regardless of whether the 621 // field is empty or not. This may be used to include empty fields in 622 // Patch requests. 623 ForceSendFields []string `json:"-"` 624 625 // NullFields is a list of field names (e.g. "EntityTypeBatchInline") to 626 // include in API requests with the JSON null value. By default, fields 627 // with empty values are omitted from API requests. However, any field 628 // with an empty value appearing in NullFields will be sent to the 629 // server as null. It is an error if a field in this list has a 630 // non-empty value. This may be used to include null fields in Patch 631 // requests. 632 NullFields []string `json:"-"` 633} 634 635func (s *GoogleCloudDialogflowV2BatchUpdateEntityTypesRequest) MarshalJSON() ([]byte, error) { 636 type NoMethod GoogleCloudDialogflowV2BatchUpdateEntityTypesRequest 637 raw := NoMethod(*s) 638 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 639} 640 641// GoogleCloudDialogflowV2BatchUpdateEntityTypesResponse: The response 642// message for EntityTypes.BatchUpdateEntityTypes. 643type GoogleCloudDialogflowV2BatchUpdateEntityTypesResponse struct { 644 // EntityTypes: The collection of updated or created entity types. 645 EntityTypes []*GoogleCloudDialogflowV2EntityType `json:"entityTypes,omitempty"` 646 647 // ForceSendFields is a list of field names (e.g. "EntityTypes") to 648 // unconditionally include in API requests. By default, fields with 649 // empty values are omitted from API requests. However, any non-pointer, 650 // non-interface field appearing in ForceSendFields will be sent to the 651 // server regardless of whether the field is empty or not. This may be 652 // used to include empty fields in Patch requests. 653 ForceSendFields []string `json:"-"` 654 655 // NullFields is a list of field names (e.g. "EntityTypes") to include 656 // in API requests with the JSON null value. By default, fields with 657 // empty values are omitted from API requests. However, any field with 658 // an empty value appearing in NullFields will be sent to the server as 659 // null. It is an error if a field in this list has a non-empty value. 660 // This may be used to include null fields in Patch requests. 661 NullFields []string `json:"-"` 662} 663 664func (s *GoogleCloudDialogflowV2BatchUpdateEntityTypesResponse) MarshalJSON() ([]byte, error) { 665 type NoMethod GoogleCloudDialogflowV2BatchUpdateEntityTypesResponse 666 raw := NoMethod(*s) 667 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 668} 669 670// GoogleCloudDialogflowV2BatchUpdateIntentsRequest: The request message 671// for Intents.BatchUpdateIntents. 672type GoogleCloudDialogflowV2BatchUpdateIntentsRequest struct { 673 // IntentBatchInline: The collection of intents to update or create. 674 IntentBatchInline *GoogleCloudDialogflowV2IntentBatch `json:"intentBatchInline,omitempty"` 675 676 // IntentBatchUri: The URI to a Google Cloud Storage file containing 677 // intents to update or 678 // create. The file format can either be a serialized proto (of 679 // IntentBatch 680 // type) or JSON object. Note: The URI must start with "gs://". 681 IntentBatchUri string `json:"intentBatchUri,omitempty"` 682 683 // IntentView: Optional. The resource view to apply to the returned 684 // intent. 685 // 686 // Possible values: 687 // "INTENT_VIEW_UNSPECIFIED" - Training phrases field is not populated 688 // in the response. 689 // "INTENT_VIEW_FULL" - All fields are populated. 690 IntentView string `json:"intentView,omitempty"` 691 692 // LanguageCode: Optional. The language of training phrases, parameters 693 // and rich messages 694 // defined in `intents`. If not specified, the agent's default language 695 // is 696 // used. 697 // [Many 698 // languages](https://cloud.google.com/dialogflow/docs/reference/la 699 // nguage) 700 // are supported. Note: languages must be enabled in the agent before 701 // they can 702 // be used. 703 LanguageCode string `json:"languageCode,omitempty"` 704 705 // UpdateMask: Optional. The mask to control which fields get updated. 706 UpdateMask string `json:"updateMask,omitempty"` 707 708 // ForceSendFields is a list of field names (e.g. "IntentBatchInline") 709 // to unconditionally include in API requests. By default, fields with 710 // empty values are omitted from API requests. However, any non-pointer, 711 // non-interface field appearing in ForceSendFields will be sent to the 712 // server regardless of whether the field is empty or not. This may be 713 // used to include empty fields in Patch requests. 714 ForceSendFields []string `json:"-"` 715 716 // NullFields is a list of field names (e.g. "IntentBatchInline") to 717 // include in API requests with the JSON null value. By default, fields 718 // with empty values are omitted from API requests. However, any field 719 // with an empty value appearing in NullFields will be sent to the 720 // server as null. It is an error if a field in this list has a 721 // non-empty value. This may be used to include null fields in Patch 722 // requests. 723 NullFields []string `json:"-"` 724} 725 726func (s *GoogleCloudDialogflowV2BatchUpdateIntentsRequest) MarshalJSON() ([]byte, error) { 727 type NoMethod GoogleCloudDialogflowV2BatchUpdateIntentsRequest 728 raw := NoMethod(*s) 729 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 730} 731 732// GoogleCloudDialogflowV2BatchUpdateIntentsResponse: The response 733// message for Intents.BatchUpdateIntents. 734type GoogleCloudDialogflowV2BatchUpdateIntentsResponse struct { 735 // Intents: The collection of updated or created intents. 736 Intents []*GoogleCloudDialogflowV2Intent `json:"intents,omitempty"` 737 738 // ForceSendFields is a list of field names (e.g. "Intents") to 739 // unconditionally include in API requests. By default, fields with 740 // empty values are omitted from API requests. However, any non-pointer, 741 // non-interface field appearing in ForceSendFields will be sent to the 742 // server regardless of whether the field is empty or not. This may be 743 // used to include empty fields in Patch requests. 744 ForceSendFields []string `json:"-"` 745 746 // NullFields is a list of field names (e.g. "Intents") to include in 747 // API requests with the JSON null value. By default, fields with empty 748 // values are omitted from API requests. However, any field with an 749 // empty value appearing in NullFields will be sent to the server as 750 // null. It is an error if a field in this list has a non-empty value. 751 // This may be used to include null fields in Patch requests. 752 NullFields []string `json:"-"` 753} 754 755func (s *GoogleCloudDialogflowV2BatchUpdateIntentsResponse) MarshalJSON() ([]byte, error) { 756 type NoMethod GoogleCloudDialogflowV2BatchUpdateIntentsResponse 757 raw := NoMethod(*s) 758 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 759} 760 761// GoogleCloudDialogflowV2Context: Represents a context. 762type GoogleCloudDialogflowV2Context struct { 763 // LifespanCount: Optional. The number of conversational query requests 764 // after which the 765 // context expires. If set to `0` (the default) the context 766 // expires 767 // immediately. Contexts expire automatically after 20 minutes if 768 // there 769 // are no matching queries. 770 LifespanCount int64 `json:"lifespanCount,omitempty"` 771 772 // Name: Required. The unique identifier of the context. 773 // Format: 774 // `projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context 775 // ID>`. 776 // 777 // The `Context ID` is always converted to lowercase, may only 778 // contain 779 // characters in [a-zA-Z0-9_-%] and may be at most 250 bytes long. 780 Name string `json:"name,omitempty"` 781 782 // Parameters: Optional. The collection of parameters associated with 783 // this context. 784 // Refer to 785 // [this 786 // doc](https://cloud.google.com/dialogflow/docs/intents-actions-pa 787 // rameters) 788 // for syntax. 789 Parameters googleapi.RawMessage `json:"parameters,omitempty"` 790 791 // ServerResponse contains the HTTP response code and headers from the 792 // server. 793 googleapi.ServerResponse `json:"-"` 794 795 // ForceSendFields is a list of field names (e.g. "LifespanCount") to 796 // unconditionally include in API requests. By default, fields with 797 // empty values are omitted from API requests. However, any non-pointer, 798 // non-interface field appearing in ForceSendFields will be sent to the 799 // server regardless of whether the field is empty or not. This may be 800 // used to include empty fields in Patch requests. 801 ForceSendFields []string `json:"-"` 802 803 // NullFields is a list of field names (e.g. "LifespanCount") to include 804 // in API requests with the JSON null value. By default, fields with 805 // empty values are omitted from API requests. However, any field with 806 // an empty value appearing in NullFields will be sent to the server as 807 // null. It is an error if a field in this list has a non-empty value. 808 // This may be used to include null fields in Patch requests. 809 NullFields []string `json:"-"` 810} 811 812func (s *GoogleCloudDialogflowV2Context) MarshalJSON() ([]byte, error) { 813 type NoMethod GoogleCloudDialogflowV2Context 814 raw := NoMethod(*s) 815 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 816} 817 818// GoogleCloudDialogflowV2DetectIntentRequest: The request to detect 819// user's intent. 820type GoogleCloudDialogflowV2DetectIntentRequest struct { 821 // InputAudio: Optional. The natural language speech audio to be 822 // processed. This field 823 // should be populated iff `query_input` is set to an input audio 824 // config. 825 // A single request can contain up to 1 minute of speech audio data. 826 InputAudio string `json:"inputAudio,omitempty"` 827 828 // OutputAudioConfig: Optional. Instructs the speech synthesizer how to 829 // generate the output 830 // audio. If this field is not set and agent-level speech synthesizer is 831 // not 832 // configured, no output audio is generated. 833 OutputAudioConfig *GoogleCloudDialogflowV2OutputAudioConfig `json:"outputAudioConfig,omitempty"` 834 835 // QueryInput: Required. The input specification. It can be set to: 836 // 837 // 1. an audio config 838 // which instructs the speech recognizer how to process the speech 839 // audio, 840 // 841 // 2. a conversational query in the form of text, or 842 // 843 // 3. an event that specifies which intent to trigger. 844 QueryInput *GoogleCloudDialogflowV2QueryInput `json:"queryInput,omitempty"` 845 846 // QueryParams: Optional. The parameters of this query. 847 QueryParams *GoogleCloudDialogflowV2QueryParameters `json:"queryParams,omitempty"` 848 849 // ForceSendFields is a list of field names (e.g. "InputAudio") to 850 // unconditionally include in API requests. By default, fields with 851 // empty values are omitted from API requests. However, any non-pointer, 852 // non-interface field appearing in ForceSendFields will be sent to the 853 // server regardless of whether the field is empty or not. This may be 854 // used to include empty fields in Patch requests. 855 ForceSendFields []string `json:"-"` 856 857 // NullFields is a list of field names (e.g. "InputAudio") to include in 858 // API requests with the JSON null value. By default, fields with empty 859 // values are omitted from API requests. However, any field with an 860 // empty value appearing in NullFields will be sent to the server as 861 // null. It is an error if a field in this list has a non-empty value. 862 // This may be used to include null fields in Patch requests. 863 NullFields []string `json:"-"` 864} 865 866func (s *GoogleCloudDialogflowV2DetectIntentRequest) MarshalJSON() ([]byte, error) { 867 type NoMethod GoogleCloudDialogflowV2DetectIntentRequest 868 raw := NoMethod(*s) 869 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 870} 871 872// GoogleCloudDialogflowV2DetectIntentResponse: The message returned 873// from the DetectIntent method. 874type GoogleCloudDialogflowV2DetectIntentResponse struct { 875 // OutputAudio: The audio data bytes encoded as specified in the 876 // request. 877 // Note: The output audio is generated based on the values of default 878 // platform 879 // text responses found in the `query_result.fulfillment_messages` 880 // field. If 881 // multiple default text responses exist, they will be concatenated 882 // when 883 // generating audio. If no default platform text responses exist, 884 // the 885 // generated audio content will be empty. 886 OutputAudio string `json:"outputAudio,omitempty"` 887 888 // OutputAudioConfig: The config used by the speech synthesizer to 889 // generate the output audio. 890 OutputAudioConfig *GoogleCloudDialogflowV2OutputAudioConfig `json:"outputAudioConfig,omitempty"` 891 892 // QueryResult: The selected results of the conversational query or 893 // event processing. 894 // See `alternative_query_results` for additional potential results. 895 QueryResult *GoogleCloudDialogflowV2QueryResult `json:"queryResult,omitempty"` 896 897 // ResponseId: The unique identifier of the response. It can be used 898 // to 899 // locate a response in the training example set or for reporting 900 // issues. 901 ResponseId string `json:"responseId,omitempty"` 902 903 // WebhookStatus: Specifies the status of the webhook request. 904 WebhookStatus *GoogleRpcStatus `json:"webhookStatus,omitempty"` 905 906 // ServerResponse contains the HTTP response code and headers from the 907 // server. 908 googleapi.ServerResponse `json:"-"` 909 910 // ForceSendFields is a list of field names (e.g. "OutputAudio") to 911 // unconditionally include in API requests. By default, fields with 912 // empty values are omitted from API requests. However, any non-pointer, 913 // non-interface field appearing in ForceSendFields will be sent to the 914 // server regardless of whether the field is empty or not. This may be 915 // used to include empty fields in Patch requests. 916 ForceSendFields []string `json:"-"` 917 918 // NullFields is a list of field names (e.g. "OutputAudio") to include 919 // in API requests with the JSON null value. By default, fields with 920 // empty values are omitted from API requests. However, any field with 921 // an empty value appearing in NullFields will be sent to the server as 922 // null. It is an error if a field in this list has a non-empty value. 923 // This may be used to include null fields in Patch requests. 924 NullFields []string `json:"-"` 925} 926 927func (s *GoogleCloudDialogflowV2DetectIntentResponse) MarshalJSON() ([]byte, error) { 928 type NoMethod GoogleCloudDialogflowV2DetectIntentResponse 929 raw := NoMethod(*s) 930 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 931} 932 933// GoogleCloudDialogflowV2EntityType: Represents an entity type. 934// Entity types serve as a tool for extracting parameter values from 935// natural 936// language queries. 937type GoogleCloudDialogflowV2EntityType struct { 938 // AutoExpansionMode: Optional. Indicates whether the entity type can be 939 // automatically 940 // expanded. 941 // 942 // Possible values: 943 // "AUTO_EXPANSION_MODE_UNSPECIFIED" - Auto expansion disabled for the 944 // entity. 945 // "AUTO_EXPANSION_MODE_DEFAULT" - Allows an agent to recognize values 946 // that have not been explicitly 947 // listed in the entity. 948 AutoExpansionMode string `json:"autoExpansionMode,omitempty"` 949 950 // DisplayName: Required. The name of the entity type. 951 DisplayName string `json:"displayName,omitempty"` 952 953 // Entities: Optional. The collection of entity entries associated with 954 // the entity type. 955 Entities []*GoogleCloudDialogflowV2EntityTypeEntity `json:"entities,omitempty"` 956 957 // Kind: Required. Indicates the kind of entity type. 958 // 959 // Possible values: 960 // "KIND_UNSPECIFIED" - Not specified. This value should be never 961 // used. 962 // "KIND_MAP" - Map entity types allow mapping of a group of synonyms 963 // to a canonical 964 // value. 965 // "KIND_LIST" - List entity types contain a set of entries that do 966 // not map to canonical 967 // values. However, list entity types can contain references to other 968 // entity 969 // types (with or without aliases). 970 Kind string `json:"kind,omitempty"` 971 972 // Name: The unique identifier of the entity type. 973 // Required for EntityTypes.UpdateEntityType 974 // and 975 // EntityTypes.BatchUpdateEntityTypes methods. 976 // Format: `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`. 977 Name string `json:"name,omitempty"` 978 979 // ServerResponse contains the HTTP response code and headers from the 980 // server. 981 googleapi.ServerResponse `json:"-"` 982 983 // ForceSendFields is a list of field names (e.g. "AutoExpansionMode") 984 // to unconditionally include in API requests. By default, fields with 985 // empty values are omitted from API requests. However, any non-pointer, 986 // non-interface field appearing in ForceSendFields will be sent to the 987 // server regardless of whether the field is empty or not. This may be 988 // used to include empty fields in Patch requests. 989 ForceSendFields []string `json:"-"` 990 991 // NullFields is a list of field names (e.g. "AutoExpansionMode") to 992 // include in API requests with the JSON null value. By default, fields 993 // with empty values are omitted from API requests. However, any field 994 // with an empty value appearing in NullFields will be sent to the 995 // server as null. It is an error if a field in this list has a 996 // non-empty value. This may be used to include null fields in Patch 997 // requests. 998 NullFields []string `json:"-"` 999} 1000 1001func (s *GoogleCloudDialogflowV2EntityType) MarshalJSON() ([]byte, error) { 1002 type NoMethod GoogleCloudDialogflowV2EntityType 1003 raw := NoMethod(*s) 1004 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1005} 1006 1007// GoogleCloudDialogflowV2EntityTypeBatch: This message is a wrapper 1008// around a collection of entity types. 1009type GoogleCloudDialogflowV2EntityTypeBatch struct { 1010 // EntityTypes: A collection of entity types. 1011 EntityTypes []*GoogleCloudDialogflowV2EntityType `json:"entityTypes,omitempty"` 1012 1013 // ForceSendFields is a list of field names (e.g. "EntityTypes") to 1014 // unconditionally include in API requests. By default, fields with 1015 // empty values are omitted from API requests. However, any non-pointer, 1016 // non-interface field appearing in ForceSendFields will be sent to the 1017 // server regardless of whether the field is empty or not. This may be 1018 // used to include empty fields in Patch requests. 1019 ForceSendFields []string `json:"-"` 1020 1021 // NullFields is a list of field names (e.g. "EntityTypes") to include 1022 // in API requests with the JSON null value. By default, fields with 1023 // empty values are omitted from API requests. However, any field with 1024 // an empty value appearing in NullFields will be sent to the server as 1025 // null. It is an error if a field in this list has a non-empty value. 1026 // This may be used to include null fields in Patch requests. 1027 NullFields []string `json:"-"` 1028} 1029 1030func (s *GoogleCloudDialogflowV2EntityTypeBatch) MarshalJSON() ([]byte, error) { 1031 type NoMethod GoogleCloudDialogflowV2EntityTypeBatch 1032 raw := NoMethod(*s) 1033 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1034} 1035 1036// GoogleCloudDialogflowV2EntityTypeEntity: An **entity entry** for an 1037// associated entity type. 1038type GoogleCloudDialogflowV2EntityTypeEntity struct { 1039 // Synonyms: Required. A collection of value synonyms. For example, if 1040 // the entity type 1041 // is *vegetable*, and `value` is *scallions*, a synonym could be 1042 // *green 1043 // onions*. 1044 // 1045 // For `KIND_LIST` entity types: 1046 // 1047 // * This collection must contain exactly one synonym equal to 1048 // `value`. 1049 Synonyms []string `json:"synonyms,omitempty"` 1050 1051 // Value: Required. The primary value associated with this entity 1052 // entry. 1053 // For example, if the entity type is *vegetable*, the value could 1054 // be 1055 // *scallions*. 1056 // 1057 // For `KIND_MAP` entity types: 1058 // 1059 // * A canonical value to be used in place of synonyms. 1060 // 1061 // For `KIND_LIST` entity types: 1062 // 1063 // * A string that can contain references to other entity types (with 1064 // or 1065 // without aliases). 1066 Value string `json:"value,omitempty"` 1067 1068 // ForceSendFields is a list of field names (e.g. "Synonyms") to 1069 // unconditionally include in API requests. By default, fields with 1070 // empty values are omitted from API requests. However, any non-pointer, 1071 // non-interface field appearing in ForceSendFields will be sent to the 1072 // server regardless of whether the field is empty or not. This may be 1073 // used to include empty fields in Patch requests. 1074 ForceSendFields []string `json:"-"` 1075 1076 // NullFields is a list of field names (e.g. "Synonyms") to include in 1077 // API requests with the JSON null value. By default, fields with empty 1078 // values are omitted from API requests. However, any field with an 1079 // empty value appearing in NullFields will be sent to the server as 1080 // null. It is an error if a field in this list has a non-empty value. 1081 // This may be used to include null fields in Patch requests. 1082 NullFields []string `json:"-"` 1083} 1084 1085func (s *GoogleCloudDialogflowV2EntityTypeEntity) MarshalJSON() ([]byte, error) { 1086 type NoMethod GoogleCloudDialogflowV2EntityTypeEntity 1087 raw := NoMethod(*s) 1088 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1089} 1090 1091// GoogleCloudDialogflowV2EventInput: Events allow for matching intents 1092// by event name instead of the natural 1093// language input. For instance, input `<event: { name: 1094// "welcome_event", 1095// parameters: { name: "Sam" } }>` can trigger a personalized welcome 1096// response. 1097// The parameter `name` may be used by the agent in the 1098// response: 1099// "Hello #welcome_event.name! What can I do for you today?". 1100type GoogleCloudDialogflowV2EventInput struct { 1101 // LanguageCode: Required. The language of this query. See 1102 // [Language 1103 // Support](https://cloud.google.com/dialogflow/docs/reference/ 1104 // language) 1105 // for a list of the currently supported language codes. Note that 1106 // queries in 1107 // the same session do not necessarily need to specify the same 1108 // language. 1109 LanguageCode string `json:"languageCode,omitempty"` 1110 1111 // Name: Required. The unique identifier of the event. 1112 Name string `json:"name,omitempty"` 1113 1114 // Parameters: Optional. The collection of parameters associated with 1115 // the event. 1116 Parameters googleapi.RawMessage `json:"parameters,omitempty"` 1117 1118 // ForceSendFields is a list of field names (e.g. "LanguageCode") to 1119 // unconditionally include in API requests. By default, fields with 1120 // empty values are omitted from API requests. However, any non-pointer, 1121 // non-interface field appearing in ForceSendFields will be sent to the 1122 // server regardless of whether the field is empty or not. This may be 1123 // used to include empty fields in Patch requests. 1124 ForceSendFields []string `json:"-"` 1125 1126 // NullFields is a list of field names (e.g. "LanguageCode") to include 1127 // in API requests with the JSON null value. By default, fields with 1128 // empty values are omitted from API requests. However, any field with 1129 // an empty value appearing in NullFields will be sent to the server as 1130 // null. It is an error if a field in this list has a non-empty value. 1131 // This may be used to include null fields in Patch requests. 1132 NullFields []string `json:"-"` 1133} 1134 1135func (s *GoogleCloudDialogflowV2EventInput) MarshalJSON() ([]byte, error) { 1136 type NoMethod GoogleCloudDialogflowV2EventInput 1137 raw := NoMethod(*s) 1138 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1139} 1140 1141// GoogleCloudDialogflowV2ExportAgentRequest: The request message for 1142// Agents.ExportAgent. 1143type GoogleCloudDialogflowV2ExportAgentRequest struct { 1144 // AgentUri: Optional. The 1145 // [Google Cloud Storage](https://cloud.google.com/storage/docs/) 1146 // URI to export the agent to. 1147 // The format of this URI must be `gs://<bucket-name>/<object-name>`. 1148 // If left unspecified, the serialized agent is returned inline. 1149 AgentUri string `json:"agentUri,omitempty"` 1150 1151 // ForceSendFields is a list of field names (e.g. "AgentUri") to 1152 // unconditionally include in API requests. By default, fields with 1153 // empty values are omitted from API requests. However, any non-pointer, 1154 // non-interface field appearing in ForceSendFields will be sent to the 1155 // server regardless of whether the field is empty or not. This may be 1156 // used to include empty fields in Patch requests. 1157 ForceSendFields []string `json:"-"` 1158 1159 // NullFields is a list of field names (e.g. "AgentUri") to include in 1160 // API requests with the JSON null value. By default, fields with empty 1161 // values are omitted from API requests. However, any field with an 1162 // empty value appearing in NullFields will be sent to the server as 1163 // null. It is an error if a field in this list has a non-empty value. 1164 // This may be used to include null fields in Patch requests. 1165 NullFields []string `json:"-"` 1166} 1167 1168func (s *GoogleCloudDialogflowV2ExportAgentRequest) MarshalJSON() ([]byte, error) { 1169 type NoMethod GoogleCloudDialogflowV2ExportAgentRequest 1170 raw := NoMethod(*s) 1171 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1172} 1173 1174// GoogleCloudDialogflowV2ExportAgentResponse: The response message for 1175// Agents.ExportAgent. 1176type GoogleCloudDialogflowV2ExportAgentResponse struct { 1177 // AgentContent: The exported agent. 1178 // 1179 // Example for how to export an agent to a zip file via a command 1180 // line: 1181 // <pre>curl \ 1182 // 1183 // 'https://dialogflow.googleapis.com/v2/projects/<project_name>/ag 1184 // ent:export'\ 1185 // -X POST \ 1186 // -H 'Authorization: Bearer '$(gcloud auth application-default 1187 // print-access-token) \ 1188 // -H 'Accept: application/json' \ 1189 // -H 'Content-Type: application/json' \ 1190 // --compressed \ 1191 // --data-binary '{}' \ 1192 // | grep agentContent | sed -e 's/.*"agentContent": "\([^"]*\)".*/\1/' 1193 // \ 1194 // | base64 --decode > <agent zip file></pre> 1195 AgentContent string `json:"agentContent,omitempty"` 1196 1197 // AgentUri: The URI to a file containing the exported agent. This field 1198 // is populated 1199 // only if `agent_uri` is specified in `ExportAgentRequest`. 1200 AgentUri string `json:"agentUri,omitempty"` 1201 1202 // ForceSendFields is a list of field names (e.g. "AgentContent") to 1203 // unconditionally include in API requests. By default, fields with 1204 // empty values are omitted from API requests. However, any non-pointer, 1205 // non-interface field appearing in ForceSendFields will be sent to the 1206 // server regardless of whether the field is empty or not. This may be 1207 // used to include empty fields in Patch requests. 1208 ForceSendFields []string `json:"-"` 1209 1210 // NullFields is a list of field names (e.g. "AgentContent") to include 1211 // in API requests with the JSON null value. By default, fields with 1212 // empty values are omitted from API requests. However, any field with 1213 // an empty value appearing in NullFields will be sent to the server as 1214 // null. It is an error if a field in this list has a non-empty value. 1215 // This may be used to include null fields in Patch requests. 1216 NullFields []string `json:"-"` 1217} 1218 1219func (s *GoogleCloudDialogflowV2ExportAgentResponse) MarshalJSON() ([]byte, error) { 1220 type NoMethod GoogleCloudDialogflowV2ExportAgentResponse 1221 raw := NoMethod(*s) 1222 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1223} 1224 1225// GoogleCloudDialogflowV2ImportAgentRequest: The request message for 1226// Agents.ImportAgent. 1227type GoogleCloudDialogflowV2ImportAgentRequest struct { 1228 // AgentContent: The agent to import. 1229 // 1230 // Example for how to import an agent via the command line: 1231 // <pre>curl \ 1232 // 1233 // 'https://dialogflow.googleapis.com/v2/projects/<project_name>/ag 1234 // ent:import\ 1235 // -X POST \ 1236 // -H 'Authorization: Bearer '$(gcloud auth application-default 1237 // print-access-token) \ 1238 // -H 'Accept: application/json' \ 1239 // -H 'Content-Type: application/json' \ 1240 // --compressed \ 1241 // --data-binary "{ 1242 // 'agentContent': '$(cat <agent zip file> | base64 -w 0)' 1243 // }"</pre> 1244 AgentContent string `json:"agentContent,omitempty"` 1245 1246 // AgentUri: The URI to a Google Cloud Storage file containing the agent 1247 // to import. 1248 // Note: The URI must start with "gs://". 1249 AgentUri string `json:"agentUri,omitempty"` 1250 1251 // ForceSendFields is a list of field names (e.g. "AgentContent") to 1252 // unconditionally include in API requests. By default, fields with 1253 // empty values are omitted from API requests. However, any non-pointer, 1254 // non-interface field appearing in ForceSendFields will be sent to the 1255 // server regardless of whether the field is empty or not. This may be 1256 // used to include empty fields in Patch requests. 1257 ForceSendFields []string `json:"-"` 1258 1259 // NullFields is a list of field names (e.g. "AgentContent") to include 1260 // in API requests with the JSON null value. By default, fields with 1261 // empty values are omitted from API requests. However, any field with 1262 // an empty value appearing in NullFields will be sent to the server as 1263 // null. It is an error if a field in this list has a non-empty value. 1264 // This may be used to include null fields in Patch requests. 1265 NullFields []string `json:"-"` 1266} 1267 1268func (s *GoogleCloudDialogflowV2ImportAgentRequest) MarshalJSON() ([]byte, error) { 1269 type NoMethod GoogleCloudDialogflowV2ImportAgentRequest 1270 raw := NoMethod(*s) 1271 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1272} 1273 1274// GoogleCloudDialogflowV2InputAudioConfig: Instructs the speech 1275// recognizer how to process the audio content. 1276type GoogleCloudDialogflowV2InputAudioConfig struct { 1277 // AudioEncoding: Required. Audio encoding of the audio content to 1278 // process. 1279 // 1280 // Possible values: 1281 // "AUDIO_ENCODING_UNSPECIFIED" - Not specified. 1282 // "AUDIO_ENCODING_LINEAR_16" - Uncompressed 16-bit signed 1283 // little-endian samples (Linear PCM). 1284 // "AUDIO_ENCODING_FLAC" - 1285 // [`FLAC`](https://xiph.org/flac/documentation.html) (Free Lossless 1286 // Audio 1287 // Codec) is the recommended encoding because it is lossless 1288 // (therefore 1289 // recognition is not compromised) and requires only about half 1290 // the 1291 // bandwidth of `LINEAR16`. `FLAC` stream encoding supports 16-bit 1292 // and 1293 // 24-bit samples, however, not all fields in `STREAMINFO` are 1294 // supported. 1295 // "AUDIO_ENCODING_MULAW" - 8-bit samples that compand 14-bit audio 1296 // samples using G.711 PCMU/mu-law. 1297 // "AUDIO_ENCODING_AMR" - Adaptive Multi-Rate Narrowband codec. 1298 // `sample_rate_hertz` must be 8000. 1299 // "AUDIO_ENCODING_AMR_WB" - Adaptive Multi-Rate Wideband codec. 1300 // `sample_rate_hertz` must be 16000. 1301 // "AUDIO_ENCODING_OGG_OPUS" - Opus encoded audio frames in Ogg 1302 // container 1303 // ([OggOpus](https://wiki.xiph.org/OggOpus)). 1304 // `sample_rate_her 1305 // tz` must be 16000. 1306 // "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE" - Although the use of lossy 1307 // encodings is not recommended, if a very low 1308 // bitrate encoding is required, `OGG_OPUS` is highly preferred 1309 // over 1310 // Speex encoding. The [Speex](https://speex.org/) encoding supported 1311 // by 1312 // Dialogflow API has a header byte in each block, as in MIME 1313 // type 1314 // `audio/x-speex-with-header-byte`. 1315 // It is a variant of the RTP Speex encoding defined in 1316 // [RFC 5574](https://tools.ietf.org/html/rfc5574). 1317 // The stream is a sequence of blocks, one block per RTP packet. Each 1318 // block 1319 // starts with a byte containing the length of the block, in bytes, 1320 // followed 1321 // by one or more frames of Speex data, padded to an integral number 1322 // of 1323 // bytes (octets) as specified in RFC 5574. In other words, each RTP 1324 // header 1325 // is replaced with a single byte containing the block length. Only 1326 // Speex 1327 // wideband is supported. `sample_rate_hertz` must be 16000. 1328 AudioEncoding string `json:"audioEncoding,omitempty"` 1329 1330 // LanguageCode: Required. The language of the supplied audio. 1331 // Dialogflow does not do 1332 // translations. See 1333 // [Language 1334 // Support](https://cloud.google.com/dialogflow/docs/reference/ 1335 // language) 1336 // for a list of the currently supported language codes. Note that 1337 // queries in 1338 // the same session do not necessarily need to specify the same 1339 // language. 1340 LanguageCode string `json:"languageCode,omitempty"` 1341 1342 // ModelVariant: Optional. Which variant of the Speech model to use. 1343 // 1344 // Possible values: 1345 // "SPEECH_MODEL_VARIANT_UNSPECIFIED" - No model variant specified. In 1346 // this case Dialogflow defaults to 1347 // USE_BEST_AVAILABLE. 1348 // "USE_BEST_AVAILABLE" - Use the best available variant of the 1349 // Speech 1350 // model that the caller is eligible for. 1351 // 1352 // Please see the 1353 // [Dialogflow 1354 // docs](https://cloud.google.com/dialogflow/docs/data-loggin 1355 // g) for 1356 // how to make your project eligible for enhanced models. 1357 // "USE_STANDARD" - Use standard model variant even if an enhanced 1358 // model is available. See the 1359 // [Cloud 1360 // Speech 1361 // documentation](https://cloud.google.com/speech-to-text/docs/enh 1362 // anced-models) 1363 // for details about enhanced models. 1364 // "USE_ENHANCED" - Use an enhanced model variant: 1365 // 1366 // * If an enhanced variant does not exist for the given 1367 // model and request language, Dialogflow falls 1368 // back to the standard variant. 1369 // 1370 // The [Cloud Speech 1371 // 1372 // documentation](https://cloud.google.com/speech-to-text/docs/enhanced-m 1373 // odels) 1374 // describes which models have enhanced variants. 1375 // 1376 // * If the API caller isn't eligible for enhanced models, Dialogflow 1377 // returns 1378 // an error. Please see the [Dialogflow 1379 // docs](https://cloud.google.com/dialogflow/docs/data-logging) 1380 // for how to make your project eligible. 1381 ModelVariant string `json:"modelVariant,omitempty"` 1382 1383 // PhraseHints: Optional. A list of strings containing words and phrases 1384 // that the speech 1385 // recognizer should recognize with higher likelihood. 1386 // 1387 // See [the Cloud 1388 // Speech 1389 // documentation](https://cloud.google.com/speech-to-text/docs/bas 1390 // ics#phrase-hints) 1391 // for more details. 1392 PhraseHints []string `json:"phraseHints,omitempty"` 1393 1394 // SampleRateHertz: Required. Sample rate (in Hertz) of the audio 1395 // content sent in the query. 1396 // Refer to 1397 // [Cloud Speech 1398 // API 1399 // documentation](https://cloud.google.com/speech-to-text/docs/basics 1400 // ) for 1401 // more details. 1402 SampleRateHertz int64 `json:"sampleRateHertz,omitempty"` 1403 1404 // ForceSendFields is a list of field names (e.g. "AudioEncoding") to 1405 // unconditionally include in API requests. By default, fields with 1406 // empty values are omitted from API requests. However, any non-pointer, 1407 // non-interface field appearing in ForceSendFields will be sent to the 1408 // server regardless of whether the field is empty or not. This may be 1409 // used to include empty fields in Patch requests. 1410 ForceSendFields []string `json:"-"` 1411 1412 // NullFields is a list of field names (e.g. "AudioEncoding") to include 1413 // in API requests with the JSON null value. By default, fields with 1414 // empty values are omitted from API requests. However, any field with 1415 // an empty value appearing in NullFields will be sent to the server as 1416 // null. It is an error if a field in this list has a non-empty value. 1417 // This may be used to include null fields in Patch requests. 1418 NullFields []string `json:"-"` 1419} 1420 1421func (s *GoogleCloudDialogflowV2InputAudioConfig) MarshalJSON() ([]byte, error) { 1422 type NoMethod GoogleCloudDialogflowV2InputAudioConfig 1423 raw := NoMethod(*s) 1424 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1425} 1426 1427// GoogleCloudDialogflowV2Intent: Represents an intent. 1428// Intents convert a number of user expressions or patterns into an 1429// action. An 1430// action is an extraction of a user command or sentence semantics. 1431type GoogleCloudDialogflowV2Intent struct { 1432 // Action: Optional. The name of the action associated with the 1433 // intent. 1434 // Note: The action name must not contain whitespaces. 1435 Action string `json:"action,omitempty"` 1436 1437 // DefaultResponsePlatforms: Optional. The list of platforms for which 1438 // the first responses will be 1439 // copied from the messages in PLATFORM_UNSPECIFIED (i.e. default 1440 // platform). 1441 // 1442 // Possible values: 1443 // "PLATFORM_UNSPECIFIED" - Not specified. 1444 // "FACEBOOK" - Facebook. 1445 // "SLACK" - Slack. 1446 // "TELEGRAM" - Telegram. 1447 // "KIK" - Kik. 1448 // "SKYPE" - Skype. 1449 // "LINE" - Line. 1450 // "VIBER" - Viber. 1451 // "ACTIONS_ON_GOOGLE" - Actions on Google. 1452 // When using Actions on Google, you can choose one of the 1453 // specific 1454 // Intent.Message types that mention support for Actions on Google, 1455 // or you can use the advanced Intent.Message.payload field. 1456 // The payload field provides access to AoG features not available in 1457 // the 1458 // specific message types. 1459 // If using the Intent.Message.payload field, it should have a 1460 // structure 1461 // similar to the JSON message shown here. For more information, 1462 // see 1463 // [Actions on Google 1464 // Webhook 1465 // Format](https://developers.google.com/actions/dialogflow/webho 1466 // ok) 1467 // <pre>{ 1468 // "expectUserResponse": true, 1469 // "isSsml": false, 1470 // "noInputPrompts": [], 1471 // "richResponse": { 1472 // "items": [ 1473 // { 1474 // "simpleResponse": { 1475 // "displayText": "hi", 1476 // "textToSpeech": "hello" 1477 // } 1478 // } 1479 // ], 1480 // "suggestions": [ 1481 // { 1482 // "title": "Say this" 1483 // }, 1484 // { 1485 // "title": "or this" 1486 // } 1487 // ] 1488 // }, 1489 // "systemIntent": { 1490 // "data": { 1491 // "@type": 1492 // "type.googleapis.com/google.actions.v2.OptionValueSpec", 1493 // "listSelect": { 1494 // "items": [ 1495 // { 1496 // "optionInfo": { 1497 // "key": "key1", 1498 // "synonyms": [ 1499 // "key one" 1500 // ] 1501 // }, 1502 // "title": "must not be empty, but unique" 1503 // }, 1504 // { 1505 // "optionInfo": { 1506 // "key": "key2", 1507 // "synonyms": [ 1508 // "key two" 1509 // ] 1510 // }, 1511 // "title": "must not be empty, but unique" 1512 // } 1513 // ] 1514 // } 1515 // }, 1516 // "intent": "actions.intent.OPTION" 1517 // } 1518 // }</pre> 1519 // "GOOGLE_HANGOUTS" - Google Hangouts. 1520 DefaultResponsePlatforms []string `json:"defaultResponsePlatforms,omitempty"` 1521 1522 // DisplayName: Required. The name of this intent. 1523 DisplayName string `json:"displayName,omitempty"` 1524 1525 // Events: Optional. The collection of event names that trigger the 1526 // intent. 1527 // If the collection of input contexts is not empty, all of the contexts 1528 // must 1529 // be present in the active user session for an event to trigger this 1530 // intent. 1531 Events []string `json:"events,omitempty"` 1532 1533 // FollowupIntentInfo: Read-only. Information about all followup intents 1534 // that have this intent as 1535 // a direct or indirect parent. We populate this field only in the 1536 // output. 1537 FollowupIntentInfo []*GoogleCloudDialogflowV2IntentFollowupIntentInfo `json:"followupIntentInfo,omitempty"` 1538 1539 // InputContextNames: Optional. The list of context names required for 1540 // this intent to be 1541 // triggered. 1542 // Format: `projects/<Project ID>/agent/sessions/-/contexts/<Context 1543 // ID>`. 1544 InputContextNames []string `json:"inputContextNames,omitempty"` 1545 1546 // IsFallback: Optional. Indicates whether this is a fallback intent. 1547 IsFallback bool `json:"isFallback,omitempty"` 1548 1549 // Messages: Optional. The collection of rich messages corresponding to 1550 // the 1551 // `Response` field in the Dialogflow console. 1552 Messages []*GoogleCloudDialogflowV2IntentMessage `json:"messages,omitempty"` 1553 1554 // MlDisabled: Optional. Indicates whether Machine Learning is disabled 1555 // for the intent. 1556 // Note: If `ml_diabled` setting is set to true, then this intent is 1557 // not 1558 // taken into account during inference in `ML ONLY` match mode. 1559 // Also, 1560 // auto-markup in the UI is turned off. 1561 MlDisabled bool `json:"mlDisabled,omitempty"` 1562 1563 // Name: The unique identifier of this intent. 1564 // Required for Intents.UpdateIntent and 1565 // Intents.BatchUpdateIntents 1566 // methods. 1567 // Format: `projects/<Project ID>/agent/intents/<Intent ID>`. 1568 Name string `json:"name,omitempty"` 1569 1570 // OutputContexts: Optional. The collection of contexts that are 1571 // activated when the intent 1572 // is matched. Context messages in this collection should not set 1573 // the 1574 // parameters field. Setting the `lifespan_count` to 0 will reset the 1575 // context 1576 // when the intent is matched. 1577 // Format: `projects/<Project ID>/agent/sessions/-/contexts/<Context 1578 // ID>`. 1579 OutputContexts []*GoogleCloudDialogflowV2Context `json:"outputContexts,omitempty"` 1580 1581 // Parameters: Optional. The collection of parameters associated with 1582 // the intent. 1583 Parameters []*GoogleCloudDialogflowV2IntentParameter `json:"parameters,omitempty"` 1584 1585 // ParentFollowupIntentName: Read-only after creation. The unique 1586 // identifier of the parent intent in the 1587 // chain of followup intents. You can set this field when creating an 1588 // intent, 1589 // for example with CreateIntent or BatchUpdateIntents, in order to 1590 // make this intent a followup intent. 1591 // 1592 // It identifies the parent followup intent. 1593 // Format: `projects/<Project ID>/agent/intents/<Intent ID>`. 1594 ParentFollowupIntentName string `json:"parentFollowupIntentName,omitempty"` 1595 1596 // Priority: Optional. The priority of this intent. Higher numbers 1597 // represent higher 1598 // priorities. If this is zero or unspecified, we use the 1599 // default 1600 // priority 500000. 1601 // 1602 // Negative numbers mean that the intent is disabled. 1603 Priority int64 `json:"priority,omitempty"` 1604 1605 // ResetContexts: Optional. Indicates whether to delete all contexts in 1606 // the current 1607 // session when this intent is matched. 1608 ResetContexts bool `json:"resetContexts,omitempty"` 1609 1610 // RootFollowupIntentName: Read-only. The unique identifier of the root 1611 // intent in the chain of 1612 // followup intents. It identifies the correct followup intents chain 1613 // for 1614 // this intent. We populate this field only in the output. 1615 // 1616 // Format: `projects/<Project ID>/agent/intents/<Intent ID>`. 1617 RootFollowupIntentName string `json:"rootFollowupIntentName,omitempty"` 1618 1619 // TrainingPhrases: Optional. The collection of examples that the agent 1620 // is 1621 // trained on. 1622 TrainingPhrases []*GoogleCloudDialogflowV2IntentTrainingPhrase `json:"trainingPhrases,omitempty"` 1623 1624 // WebhookState: Optional. Indicates whether webhooks are enabled for 1625 // the intent. 1626 // 1627 // Possible values: 1628 // "WEBHOOK_STATE_UNSPECIFIED" - Webhook is disabled in the agent and 1629 // in the intent. 1630 // "WEBHOOK_STATE_ENABLED" - Webhook is enabled in the agent and in 1631 // the intent. 1632 // "WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING" - Webhook is enabled in 1633 // the agent and in the intent. Also, each slot 1634 // filling prompt is forwarded to the webhook. 1635 WebhookState string `json:"webhookState,omitempty"` 1636 1637 // ServerResponse contains the HTTP response code and headers from the 1638 // server. 1639 googleapi.ServerResponse `json:"-"` 1640 1641 // ForceSendFields is a list of field names (e.g. "Action") to 1642 // unconditionally include in API requests. By default, fields with 1643 // empty values are omitted from API requests. However, any non-pointer, 1644 // non-interface field appearing in ForceSendFields will be sent to the 1645 // server regardless of whether the field is empty or not. This may be 1646 // used to include empty fields in Patch requests. 1647 ForceSendFields []string `json:"-"` 1648 1649 // NullFields is a list of field names (e.g. "Action") to include in API 1650 // requests with the JSON null value. By default, fields with empty 1651 // values are omitted from API requests. However, any field with an 1652 // empty value appearing in NullFields will be sent to the server as 1653 // null. It is an error if a field in this list has a non-empty value. 1654 // This may be used to include null fields in Patch requests. 1655 NullFields []string `json:"-"` 1656} 1657 1658func (s *GoogleCloudDialogflowV2Intent) MarshalJSON() ([]byte, error) { 1659 type NoMethod GoogleCloudDialogflowV2Intent 1660 raw := NoMethod(*s) 1661 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1662} 1663 1664// GoogleCloudDialogflowV2IntentBatch: This message is a wrapper around 1665// a collection of intents. 1666type GoogleCloudDialogflowV2IntentBatch struct { 1667 // Intents: A collection of intents. 1668 Intents []*GoogleCloudDialogflowV2Intent `json:"intents,omitempty"` 1669 1670 // ForceSendFields is a list of field names (e.g. "Intents") to 1671 // unconditionally include in API requests. By default, fields with 1672 // empty values are omitted from API requests. However, any non-pointer, 1673 // non-interface field appearing in ForceSendFields will be sent to the 1674 // server regardless of whether the field is empty or not. This may be 1675 // used to include empty fields in Patch requests. 1676 ForceSendFields []string `json:"-"` 1677 1678 // NullFields is a list of field names (e.g. "Intents") to include in 1679 // API requests with the JSON null value. By default, fields with empty 1680 // values are omitted from API requests. However, any field with an 1681 // empty value appearing in NullFields will be sent to the server as 1682 // null. It is an error if a field in this list has a non-empty value. 1683 // This may be used to include null fields in Patch requests. 1684 NullFields []string `json:"-"` 1685} 1686 1687func (s *GoogleCloudDialogflowV2IntentBatch) MarshalJSON() ([]byte, error) { 1688 type NoMethod GoogleCloudDialogflowV2IntentBatch 1689 raw := NoMethod(*s) 1690 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1691} 1692 1693// GoogleCloudDialogflowV2IntentFollowupIntentInfo: Represents a single 1694// followup intent in the chain. 1695type GoogleCloudDialogflowV2IntentFollowupIntentInfo struct { 1696 // FollowupIntentName: The unique identifier of the followup 1697 // intent. 1698 // Format: `projects/<Project ID>/agent/intents/<Intent ID>`. 1699 FollowupIntentName string `json:"followupIntentName,omitempty"` 1700 1701 // ParentFollowupIntentName: The unique identifier of the followup 1702 // intent's parent. 1703 // Format: `projects/<Project ID>/agent/intents/<Intent ID>`. 1704 ParentFollowupIntentName string `json:"parentFollowupIntentName,omitempty"` 1705 1706 // ForceSendFields is a list of field names (e.g. "FollowupIntentName") 1707 // to unconditionally include in API requests. By default, fields with 1708 // empty values are omitted from API requests. However, any non-pointer, 1709 // non-interface field appearing in ForceSendFields will be sent to the 1710 // server regardless of whether the field is empty or not. This may be 1711 // used to include empty fields in Patch requests. 1712 ForceSendFields []string `json:"-"` 1713 1714 // NullFields is a list of field names (e.g. "FollowupIntentName") to 1715 // include in API requests with the JSON null value. By default, fields 1716 // with empty values are omitted from API requests. However, any field 1717 // with an empty value appearing in NullFields will be sent to the 1718 // server as null. It is an error if a field in this list has a 1719 // non-empty value. This may be used to include null fields in Patch 1720 // requests. 1721 NullFields []string `json:"-"` 1722} 1723 1724func (s *GoogleCloudDialogflowV2IntentFollowupIntentInfo) MarshalJSON() ([]byte, error) { 1725 type NoMethod GoogleCloudDialogflowV2IntentFollowupIntentInfo 1726 raw := NoMethod(*s) 1727 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1728} 1729 1730// GoogleCloudDialogflowV2IntentMessage: Corresponds to the `Response` 1731// field in the Dialogflow console. 1732type GoogleCloudDialogflowV2IntentMessage struct { 1733 // BasicCard: The basic card response for Actions on Google. 1734 BasicCard *GoogleCloudDialogflowV2IntentMessageBasicCard `json:"basicCard,omitempty"` 1735 1736 // Card: The card response. 1737 Card *GoogleCloudDialogflowV2IntentMessageCard `json:"card,omitempty"` 1738 1739 // CarouselSelect: The carousel card response for Actions on Google. 1740 CarouselSelect *GoogleCloudDialogflowV2IntentMessageCarouselSelect `json:"carouselSelect,omitempty"` 1741 1742 // Image: The image response. 1743 Image *GoogleCloudDialogflowV2IntentMessageImage `json:"image,omitempty"` 1744 1745 // LinkOutSuggestion: The link out suggestion chip for Actions on 1746 // Google. 1747 LinkOutSuggestion *GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion `json:"linkOutSuggestion,omitempty"` 1748 1749 // ListSelect: The list card response for Actions on Google. 1750 ListSelect *GoogleCloudDialogflowV2IntentMessageListSelect `json:"listSelect,omitempty"` 1751 1752 // Payload: Returns a response containing a custom, platform-specific 1753 // payload. 1754 // See the Intent.Message.Platform type for a description of 1755 // the 1756 // structure that may be required for your platform. 1757 Payload googleapi.RawMessage `json:"payload,omitempty"` 1758 1759 // Platform: Optional. The platform that this message is intended for. 1760 // 1761 // Possible values: 1762 // "PLATFORM_UNSPECIFIED" - Not specified. 1763 // "FACEBOOK" - Facebook. 1764 // "SLACK" - Slack. 1765 // "TELEGRAM" - Telegram. 1766 // "KIK" - Kik. 1767 // "SKYPE" - Skype. 1768 // "LINE" - Line. 1769 // "VIBER" - Viber. 1770 // "ACTIONS_ON_GOOGLE" - Actions on Google. 1771 // When using Actions on Google, you can choose one of the 1772 // specific 1773 // Intent.Message types that mention support for Actions on Google, 1774 // or you can use the advanced Intent.Message.payload field. 1775 // The payload field provides access to AoG features not available in 1776 // the 1777 // specific message types. 1778 // If using the Intent.Message.payload field, it should have a 1779 // structure 1780 // similar to the JSON message shown here. For more information, 1781 // see 1782 // [Actions on Google 1783 // Webhook 1784 // Format](https://developers.google.com/actions/dialogflow/webho 1785 // ok) 1786 // <pre>{ 1787 // "expectUserResponse": true, 1788 // "isSsml": false, 1789 // "noInputPrompts": [], 1790 // "richResponse": { 1791 // "items": [ 1792 // { 1793 // "simpleResponse": { 1794 // "displayText": "hi", 1795 // "textToSpeech": "hello" 1796 // } 1797 // } 1798 // ], 1799 // "suggestions": [ 1800 // { 1801 // "title": "Say this" 1802 // }, 1803 // { 1804 // "title": "or this" 1805 // } 1806 // ] 1807 // }, 1808 // "systemIntent": { 1809 // "data": { 1810 // "@type": 1811 // "type.googleapis.com/google.actions.v2.OptionValueSpec", 1812 // "listSelect": { 1813 // "items": [ 1814 // { 1815 // "optionInfo": { 1816 // "key": "key1", 1817 // "synonyms": [ 1818 // "key one" 1819 // ] 1820 // }, 1821 // "title": "must not be empty, but unique" 1822 // }, 1823 // { 1824 // "optionInfo": { 1825 // "key": "key2", 1826 // "synonyms": [ 1827 // "key two" 1828 // ] 1829 // }, 1830 // "title": "must not be empty, but unique" 1831 // } 1832 // ] 1833 // } 1834 // }, 1835 // "intent": "actions.intent.OPTION" 1836 // } 1837 // }</pre> 1838 // "GOOGLE_HANGOUTS" - Google Hangouts. 1839 Platform string `json:"platform,omitempty"` 1840 1841 // QuickReplies: The quick replies response. 1842 QuickReplies *GoogleCloudDialogflowV2IntentMessageQuickReplies `json:"quickReplies,omitempty"` 1843 1844 // SimpleResponses: The voice and text-only responses for Actions on 1845 // Google. 1846 SimpleResponses *GoogleCloudDialogflowV2IntentMessageSimpleResponses `json:"simpleResponses,omitempty"` 1847 1848 // Suggestions: The suggestion chips for Actions on Google. 1849 Suggestions *GoogleCloudDialogflowV2IntentMessageSuggestions `json:"suggestions,omitempty"` 1850 1851 // Text: The text response. 1852 Text *GoogleCloudDialogflowV2IntentMessageText `json:"text,omitempty"` 1853 1854 // ForceSendFields is a list of field names (e.g. "BasicCard") to 1855 // unconditionally include in API requests. By default, fields with 1856 // empty values are omitted from API requests. However, any non-pointer, 1857 // non-interface field appearing in ForceSendFields will be sent to the 1858 // server regardless of whether the field is empty or not. This may be 1859 // used to include empty fields in Patch requests. 1860 ForceSendFields []string `json:"-"` 1861 1862 // NullFields is a list of field names (e.g. "BasicCard") to include in 1863 // API requests with the JSON null value. By default, fields with empty 1864 // values are omitted from API requests. However, any field with an 1865 // empty value appearing in NullFields will be sent to the server as 1866 // null. It is an error if a field in this list has a non-empty value. 1867 // This may be used to include null fields in Patch requests. 1868 NullFields []string `json:"-"` 1869} 1870 1871func (s *GoogleCloudDialogflowV2IntentMessage) MarshalJSON() ([]byte, error) { 1872 type NoMethod GoogleCloudDialogflowV2IntentMessage 1873 raw := NoMethod(*s) 1874 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1875} 1876 1877// GoogleCloudDialogflowV2IntentMessageBasicCard: The basic card 1878// message. Useful for displaying information. 1879type GoogleCloudDialogflowV2IntentMessageBasicCard struct { 1880 // Buttons: Optional. The collection of card buttons. 1881 Buttons []*GoogleCloudDialogflowV2IntentMessageBasicCardButton `json:"buttons,omitempty"` 1882 1883 // FormattedText: Required, unless image is present. The body text of 1884 // the card. 1885 FormattedText string `json:"formattedText,omitempty"` 1886 1887 // Image: Optional. The image for the card. 1888 Image *GoogleCloudDialogflowV2IntentMessageImage `json:"image,omitempty"` 1889 1890 // Subtitle: Optional. The subtitle of the card. 1891 Subtitle string `json:"subtitle,omitempty"` 1892 1893 // Title: Optional. The title of the card. 1894 Title string `json:"title,omitempty"` 1895 1896 // ForceSendFields is a list of field names (e.g. "Buttons") to 1897 // unconditionally include in API requests. By default, fields with 1898 // empty values are omitted from API requests. However, any non-pointer, 1899 // non-interface field appearing in ForceSendFields will be sent to the 1900 // server regardless of whether the field is empty or not. This may be 1901 // used to include empty fields in Patch requests. 1902 ForceSendFields []string `json:"-"` 1903 1904 // NullFields is a list of field names (e.g. "Buttons") to include in 1905 // API requests with the JSON null value. By default, fields with empty 1906 // values are omitted from API requests. However, any field with an 1907 // empty value appearing in NullFields will be sent to the server as 1908 // null. It is an error if a field in this list has a non-empty value. 1909 // This may be used to include null fields in Patch requests. 1910 NullFields []string `json:"-"` 1911} 1912 1913func (s *GoogleCloudDialogflowV2IntentMessageBasicCard) MarshalJSON() ([]byte, error) { 1914 type NoMethod GoogleCloudDialogflowV2IntentMessageBasicCard 1915 raw := NoMethod(*s) 1916 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1917} 1918 1919// GoogleCloudDialogflowV2IntentMessageBasicCardButton: The button 1920// object that appears at the bottom of a card. 1921type GoogleCloudDialogflowV2IntentMessageBasicCardButton struct { 1922 // OpenUriAction: Required. Action to take when a user taps on the 1923 // button. 1924 OpenUriAction *GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction `json:"openUriAction,omitempty"` 1925 1926 // Title: Required. The title of the button. 1927 Title string `json:"title,omitempty"` 1928 1929 // ForceSendFields is a list of field names (e.g. "OpenUriAction") to 1930 // unconditionally include in API requests. By default, fields with 1931 // empty values are omitted from API requests. However, any non-pointer, 1932 // non-interface field appearing in ForceSendFields will be sent to the 1933 // server regardless of whether the field is empty or not. This may be 1934 // used to include empty fields in Patch requests. 1935 ForceSendFields []string `json:"-"` 1936 1937 // NullFields is a list of field names (e.g. "OpenUriAction") to include 1938 // in API requests with the JSON null value. By default, fields with 1939 // empty values are omitted from API requests. However, any field with 1940 // an empty value appearing in NullFields will be sent to the server as 1941 // null. It is an error if a field in this list has a non-empty value. 1942 // This may be used to include null fields in Patch requests. 1943 NullFields []string `json:"-"` 1944} 1945 1946func (s *GoogleCloudDialogflowV2IntentMessageBasicCardButton) MarshalJSON() ([]byte, error) { 1947 type NoMethod GoogleCloudDialogflowV2IntentMessageBasicCardButton 1948 raw := NoMethod(*s) 1949 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1950} 1951 1952// GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction: 1953// Opens the given URI. 1954type GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction struct { 1955 // Uri: Required. The HTTP or HTTPS scheme URI. 1956 Uri string `json:"uri,omitempty"` 1957 1958 // ForceSendFields is a list of field names (e.g. "Uri") to 1959 // unconditionally include in API requests. By default, fields with 1960 // empty values are omitted from API requests. However, any non-pointer, 1961 // non-interface field appearing in ForceSendFields will be sent to the 1962 // server regardless of whether the field is empty or not. This may be 1963 // used to include empty fields in Patch requests. 1964 ForceSendFields []string `json:"-"` 1965 1966 // NullFields is a list of field names (e.g. "Uri") to include in API 1967 // requests with the JSON null value. By default, fields with empty 1968 // values are omitted from API requests. However, any field with an 1969 // empty value appearing in NullFields will be sent to the server as 1970 // null. It is an error if a field in this list has a non-empty value. 1971 // This may be used to include null fields in Patch requests. 1972 NullFields []string `json:"-"` 1973} 1974 1975func (s *GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction) MarshalJSON() ([]byte, error) { 1976 type NoMethod GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction 1977 raw := NoMethod(*s) 1978 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1979} 1980 1981// GoogleCloudDialogflowV2IntentMessageCard: The card response message. 1982type GoogleCloudDialogflowV2IntentMessageCard struct { 1983 // Buttons: Optional. The collection of card buttons. 1984 Buttons []*GoogleCloudDialogflowV2IntentMessageCardButton `json:"buttons,omitempty"` 1985 1986 // ImageUri: Optional. The public URI to an image file for the card. 1987 ImageUri string `json:"imageUri,omitempty"` 1988 1989 // Subtitle: Optional. The subtitle of the card. 1990 Subtitle string `json:"subtitle,omitempty"` 1991 1992 // Title: Optional. The title of the card. 1993 Title string `json:"title,omitempty"` 1994 1995 // ForceSendFields is a list of field names (e.g. "Buttons") to 1996 // unconditionally include in API requests. By default, fields with 1997 // empty values are omitted from API requests. However, any non-pointer, 1998 // non-interface field appearing in ForceSendFields will be sent to the 1999 // server regardless of whether the field is empty or not. This may be 2000 // used to include empty fields in Patch requests. 2001 ForceSendFields []string `json:"-"` 2002 2003 // NullFields is a list of field names (e.g. "Buttons") to include in 2004 // API requests with the JSON null value. By default, fields with empty 2005 // values are omitted from API requests. However, any field with an 2006 // empty value appearing in NullFields will be sent to the server as 2007 // null. It is an error if a field in this list has a non-empty value. 2008 // This may be used to include null fields in Patch requests. 2009 NullFields []string `json:"-"` 2010} 2011 2012func (s *GoogleCloudDialogflowV2IntentMessageCard) MarshalJSON() ([]byte, error) { 2013 type NoMethod GoogleCloudDialogflowV2IntentMessageCard 2014 raw := NoMethod(*s) 2015 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2016} 2017 2018// GoogleCloudDialogflowV2IntentMessageCardButton: Optional. Contains 2019// information about a button. 2020type GoogleCloudDialogflowV2IntentMessageCardButton struct { 2021 // Postback: Optional. The text to send back to the Dialogflow API or a 2022 // URI to 2023 // open. 2024 Postback string `json:"postback,omitempty"` 2025 2026 // Text: Optional. The text to show on the button. 2027 Text string `json:"text,omitempty"` 2028 2029 // ForceSendFields is a list of field names (e.g. "Postback") to 2030 // unconditionally include in API requests. By default, fields with 2031 // empty values are omitted from API requests. However, any non-pointer, 2032 // non-interface field appearing in ForceSendFields will be sent to the 2033 // server regardless of whether the field is empty or not. This may be 2034 // used to include empty fields in Patch requests. 2035 ForceSendFields []string `json:"-"` 2036 2037 // NullFields is a list of field names (e.g. "Postback") to include in 2038 // API requests with the JSON null value. By default, fields with empty 2039 // values are omitted from API requests. However, any field with an 2040 // empty value appearing in NullFields will be sent to the server as 2041 // null. It is an error if a field in this list has a non-empty value. 2042 // This may be used to include null fields in Patch requests. 2043 NullFields []string `json:"-"` 2044} 2045 2046func (s *GoogleCloudDialogflowV2IntentMessageCardButton) MarshalJSON() ([]byte, error) { 2047 type NoMethod GoogleCloudDialogflowV2IntentMessageCardButton 2048 raw := NoMethod(*s) 2049 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2050} 2051 2052// GoogleCloudDialogflowV2IntentMessageCarouselSelect: The card for 2053// presenting a carousel of options to select from. 2054type GoogleCloudDialogflowV2IntentMessageCarouselSelect struct { 2055 // Items: Required. Carousel items. 2056 Items []*GoogleCloudDialogflowV2IntentMessageCarouselSelectItem `json:"items,omitempty"` 2057 2058 // ForceSendFields is a list of field names (e.g. "Items") to 2059 // unconditionally include in API requests. By default, fields with 2060 // empty values are omitted from API requests. However, any non-pointer, 2061 // non-interface field appearing in ForceSendFields will be sent to the 2062 // server regardless of whether the field is empty or not. This may be 2063 // used to include empty fields in Patch requests. 2064 ForceSendFields []string `json:"-"` 2065 2066 // NullFields is a list of field names (e.g. "Items") to include in API 2067 // requests with the JSON null value. By default, fields with empty 2068 // values are omitted from API requests. However, any field with an 2069 // empty value appearing in NullFields will be sent to the server as 2070 // null. It is an error if a field in this list has a non-empty value. 2071 // This may be used to include null fields in Patch requests. 2072 NullFields []string `json:"-"` 2073} 2074 2075func (s *GoogleCloudDialogflowV2IntentMessageCarouselSelect) MarshalJSON() ([]byte, error) { 2076 type NoMethod GoogleCloudDialogflowV2IntentMessageCarouselSelect 2077 raw := NoMethod(*s) 2078 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2079} 2080 2081// GoogleCloudDialogflowV2IntentMessageCarouselSelectItem: An item in 2082// the carousel. 2083type GoogleCloudDialogflowV2IntentMessageCarouselSelectItem struct { 2084 // Description: Optional. The body text of the card. 2085 Description string `json:"description,omitempty"` 2086 2087 // Image: Optional. The image to display. 2088 Image *GoogleCloudDialogflowV2IntentMessageImage `json:"image,omitempty"` 2089 2090 // Info: Required. Additional info about the option item. 2091 Info *GoogleCloudDialogflowV2IntentMessageSelectItemInfo `json:"info,omitempty"` 2092 2093 // Title: Required. Title of the carousel item. 2094 Title string `json:"title,omitempty"` 2095 2096 // ForceSendFields is a list of field names (e.g. "Description") to 2097 // unconditionally include in API requests. By default, fields with 2098 // empty values are omitted from API requests. However, any non-pointer, 2099 // non-interface field appearing in ForceSendFields will be sent to the 2100 // server regardless of whether the field is empty or not. This may be 2101 // used to include empty fields in Patch requests. 2102 ForceSendFields []string `json:"-"` 2103 2104 // NullFields is a list of field names (e.g. "Description") to include 2105 // in API requests with the JSON null value. By default, fields with 2106 // empty values are omitted from API requests. However, any field with 2107 // an empty value appearing in NullFields will be sent to the server as 2108 // null. It is an error if a field in this list has a non-empty value. 2109 // This may be used to include null fields in Patch requests. 2110 NullFields []string `json:"-"` 2111} 2112 2113func (s *GoogleCloudDialogflowV2IntentMessageCarouselSelectItem) MarshalJSON() ([]byte, error) { 2114 type NoMethod GoogleCloudDialogflowV2IntentMessageCarouselSelectItem 2115 raw := NoMethod(*s) 2116 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2117} 2118 2119// GoogleCloudDialogflowV2IntentMessageImage: The image response 2120// message. 2121type GoogleCloudDialogflowV2IntentMessageImage struct { 2122 // AccessibilityText: Optional. A text description of the image to be 2123 // used for accessibility, 2124 // e.g., screen readers. 2125 AccessibilityText string `json:"accessibilityText,omitempty"` 2126 2127 // ImageUri: Optional. The public URI to an image file. 2128 ImageUri string `json:"imageUri,omitempty"` 2129 2130 // ForceSendFields is a list of field names (e.g. "AccessibilityText") 2131 // to unconditionally include in API requests. By default, fields with 2132 // empty values are omitted from API requests. However, any non-pointer, 2133 // non-interface field appearing in ForceSendFields will be sent to the 2134 // server regardless of whether the field is empty or not. This may be 2135 // used to include empty fields in Patch requests. 2136 ForceSendFields []string `json:"-"` 2137 2138 // NullFields is a list of field names (e.g. "AccessibilityText") to 2139 // include in API requests with the JSON null value. By default, fields 2140 // with empty values are omitted from API requests. However, any field 2141 // with an empty value appearing in NullFields will be sent to the 2142 // server as null. It is an error if a field in this list has a 2143 // non-empty value. This may be used to include null fields in Patch 2144 // requests. 2145 NullFields []string `json:"-"` 2146} 2147 2148func (s *GoogleCloudDialogflowV2IntentMessageImage) MarshalJSON() ([]byte, error) { 2149 type NoMethod GoogleCloudDialogflowV2IntentMessageImage 2150 raw := NoMethod(*s) 2151 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2152} 2153 2154// GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion: The suggestion 2155// chip message that allows the user to jump out to the app 2156// or website associated with this agent. 2157type GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion struct { 2158 // DestinationName: Required. The name of the app or site this chip is 2159 // linking to. 2160 DestinationName string `json:"destinationName,omitempty"` 2161 2162 // Uri: Required. The URI of the app or site to open when the user taps 2163 // the 2164 // suggestion chip. 2165 Uri string `json:"uri,omitempty"` 2166 2167 // ForceSendFields is a list of field names (e.g. "DestinationName") to 2168 // unconditionally include in API requests. By default, fields with 2169 // empty values are omitted from API requests. However, any non-pointer, 2170 // non-interface field appearing in ForceSendFields will be sent to the 2171 // server regardless of whether the field is empty or not. This may be 2172 // used to include empty fields in Patch requests. 2173 ForceSendFields []string `json:"-"` 2174 2175 // NullFields is a list of field names (e.g. "DestinationName") to 2176 // include in API requests with the JSON null value. By default, fields 2177 // with empty values are omitted from API requests. However, any field 2178 // with an empty value appearing in NullFields will be sent to the 2179 // server as null. It is an error if a field in this list has a 2180 // non-empty value. This may be used to include null fields in Patch 2181 // requests. 2182 NullFields []string `json:"-"` 2183} 2184 2185func (s *GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion) MarshalJSON() ([]byte, error) { 2186 type NoMethod GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion 2187 raw := NoMethod(*s) 2188 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2189} 2190 2191// GoogleCloudDialogflowV2IntentMessageListSelect: The card for 2192// presenting a list of options to select from. 2193type GoogleCloudDialogflowV2IntentMessageListSelect struct { 2194 // Items: Required. List items. 2195 Items []*GoogleCloudDialogflowV2IntentMessageListSelectItem `json:"items,omitempty"` 2196 2197 // Title: Optional. The overall title of the list. 2198 Title string `json:"title,omitempty"` 2199 2200 // ForceSendFields is a list of field names (e.g. "Items") to 2201 // unconditionally include in API requests. By default, fields with 2202 // empty values are omitted from API requests. However, any non-pointer, 2203 // non-interface field appearing in ForceSendFields will be sent to the 2204 // server regardless of whether the field is empty or not. This may be 2205 // used to include empty fields in Patch requests. 2206 ForceSendFields []string `json:"-"` 2207 2208 // NullFields is a list of field names (e.g. "Items") to include in API 2209 // requests with the JSON null value. By default, fields with empty 2210 // values are omitted from API requests. However, any field with an 2211 // empty value appearing in NullFields will be sent to the server as 2212 // null. It is an error if a field in this list has a non-empty value. 2213 // This may be used to include null fields in Patch requests. 2214 NullFields []string `json:"-"` 2215} 2216 2217func (s *GoogleCloudDialogflowV2IntentMessageListSelect) MarshalJSON() ([]byte, error) { 2218 type NoMethod GoogleCloudDialogflowV2IntentMessageListSelect 2219 raw := NoMethod(*s) 2220 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2221} 2222 2223// GoogleCloudDialogflowV2IntentMessageListSelectItem: An item in the 2224// list. 2225type GoogleCloudDialogflowV2IntentMessageListSelectItem struct { 2226 // Description: Optional. The main text describing the item. 2227 Description string `json:"description,omitempty"` 2228 2229 // Image: Optional. The image to display. 2230 Image *GoogleCloudDialogflowV2IntentMessageImage `json:"image,omitempty"` 2231 2232 // Info: Required. Additional information about this option. 2233 Info *GoogleCloudDialogflowV2IntentMessageSelectItemInfo `json:"info,omitempty"` 2234 2235 // Title: Required. The title of the list item. 2236 Title string `json:"title,omitempty"` 2237 2238 // ForceSendFields is a list of field names (e.g. "Description") to 2239 // unconditionally include in API requests. By default, fields with 2240 // empty values are omitted from API requests. However, any non-pointer, 2241 // non-interface field appearing in ForceSendFields will be sent to the 2242 // server regardless of whether the field is empty or not. This may be 2243 // used to include empty fields in Patch requests. 2244 ForceSendFields []string `json:"-"` 2245 2246 // NullFields is a list of field names (e.g. "Description") to include 2247 // in API requests with the JSON null value. By default, fields with 2248 // empty values are omitted from API requests. However, any field with 2249 // an empty value appearing in NullFields will be sent to the server as 2250 // null. It is an error if a field in this list has a non-empty value. 2251 // This may be used to include null fields in Patch requests. 2252 NullFields []string `json:"-"` 2253} 2254 2255func (s *GoogleCloudDialogflowV2IntentMessageListSelectItem) MarshalJSON() ([]byte, error) { 2256 type NoMethod GoogleCloudDialogflowV2IntentMessageListSelectItem 2257 raw := NoMethod(*s) 2258 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2259} 2260 2261// GoogleCloudDialogflowV2IntentMessageQuickReplies: The quick replies 2262// response message. 2263type GoogleCloudDialogflowV2IntentMessageQuickReplies struct { 2264 // QuickReplies: Optional. The collection of quick replies. 2265 QuickReplies []string `json:"quickReplies,omitempty"` 2266 2267 // Title: Optional. The title of the collection of quick replies. 2268 Title string `json:"title,omitempty"` 2269 2270 // ForceSendFields is a list of field names (e.g. "QuickReplies") to 2271 // unconditionally include in API requests. By default, fields with 2272 // empty values are omitted from API requests. However, any non-pointer, 2273 // non-interface field appearing in ForceSendFields will be sent to the 2274 // server regardless of whether the field is empty or not. This may be 2275 // used to include empty fields in Patch requests. 2276 ForceSendFields []string `json:"-"` 2277 2278 // NullFields is a list of field names (e.g. "QuickReplies") to include 2279 // in API requests with the JSON null value. By default, fields with 2280 // empty values are omitted from API requests. However, any field with 2281 // an empty value appearing in NullFields will be sent to the server as 2282 // null. It is an error if a field in this list has a non-empty value. 2283 // This may be used to include null fields in Patch requests. 2284 NullFields []string `json:"-"` 2285} 2286 2287func (s *GoogleCloudDialogflowV2IntentMessageQuickReplies) MarshalJSON() ([]byte, error) { 2288 type NoMethod GoogleCloudDialogflowV2IntentMessageQuickReplies 2289 raw := NoMethod(*s) 2290 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2291} 2292 2293// GoogleCloudDialogflowV2IntentMessageSelectItemInfo: Additional info 2294// about the select item for when it is triggered in a 2295// dialog. 2296type GoogleCloudDialogflowV2IntentMessageSelectItemInfo struct { 2297 // Key: Required. A unique key that will be sent back to the agent if 2298 // this 2299 // response is given. 2300 Key string `json:"key,omitempty"` 2301 2302 // Synonyms: Optional. A list of synonyms that can also be used to 2303 // trigger this 2304 // item in dialog. 2305 Synonyms []string `json:"synonyms,omitempty"` 2306 2307 // ForceSendFields is a list of field names (e.g. "Key") to 2308 // unconditionally include in API requests. By default, fields with 2309 // empty values are omitted from API requests. However, any non-pointer, 2310 // non-interface field appearing in ForceSendFields will be sent to the 2311 // server regardless of whether the field is empty or not. This may be 2312 // used to include empty fields in Patch requests. 2313 ForceSendFields []string `json:"-"` 2314 2315 // NullFields is a list of field names (e.g. "Key") to include in API 2316 // requests with the JSON null value. By default, fields with empty 2317 // values are omitted from API requests. However, any field with an 2318 // empty value appearing in NullFields will be sent to the server as 2319 // null. It is an error if a field in this list has a non-empty value. 2320 // This may be used to include null fields in Patch requests. 2321 NullFields []string `json:"-"` 2322} 2323 2324func (s *GoogleCloudDialogflowV2IntentMessageSelectItemInfo) MarshalJSON() ([]byte, error) { 2325 type NoMethod GoogleCloudDialogflowV2IntentMessageSelectItemInfo 2326 raw := NoMethod(*s) 2327 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2328} 2329 2330// GoogleCloudDialogflowV2IntentMessageSimpleResponse: The simple 2331// response message containing speech or text. 2332type GoogleCloudDialogflowV2IntentMessageSimpleResponse struct { 2333 // DisplayText: Optional. The text to display. 2334 DisplayText string `json:"displayText,omitempty"` 2335 2336 // Ssml: One of text_to_speech or ssml must be provided. Structured 2337 // spoken 2338 // response to the user in the SSML format. Mutually exclusive 2339 // with 2340 // text_to_speech. 2341 Ssml string `json:"ssml,omitempty"` 2342 2343 // TextToSpeech: One of text_to_speech or ssml must be provided. The 2344 // plain text of the 2345 // speech output. Mutually exclusive with ssml. 2346 TextToSpeech string `json:"textToSpeech,omitempty"` 2347 2348 // ForceSendFields is a list of field names (e.g. "DisplayText") to 2349 // unconditionally include in API requests. By default, fields with 2350 // empty values are omitted from API requests. However, any non-pointer, 2351 // non-interface field appearing in ForceSendFields will be sent to the 2352 // server regardless of whether the field is empty or not. This may be 2353 // used to include empty fields in Patch requests. 2354 ForceSendFields []string `json:"-"` 2355 2356 // NullFields is a list of field names (e.g. "DisplayText") to include 2357 // in API requests with the JSON null value. By default, fields with 2358 // empty values are omitted from API requests. However, any field with 2359 // an empty value appearing in NullFields will be sent to the server as 2360 // null. It is an error if a field in this list has a non-empty value. 2361 // This may be used to include null fields in Patch requests. 2362 NullFields []string `json:"-"` 2363} 2364 2365func (s *GoogleCloudDialogflowV2IntentMessageSimpleResponse) MarshalJSON() ([]byte, error) { 2366 type NoMethod GoogleCloudDialogflowV2IntentMessageSimpleResponse 2367 raw := NoMethod(*s) 2368 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2369} 2370 2371// GoogleCloudDialogflowV2IntentMessageSimpleResponses: The collection 2372// of simple response candidates. 2373// This message in `QueryResult.fulfillment_messages` 2374// and 2375// `WebhookResponse.fulfillment_messages` should contain only 2376// one 2377// `SimpleResponse`. 2378type GoogleCloudDialogflowV2IntentMessageSimpleResponses struct { 2379 // SimpleResponses: Required. The list of simple responses. 2380 SimpleResponses []*GoogleCloudDialogflowV2IntentMessageSimpleResponse `json:"simpleResponses,omitempty"` 2381 2382 // ForceSendFields is a list of field names (e.g. "SimpleResponses") to 2383 // unconditionally include in API requests. By default, fields with 2384 // empty values are omitted from API requests. However, any non-pointer, 2385 // non-interface field appearing in ForceSendFields will be sent to the 2386 // server regardless of whether the field is empty or not. This may be 2387 // used to include empty fields in Patch requests. 2388 ForceSendFields []string `json:"-"` 2389 2390 // NullFields is a list of field names (e.g. "SimpleResponses") to 2391 // include in API requests with the JSON null value. By default, fields 2392 // with empty values are omitted from API requests. However, any field 2393 // with an empty value appearing in NullFields will be sent to the 2394 // server as null. It is an error if a field in this list has a 2395 // non-empty value. This may be used to include null fields in Patch 2396 // requests. 2397 NullFields []string `json:"-"` 2398} 2399 2400func (s *GoogleCloudDialogflowV2IntentMessageSimpleResponses) MarshalJSON() ([]byte, error) { 2401 type NoMethod GoogleCloudDialogflowV2IntentMessageSimpleResponses 2402 raw := NoMethod(*s) 2403 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2404} 2405 2406// GoogleCloudDialogflowV2IntentMessageSuggestion: The suggestion chip 2407// message that the user can tap to quickly post a reply 2408// to the conversation. 2409type GoogleCloudDialogflowV2IntentMessageSuggestion struct { 2410 // Title: Required. The text shown the in the suggestion chip. 2411 Title string `json:"title,omitempty"` 2412 2413 // ForceSendFields is a list of field names (e.g. "Title") to 2414 // unconditionally include in API requests. By default, fields with 2415 // empty values are omitted from API requests. However, any non-pointer, 2416 // non-interface field appearing in ForceSendFields will be sent to the 2417 // server regardless of whether the field is empty or not. This may be 2418 // used to include empty fields in Patch requests. 2419 ForceSendFields []string `json:"-"` 2420 2421 // NullFields is a list of field names (e.g. "Title") to include in API 2422 // requests with the JSON null value. By default, fields with empty 2423 // values are omitted from API requests. However, any field with an 2424 // empty value appearing in NullFields will be sent to the server as 2425 // null. It is an error if a field in this list has a non-empty value. 2426 // This may be used to include null fields in Patch requests. 2427 NullFields []string `json:"-"` 2428} 2429 2430func (s *GoogleCloudDialogflowV2IntentMessageSuggestion) MarshalJSON() ([]byte, error) { 2431 type NoMethod GoogleCloudDialogflowV2IntentMessageSuggestion 2432 raw := NoMethod(*s) 2433 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2434} 2435 2436// GoogleCloudDialogflowV2IntentMessageSuggestions: The collection of 2437// suggestions. 2438type GoogleCloudDialogflowV2IntentMessageSuggestions struct { 2439 // Suggestions: Required. The list of suggested replies. 2440 Suggestions []*GoogleCloudDialogflowV2IntentMessageSuggestion `json:"suggestions,omitempty"` 2441 2442 // ForceSendFields is a list of field names (e.g. "Suggestions") to 2443 // unconditionally include in API requests. By default, fields with 2444 // empty values are omitted from API requests. However, any non-pointer, 2445 // non-interface field appearing in ForceSendFields will be sent to the 2446 // server regardless of whether the field is empty or not. This may be 2447 // used to include empty fields in Patch requests. 2448 ForceSendFields []string `json:"-"` 2449 2450 // NullFields is a list of field names (e.g. "Suggestions") to include 2451 // in API requests with the JSON null value. By default, fields with 2452 // empty values are omitted from API requests. However, any field with 2453 // an empty value appearing in NullFields will be sent to the server as 2454 // null. It is an error if a field in this list has a non-empty value. 2455 // This may be used to include null fields in Patch requests. 2456 NullFields []string `json:"-"` 2457} 2458 2459func (s *GoogleCloudDialogflowV2IntentMessageSuggestions) MarshalJSON() ([]byte, error) { 2460 type NoMethod GoogleCloudDialogflowV2IntentMessageSuggestions 2461 raw := NoMethod(*s) 2462 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2463} 2464 2465// GoogleCloudDialogflowV2IntentMessageText: The text response message. 2466type GoogleCloudDialogflowV2IntentMessageText struct { 2467 // Text: Optional. The collection of the agent's responses. 2468 Text []string `json:"text,omitempty"` 2469 2470 // ForceSendFields is a list of field names (e.g. "Text") to 2471 // unconditionally include in API requests. By default, fields with 2472 // empty values are omitted from API requests. However, any non-pointer, 2473 // non-interface field appearing in ForceSendFields will be sent to the 2474 // server regardless of whether the field is empty or not. This may be 2475 // used to include empty fields in Patch requests. 2476 ForceSendFields []string `json:"-"` 2477 2478 // NullFields is a list of field names (e.g. "Text") to include in API 2479 // requests with the JSON null value. By default, fields with empty 2480 // values are omitted from API requests. However, any field with an 2481 // empty value appearing in NullFields will be sent to the server as 2482 // null. It is an error if a field in this list has a non-empty value. 2483 // This may be used to include null fields in Patch requests. 2484 NullFields []string `json:"-"` 2485} 2486 2487func (s *GoogleCloudDialogflowV2IntentMessageText) MarshalJSON() ([]byte, error) { 2488 type NoMethod GoogleCloudDialogflowV2IntentMessageText 2489 raw := NoMethod(*s) 2490 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2491} 2492 2493// GoogleCloudDialogflowV2IntentParameter: Represents intent parameters. 2494type GoogleCloudDialogflowV2IntentParameter struct { 2495 // DefaultValue: Optional. The default value to use when the `value` 2496 // yields an empty 2497 // result. 2498 // Default values can be extracted from contexts by using the 2499 // following 2500 // syntax: `#context_name.parameter_name`. 2501 DefaultValue string `json:"defaultValue,omitempty"` 2502 2503 // DisplayName: Required. The name of the parameter. 2504 DisplayName string `json:"displayName,omitempty"` 2505 2506 // EntityTypeDisplayName: Optional. The name of the entity type, 2507 // prefixed with `@`, that 2508 // describes values of the parameter. If the parameter is 2509 // required, this must be provided. 2510 EntityTypeDisplayName string `json:"entityTypeDisplayName,omitempty"` 2511 2512 // IsList: Optional. Indicates whether the parameter represents a list 2513 // of values. 2514 IsList bool `json:"isList,omitempty"` 2515 2516 // Mandatory: Optional. Indicates whether the parameter is required. 2517 // That is, 2518 // whether the intent cannot be completed without collecting the 2519 // parameter 2520 // value. 2521 Mandatory bool `json:"mandatory,omitempty"` 2522 2523 // Name: The unique identifier of this parameter. 2524 Name string `json:"name,omitempty"` 2525 2526 // Prompts: Optional. The collection of prompts that the agent can 2527 // present to the 2528 // user in order to collect a value for the parameter. 2529 Prompts []string `json:"prompts,omitempty"` 2530 2531 // Value: Optional. The definition of the parameter value. It can be: 2532 // - a constant string, 2533 // - a parameter value defined as `$parameter_name`, 2534 // - an original parameter value defined as 2535 // `$parameter_name.original`, 2536 // - a parameter value from some context defined as 2537 // `#context_name.parameter_name`. 2538 Value string `json:"value,omitempty"` 2539 2540 // ForceSendFields is a list of field names (e.g. "DefaultValue") to 2541 // unconditionally include in API requests. By default, fields with 2542 // empty values are omitted from API requests. However, any non-pointer, 2543 // non-interface field appearing in ForceSendFields will be sent to the 2544 // server regardless of whether the field is empty or not. This may be 2545 // used to include empty fields in Patch requests. 2546 ForceSendFields []string `json:"-"` 2547 2548 // NullFields is a list of field names (e.g. "DefaultValue") to include 2549 // in API requests with the JSON null value. By default, fields with 2550 // empty values are omitted from API requests. However, any field with 2551 // an empty value appearing in NullFields will be sent to the server as 2552 // null. It is an error if a field in this list has a non-empty value. 2553 // This may be used to include null fields in Patch requests. 2554 NullFields []string `json:"-"` 2555} 2556 2557func (s *GoogleCloudDialogflowV2IntentParameter) MarshalJSON() ([]byte, error) { 2558 type NoMethod GoogleCloudDialogflowV2IntentParameter 2559 raw := NoMethod(*s) 2560 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2561} 2562 2563// GoogleCloudDialogflowV2IntentTrainingPhrase: Represents an example 2564// that the agent is trained on. 2565type GoogleCloudDialogflowV2IntentTrainingPhrase struct { 2566 // Name: Output only. The unique identifier of this training phrase. 2567 Name string `json:"name,omitempty"` 2568 2569 // Parts: Required. The ordered list of training phrase parts. 2570 // The parts are concatenated in order to form the training 2571 // phrase. 2572 // 2573 // Note: The API does not automatically annotate training phrases like 2574 // the 2575 // Dialogflow Console does. 2576 // 2577 // Note: Do not forget to include whitespace at part boundaries, 2578 // so the training phrase is well formatted when the parts are 2579 // concatenated. 2580 // 2581 // If the training phrase does not need to be annotated with 2582 // parameters, 2583 // you just need a single part with only the Part.text field set. 2584 // 2585 // If you want to annotate the training phrase, you must create 2586 // multiple 2587 // parts, where the fields of each part are populated in one of two 2588 // ways: 2589 // 2590 // - `Part.text` is set to a part of the phrase that has no 2591 // parameters. 2592 // - `Part.text` is set to a part of the phrase that you want to 2593 // annotate, 2594 // and the `entity_type`, `alias`, and `user_defined` fields are 2595 // all 2596 // set. 2597 Parts []*GoogleCloudDialogflowV2IntentTrainingPhrasePart `json:"parts,omitempty"` 2598 2599 // TimesAddedCount: Optional. Indicates how many times this example was 2600 // added to 2601 // the intent. Each time a developer adds an existing sample by editing 2602 // an 2603 // intent or training, this counter is increased. 2604 TimesAddedCount int64 `json:"timesAddedCount,omitempty"` 2605 2606 // Type: Required. The type of the training phrase. 2607 // 2608 // Possible values: 2609 // "TYPE_UNSPECIFIED" - Not specified. This value should never be 2610 // used. 2611 // "EXAMPLE" - Examples do not contain @-prefixed entity type names, 2612 // but example parts 2613 // can be annotated with entity types. 2614 // "TEMPLATE" - Templates are not annotated with entity types, but 2615 // they can contain 2616 // @-prefixed entity type names as substrings. 2617 // Template mode has been deprecated. Example mode is the only 2618 // supported 2619 // way to create new training phrases. If you have existing 2620 // training 2621 // phrases that you've created in template mode, those will continue 2622 // to 2623 // work. 2624 Type string `json:"type,omitempty"` 2625 2626 // ForceSendFields is a list of field names (e.g. "Name") to 2627 // unconditionally include in API requests. By default, fields with 2628 // empty values are omitted from API requests. However, any non-pointer, 2629 // non-interface field appearing in ForceSendFields will be sent to the 2630 // server regardless of whether the field is empty or not. This may be 2631 // used to include empty fields in Patch requests. 2632 ForceSendFields []string `json:"-"` 2633 2634 // NullFields is a list of field names (e.g. "Name") to include in API 2635 // requests with the JSON null value. By default, fields with empty 2636 // values are omitted from API requests. However, any field with an 2637 // empty value appearing in NullFields will be sent to the server as 2638 // null. It is an error if a field in this list has a non-empty value. 2639 // This may be used to include null fields in Patch requests. 2640 NullFields []string `json:"-"` 2641} 2642 2643func (s *GoogleCloudDialogflowV2IntentTrainingPhrase) MarshalJSON() ([]byte, error) { 2644 type NoMethod GoogleCloudDialogflowV2IntentTrainingPhrase 2645 raw := NoMethod(*s) 2646 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2647} 2648 2649// GoogleCloudDialogflowV2IntentTrainingPhrasePart: Represents a part of 2650// a training phrase. 2651type GoogleCloudDialogflowV2IntentTrainingPhrasePart struct { 2652 // Alias: Optional. The parameter name for the value extracted from 2653 // the 2654 // annotated part of the example. 2655 // This field is required for annotated parts of the training phrase. 2656 Alias string `json:"alias,omitempty"` 2657 2658 // EntityType: Optional. The entity type name prefixed with `@`. 2659 // This field is required for annotated parts of the training phrase. 2660 EntityType string `json:"entityType,omitempty"` 2661 2662 // Text: Required. The text for this part. 2663 Text string `json:"text,omitempty"` 2664 2665 // UserDefined: Optional. Indicates whether the text was manually 2666 // annotated. 2667 // This field is set to true when the Dialogflow Console is used 2668 // to 2669 // manually annotate the part. When creating an annotated part with 2670 // the 2671 // API, you must set this to true. 2672 UserDefined bool `json:"userDefined,omitempty"` 2673 2674 // ForceSendFields is a list of field names (e.g. "Alias") to 2675 // unconditionally include in API requests. By default, fields with 2676 // empty values are omitted from API requests. However, any non-pointer, 2677 // non-interface field appearing in ForceSendFields will be sent to the 2678 // server regardless of whether the field is empty or not. This may be 2679 // used to include empty fields in Patch requests. 2680 ForceSendFields []string `json:"-"` 2681 2682 // NullFields is a list of field names (e.g. "Alias") to include in API 2683 // requests with the JSON null value. By default, fields with empty 2684 // values are omitted from API requests. However, any field with an 2685 // empty value appearing in NullFields will be sent to the server as 2686 // null. It is an error if a field in this list has a non-empty value. 2687 // This may be used to include null fields in Patch requests. 2688 NullFields []string `json:"-"` 2689} 2690 2691func (s *GoogleCloudDialogflowV2IntentTrainingPhrasePart) MarshalJSON() ([]byte, error) { 2692 type NoMethod GoogleCloudDialogflowV2IntentTrainingPhrasePart 2693 raw := NoMethod(*s) 2694 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2695} 2696 2697// GoogleCloudDialogflowV2ListContextsResponse: The response message for 2698// Contexts.ListContexts. 2699type GoogleCloudDialogflowV2ListContextsResponse struct { 2700 // Contexts: The list of contexts. There will be a maximum number of 2701 // items 2702 // returned based on the page_size field in the request. 2703 Contexts []*GoogleCloudDialogflowV2Context `json:"contexts,omitempty"` 2704 2705 // NextPageToken: Token to retrieve the next page of results, or empty 2706 // if there are no 2707 // more results in the list. 2708 NextPageToken string `json:"nextPageToken,omitempty"` 2709 2710 // ServerResponse contains the HTTP response code and headers from the 2711 // server. 2712 googleapi.ServerResponse `json:"-"` 2713 2714 // ForceSendFields is a list of field names (e.g. "Contexts") to 2715 // unconditionally include in API requests. By default, fields with 2716 // empty values are omitted from API requests. However, any non-pointer, 2717 // non-interface field appearing in ForceSendFields will be sent to the 2718 // server regardless of whether the field is empty or not. This may be 2719 // used to include empty fields in Patch requests. 2720 ForceSendFields []string `json:"-"` 2721 2722 // NullFields is a list of field names (e.g. "Contexts") to include in 2723 // API requests with the JSON null value. By default, fields with empty 2724 // values are omitted from API requests. However, any field with an 2725 // empty value appearing in NullFields will be sent to the server as 2726 // null. It is an error if a field in this list has a non-empty value. 2727 // This may be used to include null fields in Patch requests. 2728 NullFields []string `json:"-"` 2729} 2730 2731func (s *GoogleCloudDialogflowV2ListContextsResponse) MarshalJSON() ([]byte, error) { 2732 type NoMethod GoogleCloudDialogflowV2ListContextsResponse 2733 raw := NoMethod(*s) 2734 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2735} 2736 2737// GoogleCloudDialogflowV2ListEntityTypesResponse: The response message 2738// for EntityTypes.ListEntityTypes. 2739type GoogleCloudDialogflowV2ListEntityTypesResponse struct { 2740 // EntityTypes: The list of agent entity types. There will be a maximum 2741 // number of items 2742 // returned based on the page_size field in the request. 2743 EntityTypes []*GoogleCloudDialogflowV2EntityType `json:"entityTypes,omitempty"` 2744 2745 // NextPageToken: Token to retrieve the next page of results, or empty 2746 // if there are no 2747 // more results in the list. 2748 NextPageToken string `json:"nextPageToken,omitempty"` 2749 2750 // ServerResponse contains the HTTP response code and headers from the 2751 // server. 2752 googleapi.ServerResponse `json:"-"` 2753 2754 // ForceSendFields is a list of field names (e.g. "EntityTypes") to 2755 // unconditionally include in API requests. By default, fields with 2756 // empty values are omitted from API requests. However, any non-pointer, 2757 // non-interface field appearing in ForceSendFields will be sent to the 2758 // server regardless of whether the field is empty or not. This may be 2759 // used to include empty fields in Patch requests. 2760 ForceSendFields []string `json:"-"` 2761 2762 // NullFields is a list of field names (e.g. "EntityTypes") to include 2763 // in API requests with the JSON null value. By default, fields with 2764 // empty values are omitted from API requests. However, any field with 2765 // an empty value appearing in NullFields will be sent to the server as 2766 // null. It is an error if a field in this list has a non-empty value. 2767 // This may be used to include null fields in Patch requests. 2768 NullFields []string `json:"-"` 2769} 2770 2771func (s *GoogleCloudDialogflowV2ListEntityTypesResponse) MarshalJSON() ([]byte, error) { 2772 type NoMethod GoogleCloudDialogflowV2ListEntityTypesResponse 2773 raw := NoMethod(*s) 2774 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2775} 2776 2777// GoogleCloudDialogflowV2ListIntentsResponse: The response message for 2778// Intents.ListIntents. 2779type GoogleCloudDialogflowV2ListIntentsResponse struct { 2780 // Intents: The list of agent intents. There will be a maximum number of 2781 // items 2782 // returned based on the page_size field in the request. 2783 Intents []*GoogleCloudDialogflowV2Intent `json:"intents,omitempty"` 2784 2785 // NextPageToken: Token to retrieve the next page of results, or empty 2786 // if there are no 2787 // more results in the list. 2788 NextPageToken string `json:"nextPageToken,omitempty"` 2789 2790 // ServerResponse contains the HTTP response code and headers from the 2791 // server. 2792 googleapi.ServerResponse `json:"-"` 2793 2794 // ForceSendFields is a list of field names (e.g. "Intents") to 2795 // unconditionally include in API requests. By default, fields with 2796 // empty values are omitted from API requests. However, any non-pointer, 2797 // non-interface field appearing in ForceSendFields will be sent to the 2798 // server regardless of whether the field is empty or not. This may be 2799 // used to include empty fields in Patch requests. 2800 ForceSendFields []string `json:"-"` 2801 2802 // NullFields is a list of field names (e.g. "Intents") to include in 2803 // API requests with the JSON null value. By default, fields with empty 2804 // values are omitted from API requests. However, any field with an 2805 // empty value appearing in NullFields will be sent to the server as 2806 // null. It is an error if a field in this list has a non-empty value. 2807 // This may be used to include null fields in Patch requests. 2808 NullFields []string `json:"-"` 2809} 2810 2811func (s *GoogleCloudDialogflowV2ListIntentsResponse) MarshalJSON() ([]byte, error) { 2812 type NoMethod GoogleCloudDialogflowV2ListIntentsResponse 2813 raw := NoMethod(*s) 2814 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2815} 2816 2817// GoogleCloudDialogflowV2ListSessionEntityTypesResponse: The response 2818// message for SessionEntityTypes.ListSessionEntityTypes. 2819type GoogleCloudDialogflowV2ListSessionEntityTypesResponse struct { 2820 // NextPageToken: Token to retrieve the next page of results, or empty 2821 // if there are no 2822 // more results in the list. 2823 NextPageToken string `json:"nextPageToken,omitempty"` 2824 2825 // SessionEntityTypes: The list of session entity types. There will be a 2826 // maximum number of items 2827 // returned based on the page_size field in the request. 2828 SessionEntityTypes []*GoogleCloudDialogflowV2SessionEntityType `json:"sessionEntityTypes,omitempty"` 2829 2830 // ServerResponse contains the HTTP response code and headers from the 2831 // server. 2832 googleapi.ServerResponse `json:"-"` 2833 2834 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 2835 // unconditionally include in API requests. By default, fields with 2836 // empty values are omitted from API requests. However, any non-pointer, 2837 // non-interface field appearing in ForceSendFields will be sent to the 2838 // server regardless of whether the field is empty or not. This may be 2839 // used to include empty fields in Patch requests. 2840 ForceSendFields []string `json:"-"` 2841 2842 // NullFields is a list of field names (e.g. "NextPageToken") to include 2843 // in API requests with the JSON null value. By default, fields with 2844 // empty values are omitted from API requests. However, any field with 2845 // an empty value appearing in NullFields will be sent to the server as 2846 // null. It is an error if a field in this list has a non-empty value. 2847 // This may be used to include null fields in Patch requests. 2848 NullFields []string `json:"-"` 2849} 2850 2851func (s *GoogleCloudDialogflowV2ListSessionEntityTypesResponse) MarshalJSON() ([]byte, error) { 2852 type NoMethod GoogleCloudDialogflowV2ListSessionEntityTypesResponse 2853 raw := NoMethod(*s) 2854 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2855} 2856 2857// GoogleCloudDialogflowV2OriginalDetectIntentRequest: Represents the 2858// contents of the original request that was passed to 2859// the `[Streaming]DetectIntent` call. 2860type GoogleCloudDialogflowV2OriginalDetectIntentRequest struct { 2861 // Payload: Optional. This field is set to the value of the 2862 // `QueryParameters.payload` 2863 // field passed in the request. Some integrations that query a 2864 // Dialogflow 2865 // agent may provide additional information in the payload. 2866 // 2867 // In particular for the Telephony Gateway this field has the 2868 // form: 2869 // <pre>{ 2870 // "telephony": { 2871 // "caller_id": "+18558363987" 2872 // } 2873 // }</pre> 2874 // Note: The caller ID field (`caller_id`) will be redacted for 2875 // Standard 2876 // Edition agents and populated with the caller ID in 2877 // [E.164 2878 // format](https://en.wikipedia.org/wiki/E.164) for Enterprise Edition 2879 // agents. 2880 Payload googleapi.RawMessage `json:"payload,omitempty"` 2881 2882 // Source: The source of this request, e.g., `google`, `facebook`, 2883 // `slack`. It is set 2884 // by Dialogflow-owned servers. 2885 Source string `json:"source,omitempty"` 2886 2887 // Version: Optional. The version of the protocol used for this 2888 // request. 2889 // This field is AoG-specific. 2890 Version string `json:"version,omitempty"` 2891 2892 // ForceSendFields is a list of field names (e.g. "Payload") to 2893 // unconditionally include in API requests. By default, fields with 2894 // empty values are omitted from API requests. However, any non-pointer, 2895 // non-interface field appearing in ForceSendFields will be sent to the 2896 // server regardless of whether the field is empty or not. This may be 2897 // used to include empty fields in Patch requests. 2898 ForceSendFields []string `json:"-"` 2899 2900 // NullFields is a list of field names (e.g. "Payload") to include in 2901 // API requests with the JSON null value. By default, fields with empty 2902 // values are omitted from API requests. However, any field with an 2903 // empty value appearing in NullFields will be sent to the server as 2904 // null. It is an error if a field in this list has a non-empty value. 2905 // This may be used to include null fields in Patch requests. 2906 NullFields []string `json:"-"` 2907} 2908 2909func (s *GoogleCloudDialogflowV2OriginalDetectIntentRequest) MarshalJSON() ([]byte, error) { 2910 type NoMethod GoogleCloudDialogflowV2OriginalDetectIntentRequest 2911 raw := NoMethod(*s) 2912 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2913} 2914 2915// GoogleCloudDialogflowV2OutputAudioConfig: Instructs the speech 2916// synthesizer on how to generate the output audio content. 2917type GoogleCloudDialogflowV2OutputAudioConfig struct { 2918 // AudioEncoding: Required. Audio encoding of the synthesized audio 2919 // content. 2920 // 2921 // Possible values: 2922 // "OUTPUT_AUDIO_ENCODING_UNSPECIFIED" - Not specified. 2923 // "OUTPUT_AUDIO_ENCODING_LINEAR_16" - Uncompressed 16-bit signed 2924 // little-endian samples (Linear PCM). 2925 // Audio content returned as LINEAR16 also contains a WAV header. 2926 // "OUTPUT_AUDIO_ENCODING_MP3" - MP3 audio. 2927 // "OUTPUT_AUDIO_ENCODING_OGG_OPUS" - Opus encoded audio wrapped in an 2928 // ogg container. The result will be a 2929 // file which can be played natively on Android, and in browsers (at 2930 // least 2931 // Chrome and Firefox). The quality of the encoding is considerably 2932 // higher 2933 // than MP3 while using approximately the same bitrate. 2934 AudioEncoding string `json:"audioEncoding,omitempty"` 2935 2936 // SampleRateHertz: Optional. The synthesis sample rate (in hertz) for 2937 // this audio. If not 2938 // provided, then the synthesizer will use the default sample rate based 2939 // on 2940 // the audio encoding. If this is different from the voice's natural 2941 // sample 2942 // rate, then the synthesizer will honor this request by converting to 2943 // the 2944 // desired sample rate (which might result in worse audio quality). 2945 SampleRateHertz int64 `json:"sampleRateHertz,omitempty"` 2946 2947 // SynthesizeSpeechConfig: Optional. Configuration of how speech should 2948 // be synthesized. 2949 SynthesizeSpeechConfig *GoogleCloudDialogflowV2SynthesizeSpeechConfig `json:"synthesizeSpeechConfig,omitempty"` 2950 2951 // ForceSendFields is a list of field names (e.g. "AudioEncoding") to 2952 // unconditionally include in API requests. By default, fields with 2953 // empty values are omitted from API requests. However, any non-pointer, 2954 // non-interface field appearing in ForceSendFields will be sent to the 2955 // server regardless of whether the field is empty or not. This may be 2956 // used to include empty fields in Patch requests. 2957 ForceSendFields []string `json:"-"` 2958 2959 // NullFields is a list of field names (e.g. "AudioEncoding") to include 2960 // in API requests with the JSON null value. By default, fields with 2961 // empty values are omitted from API requests. However, any field with 2962 // an empty value appearing in NullFields will be sent to the server as 2963 // null. It is an error if a field in this list has a non-empty value. 2964 // This may be used to include null fields in Patch requests. 2965 NullFields []string `json:"-"` 2966} 2967 2968func (s *GoogleCloudDialogflowV2OutputAudioConfig) MarshalJSON() ([]byte, error) { 2969 type NoMethod GoogleCloudDialogflowV2OutputAudioConfig 2970 raw := NoMethod(*s) 2971 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2972} 2973 2974// GoogleCloudDialogflowV2QueryInput: Represents the query input. It can 2975// contain either: 2976// 2977// 1. An audio config which 2978// instructs the speech recognizer how to process the speech 2979// audio. 2980// 2981// 2. A conversational query in the form of text,. 2982// 2983// 3. An event that specifies which intent to trigger. 2984type GoogleCloudDialogflowV2QueryInput struct { 2985 // AudioConfig: Instructs the speech recognizer how to process the 2986 // speech audio. 2987 AudioConfig *GoogleCloudDialogflowV2InputAudioConfig `json:"audioConfig,omitempty"` 2988 2989 // Event: The event to be processed. 2990 Event *GoogleCloudDialogflowV2EventInput `json:"event,omitempty"` 2991 2992 // Text: The natural language text to be processed. 2993 Text *GoogleCloudDialogflowV2TextInput `json:"text,omitempty"` 2994 2995 // ForceSendFields is a list of field names (e.g. "AudioConfig") to 2996 // unconditionally include in API requests. By default, fields with 2997 // empty values are omitted from API requests. However, any non-pointer, 2998 // non-interface field appearing in ForceSendFields will be sent to the 2999 // server regardless of whether the field is empty or not. This may be 3000 // used to include empty fields in Patch requests. 3001 ForceSendFields []string `json:"-"` 3002 3003 // NullFields is a list of field names (e.g. "AudioConfig") to include 3004 // in API requests with the JSON null value. By default, fields with 3005 // empty values are omitted from API requests. However, any field with 3006 // an empty value appearing in NullFields will be sent to the server as 3007 // null. It is an error if a field in this list has a non-empty value. 3008 // This may be used to include null fields in Patch requests. 3009 NullFields []string `json:"-"` 3010} 3011 3012func (s *GoogleCloudDialogflowV2QueryInput) MarshalJSON() ([]byte, error) { 3013 type NoMethod GoogleCloudDialogflowV2QueryInput 3014 raw := NoMethod(*s) 3015 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3016} 3017 3018// GoogleCloudDialogflowV2QueryParameters: Represents the parameters of 3019// the conversational query. 3020type GoogleCloudDialogflowV2QueryParameters struct { 3021 // Contexts: Optional. The collection of contexts to be activated before 3022 // this query is 3023 // executed. 3024 Contexts []*GoogleCloudDialogflowV2Context `json:"contexts,omitempty"` 3025 3026 // GeoLocation: Optional. The geo location of this conversational query. 3027 GeoLocation *GoogleTypeLatLng `json:"geoLocation,omitempty"` 3028 3029 // Payload: Optional. This field can be used to pass custom data into 3030 // the webhook 3031 // associated with the agent. Arbitrary JSON objects are supported. 3032 Payload googleapi.RawMessage `json:"payload,omitempty"` 3033 3034 // ResetContexts: Optional. Specifies whether to delete all contexts in 3035 // the current session 3036 // before the new ones are activated. 3037 ResetContexts bool `json:"resetContexts,omitempty"` 3038 3039 // SentimentAnalysisRequestConfig: Optional. Configures the type of 3040 // sentiment analysis to perform. If not 3041 // provided, sentiment analysis is not performed. 3042 SentimentAnalysisRequestConfig *GoogleCloudDialogflowV2SentimentAnalysisRequestConfig `json:"sentimentAnalysisRequestConfig,omitempty"` 3043 3044 // SessionEntityTypes: Optional. Additional session entity types to 3045 // replace or extend developer 3046 // entity types with. The entity synonyms apply to all languages and 3047 // persist 3048 // for the session of this query. 3049 SessionEntityTypes []*GoogleCloudDialogflowV2SessionEntityType `json:"sessionEntityTypes,omitempty"` 3050 3051 // TimeZone: Optional. The time zone of this conversational query from 3052 // the 3053 // [time zone database](https://www.iana.org/time-zones), 3054 // e.g., 3055 // America/New_York, Europe/Paris. If not provided, the time zone 3056 // specified in 3057 // agent settings is used. 3058 TimeZone string `json:"timeZone,omitempty"` 3059 3060 // ForceSendFields is a list of field names (e.g. "Contexts") to 3061 // unconditionally include in API requests. By default, fields with 3062 // empty values are omitted from API requests. However, any non-pointer, 3063 // non-interface field appearing in ForceSendFields will be sent to the 3064 // server regardless of whether the field is empty or not. This may be 3065 // used to include empty fields in Patch requests. 3066 ForceSendFields []string `json:"-"` 3067 3068 // NullFields is a list of field names (e.g. "Contexts") to include in 3069 // API requests with the JSON null value. By default, fields with empty 3070 // values are omitted from API requests. However, any field with an 3071 // empty value appearing in NullFields will be sent to the server as 3072 // null. It is an error if a field in this list has a non-empty value. 3073 // This may be used to include null fields in Patch requests. 3074 NullFields []string `json:"-"` 3075} 3076 3077func (s *GoogleCloudDialogflowV2QueryParameters) MarshalJSON() ([]byte, error) { 3078 type NoMethod GoogleCloudDialogflowV2QueryParameters 3079 raw := NoMethod(*s) 3080 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3081} 3082 3083// GoogleCloudDialogflowV2QueryResult: Represents the result of 3084// conversational query or event processing. 3085type GoogleCloudDialogflowV2QueryResult struct { 3086 // Action: The action name from the matched intent. 3087 Action string `json:"action,omitempty"` 3088 3089 // AllRequiredParamsPresent: This field is set to: 3090 // 3091 // - `false` if the matched intent has required parameters and not all 3092 // of 3093 // the required parameter values have been collected. 3094 // - `true` if all required parameter values have been collected, or if 3095 // the 3096 // matched intent doesn't contain any required parameters. 3097 AllRequiredParamsPresent bool `json:"allRequiredParamsPresent,omitempty"` 3098 3099 // DiagnosticInfo: The free-form diagnostic info. For example, this 3100 // field could contain 3101 // webhook call latency. The string keys of the Struct's fields map can 3102 // change 3103 // without notice. 3104 DiagnosticInfo googleapi.RawMessage `json:"diagnosticInfo,omitempty"` 3105 3106 // FulfillmentMessages: The collection of rich messages to present to 3107 // the user. 3108 FulfillmentMessages []*GoogleCloudDialogflowV2IntentMessage `json:"fulfillmentMessages,omitempty"` 3109 3110 // FulfillmentText: The text to be pronounced to the user or shown on 3111 // the screen. 3112 // Note: This is a legacy field, `fulfillment_messages` should be 3113 // preferred. 3114 FulfillmentText string `json:"fulfillmentText,omitempty"` 3115 3116 // Intent: The intent that matched the conversational query. Some, 3117 // not 3118 // all fields are filled in this message, including but not limited 3119 // to: 3120 // `name`, `display_name` and `webhook_state`. 3121 Intent *GoogleCloudDialogflowV2Intent `json:"intent,omitempty"` 3122 3123 // IntentDetectionConfidence: The intent detection confidence. Values 3124 // range from 0.0 3125 // (completely uncertain) to 1.0 (completely certain). 3126 // If there are `multiple knowledge_answers` messages, this value is set 3127 // to 3128 // the greatest `knowledgeAnswers.match_confidence` value in the list. 3129 IntentDetectionConfidence float64 `json:"intentDetectionConfidence,omitempty"` 3130 3131 // LanguageCode: The language that was triggered during intent 3132 // detection. 3133 // See 3134 // [Language 3135 // Support](https://cloud.google.com/dialogflow/docs/reference/ 3136 // language) 3137 // for a list of the currently supported language codes. 3138 LanguageCode string `json:"languageCode,omitempty"` 3139 3140 // OutputContexts: The collection of output contexts. If 3141 // applicable, 3142 // `output_contexts.parameters` contains entries with name 3143 // `<parameter name>.original` containing the original parameter 3144 // values 3145 // before the query. 3146 OutputContexts []*GoogleCloudDialogflowV2Context `json:"outputContexts,omitempty"` 3147 3148 // Parameters: The collection of extracted parameters. 3149 Parameters googleapi.RawMessage `json:"parameters,omitempty"` 3150 3151 // QueryText: The original conversational query text: 3152 // 3153 // - If natural language text was provided as input, `query_text` 3154 // contains 3155 // a copy of the input. 3156 // - If natural language speech audio was provided as input, 3157 // `query_text` 3158 // contains the speech recognition result. If speech recognizer 3159 // produced 3160 // multiple alternatives, a particular one is picked. 3161 // - If automatic spell correction is enabled, `query_text` will contain 3162 // the 3163 // corrected user input. 3164 QueryText string `json:"queryText,omitempty"` 3165 3166 // SentimentAnalysisResult: The sentiment analysis result, which depends 3167 // on the 3168 // `sentiment_analysis_request_config` specified in the request. 3169 SentimentAnalysisResult *GoogleCloudDialogflowV2SentimentAnalysisResult `json:"sentimentAnalysisResult,omitempty"` 3170 3171 // SpeechRecognitionConfidence: The Speech recognition confidence 3172 // between 0.0 and 1.0. A higher number 3173 // indicates an estimated greater likelihood that the recognized words 3174 // are 3175 // correct. The default of 0.0 is a sentinel value indicating that 3176 // confidence 3177 // was not set. 3178 // 3179 // This field is not guaranteed to be accurate or set. In particular 3180 // this 3181 // field isn't set for StreamingDetectIntent since the streaming 3182 // endpoint has 3183 // separate confidence estimates per portion of the audio 3184 // in 3185 // StreamingRecognitionResult. 3186 SpeechRecognitionConfidence float64 `json:"speechRecognitionConfidence,omitempty"` 3187 3188 // WebhookPayload: If the query was fulfilled by a webhook call, this 3189 // field is set to the 3190 // value of the `payload` field returned in the webhook response. 3191 WebhookPayload googleapi.RawMessage `json:"webhookPayload,omitempty"` 3192 3193 // WebhookSource: If the query was fulfilled by a webhook call, this 3194 // field is set to the 3195 // value of the `source` field returned in the webhook response. 3196 WebhookSource string `json:"webhookSource,omitempty"` 3197 3198 // ForceSendFields is a list of field names (e.g. "Action") to 3199 // unconditionally include in API requests. By default, fields with 3200 // empty values are omitted from API requests. However, any non-pointer, 3201 // non-interface field appearing in ForceSendFields will be sent to the 3202 // server regardless of whether the field is empty or not. This may be 3203 // used to include empty fields in Patch requests. 3204 ForceSendFields []string `json:"-"` 3205 3206 // NullFields is a list of field names (e.g. "Action") to include in API 3207 // requests with the JSON null value. By default, fields with empty 3208 // values are omitted from API requests. However, any field with an 3209 // empty value appearing in NullFields will be sent to the server as 3210 // null. It is an error if a field in this list has a non-empty value. 3211 // This may be used to include null fields in Patch requests. 3212 NullFields []string `json:"-"` 3213} 3214 3215func (s *GoogleCloudDialogflowV2QueryResult) MarshalJSON() ([]byte, error) { 3216 type NoMethod GoogleCloudDialogflowV2QueryResult 3217 raw := NoMethod(*s) 3218 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3219} 3220 3221func (s *GoogleCloudDialogflowV2QueryResult) UnmarshalJSON(data []byte) error { 3222 type NoMethod GoogleCloudDialogflowV2QueryResult 3223 var s1 struct { 3224 IntentDetectionConfidence gensupport.JSONFloat64 `json:"intentDetectionConfidence"` 3225 SpeechRecognitionConfidence gensupport.JSONFloat64 `json:"speechRecognitionConfidence"` 3226 *NoMethod 3227 } 3228 s1.NoMethod = (*NoMethod)(s) 3229 if err := json.Unmarshal(data, &s1); err != nil { 3230 return err 3231 } 3232 s.IntentDetectionConfidence = float64(s1.IntentDetectionConfidence) 3233 s.SpeechRecognitionConfidence = float64(s1.SpeechRecognitionConfidence) 3234 return nil 3235} 3236 3237// GoogleCloudDialogflowV2RestoreAgentRequest: The request message for 3238// Agents.RestoreAgent. 3239type GoogleCloudDialogflowV2RestoreAgentRequest struct { 3240 // AgentContent: The agent to restore. 3241 // 3242 // Example for how to restore an agent via the command line: 3243 // <pre>curl \ 3244 // 3245 // 'https://dialogflow.googleapis.com/v2/projects/<project_name>/ag 3246 // ent:restore\ 3247 // -X POST \ 3248 // -H 'Authorization: Bearer '$(gcloud auth application-default 3249 // print-access-token) \ 3250 // -H 'Accept: application/json' \ 3251 // -H 'Content-Type: application/json' \ 3252 // --compressed \ 3253 // --data-binary "{ 3254 // 'agentContent': '$(cat <agent zip file> | base64 -w 0)' 3255 // }"</pre> 3256 AgentContent string `json:"agentContent,omitempty"` 3257 3258 // AgentUri: The URI to a Google Cloud Storage file containing the agent 3259 // to restore. 3260 // Note: The URI must start with "gs://". 3261 AgentUri string `json:"agentUri,omitempty"` 3262 3263 // ForceSendFields is a list of field names (e.g. "AgentContent") to 3264 // unconditionally include in API requests. By default, fields with 3265 // empty values are omitted from API requests. However, any non-pointer, 3266 // non-interface field appearing in ForceSendFields will be sent to the 3267 // server regardless of whether the field is empty or not. This may be 3268 // used to include empty fields in Patch requests. 3269 ForceSendFields []string `json:"-"` 3270 3271 // NullFields is a list of field names (e.g. "AgentContent") to include 3272 // in API requests with the JSON null value. By default, fields with 3273 // empty values are omitted from API requests. However, any field with 3274 // an empty value appearing in NullFields will be sent to the server as 3275 // null. It is an error if a field in this list has a non-empty value. 3276 // This may be used to include null fields in Patch requests. 3277 NullFields []string `json:"-"` 3278} 3279 3280func (s *GoogleCloudDialogflowV2RestoreAgentRequest) MarshalJSON() ([]byte, error) { 3281 type NoMethod GoogleCloudDialogflowV2RestoreAgentRequest 3282 raw := NoMethod(*s) 3283 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3284} 3285 3286// GoogleCloudDialogflowV2SearchAgentsResponse: The response message for 3287// Agents.SearchAgents. 3288type GoogleCloudDialogflowV2SearchAgentsResponse struct { 3289 // Agents: The list of agents. There will be a maximum number of items 3290 // returned based 3291 // on the page_size field in the request. 3292 Agents []*GoogleCloudDialogflowV2Agent `json:"agents,omitempty"` 3293 3294 // NextPageToken: Token to retrieve the next page of results, or empty 3295 // if there are no 3296 // more results in the list. 3297 NextPageToken string `json:"nextPageToken,omitempty"` 3298 3299 // ServerResponse contains the HTTP response code and headers from the 3300 // server. 3301 googleapi.ServerResponse `json:"-"` 3302 3303 // ForceSendFields is a list of field names (e.g. "Agents") to 3304 // unconditionally include in API requests. By default, fields with 3305 // empty values are omitted from API requests. However, any non-pointer, 3306 // non-interface field appearing in ForceSendFields will be sent to the 3307 // server regardless of whether the field is empty or not. This may be 3308 // used to include empty fields in Patch requests. 3309 ForceSendFields []string `json:"-"` 3310 3311 // NullFields is a list of field names (e.g. "Agents") to include in API 3312 // requests with the JSON null value. By default, fields with empty 3313 // values are omitted from API requests. However, any field with an 3314 // empty value appearing in NullFields will be sent to the server as 3315 // null. It is an error if a field in this list has a non-empty value. 3316 // This may be used to include null fields in Patch requests. 3317 NullFields []string `json:"-"` 3318} 3319 3320func (s *GoogleCloudDialogflowV2SearchAgentsResponse) MarshalJSON() ([]byte, error) { 3321 type NoMethod GoogleCloudDialogflowV2SearchAgentsResponse 3322 raw := NoMethod(*s) 3323 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3324} 3325 3326// GoogleCloudDialogflowV2Sentiment: The sentiment, such as 3327// positive/negative feeling or association, for a unit 3328// of analysis, such as the query text. 3329type GoogleCloudDialogflowV2Sentiment struct { 3330 // Magnitude: A non-negative number in the [0, +inf) range, which 3331 // represents the absolute 3332 // magnitude of sentiment, regardless of score (positive or negative). 3333 Magnitude float64 `json:"magnitude,omitempty"` 3334 3335 // Score: Sentiment score between -1.0 (negative sentiment) and 1.0 3336 // (positive 3337 // sentiment). 3338 Score float64 `json:"score,omitempty"` 3339 3340 // ForceSendFields is a list of field names (e.g. "Magnitude") to 3341 // unconditionally include in API requests. By default, fields with 3342 // empty values are omitted from API requests. However, any non-pointer, 3343 // non-interface field appearing in ForceSendFields will be sent to the 3344 // server regardless of whether the field is empty or not. This may be 3345 // used to include empty fields in Patch requests. 3346 ForceSendFields []string `json:"-"` 3347 3348 // NullFields is a list of field names (e.g. "Magnitude") to include in 3349 // API requests with the JSON null value. By default, fields with empty 3350 // values are omitted from API requests. However, any field with an 3351 // empty value appearing in NullFields will be sent to the server as 3352 // null. It is an error if a field in this list has a non-empty value. 3353 // This may be used to include null fields in Patch requests. 3354 NullFields []string `json:"-"` 3355} 3356 3357func (s *GoogleCloudDialogflowV2Sentiment) MarshalJSON() ([]byte, error) { 3358 type NoMethod GoogleCloudDialogflowV2Sentiment 3359 raw := NoMethod(*s) 3360 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3361} 3362 3363func (s *GoogleCloudDialogflowV2Sentiment) UnmarshalJSON(data []byte) error { 3364 type NoMethod GoogleCloudDialogflowV2Sentiment 3365 var s1 struct { 3366 Magnitude gensupport.JSONFloat64 `json:"magnitude"` 3367 Score gensupport.JSONFloat64 `json:"score"` 3368 *NoMethod 3369 } 3370 s1.NoMethod = (*NoMethod)(s) 3371 if err := json.Unmarshal(data, &s1); err != nil { 3372 return err 3373 } 3374 s.Magnitude = float64(s1.Magnitude) 3375 s.Score = float64(s1.Score) 3376 return nil 3377} 3378 3379// GoogleCloudDialogflowV2SentimentAnalysisRequestConfig: Configures the 3380// types of sentiment analysis to perform. 3381type GoogleCloudDialogflowV2SentimentAnalysisRequestConfig struct { 3382 // AnalyzeQueryTextSentiment: Optional. Instructs the service to perform 3383 // sentiment analysis on 3384 // `query_text`. If not provided, sentiment analysis is not performed 3385 // on 3386 // `query_text`. 3387 AnalyzeQueryTextSentiment bool `json:"analyzeQueryTextSentiment,omitempty"` 3388 3389 // ForceSendFields is a list of field names (e.g. 3390 // "AnalyzeQueryTextSentiment") to unconditionally include in API 3391 // requests. By default, fields with empty values are omitted from API 3392 // requests. However, any non-pointer, non-interface field appearing in 3393 // ForceSendFields will be sent to the server regardless of whether the 3394 // field is empty or not. This may be used to include empty fields in 3395 // Patch requests. 3396 ForceSendFields []string `json:"-"` 3397 3398 // NullFields is a list of field names (e.g. 3399 // "AnalyzeQueryTextSentiment") to include in API requests with the JSON 3400 // null value. By default, fields with empty values are omitted from API 3401 // requests. However, any field with an empty value appearing in 3402 // NullFields will be sent to the server as null. It is an error if a 3403 // field in this list has a non-empty value. This may be used to include 3404 // null fields in Patch requests. 3405 NullFields []string `json:"-"` 3406} 3407 3408func (s *GoogleCloudDialogflowV2SentimentAnalysisRequestConfig) MarshalJSON() ([]byte, error) { 3409 type NoMethod GoogleCloudDialogflowV2SentimentAnalysisRequestConfig 3410 raw := NoMethod(*s) 3411 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3412} 3413 3414// GoogleCloudDialogflowV2SentimentAnalysisResult: The result of 3415// sentiment analysis as configured 3416// by 3417// `sentiment_analysis_request_config`. 3418type GoogleCloudDialogflowV2SentimentAnalysisResult struct { 3419 // QueryTextSentiment: The sentiment analysis result for `query_text`. 3420 QueryTextSentiment *GoogleCloudDialogflowV2Sentiment `json:"queryTextSentiment,omitempty"` 3421 3422 // ForceSendFields is a list of field names (e.g. "QueryTextSentiment") 3423 // to unconditionally include in API requests. By default, fields with 3424 // empty values are omitted from API requests. However, any non-pointer, 3425 // non-interface field appearing in ForceSendFields will be sent to the 3426 // server regardless of whether the field is empty or not. This may be 3427 // used to include empty fields in Patch requests. 3428 ForceSendFields []string `json:"-"` 3429 3430 // NullFields is a list of field names (e.g. "QueryTextSentiment") to 3431 // include in API requests with the JSON null value. By default, fields 3432 // with empty values are omitted from API requests. However, any field 3433 // with an empty value appearing in NullFields will be sent to the 3434 // server as null. It is an error if a field in this list has a 3435 // non-empty value. This may be used to include null fields in Patch 3436 // requests. 3437 NullFields []string `json:"-"` 3438} 3439 3440func (s *GoogleCloudDialogflowV2SentimentAnalysisResult) MarshalJSON() ([]byte, error) { 3441 type NoMethod GoogleCloudDialogflowV2SentimentAnalysisResult 3442 raw := NoMethod(*s) 3443 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3444} 3445 3446// GoogleCloudDialogflowV2SessionEntityType: Represents a session entity 3447// type. 3448// 3449// Extends or replaces a developer entity type at the user session level 3450// (we 3451// refer to the entity types defined at the agent level as "developer 3452// entity 3453// types"). 3454// 3455// Note: session entity types apply to all queries, regardless of the 3456// language. 3457type GoogleCloudDialogflowV2SessionEntityType struct { 3458 // Entities: Required. The collection of entities associated with this 3459 // session entity 3460 // type. 3461 Entities []*GoogleCloudDialogflowV2EntityTypeEntity `json:"entities,omitempty"` 3462 3463 // EntityOverrideMode: Required. Indicates whether the additional data 3464 // should override or 3465 // supplement the developer entity type definition. 3466 // 3467 // Possible values: 3468 // "ENTITY_OVERRIDE_MODE_UNSPECIFIED" - Not specified. This value 3469 // should be never used. 3470 // "ENTITY_OVERRIDE_MODE_OVERRIDE" - The collection of session 3471 // entities overrides the collection of entities 3472 // in the corresponding developer entity type. 3473 // "ENTITY_OVERRIDE_MODE_SUPPLEMENT" - The collection of session 3474 // entities extends the collection of entities in 3475 // the corresponding developer entity type. 3476 // 3477 // Note: Even in this override mode calls to 3478 // `ListSessionEntityTypes`, 3479 // `GetSessionEntityType`, `CreateSessionEntityType` 3480 // and 3481 // `UpdateSessionEntityType` only return the additional entities added 3482 // in 3483 // this session entity type. If you want to get the supplemented 3484 // list, 3485 // please call EntityTypes.GetEntityType on the developer entity 3486 // type 3487 // and merge. 3488 EntityOverrideMode string `json:"entityOverrideMode,omitempty"` 3489 3490 // Name: Required. The unique identifier of this session entity type. 3491 // Format: 3492 // `projects/<Project ID>/agent/sessions/<Session 3493 // ID>/entityTypes/<Entity Type 3494 // Display Name>`. 3495 // 3496 // `<Entity Type Display Name>` must be the display name of an existing 3497 // entity 3498 // type in the same agent that will be overridden or supplemented. 3499 Name string `json:"name,omitempty"` 3500 3501 // ServerResponse contains the HTTP response code and headers from the 3502 // server. 3503 googleapi.ServerResponse `json:"-"` 3504 3505 // ForceSendFields is a list of field names (e.g. "Entities") to 3506 // unconditionally include in API requests. By default, fields with 3507 // empty values are omitted from API requests. However, any non-pointer, 3508 // non-interface field appearing in ForceSendFields will be sent to the 3509 // server regardless of whether the field is empty or not. This may be 3510 // used to include empty fields in Patch requests. 3511 ForceSendFields []string `json:"-"` 3512 3513 // NullFields is a list of field names (e.g. "Entities") to include in 3514 // API requests with the JSON null value. By default, fields with empty 3515 // values are omitted from API requests. However, any field with an 3516 // empty value appearing in NullFields will be sent to the server as 3517 // null. It is an error if a field in this list has a non-empty value. 3518 // This may be used to include null fields in Patch requests. 3519 NullFields []string `json:"-"` 3520} 3521 3522func (s *GoogleCloudDialogflowV2SessionEntityType) MarshalJSON() ([]byte, error) { 3523 type NoMethod GoogleCloudDialogflowV2SessionEntityType 3524 raw := NoMethod(*s) 3525 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3526} 3527 3528// GoogleCloudDialogflowV2SynthesizeSpeechConfig: Configuration of how 3529// speech should be synthesized. 3530type GoogleCloudDialogflowV2SynthesizeSpeechConfig struct { 3531 // EffectsProfileId: Optional. An identifier which selects 'audio 3532 // effects' profiles that are 3533 // applied on (post synthesized) text to speech. Effects are applied on 3534 // top of 3535 // each other in the order they are given. 3536 EffectsProfileId []string `json:"effectsProfileId,omitempty"` 3537 3538 // Pitch: Optional. Speaking pitch, in the range [-20.0, 20.0]. 20 means 3539 // increase 20 3540 // semitones from the original pitch. -20 means decrease 20 semitones 3541 // from the 3542 // original pitch. 3543 Pitch float64 `json:"pitch,omitempty"` 3544 3545 // SpeakingRate: Optional. Speaking rate/speed, in the range [0.25, 3546 // 4.0]. 1.0 is the normal 3547 // native speed supported by the specific voice. 2.0 is twice as fast, 3548 // and 3549 // 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 speed. 3550 // Any 3551 // other values < 0.25 or > 4.0 will return an error. 3552 SpeakingRate float64 `json:"speakingRate,omitempty"` 3553 3554 // Voice: Optional. The desired voice of the synthesized audio. 3555 Voice *GoogleCloudDialogflowV2VoiceSelectionParams `json:"voice,omitempty"` 3556 3557 // VolumeGainDb: Optional. Volume gain (in dB) of the normal native 3558 // volume supported by the 3559 // specific voice, in the range [-96.0, 16.0]. If unset, or set to a 3560 // value of 3561 // 0.0 (dB), will play at normal native signal amplitude. A value of 3562 // -6.0 (dB) 3563 // will play at approximately half the amplitude of the normal native 3564 // signal 3565 // amplitude. A value of +6.0 (dB) will play at approximately twice 3566 // the 3567 // amplitude of the normal native signal amplitude. We strongly 3568 // recommend not 3569 // to exceed +10 (dB) as there's usually no effective increase in 3570 // loudness for 3571 // any value greater than that. 3572 VolumeGainDb float64 `json:"volumeGainDb,omitempty"` 3573 3574 // ForceSendFields is a list of field names (e.g. "EffectsProfileId") to 3575 // unconditionally include in API requests. By default, fields with 3576 // empty values are omitted from API requests. However, any non-pointer, 3577 // non-interface field appearing in ForceSendFields will be sent to the 3578 // server regardless of whether the field is empty or not. This may be 3579 // used to include empty fields in Patch requests. 3580 ForceSendFields []string `json:"-"` 3581 3582 // NullFields is a list of field names (e.g. "EffectsProfileId") to 3583 // include in API requests with the JSON null value. By default, fields 3584 // with empty values are omitted from API requests. However, any field 3585 // with an empty value appearing in NullFields will be sent to the 3586 // server as null. It is an error if a field in this list has a 3587 // non-empty value. This may be used to include null fields in Patch 3588 // requests. 3589 NullFields []string `json:"-"` 3590} 3591 3592func (s *GoogleCloudDialogflowV2SynthesizeSpeechConfig) MarshalJSON() ([]byte, error) { 3593 type NoMethod GoogleCloudDialogflowV2SynthesizeSpeechConfig 3594 raw := NoMethod(*s) 3595 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3596} 3597 3598func (s *GoogleCloudDialogflowV2SynthesizeSpeechConfig) UnmarshalJSON(data []byte) error { 3599 type NoMethod GoogleCloudDialogflowV2SynthesizeSpeechConfig 3600 var s1 struct { 3601 Pitch gensupport.JSONFloat64 `json:"pitch"` 3602 SpeakingRate gensupport.JSONFloat64 `json:"speakingRate"` 3603 VolumeGainDb gensupport.JSONFloat64 `json:"volumeGainDb"` 3604 *NoMethod 3605 } 3606 s1.NoMethod = (*NoMethod)(s) 3607 if err := json.Unmarshal(data, &s1); err != nil { 3608 return err 3609 } 3610 s.Pitch = float64(s1.Pitch) 3611 s.SpeakingRate = float64(s1.SpeakingRate) 3612 s.VolumeGainDb = float64(s1.VolumeGainDb) 3613 return nil 3614} 3615 3616// GoogleCloudDialogflowV2TextInput: Represents the natural language 3617// text to be processed. 3618type GoogleCloudDialogflowV2TextInput struct { 3619 // LanguageCode: Required. The language of this conversational query. 3620 // See 3621 // [Language 3622 // Support](https://cloud.google.com/dialogflow/docs/reference/ 3623 // language) 3624 // for a list of the currently supported language codes. Note that 3625 // queries in 3626 // the same session do not necessarily need to specify the same 3627 // language. 3628 LanguageCode string `json:"languageCode,omitempty"` 3629 3630 // Text: Required. The UTF-8 encoded natural language text to be 3631 // processed. 3632 // Text length must not exceed 256 characters. 3633 Text string `json:"text,omitempty"` 3634 3635 // ForceSendFields is a list of field names (e.g. "LanguageCode") to 3636 // unconditionally include in API requests. By default, fields with 3637 // empty values are omitted from API requests. However, any non-pointer, 3638 // non-interface field appearing in ForceSendFields will be sent to the 3639 // server regardless of whether the field is empty or not. This may be 3640 // used to include empty fields in Patch requests. 3641 ForceSendFields []string `json:"-"` 3642 3643 // NullFields is a list of field names (e.g. "LanguageCode") to include 3644 // in API requests with the JSON null value. By default, fields with 3645 // empty values are omitted from API requests. However, any field with 3646 // an empty value appearing in NullFields will be sent to the server as 3647 // null. It is an error if a field in this list has a non-empty value. 3648 // This may be used to include null fields in Patch requests. 3649 NullFields []string `json:"-"` 3650} 3651 3652func (s *GoogleCloudDialogflowV2TextInput) MarshalJSON() ([]byte, error) { 3653 type NoMethod GoogleCloudDialogflowV2TextInput 3654 raw := NoMethod(*s) 3655 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3656} 3657 3658// GoogleCloudDialogflowV2TrainAgentRequest: The request message for 3659// Agents.TrainAgent. 3660type GoogleCloudDialogflowV2TrainAgentRequest struct { 3661} 3662 3663// GoogleCloudDialogflowV2VoiceSelectionParams: Description of which 3664// voice to use for speech synthesis. 3665type GoogleCloudDialogflowV2VoiceSelectionParams struct { 3666 // Name: Optional. The name of the voice. If not set, the service will 3667 // choose a 3668 // voice based on the other parameters such as language_code and gender. 3669 Name string `json:"name,omitempty"` 3670 3671 // SsmlGender: Optional. The preferred gender of the voice. If not set, 3672 // the service will 3673 // choose a voice based on the other parameters such as language_code 3674 // and 3675 // name. Note that this is only a preference, not requirement. If 3676 // a 3677 // voice of the appropriate gender is not available, the synthesizer 3678 // should 3679 // substitute a voice with a different gender rather than failing the 3680 // request. 3681 // 3682 // Possible values: 3683 // "SSML_VOICE_GENDER_UNSPECIFIED" - An unspecified gender, which 3684 // means that the client doesn't care which 3685 // gender the selected voice will have. 3686 // "SSML_VOICE_GENDER_MALE" - A male voice. 3687 // "SSML_VOICE_GENDER_FEMALE" - A female voice. 3688 // "SSML_VOICE_GENDER_NEUTRAL" - A gender-neutral voice. 3689 SsmlGender string `json:"ssmlGender,omitempty"` 3690 3691 // ForceSendFields is a list of field names (e.g. "Name") to 3692 // unconditionally include in API requests. By default, fields with 3693 // empty values are omitted from API requests. However, any non-pointer, 3694 // non-interface field appearing in ForceSendFields will be sent to the 3695 // server regardless of whether the field is empty or not. This may be 3696 // used to include empty fields in Patch requests. 3697 ForceSendFields []string `json:"-"` 3698 3699 // NullFields is a list of field names (e.g. "Name") to include in API 3700 // requests with the JSON null value. By default, fields with empty 3701 // values are omitted from API requests. However, any field with an 3702 // empty value appearing in NullFields will be sent to the server as 3703 // null. It is an error if a field in this list has a non-empty value. 3704 // This may be used to include null fields in Patch requests. 3705 NullFields []string `json:"-"` 3706} 3707 3708func (s *GoogleCloudDialogflowV2VoiceSelectionParams) MarshalJSON() ([]byte, error) { 3709 type NoMethod GoogleCloudDialogflowV2VoiceSelectionParams 3710 raw := NoMethod(*s) 3711 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3712} 3713 3714// GoogleCloudDialogflowV2WebhookRequest: The request message for a 3715// webhook call. 3716type GoogleCloudDialogflowV2WebhookRequest struct { 3717 // OriginalDetectIntentRequest: Optional. The contents of the original 3718 // request that was passed to 3719 // `[Streaming]DetectIntent` call. 3720 OriginalDetectIntentRequest *GoogleCloudDialogflowV2OriginalDetectIntentRequest `json:"originalDetectIntentRequest,omitempty"` 3721 3722 // QueryResult: The result of the conversational query or event 3723 // processing. Contains the 3724 // same value as `[Streaming]DetectIntentResponse.query_result`. 3725 QueryResult *GoogleCloudDialogflowV2QueryResult `json:"queryResult,omitempty"` 3726 3727 // ResponseId: The unique identifier of the response. Contains the same 3728 // value as 3729 // `[Streaming]DetectIntentResponse.response_id`. 3730 ResponseId string `json:"responseId,omitempty"` 3731 3732 // Session: The unique identifier of detectIntent request session. 3733 // Can be used to identify end-user inside webhook 3734 // implementation. 3735 // Format: `projects/<Project ID>/agent/sessions/<Session ID>`, 3736 // or 3737 // `projects/<Project ID>/agent/environments/<Environment 3738 // ID>/users/<User 3739 // ID>/sessions/<Session ID>`. 3740 Session string `json:"session,omitempty"` 3741 3742 // ForceSendFields is a list of field names (e.g. 3743 // "OriginalDetectIntentRequest") to unconditionally include in API 3744 // requests. By default, fields with empty values are omitted from API 3745 // requests. However, any non-pointer, non-interface field appearing in 3746 // ForceSendFields will be sent to the server regardless of whether the 3747 // field is empty or not. This may be used to include empty fields in 3748 // Patch requests. 3749 ForceSendFields []string `json:"-"` 3750 3751 // NullFields is a list of field names (e.g. 3752 // "OriginalDetectIntentRequest") to include in API requests with the 3753 // JSON null value. By default, fields with empty values are omitted 3754 // from API requests. However, any field with an empty value appearing 3755 // in NullFields will be sent to the server as null. It is an error if a 3756 // field in this list has a non-empty value. This may be used to include 3757 // null fields in Patch requests. 3758 NullFields []string `json:"-"` 3759} 3760 3761func (s *GoogleCloudDialogflowV2WebhookRequest) MarshalJSON() ([]byte, error) { 3762 type NoMethod GoogleCloudDialogflowV2WebhookRequest 3763 raw := NoMethod(*s) 3764 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3765} 3766 3767// GoogleCloudDialogflowV2WebhookResponse: The response message for a 3768// webhook call. 3769type GoogleCloudDialogflowV2WebhookResponse struct { 3770 // FollowupEventInput: Optional. Makes the platform immediately invoke 3771 // another `DetectIntent` call 3772 // internally with the specified event as input. 3773 // When this field is set, Dialogflow ignores the 3774 // `fulfillment_text`, 3775 // `fulfillment_messages`, and `payload` fields. 3776 FollowupEventInput *GoogleCloudDialogflowV2EventInput `json:"followupEventInput,omitempty"` 3777 3778 // FulfillmentMessages: Optional. The collection of rich messages to 3779 // present to the user. This 3780 // value is passed directly to `QueryResult.fulfillment_messages`. 3781 FulfillmentMessages []*GoogleCloudDialogflowV2IntentMessage `json:"fulfillmentMessages,omitempty"` 3782 3783 // FulfillmentText: Optional. The text to be shown on the screen. This 3784 // value is passed directly 3785 // to `QueryResult.fulfillment_text`. 3786 FulfillmentText string `json:"fulfillmentText,omitempty"` 3787 3788 // OutputContexts: Optional. The collection of output contexts. This 3789 // value is passed directly 3790 // to `QueryResult.output_contexts`. 3791 OutputContexts []*GoogleCloudDialogflowV2Context `json:"outputContexts,omitempty"` 3792 3793 // Payload: Optional. This value is passed directly to 3794 // `QueryResult.webhook_payload`. 3795 // See the related `fulfillment_messages[i].payload field`, which may be 3796 // used 3797 // as an alternative to this field. 3798 // 3799 // This field can be used for Actions on Google responses. 3800 // It should have a structure similar to the JSON message shown here. 3801 // For more 3802 // information, see 3803 // [Actions on Google 3804 // Webhook 3805 // Format](https://developers.google.com/actions/dialogflow/webho 3806 // ok) 3807 // <pre>{ 3808 // "google": { 3809 // "expectUserResponse": true, 3810 // "richResponse": { 3811 // "items": [ 3812 // { 3813 // "simpleResponse": { 3814 // "textToSpeech": "this is a simple response" 3815 // } 3816 // } 3817 // ] 3818 // } 3819 // } 3820 // }</pre> 3821 Payload googleapi.RawMessage `json:"payload,omitempty"` 3822 3823 // Source: Optional. This value is passed directly to 3824 // `QueryResult.webhook_source`. 3825 Source string `json:"source,omitempty"` 3826 3827 // ForceSendFields is a list of field names (e.g. "FollowupEventInput") 3828 // to unconditionally include in API requests. By default, fields with 3829 // empty values are omitted from API requests. However, any non-pointer, 3830 // non-interface field appearing in ForceSendFields will be sent to the 3831 // server regardless of whether the field is empty or not. This may be 3832 // used to include empty fields in Patch requests. 3833 ForceSendFields []string `json:"-"` 3834 3835 // NullFields is a list of field names (e.g. "FollowupEventInput") to 3836 // include in API requests with the JSON null value. By default, fields 3837 // with empty values are omitted from API requests. However, any field 3838 // with an empty value appearing in NullFields will be sent to the 3839 // server as null. It is an error if a field in this list has a 3840 // non-empty value. This may be used to include null fields in Patch 3841 // requests. 3842 NullFields []string `json:"-"` 3843} 3844 3845func (s *GoogleCloudDialogflowV2WebhookResponse) MarshalJSON() ([]byte, error) { 3846 type NoMethod GoogleCloudDialogflowV2WebhookResponse 3847 raw := NoMethod(*s) 3848 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3849} 3850 3851// GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesResponse: The 3852// response message for EntityTypes.BatchUpdateEntityTypes. 3853type GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesResponse struct { 3854 // EntityTypes: The collection of updated or created entity types. 3855 EntityTypes []*GoogleCloudDialogflowV2beta1EntityType `json:"entityTypes,omitempty"` 3856 3857 // ForceSendFields is a list of field names (e.g. "EntityTypes") to 3858 // unconditionally include in API requests. By default, fields with 3859 // empty values are omitted from API requests. However, any non-pointer, 3860 // non-interface field appearing in ForceSendFields will be sent to the 3861 // server regardless of whether the field is empty or not. This may be 3862 // used to include empty fields in Patch requests. 3863 ForceSendFields []string `json:"-"` 3864 3865 // NullFields is a list of field names (e.g. "EntityTypes") to include 3866 // in API requests with the JSON null value. By default, fields with 3867 // empty values are omitted from API requests. However, any field with 3868 // an empty value appearing in NullFields will be sent to the server as 3869 // null. It is an error if a field in this list has a non-empty value. 3870 // This may be used to include null fields in Patch requests. 3871 NullFields []string `json:"-"` 3872} 3873 3874func (s *GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesResponse) MarshalJSON() ([]byte, error) { 3875 type NoMethod GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesResponse 3876 raw := NoMethod(*s) 3877 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3878} 3879 3880// GoogleCloudDialogflowV2beta1BatchUpdateIntentsResponse: The response 3881// message for Intents.BatchUpdateIntents. 3882type GoogleCloudDialogflowV2beta1BatchUpdateIntentsResponse struct { 3883 // Intents: The collection of updated or created intents. 3884 Intents []*GoogleCloudDialogflowV2beta1Intent `json:"intents,omitempty"` 3885 3886 // ForceSendFields is a list of field names (e.g. "Intents") to 3887 // unconditionally include in API requests. By default, fields with 3888 // empty values are omitted from API requests. However, any non-pointer, 3889 // non-interface field appearing in ForceSendFields will be sent to the 3890 // server regardless of whether the field is empty or not. This may be 3891 // used to include empty fields in Patch requests. 3892 ForceSendFields []string `json:"-"` 3893 3894 // NullFields is a list of field names (e.g. "Intents") to include in 3895 // API requests with the JSON null value. By default, fields with empty 3896 // values are omitted from API requests. However, any field with an 3897 // empty value appearing in NullFields will be sent to the server as 3898 // null. It is an error if a field in this list has a non-empty value. 3899 // This may be used to include null fields in Patch requests. 3900 NullFields []string `json:"-"` 3901} 3902 3903func (s *GoogleCloudDialogflowV2beta1BatchUpdateIntentsResponse) MarshalJSON() ([]byte, error) { 3904 type NoMethod GoogleCloudDialogflowV2beta1BatchUpdateIntentsResponse 3905 raw := NoMethod(*s) 3906 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3907} 3908 3909// GoogleCloudDialogflowV2beta1Context: Represents a context. 3910type GoogleCloudDialogflowV2beta1Context struct { 3911 // LifespanCount: Optional. The number of conversational query requests 3912 // after which the 3913 // context expires. If set to `0` (the default) the context 3914 // expires 3915 // immediately. Contexts expire automatically after 20 minutes if 3916 // there 3917 // are no matching queries. 3918 LifespanCount int64 `json:"lifespanCount,omitempty"` 3919 3920 // Name: Required. The unique identifier of the context. 3921 // Format: 3922 // `projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context 3923 // ID>`, 3924 // or `projects/<Project ID>/agent/environments/<Environment 3925 // ID>/users/<User 3926 // ID>/sessions/<Session ID>/contexts/<Context ID>`. 3927 // 3928 // The `Context ID` is always converted to lowercase, may only 3929 // contain 3930 // characters in a-zA-Z0-9_-% and may be at most 250 bytes long. 3931 // 3932 // If `Environment ID` is not specified, we assume default 3933 // 'draft' 3934 // environment. If `User ID` is not specified, we assume default '-' 3935 // user. 3936 Name string `json:"name,omitempty"` 3937 3938 // Parameters: Optional. The collection of parameters associated with 3939 // this context. 3940 // Refer to 3941 // [this 3942 // doc](https://cloud.google.com/dialogflow/docs/intents-actions-pa 3943 // rameters) 3944 // for syntax. 3945 Parameters googleapi.RawMessage `json:"parameters,omitempty"` 3946 3947 // ForceSendFields is a list of field names (e.g. "LifespanCount") to 3948 // unconditionally include in API requests. By default, fields with 3949 // empty values are omitted from API requests. However, any non-pointer, 3950 // non-interface field appearing in ForceSendFields will be sent to the 3951 // server regardless of whether the field is empty or not. This may be 3952 // used to include empty fields in Patch requests. 3953 ForceSendFields []string `json:"-"` 3954 3955 // NullFields is a list of field names (e.g. "LifespanCount") to include 3956 // in API requests with the JSON null value. By default, fields with 3957 // empty values are omitted from API requests. However, any field with 3958 // an empty value appearing in NullFields will be sent to the server as 3959 // null. It is an error if a field in this list has a non-empty value. 3960 // This may be used to include null fields in Patch requests. 3961 NullFields []string `json:"-"` 3962} 3963 3964func (s *GoogleCloudDialogflowV2beta1Context) MarshalJSON() ([]byte, error) { 3965 type NoMethod GoogleCloudDialogflowV2beta1Context 3966 raw := NoMethod(*s) 3967 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3968} 3969 3970// GoogleCloudDialogflowV2beta1EntityType: Represents an entity 3971// type. 3972// Entity types serve as a tool for extracting parameter values from 3973// natural 3974// language queries. 3975type GoogleCloudDialogflowV2beta1EntityType struct { 3976 // AutoExpansionMode: Optional. Indicates whether the entity type can be 3977 // automatically 3978 // expanded. 3979 // 3980 // Possible values: 3981 // "AUTO_EXPANSION_MODE_UNSPECIFIED" - Auto expansion disabled for the 3982 // entity. 3983 // "AUTO_EXPANSION_MODE_DEFAULT" - Allows an agent to recognize values 3984 // that have not been explicitly 3985 // listed in the entity. 3986 AutoExpansionMode string `json:"autoExpansionMode,omitempty"` 3987 3988 // DisplayName: Required. The name of the entity type. 3989 DisplayName string `json:"displayName,omitempty"` 3990 3991 // Entities: Optional. The collection of entity entries associated with 3992 // the entity type. 3993 Entities []*GoogleCloudDialogflowV2beta1EntityTypeEntity `json:"entities,omitempty"` 3994 3995 // Kind: Required. Indicates the kind of entity type. 3996 // 3997 // Possible values: 3998 // "KIND_UNSPECIFIED" - Not specified. This value should be never 3999 // used. 4000 // "KIND_MAP" - Map entity types allow mapping of a group of synonyms 4001 // to a canonical 4002 // value. 4003 // "KIND_LIST" - List entity types contain a set of entries that do 4004 // not map to canonical 4005 // values. However, list entity types can contain references to other 4006 // entity 4007 // types (with or without aliases). 4008 Kind string `json:"kind,omitempty"` 4009 4010 // Name: The unique identifier of the entity type. 4011 // Required for EntityTypes.UpdateEntityType 4012 // and 4013 // EntityTypes.BatchUpdateEntityTypes methods. 4014 // Format: `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`. 4015 Name string `json:"name,omitempty"` 4016 4017 // ForceSendFields is a list of field names (e.g. "AutoExpansionMode") 4018 // to unconditionally include in API requests. By default, fields with 4019 // empty values are omitted from API requests. However, any non-pointer, 4020 // non-interface field appearing in ForceSendFields will be sent to the 4021 // server regardless of whether the field is empty or not. This may be 4022 // used to include empty fields in Patch requests. 4023 ForceSendFields []string `json:"-"` 4024 4025 // NullFields is a list of field names (e.g. "AutoExpansionMode") to 4026 // include in API requests with the JSON null value. By default, fields 4027 // with empty values are omitted from API requests. However, any field 4028 // with an empty value appearing in NullFields will be sent to the 4029 // server as null. It is an error if a field in this list has a 4030 // non-empty value. This may be used to include null fields in Patch 4031 // requests. 4032 NullFields []string `json:"-"` 4033} 4034 4035func (s *GoogleCloudDialogflowV2beta1EntityType) MarshalJSON() ([]byte, error) { 4036 type NoMethod GoogleCloudDialogflowV2beta1EntityType 4037 raw := NoMethod(*s) 4038 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4039} 4040 4041// GoogleCloudDialogflowV2beta1EntityTypeEntity: An **entity entry** for 4042// an associated entity type. 4043type GoogleCloudDialogflowV2beta1EntityTypeEntity struct { 4044 // Synonyms: Required. A collection of value synonyms. For example, if 4045 // the entity type 4046 // is *vegetable*, and `value` is *scallions*, a synonym could be 4047 // *green 4048 // onions*. 4049 // 4050 // For `KIND_LIST` entity types: 4051 // 4052 // * This collection must contain exactly one synonym equal to 4053 // `value`. 4054 Synonyms []string `json:"synonyms,omitempty"` 4055 4056 // Value: Required. The primary value associated with this entity 4057 // entry. 4058 // For example, if the entity type is *vegetable*, the value could 4059 // be 4060 // *scallions*. 4061 // 4062 // For `KIND_MAP` entity types: 4063 // 4064 // * A canonical value to be used in place of synonyms. 4065 // 4066 // For `KIND_LIST` entity types: 4067 // 4068 // * A string that can contain references to other entity types (with 4069 // or 4070 // without aliases). 4071 Value string `json:"value,omitempty"` 4072 4073 // ForceSendFields is a list of field names (e.g. "Synonyms") to 4074 // unconditionally include in API requests. By default, fields with 4075 // empty values are omitted from API requests. However, any non-pointer, 4076 // non-interface field appearing in ForceSendFields will be sent to the 4077 // server regardless of whether the field is empty or not. This may be 4078 // used to include empty fields in Patch requests. 4079 ForceSendFields []string `json:"-"` 4080 4081 // NullFields is a list of field names (e.g. "Synonyms") to include in 4082 // API requests with the JSON null value. By default, fields with empty 4083 // values are omitted from API requests. However, any field with an 4084 // empty value appearing in NullFields will be sent to the server as 4085 // null. It is an error if a field in this list has a non-empty value. 4086 // This may be used to include null fields in Patch requests. 4087 NullFields []string `json:"-"` 4088} 4089 4090func (s *GoogleCloudDialogflowV2beta1EntityTypeEntity) MarshalJSON() ([]byte, error) { 4091 type NoMethod GoogleCloudDialogflowV2beta1EntityTypeEntity 4092 raw := NoMethod(*s) 4093 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4094} 4095 4096// GoogleCloudDialogflowV2beta1EventInput: Events allow for matching 4097// intents by event name instead of the natural 4098// language input. For instance, input `<event: { name: 4099// "welcome_event", 4100// parameters: { name: "Sam" } }>` can trigger a personalized welcome 4101// response. 4102// The parameter `name` may be used by the agent in the 4103// response: 4104// "Hello #welcome_event.name! What can I do for you today?". 4105type GoogleCloudDialogflowV2beta1EventInput struct { 4106 // LanguageCode: Required. The language of this query. See 4107 // [Language 4108 // Support](https://cloud.google.com/dialogflow/docs/reference/ 4109 // language) 4110 // for a list of the currently supported language codes. Note that 4111 // queries in 4112 // the same session do not necessarily need to specify the same 4113 // language. 4114 LanguageCode string `json:"languageCode,omitempty"` 4115 4116 // Name: Required. The unique identifier of the event. 4117 Name string `json:"name,omitempty"` 4118 4119 // Parameters: Optional. The collection of parameters associated with 4120 // the event. 4121 Parameters googleapi.RawMessage `json:"parameters,omitempty"` 4122 4123 // ForceSendFields is a list of field names (e.g. "LanguageCode") to 4124 // unconditionally include in API requests. By default, fields with 4125 // empty values are omitted from API requests. However, any non-pointer, 4126 // non-interface field appearing in ForceSendFields will be sent to the 4127 // server regardless of whether the field is empty or not. This may be 4128 // used to include empty fields in Patch requests. 4129 ForceSendFields []string `json:"-"` 4130 4131 // NullFields is a list of field names (e.g. "LanguageCode") to include 4132 // in API requests with the JSON null value. By default, fields with 4133 // empty values are omitted from API requests. However, any field with 4134 // an empty value appearing in NullFields will be sent to the server as 4135 // null. It is an error if a field in this list has a non-empty value. 4136 // This may be used to include null fields in Patch requests. 4137 NullFields []string `json:"-"` 4138} 4139 4140func (s *GoogleCloudDialogflowV2beta1EventInput) MarshalJSON() ([]byte, error) { 4141 type NoMethod GoogleCloudDialogflowV2beta1EventInput 4142 raw := NoMethod(*s) 4143 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4144} 4145 4146// GoogleCloudDialogflowV2beta1ExportAgentResponse: The response message 4147// for Agents.ExportAgent. 4148type GoogleCloudDialogflowV2beta1ExportAgentResponse struct { 4149 // AgentContent: The exported agent. 4150 // 4151 // Example for how to export an agent to a zip file via a command 4152 // line: 4153 // <pre>curl \ 4154 // 4155 // 'https://dialogflow.googleapis.com/v2beta1/projects/<project_name&g 4156 // t;/agent:export'\ 4157 // -X POST \ 4158 // -H 'Authorization: Bearer '$(gcloud auth application-default 4159 // print-access-token) \ 4160 // -H 'Accept: application/json' \ 4161 // -H 'Content-Type: application/json' \ 4162 // --compressed \ 4163 // --data-binary '{}' \ 4164 // | grep agentContent | sed -e 's/.*"agentContent": "\([^"]*\)".*/\1/' 4165 // \ 4166 // | base64 --decode > <agent zip file></pre> 4167 AgentContent string `json:"agentContent,omitempty"` 4168 4169 // AgentUri: The URI to a file containing the exported agent. This field 4170 // is populated 4171 // only if `agent_uri` is specified in `ExportAgentRequest`. 4172 AgentUri string `json:"agentUri,omitempty"` 4173 4174 // ForceSendFields is a list of field names (e.g. "AgentContent") to 4175 // unconditionally include in API requests. By default, fields with 4176 // empty values are omitted from API requests. However, any non-pointer, 4177 // non-interface field appearing in ForceSendFields will be sent to the 4178 // server regardless of whether the field is empty or not. This may be 4179 // used to include empty fields in Patch requests. 4180 ForceSendFields []string `json:"-"` 4181 4182 // NullFields is a list of field names (e.g. "AgentContent") to include 4183 // in API requests with the JSON null value. By default, fields with 4184 // empty values are omitted from API requests. However, any field with 4185 // an empty value appearing in NullFields will be sent to the server as 4186 // null. It is an error if a field in this list has a non-empty value. 4187 // This may be used to include null fields in Patch requests. 4188 NullFields []string `json:"-"` 4189} 4190 4191func (s *GoogleCloudDialogflowV2beta1ExportAgentResponse) MarshalJSON() ([]byte, error) { 4192 type NoMethod GoogleCloudDialogflowV2beta1ExportAgentResponse 4193 raw := NoMethod(*s) 4194 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4195} 4196 4197// GoogleCloudDialogflowV2beta1Intent: Represents an intent. 4198// Intents convert a number of user expressions or patterns into an 4199// action. An 4200// action is an extraction of a user command or sentence semantics. 4201type GoogleCloudDialogflowV2beta1Intent struct { 4202 // Action: Optional. The name of the action associated with the 4203 // intent. 4204 // Note: The action name must not contain whitespaces. 4205 Action string `json:"action,omitempty"` 4206 4207 // DefaultResponsePlatforms: Optional. The list of platforms for which 4208 // the first responses will be 4209 // copied from the messages in PLATFORM_UNSPECIFIED (i.e. default 4210 // platform). 4211 // 4212 // Possible values: 4213 // "PLATFORM_UNSPECIFIED" - Not specified. 4214 // "FACEBOOK" - Facebook. 4215 // "SLACK" - Slack. 4216 // "TELEGRAM" - Telegram. 4217 // "KIK" - Kik. 4218 // "SKYPE" - Skype. 4219 // "LINE" - Line. 4220 // "VIBER" - Viber. 4221 // "ACTIONS_ON_GOOGLE" - Actions on Google. 4222 // When using Actions on Google, you can choose one of the 4223 // specific 4224 // Intent.Message types that mention support for Actions on Google, 4225 // or you can use the advanced Intent.Message.payload field. 4226 // The payload field provides access to AoG features not available in 4227 // the 4228 // specific message types. 4229 // If using the Intent.Message.payload field, it should have a 4230 // structure 4231 // similar to the JSON message shown here. For more information, 4232 // see 4233 // [Actions on Google 4234 // Webhook 4235 // Format](https://developers.google.com/actions/dialogflow/webho 4236 // ok) 4237 // <pre>{ 4238 // "expectUserResponse": true, 4239 // "isSsml": false, 4240 // "noInputPrompts": [], 4241 // "richResponse": { 4242 // "items": [ 4243 // { 4244 // "simpleResponse": { 4245 // "displayText": "hi", 4246 // "textToSpeech": "hello" 4247 // } 4248 // } 4249 // ], 4250 // "suggestions": [ 4251 // { 4252 // "title": "Say this" 4253 // }, 4254 // { 4255 // "title": "or this" 4256 // } 4257 // ] 4258 // }, 4259 // "systemIntent": { 4260 // "data": { 4261 // "@type": 4262 // "type.googleapis.com/google.actions.v2.OptionValueSpec", 4263 // "listSelect": { 4264 // "items": [ 4265 // { 4266 // "optionInfo": { 4267 // "key": "key1", 4268 // "synonyms": [ 4269 // "key one" 4270 // ] 4271 // }, 4272 // "title": "must not be empty, but unique" 4273 // }, 4274 // { 4275 // "optionInfo": { 4276 // "key": "key2", 4277 // "synonyms": [ 4278 // "key two" 4279 // ] 4280 // }, 4281 // "title": "must not be empty, but unique" 4282 // } 4283 // ] 4284 // } 4285 // }, 4286 // "intent": "actions.intent.OPTION" 4287 // } 4288 // }</pre> 4289 // "TELEPHONY" - Telephony Gateway. 4290 // "GOOGLE_HANGOUTS" - Google Hangouts. 4291 DefaultResponsePlatforms []string `json:"defaultResponsePlatforms,omitempty"` 4292 4293 // DisplayName: Required. The name of this intent. 4294 DisplayName string `json:"displayName,omitempty"` 4295 4296 // EndInteraction: Optional. Indicates that this intent ends an 4297 // interaction. Some integrations 4298 // (e.g., Actions on Google or Dialogflow phone gateway) use this 4299 // information 4300 // to close interaction with an end user. Default is false. 4301 EndInteraction bool `json:"endInteraction,omitempty"` 4302 4303 // Events: Optional. The collection of event names that trigger the 4304 // intent. 4305 // If the collection of input contexts is not empty, all of the contexts 4306 // must 4307 // be present in the active user session for an event to trigger this 4308 // intent. 4309 Events []string `json:"events,omitempty"` 4310 4311 // FollowupIntentInfo: Read-only. Information about all followup intents 4312 // that have this intent as 4313 // a direct or indirect parent. We populate this field only in the 4314 // output. 4315 FollowupIntentInfo []*GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo `json:"followupIntentInfo,omitempty"` 4316 4317 // InputContextNames: Optional. The list of context names required for 4318 // this intent to be 4319 // triggered. 4320 // Format: `projects/<Project ID>/agent/sessions/-/contexts/<Context 4321 // ID>`. 4322 InputContextNames []string `json:"inputContextNames,omitempty"` 4323 4324 // IsFallback: Optional. Indicates whether this is a fallback intent. 4325 IsFallback bool `json:"isFallback,omitempty"` 4326 4327 // Messages: Optional. The collection of rich messages corresponding to 4328 // the 4329 // `Response` field in the Dialogflow console. 4330 Messages []*GoogleCloudDialogflowV2beta1IntentMessage `json:"messages,omitempty"` 4331 4332 // MlDisabled: Optional. Indicates whether Machine Learning is disabled 4333 // for the intent. 4334 // Note: If `ml_disabled` setting is set to true, then this intent is 4335 // not 4336 // taken into account during inference in `ML ONLY` match mode. 4337 // Also, 4338 // auto-markup in the UI is turned off. 4339 MlDisabled bool `json:"mlDisabled,omitempty"` 4340 4341 // MlEnabled: Optional. Indicates whether Machine Learning is enabled 4342 // for the intent. 4343 // Note: If `ml_enabled` setting is set to false, then this intent is 4344 // not 4345 // taken into account during inference in `ML ONLY` match mode. 4346 // Also, 4347 // auto-markup in the UI is turned off. 4348 // DEPRECATED! Please use `ml_disabled` field instead. 4349 // NOTE: If both `ml_enabled` and `ml_disabled` are either not set or 4350 // false, 4351 // then the default value is determined as follows: 4352 // - Before April 15th, 2018 the default is: 4353 // ml_enabled = false / ml_disabled = true. 4354 // - After April 15th, 2018 the default is: 4355 // ml_enabled = true / ml_disabled = false. 4356 MlEnabled bool `json:"mlEnabled,omitempty"` 4357 4358 // Name: The unique identifier of this intent. 4359 // Required for Intents.UpdateIntent and 4360 // Intents.BatchUpdateIntents 4361 // methods. 4362 // Format: `projects/<Project ID>/agent/intents/<Intent ID>`. 4363 Name string `json:"name,omitempty"` 4364 4365 // OutputContexts: Optional. The collection of contexts that are 4366 // activated when the intent 4367 // is matched. Context messages in this collection should not set 4368 // the 4369 // parameters field. Setting the `lifespan_count` to 0 will reset the 4370 // context 4371 // when the intent is matched. 4372 // Format: `projects/<Project ID>/agent/sessions/-/contexts/<Context 4373 // ID>`. 4374 OutputContexts []*GoogleCloudDialogflowV2beta1Context `json:"outputContexts,omitempty"` 4375 4376 // Parameters: Optional. The collection of parameters associated with 4377 // the intent. 4378 Parameters []*GoogleCloudDialogflowV2beta1IntentParameter `json:"parameters,omitempty"` 4379 4380 // ParentFollowupIntentName: Read-only after creation. The unique 4381 // identifier of the parent intent in the 4382 // chain of followup intents. You can set this field when creating an 4383 // intent, 4384 // for example with CreateIntent or BatchUpdateIntents, in order to 4385 // make this intent a followup intent. 4386 // 4387 // It identifies the parent followup intent. 4388 // Format: `projects/<Project ID>/agent/intents/<Intent ID>`. 4389 ParentFollowupIntentName string `json:"parentFollowupIntentName,omitempty"` 4390 4391 // Priority: Optional. The priority of this intent. Higher numbers 4392 // represent higher 4393 // priorities. If this is zero or unspecified, we use the 4394 // default 4395 // priority 500000. 4396 // 4397 // Negative numbers mean that the intent is disabled. 4398 Priority int64 `json:"priority,omitempty"` 4399 4400 // ResetContexts: Optional. Indicates whether to delete all contexts in 4401 // the current 4402 // session when this intent is matched. 4403 ResetContexts bool `json:"resetContexts,omitempty"` 4404 4405 // RootFollowupIntentName: Read-only. The unique identifier of the root 4406 // intent in the chain of 4407 // followup intents. It identifies the correct followup intents chain 4408 // for 4409 // this intent. We populate this field only in the output. 4410 // 4411 // Format: `projects/<Project ID>/agent/intents/<Intent ID>`. 4412 RootFollowupIntentName string `json:"rootFollowupIntentName,omitempty"` 4413 4414 // TrainingPhrases: Optional. The collection of examples that the agent 4415 // is 4416 // trained on. 4417 TrainingPhrases []*GoogleCloudDialogflowV2beta1IntentTrainingPhrase `json:"trainingPhrases,omitempty"` 4418 4419 // WebhookState: Optional. Indicates whether webhooks are enabled for 4420 // the intent. 4421 // 4422 // Possible values: 4423 // "WEBHOOK_STATE_UNSPECIFIED" - Webhook is disabled in the agent and 4424 // in the intent. 4425 // "WEBHOOK_STATE_ENABLED" - Webhook is enabled in the agent and in 4426 // the intent. 4427 // "WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING" - Webhook is enabled in 4428 // the agent and in the intent. Also, each slot 4429 // filling prompt is forwarded to the webhook. 4430 WebhookState string `json:"webhookState,omitempty"` 4431 4432 // ForceSendFields is a list of field names (e.g. "Action") to 4433 // unconditionally include in API requests. By default, fields with 4434 // empty values are omitted from API requests. However, any non-pointer, 4435 // non-interface field appearing in ForceSendFields will be sent to the 4436 // server regardless of whether the field is empty or not. This may be 4437 // used to include empty fields in Patch requests. 4438 ForceSendFields []string `json:"-"` 4439 4440 // NullFields is a list of field names (e.g. "Action") to include in API 4441 // requests with the JSON null value. By default, fields with empty 4442 // values are omitted from API requests. However, any field with an 4443 // empty value appearing in NullFields will be sent to the server as 4444 // null. It is an error if a field in this list has a non-empty value. 4445 // This may be used to include null fields in Patch requests. 4446 NullFields []string `json:"-"` 4447} 4448 4449func (s *GoogleCloudDialogflowV2beta1Intent) MarshalJSON() ([]byte, error) { 4450 type NoMethod GoogleCloudDialogflowV2beta1Intent 4451 raw := NoMethod(*s) 4452 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4453} 4454 4455// GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo: Represents a 4456// single followup intent in the chain. 4457type GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo struct { 4458 // FollowupIntentName: The unique identifier of the followup 4459 // intent. 4460 // Format: `projects/<Project ID>/agent/intents/<Intent ID>`. 4461 FollowupIntentName string `json:"followupIntentName,omitempty"` 4462 4463 // ParentFollowupIntentName: The unique identifier of the followup 4464 // intent's parent. 4465 // Format: `projects/<Project ID>/agent/intents/<Intent ID>`. 4466 ParentFollowupIntentName string `json:"parentFollowupIntentName,omitempty"` 4467 4468 // ForceSendFields is a list of field names (e.g. "FollowupIntentName") 4469 // to unconditionally include in API requests. By default, fields with 4470 // empty values are omitted from API requests. However, any non-pointer, 4471 // non-interface field appearing in ForceSendFields will be sent to the 4472 // server regardless of whether the field is empty or not. This may be 4473 // used to include empty fields in Patch requests. 4474 ForceSendFields []string `json:"-"` 4475 4476 // NullFields is a list of field names (e.g. "FollowupIntentName") to 4477 // include in API requests with the JSON null value. By default, fields 4478 // with empty values are omitted from API requests. However, any field 4479 // with an empty value appearing in NullFields will be sent to the 4480 // server as null. It is an error if a field in this list has a 4481 // non-empty value. This may be used to include null fields in Patch 4482 // requests. 4483 NullFields []string `json:"-"` 4484} 4485 4486func (s *GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo) MarshalJSON() ([]byte, error) { 4487 type NoMethod GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo 4488 raw := NoMethod(*s) 4489 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4490} 4491 4492// GoogleCloudDialogflowV2beta1IntentMessage: Corresponds to the 4493// `Response` field in the Dialogflow console. 4494type GoogleCloudDialogflowV2beta1IntentMessage struct { 4495 // BasicCard: Displays a basic card for Actions on Google. 4496 BasicCard *GoogleCloudDialogflowV2beta1IntentMessageBasicCard `json:"basicCard,omitempty"` 4497 4498 // Card: Displays a card. 4499 Card *GoogleCloudDialogflowV2beta1IntentMessageCard `json:"card,omitempty"` 4500 4501 // CarouselSelect: Displays a carousel card for Actions on Google. 4502 CarouselSelect *GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect `json:"carouselSelect,omitempty"` 4503 4504 // Image: Displays an image. 4505 Image *GoogleCloudDialogflowV2beta1IntentMessageImage `json:"image,omitempty"` 4506 4507 // LinkOutSuggestion: Displays a link out suggestion chip for Actions on 4508 // Google. 4509 LinkOutSuggestion *GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion `json:"linkOutSuggestion,omitempty"` 4510 4511 // ListSelect: Displays a list card for Actions on Google. 4512 ListSelect *GoogleCloudDialogflowV2beta1IntentMessageListSelect `json:"listSelect,omitempty"` 4513 4514 // Payload: Returns a response containing a custom, platform-specific 4515 // payload. 4516 // See the Intent.Message.Platform type for a description of 4517 // the 4518 // structure that may be required for your platform. 4519 Payload googleapi.RawMessage `json:"payload,omitempty"` 4520 4521 // Platform: Optional. The platform that this message is intended for. 4522 // 4523 // Possible values: 4524 // "PLATFORM_UNSPECIFIED" - Not specified. 4525 // "FACEBOOK" - Facebook. 4526 // "SLACK" - Slack. 4527 // "TELEGRAM" - Telegram. 4528 // "KIK" - Kik. 4529 // "SKYPE" - Skype. 4530 // "LINE" - Line. 4531 // "VIBER" - Viber. 4532 // "ACTIONS_ON_GOOGLE" - Actions on Google. 4533 // When using Actions on Google, you can choose one of the 4534 // specific 4535 // Intent.Message types that mention support for Actions on Google, 4536 // or you can use the advanced Intent.Message.payload field. 4537 // The payload field provides access to AoG features not available in 4538 // the 4539 // specific message types. 4540 // If using the Intent.Message.payload field, it should have a 4541 // structure 4542 // similar to the JSON message shown here. For more information, 4543 // see 4544 // [Actions on Google 4545 // Webhook 4546 // Format](https://developers.google.com/actions/dialogflow/webho 4547 // ok) 4548 // <pre>{ 4549 // "expectUserResponse": true, 4550 // "isSsml": false, 4551 // "noInputPrompts": [], 4552 // "richResponse": { 4553 // "items": [ 4554 // { 4555 // "simpleResponse": { 4556 // "displayText": "hi", 4557 // "textToSpeech": "hello" 4558 // } 4559 // } 4560 // ], 4561 // "suggestions": [ 4562 // { 4563 // "title": "Say this" 4564 // }, 4565 // { 4566 // "title": "or this" 4567 // } 4568 // ] 4569 // }, 4570 // "systemIntent": { 4571 // "data": { 4572 // "@type": 4573 // "type.googleapis.com/google.actions.v2.OptionValueSpec", 4574 // "listSelect": { 4575 // "items": [ 4576 // { 4577 // "optionInfo": { 4578 // "key": "key1", 4579 // "synonyms": [ 4580 // "key one" 4581 // ] 4582 // }, 4583 // "title": "must not be empty, but unique" 4584 // }, 4585 // { 4586 // "optionInfo": { 4587 // "key": "key2", 4588 // "synonyms": [ 4589 // "key two" 4590 // ] 4591 // }, 4592 // "title": "must not be empty, but unique" 4593 // } 4594 // ] 4595 // } 4596 // }, 4597 // "intent": "actions.intent.OPTION" 4598 // } 4599 // }</pre> 4600 // "TELEPHONY" - Telephony Gateway. 4601 // "GOOGLE_HANGOUTS" - Google Hangouts. 4602 Platform string `json:"platform,omitempty"` 4603 4604 // QuickReplies: Displays quick replies. 4605 QuickReplies *GoogleCloudDialogflowV2beta1IntentMessageQuickReplies `json:"quickReplies,omitempty"` 4606 4607 // SimpleResponses: Returns a voice or text-only response for Actions on 4608 // Google. 4609 SimpleResponses *GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses `json:"simpleResponses,omitempty"` 4610 4611 // Suggestions: Displays suggestion chips for Actions on Google. 4612 Suggestions *GoogleCloudDialogflowV2beta1IntentMessageSuggestions `json:"suggestions,omitempty"` 4613 4614 // TelephonyPlayAudio: Plays audio from a file in Telephony Gateway. 4615 TelephonyPlayAudio *GoogleCloudDialogflowV2beta1IntentMessageTelephonyPlayAudio `json:"telephonyPlayAudio,omitempty"` 4616 4617 // TelephonySynthesizeSpeech: Synthesizes speech in Telephony Gateway. 4618 TelephonySynthesizeSpeech *GoogleCloudDialogflowV2beta1IntentMessageTelephonySynthesizeSpeech `json:"telephonySynthesizeSpeech,omitempty"` 4619 4620 // TelephonyTransferCall: Transfers the call in Telephony Gateway. 4621 TelephonyTransferCall *GoogleCloudDialogflowV2beta1IntentMessageTelephonyTransferCall `json:"telephonyTransferCall,omitempty"` 4622 4623 // Text: Returns a text response. 4624 Text *GoogleCloudDialogflowV2beta1IntentMessageText `json:"text,omitempty"` 4625 4626 // ForceSendFields is a list of field names (e.g. "BasicCard") to 4627 // unconditionally include in API requests. By default, fields with 4628 // empty values are omitted from API requests. However, any non-pointer, 4629 // non-interface field appearing in ForceSendFields will be sent to the 4630 // server regardless of whether the field is empty or not. This may be 4631 // used to include empty fields in Patch requests. 4632 ForceSendFields []string `json:"-"` 4633 4634 // NullFields is a list of field names (e.g. "BasicCard") to include in 4635 // API requests with the JSON null value. By default, fields with empty 4636 // values are omitted from API requests. However, any field with an 4637 // empty value appearing in NullFields will be sent to the server as 4638 // null. It is an error if a field in this list has a non-empty value. 4639 // This may be used to include null fields in Patch requests. 4640 NullFields []string `json:"-"` 4641} 4642 4643func (s *GoogleCloudDialogflowV2beta1IntentMessage) MarshalJSON() ([]byte, error) { 4644 type NoMethod GoogleCloudDialogflowV2beta1IntentMessage 4645 raw := NoMethod(*s) 4646 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4647} 4648 4649// GoogleCloudDialogflowV2beta1IntentMessageBasicCard: The basic card 4650// message. Useful for displaying information. 4651type GoogleCloudDialogflowV2beta1IntentMessageBasicCard struct { 4652 // Buttons: Optional. The collection of card buttons. 4653 Buttons []*GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton `json:"buttons,omitempty"` 4654 4655 // FormattedText: Required, unless image is present. The body text of 4656 // the card. 4657 FormattedText string `json:"formattedText,omitempty"` 4658 4659 // Image: Optional. The image for the card. 4660 Image *GoogleCloudDialogflowV2beta1IntentMessageImage `json:"image,omitempty"` 4661 4662 // Subtitle: Optional. The subtitle of the card. 4663 Subtitle string `json:"subtitle,omitempty"` 4664 4665 // Title: Optional. The title of the card. 4666 Title string `json:"title,omitempty"` 4667 4668 // ForceSendFields is a list of field names (e.g. "Buttons") to 4669 // unconditionally include in API requests. By default, fields with 4670 // empty values are omitted from API requests. However, any non-pointer, 4671 // non-interface field appearing in ForceSendFields will be sent to the 4672 // server regardless of whether the field is empty or not. This may be 4673 // used to include empty fields in Patch requests. 4674 ForceSendFields []string `json:"-"` 4675 4676 // NullFields is a list of field names (e.g. "Buttons") to include in 4677 // API requests with the JSON null value. By default, fields with empty 4678 // values are omitted from API requests. However, any field with an 4679 // empty value appearing in NullFields will be sent to the server as 4680 // null. It is an error if a field in this list has a non-empty value. 4681 // This may be used to include null fields in Patch requests. 4682 NullFields []string `json:"-"` 4683} 4684 4685func (s *GoogleCloudDialogflowV2beta1IntentMessageBasicCard) MarshalJSON() ([]byte, error) { 4686 type NoMethod GoogleCloudDialogflowV2beta1IntentMessageBasicCard 4687 raw := NoMethod(*s) 4688 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4689} 4690 4691// GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton: The button 4692// object that appears at the bottom of a card. 4693type GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton struct { 4694 // OpenUriAction: Required. Action to take when a user taps on the 4695 // button. 4696 OpenUriAction *GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction `json:"openUriAction,omitempty"` 4697 4698 // Title: Required. The title of the button. 4699 Title string `json:"title,omitempty"` 4700 4701 // ForceSendFields is a list of field names (e.g. "OpenUriAction") to 4702 // unconditionally include in API requests. By default, fields with 4703 // empty values are omitted from API requests. However, any non-pointer, 4704 // non-interface field appearing in ForceSendFields will be sent to the 4705 // server regardless of whether the field is empty or not. This may be 4706 // used to include empty fields in Patch requests. 4707 ForceSendFields []string `json:"-"` 4708 4709 // NullFields is a list of field names (e.g. "OpenUriAction") to include 4710 // in API requests with the JSON null value. By default, fields with 4711 // empty values are omitted from API requests. However, any field with 4712 // an empty value appearing in NullFields will be sent to the server as 4713 // null. It is an error if a field in this list has a non-empty value. 4714 // This may be used to include null fields in Patch requests. 4715 NullFields []string `json:"-"` 4716} 4717 4718func (s *GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton) MarshalJSON() ([]byte, error) { 4719 type NoMethod GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton 4720 raw := NoMethod(*s) 4721 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4722} 4723 4724// GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction: 4725// Opens the given URI. 4726type GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction struct { 4727 // Uri: Required. The HTTP or HTTPS scheme URI. 4728 Uri string `json:"uri,omitempty"` 4729 4730 // ForceSendFields is a list of field names (e.g. "Uri") to 4731 // unconditionally include in API requests. By default, fields with 4732 // empty values are omitted from API requests. However, any non-pointer, 4733 // non-interface field appearing in ForceSendFields will be sent to the 4734 // server regardless of whether the field is empty or not. This may be 4735 // used to include empty fields in Patch requests. 4736 ForceSendFields []string `json:"-"` 4737 4738 // NullFields is a list of field names (e.g. "Uri") to include in API 4739 // requests with the JSON null value. By default, fields with empty 4740 // values are omitted from API requests. However, any field with an 4741 // empty value appearing in NullFields will be sent to the server as 4742 // null. It is an error if a field in this list has a non-empty value. 4743 // This may be used to include null fields in Patch requests. 4744 NullFields []string `json:"-"` 4745} 4746 4747func (s *GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction) MarshalJSON() ([]byte, error) { 4748 type NoMethod GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction 4749 raw := NoMethod(*s) 4750 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4751} 4752 4753// GoogleCloudDialogflowV2beta1IntentMessageCard: The card response 4754// message. 4755type GoogleCloudDialogflowV2beta1IntentMessageCard struct { 4756 // Buttons: Optional. The collection of card buttons. 4757 Buttons []*GoogleCloudDialogflowV2beta1IntentMessageCardButton `json:"buttons,omitempty"` 4758 4759 // ImageUri: Optional. The public URI to an image file for the card. 4760 ImageUri string `json:"imageUri,omitempty"` 4761 4762 // Subtitle: Optional. The subtitle of the card. 4763 Subtitle string `json:"subtitle,omitempty"` 4764 4765 // Title: Optional. The title of the card. 4766 Title string `json:"title,omitempty"` 4767 4768 // ForceSendFields is a list of field names (e.g. "Buttons") to 4769 // unconditionally include in API requests. By default, fields with 4770 // empty values are omitted from API requests. However, any non-pointer, 4771 // non-interface field appearing in ForceSendFields will be sent to the 4772 // server regardless of whether the field is empty or not. This may be 4773 // used to include empty fields in Patch requests. 4774 ForceSendFields []string `json:"-"` 4775 4776 // NullFields is a list of field names (e.g. "Buttons") to include in 4777 // API requests with the JSON null value. By default, fields with empty 4778 // values are omitted from API requests. However, any field with an 4779 // empty value appearing in NullFields will be sent to the server as 4780 // null. It is an error if a field in this list has a non-empty value. 4781 // This may be used to include null fields in Patch requests. 4782 NullFields []string `json:"-"` 4783} 4784 4785func (s *GoogleCloudDialogflowV2beta1IntentMessageCard) MarshalJSON() ([]byte, error) { 4786 type NoMethod GoogleCloudDialogflowV2beta1IntentMessageCard 4787 raw := NoMethod(*s) 4788 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4789} 4790 4791// GoogleCloudDialogflowV2beta1IntentMessageCardButton: Optional. 4792// Contains information about a button. 4793type GoogleCloudDialogflowV2beta1IntentMessageCardButton struct { 4794 // Postback: Optional. The text to send back to the Dialogflow API or a 4795 // URI to 4796 // open. 4797 Postback string `json:"postback,omitempty"` 4798 4799 // Text: Optional. The text to show on the button. 4800 Text string `json:"text,omitempty"` 4801 4802 // ForceSendFields is a list of field names (e.g. "Postback") to 4803 // unconditionally include in API requests. By default, fields with 4804 // empty values are omitted from API requests. However, any non-pointer, 4805 // non-interface field appearing in ForceSendFields will be sent to the 4806 // server regardless of whether the field is empty or not. This may be 4807 // used to include empty fields in Patch requests. 4808 ForceSendFields []string `json:"-"` 4809 4810 // NullFields is a list of field names (e.g. "Postback") to include in 4811 // API requests with the JSON null value. By default, fields with empty 4812 // values are omitted from API requests. However, any field with an 4813 // empty value appearing in NullFields will be sent to the server as 4814 // null. It is an error if a field in this list has a non-empty value. 4815 // This may be used to include null fields in Patch requests. 4816 NullFields []string `json:"-"` 4817} 4818 4819func (s *GoogleCloudDialogflowV2beta1IntentMessageCardButton) MarshalJSON() ([]byte, error) { 4820 type NoMethod GoogleCloudDialogflowV2beta1IntentMessageCardButton 4821 raw := NoMethod(*s) 4822 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4823} 4824 4825// GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect: The card for 4826// presenting a carousel of options to select from. 4827type GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect struct { 4828 // Items: Required. Carousel items. 4829 Items []*GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem `json:"items,omitempty"` 4830 4831 // ForceSendFields is a list of field names (e.g. "Items") to 4832 // unconditionally include in API requests. By default, fields with 4833 // empty values are omitted from API requests. However, any non-pointer, 4834 // non-interface field appearing in ForceSendFields will be sent to the 4835 // server regardless of whether the field is empty or not. This may be 4836 // used to include empty fields in Patch requests. 4837 ForceSendFields []string `json:"-"` 4838 4839 // NullFields is a list of field names (e.g. "Items") to include in API 4840 // requests with the JSON null value. By default, fields with empty 4841 // values are omitted from API requests. However, any field with an 4842 // empty value appearing in NullFields will be sent to the server as 4843 // null. It is an error if a field in this list has a non-empty value. 4844 // This may be used to include null fields in Patch requests. 4845 NullFields []string `json:"-"` 4846} 4847 4848func (s *GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect) MarshalJSON() ([]byte, error) { 4849 type NoMethod GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect 4850 raw := NoMethod(*s) 4851 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4852} 4853 4854// GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem: An item 4855// in the carousel. 4856type GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem struct { 4857 // Description: Optional. The body text of the card. 4858 Description string `json:"description,omitempty"` 4859 4860 // Image: Optional. The image to display. 4861 Image *GoogleCloudDialogflowV2beta1IntentMessageImage `json:"image,omitempty"` 4862 4863 // Info: Required. Additional info about the option item. 4864 Info *GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo `json:"info,omitempty"` 4865 4866 // Title: Required. Title of the carousel item. 4867 Title string `json:"title,omitempty"` 4868 4869 // ForceSendFields is a list of field names (e.g. "Description") to 4870 // unconditionally include in API requests. By default, fields with 4871 // empty values are omitted from API requests. However, any non-pointer, 4872 // non-interface field appearing in ForceSendFields will be sent to the 4873 // server regardless of whether the field is empty or not. This may be 4874 // used to include empty fields in Patch requests. 4875 ForceSendFields []string `json:"-"` 4876 4877 // NullFields is a list of field names (e.g. "Description") to include 4878 // in API requests with the JSON null value. By default, fields with 4879 // empty values are omitted from API requests. However, any field with 4880 // an empty value appearing in NullFields will be sent to the server as 4881 // null. It is an error if a field in this list has a non-empty value. 4882 // This may be used to include null fields in Patch requests. 4883 NullFields []string `json:"-"` 4884} 4885 4886func (s *GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem) MarshalJSON() ([]byte, error) { 4887 type NoMethod GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem 4888 raw := NoMethod(*s) 4889 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4890} 4891 4892// GoogleCloudDialogflowV2beta1IntentMessageImage: The image response 4893// message. 4894type GoogleCloudDialogflowV2beta1IntentMessageImage struct { 4895 // AccessibilityText: A text description of the image to be used for 4896 // accessibility, 4897 // e.g., screen readers. Required if image_uri is set for 4898 // CarouselSelect. 4899 AccessibilityText string `json:"accessibilityText,omitempty"` 4900 4901 // ImageUri: Optional. The public URI to an image file. 4902 ImageUri string `json:"imageUri,omitempty"` 4903 4904 // ForceSendFields is a list of field names (e.g. "AccessibilityText") 4905 // to unconditionally include in API requests. By default, fields with 4906 // empty values are omitted from API requests. However, any non-pointer, 4907 // non-interface field appearing in ForceSendFields will be sent to the 4908 // server regardless of whether the field is empty or not. This may be 4909 // used to include empty fields in Patch requests. 4910 ForceSendFields []string `json:"-"` 4911 4912 // NullFields is a list of field names (e.g. "AccessibilityText") to 4913 // include in API requests with the JSON null value. By default, fields 4914 // with empty values are omitted from API requests. However, any field 4915 // with an empty value appearing in NullFields will be sent to the 4916 // server as null. It is an error if a field in this list has a 4917 // non-empty value. This may be used to include null fields in Patch 4918 // requests. 4919 NullFields []string `json:"-"` 4920} 4921 4922func (s *GoogleCloudDialogflowV2beta1IntentMessageImage) MarshalJSON() ([]byte, error) { 4923 type NoMethod GoogleCloudDialogflowV2beta1IntentMessageImage 4924 raw := NoMethod(*s) 4925 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4926} 4927 4928// GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion: The 4929// suggestion chip message that allows the user to jump out to the 4930// app 4931// or website associated with this agent. 4932type GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion struct { 4933 // DestinationName: Required. The name of the app or site this chip is 4934 // linking to. 4935 DestinationName string `json:"destinationName,omitempty"` 4936 4937 // Uri: Required. The URI of the app or site to open when the user taps 4938 // the 4939 // suggestion chip. 4940 Uri string `json:"uri,omitempty"` 4941 4942 // ForceSendFields is a list of field names (e.g. "DestinationName") to 4943 // unconditionally include in API requests. By default, fields with 4944 // empty values are omitted from API requests. However, any non-pointer, 4945 // non-interface field appearing in ForceSendFields will be sent to the 4946 // server regardless of whether the field is empty or not. This may be 4947 // used to include empty fields in Patch requests. 4948 ForceSendFields []string `json:"-"` 4949 4950 // NullFields is a list of field names (e.g. "DestinationName") to 4951 // include in API requests with the JSON null value. By default, fields 4952 // with empty values are omitted from API requests. However, any field 4953 // with an empty value appearing in NullFields will be sent to the 4954 // server as null. It is an error if a field in this list has a 4955 // non-empty value. This may be used to include null fields in Patch 4956 // requests. 4957 NullFields []string `json:"-"` 4958} 4959 4960func (s *GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion) MarshalJSON() ([]byte, error) { 4961 type NoMethod GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion 4962 raw := NoMethod(*s) 4963 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4964} 4965 4966// GoogleCloudDialogflowV2beta1IntentMessageListSelect: The card for 4967// presenting a list of options to select from. 4968type GoogleCloudDialogflowV2beta1IntentMessageListSelect struct { 4969 // Items: Required. List items. 4970 Items []*GoogleCloudDialogflowV2beta1IntentMessageListSelectItem `json:"items,omitempty"` 4971 4972 // Title: Optional. The overall title of the list. 4973 Title string `json:"title,omitempty"` 4974 4975 // ForceSendFields is a list of field names (e.g. "Items") to 4976 // unconditionally include in API requests. By default, fields with 4977 // empty values are omitted from API requests. However, any non-pointer, 4978 // non-interface field appearing in ForceSendFields will be sent to the 4979 // server regardless of whether the field is empty or not. This may be 4980 // used to include empty fields in Patch requests. 4981 ForceSendFields []string `json:"-"` 4982 4983 // NullFields is a list of field names (e.g. "Items") to include in API 4984 // requests with the JSON null value. By default, fields with empty 4985 // values are omitted from API requests. However, any field with an 4986 // empty value appearing in NullFields will be sent to the server as 4987 // null. It is an error if a field in this list has a non-empty value. 4988 // This may be used to include null fields in Patch requests. 4989 NullFields []string `json:"-"` 4990} 4991 4992func (s *GoogleCloudDialogflowV2beta1IntentMessageListSelect) MarshalJSON() ([]byte, error) { 4993 type NoMethod GoogleCloudDialogflowV2beta1IntentMessageListSelect 4994 raw := NoMethod(*s) 4995 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4996} 4997 4998// GoogleCloudDialogflowV2beta1IntentMessageListSelectItem: An item in 4999// the list. 5000type GoogleCloudDialogflowV2beta1IntentMessageListSelectItem struct { 5001 // Description: Optional. The main text describing the item. 5002 Description string `json:"description,omitempty"` 5003 5004 // Image: Optional. The image to display. 5005 Image *GoogleCloudDialogflowV2beta1IntentMessageImage `json:"image,omitempty"` 5006 5007 // Info: Required. Additional information about this option. 5008 Info *GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo `json:"info,omitempty"` 5009 5010 // Title: Required. The title of the list item. 5011 Title string `json:"title,omitempty"` 5012 5013 // ForceSendFields is a list of field names (e.g. "Description") to 5014 // unconditionally include in API requests. By default, fields with 5015 // empty values are omitted from API requests. However, any non-pointer, 5016 // non-interface field appearing in ForceSendFields will be sent to the 5017 // server regardless of whether the field is empty or not. This may be 5018 // used to include empty fields in Patch requests. 5019 ForceSendFields []string `json:"-"` 5020 5021 // NullFields is a list of field names (e.g. "Description") to include 5022 // in API requests with the JSON null value. By default, fields with 5023 // empty values are omitted from API requests. However, any field with 5024 // an empty value appearing in NullFields will be sent to the server as 5025 // null. It is an error if a field in this list has a non-empty value. 5026 // This may be used to include null fields in Patch requests. 5027 NullFields []string `json:"-"` 5028} 5029 5030func (s *GoogleCloudDialogflowV2beta1IntentMessageListSelectItem) MarshalJSON() ([]byte, error) { 5031 type NoMethod GoogleCloudDialogflowV2beta1IntentMessageListSelectItem 5032 raw := NoMethod(*s) 5033 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5034} 5035 5036// GoogleCloudDialogflowV2beta1IntentMessageQuickReplies: The quick 5037// replies response message. 5038type GoogleCloudDialogflowV2beta1IntentMessageQuickReplies struct { 5039 // QuickReplies: Optional. The collection of quick replies. 5040 QuickReplies []string `json:"quickReplies,omitempty"` 5041 5042 // Title: Optional. The title of the collection of quick replies. 5043 Title string `json:"title,omitempty"` 5044 5045 // ForceSendFields is a list of field names (e.g. "QuickReplies") to 5046 // unconditionally include in API requests. By default, fields with 5047 // empty values are omitted from API requests. However, any non-pointer, 5048 // non-interface field appearing in ForceSendFields will be sent to the 5049 // server regardless of whether the field is empty or not. This may be 5050 // used to include empty fields in Patch requests. 5051 ForceSendFields []string `json:"-"` 5052 5053 // NullFields is a list of field names (e.g. "QuickReplies") to include 5054 // in API requests with the JSON null value. By default, fields with 5055 // empty values are omitted from API requests. However, any field with 5056 // an empty value appearing in NullFields will be sent to the server as 5057 // null. It is an error if a field in this list has a non-empty value. 5058 // This may be used to include null fields in Patch requests. 5059 NullFields []string `json:"-"` 5060} 5061 5062func (s *GoogleCloudDialogflowV2beta1IntentMessageQuickReplies) MarshalJSON() ([]byte, error) { 5063 type NoMethod GoogleCloudDialogflowV2beta1IntentMessageQuickReplies 5064 raw := NoMethod(*s) 5065 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5066} 5067 5068// GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo: Additional 5069// info about the select item for when it is triggered in a 5070// dialog. 5071type GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo struct { 5072 // Key: Required. A unique key that will be sent back to the agent if 5073 // this 5074 // response is given. 5075 Key string `json:"key,omitempty"` 5076 5077 // Synonyms: Optional. A list of synonyms that can also be used to 5078 // trigger this 5079 // item in dialog. 5080 Synonyms []string `json:"synonyms,omitempty"` 5081 5082 // ForceSendFields is a list of field names (e.g. "Key") to 5083 // unconditionally include in API requests. By default, fields with 5084 // empty values are omitted from API requests. However, any non-pointer, 5085 // non-interface field appearing in ForceSendFields will be sent to the 5086 // server regardless of whether the field is empty or not. This may be 5087 // used to include empty fields in Patch requests. 5088 ForceSendFields []string `json:"-"` 5089 5090 // NullFields is a list of field names (e.g. "Key") to include in API 5091 // requests with the JSON null value. By default, fields with empty 5092 // values are omitted from API requests. However, any field with an 5093 // empty value appearing in NullFields will be sent to the server as 5094 // null. It is an error if a field in this list has a non-empty value. 5095 // This may be used to include null fields in Patch requests. 5096 NullFields []string `json:"-"` 5097} 5098 5099func (s *GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo) MarshalJSON() ([]byte, error) { 5100 type NoMethod GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo 5101 raw := NoMethod(*s) 5102 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5103} 5104 5105// GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse: The simple 5106// response message containing speech or text. 5107type GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse struct { 5108 // DisplayText: Optional. The text to display. 5109 DisplayText string `json:"displayText,omitempty"` 5110 5111 // Ssml: One of text_to_speech or ssml must be provided. Structured 5112 // spoken 5113 // response to the user in the SSML format. Mutually exclusive 5114 // with 5115 // text_to_speech. 5116 Ssml string `json:"ssml,omitempty"` 5117 5118 // TextToSpeech: One of text_to_speech or ssml must be provided. The 5119 // plain text of the 5120 // speech output. Mutually exclusive with ssml. 5121 TextToSpeech string `json:"textToSpeech,omitempty"` 5122 5123 // ForceSendFields is a list of field names (e.g. "DisplayText") to 5124 // unconditionally include in API requests. By default, fields with 5125 // empty values are omitted from API requests. However, any non-pointer, 5126 // non-interface field appearing in ForceSendFields will be sent to the 5127 // server regardless of whether the field is empty or not. This may be 5128 // used to include empty fields in Patch requests. 5129 ForceSendFields []string `json:"-"` 5130 5131 // NullFields is a list of field names (e.g. "DisplayText") to include 5132 // in API requests with the JSON null value. By default, fields with 5133 // empty values are omitted from API requests. However, any field with 5134 // an empty value appearing in NullFields will be sent to the server as 5135 // null. It is an error if a field in this list has a non-empty value. 5136 // This may be used to include null fields in Patch requests. 5137 NullFields []string `json:"-"` 5138} 5139 5140func (s *GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse) MarshalJSON() ([]byte, error) { 5141 type NoMethod GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse 5142 raw := NoMethod(*s) 5143 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5144} 5145 5146// GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses: The 5147// collection of simple response candidates. 5148// This message in `QueryResult.fulfillment_messages` 5149// and 5150// `WebhookResponse.fulfillment_messages` should contain only 5151// one 5152// `SimpleResponse`. 5153type GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses struct { 5154 // SimpleResponses: Required. The list of simple responses. 5155 SimpleResponses []*GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse `json:"simpleResponses,omitempty"` 5156 5157 // ForceSendFields is a list of field names (e.g. "SimpleResponses") to 5158 // unconditionally include in API requests. By default, fields with 5159 // empty values are omitted from API requests. However, any non-pointer, 5160 // non-interface field appearing in ForceSendFields will be sent to the 5161 // server regardless of whether the field is empty or not. This may be 5162 // used to include empty fields in Patch requests. 5163 ForceSendFields []string `json:"-"` 5164 5165 // NullFields is a list of field names (e.g. "SimpleResponses") to 5166 // include in API requests with the JSON null value. By default, fields 5167 // with empty values are omitted from API requests. However, any field 5168 // with an empty value appearing in NullFields will be sent to the 5169 // server as null. It is an error if a field in this list has a 5170 // non-empty value. This may be used to include null fields in Patch 5171 // requests. 5172 NullFields []string `json:"-"` 5173} 5174 5175func (s *GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses) MarshalJSON() ([]byte, error) { 5176 type NoMethod GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses 5177 raw := NoMethod(*s) 5178 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5179} 5180 5181// GoogleCloudDialogflowV2beta1IntentMessageSuggestion: The suggestion 5182// chip message that the user can tap to quickly post a reply 5183// to the conversation. 5184type GoogleCloudDialogflowV2beta1IntentMessageSuggestion struct { 5185 // Title: Required. The text shown the in the suggestion chip. 5186 Title string `json:"title,omitempty"` 5187 5188 // ForceSendFields is a list of field names (e.g. "Title") to 5189 // unconditionally include in API requests. By default, fields with 5190 // empty values are omitted from API requests. However, any non-pointer, 5191 // non-interface field appearing in ForceSendFields will be sent to the 5192 // server regardless of whether the field is empty or not. This may be 5193 // used to include empty fields in Patch requests. 5194 ForceSendFields []string `json:"-"` 5195 5196 // NullFields is a list of field names (e.g. "Title") to include in API 5197 // requests with the JSON null value. By default, fields with empty 5198 // values are omitted from API requests. However, any field with an 5199 // empty value appearing in NullFields will be sent to the server as 5200 // null. It is an error if a field in this list has a non-empty value. 5201 // This may be used to include null fields in Patch requests. 5202 NullFields []string `json:"-"` 5203} 5204 5205func (s *GoogleCloudDialogflowV2beta1IntentMessageSuggestion) MarshalJSON() ([]byte, error) { 5206 type NoMethod GoogleCloudDialogflowV2beta1IntentMessageSuggestion 5207 raw := NoMethod(*s) 5208 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5209} 5210 5211// GoogleCloudDialogflowV2beta1IntentMessageSuggestions: The collection 5212// of suggestions. 5213type GoogleCloudDialogflowV2beta1IntentMessageSuggestions struct { 5214 // Suggestions: Required. The list of suggested replies. 5215 Suggestions []*GoogleCloudDialogflowV2beta1IntentMessageSuggestion `json:"suggestions,omitempty"` 5216 5217 // ForceSendFields is a list of field names (e.g. "Suggestions") to 5218 // unconditionally include in API requests. By default, fields with 5219 // empty values are omitted from API requests. However, any non-pointer, 5220 // non-interface field appearing in ForceSendFields will be sent to the 5221 // server regardless of whether the field is empty or not. This may be 5222 // used to include empty fields in Patch requests. 5223 ForceSendFields []string `json:"-"` 5224 5225 // NullFields is a list of field names (e.g. "Suggestions") to include 5226 // in API requests with the JSON null value. By default, fields with 5227 // empty values are omitted from API requests. However, any field with 5228 // an empty value appearing in NullFields will be sent to the server as 5229 // null. It is an error if a field in this list has a non-empty value. 5230 // This may be used to include null fields in Patch requests. 5231 NullFields []string `json:"-"` 5232} 5233 5234func (s *GoogleCloudDialogflowV2beta1IntentMessageSuggestions) MarshalJSON() ([]byte, error) { 5235 type NoMethod GoogleCloudDialogflowV2beta1IntentMessageSuggestions 5236 raw := NoMethod(*s) 5237 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5238} 5239 5240// GoogleCloudDialogflowV2beta1IntentMessageTelephonyPlayAudio: Plays 5241// audio from a file in Telephony Gateway. 5242type GoogleCloudDialogflowV2beta1IntentMessageTelephonyPlayAudio struct { 5243 // AudioUri: Required. URI to a Google Cloud Storage object containing 5244 // the audio to 5245 // play, e.g., "gs://bucket/object". The object must contain a 5246 // single 5247 // channel (mono) of linear PCM audio (2 bytes / sample) at 8kHz. 5248 // 5249 // This object must be readable by the 5250 // `service-<Project 5251 // Number>@gcp-sa-dialogflow.iam.gserviceaccount.com` service 5252 // account 5253 // where <Project Number> is the number of the Telephony Gateway 5254 // project 5255 // (usually the same as the Dialogflow agent project). If the Google 5256 // Cloud 5257 // Storage bucket is in the Telephony Gateway project, this permission 5258 // is 5259 // added by default when enabling the Dialogflow V2 API. 5260 // 5261 // For audio from other sources, consider using 5262 // the 5263 // `TelephonySynthesizeSpeech` message with SSML. 5264 AudioUri string `json:"audioUri,omitempty"` 5265 5266 // ForceSendFields is a list of field names (e.g. "AudioUri") to 5267 // unconditionally include in API requests. By default, fields with 5268 // empty values are omitted from API requests. However, any non-pointer, 5269 // non-interface field appearing in ForceSendFields will be sent to the 5270 // server regardless of whether the field is empty or not. This may be 5271 // used to include empty fields in Patch requests. 5272 ForceSendFields []string `json:"-"` 5273 5274 // NullFields is a list of field names (e.g. "AudioUri") to include in 5275 // API requests with the JSON null value. By default, fields with empty 5276 // values are omitted from API requests. However, any field with an 5277 // empty value appearing in NullFields will be sent to the server as 5278 // null. It is an error if a field in this list has a non-empty value. 5279 // This may be used to include null fields in Patch requests. 5280 NullFields []string `json:"-"` 5281} 5282 5283func (s *GoogleCloudDialogflowV2beta1IntentMessageTelephonyPlayAudio) MarshalJSON() ([]byte, error) { 5284 type NoMethod GoogleCloudDialogflowV2beta1IntentMessageTelephonyPlayAudio 5285 raw := NoMethod(*s) 5286 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5287} 5288 5289// GoogleCloudDialogflowV2beta1IntentMessageTelephonySynthesizeSpeech: 5290// Synthesizes speech and plays back the synthesized audio to the caller 5291// in 5292// Telephony Gateway. 5293// 5294// Telephony Gateway takes the synthesizer settings 5295// from 5296// `DetectIntentResponse.output_audio_config` which can either be set 5297// at request-level or can come from the agent-level synthesizer config. 5298type GoogleCloudDialogflowV2beta1IntentMessageTelephonySynthesizeSpeech struct { 5299 // Ssml: The SSML to be synthesized. For more information, 5300 // see 5301 // [SSML](https://developers.google.com/actions/reference/ssml). 5302 Ssml string `json:"ssml,omitempty"` 5303 5304 // Text: The raw text to be synthesized. 5305 Text string `json:"text,omitempty"` 5306 5307 // ForceSendFields is a list of field names (e.g. "Ssml") to 5308 // unconditionally include in API requests. By default, fields with 5309 // empty values are omitted from API requests. However, any non-pointer, 5310 // non-interface field appearing in ForceSendFields will be sent to the 5311 // server regardless of whether the field is empty or not. This may be 5312 // used to include empty fields in Patch requests. 5313 ForceSendFields []string `json:"-"` 5314 5315 // NullFields is a list of field names (e.g. "Ssml") to include in API 5316 // requests with the JSON null value. By default, fields with empty 5317 // values are omitted from API requests. However, any field with an 5318 // empty value appearing in NullFields will be sent to the server as 5319 // null. It is an error if a field in this list has a non-empty value. 5320 // This may be used to include null fields in Patch requests. 5321 NullFields []string `json:"-"` 5322} 5323 5324func (s *GoogleCloudDialogflowV2beta1IntentMessageTelephonySynthesizeSpeech) MarshalJSON() ([]byte, error) { 5325 type NoMethod GoogleCloudDialogflowV2beta1IntentMessageTelephonySynthesizeSpeech 5326 raw := NoMethod(*s) 5327 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5328} 5329 5330// GoogleCloudDialogflowV2beta1IntentMessageTelephonyTransferCall: 5331// Transfers the call in Telephony Gateway. 5332type GoogleCloudDialogflowV2beta1IntentMessageTelephonyTransferCall struct { 5333 // PhoneNumber: Required. The phone number to transfer the call to 5334 // in [E.164 format](https://en.wikipedia.org/wiki/E.164). 5335 // 5336 // We currently only allow transferring to US numbers (+1xxxyyyzzzz). 5337 PhoneNumber string `json:"phoneNumber,omitempty"` 5338 5339 // ForceSendFields is a list of field names (e.g. "PhoneNumber") to 5340 // unconditionally include in API requests. By default, fields with 5341 // empty values are omitted from API requests. However, any non-pointer, 5342 // non-interface field appearing in ForceSendFields will be sent to the 5343 // server regardless of whether the field is empty or not. This may be 5344 // used to include empty fields in Patch requests. 5345 ForceSendFields []string `json:"-"` 5346 5347 // NullFields is a list of field names (e.g. "PhoneNumber") to include 5348 // in API requests with the JSON null value. By default, fields with 5349 // empty values are omitted from API requests. However, any field with 5350 // an empty value appearing in NullFields will be sent to the server as 5351 // null. It is an error if a field in this list has a non-empty value. 5352 // This may be used to include null fields in Patch requests. 5353 NullFields []string `json:"-"` 5354} 5355 5356func (s *GoogleCloudDialogflowV2beta1IntentMessageTelephonyTransferCall) MarshalJSON() ([]byte, error) { 5357 type NoMethod GoogleCloudDialogflowV2beta1IntentMessageTelephonyTransferCall 5358 raw := NoMethod(*s) 5359 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5360} 5361 5362// GoogleCloudDialogflowV2beta1IntentMessageText: The text response 5363// message. 5364type GoogleCloudDialogflowV2beta1IntentMessageText struct { 5365 // Text: Optional. The collection of the agent's responses. 5366 Text []string `json:"text,omitempty"` 5367 5368 // ForceSendFields is a list of field names (e.g. "Text") to 5369 // unconditionally include in API requests. By default, fields with 5370 // empty values are omitted from API requests. However, any non-pointer, 5371 // non-interface field appearing in ForceSendFields will be sent to the 5372 // server regardless of whether the field is empty or not. This may be 5373 // used to include empty fields in Patch requests. 5374 ForceSendFields []string `json:"-"` 5375 5376 // NullFields is a list of field names (e.g. "Text") to include in API 5377 // requests with the JSON null value. By default, fields with empty 5378 // values are omitted from API requests. However, any field with an 5379 // empty value appearing in NullFields will be sent to the server as 5380 // null. It is an error if a field in this list has a non-empty value. 5381 // This may be used to include null fields in Patch requests. 5382 NullFields []string `json:"-"` 5383} 5384 5385func (s *GoogleCloudDialogflowV2beta1IntentMessageText) MarshalJSON() ([]byte, error) { 5386 type NoMethod GoogleCloudDialogflowV2beta1IntentMessageText 5387 raw := NoMethod(*s) 5388 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5389} 5390 5391// GoogleCloudDialogflowV2beta1IntentParameter: Represents intent 5392// parameters. 5393type GoogleCloudDialogflowV2beta1IntentParameter struct { 5394 // DefaultValue: Optional. The default value to use when the `value` 5395 // yields an empty 5396 // result. 5397 // Default values can be extracted from contexts by using the 5398 // following 5399 // syntax: `#context_name.parameter_name`. 5400 DefaultValue string `json:"defaultValue,omitempty"` 5401 5402 // DisplayName: Required. The name of the parameter. 5403 DisplayName string `json:"displayName,omitempty"` 5404 5405 // EntityTypeDisplayName: Optional. The name of the entity type, 5406 // prefixed with `@`, that 5407 // describes values of the parameter. If the parameter is 5408 // required, this must be provided. 5409 EntityTypeDisplayName string `json:"entityTypeDisplayName,omitempty"` 5410 5411 // IsList: Optional. Indicates whether the parameter represents a list 5412 // of values. 5413 IsList bool `json:"isList,omitempty"` 5414 5415 // Mandatory: Optional. Indicates whether the parameter is required. 5416 // That is, 5417 // whether the intent cannot be completed without collecting the 5418 // parameter 5419 // value. 5420 Mandatory bool `json:"mandatory,omitempty"` 5421 5422 // Name: The unique identifier of this parameter. 5423 Name string `json:"name,omitempty"` 5424 5425 // Prompts: Optional. The collection of prompts that the agent can 5426 // present to the 5427 // user in order to collect a value for the parameter. 5428 Prompts []string `json:"prompts,omitempty"` 5429 5430 // Value: Optional. The definition of the parameter value. It can be: 5431 // - a constant string, 5432 // - a parameter value defined as `$parameter_name`, 5433 // - an original parameter value defined as 5434 // `$parameter_name.original`, 5435 // - a parameter value from some context defined as 5436 // `#context_name.parameter_name`. 5437 Value string `json:"value,omitempty"` 5438 5439 // ForceSendFields is a list of field names (e.g. "DefaultValue") to 5440 // unconditionally include in API requests. By default, fields with 5441 // empty values are omitted from API requests. However, any non-pointer, 5442 // non-interface field appearing in ForceSendFields will be sent to the 5443 // server regardless of whether the field is empty or not. This may be 5444 // used to include empty fields in Patch requests. 5445 ForceSendFields []string `json:"-"` 5446 5447 // NullFields is a list of field names (e.g. "DefaultValue") to include 5448 // in API requests with the JSON null value. By default, fields with 5449 // empty values are omitted from API requests. However, any field with 5450 // an empty value appearing in NullFields will be sent to the server as 5451 // null. It is an error if a field in this list has a non-empty value. 5452 // This may be used to include null fields in Patch requests. 5453 NullFields []string `json:"-"` 5454} 5455 5456func (s *GoogleCloudDialogflowV2beta1IntentParameter) MarshalJSON() ([]byte, error) { 5457 type NoMethod GoogleCloudDialogflowV2beta1IntentParameter 5458 raw := NoMethod(*s) 5459 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5460} 5461 5462// GoogleCloudDialogflowV2beta1IntentTrainingPhrase: Represents an 5463// example that the agent is trained on. 5464type GoogleCloudDialogflowV2beta1IntentTrainingPhrase struct { 5465 // Name: Output only. The unique identifier of this training phrase. 5466 Name string `json:"name,omitempty"` 5467 5468 // Parts: Required. The ordered list of training phrase parts. 5469 // The parts are concatenated in order to form the training 5470 // phrase. 5471 // 5472 // Note: The API does not automatically annotate training phrases like 5473 // the 5474 // Dialogflow Console does. 5475 // 5476 // Note: Do not forget to include whitespace at part boundaries, 5477 // so the training phrase is well formatted when the parts are 5478 // concatenated. 5479 // 5480 // If the training phrase does not need to be annotated with 5481 // parameters, 5482 // you just need a single part with only the Part.text field set. 5483 // 5484 // If you want to annotate the training phrase, you must create 5485 // multiple 5486 // parts, where the fields of each part are populated in one of two 5487 // ways: 5488 // 5489 // - `Part.text` is set to a part of the phrase that has no 5490 // parameters. 5491 // - `Part.text` is set to a part of the phrase that you want to 5492 // annotate, 5493 // and the `entity_type`, `alias`, and `user_defined` fields are 5494 // all 5495 // set. 5496 Parts []*GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart `json:"parts,omitempty"` 5497 5498 // TimesAddedCount: Optional. Indicates how many times this example was 5499 // added to 5500 // the intent. Each time a developer adds an existing sample by editing 5501 // an 5502 // intent or training, this counter is increased. 5503 TimesAddedCount int64 `json:"timesAddedCount,omitempty"` 5504 5505 // Type: Required. The type of the training phrase. 5506 // 5507 // Possible values: 5508 // "TYPE_UNSPECIFIED" - Not specified. This value should never be 5509 // used. 5510 // "EXAMPLE" - Examples do not contain @-prefixed entity type names, 5511 // but example parts 5512 // can be annotated with entity types. 5513 // "TEMPLATE" - Templates are not annotated with entity types, but 5514 // they can contain 5515 // @-prefixed entity type names as substrings. 5516 // Template mode has been deprecated. Example mode is the only 5517 // supported 5518 // way to create new training phrases. If you have existing 5519 // training 5520 // phrases that you've created in template mode, those will continue 5521 // to 5522 // work. 5523 Type string `json:"type,omitempty"` 5524 5525 // ForceSendFields is a list of field names (e.g. "Name") to 5526 // unconditionally include in API requests. By default, fields with 5527 // empty values are omitted from API requests. However, any non-pointer, 5528 // non-interface field appearing in ForceSendFields will be sent to the 5529 // server regardless of whether the field is empty or not. This may be 5530 // used to include empty fields in Patch requests. 5531 ForceSendFields []string `json:"-"` 5532 5533 // NullFields is a list of field names (e.g. "Name") to include in API 5534 // requests with the JSON null value. By default, fields with empty 5535 // values are omitted from API requests. However, any field with an 5536 // empty value appearing in NullFields will be sent to the server as 5537 // null. It is an error if a field in this list has a non-empty value. 5538 // This may be used to include null fields in Patch requests. 5539 NullFields []string `json:"-"` 5540} 5541 5542func (s *GoogleCloudDialogflowV2beta1IntentTrainingPhrase) MarshalJSON() ([]byte, error) { 5543 type NoMethod GoogleCloudDialogflowV2beta1IntentTrainingPhrase 5544 raw := NoMethod(*s) 5545 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5546} 5547 5548// GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart: Represents a 5549// part of a training phrase. 5550type GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart struct { 5551 // Alias: Optional. The parameter name for the value extracted from 5552 // the 5553 // annotated part of the example. 5554 // This field is required for annotated parts of the training phrase. 5555 Alias string `json:"alias,omitempty"` 5556 5557 // EntityType: Optional. The entity type name prefixed with `@`. 5558 // This field is required for annotated parts of the training phrase. 5559 EntityType string `json:"entityType,omitempty"` 5560 5561 // Text: Required. The text for this part. 5562 Text string `json:"text,omitempty"` 5563 5564 // UserDefined: Optional. Indicates whether the text was manually 5565 // annotated. 5566 // This field is set to true when the Dialogflow Console is used 5567 // to 5568 // manually annotate the part. When creating an annotated part with 5569 // the 5570 // API, you must set this to true. 5571 UserDefined bool `json:"userDefined,omitempty"` 5572 5573 // ForceSendFields is a list of field names (e.g. "Alias") to 5574 // unconditionally include in API requests. By default, fields with 5575 // empty values are omitted from API requests. However, any non-pointer, 5576 // non-interface field appearing in ForceSendFields will be sent to the 5577 // server regardless of whether the field is empty or not. This may be 5578 // used to include empty fields in Patch requests. 5579 ForceSendFields []string `json:"-"` 5580 5581 // NullFields is a list of field names (e.g. "Alias") to include in API 5582 // requests with the JSON null value. By default, fields with empty 5583 // values are omitted from API requests. However, any field with an 5584 // empty value appearing in NullFields will be sent to the server as 5585 // null. It is an error if a field in this list has a non-empty value. 5586 // This may be used to include null fields in Patch requests. 5587 NullFields []string `json:"-"` 5588} 5589 5590func (s *GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart) MarshalJSON() ([]byte, error) { 5591 type NoMethod GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart 5592 raw := NoMethod(*s) 5593 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5594} 5595 5596// GoogleCloudDialogflowV2beta1KnowledgeAnswers: Represents the result 5597// of querying a Knowledge base. 5598type GoogleCloudDialogflowV2beta1KnowledgeAnswers struct { 5599 // Answers: A list of answers from Knowledge Connector. 5600 Answers []*GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer `json:"answers,omitempty"` 5601 5602 // ForceSendFields is a list of field names (e.g. "Answers") to 5603 // unconditionally include in API requests. By default, fields with 5604 // empty values are omitted from API requests. However, any non-pointer, 5605 // non-interface field appearing in ForceSendFields will be sent to the 5606 // server regardless of whether the field is empty or not. This may be 5607 // used to include empty fields in Patch requests. 5608 ForceSendFields []string `json:"-"` 5609 5610 // NullFields is a list of field names (e.g. "Answers") to include in 5611 // API requests with the JSON null value. By default, fields with empty 5612 // values are omitted from API requests. However, any field with an 5613 // empty value appearing in NullFields will be sent to the server as 5614 // null. It is an error if a field in this list has a non-empty value. 5615 // This may be used to include null fields in Patch requests. 5616 NullFields []string `json:"-"` 5617} 5618 5619func (s *GoogleCloudDialogflowV2beta1KnowledgeAnswers) MarshalJSON() ([]byte, error) { 5620 type NoMethod GoogleCloudDialogflowV2beta1KnowledgeAnswers 5621 raw := NoMethod(*s) 5622 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5623} 5624 5625// GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer: An answer from 5626// Knowledge Connector. 5627type GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer struct { 5628 // Answer: The piece of text from the `source` knowledge base document 5629 // that answers 5630 // this conversational query. 5631 Answer string `json:"answer,omitempty"` 5632 5633 // FaqQuestion: The corresponding FAQ question if the answer was 5634 // extracted from a FAQ 5635 // Document, empty otherwise. 5636 FaqQuestion string `json:"faqQuestion,omitempty"` 5637 5638 // MatchConfidence: The system's confidence score that this Knowledge 5639 // answer is a good match 5640 // for this conversational query. 5641 // The range is from 0.0 (completely uncertain) to 1.0 (completely 5642 // certain). 5643 // Note: The confidence score is likely to vary somewhat (possibly even 5644 // for 5645 // identical requests), as the underlying model is under 5646 // constant 5647 // improvement. It may be deprecated in the future. We recommend 5648 // using 5649 // `match_confidence_level` which should be generally more stable. 5650 MatchConfidence float64 `json:"matchConfidence,omitempty"` 5651 5652 // MatchConfidenceLevel: The system's confidence level that this 5653 // knowledge answer is a good match 5654 // for this conversational query. 5655 // NOTE: The confidence level for a given `<query, answer>` pair may 5656 // change 5657 // without notice, as it depends on models that are constantly 5658 // being 5659 // improved. However, it will change less frequently than the 5660 // confidence 5661 // score below, and should be preferred for referencing the quality of 5662 // an 5663 // answer. 5664 // 5665 // Possible values: 5666 // "MATCH_CONFIDENCE_LEVEL_UNSPECIFIED" - Not specified. 5667 // "LOW" - Indicates that the confidence is low. 5668 // "MEDIUM" - Indicates our confidence is medium. 5669 // "HIGH" - Indicates our confidence is high. 5670 MatchConfidenceLevel string `json:"matchConfidenceLevel,omitempty"` 5671 5672 // Source: Indicates which Knowledge Document this answer was extracted 5673 // from. 5674 // Format: `projects/<Project ID>/knowledgeBases/<Knowledge 5675 // Base 5676 // ID>/documents/<Document ID>`. 5677 Source string `json:"source,omitempty"` 5678 5679 // ForceSendFields is a list of field names (e.g. "Answer") to 5680 // unconditionally include in API requests. By default, fields with 5681 // empty values are omitted from API requests. However, any non-pointer, 5682 // non-interface field appearing in ForceSendFields will be sent to the 5683 // server regardless of whether the field is empty or not. This may be 5684 // used to include empty fields in Patch requests. 5685 ForceSendFields []string `json:"-"` 5686 5687 // NullFields is a list of field names (e.g. "Answer") to include in API 5688 // requests with the JSON null value. By default, fields with empty 5689 // values are omitted from API requests. However, any field with an 5690 // empty value appearing in NullFields will be sent to the server as 5691 // null. It is an error if a field in this list has a non-empty value. 5692 // This may be used to include null fields in Patch requests. 5693 NullFields []string `json:"-"` 5694} 5695 5696func (s *GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer) MarshalJSON() ([]byte, error) { 5697 type NoMethod GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer 5698 raw := NoMethod(*s) 5699 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5700} 5701 5702func (s *GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer) UnmarshalJSON(data []byte) error { 5703 type NoMethod GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer 5704 var s1 struct { 5705 MatchConfidence gensupport.JSONFloat64 `json:"matchConfidence"` 5706 *NoMethod 5707 } 5708 s1.NoMethod = (*NoMethod)(s) 5709 if err := json.Unmarshal(data, &s1); err != nil { 5710 return err 5711 } 5712 s.MatchConfidence = float64(s1.MatchConfidence) 5713 return nil 5714} 5715 5716// GoogleCloudDialogflowV2beta1KnowledgeOperationMetadata: Metadata in 5717// google::longrunning::Operation for Knowledge operations. 5718type GoogleCloudDialogflowV2beta1KnowledgeOperationMetadata struct { 5719 // State: Required. The current state of this operation. 5720 // 5721 // Possible values: 5722 // "STATE_UNSPECIFIED" - State unspecified. 5723 // "PENDING" - The operation has been created. 5724 // "RUNNING" - The operation is currently running. 5725 // "DONE" - The operation is done, either cancelled or completed. 5726 State string `json:"state,omitempty"` 5727 5728 // ForceSendFields is a list of field names (e.g. "State") to 5729 // unconditionally include in API requests. By default, fields with 5730 // empty values are omitted from API requests. However, any non-pointer, 5731 // non-interface field appearing in ForceSendFields will be sent to the 5732 // server regardless of whether the field is empty or not. This may be 5733 // used to include empty fields in Patch requests. 5734 ForceSendFields []string `json:"-"` 5735 5736 // NullFields is a list of field names (e.g. "State") to include in API 5737 // requests with the JSON null value. By default, fields with empty 5738 // values are omitted from API requests. However, any field with an 5739 // empty value appearing in NullFields will be sent to the server as 5740 // null. It is an error if a field in this list has a non-empty value. 5741 // This may be used to include null fields in Patch requests. 5742 NullFields []string `json:"-"` 5743} 5744 5745func (s *GoogleCloudDialogflowV2beta1KnowledgeOperationMetadata) MarshalJSON() ([]byte, error) { 5746 type NoMethod GoogleCloudDialogflowV2beta1KnowledgeOperationMetadata 5747 raw := NoMethod(*s) 5748 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5749} 5750 5751// GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest: Represents 5752// the contents of the original request that was passed to 5753// the `[Streaming]DetectIntent` call. 5754type GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest struct { 5755 // Payload: Optional. This field is set to the value of the 5756 // `QueryParameters.payload` 5757 // field passed in the request. Some integrations that query a 5758 // Dialogflow 5759 // agent may provide additional information in the payload. 5760 // 5761 // In particular for the Telephony Gateway this field has the 5762 // form: 5763 // <pre>{ 5764 // "telephony": { 5765 // "caller_id": "+18558363987" 5766 // } 5767 // }</pre> 5768 // Note: The caller ID field (`caller_id`) will be redacted for 5769 // Standard 5770 // Edition agents and populated with the caller ID in 5771 // [E.164 5772 // format](https://en.wikipedia.org/wiki/E.164) for Enterprise Edition 5773 // agents. 5774 Payload googleapi.RawMessage `json:"payload,omitempty"` 5775 5776 // Source: The source of this request, e.g., `google`, `facebook`, 5777 // `slack`. It is set 5778 // by Dialogflow-owned servers. 5779 Source string `json:"source,omitempty"` 5780 5781 // Version: Optional. The version of the protocol used for this 5782 // request. 5783 // This field is AoG-specific. 5784 Version string `json:"version,omitempty"` 5785 5786 // ForceSendFields is a list of field names (e.g. "Payload") to 5787 // unconditionally include in API requests. By default, fields with 5788 // empty values are omitted from API requests. However, any non-pointer, 5789 // non-interface field appearing in ForceSendFields will be sent to the 5790 // server regardless of whether the field is empty or not. This may be 5791 // used to include empty fields in Patch requests. 5792 ForceSendFields []string `json:"-"` 5793 5794 // NullFields is a list of field names (e.g. "Payload") to include in 5795 // API requests with the JSON null value. By default, fields with empty 5796 // values are omitted from API requests. However, any field with an 5797 // empty value appearing in NullFields will be sent to the server as 5798 // null. It is an error if a field in this list has a non-empty value. 5799 // This may be used to include null fields in Patch requests. 5800 NullFields []string `json:"-"` 5801} 5802 5803func (s *GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest) MarshalJSON() ([]byte, error) { 5804 type NoMethod GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest 5805 raw := NoMethod(*s) 5806 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5807} 5808 5809// GoogleCloudDialogflowV2beta1QueryResult: Represents the result of 5810// conversational query or event processing. 5811type GoogleCloudDialogflowV2beta1QueryResult struct { 5812 // Action: The action name from the matched intent. 5813 Action string `json:"action,omitempty"` 5814 5815 // AllRequiredParamsPresent: This field is set to: 5816 // 5817 // - `false` if the matched intent has required parameters and not all 5818 // of 5819 // the required parameter values have been collected. 5820 // - `true` if all required parameter values have been collected, or if 5821 // the 5822 // matched intent doesn't contain any required parameters. 5823 AllRequiredParamsPresent bool `json:"allRequiredParamsPresent,omitempty"` 5824 5825 // DiagnosticInfo: The free-form diagnostic info. For example, this 5826 // field could contain 5827 // webhook call latency. The string keys of the Struct's fields map can 5828 // change 5829 // without notice. 5830 DiagnosticInfo googleapi.RawMessage `json:"diagnosticInfo,omitempty"` 5831 5832 // FulfillmentMessages: The collection of rich messages to present to 5833 // the user. 5834 FulfillmentMessages []*GoogleCloudDialogflowV2beta1IntentMessage `json:"fulfillmentMessages,omitempty"` 5835 5836 // FulfillmentText: The text to be pronounced to the user or shown on 5837 // the screen. 5838 // Note: This is a legacy field, `fulfillment_messages` should be 5839 // preferred. 5840 FulfillmentText string `json:"fulfillmentText,omitempty"` 5841 5842 // Intent: The intent that matched the conversational query. Some, 5843 // not 5844 // all fields are filled in this message, including but not limited 5845 // to: 5846 // `name`, `display_name` and `webhook_state`. 5847 Intent *GoogleCloudDialogflowV2beta1Intent `json:"intent,omitempty"` 5848 5849 // IntentDetectionConfidence: The intent detection confidence. Values 5850 // range from 0.0 5851 // (completely uncertain) to 1.0 (completely certain). 5852 // If there are `multiple knowledge_answers` messages, this value is set 5853 // to 5854 // the greatest `knowledgeAnswers.match_confidence` value in the list. 5855 IntentDetectionConfidence float64 `json:"intentDetectionConfidence,omitempty"` 5856 5857 // KnowledgeAnswers: The result from Knowledge Connector (if any), 5858 // ordered by decreasing 5859 // `KnowledgeAnswers.match_confidence`. 5860 KnowledgeAnswers *GoogleCloudDialogflowV2beta1KnowledgeAnswers `json:"knowledgeAnswers,omitempty"` 5861 5862 // LanguageCode: The language that was triggered during intent 5863 // detection. 5864 // See 5865 // [Language 5866 // Support](https://cloud.google.com/dialogflow/docs/reference/ 5867 // language) 5868 // for a list of the currently supported language codes. 5869 LanguageCode string `json:"languageCode,omitempty"` 5870 5871 // OutputContexts: The collection of output contexts. If 5872 // applicable, 5873 // `output_contexts.parameters` contains entries with name 5874 // `<parameter name>.original` containing the original parameter 5875 // values 5876 // before the query. 5877 OutputContexts []*GoogleCloudDialogflowV2beta1Context `json:"outputContexts,omitempty"` 5878 5879 // Parameters: The collection of extracted parameters. 5880 Parameters googleapi.RawMessage `json:"parameters,omitempty"` 5881 5882 // QueryText: The original conversational query text: 5883 // 5884 // - If natural language text was provided as input, `query_text` 5885 // contains 5886 // a copy of the input. 5887 // - If natural language speech audio was provided as input, 5888 // `query_text` 5889 // contains the speech recognition result. If speech recognizer 5890 // produced 5891 // multiple alternatives, a particular one is picked. 5892 // - If automatic spell correction is enabled, `query_text` will contain 5893 // the 5894 // corrected user input. 5895 QueryText string `json:"queryText,omitempty"` 5896 5897 // SentimentAnalysisResult: The sentiment analysis result, which depends 5898 // on the 5899 // `sentiment_analysis_request_config` specified in the request. 5900 SentimentAnalysisResult *GoogleCloudDialogflowV2beta1SentimentAnalysisResult `json:"sentimentAnalysisResult,omitempty"` 5901 5902 // SpeechRecognitionConfidence: The Speech recognition confidence 5903 // between 0.0 and 1.0. A higher number 5904 // indicates an estimated greater likelihood that the recognized words 5905 // are 5906 // correct. The default of 0.0 is a sentinel value indicating that 5907 // confidence 5908 // was not set. 5909 // 5910 // This field is not guaranteed to be accurate or set. In particular 5911 // this 5912 // field isn't set for StreamingDetectIntent since the streaming 5913 // endpoint has 5914 // separate confidence estimates per portion of the audio 5915 // in 5916 // StreamingRecognitionResult. 5917 SpeechRecognitionConfidence float64 `json:"speechRecognitionConfidence,omitempty"` 5918 5919 // WebhookPayload: If the query was fulfilled by a webhook call, this 5920 // field is set to the 5921 // value of the `payload` field returned in the webhook response. 5922 WebhookPayload googleapi.RawMessage `json:"webhookPayload,omitempty"` 5923 5924 // WebhookSource: If the query was fulfilled by a webhook call, this 5925 // field is set to the 5926 // value of the `source` field returned in the webhook response. 5927 WebhookSource string `json:"webhookSource,omitempty"` 5928 5929 // ForceSendFields is a list of field names (e.g. "Action") to 5930 // unconditionally include in API requests. By default, fields with 5931 // empty values are omitted from API requests. However, any non-pointer, 5932 // non-interface field appearing in ForceSendFields will be sent to the 5933 // server regardless of whether the field is empty or not. This may be 5934 // used to include empty fields in Patch requests. 5935 ForceSendFields []string `json:"-"` 5936 5937 // NullFields is a list of field names (e.g. "Action") to include in API 5938 // requests with the JSON null value. By default, fields with empty 5939 // values are omitted from API requests. However, any field with an 5940 // empty value appearing in NullFields will be sent to the server as 5941 // null. It is an error if a field in this list has a non-empty value. 5942 // This may be used to include null fields in Patch requests. 5943 NullFields []string `json:"-"` 5944} 5945 5946func (s *GoogleCloudDialogflowV2beta1QueryResult) MarshalJSON() ([]byte, error) { 5947 type NoMethod GoogleCloudDialogflowV2beta1QueryResult 5948 raw := NoMethod(*s) 5949 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5950} 5951 5952func (s *GoogleCloudDialogflowV2beta1QueryResult) UnmarshalJSON(data []byte) error { 5953 type NoMethod GoogleCloudDialogflowV2beta1QueryResult 5954 var s1 struct { 5955 IntentDetectionConfidence gensupport.JSONFloat64 `json:"intentDetectionConfidence"` 5956 SpeechRecognitionConfidence gensupport.JSONFloat64 `json:"speechRecognitionConfidence"` 5957 *NoMethod 5958 } 5959 s1.NoMethod = (*NoMethod)(s) 5960 if err := json.Unmarshal(data, &s1); err != nil { 5961 return err 5962 } 5963 s.IntentDetectionConfidence = float64(s1.IntentDetectionConfidence) 5964 s.SpeechRecognitionConfidence = float64(s1.SpeechRecognitionConfidence) 5965 return nil 5966} 5967 5968// GoogleCloudDialogflowV2beta1Sentiment: The sentiment, such as 5969// positive/negative feeling or association, for a unit 5970// of analysis, such as the query text. 5971type GoogleCloudDialogflowV2beta1Sentiment struct { 5972 // Magnitude: A non-negative number in the [0, +inf) range, which 5973 // represents the absolute 5974 // magnitude of sentiment, regardless of score (positive or negative). 5975 Magnitude float64 `json:"magnitude,omitempty"` 5976 5977 // Score: Sentiment score between -1.0 (negative sentiment) and 1.0 5978 // (positive 5979 // sentiment). 5980 Score float64 `json:"score,omitempty"` 5981 5982 // ForceSendFields is a list of field names (e.g. "Magnitude") to 5983 // unconditionally include in API requests. By default, fields with 5984 // empty values are omitted from API requests. However, any non-pointer, 5985 // non-interface field appearing in ForceSendFields will be sent to the 5986 // server regardless of whether the field is empty or not. This may be 5987 // used to include empty fields in Patch requests. 5988 ForceSendFields []string `json:"-"` 5989 5990 // NullFields is a list of field names (e.g. "Magnitude") to include in 5991 // API requests with the JSON null value. By default, fields with empty 5992 // values are omitted from API requests. However, any field with an 5993 // empty value appearing in NullFields will be sent to the server as 5994 // null. It is an error if a field in this list has a non-empty value. 5995 // This may be used to include null fields in Patch requests. 5996 NullFields []string `json:"-"` 5997} 5998 5999func (s *GoogleCloudDialogflowV2beta1Sentiment) MarshalJSON() ([]byte, error) { 6000 type NoMethod GoogleCloudDialogflowV2beta1Sentiment 6001 raw := NoMethod(*s) 6002 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6003} 6004 6005func (s *GoogleCloudDialogflowV2beta1Sentiment) UnmarshalJSON(data []byte) error { 6006 type NoMethod GoogleCloudDialogflowV2beta1Sentiment 6007 var s1 struct { 6008 Magnitude gensupport.JSONFloat64 `json:"magnitude"` 6009 Score gensupport.JSONFloat64 `json:"score"` 6010 *NoMethod 6011 } 6012 s1.NoMethod = (*NoMethod)(s) 6013 if err := json.Unmarshal(data, &s1); err != nil { 6014 return err 6015 } 6016 s.Magnitude = float64(s1.Magnitude) 6017 s.Score = float64(s1.Score) 6018 return nil 6019} 6020 6021// GoogleCloudDialogflowV2beta1SentimentAnalysisResult: The result of 6022// sentiment analysis as configured 6023// by 6024// `sentiment_analysis_request_config`. 6025type GoogleCloudDialogflowV2beta1SentimentAnalysisResult struct { 6026 // QueryTextSentiment: The sentiment analysis result for `query_text`. 6027 QueryTextSentiment *GoogleCloudDialogflowV2beta1Sentiment `json:"queryTextSentiment,omitempty"` 6028 6029 // ForceSendFields is a list of field names (e.g. "QueryTextSentiment") 6030 // to unconditionally include in API requests. By default, fields with 6031 // empty values are omitted from API requests. However, any non-pointer, 6032 // non-interface field appearing in ForceSendFields will be sent to the 6033 // server regardless of whether the field is empty or not. This may be 6034 // used to include empty fields in Patch requests. 6035 ForceSendFields []string `json:"-"` 6036 6037 // NullFields is a list of field names (e.g. "QueryTextSentiment") to 6038 // include in API requests with the JSON null value. By default, fields 6039 // with empty values are omitted from API requests. However, any field 6040 // with an empty value appearing in NullFields will be sent to the 6041 // server as null. It is an error if a field in this list has a 6042 // non-empty value. This may be used to include null fields in Patch 6043 // requests. 6044 NullFields []string `json:"-"` 6045} 6046 6047func (s *GoogleCloudDialogflowV2beta1SentimentAnalysisResult) MarshalJSON() ([]byte, error) { 6048 type NoMethod GoogleCloudDialogflowV2beta1SentimentAnalysisResult 6049 raw := NoMethod(*s) 6050 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6051} 6052 6053// GoogleCloudDialogflowV2beta1WebhookRequest: The request message for a 6054// webhook call. 6055type GoogleCloudDialogflowV2beta1WebhookRequest struct { 6056 // AlternativeQueryResults: Alternative query results from 6057 // KnowledgeService. 6058 AlternativeQueryResults []*GoogleCloudDialogflowV2beta1QueryResult `json:"alternativeQueryResults,omitempty"` 6059 6060 // OriginalDetectIntentRequest: Optional. The contents of the original 6061 // request that was passed to 6062 // `[Streaming]DetectIntent` call. 6063 OriginalDetectIntentRequest *GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest `json:"originalDetectIntentRequest,omitempty"` 6064 6065 // QueryResult: The result of the conversational query or event 6066 // processing. Contains the 6067 // same value as `[Streaming]DetectIntentResponse.query_result`. 6068 QueryResult *GoogleCloudDialogflowV2beta1QueryResult `json:"queryResult,omitempty"` 6069 6070 // ResponseId: The unique identifier of the response. Contains the same 6071 // value as 6072 // `[Streaming]DetectIntentResponse.response_id`. 6073 ResponseId string `json:"responseId,omitempty"` 6074 6075 // Session: The unique identifier of detectIntent request session. 6076 // Can be used to identify end-user inside webhook 6077 // implementation. 6078 // Format: `projects/<Project ID>/agent/sessions/<Session ID>`, 6079 // or 6080 // `projects/<Project ID>/agent/environments/<Environment 6081 // ID>/users/<User 6082 // ID>/sessions/<Session ID>`. 6083 Session string `json:"session,omitempty"` 6084 6085 // ForceSendFields is a list of field names (e.g. 6086 // "AlternativeQueryResults") to unconditionally include in API 6087 // requests. By default, fields with empty values are omitted from API 6088 // requests. However, any non-pointer, non-interface field appearing in 6089 // ForceSendFields will be sent to the server regardless of whether the 6090 // field is empty or not. This may be used to include empty fields in 6091 // Patch requests. 6092 ForceSendFields []string `json:"-"` 6093 6094 // NullFields is a list of field names (e.g. "AlternativeQueryResults") 6095 // to include in API requests with the JSON null value. By default, 6096 // fields with empty values are omitted from API requests. However, any 6097 // field with an empty value appearing in NullFields will be sent to the 6098 // server as null. It is an error if a field in this list has a 6099 // non-empty value. This may be used to include null fields in Patch 6100 // requests. 6101 NullFields []string `json:"-"` 6102} 6103 6104func (s *GoogleCloudDialogflowV2beta1WebhookRequest) MarshalJSON() ([]byte, error) { 6105 type NoMethod GoogleCloudDialogflowV2beta1WebhookRequest 6106 raw := NoMethod(*s) 6107 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6108} 6109 6110// GoogleCloudDialogflowV2beta1WebhookResponse: The response message for 6111// a webhook call. 6112type GoogleCloudDialogflowV2beta1WebhookResponse struct { 6113 // EndInteraction: Optional. Indicates that this intent ends an 6114 // interaction. Some integrations 6115 // (e.g., Actions on Google or Dialogflow phone gateway) use this 6116 // information 6117 // to close interaction with an end user. Default is false. 6118 EndInteraction bool `json:"endInteraction,omitempty"` 6119 6120 // FollowupEventInput: Optional. Makes the platform immediately invoke 6121 // another `DetectIntent` call 6122 // internally with the specified event as input. 6123 // When this field is set, Dialogflow ignores the 6124 // `fulfillment_text`, 6125 // `fulfillment_messages`, and `payload` fields. 6126 FollowupEventInput *GoogleCloudDialogflowV2beta1EventInput `json:"followupEventInput,omitempty"` 6127 6128 // FulfillmentMessages: Optional. The collection of rich messages to 6129 // present to the user. This 6130 // value is passed directly to `QueryResult.fulfillment_messages`. 6131 FulfillmentMessages []*GoogleCloudDialogflowV2beta1IntentMessage `json:"fulfillmentMessages,omitempty"` 6132 6133 // FulfillmentText: Optional. The text to be shown on the screen. This 6134 // value is passed directly 6135 // to `QueryResult.fulfillment_text`. 6136 FulfillmentText string `json:"fulfillmentText,omitempty"` 6137 6138 // OutputContexts: Optional. The collection of output contexts. This 6139 // value is passed directly 6140 // to `QueryResult.output_contexts`. 6141 OutputContexts []*GoogleCloudDialogflowV2beta1Context `json:"outputContexts,omitempty"` 6142 6143 // Payload: Optional. This value is passed directly to 6144 // `QueryResult.webhook_payload`. 6145 // See the related `fulfillment_messages[i].payload field`, which may be 6146 // used 6147 // as an alternative to this field. 6148 // 6149 // This field can be used for Actions on Google responses. 6150 // It should have a structure similar to the JSON message shown here. 6151 // For more 6152 // information, see 6153 // [Actions on Google 6154 // Webhook 6155 // Format](https://developers.google.com/actions/dialogflow/webho 6156 // ok) 6157 // <pre>{ 6158 // "google": { 6159 // "expectUserResponse": true, 6160 // "richResponse": { 6161 // "items": [ 6162 // { 6163 // "simpleResponse": { 6164 // "textToSpeech": "this is a simple response" 6165 // } 6166 // } 6167 // ] 6168 // } 6169 // } 6170 // }</pre> 6171 Payload googleapi.RawMessage `json:"payload,omitempty"` 6172 6173 // Source: Optional. This value is passed directly to 6174 // `QueryResult.webhook_source`. 6175 Source string `json:"source,omitempty"` 6176 6177 // ForceSendFields is a list of field names (e.g. "EndInteraction") to 6178 // unconditionally include in API requests. By default, fields with 6179 // empty values are omitted from API requests. However, any non-pointer, 6180 // non-interface field appearing in ForceSendFields will be sent to the 6181 // server regardless of whether the field is empty or not. This may be 6182 // used to include empty fields in Patch requests. 6183 ForceSendFields []string `json:"-"` 6184 6185 // NullFields is a list of field names (e.g. "EndInteraction") to 6186 // include in API requests with the JSON null value. By default, fields 6187 // with empty values are omitted from API requests. However, any field 6188 // with an empty value appearing in NullFields will be sent to the 6189 // server as null. It is an error if a field in this list has a 6190 // non-empty value. This may be used to include null fields in Patch 6191 // requests. 6192 NullFields []string `json:"-"` 6193} 6194 6195func (s *GoogleCloudDialogflowV2beta1WebhookResponse) MarshalJSON() ([]byte, error) { 6196 type NoMethod GoogleCloudDialogflowV2beta1WebhookResponse 6197 raw := NoMethod(*s) 6198 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6199} 6200 6201// GoogleLongrunningOperation: This resource represents a long-running 6202// operation that is the result of a 6203// network API call. 6204type GoogleLongrunningOperation struct { 6205 // Done: If the value is `false`, it means the operation is still in 6206 // progress. 6207 // If `true`, the operation is completed, and either `error` or 6208 // `response` is 6209 // available. 6210 Done bool `json:"done,omitempty"` 6211 6212 // Error: The error result of the operation in case of failure or 6213 // cancellation. 6214 Error *GoogleRpcStatus `json:"error,omitempty"` 6215 6216 // Metadata: Service-specific metadata associated with the operation. 6217 // It typically 6218 // contains progress information and common metadata such as create 6219 // time. 6220 // Some services might not provide such metadata. Any method that 6221 // returns a 6222 // long-running operation should document the metadata type, if any. 6223 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 6224 6225 // Name: The server-assigned name, which is only unique within the same 6226 // service that 6227 // originally returns it. If you use the default HTTP mapping, 6228 // the 6229 // `name` should be a resource name ending with 6230 // `operations/{unique_id}`. 6231 Name string `json:"name,omitempty"` 6232 6233 // Response: The normal response of the operation in case of success. 6234 // If the original 6235 // method returns no data on success, such as `Delete`, the response 6236 // is 6237 // `google.protobuf.Empty`. If the original method is 6238 // standard 6239 // `Get`/`Create`/`Update`, the response should be the resource. For 6240 // other 6241 // methods, the response should have the type `XxxResponse`, where 6242 // `Xxx` 6243 // is the original method name. For example, if the original method 6244 // name 6245 // is `TakeSnapshot()`, the inferred response type 6246 // is 6247 // `TakeSnapshotResponse`. 6248 Response googleapi.RawMessage `json:"response,omitempty"` 6249 6250 // ServerResponse contains the HTTP response code and headers from the 6251 // server. 6252 googleapi.ServerResponse `json:"-"` 6253 6254 // ForceSendFields is a list of field names (e.g. "Done") to 6255 // unconditionally include in API requests. By default, fields with 6256 // empty values are omitted from API requests. However, any non-pointer, 6257 // non-interface field appearing in ForceSendFields will be sent to the 6258 // server regardless of whether the field is empty or not. This may be 6259 // used to include empty fields in Patch requests. 6260 ForceSendFields []string `json:"-"` 6261 6262 // NullFields is a list of field names (e.g. "Done") to include in API 6263 // requests with the JSON null value. By default, fields with empty 6264 // values are omitted from API requests. However, any field with an 6265 // empty value appearing in NullFields will be sent to the server as 6266 // null. It is an error if a field in this list has a non-empty value. 6267 // This may be used to include null fields in Patch requests. 6268 NullFields []string `json:"-"` 6269} 6270 6271func (s *GoogleLongrunningOperation) MarshalJSON() ([]byte, error) { 6272 type NoMethod GoogleLongrunningOperation 6273 raw := NoMethod(*s) 6274 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6275} 6276 6277// GoogleProtobufEmpty: A generic empty message that you can re-use to 6278// avoid defining duplicated 6279// empty messages in your APIs. A typical example is to use it as the 6280// request 6281// or the response type of an API method. For instance: 6282// 6283// service Foo { 6284// rpc Bar(google.protobuf.Empty) returns 6285// (google.protobuf.Empty); 6286// } 6287// 6288// The JSON representation for `Empty` is empty JSON object `{}`. 6289type GoogleProtobufEmpty struct { 6290 // ServerResponse contains the HTTP response code and headers from the 6291 // server. 6292 googleapi.ServerResponse `json:"-"` 6293} 6294 6295// GoogleRpcStatus: The `Status` type defines a logical error model that 6296// is suitable for 6297// different programming environments, including REST APIs and RPC APIs. 6298// It is 6299// used by [gRPC](https://github.com/grpc). Each `Status` message 6300// contains 6301// three pieces of data: error code, error message, and error 6302// details. 6303// 6304// You can find out more about this error model and how to work with it 6305// in the 6306// [API Design Guide](https://cloud.google.com/apis/design/errors). 6307type GoogleRpcStatus struct { 6308 // Code: The status code, which should be an enum value of 6309 // google.rpc.Code. 6310 Code int64 `json:"code,omitempty"` 6311 6312 // Details: A list of messages that carry the error details. There is a 6313 // common set of 6314 // message types for APIs to use. 6315 Details []googleapi.RawMessage `json:"details,omitempty"` 6316 6317 // Message: A developer-facing error message, which should be in 6318 // English. Any 6319 // user-facing error message should be localized and sent in 6320 // the 6321 // google.rpc.Status.details field, or localized by the client. 6322 Message string `json:"message,omitempty"` 6323 6324 // ForceSendFields is a list of field names (e.g. "Code") to 6325 // unconditionally include in API requests. By default, fields with 6326 // empty values are omitted from API requests. However, any non-pointer, 6327 // non-interface field appearing in ForceSendFields will be sent to the 6328 // server regardless of whether the field is empty or not. This may be 6329 // used to include empty fields in Patch requests. 6330 ForceSendFields []string `json:"-"` 6331 6332 // NullFields is a list of field names (e.g. "Code") to include in API 6333 // requests with the JSON null value. By default, fields with empty 6334 // values are omitted from API requests. However, any field with an 6335 // empty value appearing in NullFields will be sent to the server as 6336 // null. It is an error if a field in this list has a non-empty value. 6337 // This may be used to include null fields in Patch requests. 6338 NullFields []string `json:"-"` 6339} 6340 6341func (s *GoogleRpcStatus) MarshalJSON() ([]byte, error) { 6342 type NoMethod GoogleRpcStatus 6343 raw := NoMethod(*s) 6344 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6345} 6346 6347// GoogleTypeLatLng: An object representing a latitude/longitude pair. 6348// This is expressed as a pair 6349// of doubles representing degrees latitude and degrees longitude. 6350// Unless 6351// specified otherwise, this must conform to the 6352// <a 6353// href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84 6354// st 6355// andard</a>. Values must be within normalized ranges. 6356type GoogleTypeLatLng struct { 6357 // Latitude: The latitude in degrees. It must be in the range [-90.0, 6358 // +90.0]. 6359 Latitude float64 `json:"latitude,omitempty"` 6360 6361 // Longitude: The longitude in degrees. It must be in the range [-180.0, 6362 // +180.0]. 6363 Longitude float64 `json:"longitude,omitempty"` 6364 6365 // ForceSendFields is a list of field names (e.g. "Latitude") to 6366 // unconditionally include in API requests. By default, fields with 6367 // empty values are omitted from API requests. However, any non-pointer, 6368 // non-interface field appearing in ForceSendFields will be sent to the 6369 // server regardless of whether the field is empty or not. This may be 6370 // used to include empty fields in Patch requests. 6371 ForceSendFields []string `json:"-"` 6372 6373 // NullFields is a list of field names (e.g. "Latitude") to include in 6374 // API requests with the JSON null value. By default, fields with empty 6375 // values are omitted from API requests. However, any field with an 6376 // empty value appearing in NullFields will be sent to the server as 6377 // null. It is an error if a field in this list has a non-empty value. 6378 // This may be used to include null fields in Patch requests. 6379 NullFields []string `json:"-"` 6380} 6381 6382func (s *GoogleTypeLatLng) MarshalJSON() ([]byte, error) { 6383 type NoMethod GoogleTypeLatLng 6384 raw := NoMethod(*s) 6385 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 6386} 6387 6388func (s *GoogleTypeLatLng) UnmarshalJSON(data []byte) error { 6389 type NoMethod GoogleTypeLatLng 6390 var s1 struct { 6391 Latitude gensupport.JSONFloat64 `json:"latitude"` 6392 Longitude gensupport.JSONFloat64 `json:"longitude"` 6393 *NoMethod 6394 } 6395 s1.NoMethod = (*NoMethod)(s) 6396 if err := json.Unmarshal(data, &s1); err != nil { 6397 return err 6398 } 6399 s.Latitude = float64(s1.Latitude) 6400 s.Longitude = float64(s1.Longitude) 6401 return nil 6402} 6403 6404// method id "dialogflow.projects.agent": 6405 6406type ProjectsAgentCall struct { 6407 s *Service 6408 parent string 6409 googleclouddialogflowv2agent *GoogleCloudDialogflowV2Agent 6410 urlParams_ gensupport.URLParams 6411 ctx_ context.Context 6412 header_ http.Header 6413} 6414 6415// Agent: Creates/updates the specified agent. 6416func (r *ProjectsService) Agent(parent string, googleclouddialogflowv2agent *GoogleCloudDialogflowV2Agent) *ProjectsAgentCall { 6417 c := &ProjectsAgentCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6418 c.parent = parent 6419 c.googleclouddialogflowv2agent = googleclouddialogflowv2agent 6420 return c 6421} 6422 6423// UpdateMask sets the optional parameter "updateMask": The mask to 6424// control which fields get updated. 6425func (c *ProjectsAgentCall) UpdateMask(updateMask string) *ProjectsAgentCall { 6426 c.urlParams_.Set("updateMask", updateMask) 6427 return c 6428} 6429 6430// Fields allows partial responses to be retrieved. See 6431// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6432// for more information. 6433func (c *ProjectsAgentCall) Fields(s ...googleapi.Field) *ProjectsAgentCall { 6434 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6435 return c 6436} 6437 6438// Context sets the context to be used in this call's Do method. Any 6439// pending HTTP request will be aborted if the provided context is 6440// canceled. 6441func (c *ProjectsAgentCall) Context(ctx context.Context) *ProjectsAgentCall { 6442 c.ctx_ = ctx 6443 return c 6444} 6445 6446// Header returns an http.Header that can be modified by the caller to 6447// add HTTP headers to the request. 6448func (c *ProjectsAgentCall) Header() http.Header { 6449 if c.header_ == nil { 6450 c.header_ = make(http.Header) 6451 } 6452 return c.header_ 6453} 6454 6455func (c *ProjectsAgentCall) doRequest(alt string) (*http.Response, error) { 6456 reqHeaders := make(http.Header) 6457 for k, v := range c.header_ { 6458 reqHeaders[k] = v 6459 } 6460 reqHeaders.Set("User-Agent", c.s.userAgent()) 6461 var body io.Reader = nil 6462 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2agent) 6463 if err != nil { 6464 return nil, err 6465 } 6466 reqHeaders.Set("Content-Type", "application/json") 6467 c.urlParams_.Set("alt", alt) 6468 c.urlParams_.Set("prettyPrint", "false") 6469 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/agent") 6470 urls += "?" + c.urlParams_.Encode() 6471 req, err := http.NewRequest("POST", urls, body) 6472 if err != nil { 6473 return nil, err 6474 } 6475 req.Header = reqHeaders 6476 googleapi.Expand(req.URL, map[string]string{ 6477 "parent": c.parent, 6478 }) 6479 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6480} 6481 6482// Do executes the "dialogflow.projects.agent" call. 6483// Exactly one of *GoogleCloudDialogflowV2Agent or error will be 6484// non-nil. Any non-2xx status code is an error. Response headers are in 6485// either *GoogleCloudDialogflowV2Agent.ServerResponse.Header or (if a 6486// response was returned at all) in error.(*googleapi.Error).Header. Use 6487// googleapi.IsNotModified to check whether the returned error was 6488// because http.StatusNotModified was returned. 6489func (c *ProjectsAgentCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2Agent, error) { 6490 gensupport.SetOptions(c.urlParams_, opts...) 6491 res, err := c.doRequest("json") 6492 if res != nil && res.StatusCode == http.StatusNotModified { 6493 if res.Body != nil { 6494 res.Body.Close() 6495 } 6496 return nil, &googleapi.Error{ 6497 Code: res.StatusCode, 6498 Header: res.Header, 6499 } 6500 } 6501 if err != nil { 6502 return nil, err 6503 } 6504 defer googleapi.CloseBody(res) 6505 if err := googleapi.CheckResponse(res); err != nil { 6506 return nil, err 6507 } 6508 ret := &GoogleCloudDialogflowV2Agent{ 6509 ServerResponse: googleapi.ServerResponse{ 6510 Header: res.Header, 6511 HTTPStatusCode: res.StatusCode, 6512 }, 6513 } 6514 target := &ret 6515 if err := gensupport.DecodeResponse(target, res); err != nil { 6516 return nil, err 6517 } 6518 return ret, nil 6519 // { 6520 // "description": "Creates/updates the specified agent.", 6521 // "flatPath": "v2/projects/{projectsId}/agent", 6522 // "httpMethod": "POST", 6523 // "id": "dialogflow.projects.agent", 6524 // "parameterOrder": [ 6525 // "parent" 6526 // ], 6527 // "parameters": { 6528 // "parent": { 6529 // "description": "Required. The project of this agent.\nFormat: `projects/\u003cProject ID\u003e`.", 6530 // "location": "path", 6531 // "pattern": "^projects/[^/]+$", 6532 // "required": true, 6533 // "type": "string" 6534 // }, 6535 // "updateMask": { 6536 // "description": "Optional. The mask to control which fields get updated.", 6537 // "format": "google-fieldmask", 6538 // "location": "query", 6539 // "type": "string" 6540 // } 6541 // }, 6542 // "path": "v2/{+parent}/agent", 6543 // "request": { 6544 // "$ref": "GoogleCloudDialogflowV2Agent" 6545 // }, 6546 // "response": { 6547 // "$ref": "GoogleCloudDialogflowV2Agent" 6548 // }, 6549 // "scopes": [ 6550 // "https://www.googleapis.com/auth/cloud-platform", 6551 // "https://www.googleapis.com/auth/dialogflow" 6552 // ] 6553 // } 6554 6555} 6556 6557// method id "dialogflow.projects.deleteAgent": 6558 6559type ProjectsDeleteAgentCall struct { 6560 s *Service 6561 parent string 6562 urlParams_ gensupport.URLParams 6563 ctx_ context.Context 6564 header_ http.Header 6565} 6566 6567// DeleteAgent: Deletes the specified agent. 6568func (r *ProjectsService) DeleteAgent(parent string) *ProjectsDeleteAgentCall { 6569 c := &ProjectsDeleteAgentCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6570 c.parent = parent 6571 return c 6572} 6573 6574// Fields allows partial responses to be retrieved. See 6575// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6576// for more information. 6577func (c *ProjectsDeleteAgentCall) Fields(s ...googleapi.Field) *ProjectsDeleteAgentCall { 6578 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6579 return c 6580} 6581 6582// Context sets the context to be used in this call's Do method. Any 6583// pending HTTP request will be aborted if the provided context is 6584// canceled. 6585func (c *ProjectsDeleteAgentCall) Context(ctx context.Context) *ProjectsDeleteAgentCall { 6586 c.ctx_ = ctx 6587 return c 6588} 6589 6590// Header returns an http.Header that can be modified by the caller to 6591// add HTTP headers to the request. 6592func (c *ProjectsDeleteAgentCall) Header() http.Header { 6593 if c.header_ == nil { 6594 c.header_ = make(http.Header) 6595 } 6596 return c.header_ 6597} 6598 6599func (c *ProjectsDeleteAgentCall) doRequest(alt string) (*http.Response, error) { 6600 reqHeaders := make(http.Header) 6601 for k, v := range c.header_ { 6602 reqHeaders[k] = v 6603 } 6604 reqHeaders.Set("User-Agent", c.s.userAgent()) 6605 var body io.Reader = nil 6606 c.urlParams_.Set("alt", alt) 6607 c.urlParams_.Set("prettyPrint", "false") 6608 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/agent") 6609 urls += "?" + c.urlParams_.Encode() 6610 req, err := http.NewRequest("DELETE", urls, body) 6611 if err != nil { 6612 return nil, err 6613 } 6614 req.Header = reqHeaders 6615 googleapi.Expand(req.URL, map[string]string{ 6616 "parent": c.parent, 6617 }) 6618 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6619} 6620 6621// Do executes the "dialogflow.projects.deleteAgent" call. 6622// Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any 6623// non-2xx status code is an error. Response headers are in either 6624// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was 6625// returned at all) in error.(*googleapi.Error).Header. Use 6626// googleapi.IsNotModified to check whether the returned error was 6627// because http.StatusNotModified was returned. 6628func (c *ProjectsDeleteAgentCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { 6629 gensupport.SetOptions(c.urlParams_, opts...) 6630 res, err := c.doRequest("json") 6631 if res != nil && res.StatusCode == http.StatusNotModified { 6632 if res.Body != nil { 6633 res.Body.Close() 6634 } 6635 return nil, &googleapi.Error{ 6636 Code: res.StatusCode, 6637 Header: res.Header, 6638 } 6639 } 6640 if err != nil { 6641 return nil, err 6642 } 6643 defer googleapi.CloseBody(res) 6644 if err := googleapi.CheckResponse(res); err != nil { 6645 return nil, err 6646 } 6647 ret := &GoogleProtobufEmpty{ 6648 ServerResponse: googleapi.ServerResponse{ 6649 Header: res.Header, 6650 HTTPStatusCode: res.StatusCode, 6651 }, 6652 } 6653 target := &ret 6654 if err := gensupport.DecodeResponse(target, res); err != nil { 6655 return nil, err 6656 } 6657 return ret, nil 6658 // { 6659 // "description": "Deletes the specified agent.", 6660 // "flatPath": "v2/projects/{projectsId}/agent", 6661 // "httpMethod": "DELETE", 6662 // "id": "dialogflow.projects.deleteAgent", 6663 // "parameterOrder": [ 6664 // "parent" 6665 // ], 6666 // "parameters": { 6667 // "parent": { 6668 // "description": "Required. The project that the agent to delete is associated with.\nFormat: `projects/\u003cProject ID\u003e`.", 6669 // "location": "path", 6670 // "pattern": "^projects/[^/]+$", 6671 // "required": true, 6672 // "type": "string" 6673 // } 6674 // }, 6675 // "path": "v2/{+parent}/agent", 6676 // "response": { 6677 // "$ref": "GoogleProtobufEmpty" 6678 // }, 6679 // "scopes": [ 6680 // "https://www.googleapis.com/auth/cloud-platform", 6681 // "https://www.googleapis.com/auth/dialogflow" 6682 // ] 6683 // } 6684 6685} 6686 6687// method id "dialogflow.projects.getAgent": 6688 6689type ProjectsGetAgentCall struct { 6690 s *Service 6691 parent string 6692 urlParams_ gensupport.URLParams 6693 ifNoneMatch_ string 6694 ctx_ context.Context 6695 header_ http.Header 6696} 6697 6698// GetAgent: Retrieves the specified agent. 6699func (r *ProjectsService) GetAgent(parent string) *ProjectsGetAgentCall { 6700 c := &ProjectsGetAgentCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6701 c.parent = parent 6702 return c 6703} 6704 6705// Fields allows partial responses to be retrieved. See 6706// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6707// for more information. 6708func (c *ProjectsGetAgentCall) Fields(s ...googleapi.Field) *ProjectsGetAgentCall { 6709 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6710 return c 6711} 6712 6713// IfNoneMatch sets the optional parameter which makes the operation 6714// fail if the object's ETag matches the given value. This is useful for 6715// getting updates only after the object has changed since the last 6716// request. Use googleapi.IsNotModified to check whether the response 6717// error from Do is the result of In-None-Match. 6718func (c *ProjectsGetAgentCall) IfNoneMatch(entityTag string) *ProjectsGetAgentCall { 6719 c.ifNoneMatch_ = entityTag 6720 return c 6721} 6722 6723// Context sets the context to be used in this call's Do method. Any 6724// pending HTTP request will be aborted if the provided context is 6725// canceled. 6726func (c *ProjectsGetAgentCall) Context(ctx context.Context) *ProjectsGetAgentCall { 6727 c.ctx_ = ctx 6728 return c 6729} 6730 6731// Header returns an http.Header that can be modified by the caller to 6732// add HTTP headers to the request. 6733func (c *ProjectsGetAgentCall) Header() http.Header { 6734 if c.header_ == nil { 6735 c.header_ = make(http.Header) 6736 } 6737 return c.header_ 6738} 6739 6740func (c *ProjectsGetAgentCall) doRequest(alt string) (*http.Response, error) { 6741 reqHeaders := make(http.Header) 6742 for k, v := range c.header_ { 6743 reqHeaders[k] = v 6744 } 6745 reqHeaders.Set("User-Agent", c.s.userAgent()) 6746 if c.ifNoneMatch_ != "" { 6747 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6748 } 6749 var body io.Reader = nil 6750 c.urlParams_.Set("alt", alt) 6751 c.urlParams_.Set("prettyPrint", "false") 6752 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/agent") 6753 urls += "?" + c.urlParams_.Encode() 6754 req, err := http.NewRequest("GET", urls, body) 6755 if err != nil { 6756 return nil, err 6757 } 6758 req.Header = reqHeaders 6759 googleapi.Expand(req.URL, map[string]string{ 6760 "parent": c.parent, 6761 }) 6762 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6763} 6764 6765// Do executes the "dialogflow.projects.getAgent" call. 6766// Exactly one of *GoogleCloudDialogflowV2Agent or error will be 6767// non-nil. Any non-2xx status code is an error. Response headers are in 6768// either *GoogleCloudDialogflowV2Agent.ServerResponse.Header or (if a 6769// response was returned at all) in error.(*googleapi.Error).Header. Use 6770// googleapi.IsNotModified to check whether the returned error was 6771// because http.StatusNotModified was returned. 6772func (c *ProjectsGetAgentCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2Agent, error) { 6773 gensupport.SetOptions(c.urlParams_, opts...) 6774 res, err := c.doRequest("json") 6775 if res != nil && res.StatusCode == http.StatusNotModified { 6776 if res.Body != nil { 6777 res.Body.Close() 6778 } 6779 return nil, &googleapi.Error{ 6780 Code: res.StatusCode, 6781 Header: res.Header, 6782 } 6783 } 6784 if err != nil { 6785 return nil, err 6786 } 6787 defer googleapi.CloseBody(res) 6788 if err := googleapi.CheckResponse(res); err != nil { 6789 return nil, err 6790 } 6791 ret := &GoogleCloudDialogflowV2Agent{ 6792 ServerResponse: googleapi.ServerResponse{ 6793 Header: res.Header, 6794 HTTPStatusCode: res.StatusCode, 6795 }, 6796 } 6797 target := &ret 6798 if err := gensupport.DecodeResponse(target, res); err != nil { 6799 return nil, err 6800 } 6801 return ret, nil 6802 // { 6803 // "description": "Retrieves the specified agent.", 6804 // "flatPath": "v2/projects/{projectsId}/agent", 6805 // "httpMethod": "GET", 6806 // "id": "dialogflow.projects.getAgent", 6807 // "parameterOrder": [ 6808 // "parent" 6809 // ], 6810 // "parameters": { 6811 // "parent": { 6812 // "description": "Required. The project that the agent to fetch is associated with.\nFormat: `projects/\u003cProject ID\u003e`.", 6813 // "location": "path", 6814 // "pattern": "^projects/[^/]+$", 6815 // "required": true, 6816 // "type": "string" 6817 // } 6818 // }, 6819 // "path": "v2/{+parent}/agent", 6820 // "response": { 6821 // "$ref": "GoogleCloudDialogflowV2Agent" 6822 // }, 6823 // "scopes": [ 6824 // "https://www.googleapis.com/auth/cloud-platform", 6825 // "https://www.googleapis.com/auth/dialogflow" 6826 // ] 6827 // } 6828 6829} 6830 6831// method id "dialogflow.projects.agent.export": 6832 6833type ProjectsAgentExportCall struct { 6834 s *Service 6835 parent string 6836 googleclouddialogflowv2exportagentrequest *GoogleCloudDialogflowV2ExportAgentRequest 6837 urlParams_ gensupport.URLParams 6838 ctx_ context.Context 6839 header_ http.Header 6840} 6841 6842// Export: Exports the specified agent to a ZIP file. 6843// 6844// Operation <response: ExportAgentResponse> 6845func (r *ProjectsAgentService) Export(parent string, googleclouddialogflowv2exportagentrequest *GoogleCloudDialogflowV2ExportAgentRequest) *ProjectsAgentExportCall { 6846 c := &ProjectsAgentExportCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6847 c.parent = parent 6848 c.googleclouddialogflowv2exportagentrequest = googleclouddialogflowv2exportagentrequest 6849 return c 6850} 6851 6852// Fields allows partial responses to be retrieved. See 6853// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6854// for more information. 6855func (c *ProjectsAgentExportCall) Fields(s ...googleapi.Field) *ProjectsAgentExportCall { 6856 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6857 return c 6858} 6859 6860// Context sets the context to be used in this call's Do method. Any 6861// pending HTTP request will be aborted if the provided context is 6862// canceled. 6863func (c *ProjectsAgentExportCall) Context(ctx context.Context) *ProjectsAgentExportCall { 6864 c.ctx_ = ctx 6865 return c 6866} 6867 6868// Header returns an http.Header that can be modified by the caller to 6869// add HTTP headers to the request. 6870func (c *ProjectsAgentExportCall) Header() http.Header { 6871 if c.header_ == nil { 6872 c.header_ = make(http.Header) 6873 } 6874 return c.header_ 6875} 6876 6877func (c *ProjectsAgentExportCall) doRequest(alt string) (*http.Response, error) { 6878 reqHeaders := make(http.Header) 6879 for k, v := range c.header_ { 6880 reqHeaders[k] = v 6881 } 6882 reqHeaders.Set("User-Agent", c.s.userAgent()) 6883 var body io.Reader = nil 6884 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2exportagentrequest) 6885 if err != nil { 6886 return nil, err 6887 } 6888 reqHeaders.Set("Content-Type", "application/json") 6889 c.urlParams_.Set("alt", alt) 6890 c.urlParams_.Set("prettyPrint", "false") 6891 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/agent:export") 6892 urls += "?" + c.urlParams_.Encode() 6893 req, err := http.NewRequest("POST", urls, body) 6894 if err != nil { 6895 return nil, err 6896 } 6897 req.Header = reqHeaders 6898 googleapi.Expand(req.URL, map[string]string{ 6899 "parent": c.parent, 6900 }) 6901 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6902} 6903 6904// Do executes the "dialogflow.projects.agent.export" call. 6905// Exactly one of *GoogleLongrunningOperation or error will be non-nil. 6906// Any non-2xx status code is an error. Response headers are in either 6907// *GoogleLongrunningOperation.ServerResponse.Header or (if a response 6908// was returned at all) in error.(*googleapi.Error).Header. Use 6909// googleapi.IsNotModified to check whether the returned error was 6910// because http.StatusNotModified was returned. 6911func (c *ProjectsAgentExportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 6912 gensupport.SetOptions(c.urlParams_, opts...) 6913 res, err := c.doRequest("json") 6914 if res != nil && res.StatusCode == http.StatusNotModified { 6915 if res.Body != nil { 6916 res.Body.Close() 6917 } 6918 return nil, &googleapi.Error{ 6919 Code: res.StatusCode, 6920 Header: res.Header, 6921 } 6922 } 6923 if err != nil { 6924 return nil, err 6925 } 6926 defer googleapi.CloseBody(res) 6927 if err := googleapi.CheckResponse(res); err != nil { 6928 return nil, err 6929 } 6930 ret := &GoogleLongrunningOperation{ 6931 ServerResponse: googleapi.ServerResponse{ 6932 Header: res.Header, 6933 HTTPStatusCode: res.StatusCode, 6934 }, 6935 } 6936 target := &ret 6937 if err := gensupport.DecodeResponse(target, res); err != nil { 6938 return nil, err 6939 } 6940 return ret, nil 6941 // { 6942 // "description": "Exports the specified agent to a ZIP file.\n\nOperation \u003cresponse: ExportAgentResponse\u003e", 6943 // "flatPath": "v2/projects/{projectsId}/agent:export", 6944 // "httpMethod": "POST", 6945 // "id": "dialogflow.projects.agent.export", 6946 // "parameterOrder": [ 6947 // "parent" 6948 // ], 6949 // "parameters": { 6950 // "parent": { 6951 // "description": "Required. The project that the agent to export is associated with.\nFormat: `projects/\u003cProject ID\u003e`.", 6952 // "location": "path", 6953 // "pattern": "^projects/[^/]+$", 6954 // "required": true, 6955 // "type": "string" 6956 // } 6957 // }, 6958 // "path": "v2/{+parent}/agent:export", 6959 // "request": { 6960 // "$ref": "GoogleCloudDialogflowV2ExportAgentRequest" 6961 // }, 6962 // "response": { 6963 // "$ref": "GoogleLongrunningOperation" 6964 // }, 6965 // "scopes": [ 6966 // "https://www.googleapis.com/auth/cloud-platform", 6967 // "https://www.googleapis.com/auth/dialogflow" 6968 // ] 6969 // } 6970 6971} 6972 6973// method id "dialogflow.projects.agent.import": 6974 6975type ProjectsAgentImportCall struct { 6976 s *Service 6977 parent string 6978 googleclouddialogflowv2importagentrequest *GoogleCloudDialogflowV2ImportAgentRequest 6979 urlParams_ gensupport.URLParams 6980 ctx_ context.Context 6981 header_ http.Header 6982} 6983 6984// Import: Imports the specified agent from a ZIP file. 6985// 6986// Uploads new intents and entity types without deleting the existing 6987// ones. 6988// Intents and entity types with the same name are replaced with the 6989// new 6990// versions from ImportAgentRequest. 6991// 6992// Operation <response: google.protobuf.Empty> 6993func (r *ProjectsAgentService) Import(parent string, googleclouddialogflowv2importagentrequest *GoogleCloudDialogflowV2ImportAgentRequest) *ProjectsAgentImportCall { 6994 c := &ProjectsAgentImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6995 c.parent = parent 6996 c.googleclouddialogflowv2importagentrequest = googleclouddialogflowv2importagentrequest 6997 return c 6998} 6999 7000// Fields allows partial responses to be retrieved. See 7001// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7002// for more information. 7003func (c *ProjectsAgentImportCall) Fields(s ...googleapi.Field) *ProjectsAgentImportCall { 7004 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7005 return c 7006} 7007 7008// Context sets the context to be used in this call's Do method. Any 7009// pending HTTP request will be aborted if the provided context is 7010// canceled. 7011func (c *ProjectsAgentImportCall) Context(ctx context.Context) *ProjectsAgentImportCall { 7012 c.ctx_ = ctx 7013 return c 7014} 7015 7016// Header returns an http.Header that can be modified by the caller to 7017// add HTTP headers to the request. 7018func (c *ProjectsAgentImportCall) Header() http.Header { 7019 if c.header_ == nil { 7020 c.header_ = make(http.Header) 7021 } 7022 return c.header_ 7023} 7024 7025func (c *ProjectsAgentImportCall) doRequest(alt string) (*http.Response, error) { 7026 reqHeaders := make(http.Header) 7027 for k, v := range c.header_ { 7028 reqHeaders[k] = v 7029 } 7030 reqHeaders.Set("User-Agent", c.s.userAgent()) 7031 var body io.Reader = nil 7032 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2importagentrequest) 7033 if err != nil { 7034 return nil, err 7035 } 7036 reqHeaders.Set("Content-Type", "application/json") 7037 c.urlParams_.Set("alt", alt) 7038 c.urlParams_.Set("prettyPrint", "false") 7039 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/agent:import") 7040 urls += "?" + c.urlParams_.Encode() 7041 req, err := http.NewRequest("POST", urls, body) 7042 if err != nil { 7043 return nil, err 7044 } 7045 req.Header = reqHeaders 7046 googleapi.Expand(req.URL, map[string]string{ 7047 "parent": c.parent, 7048 }) 7049 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7050} 7051 7052// Do executes the "dialogflow.projects.agent.import" call. 7053// Exactly one of *GoogleLongrunningOperation or error will be non-nil. 7054// Any non-2xx status code is an error. Response headers are in either 7055// *GoogleLongrunningOperation.ServerResponse.Header or (if a response 7056// was returned at all) in error.(*googleapi.Error).Header. Use 7057// googleapi.IsNotModified to check whether the returned error was 7058// because http.StatusNotModified was returned. 7059func (c *ProjectsAgentImportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 7060 gensupport.SetOptions(c.urlParams_, opts...) 7061 res, err := c.doRequest("json") 7062 if res != nil && res.StatusCode == http.StatusNotModified { 7063 if res.Body != nil { 7064 res.Body.Close() 7065 } 7066 return nil, &googleapi.Error{ 7067 Code: res.StatusCode, 7068 Header: res.Header, 7069 } 7070 } 7071 if err != nil { 7072 return nil, err 7073 } 7074 defer googleapi.CloseBody(res) 7075 if err := googleapi.CheckResponse(res); err != nil { 7076 return nil, err 7077 } 7078 ret := &GoogleLongrunningOperation{ 7079 ServerResponse: googleapi.ServerResponse{ 7080 Header: res.Header, 7081 HTTPStatusCode: res.StatusCode, 7082 }, 7083 } 7084 target := &ret 7085 if err := gensupport.DecodeResponse(target, res); err != nil { 7086 return nil, err 7087 } 7088 return ret, nil 7089 // { 7090 // "description": "Imports the specified agent from a ZIP file.\n\nUploads new intents and entity types without deleting the existing ones.\nIntents and entity types with the same name are replaced with the new\nversions from ImportAgentRequest.\n\nOperation \u003cresponse: google.protobuf.Empty\u003e", 7091 // "flatPath": "v2/projects/{projectsId}/agent:import", 7092 // "httpMethod": "POST", 7093 // "id": "dialogflow.projects.agent.import", 7094 // "parameterOrder": [ 7095 // "parent" 7096 // ], 7097 // "parameters": { 7098 // "parent": { 7099 // "description": "Required. The project that the agent to import is associated with.\nFormat: `projects/\u003cProject ID\u003e`.", 7100 // "location": "path", 7101 // "pattern": "^projects/[^/]+$", 7102 // "required": true, 7103 // "type": "string" 7104 // } 7105 // }, 7106 // "path": "v2/{+parent}/agent:import", 7107 // "request": { 7108 // "$ref": "GoogleCloudDialogflowV2ImportAgentRequest" 7109 // }, 7110 // "response": { 7111 // "$ref": "GoogleLongrunningOperation" 7112 // }, 7113 // "scopes": [ 7114 // "https://www.googleapis.com/auth/cloud-platform", 7115 // "https://www.googleapis.com/auth/dialogflow" 7116 // ] 7117 // } 7118 7119} 7120 7121// method id "dialogflow.projects.agent.restore": 7122 7123type ProjectsAgentRestoreCall struct { 7124 s *Service 7125 parent string 7126 googleclouddialogflowv2restoreagentrequest *GoogleCloudDialogflowV2RestoreAgentRequest 7127 urlParams_ gensupport.URLParams 7128 ctx_ context.Context 7129 header_ http.Header 7130} 7131 7132// Restore: Restores the specified agent from a ZIP file. 7133// 7134// Replaces the current agent version with a new one. All the intents 7135// and 7136// entity types in the older version are deleted. 7137// 7138// Operation <response: google.protobuf.Empty> 7139func (r *ProjectsAgentService) Restore(parent string, googleclouddialogflowv2restoreagentrequest *GoogleCloudDialogflowV2RestoreAgentRequest) *ProjectsAgentRestoreCall { 7140 c := &ProjectsAgentRestoreCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7141 c.parent = parent 7142 c.googleclouddialogflowv2restoreagentrequest = googleclouddialogflowv2restoreagentrequest 7143 return c 7144} 7145 7146// Fields allows partial responses to be retrieved. See 7147// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7148// for more information. 7149func (c *ProjectsAgentRestoreCall) Fields(s ...googleapi.Field) *ProjectsAgentRestoreCall { 7150 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7151 return c 7152} 7153 7154// Context sets the context to be used in this call's Do method. Any 7155// pending HTTP request will be aborted if the provided context is 7156// canceled. 7157func (c *ProjectsAgentRestoreCall) Context(ctx context.Context) *ProjectsAgentRestoreCall { 7158 c.ctx_ = ctx 7159 return c 7160} 7161 7162// Header returns an http.Header that can be modified by the caller to 7163// add HTTP headers to the request. 7164func (c *ProjectsAgentRestoreCall) Header() http.Header { 7165 if c.header_ == nil { 7166 c.header_ = make(http.Header) 7167 } 7168 return c.header_ 7169} 7170 7171func (c *ProjectsAgentRestoreCall) doRequest(alt string) (*http.Response, error) { 7172 reqHeaders := make(http.Header) 7173 for k, v := range c.header_ { 7174 reqHeaders[k] = v 7175 } 7176 reqHeaders.Set("User-Agent", c.s.userAgent()) 7177 var body io.Reader = nil 7178 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2restoreagentrequest) 7179 if err != nil { 7180 return nil, err 7181 } 7182 reqHeaders.Set("Content-Type", "application/json") 7183 c.urlParams_.Set("alt", alt) 7184 c.urlParams_.Set("prettyPrint", "false") 7185 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/agent:restore") 7186 urls += "?" + c.urlParams_.Encode() 7187 req, err := http.NewRequest("POST", urls, body) 7188 if err != nil { 7189 return nil, err 7190 } 7191 req.Header = reqHeaders 7192 googleapi.Expand(req.URL, map[string]string{ 7193 "parent": c.parent, 7194 }) 7195 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7196} 7197 7198// Do executes the "dialogflow.projects.agent.restore" call. 7199// Exactly one of *GoogleLongrunningOperation or error will be non-nil. 7200// Any non-2xx status code is an error. Response headers are in either 7201// *GoogleLongrunningOperation.ServerResponse.Header or (if a response 7202// was returned at all) in error.(*googleapi.Error).Header. Use 7203// googleapi.IsNotModified to check whether the returned error was 7204// because http.StatusNotModified was returned. 7205func (c *ProjectsAgentRestoreCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 7206 gensupport.SetOptions(c.urlParams_, opts...) 7207 res, err := c.doRequest("json") 7208 if res != nil && res.StatusCode == http.StatusNotModified { 7209 if res.Body != nil { 7210 res.Body.Close() 7211 } 7212 return nil, &googleapi.Error{ 7213 Code: res.StatusCode, 7214 Header: res.Header, 7215 } 7216 } 7217 if err != nil { 7218 return nil, err 7219 } 7220 defer googleapi.CloseBody(res) 7221 if err := googleapi.CheckResponse(res); err != nil { 7222 return nil, err 7223 } 7224 ret := &GoogleLongrunningOperation{ 7225 ServerResponse: googleapi.ServerResponse{ 7226 Header: res.Header, 7227 HTTPStatusCode: res.StatusCode, 7228 }, 7229 } 7230 target := &ret 7231 if err := gensupport.DecodeResponse(target, res); err != nil { 7232 return nil, err 7233 } 7234 return ret, nil 7235 // { 7236 // "description": "Restores the specified agent from a ZIP file.\n\nReplaces the current agent version with a new one. All the intents and\nentity types in the older version are deleted.\n\nOperation \u003cresponse: google.protobuf.Empty\u003e", 7237 // "flatPath": "v2/projects/{projectsId}/agent:restore", 7238 // "httpMethod": "POST", 7239 // "id": "dialogflow.projects.agent.restore", 7240 // "parameterOrder": [ 7241 // "parent" 7242 // ], 7243 // "parameters": { 7244 // "parent": { 7245 // "description": "Required. The project that the agent to restore is associated with.\nFormat: `projects/\u003cProject ID\u003e`.", 7246 // "location": "path", 7247 // "pattern": "^projects/[^/]+$", 7248 // "required": true, 7249 // "type": "string" 7250 // } 7251 // }, 7252 // "path": "v2/{+parent}/agent:restore", 7253 // "request": { 7254 // "$ref": "GoogleCloudDialogflowV2RestoreAgentRequest" 7255 // }, 7256 // "response": { 7257 // "$ref": "GoogleLongrunningOperation" 7258 // }, 7259 // "scopes": [ 7260 // "https://www.googleapis.com/auth/cloud-platform", 7261 // "https://www.googleapis.com/auth/dialogflow" 7262 // ] 7263 // } 7264 7265} 7266 7267// method id "dialogflow.projects.agent.search": 7268 7269type ProjectsAgentSearchCall struct { 7270 s *Service 7271 parent string 7272 urlParams_ gensupport.URLParams 7273 ifNoneMatch_ string 7274 ctx_ context.Context 7275 header_ http.Header 7276} 7277 7278// Search: Returns the list of agents. 7279// 7280// Since there is at most one conversational agent per project, this 7281// method is 7282// useful primarily for listing all agents across projects the caller 7283// has 7284// access to. One can achieve that with a wildcard project collection id 7285// "-". 7286// Refer to 7287// [List 7288// Sub-Collections](https://cloud.google.com/apis/design/design_pat 7289// terns#list_sub-collections). 7290func (r *ProjectsAgentService) Search(parent string) *ProjectsAgentSearchCall { 7291 c := &ProjectsAgentSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7292 c.parent = parent 7293 return c 7294} 7295 7296// PageSize sets the optional parameter "pageSize": The maximum number 7297// of items to return in a single page. By 7298// default 100 and at most 1000. 7299func (c *ProjectsAgentSearchCall) PageSize(pageSize int64) *ProjectsAgentSearchCall { 7300 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 7301 return c 7302} 7303 7304// PageToken sets the optional parameter "pageToken": The 7305// next_page_token value returned from a previous list request. 7306func (c *ProjectsAgentSearchCall) PageToken(pageToken string) *ProjectsAgentSearchCall { 7307 c.urlParams_.Set("pageToken", pageToken) 7308 return c 7309} 7310 7311// Fields allows partial responses to be retrieved. See 7312// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7313// for more information. 7314func (c *ProjectsAgentSearchCall) Fields(s ...googleapi.Field) *ProjectsAgentSearchCall { 7315 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7316 return c 7317} 7318 7319// IfNoneMatch sets the optional parameter which makes the operation 7320// fail if the object's ETag matches the given value. This is useful for 7321// getting updates only after the object has changed since the last 7322// request. Use googleapi.IsNotModified to check whether the response 7323// error from Do is the result of In-None-Match. 7324func (c *ProjectsAgentSearchCall) IfNoneMatch(entityTag string) *ProjectsAgentSearchCall { 7325 c.ifNoneMatch_ = entityTag 7326 return c 7327} 7328 7329// Context sets the context to be used in this call's Do method. Any 7330// pending HTTP request will be aborted if the provided context is 7331// canceled. 7332func (c *ProjectsAgentSearchCall) Context(ctx context.Context) *ProjectsAgentSearchCall { 7333 c.ctx_ = ctx 7334 return c 7335} 7336 7337// Header returns an http.Header that can be modified by the caller to 7338// add HTTP headers to the request. 7339func (c *ProjectsAgentSearchCall) Header() http.Header { 7340 if c.header_ == nil { 7341 c.header_ = make(http.Header) 7342 } 7343 return c.header_ 7344} 7345 7346func (c *ProjectsAgentSearchCall) doRequest(alt string) (*http.Response, error) { 7347 reqHeaders := make(http.Header) 7348 for k, v := range c.header_ { 7349 reqHeaders[k] = v 7350 } 7351 reqHeaders.Set("User-Agent", c.s.userAgent()) 7352 if c.ifNoneMatch_ != "" { 7353 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7354 } 7355 var body io.Reader = nil 7356 c.urlParams_.Set("alt", alt) 7357 c.urlParams_.Set("prettyPrint", "false") 7358 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/agent:search") 7359 urls += "?" + c.urlParams_.Encode() 7360 req, err := http.NewRequest("GET", urls, body) 7361 if err != nil { 7362 return nil, err 7363 } 7364 req.Header = reqHeaders 7365 googleapi.Expand(req.URL, map[string]string{ 7366 "parent": c.parent, 7367 }) 7368 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7369} 7370 7371// Do executes the "dialogflow.projects.agent.search" call. 7372// Exactly one of *GoogleCloudDialogflowV2SearchAgentsResponse or error 7373// will be non-nil. Any non-2xx status code is an error. Response 7374// headers are in either 7375// *GoogleCloudDialogflowV2SearchAgentsResponse.ServerResponse.Header or 7376// (if a response was returned at all) in 7377// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 7378// whether the returned error was because http.StatusNotModified was 7379// returned. 7380func (c *ProjectsAgentSearchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2SearchAgentsResponse, error) { 7381 gensupport.SetOptions(c.urlParams_, opts...) 7382 res, err := c.doRequest("json") 7383 if res != nil && res.StatusCode == http.StatusNotModified { 7384 if res.Body != nil { 7385 res.Body.Close() 7386 } 7387 return nil, &googleapi.Error{ 7388 Code: res.StatusCode, 7389 Header: res.Header, 7390 } 7391 } 7392 if err != nil { 7393 return nil, err 7394 } 7395 defer googleapi.CloseBody(res) 7396 if err := googleapi.CheckResponse(res); err != nil { 7397 return nil, err 7398 } 7399 ret := &GoogleCloudDialogflowV2SearchAgentsResponse{ 7400 ServerResponse: googleapi.ServerResponse{ 7401 Header: res.Header, 7402 HTTPStatusCode: res.StatusCode, 7403 }, 7404 } 7405 target := &ret 7406 if err := gensupport.DecodeResponse(target, res); err != nil { 7407 return nil, err 7408 } 7409 return ret, nil 7410 // { 7411 // "description": "Returns the list of agents.\n\nSince there is at most one conversational agent per project, this method is\nuseful primarily for listing all agents across projects the caller has\naccess to. One can achieve that with a wildcard project collection id \"-\".\nRefer to [List\nSub-Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections).", 7412 // "flatPath": "v2/projects/{projectsId}/agent:search", 7413 // "httpMethod": "GET", 7414 // "id": "dialogflow.projects.agent.search", 7415 // "parameterOrder": [ 7416 // "parent" 7417 // ], 7418 // "parameters": { 7419 // "pageSize": { 7420 // "description": "Optional. The maximum number of items to return in a single page. By\ndefault 100 and at most 1000.", 7421 // "format": "int32", 7422 // "location": "query", 7423 // "type": "integer" 7424 // }, 7425 // "pageToken": { 7426 // "description": "Optional. The next_page_token value returned from a previous list request.", 7427 // "location": "query", 7428 // "type": "string" 7429 // }, 7430 // "parent": { 7431 // "description": "Required. The project to list agents from.\nFormat: `projects/\u003cProject ID or '-'\u003e`.", 7432 // "location": "path", 7433 // "pattern": "^projects/[^/]+$", 7434 // "required": true, 7435 // "type": "string" 7436 // } 7437 // }, 7438 // "path": "v2/{+parent}/agent:search", 7439 // "response": { 7440 // "$ref": "GoogleCloudDialogflowV2SearchAgentsResponse" 7441 // }, 7442 // "scopes": [ 7443 // "https://www.googleapis.com/auth/cloud-platform", 7444 // "https://www.googleapis.com/auth/dialogflow" 7445 // ] 7446 // } 7447 7448} 7449 7450// Pages invokes f for each page of results. 7451// A non-nil error returned from f will halt the iteration. 7452// The provided context supersedes any context provided to the Context method. 7453func (c *ProjectsAgentSearchCall) Pages(ctx context.Context, f func(*GoogleCloudDialogflowV2SearchAgentsResponse) error) error { 7454 c.ctx_ = ctx 7455 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 7456 for { 7457 x, err := c.Do() 7458 if err != nil { 7459 return err 7460 } 7461 if err := f(x); err != nil { 7462 return err 7463 } 7464 if x.NextPageToken == "" { 7465 return nil 7466 } 7467 c.PageToken(x.NextPageToken) 7468 } 7469} 7470 7471// method id "dialogflow.projects.agent.train": 7472 7473type ProjectsAgentTrainCall struct { 7474 s *Service 7475 parent string 7476 googleclouddialogflowv2trainagentrequest *GoogleCloudDialogflowV2TrainAgentRequest 7477 urlParams_ gensupport.URLParams 7478 ctx_ context.Context 7479 header_ http.Header 7480} 7481 7482// Train: Trains the specified agent. 7483// 7484// Operation <response: google.protobuf.Empty> 7485func (r *ProjectsAgentService) Train(parent string, googleclouddialogflowv2trainagentrequest *GoogleCloudDialogflowV2TrainAgentRequest) *ProjectsAgentTrainCall { 7486 c := &ProjectsAgentTrainCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7487 c.parent = parent 7488 c.googleclouddialogflowv2trainagentrequest = googleclouddialogflowv2trainagentrequest 7489 return c 7490} 7491 7492// Fields allows partial responses to be retrieved. See 7493// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7494// for more information. 7495func (c *ProjectsAgentTrainCall) Fields(s ...googleapi.Field) *ProjectsAgentTrainCall { 7496 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7497 return c 7498} 7499 7500// Context sets the context to be used in this call's Do method. Any 7501// pending HTTP request will be aborted if the provided context is 7502// canceled. 7503func (c *ProjectsAgentTrainCall) Context(ctx context.Context) *ProjectsAgentTrainCall { 7504 c.ctx_ = ctx 7505 return c 7506} 7507 7508// Header returns an http.Header that can be modified by the caller to 7509// add HTTP headers to the request. 7510func (c *ProjectsAgentTrainCall) Header() http.Header { 7511 if c.header_ == nil { 7512 c.header_ = make(http.Header) 7513 } 7514 return c.header_ 7515} 7516 7517func (c *ProjectsAgentTrainCall) doRequest(alt string) (*http.Response, error) { 7518 reqHeaders := make(http.Header) 7519 for k, v := range c.header_ { 7520 reqHeaders[k] = v 7521 } 7522 reqHeaders.Set("User-Agent", c.s.userAgent()) 7523 var body io.Reader = nil 7524 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2trainagentrequest) 7525 if err != nil { 7526 return nil, err 7527 } 7528 reqHeaders.Set("Content-Type", "application/json") 7529 c.urlParams_.Set("alt", alt) 7530 c.urlParams_.Set("prettyPrint", "false") 7531 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/agent:train") 7532 urls += "?" + c.urlParams_.Encode() 7533 req, err := http.NewRequest("POST", urls, body) 7534 if err != nil { 7535 return nil, err 7536 } 7537 req.Header = reqHeaders 7538 googleapi.Expand(req.URL, map[string]string{ 7539 "parent": c.parent, 7540 }) 7541 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7542} 7543 7544// Do executes the "dialogflow.projects.agent.train" call. 7545// Exactly one of *GoogleLongrunningOperation or error will be non-nil. 7546// Any non-2xx status code is an error. Response headers are in either 7547// *GoogleLongrunningOperation.ServerResponse.Header or (if a response 7548// was returned at all) in error.(*googleapi.Error).Header. Use 7549// googleapi.IsNotModified to check whether the returned error was 7550// because http.StatusNotModified was returned. 7551func (c *ProjectsAgentTrainCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 7552 gensupport.SetOptions(c.urlParams_, opts...) 7553 res, err := c.doRequest("json") 7554 if res != nil && res.StatusCode == http.StatusNotModified { 7555 if res.Body != nil { 7556 res.Body.Close() 7557 } 7558 return nil, &googleapi.Error{ 7559 Code: res.StatusCode, 7560 Header: res.Header, 7561 } 7562 } 7563 if err != nil { 7564 return nil, err 7565 } 7566 defer googleapi.CloseBody(res) 7567 if err := googleapi.CheckResponse(res); err != nil { 7568 return nil, err 7569 } 7570 ret := &GoogleLongrunningOperation{ 7571 ServerResponse: googleapi.ServerResponse{ 7572 Header: res.Header, 7573 HTTPStatusCode: res.StatusCode, 7574 }, 7575 } 7576 target := &ret 7577 if err := gensupport.DecodeResponse(target, res); err != nil { 7578 return nil, err 7579 } 7580 return ret, nil 7581 // { 7582 // "description": "Trains the specified agent.\n\nOperation \u003cresponse: google.protobuf.Empty\u003e", 7583 // "flatPath": "v2/projects/{projectsId}/agent:train", 7584 // "httpMethod": "POST", 7585 // "id": "dialogflow.projects.agent.train", 7586 // "parameterOrder": [ 7587 // "parent" 7588 // ], 7589 // "parameters": { 7590 // "parent": { 7591 // "description": "Required. The project that the agent to train is associated with.\nFormat: `projects/\u003cProject ID\u003e`.", 7592 // "location": "path", 7593 // "pattern": "^projects/[^/]+$", 7594 // "required": true, 7595 // "type": "string" 7596 // } 7597 // }, 7598 // "path": "v2/{+parent}/agent:train", 7599 // "request": { 7600 // "$ref": "GoogleCloudDialogflowV2TrainAgentRequest" 7601 // }, 7602 // "response": { 7603 // "$ref": "GoogleLongrunningOperation" 7604 // }, 7605 // "scopes": [ 7606 // "https://www.googleapis.com/auth/cloud-platform", 7607 // "https://www.googleapis.com/auth/dialogflow" 7608 // ] 7609 // } 7610 7611} 7612 7613// method id "dialogflow.projects.agent.entityTypes.batchDelete": 7614 7615type ProjectsAgentEntityTypesBatchDeleteCall struct { 7616 s *Service 7617 parent string 7618 googleclouddialogflowv2batchdeleteentitytypesrequest *GoogleCloudDialogflowV2BatchDeleteEntityTypesRequest 7619 urlParams_ gensupport.URLParams 7620 ctx_ context.Context 7621 header_ http.Header 7622} 7623 7624// BatchDelete: Deletes entity types in the specified agent. 7625// 7626// Operation <response: google.protobuf.Empty> 7627func (r *ProjectsAgentEntityTypesService) BatchDelete(parent string, googleclouddialogflowv2batchdeleteentitytypesrequest *GoogleCloudDialogflowV2BatchDeleteEntityTypesRequest) *ProjectsAgentEntityTypesBatchDeleteCall { 7628 c := &ProjectsAgentEntityTypesBatchDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7629 c.parent = parent 7630 c.googleclouddialogflowv2batchdeleteentitytypesrequest = googleclouddialogflowv2batchdeleteentitytypesrequest 7631 return c 7632} 7633 7634// Fields allows partial responses to be retrieved. See 7635// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7636// for more information. 7637func (c *ProjectsAgentEntityTypesBatchDeleteCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesBatchDeleteCall { 7638 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7639 return c 7640} 7641 7642// Context sets the context to be used in this call's Do method. Any 7643// pending HTTP request will be aborted if the provided context is 7644// canceled. 7645func (c *ProjectsAgentEntityTypesBatchDeleteCall) Context(ctx context.Context) *ProjectsAgentEntityTypesBatchDeleteCall { 7646 c.ctx_ = ctx 7647 return c 7648} 7649 7650// Header returns an http.Header that can be modified by the caller to 7651// add HTTP headers to the request. 7652func (c *ProjectsAgentEntityTypesBatchDeleteCall) Header() http.Header { 7653 if c.header_ == nil { 7654 c.header_ = make(http.Header) 7655 } 7656 return c.header_ 7657} 7658 7659func (c *ProjectsAgentEntityTypesBatchDeleteCall) doRequest(alt string) (*http.Response, error) { 7660 reqHeaders := make(http.Header) 7661 for k, v := range c.header_ { 7662 reqHeaders[k] = v 7663 } 7664 reqHeaders.Set("User-Agent", c.s.userAgent()) 7665 var body io.Reader = nil 7666 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2batchdeleteentitytypesrequest) 7667 if err != nil { 7668 return nil, err 7669 } 7670 reqHeaders.Set("Content-Type", "application/json") 7671 c.urlParams_.Set("alt", alt) 7672 c.urlParams_.Set("prettyPrint", "false") 7673 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/entityTypes:batchDelete") 7674 urls += "?" + c.urlParams_.Encode() 7675 req, err := http.NewRequest("POST", urls, body) 7676 if err != nil { 7677 return nil, err 7678 } 7679 req.Header = reqHeaders 7680 googleapi.Expand(req.URL, map[string]string{ 7681 "parent": c.parent, 7682 }) 7683 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7684} 7685 7686// Do executes the "dialogflow.projects.agent.entityTypes.batchDelete" call. 7687// Exactly one of *GoogleLongrunningOperation or error will be non-nil. 7688// Any non-2xx status code is an error. Response headers are in either 7689// *GoogleLongrunningOperation.ServerResponse.Header or (if a response 7690// was returned at all) in error.(*googleapi.Error).Header. Use 7691// googleapi.IsNotModified to check whether the returned error was 7692// because http.StatusNotModified was returned. 7693func (c *ProjectsAgentEntityTypesBatchDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 7694 gensupport.SetOptions(c.urlParams_, opts...) 7695 res, err := c.doRequest("json") 7696 if res != nil && res.StatusCode == http.StatusNotModified { 7697 if res.Body != nil { 7698 res.Body.Close() 7699 } 7700 return nil, &googleapi.Error{ 7701 Code: res.StatusCode, 7702 Header: res.Header, 7703 } 7704 } 7705 if err != nil { 7706 return nil, err 7707 } 7708 defer googleapi.CloseBody(res) 7709 if err := googleapi.CheckResponse(res); err != nil { 7710 return nil, err 7711 } 7712 ret := &GoogleLongrunningOperation{ 7713 ServerResponse: googleapi.ServerResponse{ 7714 Header: res.Header, 7715 HTTPStatusCode: res.StatusCode, 7716 }, 7717 } 7718 target := &ret 7719 if err := gensupport.DecodeResponse(target, res); err != nil { 7720 return nil, err 7721 } 7722 return ret, nil 7723 // { 7724 // "description": "Deletes entity types in the specified agent.\n\nOperation \u003cresponse: google.protobuf.Empty\u003e", 7725 // "flatPath": "v2/projects/{projectsId}/agent/entityTypes:batchDelete", 7726 // "httpMethod": "POST", 7727 // "id": "dialogflow.projects.agent.entityTypes.batchDelete", 7728 // "parameterOrder": [ 7729 // "parent" 7730 // ], 7731 // "parameters": { 7732 // "parent": { 7733 // "description": "Required. The name of the agent to delete all entities types for. Format:\n`projects/\u003cProject ID\u003e/agent`.", 7734 // "location": "path", 7735 // "pattern": "^projects/[^/]+/agent$", 7736 // "required": true, 7737 // "type": "string" 7738 // } 7739 // }, 7740 // "path": "v2/{+parent}/entityTypes:batchDelete", 7741 // "request": { 7742 // "$ref": "GoogleCloudDialogflowV2BatchDeleteEntityTypesRequest" 7743 // }, 7744 // "response": { 7745 // "$ref": "GoogleLongrunningOperation" 7746 // }, 7747 // "scopes": [ 7748 // "https://www.googleapis.com/auth/cloud-platform", 7749 // "https://www.googleapis.com/auth/dialogflow" 7750 // ] 7751 // } 7752 7753} 7754 7755// method id "dialogflow.projects.agent.entityTypes.batchUpdate": 7756 7757type ProjectsAgentEntityTypesBatchUpdateCall struct { 7758 s *Service 7759 parent string 7760 googleclouddialogflowv2batchupdateentitytypesrequest *GoogleCloudDialogflowV2BatchUpdateEntityTypesRequest 7761 urlParams_ gensupport.URLParams 7762 ctx_ context.Context 7763 header_ http.Header 7764} 7765 7766// BatchUpdate: Updates/Creates multiple entity types in the specified 7767// agent. 7768// 7769// Operation <response: BatchUpdateEntityTypesResponse> 7770func (r *ProjectsAgentEntityTypesService) BatchUpdate(parent string, googleclouddialogflowv2batchupdateentitytypesrequest *GoogleCloudDialogflowV2BatchUpdateEntityTypesRequest) *ProjectsAgentEntityTypesBatchUpdateCall { 7771 c := &ProjectsAgentEntityTypesBatchUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7772 c.parent = parent 7773 c.googleclouddialogflowv2batchupdateentitytypesrequest = googleclouddialogflowv2batchupdateentitytypesrequest 7774 return c 7775} 7776 7777// Fields allows partial responses to be retrieved. See 7778// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7779// for more information. 7780func (c *ProjectsAgentEntityTypesBatchUpdateCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesBatchUpdateCall { 7781 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7782 return c 7783} 7784 7785// Context sets the context to be used in this call's Do method. Any 7786// pending HTTP request will be aborted if the provided context is 7787// canceled. 7788func (c *ProjectsAgentEntityTypesBatchUpdateCall) Context(ctx context.Context) *ProjectsAgentEntityTypesBatchUpdateCall { 7789 c.ctx_ = ctx 7790 return c 7791} 7792 7793// Header returns an http.Header that can be modified by the caller to 7794// add HTTP headers to the request. 7795func (c *ProjectsAgentEntityTypesBatchUpdateCall) Header() http.Header { 7796 if c.header_ == nil { 7797 c.header_ = make(http.Header) 7798 } 7799 return c.header_ 7800} 7801 7802func (c *ProjectsAgentEntityTypesBatchUpdateCall) doRequest(alt string) (*http.Response, error) { 7803 reqHeaders := make(http.Header) 7804 for k, v := range c.header_ { 7805 reqHeaders[k] = v 7806 } 7807 reqHeaders.Set("User-Agent", c.s.userAgent()) 7808 var body io.Reader = nil 7809 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2batchupdateentitytypesrequest) 7810 if err != nil { 7811 return nil, err 7812 } 7813 reqHeaders.Set("Content-Type", "application/json") 7814 c.urlParams_.Set("alt", alt) 7815 c.urlParams_.Set("prettyPrint", "false") 7816 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/entityTypes:batchUpdate") 7817 urls += "?" + c.urlParams_.Encode() 7818 req, err := http.NewRequest("POST", urls, body) 7819 if err != nil { 7820 return nil, err 7821 } 7822 req.Header = reqHeaders 7823 googleapi.Expand(req.URL, map[string]string{ 7824 "parent": c.parent, 7825 }) 7826 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7827} 7828 7829// Do executes the "dialogflow.projects.agent.entityTypes.batchUpdate" call. 7830// Exactly one of *GoogleLongrunningOperation or error will be non-nil. 7831// Any non-2xx status code is an error. Response headers are in either 7832// *GoogleLongrunningOperation.ServerResponse.Header or (if a response 7833// was returned at all) in error.(*googleapi.Error).Header. Use 7834// googleapi.IsNotModified to check whether the returned error was 7835// because http.StatusNotModified was returned. 7836func (c *ProjectsAgentEntityTypesBatchUpdateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 7837 gensupport.SetOptions(c.urlParams_, opts...) 7838 res, err := c.doRequest("json") 7839 if res != nil && res.StatusCode == http.StatusNotModified { 7840 if res.Body != nil { 7841 res.Body.Close() 7842 } 7843 return nil, &googleapi.Error{ 7844 Code: res.StatusCode, 7845 Header: res.Header, 7846 } 7847 } 7848 if err != nil { 7849 return nil, err 7850 } 7851 defer googleapi.CloseBody(res) 7852 if err := googleapi.CheckResponse(res); err != nil { 7853 return nil, err 7854 } 7855 ret := &GoogleLongrunningOperation{ 7856 ServerResponse: googleapi.ServerResponse{ 7857 Header: res.Header, 7858 HTTPStatusCode: res.StatusCode, 7859 }, 7860 } 7861 target := &ret 7862 if err := gensupport.DecodeResponse(target, res); err != nil { 7863 return nil, err 7864 } 7865 return ret, nil 7866 // { 7867 // "description": "Updates/Creates multiple entity types in the specified agent.\n\nOperation \u003cresponse: BatchUpdateEntityTypesResponse\u003e", 7868 // "flatPath": "v2/projects/{projectsId}/agent/entityTypes:batchUpdate", 7869 // "httpMethod": "POST", 7870 // "id": "dialogflow.projects.agent.entityTypes.batchUpdate", 7871 // "parameterOrder": [ 7872 // "parent" 7873 // ], 7874 // "parameters": { 7875 // "parent": { 7876 // "description": "Required. The name of the agent to update or create entity types in.\nFormat: `projects/\u003cProject ID\u003e/agent`.", 7877 // "location": "path", 7878 // "pattern": "^projects/[^/]+/agent$", 7879 // "required": true, 7880 // "type": "string" 7881 // } 7882 // }, 7883 // "path": "v2/{+parent}/entityTypes:batchUpdate", 7884 // "request": { 7885 // "$ref": "GoogleCloudDialogflowV2BatchUpdateEntityTypesRequest" 7886 // }, 7887 // "response": { 7888 // "$ref": "GoogleLongrunningOperation" 7889 // }, 7890 // "scopes": [ 7891 // "https://www.googleapis.com/auth/cloud-platform", 7892 // "https://www.googleapis.com/auth/dialogflow" 7893 // ] 7894 // } 7895 7896} 7897 7898// method id "dialogflow.projects.agent.entityTypes.create": 7899 7900type ProjectsAgentEntityTypesCreateCall struct { 7901 s *Service 7902 parent string 7903 googleclouddialogflowv2entitytype *GoogleCloudDialogflowV2EntityType 7904 urlParams_ gensupport.URLParams 7905 ctx_ context.Context 7906 header_ http.Header 7907} 7908 7909// Create: Creates an entity type in the specified agent. 7910func (r *ProjectsAgentEntityTypesService) Create(parent string, googleclouddialogflowv2entitytype *GoogleCloudDialogflowV2EntityType) *ProjectsAgentEntityTypesCreateCall { 7911 c := &ProjectsAgentEntityTypesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7912 c.parent = parent 7913 c.googleclouddialogflowv2entitytype = googleclouddialogflowv2entitytype 7914 return c 7915} 7916 7917// LanguageCode sets the optional parameter "languageCode": The language 7918// of entity synonyms defined in `entity_type`. If not 7919// specified, the agent's default language is 7920// used. 7921// [Many 7922// languages](https://cloud.google.com/dialogflow/docs/refere 7923// nce/language) 7924// are supported. Note: languages must be enabled in the agent before 7925// they can 7926// be used. 7927func (c *ProjectsAgentEntityTypesCreateCall) LanguageCode(languageCode string) *ProjectsAgentEntityTypesCreateCall { 7928 c.urlParams_.Set("languageCode", languageCode) 7929 return c 7930} 7931 7932// Fields allows partial responses to be retrieved. See 7933// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7934// for more information. 7935func (c *ProjectsAgentEntityTypesCreateCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesCreateCall { 7936 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7937 return c 7938} 7939 7940// Context sets the context to be used in this call's Do method. Any 7941// pending HTTP request will be aborted if the provided context is 7942// canceled. 7943func (c *ProjectsAgentEntityTypesCreateCall) Context(ctx context.Context) *ProjectsAgentEntityTypesCreateCall { 7944 c.ctx_ = ctx 7945 return c 7946} 7947 7948// Header returns an http.Header that can be modified by the caller to 7949// add HTTP headers to the request. 7950func (c *ProjectsAgentEntityTypesCreateCall) Header() http.Header { 7951 if c.header_ == nil { 7952 c.header_ = make(http.Header) 7953 } 7954 return c.header_ 7955} 7956 7957func (c *ProjectsAgentEntityTypesCreateCall) doRequest(alt string) (*http.Response, error) { 7958 reqHeaders := make(http.Header) 7959 for k, v := range c.header_ { 7960 reqHeaders[k] = v 7961 } 7962 reqHeaders.Set("User-Agent", c.s.userAgent()) 7963 var body io.Reader = nil 7964 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2entitytype) 7965 if err != nil { 7966 return nil, err 7967 } 7968 reqHeaders.Set("Content-Type", "application/json") 7969 c.urlParams_.Set("alt", alt) 7970 c.urlParams_.Set("prettyPrint", "false") 7971 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/entityTypes") 7972 urls += "?" + c.urlParams_.Encode() 7973 req, err := http.NewRequest("POST", urls, body) 7974 if err != nil { 7975 return nil, err 7976 } 7977 req.Header = reqHeaders 7978 googleapi.Expand(req.URL, map[string]string{ 7979 "parent": c.parent, 7980 }) 7981 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7982} 7983 7984// Do executes the "dialogflow.projects.agent.entityTypes.create" call. 7985// Exactly one of *GoogleCloudDialogflowV2EntityType or error will be 7986// non-nil. Any non-2xx status code is an error. Response headers are in 7987// either *GoogleCloudDialogflowV2EntityType.ServerResponse.Header or 7988// (if a response was returned at all) in 7989// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 7990// whether the returned error was because http.StatusNotModified was 7991// returned. 7992func (c *ProjectsAgentEntityTypesCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2EntityType, error) { 7993 gensupport.SetOptions(c.urlParams_, opts...) 7994 res, err := c.doRequest("json") 7995 if res != nil && res.StatusCode == http.StatusNotModified { 7996 if res.Body != nil { 7997 res.Body.Close() 7998 } 7999 return nil, &googleapi.Error{ 8000 Code: res.StatusCode, 8001 Header: res.Header, 8002 } 8003 } 8004 if err != nil { 8005 return nil, err 8006 } 8007 defer googleapi.CloseBody(res) 8008 if err := googleapi.CheckResponse(res); err != nil { 8009 return nil, err 8010 } 8011 ret := &GoogleCloudDialogflowV2EntityType{ 8012 ServerResponse: googleapi.ServerResponse{ 8013 Header: res.Header, 8014 HTTPStatusCode: res.StatusCode, 8015 }, 8016 } 8017 target := &ret 8018 if err := gensupport.DecodeResponse(target, res); err != nil { 8019 return nil, err 8020 } 8021 return ret, nil 8022 // { 8023 // "description": "Creates an entity type in the specified agent.", 8024 // "flatPath": "v2/projects/{projectsId}/agent/entityTypes", 8025 // "httpMethod": "POST", 8026 // "id": "dialogflow.projects.agent.entityTypes.create", 8027 // "parameterOrder": [ 8028 // "parent" 8029 // ], 8030 // "parameters": { 8031 // "languageCode": { 8032 // "description": "Optional. The language of entity synonyms defined in `entity_type`. If not\nspecified, the agent's default language is used.\n[Many\nlanguages](https://cloud.google.com/dialogflow/docs/reference/language)\nare supported. Note: languages must be enabled in the agent before they can\nbe used.", 8033 // "location": "query", 8034 // "type": "string" 8035 // }, 8036 // "parent": { 8037 // "description": "Required. The agent to create a entity type for.\nFormat: `projects/\u003cProject ID\u003e/agent`.", 8038 // "location": "path", 8039 // "pattern": "^projects/[^/]+/agent$", 8040 // "required": true, 8041 // "type": "string" 8042 // } 8043 // }, 8044 // "path": "v2/{+parent}/entityTypes", 8045 // "request": { 8046 // "$ref": "GoogleCloudDialogflowV2EntityType" 8047 // }, 8048 // "response": { 8049 // "$ref": "GoogleCloudDialogflowV2EntityType" 8050 // }, 8051 // "scopes": [ 8052 // "https://www.googleapis.com/auth/cloud-platform", 8053 // "https://www.googleapis.com/auth/dialogflow" 8054 // ] 8055 // } 8056 8057} 8058 8059// method id "dialogflow.projects.agent.entityTypes.delete": 8060 8061type ProjectsAgentEntityTypesDeleteCall struct { 8062 s *Service 8063 name string 8064 urlParams_ gensupport.URLParams 8065 ctx_ context.Context 8066 header_ http.Header 8067} 8068 8069// Delete: Deletes the specified entity type. 8070func (r *ProjectsAgentEntityTypesService) Delete(name string) *ProjectsAgentEntityTypesDeleteCall { 8071 c := &ProjectsAgentEntityTypesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8072 c.name = name 8073 return c 8074} 8075 8076// Fields allows partial responses to be retrieved. See 8077// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8078// for more information. 8079func (c *ProjectsAgentEntityTypesDeleteCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesDeleteCall { 8080 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8081 return c 8082} 8083 8084// Context sets the context to be used in this call's Do method. Any 8085// pending HTTP request will be aborted if the provided context is 8086// canceled. 8087func (c *ProjectsAgentEntityTypesDeleteCall) Context(ctx context.Context) *ProjectsAgentEntityTypesDeleteCall { 8088 c.ctx_ = ctx 8089 return c 8090} 8091 8092// Header returns an http.Header that can be modified by the caller to 8093// add HTTP headers to the request. 8094func (c *ProjectsAgentEntityTypesDeleteCall) Header() http.Header { 8095 if c.header_ == nil { 8096 c.header_ = make(http.Header) 8097 } 8098 return c.header_ 8099} 8100 8101func (c *ProjectsAgentEntityTypesDeleteCall) doRequest(alt string) (*http.Response, error) { 8102 reqHeaders := make(http.Header) 8103 for k, v := range c.header_ { 8104 reqHeaders[k] = v 8105 } 8106 reqHeaders.Set("User-Agent", c.s.userAgent()) 8107 var body io.Reader = nil 8108 c.urlParams_.Set("alt", alt) 8109 c.urlParams_.Set("prettyPrint", "false") 8110 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") 8111 urls += "?" + c.urlParams_.Encode() 8112 req, err := http.NewRequest("DELETE", urls, body) 8113 if err != nil { 8114 return nil, err 8115 } 8116 req.Header = reqHeaders 8117 googleapi.Expand(req.URL, map[string]string{ 8118 "name": c.name, 8119 }) 8120 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8121} 8122 8123// Do executes the "dialogflow.projects.agent.entityTypes.delete" call. 8124// Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any 8125// non-2xx status code is an error. Response headers are in either 8126// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was 8127// returned at all) in error.(*googleapi.Error).Header. Use 8128// googleapi.IsNotModified to check whether the returned error was 8129// because http.StatusNotModified was returned. 8130func (c *ProjectsAgentEntityTypesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { 8131 gensupport.SetOptions(c.urlParams_, opts...) 8132 res, err := c.doRequest("json") 8133 if res != nil && res.StatusCode == http.StatusNotModified { 8134 if res.Body != nil { 8135 res.Body.Close() 8136 } 8137 return nil, &googleapi.Error{ 8138 Code: res.StatusCode, 8139 Header: res.Header, 8140 } 8141 } 8142 if err != nil { 8143 return nil, err 8144 } 8145 defer googleapi.CloseBody(res) 8146 if err := googleapi.CheckResponse(res); err != nil { 8147 return nil, err 8148 } 8149 ret := &GoogleProtobufEmpty{ 8150 ServerResponse: googleapi.ServerResponse{ 8151 Header: res.Header, 8152 HTTPStatusCode: res.StatusCode, 8153 }, 8154 } 8155 target := &ret 8156 if err := gensupport.DecodeResponse(target, res); err != nil { 8157 return nil, err 8158 } 8159 return ret, nil 8160 // { 8161 // "description": "Deletes the specified entity type.", 8162 // "flatPath": "v2/projects/{projectsId}/agent/entityTypes/{entityTypesId}", 8163 // "httpMethod": "DELETE", 8164 // "id": "dialogflow.projects.agent.entityTypes.delete", 8165 // "parameterOrder": [ 8166 // "name" 8167 // ], 8168 // "parameters": { 8169 // "name": { 8170 // "description": "Required. The name of the entity type to delete.\nFormat: `projects/\u003cProject ID\u003e/agent/entityTypes/\u003cEntityType ID\u003e`.", 8171 // "location": "path", 8172 // "pattern": "^projects/[^/]+/agent/entityTypes/[^/]+$", 8173 // "required": true, 8174 // "type": "string" 8175 // } 8176 // }, 8177 // "path": "v2/{+name}", 8178 // "response": { 8179 // "$ref": "GoogleProtobufEmpty" 8180 // }, 8181 // "scopes": [ 8182 // "https://www.googleapis.com/auth/cloud-platform", 8183 // "https://www.googleapis.com/auth/dialogflow" 8184 // ] 8185 // } 8186 8187} 8188 8189// method id "dialogflow.projects.agent.entityTypes.get": 8190 8191type ProjectsAgentEntityTypesGetCall struct { 8192 s *Service 8193 name string 8194 urlParams_ gensupport.URLParams 8195 ifNoneMatch_ string 8196 ctx_ context.Context 8197 header_ http.Header 8198} 8199 8200// Get: Retrieves the specified entity type. 8201func (r *ProjectsAgentEntityTypesService) Get(name string) *ProjectsAgentEntityTypesGetCall { 8202 c := &ProjectsAgentEntityTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8203 c.name = name 8204 return c 8205} 8206 8207// LanguageCode sets the optional parameter "languageCode": The language 8208// to retrieve entity synonyms for. If not specified, 8209// the agent's default language is 8210// used. 8211// [Many 8212// languages](https://cloud.google.com/dialogflow/docs/refere 8213// nce/language) 8214// are supported. Note: languages must be enabled in the agent before 8215// they can 8216// be used. 8217func (c *ProjectsAgentEntityTypesGetCall) LanguageCode(languageCode string) *ProjectsAgentEntityTypesGetCall { 8218 c.urlParams_.Set("languageCode", languageCode) 8219 return c 8220} 8221 8222// Fields allows partial responses to be retrieved. See 8223// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8224// for more information. 8225func (c *ProjectsAgentEntityTypesGetCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesGetCall { 8226 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8227 return c 8228} 8229 8230// IfNoneMatch sets the optional parameter which makes the operation 8231// fail if the object's ETag matches the given value. This is useful for 8232// getting updates only after the object has changed since the last 8233// request. Use googleapi.IsNotModified to check whether the response 8234// error from Do is the result of In-None-Match. 8235func (c *ProjectsAgentEntityTypesGetCall) IfNoneMatch(entityTag string) *ProjectsAgentEntityTypesGetCall { 8236 c.ifNoneMatch_ = entityTag 8237 return c 8238} 8239 8240// Context sets the context to be used in this call's Do method. Any 8241// pending HTTP request will be aborted if the provided context is 8242// canceled. 8243func (c *ProjectsAgentEntityTypesGetCall) Context(ctx context.Context) *ProjectsAgentEntityTypesGetCall { 8244 c.ctx_ = ctx 8245 return c 8246} 8247 8248// Header returns an http.Header that can be modified by the caller to 8249// add HTTP headers to the request. 8250func (c *ProjectsAgentEntityTypesGetCall) Header() http.Header { 8251 if c.header_ == nil { 8252 c.header_ = make(http.Header) 8253 } 8254 return c.header_ 8255} 8256 8257func (c *ProjectsAgentEntityTypesGetCall) doRequest(alt string) (*http.Response, error) { 8258 reqHeaders := make(http.Header) 8259 for k, v := range c.header_ { 8260 reqHeaders[k] = v 8261 } 8262 reqHeaders.Set("User-Agent", c.s.userAgent()) 8263 if c.ifNoneMatch_ != "" { 8264 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8265 } 8266 var body io.Reader = nil 8267 c.urlParams_.Set("alt", alt) 8268 c.urlParams_.Set("prettyPrint", "false") 8269 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") 8270 urls += "?" + c.urlParams_.Encode() 8271 req, err := http.NewRequest("GET", urls, body) 8272 if err != nil { 8273 return nil, err 8274 } 8275 req.Header = reqHeaders 8276 googleapi.Expand(req.URL, map[string]string{ 8277 "name": c.name, 8278 }) 8279 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8280} 8281 8282// Do executes the "dialogflow.projects.agent.entityTypes.get" call. 8283// Exactly one of *GoogleCloudDialogflowV2EntityType or error will be 8284// non-nil. Any non-2xx status code is an error. Response headers are in 8285// either *GoogleCloudDialogflowV2EntityType.ServerResponse.Header or 8286// (if a response was returned at all) in 8287// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 8288// whether the returned error was because http.StatusNotModified was 8289// returned. 8290func (c *ProjectsAgentEntityTypesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2EntityType, error) { 8291 gensupport.SetOptions(c.urlParams_, opts...) 8292 res, err := c.doRequest("json") 8293 if res != nil && res.StatusCode == http.StatusNotModified { 8294 if res.Body != nil { 8295 res.Body.Close() 8296 } 8297 return nil, &googleapi.Error{ 8298 Code: res.StatusCode, 8299 Header: res.Header, 8300 } 8301 } 8302 if err != nil { 8303 return nil, err 8304 } 8305 defer googleapi.CloseBody(res) 8306 if err := googleapi.CheckResponse(res); err != nil { 8307 return nil, err 8308 } 8309 ret := &GoogleCloudDialogflowV2EntityType{ 8310 ServerResponse: googleapi.ServerResponse{ 8311 Header: res.Header, 8312 HTTPStatusCode: res.StatusCode, 8313 }, 8314 } 8315 target := &ret 8316 if err := gensupport.DecodeResponse(target, res); err != nil { 8317 return nil, err 8318 } 8319 return ret, nil 8320 // { 8321 // "description": "Retrieves the specified entity type.", 8322 // "flatPath": "v2/projects/{projectsId}/agent/entityTypes/{entityTypesId}", 8323 // "httpMethod": "GET", 8324 // "id": "dialogflow.projects.agent.entityTypes.get", 8325 // "parameterOrder": [ 8326 // "name" 8327 // ], 8328 // "parameters": { 8329 // "languageCode": { 8330 // "description": "Optional. The language to retrieve entity synonyms for. If not specified,\nthe agent's default language is used.\n[Many\nlanguages](https://cloud.google.com/dialogflow/docs/reference/language)\nare supported. Note: languages must be enabled in the agent before they can\nbe used.", 8331 // "location": "query", 8332 // "type": "string" 8333 // }, 8334 // "name": { 8335 // "description": "Required. The name of the entity type.\nFormat: `projects/\u003cProject ID\u003e/agent/entityTypes/\u003cEntityType ID\u003e`.", 8336 // "location": "path", 8337 // "pattern": "^projects/[^/]+/agent/entityTypes/[^/]+$", 8338 // "required": true, 8339 // "type": "string" 8340 // } 8341 // }, 8342 // "path": "v2/{+name}", 8343 // "response": { 8344 // "$ref": "GoogleCloudDialogflowV2EntityType" 8345 // }, 8346 // "scopes": [ 8347 // "https://www.googleapis.com/auth/cloud-platform", 8348 // "https://www.googleapis.com/auth/dialogflow" 8349 // ] 8350 // } 8351 8352} 8353 8354// method id "dialogflow.projects.agent.entityTypes.list": 8355 8356type ProjectsAgentEntityTypesListCall struct { 8357 s *Service 8358 parent string 8359 urlParams_ gensupport.URLParams 8360 ifNoneMatch_ string 8361 ctx_ context.Context 8362 header_ http.Header 8363} 8364 8365// List: Returns the list of all entity types in the specified agent. 8366func (r *ProjectsAgentEntityTypesService) List(parent string) *ProjectsAgentEntityTypesListCall { 8367 c := &ProjectsAgentEntityTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8368 c.parent = parent 8369 return c 8370} 8371 8372// LanguageCode sets the optional parameter "languageCode": The language 8373// to list entity synonyms for. If not specified, 8374// the agent's default language is 8375// used. 8376// [Many 8377// languages](https://cloud.google.com/dialogflow/docs/refere 8378// nce/language) 8379// are supported. Note: languages must be enabled in the agent before 8380// they can 8381// be used. 8382func (c *ProjectsAgentEntityTypesListCall) LanguageCode(languageCode string) *ProjectsAgentEntityTypesListCall { 8383 c.urlParams_.Set("languageCode", languageCode) 8384 return c 8385} 8386 8387// PageSize sets the optional parameter "pageSize": The maximum number 8388// of items to return in a single page. By 8389// default 100 and at most 1000. 8390func (c *ProjectsAgentEntityTypesListCall) PageSize(pageSize int64) *ProjectsAgentEntityTypesListCall { 8391 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 8392 return c 8393} 8394 8395// PageToken sets the optional parameter "pageToken": The 8396// next_page_token value returned from a previous list request. 8397func (c *ProjectsAgentEntityTypesListCall) PageToken(pageToken string) *ProjectsAgentEntityTypesListCall { 8398 c.urlParams_.Set("pageToken", pageToken) 8399 return c 8400} 8401 8402// Fields allows partial responses to be retrieved. See 8403// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8404// for more information. 8405func (c *ProjectsAgentEntityTypesListCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesListCall { 8406 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8407 return c 8408} 8409 8410// IfNoneMatch sets the optional parameter which makes the operation 8411// fail if the object's ETag matches the given value. This is useful for 8412// getting updates only after the object has changed since the last 8413// request. Use googleapi.IsNotModified to check whether the response 8414// error from Do is the result of In-None-Match. 8415func (c *ProjectsAgentEntityTypesListCall) IfNoneMatch(entityTag string) *ProjectsAgentEntityTypesListCall { 8416 c.ifNoneMatch_ = entityTag 8417 return c 8418} 8419 8420// Context sets the context to be used in this call's Do method. Any 8421// pending HTTP request will be aborted if the provided context is 8422// canceled. 8423func (c *ProjectsAgentEntityTypesListCall) Context(ctx context.Context) *ProjectsAgentEntityTypesListCall { 8424 c.ctx_ = ctx 8425 return c 8426} 8427 8428// Header returns an http.Header that can be modified by the caller to 8429// add HTTP headers to the request. 8430func (c *ProjectsAgentEntityTypesListCall) Header() http.Header { 8431 if c.header_ == nil { 8432 c.header_ = make(http.Header) 8433 } 8434 return c.header_ 8435} 8436 8437func (c *ProjectsAgentEntityTypesListCall) doRequest(alt string) (*http.Response, error) { 8438 reqHeaders := make(http.Header) 8439 for k, v := range c.header_ { 8440 reqHeaders[k] = v 8441 } 8442 reqHeaders.Set("User-Agent", c.s.userAgent()) 8443 if c.ifNoneMatch_ != "" { 8444 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8445 } 8446 var body io.Reader = nil 8447 c.urlParams_.Set("alt", alt) 8448 c.urlParams_.Set("prettyPrint", "false") 8449 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/entityTypes") 8450 urls += "?" + c.urlParams_.Encode() 8451 req, err := http.NewRequest("GET", urls, body) 8452 if err != nil { 8453 return nil, err 8454 } 8455 req.Header = reqHeaders 8456 googleapi.Expand(req.URL, map[string]string{ 8457 "parent": c.parent, 8458 }) 8459 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8460} 8461 8462// Do executes the "dialogflow.projects.agent.entityTypes.list" call. 8463// Exactly one of *GoogleCloudDialogflowV2ListEntityTypesResponse or 8464// error will be non-nil. Any non-2xx status code is an error. Response 8465// headers are in either 8466// *GoogleCloudDialogflowV2ListEntityTypesResponse.ServerResponse.Header 8467// or (if a response was returned at all) in 8468// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 8469// whether the returned error was because http.StatusNotModified was 8470// returned. 8471func (c *ProjectsAgentEntityTypesListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2ListEntityTypesResponse, error) { 8472 gensupport.SetOptions(c.urlParams_, opts...) 8473 res, err := c.doRequest("json") 8474 if res != nil && res.StatusCode == http.StatusNotModified { 8475 if res.Body != nil { 8476 res.Body.Close() 8477 } 8478 return nil, &googleapi.Error{ 8479 Code: res.StatusCode, 8480 Header: res.Header, 8481 } 8482 } 8483 if err != nil { 8484 return nil, err 8485 } 8486 defer googleapi.CloseBody(res) 8487 if err := googleapi.CheckResponse(res); err != nil { 8488 return nil, err 8489 } 8490 ret := &GoogleCloudDialogflowV2ListEntityTypesResponse{ 8491 ServerResponse: googleapi.ServerResponse{ 8492 Header: res.Header, 8493 HTTPStatusCode: res.StatusCode, 8494 }, 8495 } 8496 target := &ret 8497 if err := gensupport.DecodeResponse(target, res); err != nil { 8498 return nil, err 8499 } 8500 return ret, nil 8501 // { 8502 // "description": "Returns the list of all entity types in the specified agent.", 8503 // "flatPath": "v2/projects/{projectsId}/agent/entityTypes", 8504 // "httpMethod": "GET", 8505 // "id": "dialogflow.projects.agent.entityTypes.list", 8506 // "parameterOrder": [ 8507 // "parent" 8508 // ], 8509 // "parameters": { 8510 // "languageCode": { 8511 // "description": "Optional. The language to list entity synonyms for. If not specified,\nthe agent's default language is used.\n[Many\nlanguages](https://cloud.google.com/dialogflow/docs/reference/language)\nare supported. Note: languages must be enabled in the agent before they can\nbe used.", 8512 // "location": "query", 8513 // "type": "string" 8514 // }, 8515 // "pageSize": { 8516 // "description": "Optional. The maximum number of items to return in a single page. By\ndefault 100 and at most 1000.", 8517 // "format": "int32", 8518 // "location": "query", 8519 // "type": "integer" 8520 // }, 8521 // "pageToken": { 8522 // "description": "Optional. The next_page_token value returned from a previous list request.", 8523 // "location": "query", 8524 // "type": "string" 8525 // }, 8526 // "parent": { 8527 // "description": "Required. The agent to list all entity types from.\nFormat: `projects/\u003cProject ID\u003e/agent`.", 8528 // "location": "path", 8529 // "pattern": "^projects/[^/]+/agent$", 8530 // "required": true, 8531 // "type": "string" 8532 // } 8533 // }, 8534 // "path": "v2/{+parent}/entityTypes", 8535 // "response": { 8536 // "$ref": "GoogleCloudDialogflowV2ListEntityTypesResponse" 8537 // }, 8538 // "scopes": [ 8539 // "https://www.googleapis.com/auth/cloud-platform", 8540 // "https://www.googleapis.com/auth/dialogflow" 8541 // ] 8542 // } 8543 8544} 8545 8546// Pages invokes f for each page of results. 8547// A non-nil error returned from f will halt the iteration. 8548// The provided context supersedes any context provided to the Context method. 8549func (c *ProjectsAgentEntityTypesListCall) Pages(ctx context.Context, f func(*GoogleCloudDialogflowV2ListEntityTypesResponse) error) error { 8550 c.ctx_ = ctx 8551 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 8552 for { 8553 x, err := c.Do() 8554 if err != nil { 8555 return err 8556 } 8557 if err := f(x); err != nil { 8558 return err 8559 } 8560 if x.NextPageToken == "" { 8561 return nil 8562 } 8563 c.PageToken(x.NextPageToken) 8564 } 8565} 8566 8567// method id "dialogflow.projects.agent.entityTypes.patch": 8568 8569type ProjectsAgentEntityTypesPatchCall struct { 8570 s *Service 8571 nameid string 8572 googleclouddialogflowv2entitytype *GoogleCloudDialogflowV2EntityType 8573 urlParams_ gensupport.URLParams 8574 ctx_ context.Context 8575 header_ http.Header 8576} 8577 8578// Patch: Updates the specified entity type. 8579func (r *ProjectsAgentEntityTypesService) Patch(nameid string, googleclouddialogflowv2entitytype *GoogleCloudDialogflowV2EntityType) *ProjectsAgentEntityTypesPatchCall { 8580 c := &ProjectsAgentEntityTypesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8581 c.nameid = nameid 8582 c.googleclouddialogflowv2entitytype = googleclouddialogflowv2entitytype 8583 return c 8584} 8585 8586// LanguageCode sets the optional parameter "languageCode": The language 8587// of entity synonyms defined in `entity_type`. If not 8588// specified, the agent's default language is 8589// used. 8590// [Many 8591// languages](https://cloud.google.com/dialogflow/docs/refere 8592// nce/language) 8593// are supported. Note: languages must be enabled in the agent before 8594// they can 8595// be used. 8596func (c *ProjectsAgentEntityTypesPatchCall) LanguageCode(languageCode string) *ProjectsAgentEntityTypesPatchCall { 8597 c.urlParams_.Set("languageCode", languageCode) 8598 return c 8599} 8600 8601// UpdateMask sets the optional parameter "updateMask": The mask to 8602// control which fields get updated. 8603func (c *ProjectsAgentEntityTypesPatchCall) UpdateMask(updateMask string) *ProjectsAgentEntityTypesPatchCall { 8604 c.urlParams_.Set("updateMask", updateMask) 8605 return c 8606} 8607 8608// Fields allows partial responses to be retrieved. See 8609// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8610// for more information. 8611func (c *ProjectsAgentEntityTypesPatchCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesPatchCall { 8612 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8613 return c 8614} 8615 8616// Context sets the context to be used in this call's Do method. Any 8617// pending HTTP request will be aborted if the provided context is 8618// canceled. 8619func (c *ProjectsAgentEntityTypesPatchCall) Context(ctx context.Context) *ProjectsAgentEntityTypesPatchCall { 8620 c.ctx_ = ctx 8621 return c 8622} 8623 8624// Header returns an http.Header that can be modified by the caller to 8625// add HTTP headers to the request. 8626func (c *ProjectsAgentEntityTypesPatchCall) Header() http.Header { 8627 if c.header_ == nil { 8628 c.header_ = make(http.Header) 8629 } 8630 return c.header_ 8631} 8632 8633func (c *ProjectsAgentEntityTypesPatchCall) doRequest(alt string) (*http.Response, error) { 8634 reqHeaders := make(http.Header) 8635 for k, v := range c.header_ { 8636 reqHeaders[k] = v 8637 } 8638 reqHeaders.Set("User-Agent", c.s.userAgent()) 8639 var body io.Reader = nil 8640 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2entitytype) 8641 if err != nil { 8642 return nil, err 8643 } 8644 reqHeaders.Set("Content-Type", "application/json") 8645 c.urlParams_.Set("alt", alt) 8646 c.urlParams_.Set("prettyPrint", "false") 8647 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") 8648 urls += "?" + c.urlParams_.Encode() 8649 req, err := http.NewRequest("PATCH", urls, body) 8650 if err != nil { 8651 return nil, err 8652 } 8653 req.Header = reqHeaders 8654 googleapi.Expand(req.URL, map[string]string{ 8655 "name": c.nameid, 8656 }) 8657 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8658} 8659 8660// Do executes the "dialogflow.projects.agent.entityTypes.patch" call. 8661// Exactly one of *GoogleCloudDialogflowV2EntityType or error will be 8662// non-nil. Any non-2xx status code is an error. Response headers are in 8663// either *GoogleCloudDialogflowV2EntityType.ServerResponse.Header or 8664// (if a response was returned at all) in 8665// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 8666// whether the returned error was because http.StatusNotModified was 8667// returned. 8668func (c *ProjectsAgentEntityTypesPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2EntityType, error) { 8669 gensupport.SetOptions(c.urlParams_, opts...) 8670 res, err := c.doRequest("json") 8671 if res != nil && res.StatusCode == http.StatusNotModified { 8672 if res.Body != nil { 8673 res.Body.Close() 8674 } 8675 return nil, &googleapi.Error{ 8676 Code: res.StatusCode, 8677 Header: res.Header, 8678 } 8679 } 8680 if err != nil { 8681 return nil, err 8682 } 8683 defer googleapi.CloseBody(res) 8684 if err := googleapi.CheckResponse(res); err != nil { 8685 return nil, err 8686 } 8687 ret := &GoogleCloudDialogflowV2EntityType{ 8688 ServerResponse: googleapi.ServerResponse{ 8689 Header: res.Header, 8690 HTTPStatusCode: res.StatusCode, 8691 }, 8692 } 8693 target := &ret 8694 if err := gensupport.DecodeResponse(target, res); err != nil { 8695 return nil, err 8696 } 8697 return ret, nil 8698 // { 8699 // "description": "Updates the specified entity type.", 8700 // "flatPath": "v2/projects/{projectsId}/agent/entityTypes/{entityTypesId}", 8701 // "httpMethod": "PATCH", 8702 // "id": "dialogflow.projects.agent.entityTypes.patch", 8703 // "parameterOrder": [ 8704 // "name" 8705 // ], 8706 // "parameters": { 8707 // "languageCode": { 8708 // "description": "Optional. The language of entity synonyms defined in `entity_type`. If not\nspecified, the agent's default language is used.\n[Many\nlanguages](https://cloud.google.com/dialogflow/docs/reference/language)\nare supported. Note: languages must be enabled in the agent before they can\nbe used.", 8709 // "location": "query", 8710 // "type": "string" 8711 // }, 8712 // "name": { 8713 // "description": "The unique identifier of the entity type.\nRequired for EntityTypes.UpdateEntityType and\nEntityTypes.BatchUpdateEntityTypes methods.\nFormat: `projects/\u003cProject ID\u003e/agent/entityTypes/\u003cEntity Type ID\u003e`.", 8714 // "location": "path", 8715 // "pattern": "^projects/[^/]+/agent/entityTypes/[^/]+$", 8716 // "required": true, 8717 // "type": "string" 8718 // }, 8719 // "updateMask": { 8720 // "description": "Optional. The mask to control which fields get updated.", 8721 // "format": "google-fieldmask", 8722 // "location": "query", 8723 // "type": "string" 8724 // } 8725 // }, 8726 // "path": "v2/{+name}", 8727 // "request": { 8728 // "$ref": "GoogleCloudDialogflowV2EntityType" 8729 // }, 8730 // "response": { 8731 // "$ref": "GoogleCloudDialogflowV2EntityType" 8732 // }, 8733 // "scopes": [ 8734 // "https://www.googleapis.com/auth/cloud-platform", 8735 // "https://www.googleapis.com/auth/dialogflow" 8736 // ] 8737 // } 8738 8739} 8740 8741// method id "dialogflow.projects.agent.entityTypes.entities.batchCreate": 8742 8743type ProjectsAgentEntityTypesEntitiesBatchCreateCall struct { 8744 s *Service 8745 parent string 8746 googleclouddialogflowv2batchcreateentitiesrequest *GoogleCloudDialogflowV2BatchCreateEntitiesRequest 8747 urlParams_ gensupport.URLParams 8748 ctx_ context.Context 8749 header_ http.Header 8750} 8751 8752// BatchCreate: Creates multiple new entities in the specified entity 8753// type. 8754// 8755// Operation <response: google.protobuf.Empty> 8756func (r *ProjectsAgentEntityTypesEntitiesService) BatchCreate(parent string, googleclouddialogflowv2batchcreateentitiesrequest *GoogleCloudDialogflowV2BatchCreateEntitiesRequest) *ProjectsAgentEntityTypesEntitiesBatchCreateCall { 8757 c := &ProjectsAgentEntityTypesEntitiesBatchCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8758 c.parent = parent 8759 c.googleclouddialogflowv2batchcreateentitiesrequest = googleclouddialogflowv2batchcreateentitiesrequest 8760 return c 8761} 8762 8763// Fields allows partial responses to be retrieved. See 8764// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8765// for more information. 8766func (c *ProjectsAgentEntityTypesEntitiesBatchCreateCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesEntitiesBatchCreateCall { 8767 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8768 return c 8769} 8770 8771// Context sets the context to be used in this call's Do method. Any 8772// pending HTTP request will be aborted if the provided context is 8773// canceled. 8774func (c *ProjectsAgentEntityTypesEntitiesBatchCreateCall) Context(ctx context.Context) *ProjectsAgentEntityTypesEntitiesBatchCreateCall { 8775 c.ctx_ = ctx 8776 return c 8777} 8778 8779// Header returns an http.Header that can be modified by the caller to 8780// add HTTP headers to the request. 8781func (c *ProjectsAgentEntityTypesEntitiesBatchCreateCall) Header() http.Header { 8782 if c.header_ == nil { 8783 c.header_ = make(http.Header) 8784 } 8785 return c.header_ 8786} 8787 8788func (c *ProjectsAgentEntityTypesEntitiesBatchCreateCall) doRequest(alt string) (*http.Response, error) { 8789 reqHeaders := make(http.Header) 8790 for k, v := range c.header_ { 8791 reqHeaders[k] = v 8792 } 8793 reqHeaders.Set("User-Agent", c.s.userAgent()) 8794 var body io.Reader = nil 8795 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2batchcreateentitiesrequest) 8796 if err != nil { 8797 return nil, err 8798 } 8799 reqHeaders.Set("Content-Type", "application/json") 8800 c.urlParams_.Set("alt", alt) 8801 c.urlParams_.Set("prettyPrint", "false") 8802 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/entities:batchCreate") 8803 urls += "?" + c.urlParams_.Encode() 8804 req, err := http.NewRequest("POST", urls, body) 8805 if err != nil { 8806 return nil, err 8807 } 8808 req.Header = reqHeaders 8809 googleapi.Expand(req.URL, map[string]string{ 8810 "parent": c.parent, 8811 }) 8812 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8813} 8814 8815// Do executes the "dialogflow.projects.agent.entityTypes.entities.batchCreate" call. 8816// Exactly one of *GoogleLongrunningOperation or error will be non-nil. 8817// Any non-2xx status code is an error. Response headers are in either 8818// *GoogleLongrunningOperation.ServerResponse.Header or (if a response 8819// was returned at all) in error.(*googleapi.Error).Header. Use 8820// googleapi.IsNotModified to check whether the returned error was 8821// because http.StatusNotModified was returned. 8822func (c *ProjectsAgentEntityTypesEntitiesBatchCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 8823 gensupport.SetOptions(c.urlParams_, opts...) 8824 res, err := c.doRequest("json") 8825 if res != nil && res.StatusCode == http.StatusNotModified { 8826 if res.Body != nil { 8827 res.Body.Close() 8828 } 8829 return nil, &googleapi.Error{ 8830 Code: res.StatusCode, 8831 Header: res.Header, 8832 } 8833 } 8834 if err != nil { 8835 return nil, err 8836 } 8837 defer googleapi.CloseBody(res) 8838 if err := googleapi.CheckResponse(res); err != nil { 8839 return nil, err 8840 } 8841 ret := &GoogleLongrunningOperation{ 8842 ServerResponse: googleapi.ServerResponse{ 8843 Header: res.Header, 8844 HTTPStatusCode: res.StatusCode, 8845 }, 8846 } 8847 target := &ret 8848 if err := gensupport.DecodeResponse(target, res); err != nil { 8849 return nil, err 8850 } 8851 return ret, nil 8852 // { 8853 // "description": "Creates multiple new entities in the specified entity type.\n\nOperation \u003cresponse: google.protobuf.Empty\u003e", 8854 // "flatPath": "v2/projects/{projectsId}/agent/entityTypes/{entityTypesId}/entities:batchCreate", 8855 // "httpMethod": "POST", 8856 // "id": "dialogflow.projects.agent.entityTypes.entities.batchCreate", 8857 // "parameterOrder": [ 8858 // "parent" 8859 // ], 8860 // "parameters": { 8861 // "parent": { 8862 // "description": "Required. The name of the entity type to create entities in. Format:\n`projects/\u003cProject ID\u003e/agent/entityTypes/\u003cEntity Type ID\u003e`.", 8863 // "location": "path", 8864 // "pattern": "^projects/[^/]+/agent/entityTypes/[^/]+$", 8865 // "required": true, 8866 // "type": "string" 8867 // } 8868 // }, 8869 // "path": "v2/{+parent}/entities:batchCreate", 8870 // "request": { 8871 // "$ref": "GoogleCloudDialogflowV2BatchCreateEntitiesRequest" 8872 // }, 8873 // "response": { 8874 // "$ref": "GoogleLongrunningOperation" 8875 // }, 8876 // "scopes": [ 8877 // "https://www.googleapis.com/auth/cloud-platform", 8878 // "https://www.googleapis.com/auth/dialogflow" 8879 // ] 8880 // } 8881 8882} 8883 8884// method id "dialogflow.projects.agent.entityTypes.entities.batchDelete": 8885 8886type ProjectsAgentEntityTypesEntitiesBatchDeleteCall struct { 8887 s *Service 8888 parent string 8889 googleclouddialogflowv2batchdeleteentitiesrequest *GoogleCloudDialogflowV2BatchDeleteEntitiesRequest 8890 urlParams_ gensupport.URLParams 8891 ctx_ context.Context 8892 header_ http.Header 8893} 8894 8895// BatchDelete: Deletes entities in the specified entity 8896// type. 8897// 8898// Operation <response: google.protobuf.Empty> 8899func (r *ProjectsAgentEntityTypesEntitiesService) BatchDelete(parent string, googleclouddialogflowv2batchdeleteentitiesrequest *GoogleCloudDialogflowV2BatchDeleteEntitiesRequest) *ProjectsAgentEntityTypesEntitiesBatchDeleteCall { 8900 c := &ProjectsAgentEntityTypesEntitiesBatchDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8901 c.parent = parent 8902 c.googleclouddialogflowv2batchdeleteentitiesrequest = googleclouddialogflowv2batchdeleteentitiesrequest 8903 return c 8904} 8905 8906// Fields allows partial responses to be retrieved. See 8907// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8908// for more information. 8909func (c *ProjectsAgentEntityTypesEntitiesBatchDeleteCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesEntitiesBatchDeleteCall { 8910 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8911 return c 8912} 8913 8914// Context sets the context to be used in this call's Do method. Any 8915// pending HTTP request will be aborted if the provided context is 8916// canceled. 8917func (c *ProjectsAgentEntityTypesEntitiesBatchDeleteCall) Context(ctx context.Context) *ProjectsAgentEntityTypesEntitiesBatchDeleteCall { 8918 c.ctx_ = ctx 8919 return c 8920} 8921 8922// Header returns an http.Header that can be modified by the caller to 8923// add HTTP headers to the request. 8924func (c *ProjectsAgentEntityTypesEntitiesBatchDeleteCall) Header() http.Header { 8925 if c.header_ == nil { 8926 c.header_ = make(http.Header) 8927 } 8928 return c.header_ 8929} 8930 8931func (c *ProjectsAgentEntityTypesEntitiesBatchDeleteCall) doRequest(alt string) (*http.Response, error) { 8932 reqHeaders := make(http.Header) 8933 for k, v := range c.header_ { 8934 reqHeaders[k] = v 8935 } 8936 reqHeaders.Set("User-Agent", c.s.userAgent()) 8937 var body io.Reader = nil 8938 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2batchdeleteentitiesrequest) 8939 if err != nil { 8940 return nil, err 8941 } 8942 reqHeaders.Set("Content-Type", "application/json") 8943 c.urlParams_.Set("alt", alt) 8944 c.urlParams_.Set("prettyPrint", "false") 8945 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/entities:batchDelete") 8946 urls += "?" + c.urlParams_.Encode() 8947 req, err := http.NewRequest("POST", urls, body) 8948 if err != nil { 8949 return nil, err 8950 } 8951 req.Header = reqHeaders 8952 googleapi.Expand(req.URL, map[string]string{ 8953 "parent": c.parent, 8954 }) 8955 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8956} 8957 8958// Do executes the "dialogflow.projects.agent.entityTypes.entities.batchDelete" call. 8959// Exactly one of *GoogleLongrunningOperation or error will be non-nil. 8960// Any non-2xx status code is an error. Response headers are in either 8961// *GoogleLongrunningOperation.ServerResponse.Header or (if a response 8962// was returned at all) in error.(*googleapi.Error).Header. Use 8963// googleapi.IsNotModified to check whether the returned error was 8964// because http.StatusNotModified was returned. 8965func (c *ProjectsAgentEntityTypesEntitiesBatchDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 8966 gensupport.SetOptions(c.urlParams_, opts...) 8967 res, err := c.doRequest("json") 8968 if res != nil && res.StatusCode == http.StatusNotModified { 8969 if res.Body != nil { 8970 res.Body.Close() 8971 } 8972 return nil, &googleapi.Error{ 8973 Code: res.StatusCode, 8974 Header: res.Header, 8975 } 8976 } 8977 if err != nil { 8978 return nil, err 8979 } 8980 defer googleapi.CloseBody(res) 8981 if err := googleapi.CheckResponse(res); err != nil { 8982 return nil, err 8983 } 8984 ret := &GoogleLongrunningOperation{ 8985 ServerResponse: googleapi.ServerResponse{ 8986 Header: res.Header, 8987 HTTPStatusCode: res.StatusCode, 8988 }, 8989 } 8990 target := &ret 8991 if err := gensupport.DecodeResponse(target, res); err != nil { 8992 return nil, err 8993 } 8994 return ret, nil 8995 // { 8996 // "description": "Deletes entities in the specified entity type.\n\nOperation \u003cresponse: google.protobuf.Empty\u003e", 8997 // "flatPath": "v2/projects/{projectsId}/agent/entityTypes/{entityTypesId}/entities:batchDelete", 8998 // "httpMethod": "POST", 8999 // "id": "dialogflow.projects.agent.entityTypes.entities.batchDelete", 9000 // "parameterOrder": [ 9001 // "parent" 9002 // ], 9003 // "parameters": { 9004 // "parent": { 9005 // "description": "Required. The name of the entity type to delete entries for. Format:\n`projects/\u003cProject ID\u003e/agent/entityTypes/\u003cEntity Type ID\u003e`.", 9006 // "location": "path", 9007 // "pattern": "^projects/[^/]+/agent/entityTypes/[^/]+$", 9008 // "required": true, 9009 // "type": "string" 9010 // } 9011 // }, 9012 // "path": "v2/{+parent}/entities:batchDelete", 9013 // "request": { 9014 // "$ref": "GoogleCloudDialogflowV2BatchDeleteEntitiesRequest" 9015 // }, 9016 // "response": { 9017 // "$ref": "GoogleLongrunningOperation" 9018 // }, 9019 // "scopes": [ 9020 // "https://www.googleapis.com/auth/cloud-platform", 9021 // "https://www.googleapis.com/auth/dialogflow" 9022 // ] 9023 // } 9024 9025} 9026 9027// method id "dialogflow.projects.agent.entityTypes.entities.batchUpdate": 9028 9029type ProjectsAgentEntityTypesEntitiesBatchUpdateCall struct { 9030 s *Service 9031 parent string 9032 googleclouddialogflowv2batchupdateentitiesrequest *GoogleCloudDialogflowV2BatchUpdateEntitiesRequest 9033 urlParams_ gensupport.URLParams 9034 ctx_ context.Context 9035 header_ http.Header 9036} 9037 9038// BatchUpdate: Updates or creates multiple entities in the specified 9039// entity type. This 9040// method does not affect entities in the entity type that aren't 9041// explicitly 9042// specified in the request. 9043// 9044// Operation <response: google.protobuf.Empty> 9045func (r *ProjectsAgentEntityTypesEntitiesService) BatchUpdate(parent string, googleclouddialogflowv2batchupdateentitiesrequest *GoogleCloudDialogflowV2BatchUpdateEntitiesRequest) *ProjectsAgentEntityTypesEntitiesBatchUpdateCall { 9046 c := &ProjectsAgentEntityTypesEntitiesBatchUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9047 c.parent = parent 9048 c.googleclouddialogflowv2batchupdateentitiesrequest = googleclouddialogflowv2batchupdateentitiesrequest 9049 return c 9050} 9051 9052// Fields allows partial responses to be retrieved. See 9053// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9054// for more information. 9055func (c *ProjectsAgentEntityTypesEntitiesBatchUpdateCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesEntitiesBatchUpdateCall { 9056 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9057 return c 9058} 9059 9060// Context sets the context to be used in this call's Do method. Any 9061// pending HTTP request will be aborted if the provided context is 9062// canceled. 9063func (c *ProjectsAgentEntityTypesEntitiesBatchUpdateCall) Context(ctx context.Context) *ProjectsAgentEntityTypesEntitiesBatchUpdateCall { 9064 c.ctx_ = ctx 9065 return c 9066} 9067 9068// Header returns an http.Header that can be modified by the caller to 9069// add HTTP headers to the request. 9070func (c *ProjectsAgentEntityTypesEntitiesBatchUpdateCall) Header() http.Header { 9071 if c.header_ == nil { 9072 c.header_ = make(http.Header) 9073 } 9074 return c.header_ 9075} 9076 9077func (c *ProjectsAgentEntityTypesEntitiesBatchUpdateCall) doRequest(alt string) (*http.Response, error) { 9078 reqHeaders := make(http.Header) 9079 for k, v := range c.header_ { 9080 reqHeaders[k] = v 9081 } 9082 reqHeaders.Set("User-Agent", c.s.userAgent()) 9083 var body io.Reader = nil 9084 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2batchupdateentitiesrequest) 9085 if err != nil { 9086 return nil, err 9087 } 9088 reqHeaders.Set("Content-Type", "application/json") 9089 c.urlParams_.Set("alt", alt) 9090 c.urlParams_.Set("prettyPrint", "false") 9091 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/entities:batchUpdate") 9092 urls += "?" + c.urlParams_.Encode() 9093 req, err := http.NewRequest("POST", urls, body) 9094 if err != nil { 9095 return nil, err 9096 } 9097 req.Header = reqHeaders 9098 googleapi.Expand(req.URL, map[string]string{ 9099 "parent": c.parent, 9100 }) 9101 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9102} 9103 9104// Do executes the "dialogflow.projects.agent.entityTypes.entities.batchUpdate" call. 9105// Exactly one of *GoogleLongrunningOperation or error will be non-nil. 9106// Any non-2xx status code is an error. Response headers are in either 9107// *GoogleLongrunningOperation.ServerResponse.Header or (if a response 9108// was returned at all) in error.(*googleapi.Error).Header. Use 9109// googleapi.IsNotModified to check whether the returned error was 9110// because http.StatusNotModified was returned. 9111func (c *ProjectsAgentEntityTypesEntitiesBatchUpdateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 9112 gensupport.SetOptions(c.urlParams_, opts...) 9113 res, err := c.doRequest("json") 9114 if res != nil && res.StatusCode == http.StatusNotModified { 9115 if res.Body != nil { 9116 res.Body.Close() 9117 } 9118 return nil, &googleapi.Error{ 9119 Code: res.StatusCode, 9120 Header: res.Header, 9121 } 9122 } 9123 if err != nil { 9124 return nil, err 9125 } 9126 defer googleapi.CloseBody(res) 9127 if err := googleapi.CheckResponse(res); err != nil { 9128 return nil, err 9129 } 9130 ret := &GoogleLongrunningOperation{ 9131 ServerResponse: googleapi.ServerResponse{ 9132 Header: res.Header, 9133 HTTPStatusCode: res.StatusCode, 9134 }, 9135 } 9136 target := &ret 9137 if err := gensupport.DecodeResponse(target, res); err != nil { 9138 return nil, err 9139 } 9140 return ret, nil 9141 // { 9142 // "description": "Updates or creates multiple entities in the specified entity type. This\nmethod does not affect entities in the entity type that aren't explicitly\nspecified in the request.\n\nOperation \u003cresponse: google.protobuf.Empty\u003e", 9143 // "flatPath": "v2/projects/{projectsId}/agent/entityTypes/{entityTypesId}/entities:batchUpdate", 9144 // "httpMethod": "POST", 9145 // "id": "dialogflow.projects.agent.entityTypes.entities.batchUpdate", 9146 // "parameterOrder": [ 9147 // "parent" 9148 // ], 9149 // "parameters": { 9150 // "parent": { 9151 // "description": "Required. The name of the entity type to update or create entities in.\nFormat: `projects/\u003cProject ID\u003e/agent/entityTypes/\u003cEntity Type ID\u003e`.", 9152 // "location": "path", 9153 // "pattern": "^projects/[^/]+/agent/entityTypes/[^/]+$", 9154 // "required": true, 9155 // "type": "string" 9156 // } 9157 // }, 9158 // "path": "v2/{+parent}/entities:batchUpdate", 9159 // "request": { 9160 // "$ref": "GoogleCloudDialogflowV2BatchUpdateEntitiesRequest" 9161 // }, 9162 // "response": { 9163 // "$ref": "GoogleLongrunningOperation" 9164 // }, 9165 // "scopes": [ 9166 // "https://www.googleapis.com/auth/cloud-platform", 9167 // "https://www.googleapis.com/auth/dialogflow" 9168 // ] 9169 // } 9170 9171} 9172 9173// method id "dialogflow.projects.agent.intents.batchDelete": 9174 9175type ProjectsAgentIntentsBatchDeleteCall struct { 9176 s *Service 9177 parent string 9178 googleclouddialogflowv2batchdeleteintentsrequest *GoogleCloudDialogflowV2BatchDeleteIntentsRequest 9179 urlParams_ gensupport.URLParams 9180 ctx_ context.Context 9181 header_ http.Header 9182} 9183 9184// BatchDelete: Deletes intents in the specified agent. 9185// 9186// Operation <response: google.protobuf.Empty> 9187func (r *ProjectsAgentIntentsService) BatchDelete(parent string, googleclouddialogflowv2batchdeleteintentsrequest *GoogleCloudDialogflowV2BatchDeleteIntentsRequest) *ProjectsAgentIntentsBatchDeleteCall { 9188 c := &ProjectsAgentIntentsBatchDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9189 c.parent = parent 9190 c.googleclouddialogflowv2batchdeleteintentsrequest = googleclouddialogflowv2batchdeleteintentsrequest 9191 return c 9192} 9193 9194// Fields allows partial responses to be retrieved. See 9195// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9196// for more information. 9197func (c *ProjectsAgentIntentsBatchDeleteCall) Fields(s ...googleapi.Field) *ProjectsAgentIntentsBatchDeleteCall { 9198 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9199 return c 9200} 9201 9202// Context sets the context to be used in this call's Do method. Any 9203// pending HTTP request will be aborted if the provided context is 9204// canceled. 9205func (c *ProjectsAgentIntentsBatchDeleteCall) Context(ctx context.Context) *ProjectsAgentIntentsBatchDeleteCall { 9206 c.ctx_ = ctx 9207 return c 9208} 9209 9210// Header returns an http.Header that can be modified by the caller to 9211// add HTTP headers to the request. 9212func (c *ProjectsAgentIntentsBatchDeleteCall) Header() http.Header { 9213 if c.header_ == nil { 9214 c.header_ = make(http.Header) 9215 } 9216 return c.header_ 9217} 9218 9219func (c *ProjectsAgentIntentsBatchDeleteCall) doRequest(alt string) (*http.Response, error) { 9220 reqHeaders := make(http.Header) 9221 for k, v := range c.header_ { 9222 reqHeaders[k] = v 9223 } 9224 reqHeaders.Set("User-Agent", c.s.userAgent()) 9225 var body io.Reader = nil 9226 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2batchdeleteintentsrequest) 9227 if err != nil { 9228 return nil, err 9229 } 9230 reqHeaders.Set("Content-Type", "application/json") 9231 c.urlParams_.Set("alt", alt) 9232 c.urlParams_.Set("prettyPrint", "false") 9233 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/intents:batchDelete") 9234 urls += "?" + c.urlParams_.Encode() 9235 req, err := http.NewRequest("POST", urls, body) 9236 if err != nil { 9237 return nil, err 9238 } 9239 req.Header = reqHeaders 9240 googleapi.Expand(req.URL, map[string]string{ 9241 "parent": c.parent, 9242 }) 9243 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9244} 9245 9246// Do executes the "dialogflow.projects.agent.intents.batchDelete" call. 9247// Exactly one of *GoogleLongrunningOperation or error will be non-nil. 9248// Any non-2xx status code is an error. Response headers are in either 9249// *GoogleLongrunningOperation.ServerResponse.Header or (if a response 9250// was returned at all) in error.(*googleapi.Error).Header. Use 9251// googleapi.IsNotModified to check whether the returned error was 9252// because http.StatusNotModified was returned. 9253func (c *ProjectsAgentIntentsBatchDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 9254 gensupport.SetOptions(c.urlParams_, opts...) 9255 res, err := c.doRequest("json") 9256 if res != nil && res.StatusCode == http.StatusNotModified { 9257 if res.Body != nil { 9258 res.Body.Close() 9259 } 9260 return nil, &googleapi.Error{ 9261 Code: res.StatusCode, 9262 Header: res.Header, 9263 } 9264 } 9265 if err != nil { 9266 return nil, err 9267 } 9268 defer googleapi.CloseBody(res) 9269 if err := googleapi.CheckResponse(res); err != nil { 9270 return nil, err 9271 } 9272 ret := &GoogleLongrunningOperation{ 9273 ServerResponse: googleapi.ServerResponse{ 9274 Header: res.Header, 9275 HTTPStatusCode: res.StatusCode, 9276 }, 9277 } 9278 target := &ret 9279 if err := gensupport.DecodeResponse(target, res); err != nil { 9280 return nil, err 9281 } 9282 return ret, nil 9283 // { 9284 // "description": "Deletes intents in the specified agent.\n\nOperation \u003cresponse: google.protobuf.Empty\u003e", 9285 // "flatPath": "v2/projects/{projectsId}/agent/intents:batchDelete", 9286 // "httpMethod": "POST", 9287 // "id": "dialogflow.projects.agent.intents.batchDelete", 9288 // "parameterOrder": [ 9289 // "parent" 9290 // ], 9291 // "parameters": { 9292 // "parent": { 9293 // "description": "Required. The name of the agent to delete all entities types for. Format:\n`projects/\u003cProject ID\u003e/agent`.", 9294 // "location": "path", 9295 // "pattern": "^projects/[^/]+/agent$", 9296 // "required": true, 9297 // "type": "string" 9298 // } 9299 // }, 9300 // "path": "v2/{+parent}/intents:batchDelete", 9301 // "request": { 9302 // "$ref": "GoogleCloudDialogflowV2BatchDeleteIntentsRequest" 9303 // }, 9304 // "response": { 9305 // "$ref": "GoogleLongrunningOperation" 9306 // }, 9307 // "scopes": [ 9308 // "https://www.googleapis.com/auth/cloud-platform", 9309 // "https://www.googleapis.com/auth/dialogflow" 9310 // ] 9311 // } 9312 9313} 9314 9315// method id "dialogflow.projects.agent.intents.batchUpdate": 9316 9317type ProjectsAgentIntentsBatchUpdateCall struct { 9318 s *Service 9319 parent string 9320 googleclouddialogflowv2batchupdateintentsrequest *GoogleCloudDialogflowV2BatchUpdateIntentsRequest 9321 urlParams_ gensupport.URLParams 9322 ctx_ context.Context 9323 header_ http.Header 9324} 9325 9326// BatchUpdate: Updates/Creates multiple intents in the specified 9327// agent. 9328// 9329// Operation <response: BatchUpdateIntentsResponse> 9330func (r *ProjectsAgentIntentsService) BatchUpdate(parent string, googleclouddialogflowv2batchupdateintentsrequest *GoogleCloudDialogflowV2BatchUpdateIntentsRequest) *ProjectsAgentIntentsBatchUpdateCall { 9331 c := &ProjectsAgentIntentsBatchUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9332 c.parent = parent 9333 c.googleclouddialogflowv2batchupdateintentsrequest = googleclouddialogflowv2batchupdateintentsrequest 9334 return c 9335} 9336 9337// Fields allows partial responses to be retrieved. See 9338// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9339// for more information. 9340func (c *ProjectsAgentIntentsBatchUpdateCall) Fields(s ...googleapi.Field) *ProjectsAgentIntentsBatchUpdateCall { 9341 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9342 return c 9343} 9344 9345// Context sets the context to be used in this call's Do method. Any 9346// pending HTTP request will be aborted if the provided context is 9347// canceled. 9348func (c *ProjectsAgentIntentsBatchUpdateCall) Context(ctx context.Context) *ProjectsAgentIntentsBatchUpdateCall { 9349 c.ctx_ = ctx 9350 return c 9351} 9352 9353// Header returns an http.Header that can be modified by the caller to 9354// add HTTP headers to the request. 9355func (c *ProjectsAgentIntentsBatchUpdateCall) Header() http.Header { 9356 if c.header_ == nil { 9357 c.header_ = make(http.Header) 9358 } 9359 return c.header_ 9360} 9361 9362func (c *ProjectsAgentIntentsBatchUpdateCall) doRequest(alt string) (*http.Response, error) { 9363 reqHeaders := make(http.Header) 9364 for k, v := range c.header_ { 9365 reqHeaders[k] = v 9366 } 9367 reqHeaders.Set("User-Agent", c.s.userAgent()) 9368 var body io.Reader = nil 9369 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2batchupdateintentsrequest) 9370 if err != nil { 9371 return nil, err 9372 } 9373 reqHeaders.Set("Content-Type", "application/json") 9374 c.urlParams_.Set("alt", alt) 9375 c.urlParams_.Set("prettyPrint", "false") 9376 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/intents:batchUpdate") 9377 urls += "?" + c.urlParams_.Encode() 9378 req, err := http.NewRequest("POST", urls, body) 9379 if err != nil { 9380 return nil, err 9381 } 9382 req.Header = reqHeaders 9383 googleapi.Expand(req.URL, map[string]string{ 9384 "parent": c.parent, 9385 }) 9386 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9387} 9388 9389// Do executes the "dialogflow.projects.agent.intents.batchUpdate" call. 9390// Exactly one of *GoogleLongrunningOperation or error will be non-nil. 9391// Any non-2xx status code is an error. Response headers are in either 9392// *GoogleLongrunningOperation.ServerResponse.Header or (if a response 9393// was returned at all) in error.(*googleapi.Error).Header. Use 9394// googleapi.IsNotModified to check whether the returned error was 9395// because http.StatusNotModified was returned. 9396func (c *ProjectsAgentIntentsBatchUpdateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 9397 gensupport.SetOptions(c.urlParams_, opts...) 9398 res, err := c.doRequest("json") 9399 if res != nil && res.StatusCode == http.StatusNotModified { 9400 if res.Body != nil { 9401 res.Body.Close() 9402 } 9403 return nil, &googleapi.Error{ 9404 Code: res.StatusCode, 9405 Header: res.Header, 9406 } 9407 } 9408 if err != nil { 9409 return nil, err 9410 } 9411 defer googleapi.CloseBody(res) 9412 if err := googleapi.CheckResponse(res); err != nil { 9413 return nil, err 9414 } 9415 ret := &GoogleLongrunningOperation{ 9416 ServerResponse: googleapi.ServerResponse{ 9417 Header: res.Header, 9418 HTTPStatusCode: res.StatusCode, 9419 }, 9420 } 9421 target := &ret 9422 if err := gensupport.DecodeResponse(target, res); err != nil { 9423 return nil, err 9424 } 9425 return ret, nil 9426 // { 9427 // "description": "Updates/Creates multiple intents in the specified agent.\n\nOperation \u003cresponse: BatchUpdateIntentsResponse\u003e", 9428 // "flatPath": "v2/projects/{projectsId}/agent/intents:batchUpdate", 9429 // "httpMethod": "POST", 9430 // "id": "dialogflow.projects.agent.intents.batchUpdate", 9431 // "parameterOrder": [ 9432 // "parent" 9433 // ], 9434 // "parameters": { 9435 // "parent": { 9436 // "description": "Required. The name of the agent to update or create intents in.\nFormat: `projects/\u003cProject ID\u003e/agent`.", 9437 // "location": "path", 9438 // "pattern": "^projects/[^/]+/agent$", 9439 // "required": true, 9440 // "type": "string" 9441 // } 9442 // }, 9443 // "path": "v2/{+parent}/intents:batchUpdate", 9444 // "request": { 9445 // "$ref": "GoogleCloudDialogflowV2BatchUpdateIntentsRequest" 9446 // }, 9447 // "response": { 9448 // "$ref": "GoogleLongrunningOperation" 9449 // }, 9450 // "scopes": [ 9451 // "https://www.googleapis.com/auth/cloud-platform", 9452 // "https://www.googleapis.com/auth/dialogflow" 9453 // ] 9454 // } 9455 9456} 9457 9458// method id "dialogflow.projects.agent.intents.create": 9459 9460type ProjectsAgentIntentsCreateCall struct { 9461 s *Service 9462 parent string 9463 googleclouddialogflowv2intent *GoogleCloudDialogflowV2Intent 9464 urlParams_ gensupport.URLParams 9465 ctx_ context.Context 9466 header_ http.Header 9467} 9468 9469// Create: Creates an intent in the specified agent. 9470func (r *ProjectsAgentIntentsService) Create(parent string, googleclouddialogflowv2intent *GoogleCloudDialogflowV2Intent) *ProjectsAgentIntentsCreateCall { 9471 c := &ProjectsAgentIntentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9472 c.parent = parent 9473 c.googleclouddialogflowv2intent = googleclouddialogflowv2intent 9474 return c 9475} 9476 9477// IntentView sets the optional parameter "intentView": The resource 9478// view to apply to the returned intent. 9479// 9480// Possible values: 9481// "INTENT_VIEW_UNSPECIFIED" 9482// "INTENT_VIEW_FULL" 9483func (c *ProjectsAgentIntentsCreateCall) IntentView(intentView string) *ProjectsAgentIntentsCreateCall { 9484 c.urlParams_.Set("intentView", intentView) 9485 return c 9486} 9487 9488// LanguageCode sets the optional parameter "languageCode": The language 9489// of training phrases, parameters and rich messages 9490// defined in `intent`. If not specified, the agent's default language 9491// is 9492// used. 9493// [Many 9494// languages](https://cloud.google.com/dialogflow/docs/reference/la 9495// nguage) 9496// are supported. Note: languages must be enabled in the agent before 9497// they can 9498// be used. 9499func (c *ProjectsAgentIntentsCreateCall) LanguageCode(languageCode string) *ProjectsAgentIntentsCreateCall { 9500 c.urlParams_.Set("languageCode", languageCode) 9501 return c 9502} 9503 9504// Fields allows partial responses to be retrieved. See 9505// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9506// for more information. 9507func (c *ProjectsAgentIntentsCreateCall) Fields(s ...googleapi.Field) *ProjectsAgentIntentsCreateCall { 9508 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9509 return c 9510} 9511 9512// Context sets the context to be used in this call's Do method. Any 9513// pending HTTP request will be aborted if the provided context is 9514// canceled. 9515func (c *ProjectsAgentIntentsCreateCall) Context(ctx context.Context) *ProjectsAgentIntentsCreateCall { 9516 c.ctx_ = ctx 9517 return c 9518} 9519 9520// Header returns an http.Header that can be modified by the caller to 9521// add HTTP headers to the request. 9522func (c *ProjectsAgentIntentsCreateCall) Header() http.Header { 9523 if c.header_ == nil { 9524 c.header_ = make(http.Header) 9525 } 9526 return c.header_ 9527} 9528 9529func (c *ProjectsAgentIntentsCreateCall) doRequest(alt string) (*http.Response, error) { 9530 reqHeaders := make(http.Header) 9531 for k, v := range c.header_ { 9532 reqHeaders[k] = v 9533 } 9534 reqHeaders.Set("User-Agent", c.s.userAgent()) 9535 var body io.Reader = nil 9536 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2intent) 9537 if err != nil { 9538 return nil, err 9539 } 9540 reqHeaders.Set("Content-Type", "application/json") 9541 c.urlParams_.Set("alt", alt) 9542 c.urlParams_.Set("prettyPrint", "false") 9543 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/intents") 9544 urls += "?" + c.urlParams_.Encode() 9545 req, err := http.NewRequest("POST", urls, body) 9546 if err != nil { 9547 return nil, err 9548 } 9549 req.Header = reqHeaders 9550 googleapi.Expand(req.URL, map[string]string{ 9551 "parent": c.parent, 9552 }) 9553 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9554} 9555 9556// Do executes the "dialogflow.projects.agent.intents.create" call. 9557// Exactly one of *GoogleCloudDialogflowV2Intent or error will be 9558// non-nil. Any non-2xx status code is an error. Response headers are in 9559// either *GoogleCloudDialogflowV2Intent.ServerResponse.Header or (if a 9560// response was returned at all) in error.(*googleapi.Error).Header. Use 9561// googleapi.IsNotModified to check whether the returned error was 9562// because http.StatusNotModified was returned. 9563func (c *ProjectsAgentIntentsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2Intent, error) { 9564 gensupport.SetOptions(c.urlParams_, opts...) 9565 res, err := c.doRequest("json") 9566 if res != nil && res.StatusCode == http.StatusNotModified { 9567 if res.Body != nil { 9568 res.Body.Close() 9569 } 9570 return nil, &googleapi.Error{ 9571 Code: res.StatusCode, 9572 Header: res.Header, 9573 } 9574 } 9575 if err != nil { 9576 return nil, err 9577 } 9578 defer googleapi.CloseBody(res) 9579 if err := googleapi.CheckResponse(res); err != nil { 9580 return nil, err 9581 } 9582 ret := &GoogleCloudDialogflowV2Intent{ 9583 ServerResponse: googleapi.ServerResponse{ 9584 Header: res.Header, 9585 HTTPStatusCode: res.StatusCode, 9586 }, 9587 } 9588 target := &ret 9589 if err := gensupport.DecodeResponse(target, res); err != nil { 9590 return nil, err 9591 } 9592 return ret, nil 9593 // { 9594 // "description": "Creates an intent in the specified agent.", 9595 // "flatPath": "v2/projects/{projectsId}/agent/intents", 9596 // "httpMethod": "POST", 9597 // "id": "dialogflow.projects.agent.intents.create", 9598 // "parameterOrder": [ 9599 // "parent" 9600 // ], 9601 // "parameters": { 9602 // "intentView": { 9603 // "description": "Optional. The resource view to apply to the returned intent.", 9604 // "enum": [ 9605 // "INTENT_VIEW_UNSPECIFIED", 9606 // "INTENT_VIEW_FULL" 9607 // ], 9608 // "location": "query", 9609 // "type": "string" 9610 // }, 9611 // "languageCode": { 9612 // "description": "Optional. The language of training phrases, parameters and rich messages\ndefined in `intent`. If not specified, the agent's default language is\nused. [Many\nlanguages](https://cloud.google.com/dialogflow/docs/reference/language)\nare supported. Note: languages must be enabled in the agent before they can\nbe used.", 9613 // "location": "query", 9614 // "type": "string" 9615 // }, 9616 // "parent": { 9617 // "description": "Required. The agent to create a intent for.\nFormat: `projects/\u003cProject ID\u003e/agent`.", 9618 // "location": "path", 9619 // "pattern": "^projects/[^/]+/agent$", 9620 // "required": true, 9621 // "type": "string" 9622 // } 9623 // }, 9624 // "path": "v2/{+parent}/intents", 9625 // "request": { 9626 // "$ref": "GoogleCloudDialogflowV2Intent" 9627 // }, 9628 // "response": { 9629 // "$ref": "GoogleCloudDialogflowV2Intent" 9630 // }, 9631 // "scopes": [ 9632 // "https://www.googleapis.com/auth/cloud-platform", 9633 // "https://www.googleapis.com/auth/dialogflow" 9634 // ] 9635 // } 9636 9637} 9638 9639// method id "dialogflow.projects.agent.intents.delete": 9640 9641type ProjectsAgentIntentsDeleteCall struct { 9642 s *Service 9643 name string 9644 urlParams_ gensupport.URLParams 9645 ctx_ context.Context 9646 header_ http.Header 9647} 9648 9649// Delete: Deletes the specified intent and its direct or indirect 9650// followup intents. 9651func (r *ProjectsAgentIntentsService) Delete(name string) *ProjectsAgentIntentsDeleteCall { 9652 c := &ProjectsAgentIntentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9653 c.name = name 9654 return c 9655} 9656 9657// Fields allows partial responses to be retrieved. See 9658// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9659// for more information. 9660func (c *ProjectsAgentIntentsDeleteCall) Fields(s ...googleapi.Field) *ProjectsAgentIntentsDeleteCall { 9661 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9662 return c 9663} 9664 9665// Context sets the context to be used in this call's Do method. Any 9666// pending HTTP request will be aborted if the provided context is 9667// canceled. 9668func (c *ProjectsAgentIntentsDeleteCall) Context(ctx context.Context) *ProjectsAgentIntentsDeleteCall { 9669 c.ctx_ = ctx 9670 return c 9671} 9672 9673// Header returns an http.Header that can be modified by the caller to 9674// add HTTP headers to the request. 9675func (c *ProjectsAgentIntentsDeleteCall) Header() http.Header { 9676 if c.header_ == nil { 9677 c.header_ = make(http.Header) 9678 } 9679 return c.header_ 9680} 9681 9682func (c *ProjectsAgentIntentsDeleteCall) doRequest(alt string) (*http.Response, error) { 9683 reqHeaders := make(http.Header) 9684 for k, v := range c.header_ { 9685 reqHeaders[k] = v 9686 } 9687 reqHeaders.Set("User-Agent", c.s.userAgent()) 9688 var body io.Reader = nil 9689 c.urlParams_.Set("alt", alt) 9690 c.urlParams_.Set("prettyPrint", "false") 9691 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") 9692 urls += "?" + c.urlParams_.Encode() 9693 req, err := http.NewRequest("DELETE", urls, body) 9694 if err != nil { 9695 return nil, err 9696 } 9697 req.Header = reqHeaders 9698 googleapi.Expand(req.URL, map[string]string{ 9699 "name": c.name, 9700 }) 9701 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9702} 9703 9704// Do executes the "dialogflow.projects.agent.intents.delete" call. 9705// Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any 9706// non-2xx status code is an error. Response headers are in either 9707// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was 9708// returned at all) in error.(*googleapi.Error).Header. Use 9709// googleapi.IsNotModified to check whether the returned error was 9710// because http.StatusNotModified was returned. 9711func (c *ProjectsAgentIntentsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { 9712 gensupport.SetOptions(c.urlParams_, opts...) 9713 res, err := c.doRequest("json") 9714 if res != nil && res.StatusCode == http.StatusNotModified { 9715 if res.Body != nil { 9716 res.Body.Close() 9717 } 9718 return nil, &googleapi.Error{ 9719 Code: res.StatusCode, 9720 Header: res.Header, 9721 } 9722 } 9723 if err != nil { 9724 return nil, err 9725 } 9726 defer googleapi.CloseBody(res) 9727 if err := googleapi.CheckResponse(res); err != nil { 9728 return nil, err 9729 } 9730 ret := &GoogleProtobufEmpty{ 9731 ServerResponse: googleapi.ServerResponse{ 9732 Header: res.Header, 9733 HTTPStatusCode: res.StatusCode, 9734 }, 9735 } 9736 target := &ret 9737 if err := gensupport.DecodeResponse(target, res); err != nil { 9738 return nil, err 9739 } 9740 return ret, nil 9741 // { 9742 // "description": "Deletes the specified intent and its direct or indirect followup intents.", 9743 // "flatPath": "v2/projects/{projectsId}/agent/intents/{intentsId}", 9744 // "httpMethod": "DELETE", 9745 // "id": "dialogflow.projects.agent.intents.delete", 9746 // "parameterOrder": [ 9747 // "name" 9748 // ], 9749 // "parameters": { 9750 // "name": { 9751 // "description": "Required. The name of the intent to delete. If this intent has direct or\nindirect followup intents, we also delete them.\nFormat: `projects/\u003cProject ID\u003e/agent/intents/\u003cIntent ID\u003e`.", 9752 // "location": "path", 9753 // "pattern": "^projects/[^/]+/agent/intents/[^/]+$", 9754 // "required": true, 9755 // "type": "string" 9756 // } 9757 // }, 9758 // "path": "v2/{+name}", 9759 // "response": { 9760 // "$ref": "GoogleProtobufEmpty" 9761 // }, 9762 // "scopes": [ 9763 // "https://www.googleapis.com/auth/cloud-platform", 9764 // "https://www.googleapis.com/auth/dialogflow" 9765 // ] 9766 // } 9767 9768} 9769 9770// method id "dialogflow.projects.agent.intents.get": 9771 9772type ProjectsAgentIntentsGetCall struct { 9773 s *Service 9774 name string 9775 urlParams_ gensupport.URLParams 9776 ifNoneMatch_ string 9777 ctx_ context.Context 9778 header_ http.Header 9779} 9780 9781// Get: Retrieves the specified intent. 9782func (r *ProjectsAgentIntentsService) Get(name string) *ProjectsAgentIntentsGetCall { 9783 c := &ProjectsAgentIntentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9784 c.name = name 9785 return c 9786} 9787 9788// IntentView sets the optional parameter "intentView": The resource 9789// view to apply to the returned intent. 9790// 9791// Possible values: 9792// "INTENT_VIEW_UNSPECIFIED" 9793// "INTENT_VIEW_FULL" 9794func (c *ProjectsAgentIntentsGetCall) IntentView(intentView string) *ProjectsAgentIntentsGetCall { 9795 c.urlParams_.Set("intentView", intentView) 9796 return c 9797} 9798 9799// LanguageCode sets the optional parameter "languageCode": The language 9800// to retrieve training phrases, parameters and rich 9801// messages for. If not specified, the agent's default language is 9802// used. 9803// [Many 9804// languages](https://cloud.google.com/dialogflow/docs/refere 9805// nce/language) 9806// are supported. Note: languages must be enabled in the agent before 9807// they can 9808// be used. 9809func (c *ProjectsAgentIntentsGetCall) LanguageCode(languageCode string) *ProjectsAgentIntentsGetCall { 9810 c.urlParams_.Set("languageCode", languageCode) 9811 return c 9812} 9813 9814// Fields allows partial responses to be retrieved. See 9815// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9816// for more information. 9817func (c *ProjectsAgentIntentsGetCall) Fields(s ...googleapi.Field) *ProjectsAgentIntentsGetCall { 9818 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9819 return c 9820} 9821 9822// IfNoneMatch sets the optional parameter which makes the operation 9823// fail if the object's ETag matches the given value. This is useful for 9824// getting updates only after the object has changed since the last 9825// request. Use googleapi.IsNotModified to check whether the response 9826// error from Do is the result of In-None-Match. 9827func (c *ProjectsAgentIntentsGetCall) IfNoneMatch(entityTag string) *ProjectsAgentIntentsGetCall { 9828 c.ifNoneMatch_ = entityTag 9829 return c 9830} 9831 9832// Context sets the context to be used in this call's Do method. Any 9833// pending HTTP request will be aborted if the provided context is 9834// canceled. 9835func (c *ProjectsAgentIntentsGetCall) Context(ctx context.Context) *ProjectsAgentIntentsGetCall { 9836 c.ctx_ = ctx 9837 return c 9838} 9839 9840// Header returns an http.Header that can be modified by the caller to 9841// add HTTP headers to the request. 9842func (c *ProjectsAgentIntentsGetCall) Header() http.Header { 9843 if c.header_ == nil { 9844 c.header_ = make(http.Header) 9845 } 9846 return c.header_ 9847} 9848 9849func (c *ProjectsAgentIntentsGetCall) doRequest(alt string) (*http.Response, error) { 9850 reqHeaders := make(http.Header) 9851 for k, v := range c.header_ { 9852 reqHeaders[k] = v 9853 } 9854 reqHeaders.Set("User-Agent", c.s.userAgent()) 9855 if c.ifNoneMatch_ != "" { 9856 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9857 } 9858 var body io.Reader = nil 9859 c.urlParams_.Set("alt", alt) 9860 c.urlParams_.Set("prettyPrint", "false") 9861 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") 9862 urls += "?" + c.urlParams_.Encode() 9863 req, err := http.NewRequest("GET", urls, body) 9864 if err != nil { 9865 return nil, err 9866 } 9867 req.Header = reqHeaders 9868 googleapi.Expand(req.URL, map[string]string{ 9869 "name": c.name, 9870 }) 9871 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9872} 9873 9874// Do executes the "dialogflow.projects.agent.intents.get" call. 9875// Exactly one of *GoogleCloudDialogflowV2Intent or error will be 9876// non-nil. Any non-2xx status code is an error. Response headers are in 9877// either *GoogleCloudDialogflowV2Intent.ServerResponse.Header or (if a 9878// response was returned at all) in error.(*googleapi.Error).Header. Use 9879// googleapi.IsNotModified to check whether the returned error was 9880// because http.StatusNotModified was returned. 9881func (c *ProjectsAgentIntentsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2Intent, error) { 9882 gensupport.SetOptions(c.urlParams_, opts...) 9883 res, err := c.doRequest("json") 9884 if res != nil && res.StatusCode == http.StatusNotModified { 9885 if res.Body != nil { 9886 res.Body.Close() 9887 } 9888 return nil, &googleapi.Error{ 9889 Code: res.StatusCode, 9890 Header: res.Header, 9891 } 9892 } 9893 if err != nil { 9894 return nil, err 9895 } 9896 defer googleapi.CloseBody(res) 9897 if err := googleapi.CheckResponse(res); err != nil { 9898 return nil, err 9899 } 9900 ret := &GoogleCloudDialogflowV2Intent{ 9901 ServerResponse: googleapi.ServerResponse{ 9902 Header: res.Header, 9903 HTTPStatusCode: res.StatusCode, 9904 }, 9905 } 9906 target := &ret 9907 if err := gensupport.DecodeResponse(target, res); err != nil { 9908 return nil, err 9909 } 9910 return ret, nil 9911 // { 9912 // "description": "Retrieves the specified intent.", 9913 // "flatPath": "v2/projects/{projectsId}/agent/intents/{intentsId}", 9914 // "httpMethod": "GET", 9915 // "id": "dialogflow.projects.agent.intents.get", 9916 // "parameterOrder": [ 9917 // "name" 9918 // ], 9919 // "parameters": { 9920 // "intentView": { 9921 // "description": "Optional. The resource view to apply to the returned intent.", 9922 // "enum": [ 9923 // "INTENT_VIEW_UNSPECIFIED", 9924 // "INTENT_VIEW_FULL" 9925 // ], 9926 // "location": "query", 9927 // "type": "string" 9928 // }, 9929 // "languageCode": { 9930 // "description": "Optional. The language to retrieve training phrases, parameters and rich\nmessages for. If not specified, the agent's default language is used.\n[Many\nlanguages](https://cloud.google.com/dialogflow/docs/reference/language)\nare supported. Note: languages must be enabled in the agent before they can\nbe used.", 9931 // "location": "query", 9932 // "type": "string" 9933 // }, 9934 // "name": { 9935 // "description": "Required. The name of the intent.\nFormat: `projects/\u003cProject ID\u003e/agent/intents/\u003cIntent ID\u003e`.", 9936 // "location": "path", 9937 // "pattern": "^projects/[^/]+/agent/intents/[^/]+$", 9938 // "required": true, 9939 // "type": "string" 9940 // } 9941 // }, 9942 // "path": "v2/{+name}", 9943 // "response": { 9944 // "$ref": "GoogleCloudDialogflowV2Intent" 9945 // }, 9946 // "scopes": [ 9947 // "https://www.googleapis.com/auth/cloud-platform", 9948 // "https://www.googleapis.com/auth/dialogflow" 9949 // ] 9950 // } 9951 9952} 9953 9954// method id "dialogflow.projects.agent.intents.list": 9955 9956type ProjectsAgentIntentsListCall struct { 9957 s *Service 9958 parent string 9959 urlParams_ gensupport.URLParams 9960 ifNoneMatch_ string 9961 ctx_ context.Context 9962 header_ http.Header 9963} 9964 9965// List: Returns the list of all intents in the specified agent. 9966func (r *ProjectsAgentIntentsService) List(parent string) *ProjectsAgentIntentsListCall { 9967 c := &ProjectsAgentIntentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9968 c.parent = parent 9969 return c 9970} 9971 9972// IntentView sets the optional parameter "intentView": The resource 9973// view to apply to the returned intent. 9974// 9975// Possible values: 9976// "INTENT_VIEW_UNSPECIFIED" 9977// "INTENT_VIEW_FULL" 9978func (c *ProjectsAgentIntentsListCall) IntentView(intentView string) *ProjectsAgentIntentsListCall { 9979 c.urlParams_.Set("intentView", intentView) 9980 return c 9981} 9982 9983// LanguageCode sets the optional parameter "languageCode": The language 9984// to list training phrases, parameters and rich 9985// messages for. If not specified, the agent's default language is 9986// used. 9987// [Many 9988// languages](https://cloud.google.com/dialogflow/docs/refere 9989// nce/language) 9990// are supported. Note: languages must be enabled in the agent before 9991// they can 9992// be used. 9993func (c *ProjectsAgentIntentsListCall) LanguageCode(languageCode string) *ProjectsAgentIntentsListCall { 9994 c.urlParams_.Set("languageCode", languageCode) 9995 return c 9996} 9997 9998// PageSize sets the optional parameter "pageSize": The maximum number 9999// of items to return in a single page. By 10000// default 100 and at most 1000. 10001func (c *ProjectsAgentIntentsListCall) PageSize(pageSize int64) *ProjectsAgentIntentsListCall { 10002 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 10003 return c 10004} 10005 10006// PageToken sets the optional parameter "pageToken": The 10007// next_page_token value returned from a previous list request. 10008func (c *ProjectsAgentIntentsListCall) PageToken(pageToken string) *ProjectsAgentIntentsListCall { 10009 c.urlParams_.Set("pageToken", pageToken) 10010 return c 10011} 10012 10013// Fields allows partial responses to be retrieved. See 10014// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10015// for more information. 10016func (c *ProjectsAgentIntentsListCall) Fields(s ...googleapi.Field) *ProjectsAgentIntentsListCall { 10017 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10018 return c 10019} 10020 10021// IfNoneMatch sets the optional parameter which makes the operation 10022// fail if the object's ETag matches the given value. This is useful for 10023// getting updates only after the object has changed since the last 10024// request. Use googleapi.IsNotModified to check whether the response 10025// error from Do is the result of In-None-Match. 10026func (c *ProjectsAgentIntentsListCall) IfNoneMatch(entityTag string) *ProjectsAgentIntentsListCall { 10027 c.ifNoneMatch_ = entityTag 10028 return c 10029} 10030 10031// Context sets the context to be used in this call's Do method. Any 10032// pending HTTP request will be aborted if the provided context is 10033// canceled. 10034func (c *ProjectsAgentIntentsListCall) Context(ctx context.Context) *ProjectsAgentIntentsListCall { 10035 c.ctx_ = ctx 10036 return c 10037} 10038 10039// Header returns an http.Header that can be modified by the caller to 10040// add HTTP headers to the request. 10041func (c *ProjectsAgentIntentsListCall) Header() http.Header { 10042 if c.header_ == nil { 10043 c.header_ = make(http.Header) 10044 } 10045 return c.header_ 10046} 10047 10048func (c *ProjectsAgentIntentsListCall) doRequest(alt string) (*http.Response, error) { 10049 reqHeaders := make(http.Header) 10050 for k, v := range c.header_ { 10051 reqHeaders[k] = v 10052 } 10053 reqHeaders.Set("User-Agent", c.s.userAgent()) 10054 if c.ifNoneMatch_ != "" { 10055 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10056 } 10057 var body io.Reader = nil 10058 c.urlParams_.Set("alt", alt) 10059 c.urlParams_.Set("prettyPrint", "false") 10060 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/intents") 10061 urls += "?" + c.urlParams_.Encode() 10062 req, err := http.NewRequest("GET", urls, body) 10063 if err != nil { 10064 return nil, err 10065 } 10066 req.Header = reqHeaders 10067 googleapi.Expand(req.URL, map[string]string{ 10068 "parent": c.parent, 10069 }) 10070 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10071} 10072 10073// Do executes the "dialogflow.projects.agent.intents.list" call. 10074// Exactly one of *GoogleCloudDialogflowV2ListIntentsResponse or error 10075// will be non-nil. Any non-2xx status code is an error. Response 10076// headers are in either 10077// *GoogleCloudDialogflowV2ListIntentsResponse.ServerResponse.Header or 10078// (if a response was returned at all) in 10079// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 10080// whether the returned error was because http.StatusNotModified was 10081// returned. 10082func (c *ProjectsAgentIntentsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2ListIntentsResponse, error) { 10083 gensupport.SetOptions(c.urlParams_, opts...) 10084 res, err := c.doRequest("json") 10085 if res != nil && res.StatusCode == http.StatusNotModified { 10086 if res.Body != nil { 10087 res.Body.Close() 10088 } 10089 return nil, &googleapi.Error{ 10090 Code: res.StatusCode, 10091 Header: res.Header, 10092 } 10093 } 10094 if err != nil { 10095 return nil, err 10096 } 10097 defer googleapi.CloseBody(res) 10098 if err := googleapi.CheckResponse(res); err != nil { 10099 return nil, err 10100 } 10101 ret := &GoogleCloudDialogflowV2ListIntentsResponse{ 10102 ServerResponse: googleapi.ServerResponse{ 10103 Header: res.Header, 10104 HTTPStatusCode: res.StatusCode, 10105 }, 10106 } 10107 target := &ret 10108 if err := gensupport.DecodeResponse(target, res); err != nil { 10109 return nil, err 10110 } 10111 return ret, nil 10112 // { 10113 // "description": "Returns the list of all intents in the specified agent.", 10114 // "flatPath": "v2/projects/{projectsId}/agent/intents", 10115 // "httpMethod": "GET", 10116 // "id": "dialogflow.projects.agent.intents.list", 10117 // "parameterOrder": [ 10118 // "parent" 10119 // ], 10120 // "parameters": { 10121 // "intentView": { 10122 // "description": "Optional. The resource view to apply to the returned intent.", 10123 // "enum": [ 10124 // "INTENT_VIEW_UNSPECIFIED", 10125 // "INTENT_VIEW_FULL" 10126 // ], 10127 // "location": "query", 10128 // "type": "string" 10129 // }, 10130 // "languageCode": { 10131 // "description": "Optional. The language to list training phrases, parameters and rich\nmessages for. If not specified, the agent's default language is used.\n[Many\nlanguages](https://cloud.google.com/dialogflow/docs/reference/language)\nare supported. Note: languages must be enabled in the agent before they can\nbe used.", 10132 // "location": "query", 10133 // "type": "string" 10134 // }, 10135 // "pageSize": { 10136 // "description": "Optional. The maximum number of items to return in a single page. By\ndefault 100 and at most 1000.", 10137 // "format": "int32", 10138 // "location": "query", 10139 // "type": "integer" 10140 // }, 10141 // "pageToken": { 10142 // "description": "Optional. The next_page_token value returned from a previous list request.", 10143 // "location": "query", 10144 // "type": "string" 10145 // }, 10146 // "parent": { 10147 // "description": "Required. The agent to list all intents from.\nFormat: `projects/\u003cProject ID\u003e/agent`.", 10148 // "location": "path", 10149 // "pattern": "^projects/[^/]+/agent$", 10150 // "required": true, 10151 // "type": "string" 10152 // } 10153 // }, 10154 // "path": "v2/{+parent}/intents", 10155 // "response": { 10156 // "$ref": "GoogleCloudDialogflowV2ListIntentsResponse" 10157 // }, 10158 // "scopes": [ 10159 // "https://www.googleapis.com/auth/cloud-platform", 10160 // "https://www.googleapis.com/auth/dialogflow" 10161 // ] 10162 // } 10163 10164} 10165 10166// Pages invokes f for each page of results. 10167// A non-nil error returned from f will halt the iteration. 10168// The provided context supersedes any context provided to the Context method. 10169func (c *ProjectsAgentIntentsListCall) Pages(ctx context.Context, f func(*GoogleCloudDialogflowV2ListIntentsResponse) error) error { 10170 c.ctx_ = ctx 10171 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 10172 for { 10173 x, err := c.Do() 10174 if err != nil { 10175 return err 10176 } 10177 if err := f(x); err != nil { 10178 return err 10179 } 10180 if x.NextPageToken == "" { 10181 return nil 10182 } 10183 c.PageToken(x.NextPageToken) 10184 } 10185} 10186 10187// method id "dialogflow.projects.agent.intents.patch": 10188 10189type ProjectsAgentIntentsPatchCall struct { 10190 s *Service 10191 nameid string 10192 googleclouddialogflowv2intent *GoogleCloudDialogflowV2Intent 10193 urlParams_ gensupport.URLParams 10194 ctx_ context.Context 10195 header_ http.Header 10196} 10197 10198// Patch: Updates the specified intent. 10199func (r *ProjectsAgentIntentsService) Patch(nameid string, googleclouddialogflowv2intent *GoogleCloudDialogflowV2Intent) *ProjectsAgentIntentsPatchCall { 10200 c := &ProjectsAgentIntentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10201 c.nameid = nameid 10202 c.googleclouddialogflowv2intent = googleclouddialogflowv2intent 10203 return c 10204} 10205 10206// IntentView sets the optional parameter "intentView": The resource 10207// view to apply to the returned intent. 10208// 10209// Possible values: 10210// "INTENT_VIEW_UNSPECIFIED" 10211// "INTENT_VIEW_FULL" 10212func (c *ProjectsAgentIntentsPatchCall) IntentView(intentView string) *ProjectsAgentIntentsPatchCall { 10213 c.urlParams_.Set("intentView", intentView) 10214 return c 10215} 10216 10217// LanguageCode sets the optional parameter "languageCode": The language 10218// of training phrases, parameters and rich messages 10219// defined in `intent`. If not specified, the agent's default language 10220// is 10221// used. 10222// [Many 10223// languages](https://cloud.google.com/dialogflow/docs/reference/la 10224// nguage) 10225// are supported. Note: languages must be enabled in the agent before 10226// they can 10227// be used. 10228func (c *ProjectsAgentIntentsPatchCall) LanguageCode(languageCode string) *ProjectsAgentIntentsPatchCall { 10229 c.urlParams_.Set("languageCode", languageCode) 10230 return c 10231} 10232 10233// UpdateMask sets the optional parameter "updateMask": The mask to 10234// control which fields get updated. 10235func (c *ProjectsAgentIntentsPatchCall) UpdateMask(updateMask string) *ProjectsAgentIntentsPatchCall { 10236 c.urlParams_.Set("updateMask", updateMask) 10237 return c 10238} 10239 10240// Fields allows partial responses to be retrieved. See 10241// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10242// for more information. 10243func (c *ProjectsAgentIntentsPatchCall) Fields(s ...googleapi.Field) *ProjectsAgentIntentsPatchCall { 10244 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10245 return c 10246} 10247 10248// Context sets the context to be used in this call's Do method. Any 10249// pending HTTP request will be aborted if the provided context is 10250// canceled. 10251func (c *ProjectsAgentIntentsPatchCall) Context(ctx context.Context) *ProjectsAgentIntentsPatchCall { 10252 c.ctx_ = ctx 10253 return c 10254} 10255 10256// Header returns an http.Header that can be modified by the caller to 10257// add HTTP headers to the request. 10258func (c *ProjectsAgentIntentsPatchCall) Header() http.Header { 10259 if c.header_ == nil { 10260 c.header_ = make(http.Header) 10261 } 10262 return c.header_ 10263} 10264 10265func (c *ProjectsAgentIntentsPatchCall) doRequest(alt string) (*http.Response, error) { 10266 reqHeaders := make(http.Header) 10267 for k, v := range c.header_ { 10268 reqHeaders[k] = v 10269 } 10270 reqHeaders.Set("User-Agent", c.s.userAgent()) 10271 var body io.Reader = nil 10272 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2intent) 10273 if err != nil { 10274 return nil, err 10275 } 10276 reqHeaders.Set("Content-Type", "application/json") 10277 c.urlParams_.Set("alt", alt) 10278 c.urlParams_.Set("prettyPrint", "false") 10279 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") 10280 urls += "?" + c.urlParams_.Encode() 10281 req, err := http.NewRequest("PATCH", urls, body) 10282 if err != nil { 10283 return nil, err 10284 } 10285 req.Header = reqHeaders 10286 googleapi.Expand(req.URL, map[string]string{ 10287 "name": c.nameid, 10288 }) 10289 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10290} 10291 10292// Do executes the "dialogflow.projects.agent.intents.patch" call. 10293// Exactly one of *GoogleCloudDialogflowV2Intent or error will be 10294// non-nil. Any non-2xx status code is an error. Response headers are in 10295// either *GoogleCloudDialogflowV2Intent.ServerResponse.Header or (if a 10296// response was returned at all) in error.(*googleapi.Error).Header. Use 10297// googleapi.IsNotModified to check whether the returned error was 10298// because http.StatusNotModified was returned. 10299func (c *ProjectsAgentIntentsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2Intent, error) { 10300 gensupport.SetOptions(c.urlParams_, opts...) 10301 res, err := c.doRequest("json") 10302 if res != nil && res.StatusCode == http.StatusNotModified { 10303 if res.Body != nil { 10304 res.Body.Close() 10305 } 10306 return nil, &googleapi.Error{ 10307 Code: res.StatusCode, 10308 Header: res.Header, 10309 } 10310 } 10311 if err != nil { 10312 return nil, err 10313 } 10314 defer googleapi.CloseBody(res) 10315 if err := googleapi.CheckResponse(res); err != nil { 10316 return nil, err 10317 } 10318 ret := &GoogleCloudDialogflowV2Intent{ 10319 ServerResponse: googleapi.ServerResponse{ 10320 Header: res.Header, 10321 HTTPStatusCode: res.StatusCode, 10322 }, 10323 } 10324 target := &ret 10325 if err := gensupport.DecodeResponse(target, res); err != nil { 10326 return nil, err 10327 } 10328 return ret, nil 10329 // { 10330 // "description": "Updates the specified intent.", 10331 // "flatPath": "v2/projects/{projectsId}/agent/intents/{intentsId}", 10332 // "httpMethod": "PATCH", 10333 // "id": "dialogflow.projects.agent.intents.patch", 10334 // "parameterOrder": [ 10335 // "name" 10336 // ], 10337 // "parameters": { 10338 // "intentView": { 10339 // "description": "Optional. The resource view to apply to the returned intent.", 10340 // "enum": [ 10341 // "INTENT_VIEW_UNSPECIFIED", 10342 // "INTENT_VIEW_FULL" 10343 // ], 10344 // "location": "query", 10345 // "type": "string" 10346 // }, 10347 // "languageCode": { 10348 // "description": "Optional. The language of training phrases, parameters and rich messages\ndefined in `intent`. If not specified, the agent's default language is\nused. [Many\nlanguages](https://cloud.google.com/dialogflow/docs/reference/language)\nare supported. Note: languages must be enabled in the agent before they can\nbe used.", 10349 // "location": "query", 10350 // "type": "string" 10351 // }, 10352 // "name": { 10353 // "description": "The unique identifier of this intent.\nRequired for Intents.UpdateIntent and Intents.BatchUpdateIntents\nmethods.\nFormat: `projects/\u003cProject ID\u003e/agent/intents/\u003cIntent ID\u003e`.", 10354 // "location": "path", 10355 // "pattern": "^projects/[^/]+/agent/intents/[^/]+$", 10356 // "required": true, 10357 // "type": "string" 10358 // }, 10359 // "updateMask": { 10360 // "description": "Optional. The mask to control which fields get updated.", 10361 // "format": "google-fieldmask", 10362 // "location": "query", 10363 // "type": "string" 10364 // } 10365 // }, 10366 // "path": "v2/{+name}", 10367 // "request": { 10368 // "$ref": "GoogleCloudDialogflowV2Intent" 10369 // }, 10370 // "response": { 10371 // "$ref": "GoogleCloudDialogflowV2Intent" 10372 // }, 10373 // "scopes": [ 10374 // "https://www.googleapis.com/auth/cloud-platform", 10375 // "https://www.googleapis.com/auth/dialogflow" 10376 // ] 10377 // } 10378 10379} 10380 10381// method id "dialogflow.projects.agent.sessions.deleteContexts": 10382 10383type ProjectsAgentSessionsDeleteContextsCall struct { 10384 s *Service 10385 parent string 10386 urlParams_ gensupport.URLParams 10387 ctx_ context.Context 10388 header_ http.Header 10389} 10390 10391// DeleteContexts: Deletes all active contexts in the specified session. 10392func (r *ProjectsAgentSessionsService) DeleteContexts(parent string) *ProjectsAgentSessionsDeleteContextsCall { 10393 c := &ProjectsAgentSessionsDeleteContextsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10394 c.parent = parent 10395 return c 10396} 10397 10398// Fields allows partial responses to be retrieved. See 10399// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10400// for more information. 10401func (c *ProjectsAgentSessionsDeleteContextsCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsDeleteContextsCall { 10402 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10403 return c 10404} 10405 10406// Context sets the context to be used in this call's Do method. Any 10407// pending HTTP request will be aborted if the provided context is 10408// canceled. 10409func (c *ProjectsAgentSessionsDeleteContextsCall) Context(ctx context.Context) *ProjectsAgentSessionsDeleteContextsCall { 10410 c.ctx_ = ctx 10411 return c 10412} 10413 10414// Header returns an http.Header that can be modified by the caller to 10415// add HTTP headers to the request. 10416func (c *ProjectsAgentSessionsDeleteContextsCall) Header() http.Header { 10417 if c.header_ == nil { 10418 c.header_ = make(http.Header) 10419 } 10420 return c.header_ 10421} 10422 10423func (c *ProjectsAgentSessionsDeleteContextsCall) doRequest(alt string) (*http.Response, error) { 10424 reqHeaders := make(http.Header) 10425 for k, v := range c.header_ { 10426 reqHeaders[k] = v 10427 } 10428 reqHeaders.Set("User-Agent", c.s.userAgent()) 10429 var body io.Reader = nil 10430 c.urlParams_.Set("alt", alt) 10431 c.urlParams_.Set("prettyPrint", "false") 10432 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/contexts") 10433 urls += "?" + c.urlParams_.Encode() 10434 req, err := http.NewRequest("DELETE", urls, body) 10435 if err != nil { 10436 return nil, err 10437 } 10438 req.Header = reqHeaders 10439 googleapi.Expand(req.URL, map[string]string{ 10440 "parent": c.parent, 10441 }) 10442 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10443} 10444 10445// Do executes the "dialogflow.projects.agent.sessions.deleteContexts" call. 10446// Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any 10447// non-2xx status code is an error. Response headers are in either 10448// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was 10449// returned at all) in error.(*googleapi.Error).Header. Use 10450// googleapi.IsNotModified to check whether the returned error was 10451// because http.StatusNotModified was returned. 10452func (c *ProjectsAgentSessionsDeleteContextsCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { 10453 gensupport.SetOptions(c.urlParams_, opts...) 10454 res, err := c.doRequest("json") 10455 if res != nil && res.StatusCode == http.StatusNotModified { 10456 if res.Body != nil { 10457 res.Body.Close() 10458 } 10459 return nil, &googleapi.Error{ 10460 Code: res.StatusCode, 10461 Header: res.Header, 10462 } 10463 } 10464 if err != nil { 10465 return nil, err 10466 } 10467 defer googleapi.CloseBody(res) 10468 if err := googleapi.CheckResponse(res); err != nil { 10469 return nil, err 10470 } 10471 ret := &GoogleProtobufEmpty{ 10472 ServerResponse: googleapi.ServerResponse{ 10473 Header: res.Header, 10474 HTTPStatusCode: res.StatusCode, 10475 }, 10476 } 10477 target := &ret 10478 if err := gensupport.DecodeResponse(target, res); err != nil { 10479 return nil, err 10480 } 10481 return ret, nil 10482 // { 10483 // "description": "Deletes all active contexts in the specified session.", 10484 // "flatPath": "v2/projects/{projectsId}/agent/sessions/{sessionsId}/contexts", 10485 // "httpMethod": "DELETE", 10486 // "id": "dialogflow.projects.agent.sessions.deleteContexts", 10487 // "parameterOrder": [ 10488 // "parent" 10489 // ], 10490 // "parameters": { 10491 // "parent": { 10492 // "description": "Required. The name of the session to delete all contexts from. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e`.", 10493 // "location": "path", 10494 // "pattern": "^projects/[^/]+/agent/sessions/[^/]+$", 10495 // "required": true, 10496 // "type": "string" 10497 // } 10498 // }, 10499 // "path": "v2/{+parent}/contexts", 10500 // "response": { 10501 // "$ref": "GoogleProtobufEmpty" 10502 // }, 10503 // "scopes": [ 10504 // "https://www.googleapis.com/auth/cloud-platform", 10505 // "https://www.googleapis.com/auth/dialogflow" 10506 // ] 10507 // } 10508 10509} 10510 10511// method id "dialogflow.projects.agent.sessions.detectIntent": 10512 10513type ProjectsAgentSessionsDetectIntentCall struct { 10514 s *Service 10515 sessionid string 10516 googleclouddialogflowv2detectintentrequest *GoogleCloudDialogflowV2DetectIntentRequest 10517 urlParams_ gensupport.URLParams 10518 ctx_ context.Context 10519 header_ http.Header 10520} 10521 10522// DetectIntent: Processes a natural language query and returns 10523// structured, actionable data 10524// as a result. This method is not idempotent, because it may cause 10525// contexts 10526// and session entity types to be updated, which in turn might 10527// affect 10528// results of future queries. 10529func (r *ProjectsAgentSessionsService) DetectIntent(sessionid string, googleclouddialogflowv2detectintentrequest *GoogleCloudDialogflowV2DetectIntentRequest) *ProjectsAgentSessionsDetectIntentCall { 10530 c := &ProjectsAgentSessionsDetectIntentCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10531 c.sessionid = sessionid 10532 c.googleclouddialogflowv2detectintentrequest = googleclouddialogflowv2detectintentrequest 10533 return c 10534} 10535 10536// Fields allows partial responses to be retrieved. See 10537// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10538// for more information. 10539func (c *ProjectsAgentSessionsDetectIntentCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsDetectIntentCall { 10540 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10541 return c 10542} 10543 10544// Context sets the context to be used in this call's Do method. Any 10545// pending HTTP request will be aborted if the provided context is 10546// canceled. 10547func (c *ProjectsAgentSessionsDetectIntentCall) Context(ctx context.Context) *ProjectsAgentSessionsDetectIntentCall { 10548 c.ctx_ = ctx 10549 return c 10550} 10551 10552// Header returns an http.Header that can be modified by the caller to 10553// add HTTP headers to the request. 10554func (c *ProjectsAgentSessionsDetectIntentCall) Header() http.Header { 10555 if c.header_ == nil { 10556 c.header_ = make(http.Header) 10557 } 10558 return c.header_ 10559} 10560 10561func (c *ProjectsAgentSessionsDetectIntentCall) doRequest(alt string) (*http.Response, error) { 10562 reqHeaders := make(http.Header) 10563 for k, v := range c.header_ { 10564 reqHeaders[k] = v 10565 } 10566 reqHeaders.Set("User-Agent", c.s.userAgent()) 10567 var body io.Reader = nil 10568 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2detectintentrequest) 10569 if err != nil { 10570 return nil, err 10571 } 10572 reqHeaders.Set("Content-Type", "application/json") 10573 c.urlParams_.Set("alt", alt) 10574 c.urlParams_.Set("prettyPrint", "false") 10575 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+session}:detectIntent") 10576 urls += "?" + c.urlParams_.Encode() 10577 req, err := http.NewRequest("POST", urls, body) 10578 if err != nil { 10579 return nil, err 10580 } 10581 req.Header = reqHeaders 10582 googleapi.Expand(req.URL, map[string]string{ 10583 "session": c.sessionid, 10584 }) 10585 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10586} 10587 10588// Do executes the "dialogflow.projects.agent.sessions.detectIntent" call. 10589// Exactly one of *GoogleCloudDialogflowV2DetectIntentResponse or error 10590// will be non-nil. Any non-2xx status code is an error. Response 10591// headers are in either 10592// *GoogleCloudDialogflowV2DetectIntentResponse.ServerResponse.Header or 10593// (if a response was returned at all) in 10594// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 10595// whether the returned error was because http.StatusNotModified was 10596// returned. 10597func (c *ProjectsAgentSessionsDetectIntentCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2DetectIntentResponse, error) { 10598 gensupport.SetOptions(c.urlParams_, opts...) 10599 res, err := c.doRequest("json") 10600 if res != nil && res.StatusCode == http.StatusNotModified { 10601 if res.Body != nil { 10602 res.Body.Close() 10603 } 10604 return nil, &googleapi.Error{ 10605 Code: res.StatusCode, 10606 Header: res.Header, 10607 } 10608 } 10609 if err != nil { 10610 return nil, err 10611 } 10612 defer googleapi.CloseBody(res) 10613 if err := googleapi.CheckResponse(res); err != nil { 10614 return nil, err 10615 } 10616 ret := &GoogleCloudDialogflowV2DetectIntentResponse{ 10617 ServerResponse: googleapi.ServerResponse{ 10618 Header: res.Header, 10619 HTTPStatusCode: res.StatusCode, 10620 }, 10621 } 10622 target := &ret 10623 if err := gensupport.DecodeResponse(target, res); err != nil { 10624 return nil, err 10625 } 10626 return ret, nil 10627 // { 10628 // "description": "Processes a natural language query and returns structured, actionable data\nas a result. This method is not idempotent, because it may cause contexts\nand session entity types to be updated, which in turn might affect\nresults of future queries.", 10629 // "flatPath": "v2/projects/{projectsId}/agent/sessions/{sessionsId}:detectIntent", 10630 // "httpMethod": "POST", 10631 // "id": "dialogflow.projects.agent.sessions.detectIntent", 10632 // "parameterOrder": [ 10633 // "session" 10634 // ], 10635 // "parameters": { 10636 // "session": { 10637 // "description": "Required. The name of the session this query is sent to. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e`. It's up to the API\ncaller to choose an appropriate session ID. It can be a random number or\nsome type of user identifier (preferably hashed). The length of the session\nID must not exceed 36 bytes.", 10638 // "location": "path", 10639 // "pattern": "^projects/[^/]+/agent/sessions/[^/]+$", 10640 // "required": true, 10641 // "type": "string" 10642 // } 10643 // }, 10644 // "path": "v2/{+session}:detectIntent", 10645 // "request": { 10646 // "$ref": "GoogleCloudDialogflowV2DetectIntentRequest" 10647 // }, 10648 // "response": { 10649 // "$ref": "GoogleCloudDialogflowV2DetectIntentResponse" 10650 // }, 10651 // "scopes": [ 10652 // "https://www.googleapis.com/auth/cloud-platform", 10653 // "https://www.googleapis.com/auth/dialogflow" 10654 // ] 10655 // } 10656 10657} 10658 10659// method id "dialogflow.projects.agent.sessions.contexts.create": 10660 10661type ProjectsAgentSessionsContextsCreateCall struct { 10662 s *Service 10663 parent string 10664 googleclouddialogflowv2context *GoogleCloudDialogflowV2Context 10665 urlParams_ gensupport.URLParams 10666 ctx_ context.Context 10667 header_ http.Header 10668} 10669 10670// Create: Creates a context. 10671// 10672// If the specified context already exists, overrides the context. 10673func (r *ProjectsAgentSessionsContextsService) Create(parent string, googleclouddialogflowv2context *GoogleCloudDialogflowV2Context) *ProjectsAgentSessionsContextsCreateCall { 10674 c := &ProjectsAgentSessionsContextsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10675 c.parent = parent 10676 c.googleclouddialogflowv2context = googleclouddialogflowv2context 10677 return c 10678} 10679 10680// Fields allows partial responses to be retrieved. See 10681// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10682// for more information. 10683func (c *ProjectsAgentSessionsContextsCreateCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsContextsCreateCall { 10684 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10685 return c 10686} 10687 10688// Context sets the context to be used in this call's Do method. Any 10689// pending HTTP request will be aborted if the provided context is 10690// canceled. 10691func (c *ProjectsAgentSessionsContextsCreateCall) Context(ctx context.Context) *ProjectsAgentSessionsContextsCreateCall { 10692 c.ctx_ = ctx 10693 return c 10694} 10695 10696// Header returns an http.Header that can be modified by the caller to 10697// add HTTP headers to the request. 10698func (c *ProjectsAgentSessionsContextsCreateCall) Header() http.Header { 10699 if c.header_ == nil { 10700 c.header_ = make(http.Header) 10701 } 10702 return c.header_ 10703} 10704 10705func (c *ProjectsAgentSessionsContextsCreateCall) doRequest(alt string) (*http.Response, error) { 10706 reqHeaders := make(http.Header) 10707 for k, v := range c.header_ { 10708 reqHeaders[k] = v 10709 } 10710 reqHeaders.Set("User-Agent", c.s.userAgent()) 10711 var body io.Reader = nil 10712 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2context) 10713 if err != nil { 10714 return nil, err 10715 } 10716 reqHeaders.Set("Content-Type", "application/json") 10717 c.urlParams_.Set("alt", alt) 10718 c.urlParams_.Set("prettyPrint", "false") 10719 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/contexts") 10720 urls += "?" + c.urlParams_.Encode() 10721 req, err := http.NewRequest("POST", urls, body) 10722 if err != nil { 10723 return nil, err 10724 } 10725 req.Header = reqHeaders 10726 googleapi.Expand(req.URL, map[string]string{ 10727 "parent": c.parent, 10728 }) 10729 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10730} 10731 10732// Do executes the "dialogflow.projects.agent.sessions.contexts.create" call. 10733// Exactly one of *GoogleCloudDialogflowV2Context or error will be 10734// non-nil. Any non-2xx status code is an error. Response headers are in 10735// either *GoogleCloudDialogflowV2Context.ServerResponse.Header or (if a 10736// response was returned at all) in error.(*googleapi.Error).Header. Use 10737// googleapi.IsNotModified to check whether the returned error was 10738// because http.StatusNotModified was returned. 10739func (c *ProjectsAgentSessionsContextsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2Context, error) { 10740 gensupport.SetOptions(c.urlParams_, opts...) 10741 res, err := c.doRequest("json") 10742 if res != nil && res.StatusCode == http.StatusNotModified { 10743 if res.Body != nil { 10744 res.Body.Close() 10745 } 10746 return nil, &googleapi.Error{ 10747 Code: res.StatusCode, 10748 Header: res.Header, 10749 } 10750 } 10751 if err != nil { 10752 return nil, err 10753 } 10754 defer googleapi.CloseBody(res) 10755 if err := googleapi.CheckResponse(res); err != nil { 10756 return nil, err 10757 } 10758 ret := &GoogleCloudDialogflowV2Context{ 10759 ServerResponse: googleapi.ServerResponse{ 10760 Header: res.Header, 10761 HTTPStatusCode: res.StatusCode, 10762 }, 10763 } 10764 target := &ret 10765 if err := gensupport.DecodeResponse(target, res); err != nil { 10766 return nil, err 10767 } 10768 return ret, nil 10769 // { 10770 // "description": "Creates a context.\n\nIf the specified context already exists, overrides the context.", 10771 // "flatPath": "v2/projects/{projectsId}/agent/sessions/{sessionsId}/contexts", 10772 // "httpMethod": "POST", 10773 // "id": "dialogflow.projects.agent.sessions.contexts.create", 10774 // "parameterOrder": [ 10775 // "parent" 10776 // ], 10777 // "parameters": { 10778 // "parent": { 10779 // "description": "Required. The session to create a context for.\nFormat: `projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e`.", 10780 // "location": "path", 10781 // "pattern": "^projects/[^/]+/agent/sessions/[^/]+$", 10782 // "required": true, 10783 // "type": "string" 10784 // } 10785 // }, 10786 // "path": "v2/{+parent}/contexts", 10787 // "request": { 10788 // "$ref": "GoogleCloudDialogflowV2Context" 10789 // }, 10790 // "response": { 10791 // "$ref": "GoogleCloudDialogflowV2Context" 10792 // }, 10793 // "scopes": [ 10794 // "https://www.googleapis.com/auth/cloud-platform", 10795 // "https://www.googleapis.com/auth/dialogflow" 10796 // ] 10797 // } 10798 10799} 10800 10801// method id "dialogflow.projects.agent.sessions.contexts.delete": 10802 10803type ProjectsAgentSessionsContextsDeleteCall struct { 10804 s *Service 10805 name string 10806 urlParams_ gensupport.URLParams 10807 ctx_ context.Context 10808 header_ http.Header 10809} 10810 10811// Delete: Deletes the specified context. 10812func (r *ProjectsAgentSessionsContextsService) Delete(name string) *ProjectsAgentSessionsContextsDeleteCall { 10813 c := &ProjectsAgentSessionsContextsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10814 c.name = name 10815 return c 10816} 10817 10818// Fields allows partial responses to be retrieved. See 10819// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10820// for more information. 10821func (c *ProjectsAgentSessionsContextsDeleteCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsContextsDeleteCall { 10822 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10823 return c 10824} 10825 10826// Context sets the context to be used in this call's Do method. Any 10827// pending HTTP request will be aborted if the provided context is 10828// canceled. 10829func (c *ProjectsAgentSessionsContextsDeleteCall) Context(ctx context.Context) *ProjectsAgentSessionsContextsDeleteCall { 10830 c.ctx_ = ctx 10831 return c 10832} 10833 10834// Header returns an http.Header that can be modified by the caller to 10835// add HTTP headers to the request. 10836func (c *ProjectsAgentSessionsContextsDeleteCall) Header() http.Header { 10837 if c.header_ == nil { 10838 c.header_ = make(http.Header) 10839 } 10840 return c.header_ 10841} 10842 10843func (c *ProjectsAgentSessionsContextsDeleteCall) doRequest(alt string) (*http.Response, error) { 10844 reqHeaders := make(http.Header) 10845 for k, v := range c.header_ { 10846 reqHeaders[k] = v 10847 } 10848 reqHeaders.Set("User-Agent", c.s.userAgent()) 10849 var body io.Reader = nil 10850 c.urlParams_.Set("alt", alt) 10851 c.urlParams_.Set("prettyPrint", "false") 10852 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") 10853 urls += "?" + c.urlParams_.Encode() 10854 req, err := http.NewRequest("DELETE", urls, body) 10855 if err != nil { 10856 return nil, err 10857 } 10858 req.Header = reqHeaders 10859 googleapi.Expand(req.URL, map[string]string{ 10860 "name": c.name, 10861 }) 10862 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10863} 10864 10865// Do executes the "dialogflow.projects.agent.sessions.contexts.delete" call. 10866// Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any 10867// non-2xx status code is an error. Response headers are in either 10868// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was 10869// returned at all) in error.(*googleapi.Error).Header. Use 10870// googleapi.IsNotModified to check whether the returned error was 10871// because http.StatusNotModified was returned. 10872func (c *ProjectsAgentSessionsContextsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { 10873 gensupport.SetOptions(c.urlParams_, opts...) 10874 res, err := c.doRequest("json") 10875 if res != nil && res.StatusCode == http.StatusNotModified { 10876 if res.Body != nil { 10877 res.Body.Close() 10878 } 10879 return nil, &googleapi.Error{ 10880 Code: res.StatusCode, 10881 Header: res.Header, 10882 } 10883 } 10884 if err != nil { 10885 return nil, err 10886 } 10887 defer googleapi.CloseBody(res) 10888 if err := googleapi.CheckResponse(res); err != nil { 10889 return nil, err 10890 } 10891 ret := &GoogleProtobufEmpty{ 10892 ServerResponse: googleapi.ServerResponse{ 10893 Header: res.Header, 10894 HTTPStatusCode: res.StatusCode, 10895 }, 10896 } 10897 target := &ret 10898 if err := gensupport.DecodeResponse(target, res); err != nil { 10899 return nil, err 10900 } 10901 return ret, nil 10902 // { 10903 // "description": "Deletes the specified context.", 10904 // "flatPath": "v2/projects/{projectsId}/agent/sessions/{sessionsId}/contexts/{contextsId}", 10905 // "httpMethod": "DELETE", 10906 // "id": "dialogflow.projects.agent.sessions.contexts.delete", 10907 // "parameterOrder": [ 10908 // "name" 10909 // ], 10910 // "parameters": { 10911 // "name": { 10912 // "description": "Required. The name of the context to delete. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e/contexts/\u003cContext ID\u003e`.", 10913 // "location": "path", 10914 // "pattern": "^projects/[^/]+/agent/sessions/[^/]+/contexts/[^/]+$", 10915 // "required": true, 10916 // "type": "string" 10917 // } 10918 // }, 10919 // "path": "v2/{+name}", 10920 // "response": { 10921 // "$ref": "GoogleProtobufEmpty" 10922 // }, 10923 // "scopes": [ 10924 // "https://www.googleapis.com/auth/cloud-platform", 10925 // "https://www.googleapis.com/auth/dialogflow" 10926 // ] 10927 // } 10928 10929} 10930 10931// method id "dialogflow.projects.agent.sessions.contexts.get": 10932 10933type ProjectsAgentSessionsContextsGetCall struct { 10934 s *Service 10935 name string 10936 urlParams_ gensupport.URLParams 10937 ifNoneMatch_ string 10938 ctx_ context.Context 10939 header_ http.Header 10940} 10941 10942// Get: Retrieves the specified context. 10943func (r *ProjectsAgentSessionsContextsService) Get(name string) *ProjectsAgentSessionsContextsGetCall { 10944 c := &ProjectsAgentSessionsContextsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10945 c.name = name 10946 return c 10947} 10948 10949// Fields allows partial responses to be retrieved. See 10950// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10951// for more information. 10952func (c *ProjectsAgentSessionsContextsGetCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsContextsGetCall { 10953 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10954 return c 10955} 10956 10957// IfNoneMatch sets the optional parameter which makes the operation 10958// fail if the object's ETag matches the given value. This is useful for 10959// getting updates only after the object has changed since the last 10960// request. Use googleapi.IsNotModified to check whether the response 10961// error from Do is the result of In-None-Match. 10962func (c *ProjectsAgentSessionsContextsGetCall) IfNoneMatch(entityTag string) *ProjectsAgentSessionsContextsGetCall { 10963 c.ifNoneMatch_ = entityTag 10964 return c 10965} 10966 10967// Context sets the context to be used in this call's Do method. Any 10968// pending HTTP request will be aborted if the provided context is 10969// canceled. 10970func (c *ProjectsAgentSessionsContextsGetCall) Context(ctx context.Context) *ProjectsAgentSessionsContextsGetCall { 10971 c.ctx_ = ctx 10972 return c 10973} 10974 10975// Header returns an http.Header that can be modified by the caller to 10976// add HTTP headers to the request. 10977func (c *ProjectsAgentSessionsContextsGetCall) Header() http.Header { 10978 if c.header_ == nil { 10979 c.header_ = make(http.Header) 10980 } 10981 return c.header_ 10982} 10983 10984func (c *ProjectsAgentSessionsContextsGetCall) doRequest(alt string) (*http.Response, error) { 10985 reqHeaders := make(http.Header) 10986 for k, v := range c.header_ { 10987 reqHeaders[k] = v 10988 } 10989 reqHeaders.Set("User-Agent", c.s.userAgent()) 10990 if c.ifNoneMatch_ != "" { 10991 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10992 } 10993 var body io.Reader = nil 10994 c.urlParams_.Set("alt", alt) 10995 c.urlParams_.Set("prettyPrint", "false") 10996 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") 10997 urls += "?" + c.urlParams_.Encode() 10998 req, err := http.NewRequest("GET", urls, body) 10999 if err != nil { 11000 return nil, err 11001 } 11002 req.Header = reqHeaders 11003 googleapi.Expand(req.URL, map[string]string{ 11004 "name": c.name, 11005 }) 11006 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11007} 11008 11009// Do executes the "dialogflow.projects.agent.sessions.contexts.get" call. 11010// Exactly one of *GoogleCloudDialogflowV2Context or error will be 11011// non-nil. Any non-2xx status code is an error. Response headers are in 11012// either *GoogleCloudDialogflowV2Context.ServerResponse.Header or (if a 11013// response was returned at all) in error.(*googleapi.Error).Header. Use 11014// googleapi.IsNotModified to check whether the returned error was 11015// because http.StatusNotModified was returned. 11016func (c *ProjectsAgentSessionsContextsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2Context, error) { 11017 gensupport.SetOptions(c.urlParams_, opts...) 11018 res, err := c.doRequest("json") 11019 if res != nil && res.StatusCode == http.StatusNotModified { 11020 if res.Body != nil { 11021 res.Body.Close() 11022 } 11023 return nil, &googleapi.Error{ 11024 Code: res.StatusCode, 11025 Header: res.Header, 11026 } 11027 } 11028 if err != nil { 11029 return nil, err 11030 } 11031 defer googleapi.CloseBody(res) 11032 if err := googleapi.CheckResponse(res); err != nil { 11033 return nil, err 11034 } 11035 ret := &GoogleCloudDialogflowV2Context{ 11036 ServerResponse: googleapi.ServerResponse{ 11037 Header: res.Header, 11038 HTTPStatusCode: res.StatusCode, 11039 }, 11040 } 11041 target := &ret 11042 if err := gensupport.DecodeResponse(target, res); err != nil { 11043 return nil, err 11044 } 11045 return ret, nil 11046 // { 11047 // "description": "Retrieves the specified context.", 11048 // "flatPath": "v2/projects/{projectsId}/agent/sessions/{sessionsId}/contexts/{contextsId}", 11049 // "httpMethod": "GET", 11050 // "id": "dialogflow.projects.agent.sessions.contexts.get", 11051 // "parameterOrder": [ 11052 // "name" 11053 // ], 11054 // "parameters": { 11055 // "name": { 11056 // "description": "Required. The name of the context. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e/contexts/\u003cContext ID\u003e`.", 11057 // "location": "path", 11058 // "pattern": "^projects/[^/]+/agent/sessions/[^/]+/contexts/[^/]+$", 11059 // "required": true, 11060 // "type": "string" 11061 // } 11062 // }, 11063 // "path": "v2/{+name}", 11064 // "response": { 11065 // "$ref": "GoogleCloudDialogflowV2Context" 11066 // }, 11067 // "scopes": [ 11068 // "https://www.googleapis.com/auth/cloud-platform", 11069 // "https://www.googleapis.com/auth/dialogflow" 11070 // ] 11071 // } 11072 11073} 11074 11075// method id "dialogflow.projects.agent.sessions.contexts.list": 11076 11077type ProjectsAgentSessionsContextsListCall struct { 11078 s *Service 11079 parent string 11080 urlParams_ gensupport.URLParams 11081 ifNoneMatch_ string 11082 ctx_ context.Context 11083 header_ http.Header 11084} 11085 11086// List: Returns the list of all contexts in the specified session. 11087func (r *ProjectsAgentSessionsContextsService) List(parent string) *ProjectsAgentSessionsContextsListCall { 11088 c := &ProjectsAgentSessionsContextsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11089 c.parent = parent 11090 return c 11091} 11092 11093// PageSize sets the optional parameter "pageSize": The maximum number 11094// of items to return in a single page. By 11095// default 100 and at most 1000. 11096func (c *ProjectsAgentSessionsContextsListCall) PageSize(pageSize int64) *ProjectsAgentSessionsContextsListCall { 11097 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 11098 return c 11099} 11100 11101// PageToken sets the optional parameter "pageToken": The 11102// next_page_token value returned from a previous list request. 11103func (c *ProjectsAgentSessionsContextsListCall) PageToken(pageToken string) *ProjectsAgentSessionsContextsListCall { 11104 c.urlParams_.Set("pageToken", pageToken) 11105 return c 11106} 11107 11108// Fields allows partial responses to be retrieved. See 11109// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11110// for more information. 11111func (c *ProjectsAgentSessionsContextsListCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsContextsListCall { 11112 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11113 return c 11114} 11115 11116// IfNoneMatch sets the optional parameter which makes the operation 11117// fail if the object's ETag matches the given value. This is useful for 11118// getting updates only after the object has changed since the last 11119// request. Use googleapi.IsNotModified to check whether the response 11120// error from Do is the result of In-None-Match. 11121func (c *ProjectsAgentSessionsContextsListCall) IfNoneMatch(entityTag string) *ProjectsAgentSessionsContextsListCall { 11122 c.ifNoneMatch_ = entityTag 11123 return c 11124} 11125 11126// Context sets the context to be used in this call's Do method. Any 11127// pending HTTP request will be aborted if the provided context is 11128// canceled. 11129func (c *ProjectsAgentSessionsContextsListCall) Context(ctx context.Context) *ProjectsAgentSessionsContextsListCall { 11130 c.ctx_ = ctx 11131 return c 11132} 11133 11134// Header returns an http.Header that can be modified by the caller to 11135// add HTTP headers to the request. 11136func (c *ProjectsAgentSessionsContextsListCall) Header() http.Header { 11137 if c.header_ == nil { 11138 c.header_ = make(http.Header) 11139 } 11140 return c.header_ 11141} 11142 11143func (c *ProjectsAgentSessionsContextsListCall) doRequest(alt string) (*http.Response, error) { 11144 reqHeaders := make(http.Header) 11145 for k, v := range c.header_ { 11146 reqHeaders[k] = v 11147 } 11148 reqHeaders.Set("User-Agent", c.s.userAgent()) 11149 if c.ifNoneMatch_ != "" { 11150 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11151 } 11152 var body io.Reader = nil 11153 c.urlParams_.Set("alt", alt) 11154 c.urlParams_.Set("prettyPrint", "false") 11155 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/contexts") 11156 urls += "?" + c.urlParams_.Encode() 11157 req, err := http.NewRequest("GET", urls, body) 11158 if err != nil { 11159 return nil, err 11160 } 11161 req.Header = reqHeaders 11162 googleapi.Expand(req.URL, map[string]string{ 11163 "parent": c.parent, 11164 }) 11165 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11166} 11167 11168// Do executes the "dialogflow.projects.agent.sessions.contexts.list" call. 11169// Exactly one of *GoogleCloudDialogflowV2ListContextsResponse or error 11170// will be non-nil. Any non-2xx status code is an error. Response 11171// headers are in either 11172// *GoogleCloudDialogflowV2ListContextsResponse.ServerResponse.Header or 11173// (if a response was returned at all) in 11174// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 11175// whether the returned error was because http.StatusNotModified was 11176// returned. 11177func (c *ProjectsAgentSessionsContextsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2ListContextsResponse, error) { 11178 gensupport.SetOptions(c.urlParams_, opts...) 11179 res, err := c.doRequest("json") 11180 if res != nil && res.StatusCode == http.StatusNotModified { 11181 if res.Body != nil { 11182 res.Body.Close() 11183 } 11184 return nil, &googleapi.Error{ 11185 Code: res.StatusCode, 11186 Header: res.Header, 11187 } 11188 } 11189 if err != nil { 11190 return nil, err 11191 } 11192 defer googleapi.CloseBody(res) 11193 if err := googleapi.CheckResponse(res); err != nil { 11194 return nil, err 11195 } 11196 ret := &GoogleCloudDialogflowV2ListContextsResponse{ 11197 ServerResponse: googleapi.ServerResponse{ 11198 Header: res.Header, 11199 HTTPStatusCode: res.StatusCode, 11200 }, 11201 } 11202 target := &ret 11203 if err := gensupport.DecodeResponse(target, res); err != nil { 11204 return nil, err 11205 } 11206 return ret, nil 11207 // { 11208 // "description": "Returns the list of all contexts in the specified session.", 11209 // "flatPath": "v2/projects/{projectsId}/agent/sessions/{sessionsId}/contexts", 11210 // "httpMethod": "GET", 11211 // "id": "dialogflow.projects.agent.sessions.contexts.list", 11212 // "parameterOrder": [ 11213 // "parent" 11214 // ], 11215 // "parameters": { 11216 // "pageSize": { 11217 // "description": "Optional. The maximum number of items to return in a single page. By\ndefault 100 and at most 1000.", 11218 // "format": "int32", 11219 // "location": "query", 11220 // "type": "integer" 11221 // }, 11222 // "pageToken": { 11223 // "description": "Optional. The next_page_token value returned from a previous list request.", 11224 // "location": "query", 11225 // "type": "string" 11226 // }, 11227 // "parent": { 11228 // "description": "Required. The session to list all contexts from.\nFormat: `projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e`.", 11229 // "location": "path", 11230 // "pattern": "^projects/[^/]+/agent/sessions/[^/]+$", 11231 // "required": true, 11232 // "type": "string" 11233 // } 11234 // }, 11235 // "path": "v2/{+parent}/contexts", 11236 // "response": { 11237 // "$ref": "GoogleCloudDialogflowV2ListContextsResponse" 11238 // }, 11239 // "scopes": [ 11240 // "https://www.googleapis.com/auth/cloud-platform", 11241 // "https://www.googleapis.com/auth/dialogflow" 11242 // ] 11243 // } 11244 11245} 11246 11247// Pages invokes f for each page of results. 11248// A non-nil error returned from f will halt the iteration. 11249// The provided context supersedes any context provided to the Context method. 11250func (c *ProjectsAgentSessionsContextsListCall) Pages(ctx context.Context, f func(*GoogleCloudDialogflowV2ListContextsResponse) error) error { 11251 c.ctx_ = ctx 11252 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 11253 for { 11254 x, err := c.Do() 11255 if err != nil { 11256 return err 11257 } 11258 if err := f(x); err != nil { 11259 return err 11260 } 11261 if x.NextPageToken == "" { 11262 return nil 11263 } 11264 c.PageToken(x.NextPageToken) 11265 } 11266} 11267 11268// method id "dialogflow.projects.agent.sessions.contexts.patch": 11269 11270type ProjectsAgentSessionsContextsPatchCall struct { 11271 s *Service 11272 nameid string 11273 googleclouddialogflowv2context *GoogleCloudDialogflowV2Context 11274 urlParams_ gensupport.URLParams 11275 ctx_ context.Context 11276 header_ http.Header 11277} 11278 11279// Patch: Updates the specified context. 11280func (r *ProjectsAgentSessionsContextsService) Patch(nameid string, googleclouddialogflowv2context *GoogleCloudDialogflowV2Context) *ProjectsAgentSessionsContextsPatchCall { 11281 c := &ProjectsAgentSessionsContextsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11282 c.nameid = nameid 11283 c.googleclouddialogflowv2context = googleclouddialogflowv2context 11284 return c 11285} 11286 11287// UpdateMask sets the optional parameter "updateMask": The mask to 11288// control which fields get updated. 11289func (c *ProjectsAgentSessionsContextsPatchCall) UpdateMask(updateMask string) *ProjectsAgentSessionsContextsPatchCall { 11290 c.urlParams_.Set("updateMask", updateMask) 11291 return c 11292} 11293 11294// Fields allows partial responses to be retrieved. See 11295// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11296// for more information. 11297func (c *ProjectsAgentSessionsContextsPatchCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsContextsPatchCall { 11298 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11299 return c 11300} 11301 11302// Context sets the context to be used in this call's Do method. Any 11303// pending HTTP request will be aborted if the provided context is 11304// canceled. 11305func (c *ProjectsAgentSessionsContextsPatchCall) Context(ctx context.Context) *ProjectsAgentSessionsContextsPatchCall { 11306 c.ctx_ = ctx 11307 return c 11308} 11309 11310// Header returns an http.Header that can be modified by the caller to 11311// add HTTP headers to the request. 11312func (c *ProjectsAgentSessionsContextsPatchCall) Header() http.Header { 11313 if c.header_ == nil { 11314 c.header_ = make(http.Header) 11315 } 11316 return c.header_ 11317} 11318 11319func (c *ProjectsAgentSessionsContextsPatchCall) doRequest(alt string) (*http.Response, error) { 11320 reqHeaders := make(http.Header) 11321 for k, v := range c.header_ { 11322 reqHeaders[k] = v 11323 } 11324 reqHeaders.Set("User-Agent", c.s.userAgent()) 11325 var body io.Reader = nil 11326 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2context) 11327 if err != nil { 11328 return nil, err 11329 } 11330 reqHeaders.Set("Content-Type", "application/json") 11331 c.urlParams_.Set("alt", alt) 11332 c.urlParams_.Set("prettyPrint", "false") 11333 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") 11334 urls += "?" + c.urlParams_.Encode() 11335 req, err := http.NewRequest("PATCH", urls, body) 11336 if err != nil { 11337 return nil, err 11338 } 11339 req.Header = reqHeaders 11340 googleapi.Expand(req.URL, map[string]string{ 11341 "name": c.nameid, 11342 }) 11343 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11344} 11345 11346// Do executes the "dialogflow.projects.agent.sessions.contexts.patch" call. 11347// Exactly one of *GoogleCloudDialogflowV2Context or error will be 11348// non-nil. Any non-2xx status code is an error. Response headers are in 11349// either *GoogleCloudDialogflowV2Context.ServerResponse.Header or (if a 11350// response was returned at all) in error.(*googleapi.Error).Header. Use 11351// googleapi.IsNotModified to check whether the returned error was 11352// because http.StatusNotModified was returned. 11353func (c *ProjectsAgentSessionsContextsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2Context, error) { 11354 gensupport.SetOptions(c.urlParams_, opts...) 11355 res, err := c.doRequest("json") 11356 if res != nil && res.StatusCode == http.StatusNotModified { 11357 if res.Body != nil { 11358 res.Body.Close() 11359 } 11360 return nil, &googleapi.Error{ 11361 Code: res.StatusCode, 11362 Header: res.Header, 11363 } 11364 } 11365 if err != nil { 11366 return nil, err 11367 } 11368 defer googleapi.CloseBody(res) 11369 if err := googleapi.CheckResponse(res); err != nil { 11370 return nil, err 11371 } 11372 ret := &GoogleCloudDialogflowV2Context{ 11373 ServerResponse: googleapi.ServerResponse{ 11374 Header: res.Header, 11375 HTTPStatusCode: res.StatusCode, 11376 }, 11377 } 11378 target := &ret 11379 if err := gensupport.DecodeResponse(target, res); err != nil { 11380 return nil, err 11381 } 11382 return ret, nil 11383 // { 11384 // "description": "Updates the specified context.", 11385 // "flatPath": "v2/projects/{projectsId}/agent/sessions/{sessionsId}/contexts/{contextsId}", 11386 // "httpMethod": "PATCH", 11387 // "id": "dialogflow.projects.agent.sessions.contexts.patch", 11388 // "parameterOrder": [ 11389 // "name" 11390 // ], 11391 // "parameters": { 11392 // "name": { 11393 // "description": "Required. The unique identifier of the context. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e/contexts/\u003cContext ID\u003e`.\n\nThe `Context ID` is always converted to lowercase, may only contain\ncharacters in [a-zA-Z0-9_-%] and may be at most 250 bytes long.", 11394 // "location": "path", 11395 // "pattern": "^projects/[^/]+/agent/sessions/[^/]+/contexts/[^/]+$", 11396 // "required": true, 11397 // "type": "string" 11398 // }, 11399 // "updateMask": { 11400 // "description": "Optional. The mask to control which fields get updated.", 11401 // "format": "google-fieldmask", 11402 // "location": "query", 11403 // "type": "string" 11404 // } 11405 // }, 11406 // "path": "v2/{+name}", 11407 // "request": { 11408 // "$ref": "GoogleCloudDialogflowV2Context" 11409 // }, 11410 // "response": { 11411 // "$ref": "GoogleCloudDialogflowV2Context" 11412 // }, 11413 // "scopes": [ 11414 // "https://www.googleapis.com/auth/cloud-platform", 11415 // "https://www.googleapis.com/auth/dialogflow" 11416 // ] 11417 // } 11418 11419} 11420 11421// method id "dialogflow.projects.agent.sessions.entityTypes.create": 11422 11423type ProjectsAgentSessionsEntityTypesCreateCall struct { 11424 s *Service 11425 parent string 11426 googleclouddialogflowv2sessionentitytype *GoogleCloudDialogflowV2SessionEntityType 11427 urlParams_ gensupport.URLParams 11428 ctx_ context.Context 11429 header_ http.Header 11430} 11431 11432// Create: Creates a session entity type. 11433// 11434// If the specified session entity type already exists, overrides the 11435// session 11436// entity type. 11437func (r *ProjectsAgentSessionsEntityTypesService) Create(parent string, googleclouddialogflowv2sessionentitytype *GoogleCloudDialogflowV2SessionEntityType) *ProjectsAgentSessionsEntityTypesCreateCall { 11438 c := &ProjectsAgentSessionsEntityTypesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11439 c.parent = parent 11440 c.googleclouddialogflowv2sessionentitytype = googleclouddialogflowv2sessionentitytype 11441 return c 11442} 11443 11444// Fields allows partial responses to be retrieved. See 11445// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11446// for more information. 11447func (c *ProjectsAgentSessionsEntityTypesCreateCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsEntityTypesCreateCall { 11448 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11449 return c 11450} 11451 11452// Context sets the context to be used in this call's Do method. Any 11453// pending HTTP request will be aborted if the provided context is 11454// canceled. 11455func (c *ProjectsAgentSessionsEntityTypesCreateCall) Context(ctx context.Context) *ProjectsAgentSessionsEntityTypesCreateCall { 11456 c.ctx_ = ctx 11457 return c 11458} 11459 11460// Header returns an http.Header that can be modified by the caller to 11461// add HTTP headers to the request. 11462func (c *ProjectsAgentSessionsEntityTypesCreateCall) Header() http.Header { 11463 if c.header_ == nil { 11464 c.header_ = make(http.Header) 11465 } 11466 return c.header_ 11467} 11468 11469func (c *ProjectsAgentSessionsEntityTypesCreateCall) doRequest(alt string) (*http.Response, error) { 11470 reqHeaders := make(http.Header) 11471 for k, v := range c.header_ { 11472 reqHeaders[k] = v 11473 } 11474 reqHeaders.Set("User-Agent", c.s.userAgent()) 11475 var body io.Reader = nil 11476 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2sessionentitytype) 11477 if err != nil { 11478 return nil, err 11479 } 11480 reqHeaders.Set("Content-Type", "application/json") 11481 c.urlParams_.Set("alt", alt) 11482 c.urlParams_.Set("prettyPrint", "false") 11483 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/entityTypes") 11484 urls += "?" + c.urlParams_.Encode() 11485 req, err := http.NewRequest("POST", urls, body) 11486 if err != nil { 11487 return nil, err 11488 } 11489 req.Header = reqHeaders 11490 googleapi.Expand(req.URL, map[string]string{ 11491 "parent": c.parent, 11492 }) 11493 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11494} 11495 11496// Do executes the "dialogflow.projects.agent.sessions.entityTypes.create" call. 11497// Exactly one of *GoogleCloudDialogflowV2SessionEntityType or error 11498// will be non-nil. Any non-2xx status code is an error. Response 11499// headers are in either 11500// *GoogleCloudDialogflowV2SessionEntityType.ServerResponse.Header or 11501// (if a response was returned at all) in 11502// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 11503// whether the returned error was because http.StatusNotModified was 11504// returned. 11505func (c *ProjectsAgentSessionsEntityTypesCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2SessionEntityType, error) { 11506 gensupport.SetOptions(c.urlParams_, opts...) 11507 res, err := c.doRequest("json") 11508 if res != nil && res.StatusCode == http.StatusNotModified { 11509 if res.Body != nil { 11510 res.Body.Close() 11511 } 11512 return nil, &googleapi.Error{ 11513 Code: res.StatusCode, 11514 Header: res.Header, 11515 } 11516 } 11517 if err != nil { 11518 return nil, err 11519 } 11520 defer googleapi.CloseBody(res) 11521 if err := googleapi.CheckResponse(res); err != nil { 11522 return nil, err 11523 } 11524 ret := &GoogleCloudDialogflowV2SessionEntityType{ 11525 ServerResponse: googleapi.ServerResponse{ 11526 Header: res.Header, 11527 HTTPStatusCode: res.StatusCode, 11528 }, 11529 } 11530 target := &ret 11531 if err := gensupport.DecodeResponse(target, res); err != nil { 11532 return nil, err 11533 } 11534 return ret, nil 11535 // { 11536 // "description": "Creates a session entity type.\n\nIf the specified session entity type already exists, overrides the session\nentity type.", 11537 // "flatPath": "v2/projects/{projectsId}/agent/sessions/{sessionsId}/entityTypes", 11538 // "httpMethod": "POST", 11539 // "id": "dialogflow.projects.agent.sessions.entityTypes.create", 11540 // "parameterOrder": [ 11541 // "parent" 11542 // ], 11543 // "parameters": { 11544 // "parent": { 11545 // "description": "Required. The session to create a session entity type for.\nFormat: `projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e`.", 11546 // "location": "path", 11547 // "pattern": "^projects/[^/]+/agent/sessions/[^/]+$", 11548 // "required": true, 11549 // "type": "string" 11550 // } 11551 // }, 11552 // "path": "v2/{+parent}/entityTypes", 11553 // "request": { 11554 // "$ref": "GoogleCloudDialogflowV2SessionEntityType" 11555 // }, 11556 // "response": { 11557 // "$ref": "GoogleCloudDialogflowV2SessionEntityType" 11558 // }, 11559 // "scopes": [ 11560 // "https://www.googleapis.com/auth/cloud-platform", 11561 // "https://www.googleapis.com/auth/dialogflow" 11562 // ] 11563 // } 11564 11565} 11566 11567// method id "dialogflow.projects.agent.sessions.entityTypes.delete": 11568 11569type ProjectsAgentSessionsEntityTypesDeleteCall struct { 11570 s *Service 11571 name string 11572 urlParams_ gensupport.URLParams 11573 ctx_ context.Context 11574 header_ http.Header 11575} 11576 11577// Delete: Deletes the specified session entity type. 11578func (r *ProjectsAgentSessionsEntityTypesService) Delete(name string) *ProjectsAgentSessionsEntityTypesDeleteCall { 11579 c := &ProjectsAgentSessionsEntityTypesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11580 c.name = name 11581 return c 11582} 11583 11584// Fields allows partial responses to be retrieved. See 11585// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11586// for more information. 11587func (c *ProjectsAgentSessionsEntityTypesDeleteCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsEntityTypesDeleteCall { 11588 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11589 return c 11590} 11591 11592// Context sets the context to be used in this call's Do method. Any 11593// pending HTTP request will be aborted if the provided context is 11594// canceled. 11595func (c *ProjectsAgentSessionsEntityTypesDeleteCall) Context(ctx context.Context) *ProjectsAgentSessionsEntityTypesDeleteCall { 11596 c.ctx_ = ctx 11597 return c 11598} 11599 11600// Header returns an http.Header that can be modified by the caller to 11601// add HTTP headers to the request. 11602func (c *ProjectsAgentSessionsEntityTypesDeleteCall) Header() http.Header { 11603 if c.header_ == nil { 11604 c.header_ = make(http.Header) 11605 } 11606 return c.header_ 11607} 11608 11609func (c *ProjectsAgentSessionsEntityTypesDeleteCall) doRequest(alt string) (*http.Response, error) { 11610 reqHeaders := make(http.Header) 11611 for k, v := range c.header_ { 11612 reqHeaders[k] = v 11613 } 11614 reqHeaders.Set("User-Agent", c.s.userAgent()) 11615 var body io.Reader = nil 11616 c.urlParams_.Set("alt", alt) 11617 c.urlParams_.Set("prettyPrint", "false") 11618 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") 11619 urls += "?" + c.urlParams_.Encode() 11620 req, err := http.NewRequest("DELETE", urls, body) 11621 if err != nil { 11622 return nil, err 11623 } 11624 req.Header = reqHeaders 11625 googleapi.Expand(req.URL, map[string]string{ 11626 "name": c.name, 11627 }) 11628 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11629} 11630 11631// Do executes the "dialogflow.projects.agent.sessions.entityTypes.delete" call. 11632// Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any 11633// non-2xx status code is an error. Response headers are in either 11634// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was 11635// returned at all) in error.(*googleapi.Error).Header. Use 11636// googleapi.IsNotModified to check whether the returned error was 11637// because http.StatusNotModified was returned. 11638func (c *ProjectsAgentSessionsEntityTypesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { 11639 gensupport.SetOptions(c.urlParams_, opts...) 11640 res, err := c.doRequest("json") 11641 if res != nil && res.StatusCode == http.StatusNotModified { 11642 if res.Body != nil { 11643 res.Body.Close() 11644 } 11645 return nil, &googleapi.Error{ 11646 Code: res.StatusCode, 11647 Header: res.Header, 11648 } 11649 } 11650 if err != nil { 11651 return nil, err 11652 } 11653 defer googleapi.CloseBody(res) 11654 if err := googleapi.CheckResponse(res); err != nil { 11655 return nil, err 11656 } 11657 ret := &GoogleProtobufEmpty{ 11658 ServerResponse: googleapi.ServerResponse{ 11659 Header: res.Header, 11660 HTTPStatusCode: res.StatusCode, 11661 }, 11662 } 11663 target := &ret 11664 if err := gensupport.DecodeResponse(target, res); err != nil { 11665 return nil, err 11666 } 11667 return ret, nil 11668 // { 11669 // "description": "Deletes the specified session entity type.", 11670 // "flatPath": "v2/projects/{projectsId}/agent/sessions/{sessionsId}/entityTypes/{entityTypesId}", 11671 // "httpMethod": "DELETE", 11672 // "id": "dialogflow.projects.agent.sessions.entityTypes.delete", 11673 // "parameterOrder": [ 11674 // "name" 11675 // ], 11676 // "parameters": { 11677 // "name": { 11678 // "description": "Required. The name of the entity type to delete. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e/entityTypes/\u003cEntity Type\nDisplay Name\u003e`.", 11679 // "location": "path", 11680 // "pattern": "^projects/[^/]+/agent/sessions/[^/]+/entityTypes/[^/]+$", 11681 // "required": true, 11682 // "type": "string" 11683 // } 11684 // }, 11685 // "path": "v2/{+name}", 11686 // "response": { 11687 // "$ref": "GoogleProtobufEmpty" 11688 // }, 11689 // "scopes": [ 11690 // "https://www.googleapis.com/auth/cloud-platform", 11691 // "https://www.googleapis.com/auth/dialogflow" 11692 // ] 11693 // } 11694 11695} 11696 11697// method id "dialogflow.projects.agent.sessions.entityTypes.get": 11698 11699type ProjectsAgentSessionsEntityTypesGetCall struct { 11700 s *Service 11701 name string 11702 urlParams_ gensupport.URLParams 11703 ifNoneMatch_ string 11704 ctx_ context.Context 11705 header_ http.Header 11706} 11707 11708// Get: Retrieves the specified session entity type. 11709func (r *ProjectsAgentSessionsEntityTypesService) Get(name string) *ProjectsAgentSessionsEntityTypesGetCall { 11710 c := &ProjectsAgentSessionsEntityTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11711 c.name = name 11712 return c 11713} 11714 11715// Fields allows partial responses to be retrieved. See 11716// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11717// for more information. 11718func (c *ProjectsAgentSessionsEntityTypesGetCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsEntityTypesGetCall { 11719 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11720 return c 11721} 11722 11723// IfNoneMatch sets the optional parameter which makes the operation 11724// fail if the object's ETag matches the given value. This is useful for 11725// getting updates only after the object has changed since the last 11726// request. Use googleapi.IsNotModified to check whether the response 11727// error from Do is the result of In-None-Match. 11728func (c *ProjectsAgentSessionsEntityTypesGetCall) IfNoneMatch(entityTag string) *ProjectsAgentSessionsEntityTypesGetCall { 11729 c.ifNoneMatch_ = entityTag 11730 return c 11731} 11732 11733// Context sets the context to be used in this call's Do method. Any 11734// pending HTTP request will be aborted if the provided context is 11735// canceled. 11736func (c *ProjectsAgentSessionsEntityTypesGetCall) Context(ctx context.Context) *ProjectsAgentSessionsEntityTypesGetCall { 11737 c.ctx_ = ctx 11738 return c 11739} 11740 11741// Header returns an http.Header that can be modified by the caller to 11742// add HTTP headers to the request. 11743func (c *ProjectsAgentSessionsEntityTypesGetCall) Header() http.Header { 11744 if c.header_ == nil { 11745 c.header_ = make(http.Header) 11746 } 11747 return c.header_ 11748} 11749 11750func (c *ProjectsAgentSessionsEntityTypesGetCall) doRequest(alt string) (*http.Response, error) { 11751 reqHeaders := make(http.Header) 11752 for k, v := range c.header_ { 11753 reqHeaders[k] = v 11754 } 11755 reqHeaders.Set("User-Agent", c.s.userAgent()) 11756 if c.ifNoneMatch_ != "" { 11757 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11758 } 11759 var body io.Reader = nil 11760 c.urlParams_.Set("alt", alt) 11761 c.urlParams_.Set("prettyPrint", "false") 11762 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") 11763 urls += "?" + c.urlParams_.Encode() 11764 req, err := http.NewRequest("GET", urls, body) 11765 if err != nil { 11766 return nil, err 11767 } 11768 req.Header = reqHeaders 11769 googleapi.Expand(req.URL, map[string]string{ 11770 "name": c.name, 11771 }) 11772 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11773} 11774 11775// Do executes the "dialogflow.projects.agent.sessions.entityTypes.get" call. 11776// Exactly one of *GoogleCloudDialogflowV2SessionEntityType or error 11777// will be non-nil. Any non-2xx status code is an error. Response 11778// headers are in either 11779// *GoogleCloudDialogflowV2SessionEntityType.ServerResponse.Header or 11780// (if a response was returned at all) in 11781// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 11782// whether the returned error was because http.StatusNotModified was 11783// returned. 11784func (c *ProjectsAgentSessionsEntityTypesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2SessionEntityType, error) { 11785 gensupport.SetOptions(c.urlParams_, opts...) 11786 res, err := c.doRequest("json") 11787 if res != nil && res.StatusCode == http.StatusNotModified { 11788 if res.Body != nil { 11789 res.Body.Close() 11790 } 11791 return nil, &googleapi.Error{ 11792 Code: res.StatusCode, 11793 Header: res.Header, 11794 } 11795 } 11796 if err != nil { 11797 return nil, err 11798 } 11799 defer googleapi.CloseBody(res) 11800 if err := googleapi.CheckResponse(res); err != nil { 11801 return nil, err 11802 } 11803 ret := &GoogleCloudDialogflowV2SessionEntityType{ 11804 ServerResponse: googleapi.ServerResponse{ 11805 Header: res.Header, 11806 HTTPStatusCode: res.StatusCode, 11807 }, 11808 } 11809 target := &ret 11810 if err := gensupport.DecodeResponse(target, res); err != nil { 11811 return nil, err 11812 } 11813 return ret, nil 11814 // { 11815 // "description": "Retrieves the specified session entity type.", 11816 // "flatPath": "v2/projects/{projectsId}/agent/sessions/{sessionsId}/entityTypes/{entityTypesId}", 11817 // "httpMethod": "GET", 11818 // "id": "dialogflow.projects.agent.sessions.entityTypes.get", 11819 // "parameterOrder": [ 11820 // "name" 11821 // ], 11822 // "parameters": { 11823 // "name": { 11824 // "description": "Required. The name of the session entity type. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e/entityTypes/\u003cEntity Type\nDisplay Name\u003e`.", 11825 // "location": "path", 11826 // "pattern": "^projects/[^/]+/agent/sessions/[^/]+/entityTypes/[^/]+$", 11827 // "required": true, 11828 // "type": "string" 11829 // } 11830 // }, 11831 // "path": "v2/{+name}", 11832 // "response": { 11833 // "$ref": "GoogleCloudDialogflowV2SessionEntityType" 11834 // }, 11835 // "scopes": [ 11836 // "https://www.googleapis.com/auth/cloud-platform", 11837 // "https://www.googleapis.com/auth/dialogflow" 11838 // ] 11839 // } 11840 11841} 11842 11843// method id "dialogflow.projects.agent.sessions.entityTypes.list": 11844 11845type ProjectsAgentSessionsEntityTypesListCall struct { 11846 s *Service 11847 parent string 11848 urlParams_ gensupport.URLParams 11849 ifNoneMatch_ string 11850 ctx_ context.Context 11851 header_ http.Header 11852} 11853 11854// List: Returns the list of all session entity types in the specified 11855// session. 11856func (r *ProjectsAgentSessionsEntityTypesService) List(parent string) *ProjectsAgentSessionsEntityTypesListCall { 11857 c := &ProjectsAgentSessionsEntityTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11858 c.parent = parent 11859 return c 11860} 11861 11862// PageSize sets the optional parameter "pageSize": The maximum number 11863// of items to return in a single page. By 11864// default 100 and at most 1000. 11865func (c *ProjectsAgentSessionsEntityTypesListCall) PageSize(pageSize int64) *ProjectsAgentSessionsEntityTypesListCall { 11866 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 11867 return c 11868} 11869 11870// PageToken sets the optional parameter "pageToken": The 11871// next_page_token value returned from a previous list request. 11872func (c *ProjectsAgentSessionsEntityTypesListCall) PageToken(pageToken string) *ProjectsAgentSessionsEntityTypesListCall { 11873 c.urlParams_.Set("pageToken", pageToken) 11874 return c 11875} 11876 11877// Fields allows partial responses to be retrieved. See 11878// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11879// for more information. 11880func (c *ProjectsAgentSessionsEntityTypesListCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsEntityTypesListCall { 11881 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11882 return c 11883} 11884 11885// IfNoneMatch sets the optional parameter which makes the operation 11886// fail if the object's ETag matches the given value. This is useful for 11887// getting updates only after the object has changed since the last 11888// request. Use googleapi.IsNotModified to check whether the response 11889// error from Do is the result of In-None-Match. 11890func (c *ProjectsAgentSessionsEntityTypesListCall) IfNoneMatch(entityTag string) *ProjectsAgentSessionsEntityTypesListCall { 11891 c.ifNoneMatch_ = entityTag 11892 return c 11893} 11894 11895// Context sets the context to be used in this call's Do method. Any 11896// pending HTTP request will be aborted if the provided context is 11897// canceled. 11898func (c *ProjectsAgentSessionsEntityTypesListCall) Context(ctx context.Context) *ProjectsAgentSessionsEntityTypesListCall { 11899 c.ctx_ = ctx 11900 return c 11901} 11902 11903// Header returns an http.Header that can be modified by the caller to 11904// add HTTP headers to the request. 11905func (c *ProjectsAgentSessionsEntityTypesListCall) Header() http.Header { 11906 if c.header_ == nil { 11907 c.header_ = make(http.Header) 11908 } 11909 return c.header_ 11910} 11911 11912func (c *ProjectsAgentSessionsEntityTypesListCall) doRequest(alt string) (*http.Response, error) { 11913 reqHeaders := make(http.Header) 11914 for k, v := range c.header_ { 11915 reqHeaders[k] = v 11916 } 11917 reqHeaders.Set("User-Agent", c.s.userAgent()) 11918 if c.ifNoneMatch_ != "" { 11919 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11920 } 11921 var body io.Reader = nil 11922 c.urlParams_.Set("alt", alt) 11923 c.urlParams_.Set("prettyPrint", "false") 11924 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/entityTypes") 11925 urls += "?" + c.urlParams_.Encode() 11926 req, err := http.NewRequest("GET", urls, body) 11927 if err != nil { 11928 return nil, err 11929 } 11930 req.Header = reqHeaders 11931 googleapi.Expand(req.URL, map[string]string{ 11932 "parent": c.parent, 11933 }) 11934 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11935} 11936 11937// Do executes the "dialogflow.projects.agent.sessions.entityTypes.list" call. 11938// Exactly one of *GoogleCloudDialogflowV2ListSessionEntityTypesResponse 11939// or error will be non-nil. Any non-2xx status code is an error. 11940// Response headers are in either 11941// *GoogleCloudDialogflowV2ListSessionEntityTypesResponse.ServerResponse. 11942// Header or (if a response was returned at all) in 11943// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 11944// whether the returned error was because http.StatusNotModified was 11945// returned. 11946func (c *ProjectsAgentSessionsEntityTypesListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2ListSessionEntityTypesResponse, error) { 11947 gensupport.SetOptions(c.urlParams_, opts...) 11948 res, err := c.doRequest("json") 11949 if res != nil && res.StatusCode == http.StatusNotModified { 11950 if res.Body != nil { 11951 res.Body.Close() 11952 } 11953 return nil, &googleapi.Error{ 11954 Code: res.StatusCode, 11955 Header: res.Header, 11956 } 11957 } 11958 if err != nil { 11959 return nil, err 11960 } 11961 defer googleapi.CloseBody(res) 11962 if err := googleapi.CheckResponse(res); err != nil { 11963 return nil, err 11964 } 11965 ret := &GoogleCloudDialogflowV2ListSessionEntityTypesResponse{ 11966 ServerResponse: googleapi.ServerResponse{ 11967 Header: res.Header, 11968 HTTPStatusCode: res.StatusCode, 11969 }, 11970 } 11971 target := &ret 11972 if err := gensupport.DecodeResponse(target, res); err != nil { 11973 return nil, err 11974 } 11975 return ret, nil 11976 // { 11977 // "description": "Returns the list of all session entity types in the specified session.", 11978 // "flatPath": "v2/projects/{projectsId}/agent/sessions/{sessionsId}/entityTypes", 11979 // "httpMethod": "GET", 11980 // "id": "dialogflow.projects.agent.sessions.entityTypes.list", 11981 // "parameterOrder": [ 11982 // "parent" 11983 // ], 11984 // "parameters": { 11985 // "pageSize": { 11986 // "description": "Optional. The maximum number of items to return in a single page. By\ndefault 100 and at most 1000.", 11987 // "format": "int32", 11988 // "location": "query", 11989 // "type": "integer" 11990 // }, 11991 // "pageToken": { 11992 // "description": "Optional. The next_page_token value returned from a previous list request.", 11993 // "location": "query", 11994 // "type": "string" 11995 // }, 11996 // "parent": { 11997 // "description": "Required. The session to list all session entity types from.\nFormat: `projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e`.", 11998 // "location": "path", 11999 // "pattern": "^projects/[^/]+/agent/sessions/[^/]+$", 12000 // "required": true, 12001 // "type": "string" 12002 // } 12003 // }, 12004 // "path": "v2/{+parent}/entityTypes", 12005 // "response": { 12006 // "$ref": "GoogleCloudDialogflowV2ListSessionEntityTypesResponse" 12007 // }, 12008 // "scopes": [ 12009 // "https://www.googleapis.com/auth/cloud-platform", 12010 // "https://www.googleapis.com/auth/dialogflow" 12011 // ] 12012 // } 12013 12014} 12015 12016// Pages invokes f for each page of results. 12017// A non-nil error returned from f will halt the iteration. 12018// The provided context supersedes any context provided to the Context method. 12019func (c *ProjectsAgentSessionsEntityTypesListCall) Pages(ctx context.Context, f func(*GoogleCloudDialogflowV2ListSessionEntityTypesResponse) error) error { 12020 c.ctx_ = ctx 12021 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 12022 for { 12023 x, err := c.Do() 12024 if err != nil { 12025 return err 12026 } 12027 if err := f(x); err != nil { 12028 return err 12029 } 12030 if x.NextPageToken == "" { 12031 return nil 12032 } 12033 c.PageToken(x.NextPageToken) 12034 } 12035} 12036 12037// method id "dialogflow.projects.agent.sessions.entityTypes.patch": 12038 12039type ProjectsAgentSessionsEntityTypesPatchCall struct { 12040 s *Service 12041 nameid string 12042 googleclouddialogflowv2sessionentitytype *GoogleCloudDialogflowV2SessionEntityType 12043 urlParams_ gensupport.URLParams 12044 ctx_ context.Context 12045 header_ http.Header 12046} 12047 12048// Patch: Updates the specified session entity type. 12049func (r *ProjectsAgentSessionsEntityTypesService) Patch(nameid string, googleclouddialogflowv2sessionentitytype *GoogleCloudDialogflowV2SessionEntityType) *ProjectsAgentSessionsEntityTypesPatchCall { 12050 c := &ProjectsAgentSessionsEntityTypesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12051 c.nameid = nameid 12052 c.googleclouddialogflowv2sessionentitytype = googleclouddialogflowv2sessionentitytype 12053 return c 12054} 12055 12056// UpdateMask sets the optional parameter "updateMask": The mask to 12057// control which fields get updated. 12058func (c *ProjectsAgentSessionsEntityTypesPatchCall) UpdateMask(updateMask string) *ProjectsAgentSessionsEntityTypesPatchCall { 12059 c.urlParams_.Set("updateMask", updateMask) 12060 return c 12061} 12062 12063// Fields allows partial responses to be retrieved. See 12064// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12065// for more information. 12066func (c *ProjectsAgentSessionsEntityTypesPatchCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsEntityTypesPatchCall { 12067 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12068 return c 12069} 12070 12071// Context sets the context to be used in this call's Do method. Any 12072// pending HTTP request will be aborted if the provided context is 12073// canceled. 12074func (c *ProjectsAgentSessionsEntityTypesPatchCall) Context(ctx context.Context) *ProjectsAgentSessionsEntityTypesPatchCall { 12075 c.ctx_ = ctx 12076 return c 12077} 12078 12079// Header returns an http.Header that can be modified by the caller to 12080// add HTTP headers to the request. 12081func (c *ProjectsAgentSessionsEntityTypesPatchCall) Header() http.Header { 12082 if c.header_ == nil { 12083 c.header_ = make(http.Header) 12084 } 12085 return c.header_ 12086} 12087 12088func (c *ProjectsAgentSessionsEntityTypesPatchCall) doRequest(alt string) (*http.Response, error) { 12089 reqHeaders := make(http.Header) 12090 for k, v := range c.header_ { 12091 reqHeaders[k] = v 12092 } 12093 reqHeaders.Set("User-Agent", c.s.userAgent()) 12094 var body io.Reader = nil 12095 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2sessionentitytype) 12096 if err != nil { 12097 return nil, err 12098 } 12099 reqHeaders.Set("Content-Type", "application/json") 12100 c.urlParams_.Set("alt", alt) 12101 c.urlParams_.Set("prettyPrint", "false") 12102 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") 12103 urls += "?" + c.urlParams_.Encode() 12104 req, err := http.NewRequest("PATCH", urls, body) 12105 if err != nil { 12106 return nil, err 12107 } 12108 req.Header = reqHeaders 12109 googleapi.Expand(req.URL, map[string]string{ 12110 "name": c.nameid, 12111 }) 12112 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12113} 12114 12115// Do executes the "dialogflow.projects.agent.sessions.entityTypes.patch" call. 12116// Exactly one of *GoogleCloudDialogflowV2SessionEntityType or error 12117// will be non-nil. Any non-2xx status code is an error. Response 12118// headers are in either 12119// *GoogleCloudDialogflowV2SessionEntityType.ServerResponse.Header or 12120// (if a response was returned at all) in 12121// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 12122// whether the returned error was because http.StatusNotModified was 12123// returned. 12124func (c *ProjectsAgentSessionsEntityTypesPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2SessionEntityType, error) { 12125 gensupport.SetOptions(c.urlParams_, opts...) 12126 res, err := c.doRequest("json") 12127 if res != nil && res.StatusCode == http.StatusNotModified { 12128 if res.Body != nil { 12129 res.Body.Close() 12130 } 12131 return nil, &googleapi.Error{ 12132 Code: res.StatusCode, 12133 Header: res.Header, 12134 } 12135 } 12136 if err != nil { 12137 return nil, err 12138 } 12139 defer googleapi.CloseBody(res) 12140 if err := googleapi.CheckResponse(res); err != nil { 12141 return nil, err 12142 } 12143 ret := &GoogleCloudDialogflowV2SessionEntityType{ 12144 ServerResponse: googleapi.ServerResponse{ 12145 Header: res.Header, 12146 HTTPStatusCode: res.StatusCode, 12147 }, 12148 } 12149 target := &ret 12150 if err := gensupport.DecodeResponse(target, res); err != nil { 12151 return nil, err 12152 } 12153 return ret, nil 12154 // { 12155 // "description": "Updates the specified session entity type.", 12156 // "flatPath": "v2/projects/{projectsId}/agent/sessions/{sessionsId}/entityTypes/{entityTypesId}", 12157 // "httpMethod": "PATCH", 12158 // "id": "dialogflow.projects.agent.sessions.entityTypes.patch", 12159 // "parameterOrder": [ 12160 // "name" 12161 // ], 12162 // "parameters": { 12163 // "name": { 12164 // "description": "Required. The unique identifier of this session entity type. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e/entityTypes/\u003cEntity Type\nDisplay Name\u003e`.\n\n`\u003cEntity Type Display Name\u003e` must be the display name of an existing entity\ntype in the same agent that will be overridden or supplemented.", 12165 // "location": "path", 12166 // "pattern": "^projects/[^/]+/agent/sessions/[^/]+/entityTypes/[^/]+$", 12167 // "required": true, 12168 // "type": "string" 12169 // }, 12170 // "updateMask": { 12171 // "description": "Optional. The mask to control which fields get updated.", 12172 // "format": "google-fieldmask", 12173 // "location": "query", 12174 // "type": "string" 12175 // } 12176 // }, 12177 // "path": "v2/{+name}", 12178 // "request": { 12179 // "$ref": "GoogleCloudDialogflowV2SessionEntityType" 12180 // }, 12181 // "response": { 12182 // "$ref": "GoogleCloudDialogflowV2SessionEntityType" 12183 // }, 12184 // "scopes": [ 12185 // "https://www.googleapis.com/auth/cloud-platform", 12186 // "https://www.googleapis.com/auth/dialogflow" 12187 // ] 12188 // } 12189 12190} 12191 12192// method id "dialogflow.projects.operations.get": 12193 12194type ProjectsOperationsGetCall struct { 12195 s *Service 12196 name string 12197 urlParams_ gensupport.URLParams 12198 ifNoneMatch_ string 12199 ctx_ context.Context 12200 header_ http.Header 12201} 12202 12203// Get: Gets the latest state of a long-running operation. Clients can 12204// use this 12205// method to poll the operation result at intervals as recommended by 12206// the API 12207// service. 12208func (r *ProjectsOperationsService) Get(name string) *ProjectsOperationsGetCall { 12209 c := &ProjectsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12210 c.name = name 12211 return c 12212} 12213 12214// Fields allows partial responses to be retrieved. See 12215// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12216// for more information. 12217func (c *ProjectsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsOperationsGetCall { 12218 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12219 return c 12220} 12221 12222// IfNoneMatch sets the optional parameter which makes the operation 12223// fail if the object's ETag matches the given value. This is useful for 12224// getting updates only after the object has changed since the last 12225// request. Use googleapi.IsNotModified to check whether the response 12226// error from Do is the result of In-None-Match. 12227func (c *ProjectsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsOperationsGetCall { 12228 c.ifNoneMatch_ = entityTag 12229 return c 12230} 12231 12232// Context sets the context to be used in this call's Do method. Any 12233// pending HTTP request will be aborted if the provided context is 12234// canceled. 12235func (c *ProjectsOperationsGetCall) Context(ctx context.Context) *ProjectsOperationsGetCall { 12236 c.ctx_ = ctx 12237 return c 12238} 12239 12240// Header returns an http.Header that can be modified by the caller to 12241// add HTTP headers to the request. 12242func (c *ProjectsOperationsGetCall) Header() http.Header { 12243 if c.header_ == nil { 12244 c.header_ = make(http.Header) 12245 } 12246 return c.header_ 12247} 12248 12249func (c *ProjectsOperationsGetCall) doRequest(alt string) (*http.Response, error) { 12250 reqHeaders := make(http.Header) 12251 for k, v := range c.header_ { 12252 reqHeaders[k] = v 12253 } 12254 reqHeaders.Set("User-Agent", c.s.userAgent()) 12255 if c.ifNoneMatch_ != "" { 12256 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 12257 } 12258 var body io.Reader = nil 12259 c.urlParams_.Set("alt", alt) 12260 c.urlParams_.Set("prettyPrint", "false") 12261 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") 12262 urls += "?" + c.urlParams_.Encode() 12263 req, err := http.NewRequest("GET", urls, body) 12264 if err != nil { 12265 return nil, err 12266 } 12267 req.Header = reqHeaders 12268 googleapi.Expand(req.URL, map[string]string{ 12269 "name": c.name, 12270 }) 12271 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12272} 12273 12274// Do executes the "dialogflow.projects.operations.get" call. 12275// Exactly one of *GoogleLongrunningOperation or error will be non-nil. 12276// Any non-2xx status code is an error. Response headers are in either 12277// *GoogleLongrunningOperation.ServerResponse.Header or (if a response 12278// was returned at all) in error.(*googleapi.Error).Header. Use 12279// googleapi.IsNotModified to check whether the returned error was 12280// because http.StatusNotModified was returned. 12281func (c *ProjectsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 12282 gensupport.SetOptions(c.urlParams_, opts...) 12283 res, err := c.doRequest("json") 12284 if res != nil && res.StatusCode == http.StatusNotModified { 12285 if res.Body != nil { 12286 res.Body.Close() 12287 } 12288 return nil, &googleapi.Error{ 12289 Code: res.StatusCode, 12290 Header: res.Header, 12291 } 12292 } 12293 if err != nil { 12294 return nil, err 12295 } 12296 defer googleapi.CloseBody(res) 12297 if err := googleapi.CheckResponse(res); err != nil { 12298 return nil, err 12299 } 12300 ret := &GoogleLongrunningOperation{ 12301 ServerResponse: googleapi.ServerResponse{ 12302 Header: res.Header, 12303 HTTPStatusCode: res.StatusCode, 12304 }, 12305 } 12306 target := &ret 12307 if err := gensupport.DecodeResponse(target, res); err != nil { 12308 return nil, err 12309 } 12310 return ret, nil 12311 // { 12312 // "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice.", 12313 // "flatPath": "v2/projects/{projectsId}/operations/{operationsId}", 12314 // "httpMethod": "GET", 12315 // "id": "dialogflow.projects.operations.get", 12316 // "parameterOrder": [ 12317 // "name" 12318 // ], 12319 // "parameters": { 12320 // "name": { 12321 // "description": "The name of the operation resource.", 12322 // "location": "path", 12323 // "pattern": "^projects/[^/]+/operations/[^/]+$", 12324 // "required": true, 12325 // "type": "string" 12326 // } 12327 // }, 12328 // "path": "v2/{+name}", 12329 // "response": { 12330 // "$ref": "GoogleLongrunningOperation" 12331 // }, 12332 // "scopes": [ 12333 // "https://www.googleapis.com/auth/cloud-platform", 12334 // "https://www.googleapis.com/auth/dialogflow" 12335 // ] 12336 // } 12337 12338} 12339