You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

11653 lines
443 KiB

  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. // Code generated file. DO NOT EDIT.
  5. // Package dialogflow provides access to the Dialogflow API.
  6. //
  7. // This package is DEPRECATED. Use package cloud.google.com/go/dialogflow/apiv2 instead.
  8. //
  9. // For product documentation, see: https://cloud.google.com/dialogflow-enterprise/
  10. //
  11. // Creating a client
  12. //
  13. // Usage example:
  14. //
  15. // import "google.golang.org/api/dialogflow/v2"
  16. // ...
  17. // ctx := context.Background()
  18. // dialogflowService, err := dialogflow.NewService(ctx)
  19. //
  20. // In this example, Google Application Default Credentials are used for authentication.
  21. //
  22. // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
  23. //
  24. // Other authentication options
  25. //
  26. // By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
  27. //
  28. // dialogflowService, err := dialogflow.NewService(ctx, option.WithScopes(dialogflow.DialogflowScope))
  29. //
  30. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  31. //
  32. // dialogflowService, err := dialogflow.NewService(ctx, option.WithAPIKey("AIza..."))
  33. //
  34. // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
  35. //
  36. // config := &oauth2.Config{...}
  37. // // ...
  38. // token, err := config.Exchange(ctx, ...)
  39. // dialogflowService, err := dialogflow.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
  40. //
  41. // See https://godoc.org/google.golang.org/api/option/ for details on options.
  42. package dialogflow // import "google.golang.org/api/dialogflow/v2"
  43. import (
  44. "bytes"
  45. "context"
  46. "encoding/json"
  47. "errors"
  48. "fmt"
  49. "io"
  50. "net/http"
  51. "net/url"
  52. "strconv"
  53. "strings"
  54. gensupport "google.golang.org/api/gensupport"
  55. googleapi "google.golang.org/api/googleapi"
  56. option "google.golang.org/api/option"
  57. htransport "google.golang.org/api/transport/http"
  58. )
  59. // Always reference these packages, just in case the auto-generated code
  60. // below doesn't.
  61. var _ = bytes.NewBuffer
  62. var _ = strconv.Itoa
  63. var _ = fmt.Sprintf
  64. var _ = json.NewDecoder
  65. var _ = io.Copy
  66. var _ = url.Parse
  67. var _ = gensupport.MarshalJSON
  68. var _ = googleapi.Version
  69. var _ = errors.New
  70. var _ = strings.Replace
  71. var _ = context.Canceled
  72. const apiId = "dialogflow:v2"
  73. const apiName = "dialogflow"
  74. const apiVersion = "v2"
  75. const basePath = "https://dialogflow.googleapis.com/"
  76. // OAuth2 scopes used by this API.
  77. const (
  78. // View and manage your data across Google Cloud Platform services
  79. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  80. // View, manage and query your Dialogflow agents
  81. DialogflowScope = "https://www.googleapis.com/auth/dialogflow"
  82. )
  83. // NewService creates a new Service.
  84. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
  85. scopesOption := option.WithScopes(
  86. "https://www.googleapis.com/auth/cloud-platform",
  87. "https://www.googleapis.com/auth/dialogflow",
  88. )
  89. // NOTE: prepend, so we don't override user-specified scopes.
  90. opts = append([]option.ClientOption{scopesOption}, opts...)
  91. client, endpoint, err := htransport.NewClient(ctx, opts...)
  92. if err != nil {
  93. return nil, err
  94. }
  95. s, err := New(client)
  96. if err != nil {
  97. return nil, err
  98. }
  99. if endpoint != "" {
  100. s.BasePath = endpoint
  101. }
  102. return s, nil
  103. }
  104. // New creates a new Service. It uses the provided http.Client for requests.
  105. //
  106. // Deprecated: please use NewService instead.
  107. // To provide a custom HTTP client, use option.WithHTTPClient.
  108. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
  109. func New(client *http.Client) (*Service, error) {
  110. if client == nil {
  111. return nil, errors.New("client is nil")
  112. }
  113. s := &Service{client: client, BasePath: basePath}
  114. s.Projects = NewProjectsService(s)
  115. return s, nil
  116. }
  117. type Service struct {
  118. client *http.Client
  119. BasePath string // API endpoint base URL
  120. UserAgent string // optional additional User-Agent fragment
  121. Projects *ProjectsService
  122. }
  123. func (s *Service) userAgent() string {
  124. if s.UserAgent == "" {
  125. return googleapi.UserAgent
  126. }
  127. return googleapi.UserAgent + " " + s.UserAgent
  128. }
  129. func NewProjectsService(s *Service) *ProjectsService {
  130. rs := &ProjectsService{s: s}
  131. rs.Agent = NewProjectsAgentService(s)
  132. rs.Operations = NewProjectsOperationsService(s)
  133. return rs
  134. }
  135. type ProjectsService struct {
  136. s *Service
  137. Agent *ProjectsAgentService
  138. Operations *ProjectsOperationsService
  139. }
  140. func NewProjectsAgentService(s *Service) *ProjectsAgentService {
  141. rs := &ProjectsAgentService{s: s}
  142. rs.EntityTypes = NewProjectsAgentEntityTypesService(s)
  143. rs.Intents = NewProjectsAgentIntentsService(s)
  144. rs.Sessions = NewProjectsAgentSessionsService(s)
  145. return rs
  146. }
  147. type ProjectsAgentService struct {
  148. s *Service
  149. EntityTypes *ProjectsAgentEntityTypesService
  150. Intents *ProjectsAgentIntentsService
  151. Sessions *ProjectsAgentSessionsService
  152. }
  153. func NewProjectsAgentEntityTypesService(s *Service) *ProjectsAgentEntityTypesService {
  154. rs := &ProjectsAgentEntityTypesService{s: s}
  155. rs.Entities = NewProjectsAgentEntityTypesEntitiesService(s)
  156. return rs
  157. }
  158. type ProjectsAgentEntityTypesService struct {
  159. s *Service
  160. Entities *ProjectsAgentEntityTypesEntitiesService
  161. }
  162. func NewProjectsAgentEntityTypesEntitiesService(s *Service) *ProjectsAgentEntityTypesEntitiesService {
  163. rs := &ProjectsAgentEntityTypesEntitiesService{s: s}
  164. return rs
  165. }
  166. type ProjectsAgentEntityTypesEntitiesService struct {
  167. s *Service
  168. }
  169. func NewProjectsAgentIntentsService(s *Service) *ProjectsAgentIntentsService {
  170. rs := &ProjectsAgentIntentsService{s: s}
  171. return rs
  172. }
  173. type ProjectsAgentIntentsService struct {
  174. s *Service
  175. }
  176. func NewProjectsAgentSessionsService(s *Service) *ProjectsAgentSessionsService {
  177. rs := &ProjectsAgentSessionsService{s: s}
  178. rs.Contexts = NewProjectsAgentSessionsContextsService(s)
  179. rs.EntityTypes = NewProjectsAgentSessionsEntityTypesService(s)
  180. return rs
  181. }
  182. type ProjectsAgentSessionsService struct {
  183. s *Service
  184. Contexts *ProjectsAgentSessionsContextsService
  185. EntityTypes *ProjectsAgentSessionsEntityTypesService
  186. }
  187. func NewProjectsAgentSessionsContextsService(s *Service) *ProjectsAgentSessionsContextsService {
  188. rs := &ProjectsAgentSessionsContextsService{s: s}
  189. return rs
  190. }
  191. type ProjectsAgentSessionsContextsService struct {
  192. s *Service
  193. }
  194. func NewProjectsAgentSessionsEntityTypesService(s *Service) *ProjectsAgentSessionsEntityTypesService {
  195. rs := &ProjectsAgentSessionsEntityTypesService{s: s}
  196. return rs
  197. }
  198. type ProjectsAgentSessionsEntityTypesService struct {
  199. s *Service
  200. }
  201. func NewProjectsOperationsService(s *Service) *ProjectsOperationsService {
  202. rs := &ProjectsOperationsService{s: s}
  203. return rs
  204. }
  205. type ProjectsOperationsService struct {
  206. s *Service
  207. }
  208. // GoogleCloudDialogflowV2Agent: Represents a conversational agent.
  209. type GoogleCloudDialogflowV2Agent struct {
  210. // AvatarUri: Optional. The URI of the agent's avatar.
  211. // Avatars are used throughout the Dialogflow console and in the
  212. // self-hosted
  213. // [Web Demo](https://dialogflow.com/docs/integrations/web-demo)
  214. // integration.
  215. AvatarUri string `json:"avatarUri,omitempty"`
  216. // ClassificationThreshold: Optional. To filter out false positive
  217. // results and still get variety in
  218. // matched natural language inputs for your agent, you can tune the
  219. // machine
  220. // learning classification threshold. If the returned score value is
  221. // less than
  222. // the threshold value, then a fallback intent will be triggered or, if
  223. // there
  224. // are no fallback intents defined, no intent will be triggered. The
  225. // score
  226. // values range from 0.0 (completely uncertain) to 1.0 (completely
  227. // certain).
  228. // If set to 0.0, the default of 0.3 is used.
  229. ClassificationThreshold float64 `json:"classificationThreshold,omitempty"`
  230. // DefaultLanguageCode: Required. The default language of the agent as a
  231. // language tag. See
  232. // [Language Support](https://dialogflow.com/docs/reference/language)
  233. // for a
  234. // list of the currently supported language codes.
  235. // This field cannot be set by the `Update` method.
  236. DefaultLanguageCode string `json:"defaultLanguageCode,omitempty"`
  237. // Description: Optional. The description of this agent.
  238. // The maximum length is 500 characters. If exceeded, the request is
  239. // rejected.
  240. Description string `json:"description,omitempty"`
  241. // DisplayName: Required. The name of this agent.
  242. DisplayName string `json:"displayName,omitempty"`
  243. // EnableLogging: Optional. Determines whether this agent should log
  244. // conversation queries.
  245. EnableLogging bool `json:"enableLogging,omitempty"`
  246. // MatchMode: Optional. Determines how intents are detected from user
  247. // queries.
  248. //
  249. // Possible values:
  250. // "MATCH_MODE_UNSPECIFIED" - Not specified.
  251. // "MATCH_MODE_HYBRID" - Best for agents with a small number of
  252. // examples in intents and/or wide
  253. // use of templates syntax and composite entities.
  254. // "MATCH_MODE_ML_ONLY" - Can be used for agents with a large number
  255. // of examples in intents,
  256. // especially the ones using @sys.any or very large developer entities.
  257. MatchMode string `json:"matchMode,omitempty"`
  258. // Parent: Required. The project of this agent.
  259. // Format: `projects/<Project ID>`.
  260. Parent string `json:"parent,omitempty"`
  261. // SupportedLanguageCodes: Optional. The list of all languages supported
  262. // by this agent (except for the
  263. // `default_language_code`).
  264. SupportedLanguageCodes []string `json:"supportedLanguageCodes,omitempty"`
  265. // TimeZone: Required. The time zone of this agent from the
  266. // [time zone database](https://www.iana.org/time-zones),
  267. // e.g.,
  268. // America/New_York, Europe/Paris.
  269. TimeZone string `json:"timeZone,omitempty"`
  270. // ServerResponse contains the HTTP response code and headers from the
  271. // server.
  272. googleapi.ServerResponse `json:"-"`
  273. // ForceSendFields is a list of field names (e.g. "AvatarUri") to
  274. // unconditionally include in API requests. By default, fields with
  275. // empty values are omitted from API requests. However, any non-pointer,
  276. // non-interface field appearing in ForceSendFields will be sent to the
  277. // server regardless of whether the field is empty or not. This may be
  278. // used to include empty fields in Patch requests.
  279. ForceSendFields []string `json:"-"`
  280. // NullFields is a list of field names (e.g. "AvatarUri") to include in
  281. // API requests with the JSON null value. By default, fields with empty
  282. // values are omitted from API requests. However, any field with an
  283. // empty value appearing in NullFields will be sent to the server as
  284. // null. It is an error if a field in this list has a non-empty value.
  285. // This may be used to include null fields in Patch requests.
  286. NullFields []string `json:"-"`
  287. }
  288. func (s *GoogleCloudDialogflowV2Agent) MarshalJSON() ([]byte, error) {
  289. type NoMethod GoogleCloudDialogflowV2Agent
  290. raw := NoMethod(*s)
  291. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  292. }
  293. func (s *GoogleCloudDialogflowV2Agent) UnmarshalJSON(data []byte) error {
  294. type NoMethod GoogleCloudDialogflowV2Agent
  295. var s1 struct {
  296. ClassificationThreshold gensupport.JSONFloat64 `json:"classificationThreshold"`
  297. *NoMethod
  298. }
  299. s1.NoMethod = (*NoMethod)(s)
  300. if err := json.Unmarshal(data, &s1); err != nil {
  301. return err
  302. }
  303. s.ClassificationThreshold = float64(s1.ClassificationThreshold)
  304. return nil
  305. }
  306. // GoogleCloudDialogflowV2BatchCreateEntitiesRequest: The request
  307. // message for EntityTypes.BatchCreateEntities.
  308. type GoogleCloudDialogflowV2BatchCreateEntitiesRequest struct {
  309. // Entities: Required. The entities to create.
  310. Entities []*GoogleCloudDialogflowV2EntityTypeEntity `json:"entities,omitempty"`
  311. // LanguageCode: Optional. The language of entity synonyms defined in
  312. // `entities`. If not
  313. // specified, the agent's default language is used.
  314. // [More than a
  315. // dozen
  316. // languages](https://dialogflow.com/docs/reference/language) are
  317. // supported.
  318. // Note: languages must be enabled in the agent, before they can be
  319. // used.
  320. LanguageCode string `json:"languageCode,omitempty"`
  321. // ForceSendFields is a list of field names (e.g. "Entities") to
  322. // unconditionally include in API requests. By default, fields with
  323. // empty values are omitted from API requests. However, any non-pointer,
  324. // non-interface field appearing in ForceSendFields will be sent to the
  325. // server regardless of whether the field is empty or not. This may be
  326. // used to include empty fields in Patch requests.
  327. ForceSendFields []string `json:"-"`
  328. // NullFields is a list of field names (e.g. "Entities") to include in
  329. // API requests with the JSON null value. By default, fields with empty
  330. // values are omitted from API requests. However, any field with an
  331. // empty value appearing in NullFields will be sent to the server as
  332. // null. It is an error if a field in this list has a non-empty value.
  333. // This may be used to include null fields in Patch requests.
  334. NullFields []string `json:"-"`
  335. }
  336. func (s *GoogleCloudDialogflowV2BatchCreateEntitiesRequest) MarshalJSON() ([]byte, error) {
  337. type NoMethod GoogleCloudDialogflowV2BatchCreateEntitiesRequest
  338. raw := NoMethod(*s)
  339. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  340. }
  341. // GoogleCloudDialogflowV2BatchDeleteEntitiesRequest: The request
  342. // message for EntityTypes.BatchDeleteEntities.
  343. type GoogleCloudDialogflowV2BatchDeleteEntitiesRequest struct {
  344. // EntityValues: Required. The canonical `values` of the entities to
  345. // delete. Note that
  346. // these are not fully-qualified names, i.e. they don't start
  347. // with
  348. // `projects/<Project ID>`.
  349. EntityValues []string `json:"entityValues,omitempty"`
  350. // LanguageCode: Optional. The language of entity synonyms defined in
  351. // `entities`. If not
  352. // specified, the agent's default language is used.
  353. // [More than a
  354. // dozen
  355. // languages](https://dialogflow.com/docs/reference/language) are
  356. // supported.
  357. // Note: languages must be enabled in the agent, before they can be
  358. // used.
  359. LanguageCode string `json:"languageCode,omitempty"`
  360. // ForceSendFields is a list of field names (e.g. "EntityValues") to
  361. // unconditionally include in API requests. By default, fields with
  362. // empty values are omitted from API requests. However, any non-pointer,
  363. // non-interface field appearing in ForceSendFields will be sent to the
  364. // server regardless of whether the field is empty or not. This may be
  365. // used to include empty fields in Patch requests.
  366. ForceSendFields []string `json:"-"`
  367. // NullFields is a list of field names (e.g. "EntityValues") to include
  368. // in API requests with the JSON null value. By default, fields with
  369. // empty values are omitted from API requests. However, any field with
  370. // an empty value appearing in NullFields will be sent to the server as
  371. // null. It is an error if a field in this list has a non-empty value.
  372. // This may be used to include null fields in Patch requests.
  373. NullFields []string `json:"-"`
  374. }
  375. func (s *GoogleCloudDialogflowV2BatchDeleteEntitiesRequest) MarshalJSON() ([]byte, error) {
  376. type NoMethod GoogleCloudDialogflowV2BatchDeleteEntitiesRequest
  377. raw := NoMethod(*s)
  378. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  379. }
  380. // GoogleCloudDialogflowV2BatchDeleteEntityTypesRequest: The request
  381. // message for EntityTypes.BatchDeleteEntityTypes.
  382. type GoogleCloudDialogflowV2BatchDeleteEntityTypesRequest struct {
  383. // EntityTypeNames: Required. The names entity types to delete. All
  384. // names must point to the
  385. // same agent as `parent`.
  386. EntityTypeNames []string `json:"entityTypeNames,omitempty"`
  387. // ForceSendFields is a list of field names (e.g. "EntityTypeNames") to
  388. // unconditionally include in API requests. By default, fields with
  389. // empty values are omitted from API requests. However, any non-pointer,
  390. // non-interface field appearing in ForceSendFields will be sent to the
  391. // server regardless of whether the field is empty or not. This may be
  392. // used to include empty fields in Patch requests.
  393. ForceSendFields []string `json:"-"`
  394. // NullFields is a list of field names (e.g. "EntityTypeNames") to
  395. // include in API requests with the JSON null value. By default, fields
  396. // with empty values are omitted from API requests. However, any field
  397. // with an empty value appearing in NullFields will be sent to the
  398. // server as null. It is an error if a field in this list has a
  399. // non-empty value. This may be used to include null fields in Patch
  400. // requests.
  401. NullFields []string `json:"-"`
  402. }
  403. func (s *GoogleCloudDialogflowV2BatchDeleteEntityTypesRequest) MarshalJSON() ([]byte, error) {
  404. type NoMethod GoogleCloudDialogflowV2BatchDeleteEntityTypesRequest
  405. raw := NoMethod(*s)
  406. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  407. }
  408. // GoogleCloudDialogflowV2BatchDeleteIntentsRequest: The request message
  409. // for Intents.BatchDeleteIntents.
  410. type GoogleCloudDialogflowV2BatchDeleteIntentsRequest struct {
  411. // Intents: Required. The collection of intents to delete. Only intent
  412. // `name` must be
  413. // filled in.
  414. Intents []*GoogleCloudDialogflowV2Intent `json:"intents,omitempty"`
  415. // ForceSendFields is a list of field names (e.g. "Intents") to
  416. // unconditionally include in API requests. By default, fields with
  417. // empty values are omitted from API requests. However, any non-pointer,
  418. // non-interface field appearing in ForceSendFields will be sent to the
  419. // server regardless of whether the field is empty or not. This may be
  420. // used to include empty fields in Patch requests.
  421. ForceSendFields []string `json:"-"`
  422. // NullFields is a list of field names (e.g. "Intents") to include in
  423. // API requests with the JSON null value. By default, fields with empty
  424. // values are omitted from API requests. However, any field with an
  425. // empty value appearing in NullFields will be sent to the server as
  426. // null. It is an error if a field in this list has a non-empty value.
  427. // This may be used to include null fields in Patch requests.
  428. NullFields []string `json:"-"`
  429. }
  430. func (s *GoogleCloudDialogflowV2BatchDeleteIntentsRequest) MarshalJSON() ([]byte, error) {
  431. type NoMethod GoogleCloudDialogflowV2BatchDeleteIntentsRequest
  432. raw := NoMethod(*s)
  433. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  434. }
  435. // GoogleCloudDialogflowV2BatchUpdateEntitiesRequest: The request
  436. // message for EntityTypes.BatchUpdateEntities.
  437. type GoogleCloudDialogflowV2BatchUpdateEntitiesRequest struct {
  438. // Entities: Required. The entities to update or create.
  439. Entities []*GoogleCloudDialogflowV2EntityTypeEntity `json:"entities,omitempty"`
  440. // LanguageCode: Optional. The language of entity synonyms defined in
  441. // `entities`. If not
  442. // specified, the agent's default language is used.
  443. // [More than a
  444. // dozen
  445. // languages](https://dialogflow.com/docs/reference/language) are
  446. // supported.
  447. // Note: languages must be enabled in the agent, before they can be
  448. // used.
  449. LanguageCode string `json:"languageCode,omitempty"`
  450. // UpdateMask: Optional. The mask to control which fields get updated.
  451. UpdateMask string `json:"updateMask,omitempty"`
  452. // ForceSendFields is a list of field names (e.g. "Entities") to
  453. // unconditionally include in API requests. By default, fields with
  454. // empty values are omitted from API requests. However, any non-pointer,
  455. // non-interface field appearing in ForceSendFields will be sent to the
  456. // server regardless of whether the field is empty or not. This may be
  457. // used to include empty fields in Patch requests.
  458. ForceSendFields []string `json:"-"`
  459. // NullFields is a list of field names (e.g. "Entities") to include in
  460. // API requests with the JSON null value. By default, fields with empty
  461. // values are omitted from API requests. However, any field with an
  462. // empty value appearing in NullFields will be sent to the server as
  463. // null. It is an error if a field in this list has a non-empty value.
  464. // This may be used to include null fields in Patch requests.
  465. NullFields []string `json:"-"`
  466. }
  467. func (s *GoogleCloudDialogflowV2BatchUpdateEntitiesRequest) MarshalJSON() ([]byte, error) {
  468. type NoMethod GoogleCloudDialogflowV2BatchUpdateEntitiesRequest
  469. raw := NoMethod(*s)
  470. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  471. }
  472. // GoogleCloudDialogflowV2BatchUpdateEntityTypesRequest: The request
  473. // message for EntityTypes.BatchUpdateEntityTypes.
  474. type GoogleCloudDialogflowV2BatchUpdateEntityTypesRequest struct {
  475. // EntityTypeBatchInline: The collection of entity types to update or
  476. // create.
  477. EntityTypeBatchInline *GoogleCloudDialogflowV2EntityTypeBatch `json:"entityTypeBatchInline,omitempty"`
  478. // EntityTypeBatchUri: The URI to a Google Cloud Storage file containing
  479. // entity types to update
  480. // or create. The file format can either be a serialized proto
  481. // (of
  482. // EntityBatch type) or a JSON object. Note: The URI must start
  483. // with
  484. // "gs://".
  485. EntityTypeBatchUri string `json:"entityTypeBatchUri,omitempty"`
  486. // LanguageCode: Optional. The language of entity synonyms defined in
  487. // `entity_types`. If not
  488. // specified, the agent's default language is used.
  489. // [More than a
  490. // dozen
  491. // languages](https://dialogflow.com/docs/reference/language) are
  492. // supported.
  493. // Note: languages must be enabled in the agent, before they can be
  494. // used.
  495. LanguageCode string `json:"languageCode,omitempty"`
  496. // UpdateMask: Optional. The mask to control which fields get updated.
  497. UpdateMask string `json:"updateMask,omitempty"`
  498. // ForceSendFields is a list of field names (e.g.
  499. // "EntityTypeBatchInline") to unconditionally include in API requests.
  500. // By default, fields with empty values are omitted from API requests.
  501. // However, any non-pointer, non-interface field appearing in
  502. // ForceSendFields will be sent to the server regardless of whether the
  503. // field is empty or not. This may be used to include empty fields in
  504. // Patch requests.
  505. ForceSendFields []string `json:"-"`
  506. // NullFields is a list of field names (e.g. "EntityTypeBatchInline") to
  507. // include in API requests with the JSON null value. By default, fields
  508. // with empty values are omitted from API requests. However, any field
  509. // with an empty value appearing in NullFields will be sent to the
  510. // server as null. It is an error if a field in this list has a
  511. // non-empty value. This may be used to include null fields in Patch
  512. // requests.
  513. NullFields []string `json:"-"`
  514. }
  515. func (s *GoogleCloudDialogflowV2BatchUpdateEntityTypesRequest) MarshalJSON() ([]byte, error) {
  516. type NoMethod GoogleCloudDialogflowV2BatchUpdateEntityTypesRequest
  517. raw := NoMethod(*s)
  518. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  519. }
  520. // GoogleCloudDialogflowV2BatchUpdateEntityTypesResponse: The response
  521. // message for EntityTypes.BatchUpdateEntityTypes.
  522. type GoogleCloudDialogflowV2BatchUpdateEntityTypesResponse struct {
  523. // EntityTypes: The collection of updated or created entity types.
  524. EntityTypes []*GoogleCloudDialogflowV2EntityType `json:"entityTypes,omitempty"`
  525. // ForceSendFields is a list of field names (e.g. "EntityTypes") to
  526. // unconditionally include in API requests. By default, fields with
  527. // empty values are omitted from API requests. However, any non-pointer,
  528. // non-interface field appearing in ForceSendFields will be sent to the
  529. // server regardless of whether the field is empty or not. This may be
  530. // used to include empty fields in Patch requests.
  531. ForceSendFields []string `json:"-"`
  532. // NullFields is a list of field names (e.g. "EntityTypes") to include
  533. // in API requests with the JSON null value. By default, fields with
  534. // empty values are omitted from API requests. However, any field with
  535. // an empty value appearing in NullFields will be sent to the server as
  536. // null. It is an error if a field in this list has a non-empty value.
  537. // This may be used to include null fields in Patch requests.
  538. NullFields []string `json:"-"`
  539. }
  540. func (s *GoogleCloudDialogflowV2BatchUpdateEntityTypesResponse) MarshalJSON() ([]byte, error) {
  541. type NoMethod GoogleCloudDialogflowV2BatchUpdateEntityTypesResponse
  542. raw := NoMethod(*s)
  543. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  544. }
  545. // GoogleCloudDialogflowV2BatchUpdateIntentsRequest: The request message
  546. // for Intents.BatchUpdateIntents.
  547. type GoogleCloudDialogflowV2BatchUpdateIntentsRequest struct {
  548. // IntentBatchInline: The collection of intents to update or create.
  549. IntentBatchInline *GoogleCloudDialogflowV2IntentBatch `json:"intentBatchInline,omitempty"`
  550. // IntentBatchUri: The URI to a Google Cloud Storage file containing
  551. // intents to update or
  552. // create. The file format can either be a serialized proto (of
  553. // IntentBatch
  554. // type) or JSON object. Note: The URI must start with "gs://".
  555. IntentBatchUri string `json:"intentBatchUri,omitempty"`
  556. // IntentView: Optional. The resource view to apply to the returned
  557. // intent.
  558. //
  559. // Possible values:
  560. // "INTENT_VIEW_UNSPECIFIED" - Training phrases field is not populated
  561. // in the response.
  562. // "INTENT_VIEW_FULL" - All fields are populated.
  563. IntentView string `json:"intentView,omitempty"`
  564. // LanguageCode: Optional. The language of training phrases, parameters
  565. // and rich messages
  566. // defined in `intents`. If not specified, the agent's default language
  567. // is
  568. // used. [More than a
  569. // dozen
  570. // languages](https://dialogflow.com/docs/reference/language) are
  571. // supported.
  572. // Note: languages must be enabled in the agent, before they can be
  573. // used.
  574. LanguageCode string `json:"languageCode,omitempty"`
  575. // UpdateMask: Optional. The mask to control which fields get updated.
  576. UpdateMask string `json:"updateMask,omitempty"`
  577. // ForceSendFields is a list of field names (e.g. "IntentBatchInline")
  578. // to unconditionally include in API requests. By default, fields with
  579. // empty values are omitted from API requests. However, any non-pointer,
  580. // non-interface field appearing in ForceSendFields will be sent to the
  581. // server regardless of whether the field is empty or not. This may be
  582. // used to include empty fields in Patch requests.
  583. ForceSendFields []string `json:"-"`
  584. // NullFields is a list of field names (e.g. "IntentBatchInline") to
  585. // include in API requests with the JSON null value. By default, fields
  586. // with empty values are omitted from API requests. However, any field
  587. // with an empty value appearing in NullFields will be sent to the
  588. // server as null. It is an error if a field in this list has a
  589. // non-empty value. This may be used to include null fields in Patch
  590. // requests.
  591. NullFields []string `json:"-"`
  592. }
  593. func (s *GoogleCloudDialogflowV2BatchUpdateIntentsRequest) MarshalJSON() ([]byte, error) {
  594. type NoMethod GoogleCloudDialogflowV2BatchUpdateIntentsRequest
  595. raw := NoMethod(*s)
  596. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  597. }
  598. // GoogleCloudDialogflowV2BatchUpdateIntentsResponse: The response
  599. // message for Intents.BatchUpdateIntents.
  600. type GoogleCloudDialogflowV2BatchUpdateIntentsResponse struct {
  601. // Intents: The collection of updated or created intents.
  602. Intents []*GoogleCloudDialogflowV2Intent `json:"intents,omitempty"`
  603. // ForceSendFields is a list of field names (e.g. "Intents") to
  604. // unconditionally include in API requests. By default, fields with
  605. // empty values are omitted from API requests. However, any non-pointer,
  606. // non-interface field appearing in ForceSendFields will be sent to the
  607. // server regardless of whether the field is empty or not. This may be
  608. // used to include empty fields in Patch requests.
  609. ForceSendFields []string `json:"-"`
  610. // NullFields is a list of field names (e.g. "Intents") to include in
  611. // API requests with the JSON null value. By default, fields with empty
  612. // values are omitted from API requests. However, any field with an
  613. // empty value appearing in NullFields will be sent to the server as
  614. // null. It is an error if a field in this list has a non-empty value.
  615. // This may be used to include null fields in Patch requests.
  616. NullFields []string `json:"-"`
  617. }
  618. func (s *GoogleCloudDialogflowV2BatchUpdateIntentsResponse) MarshalJSON() ([]byte, error) {
  619. type NoMethod GoogleCloudDialogflowV2BatchUpdateIntentsResponse
  620. raw := NoMethod(*s)
  621. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  622. }
  623. // GoogleCloudDialogflowV2Context: Represents a context.
  624. type GoogleCloudDialogflowV2Context struct {
  625. // LifespanCount: Optional. The number of conversational query requests
  626. // after which the
  627. // context expires. If set to `0` (the default) the context
  628. // expires
  629. // immediately. Contexts expire automatically after 20 minutes if
  630. // there
  631. // are no matching queries.
  632. LifespanCount int64 `json:"lifespanCount,omitempty"`
  633. // Name: Required. The unique identifier of the context.
  634. // Format:
  635. // `projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context
  636. // ID>`.
  637. //
  638. // The `Context ID` is always converted to lowercase, may only
  639. // contain
  640. // characters in [a-zA-Z0-9_-%] and may be at most 250 bytes long.
  641. Name string `json:"name,omitempty"`
  642. // Parameters: Optional. The collection of parameters associated with
  643. // this context.
  644. // Refer to [this
  645. // doc](https://dialogflow.com/docs/actions-and-parameters) for
  646. // syntax.
  647. Parameters googleapi.RawMessage `json:"parameters,omitempty"`
  648. // ServerResponse contains the HTTP response code and headers from the
  649. // server.
  650. googleapi.ServerResponse `json:"-"`
  651. // ForceSendFields is a list of field names (e.g. "LifespanCount") to
  652. // unconditionally include in API requests. By default, fields with
  653. // empty values are omitted from API requests. However, any non-pointer,
  654. // non-interface field appearing in ForceSendFields will be sent to the
  655. // server regardless of whether the field is empty or not. This may be
  656. // used to include empty fields in Patch requests.
  657. ForceSendFields []string `json:"-"`
  658. // NullFields is a list of field names (e.g. "LifespanCount") to include
  659. // in API requests with the JSON null value. By default, fields with
  660. // empty values are omitted from API requests. However, any field with
  661. // an empty value appearing in NullFields will be sent to the server as
  662. // null. It is an error if a field in this list has a non-empty value.
  663. // This may be used to include null fields in Patch requests.
  664. NullFields []string `json:"-"`
  665. }
  666. func (s *GoogleCloudDialogflowV2Context) MarshalJSON() ([]byte, error) {
  667. type NoMethod GoogleCloudDialogflowV2Context
  668. raw := NoMethod(*s)
  669. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  670. }
  671. // GoogleCloudDialogflowV2DetectIntentRequest: The request to detect
  672. // user's intent.
  673. type GoogleCloudDialogflowV2DetectIntentRequest struct {
  674. // InputAudio: Optional. The natural language speech audio to be
  675. // processed. This field
  676. // should be populated iff `query_input` is set to an input audio
  677. // config.
  678. // A single request can contain up to 1 minute of speech audio data.
  679. InputAudio string `json:"inputAudio,omitempty"`
  680. // QueryInput: Required. The input specification. It can be set to:
  681. //
  682. // 1. an audio config
  683. // which instructs the speech recognizer how to process the speech
  684. // audio,
  685. //
  686. // 2. a conversational query in the form of text, or
  687. //
  688. // 3. an event that specifies which intent to trigger.
  689. QueryInput *GoogleCloudDialogflowV2QueryInput `json:"queryInput,omitempty"`
  690. // QueryParams: Optional. The parameters of this query.
  691. QueryParams *GoogleCloudDialogflowV2QueryParameters `json:"queryParams,omitempty"`
  692. // ForceSendFields is a list of field names (e.g. "InputAudio") to
  693. // unconditionally include in API requests. By default, fields with
  694. // empty values are omitted from API requests. However, any non-pointer,
  695. // non-interface field appearing in ForceSendFields will be sent to the
  696. // server regardless of whether the field is empty or not. This may be
  697. // used to include empty fields in Patch requests.
  698. ForceSendFields []string `json:"-"`
  699. // NullFields is a list of field names (e.g. "InputAudio") to include in
  700. // API requests with the JSON null value. By default, fields with empty
  701. // values are omitted from API requests. However, any field with an
  702. // empty value appearing in NullFields will be sent to the server as
  703. // null. It is an error if a field in this list has a non-empty value.
  704. // This may be used to include null fields in Patch requests.
  705. NullFields []string `json:"-"`
  706. }
  707. func (s *GoogleCloudDialogflowV2DetectIntentRequest) MarshalJSON() ([]byte, error) {
  708. type NoMethod GoogleCloudDialogflowV2DetectIntentRequest
  709. raw := NoMethod(*s)
  710. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  711. }
  712. // GoogleCloudDialogflowV2DetectIntentResponse: The message returned
  713. // from the DetectIntent method.
  714. type GoogleCloudDialogflowV2DetectIntentResponse struct {
  715. // QueryResult: The selected results of the conversational query or
  716. // event processing.
  717. // See `alternative_query_results` for additional potential results.
  718. QueryResult *GoogleCloudDialogflowV2QueryResult `json:"queryResult,omitempty"`
  719. // ResponseId: The unique identifier of the response. It can be used
  720. // to
  721. // locate a response in the training example set or for reporting
  722. // issues.
  723. ResponseId string `json:"responseId,omitempty"`
  724. // WebhookStatus: Specifies the status of the webhook request.
  725. WebhookStatus *GoogleRpcStatus `json:"webhookStatus,omitempty"`
  726. // ServerResponse contains the HTTP response code and headers from the
  727. // server.
  728. googleapi.ServerResponse `json:"-"`
  729. // ForceSendFields is a list of field names (e.g. "QueryResult") to
  730. // unconditionally include in API requests. By default, fields with
  731. // empty values are omitted from API requests. However, any non-pointer,
  732. // non-interface field appearing in ForceSendFields will be sent to the
  733. // server regardless of whether the field is empty or not. This may be
  734. // used to include empty fields in Patch requests.
  735. ForceSendFields []string `json:"-"`
  736. // NullFields is a list of field names (e.g. "QueryResult") to include
  737. // in API requests with the JSON null value. By default, fields with
  738. // empty values are omitted from API requests. However, any field with
  739. // an empty value appearing in NullFields will be sent to the server as
  740. // null. It is an error if a field in this list has a non-empty value.
  741. // This may be used to include null fields in Patch requests.
  742. NullFields []string `json:"-"`
  743. }
  744. func (s *GoogleCloudDialogflowV2DetectIntentResponse) MarshalJSON() ([]byte, error) {
  745. type NoMethod GoogleCloudDialogflowV2DetectIntentResponse
  746. raw := NoMethod(*s)
  747. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  748. }
  749. // GoogleCloudDialogflowV2EntityType: Represents an entity type.
  750. // Entity types serve as a tool for extracting parameter values from
  751. // natural
  752. // language queries.
  753. type GoogleCloudDialogflowV2EntityType struct {
  754. // AutoExpansionMode: Optional. Indicates whether the entity type can be
  755. // automatically
  756. // expanded.
  757. //
  758. // Possible values:
  759. // "AUTO_EXPANSION_MODE_UNSPECIFIED" - Auto expansion disabled for the
  760. // entity.
  761. // "AUTO_EXPANSION_MODE_DEFAULT" - Allows an agent to recognize values
  762. // that have not been explicitly
  763. // listed in the entity.
  764. AutoExpansionMode string `json:"autoExpansionMode,omitempty"`
  765. // DisplayName: Required. The name of the entity type.
  766. DisplayName string `json:"displayName,omitempty"`
  767. // Entities: Optional. The collection of entity entries associated with
  768. // the entity type.
  769. Entities []*GoogleCloudDialogflowV2EntityTypeEntity `json:"entities,omitempty"`
  770. // Kind: Required. Indicates the kind of entity type.
  771. //
  772. // Possible values:
  773. // "KIND_UNSPECIFIED" - Not specified. This value should be never
  774. // used.
  775. // "KIND_MAP" - Map entity types allow mapping of a group of synonyms
  776. // to a canonical
  777. // value.
  778. // "KIND_LIST" - List entity types contain a set of entries that do
  779. // not map to canonical
  780. // values. However, list entity types can contain references to other
  781. // entity
  782. // types (with or without aliases).
  783. Kind string `json:"kind,omitempty"`
  784. // Name: The unique identifier of the entity type.
  785. // Required for EntityTypes.UpdateEntityType
  786. // and
  787. // EntityTypes.BatchUpdateEntityTypes methods.
  788. // Format: `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.
  789. Name string `json:"name,omitempty"`
  790. // ServerResponse contains the HTTP response code and headers from the
  791. // server.
  792. googleapi.ServerResponse `json:"-"`
  793. // ForceSendFields is a list of field names (e.g. "AutoExpansionMode")
  794. // to unconditionally include in API requests. By default, fields with
  795. // empty values are omitted from API requests. However, any non-pointer,
  796. // non-interface field appearing in ForceSendFields will be sent to the
  797. // server regardless of whether the field is empty or not. This may be
  798. // used to include empty fields in Patch requests.
  799. ForceSendFields []string `json:"-"`
  800. // NullFields is a list of field names (e.g. "AutoExpansionMode") to
  801. // include in API requests with the JSON null value. By default, fields
  802. // with empty values are omitted from API requests. However, any field
  803. // with an empty value appearing in NullFields will be sent to the
  804. // server as null. It is an error if a field in this list has a
  805. // non-empty value. This may be used to include null fields in Patch
  806. // requests.
  807. NullFields []string `json:"-"`
  808. }
  809. func (s *GoogleCloudDialogflowV2EntityType) MarshalJSON() ([]byte, error) {
  810. type NoMethod GoogleCloudDialogflowV2EntityType
  811. raw := NoMethod(*s)
  812. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  813. }
  814. // GoogleCloudDialogflowV2EntityTypeBatch: This message is a wrapper
  815. // around a collection of entity types.
  816. type GoogleCloudDialogflowV2EntityTypeBatch struct {
  817. // EntityTypes: A collection of entity types.
  818. EntityTypes []*GoogleCloudDialogflowV2EntityType `json:"entityTypes,omitempty"`
  819. // ForceSendFields is a list of field names (e.g. "EntityTypes") to
  820. // unconditionally include in API requests. By default, fields with
  821. // empty values are omitted from API requests. However, any non-pointer,
  822. // non-interface field appearing in ForceSendFields will be sent to the
  823. // server regardless of whether the field is empty or not. This may be
  824. // used to include empty fields in Patch requests.
  825. ForceSendFields []string `json:"-"`
  826. // NullFields is a list of field names (e.g. "EntityTypes") to include
  827. // in API requests with the JSON null value. By default, fields with
  828. // empty values are omitted from API requests. However, any field with
  829. // an empty value appearing in NullFields will be sent to the server as
  830. // null. It is an error if a field in this list has a non-empty value.
  831. // This may be used to include null fields in Patch requests.
  832. NullFields []string `json:"-"`
  833. }
  834. func (s *GoogleCloudDialogflowV2EntityTypeBatch) MarshalJSON() ([]byte, error) {
  835. type NoMethod GoogleCloudDialogflowV2EntityTypeBatch
  836. raw := NoMethod(*s)
  837. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  838. }
  839. // GoogleCloudDialogflowV2EntityTypeEntity: An **entity entry** for an
  840. // associated entity type.
  841. type GoogleCloudDialogflowV2EntityTypeEntity struct {
  842. // Synonyms: Required. A collection of value synonyms. For example, if
  843. // the entity type
  844. // is *vegetable*, and `value` is *scallions*, a synonym could be
  845. // *green
  846. // onions*.
  847. //
  848. // For `KIND_LIST` entity types:
  849. //
  850. // * This collection must contain exactly one synonym equal to
  851. // `value`.
  852. Synonyms []string `json:"synonyms,omitempty"`
  853. // Value: Required. The primary value associated with this entity
  854. // entry.
  855. // For example, if the entity type is *vegetable*, the value could
  856. // be
  857. // *scallions*.
  858. //
  859. // For `KIND_MAP` entity types:
  860. //
  861. // * A canonical value to be used in place of synonyms.
  862. //
  863. // For `KIND_LIST` entity types:
  864. //
  865. // * A string that can contain references to other entity types (with
  866. // or
  867. // without aliases).
  868. Value string `json:"value,omitempty"`
  869. // ForceSendFields is a list of field names (e.g. "Synonyms") to
  870. // unconditionally include in API requests. By default, fields with
  871. // empty values are omitted from API requests. However, any non-pointer,
  872. // non-interface field appearing in ForceSendFields will be sent to the
  873. // server regardless of whether the field is empty or not. This may be
  874. // used to include empty fields in Patch requests.
  875. ForceSendFields []string `json:"-"`
  876. // NullFields is a list of field names (e.g. "Synonyms") to include in
  877. // API requests with the JSON null value. By default, fields with empty
  878. // values are omitted from API requests. However, any field with an
  879. // empty value appearing in NullFields will be sent to the server as
  880. // null. It is an error if a field in this list has a non-empty value.
  881. // This may be used to include null fields in Patch requests.
  882. NullFields []string `json:"-"`
  883. }
  884. func (s *GoogleCloudDialogflowV2EntityTypeEntity) MarshalJSON() ([]byte, error) {
  885. type NoMethod GoogleCloudDialogflowV2EntityTypeEntity
  886. raw := NoMethod(*s)
  887. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  888. }
  889. // GoogleCloudDialogflowV2EventInput: Events allow for matching intents
  890. // by event name instead of the natural
  891. // language input. For instance, input `<event: { name:
  892. // "welcome_event",
  893. // parameters: { name: "Sam" } }>` can trigger a personalized welcome
  894. // response.
  895. // The parameter `name` may be used by the agent in the
  896. // response:
  897. // "Hello #welcome_event.name! What can I do for you today?".
  898. type GoogleCloudDialogflowV2EventInput struct {
  899. // LanguageCode: Required. The language of this query. See
  900. // [Language
  901. // Support](https://dialogflow.com/docs/languages) for a list of
  902. // the
  903. // currently supported language codes. Note that queries in the same
  904. // session
  905. // do not necessarily need to specify the same language.
  906. LanguageCode string `json:"languageCode,omitempty"`
  907. // Name: Required. The unique identifier of the event.
  908. Name string `json:"name,omitempty"`
  909. // Parameters: Optional. The collection of parameters associated with
  910. // the event.
  911. Parameters googleapi.RawMessage `json:"parameters,omitempty"`
  912. // ForceSendFields is a list of field names (e.g. "LanguageCode") to
  913. // unconditionally include in API requests. By default, fields with
  914. // empty values are omitted from API requests. However, any non-pointer,
  915. // non-interface field appearing in ForceSendFields will be sent to the
  916. // server regardless of whether the field is empty or not. This may be
  917. // used to include empty fields in Patch requests.
  918. ForceSendFields []string `json:"-"`
  919. // NullFields is a list of field names (e.g. "LanguageCode") to include
  920. // in API requests with the JSON null value. By default, fields with
  921. // empty values are omitted from API requests. However, any field with
  922. // an empty value appearing in NullFields will be sent to the server as
  923. // null. It is an error if a field in this list has a non-empty value.
  924. // This may be used to include null fields in Patch requests.
  925. NullFields []string `json:"-"`
  926. }
  927. func (s *GoogleCloudDialogflowV2EventInput) MarshalJSON() ([]byte, error) {
  928. type NoMethod GoogleCloudDialogflowV2EventInput
  929. raw := NoMethod(*s)
  930. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  931. }
  932. // GoogleCloudDialogflowV2ExportAgentRequest: The request message for
  933. // Agents.ExportAgent.
  934. type GoogleCloudDialogflowV2ExportAgentRequest struct {
  935. // AgentUri: Optional. The
  936. // [Google Cloud Storage](https://cloud.google.com/storage/docs/)
  937. // URI to export the agent to.
  938. // The format of this URI must be `gs://<bucket-name>/<object-name>`.
  939. // If left unspecified, the serialized agent is returned inline.
  940. AgentUri string `json:"agentUri,omitempty"`
  941. // ForceSendFields is a list of field names (e.g. "AgentUri") to
  942. // unconditionally include in API requests. By default, fields with
  943. // empty values are omitted from API requests. However, any non-pointer,
  944. // non-interface field appearing in ForceSendFields will be sent to the
  945. // server regardless of whether the field is empty or not. This may be
  946. // used to include empty fields in Patch requests.
  947. ForceSendFields []string `json:"-"`
  948. // NullFields is a list of field names (e.g. "AgentUri") to include in
  949. // API requests with the JSON null value. By default, fields with empty
  950. // values are omitted from API requests. However, any field with an
  951. // empty value appearing in NullFields will be sent to the server as
  952. // null. It is an error if a field in this list has a non-empty value.
  953. // This may be used to include null fields in Patch requests.
  954. NullFields []string `json:"-"`
  955. }
  956. func (s *GoogleCloudDialogflowV2ExportAgentRequest) MarshalJSON() ([]byte, error) {
  957. type NoMethod GoogleCloudDialogflowV2ExportAgentRequest
  958. raw := NoMethod(*s)
  959. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  960. }
  961. // GoogleCloudDialogflowV2ExportAgentResponse: The response message for
  962. // Agents.ExportAgent.
  963. type GoogleCloudDialogflowV2ExportAgentResponse struct {
  964. // AgentContent: The exported agent.
  965. //
  966. // Example for how to export an agent to a zip file via a command
  967. // line:
  968. // <pre>curl \
  969. //
  970. // 'https://dialogflow.googleapis.com/v2/projects/&lt;project_name&gt;/ag
  971. // ent:export'\
  972. // -X POST \
  973. // -H 'Authorization: Bearer '$(gcloud auth application-default
  974. // print-access-token) \
  975. // -H 'Accept: application/json' \
  976. // -H 'Content-Type: application/json' \
  977. // --compressed \
  978. // --data-binary '{}' \
  979. // | grep agentContent | sed -e 's/.*"agentContent": "\([^"]*\)".*/\1/'
  980. // \
  981. // | base64 --decode > &lt;agent zip file&gt;</pre>
  982. AgentContent string `json:"agentContent,omitempty"`
  983. // AgentUri: The URI to a file containing the exported agent. This field
  984. // is populated
  985. // only if `agent_uri` is specified in `ExportAgentRequest`.
  986. AgentUri string `json:"agentUri,omitempty"`
  987. // ForceSendFields is a list of field names (e.g. "AgentContent") to
  988. // unconditionally include in API requests. By default, fields with
  989. // empty values are omitted from API requests. However, any non-pointer,
  990. // non-interface field appearing in ForceSendFields will be sent to the
  991. // server regardless of whether the field is empty or not. This may be
  992. // used to include empty fields in Patch requests.
  993. ForceSendFields []string `json:"-"`
  994. // NullFields is a list of field names (e.g. "AgentContent") to include
  995. // in API requests with the JSON null value. By default, fields with
  996. // empty values are omitted from API requests. However, any field with
  997. // an empty value appearing in NullFields will be sent to the server as
  998. // null. It is an error if a field in this list has a non-empty value.
  999. // This may be used to include null fields in Patch requests.
  1000. NullFields []string `json:"-"`
  1001. }
  1002. func (s *GoogleCloudDialogflowV2ExportAgentResponse) MarshalJSON() ([]byte, error) {
  1003. type NoMethod GoogleCloudDialogflowV2ExportAgentResponse
  1004. raw := NoMethod(*s)
  1005. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1006. }
  1007. // GoogleCloudDialogflowV2ImportAgentRequest: The request message for
  1008. // Agents.ImportAgent.
  1009. type GoogleCloudDialogflowV2ImportAgentRequest struct {
  1010. // AgentContent: The agent to import.
  1011. //
  1012. // Example for how to import an agent via the command line:
  1013. // <pre>curl \
  1014. //
  1015. // 'https://dialogflow.googleapis.com/v2/projects/&lt;project_name&gt;/ag
  1016. // ent:import\
  1017. // -X POST \
  1018. // -H 'Authorization: Bearer '$(gcloud auth application-default
  1019. // print-access-token) \
  1020. // -H 'Accept: application/json' \
  1021. // -H 'Content-Type: application/json' \
  1022. // --compressed \
  1023. // --data-binary "{
  1024. // 'agentContent': '$(cat &lt;agent zip file&gt; | base64 -w 0)'
  1025. // }"</pre>
  1026. AgentContent string `json:"agentContent,omitempty"`
  1027. // AgentUri: The URI to a Google Cloud Storage file containing the agent
  1028. // to import.
  1029. // Note: The URI must start with "gs://".
  1030. AgentUri string `json:"agentUri,omitempty"`
  1031. // ForceSendFields is a list of field names (e.g. "AgentContent") to
  1032. // unconditionally include in API requests. By default, fields with
  1033. // empty values are omitted from API requests. However, any non-pointer,
  1034. // non-interface field appearing in ForceSendFields will be sent to the
  1035. // server regardless of whether the field is empty or not. This may be
  1036. // used to include empty fields in Patch requests.
  1037. ForceSendFields []string `json:"-"`
  1038. // NullFields is a list of field names (e.g. "AgentContent") to include
  1039. // in API requests with the JSON null value. By default, fields with
  1040. // empty values are omitted from API requests. However, any field with
  1041. // an empty value appearing in NullFields will be sent to the server as
  1042. // null. It is an error if a field in this list has a non-empty value.
  1043. // This may be used to include null fields in Patch requests.
  1044. NullFields []string `json:"-"`
  1045. }
  1046. func (s *GoogleCloudDialogflowV2ImportAgentRequest) MarshalJSON() ([]byte, error) {
  1047. type NoMethod GoogleCloudDialogflowV2ImportAgentRequest
  1048. raw := NoMethod(*s)
  1049. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1050. }
  1051. // GoogleCloudDialogflowV2InputAudioConfig: Instructs the speech
  1052. // recognizer how to process the audio content.
  1053. type GoogleCloudDialogflowV2InputAudioConfig struct {
  1054. // AudioEncoding: Required. Audio encoding of the audio content to
  1055. // process.
  1056. //
  1057. // Possible values:
  1058. // "AUDIO_ENCODING_UNSPECIFIED" - Not specified.
  1059. // "AUDIO_ENCODING_LINEAR_16" - Uncompressed 16-bit signed
  1060. // little-endian samples (Linear PCM).
  1061. // "AUDIO_ENCODING_FLAC" -
  1062. // [`FLAC`](https://xiph.org/flac/documentation.html) (Free Lossless
  1063. // Audio
  1064. // Codec) is the recommended encoding because it is lossless
  1065. // (therefore
  1066. // recognition is not compromised) and requires only about half
  1067. // the
  1068. // bandwidth of `LINEAR16`. `FLAC` stream encoding supports 16-bit
  1069. // and
  1070. // 24-bit samples, however, not all fields in `STREAMINFO` are
  1071. // supported.
  1072. // "AUDIO_ENCODING_MULAW" - 8-bit samples that compand 14-bit audio
  1073. // samples using G.711 PCMU/mu-law.
  1074. // "AUDIO_ENCODING_AMR" - Adaptive Multi-Rate Narrowband codec.
  1075. // `sample_rate_hertz` must be 8000.
  1076. // "AUDIO_ENCODING_AMR_WB" - Adaptive Multi-Rate Wideband codec.
  1077. // `sample_rate_hertz` must be 16000.
  1078. // "AUDIO_ENCODING_OGG_OPUS" - Opus encoded audio frames in Ogg
  1079. // container
  1080. // ([OggOpus](https://wiki.xiph.org/OggOpus)).
  1081. // `sample_rate_her
  1082. // tz` must be 16000.
  1083. // "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE" - Although the use of lossy
  1084. // encodings is not recommended, if a very low
  1085. // bitrate encoding is required, `OGG_OPUS` is highly preferred
  1086. // over
  1087. // Speex encoding. The [Speex](https://speex.org/) encoding supported
  1088. // by
  1089. // Dialogflow API has a header byte in each block, as in MIME
  1090. // type
  1091. // `audio/x-speex-with-header-byte`.
  1092. // It is a variant of the RTP Speex encoding defined in
  1093. // [RFC 5574](https://tools.ietf.org/html/rfc5574).
  1094. // The stream is a sequence of blocks, one block per RTP packet. Each
  1095. // block
  1096. // starts with a byte containing the length of the block, in bytes,
  1097. // followed
  1098. // by one or more frames of Speex data, padded to an integral number
  1099. // of
  1100. // bytes (octets) as specified in RFC 5574. In other words, each RTP
  1101. // header
  1102. // is replaced with a single byte containing the block length. Only
  1103. // Speex
  1104. // wideband is supported. `sample_rate_hertz` must be 16000.
  1105. AudioEncoding string `json:"audioEncoding,omitempty"`
  1106. // LanguageCode: Required. The language of the supplied audio.
  1107. // Dialogflow does not do
  1108. // translations. See
  1109. // [Language
  1110. // Support](https://dialogflow.com/docs/languages) for a list of
  1111. // the
  1112. // currently supported language codes. Note that queries in the same
  1113. // session
  1114. // do not necessarily need to specify the same language.
  1115. LanguageCode string `json:"languageCode,omitempty"`
  1116. // PhraseHints: Optional. The collection of phrase hints which are used
  1117. // to boost accuracy
  1118. // of speech recognition.
  1119. // Refer to
  1120. // [Cloud Speech
  1121. // API
  1122. // documentation](https://cloud.google.com/speech-to-text/docs/basics
  1123. // #phrase-hints)
  1124. // for more details.
  1125. PhraseHints []string `json:"phraseHints,omitempty"`
  1126. // SampleRateHertz: Required. Sample rate (in Hertz) of the audio
  1127. // content sent in the query.
  1128. // Refer to
  1129. // [Cloud Speech
  1130. // API
  1131. // documentation](https://cloud.google.com/speech-to-text/docs/basics
  1132. // ) for
  1133. // more details.
  1134. SampleRateHertz int64 `json:"sampleRateHertz,omitempty"`
  1135. // ForceSendFields is a list of field names (e.g. "AudioEncoding") to
  1136. // unconditionally include in API requests. By default, fields with
  1137. // empty values are omitted from API requests. However, any non-pointer,
  1138. // non-interface field appearing in ForceSendFields will be sent to the
  1139. // server regardless of whether the field is empty or not. This may be
  1140. // used to include empty fields in Patch requests.
  1141. ForceSendFields []string `json:"-"`
  1142. // NullFields is a list of field names (e.g. "AudioEncoding") to include
  1143. // in API requests with the JSON null value. By default, fields with
  1144. // empty values are omitted from API requests. However, any field with
  1145. // an empty value appearing in NullFields will be sent to the server as
  1146. // null. It is an error if a field in this list has a non-empty value.
  1147. // This may be used to include null fields in Patch requests.
  1148. NullFields []string `json:"-"`
  1149. }
  1150. func (s *GoogleCloudDialogflowV2InputAudioConfig) MarshalJSON() ([]byte, error) {
  1151. type NoMethod GoogleCloudDialogflowV2InputAudioConfig
  1152. raw := NoMethod(*s)
  1153. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1154. }
  1155. // GoogleCloudDialogflowV2Intent: Represents an intent.
  1156. // Intents convert a number of user expressions or patterns into an
  1157. // action. An
  1158. // action is an extraction of a user command or sentence semantics.
  1159. type GoogleCloudDialogflowV2Intent struct {
  1160. // Action: Optional. The name of the action associated with the
  1161. // intent.
  1162. // Note: The action name must not contain whitespaces.
  1163. Action string `json:"action,omitempty"`
  1164. // DefaultResponsePlatforms: Optional. The list of platforms for which
  1165. // the first response will be
  1166. // taken from among the messages assigned to the DEFAULT_PLATFORM.
  1167. //
  1168. // Possible values:
  1169. // "PLATFORM_UNSPECIFIED" - Not specified.
  1170. // "FACEBOOK" - Facebook.
  1171. // "SLACK" - Slack.
  1172. // "TELEGRAM" - Telegram.
  1173. // "KIK" - Kik.
  1174. // "SKYPE" - Skype.
  1175. // "LINE" - Line.
  1176. // "VIBER" - Viber.
  1177. // "ACTIONS_ON_GOOGLE" - Actions on Google.
  1178. // When using Actions on Google, you can choose one of the
  1179. // specific
  1180. // Intent.Message types that mention support for Actions on Google,
  1181. // or you can use the advanced Intent.Message.payload field.
  1182. // The payload field provides access to AoG features not available in
  1183. // the
  1184. // specific message types.
  1185. // If using the Intent.Message.payload field, it should have a
  1186. // structure
  1187. // similar to the JSON message shown here. For more information,
  1188. // see
  1189. // [Actions on Google
  1190. // Webhook
  1191. // Format](https://developers.google.com/actions/dialogflow/webho
  1192. // ok)
  1193. // <pre>{
  1194. // "expectUserResponse": true,
  1195. // "isSsml": false,
  1196. // "noInputPrompts": [],
  1197. // "richResponse": {
  1198. // "items": [
  1199. // {
  1200. // "simpleResponse": {
  1201. // "displayText": "hi",
  1202. // "textToSpeech": "hello"
  1203. // }
  1204. // }
  1205. // ],
  1206. // "suggestions": [
  1207. // {
  1208. // "title": "Say this"
  1209. // },
  1210. // {
  1211. // "title": "or this"
  1212. // }
  1213. // ]
  1214. // },
  1215. // "systemIntent": {
  1216. // "data": {
  1217. // "@type":
  1218. // "type.googleapis.com/google.actions.v2.OptionValueSpec",
  1219. // "listSelect": {
  1220. // "items": [
  1221. // {
  1222. // "optionInfo": {
  1223. // "key": "key1",
  1224. // "synonyms": [
  1225. // "key one"
  1226. // ]
  1227. // },
  1228. // "title": "must not be empty, but unique"
  1229. // },
  1230. // {
  1231. // "optionInfo": {
  1232. // "key": "key2",
  1233. // "synonyms": [
  1234. // "key two"
  1235. // ]
  1236. // },
  1237. // "title": "must not be empty, but unique"
  1238. // }
  1239. // ]
  1240. // }
  1241. // },
  1242. // "intent": "actions.intent.OPTION"
  1243. // }
  1244. // }</pre>
  1245. DefaultResponsePlatforms []string `json:"defaultResponsePlatforms,omitempty"`
  1246. // DisplayName: Required. The name of this intent.
  1247. DisplayName string `json:"displayName,omitempty"`
  1248. // Events: Optional. The collection of event names that trigger the
  1249. // intent.
  1250. // If the collection of input contexts is not empty, all of the contexts
  1251. // must
  1252. // be present in the active user session for an event to trigger this
  1253. // intent.
  1254. Events []string `json:"events,omitempty"`
  1255. // FollowupIntentInfo: Read-only. Information about all followup intents
  1256. // that have this intent as
  1257. // a direct or indirect parent. We populate this field only in the
  1258. // output.
  1259. FollowupIntentInfo []*GoogleCloudDialogflowV2IntentFollowupIntentInfo `json:"followupIntentInfo,omitempty"`
  1260. // InputContextNames: Optional. The list of context names required for
  1261. // this intent to be
  1262. // triggered.
  1263. // Format: `projects/<Project ID>/agent/sessions/-/contexts/<Context
  1264. // ID>`.
  1265. InputContextNames []string `json:"inputContextNames,omitempty"`
  1266. // IsFallback: Optional. Indicates whether this is a fallback intent.
  1267. IsFallback bool `json:"isFallback,omitempty"`
  1268. // Messages: Optional. The collection of rich messages corresponding to
  1269. // the
  1270. // `Response` field in the Dialogflow console.
  1271. Messages []*GoogleCloudDialogflowV2IntentMessage `json:"messages,omitempty"`
  1272. // MlDisabled: Optional. Indicates whether Machine Learning is disabled
  1273. // for the intent.
  1274. // Note: If `ml_diabled` setting is set to true, then this intent is
  1275. // not
  1276. // taken into account during inference in `ML ONLY` match mode.
  1277. // Also,
  1278. // auto-markup in the UI is turned off.
  1279. MlDisabled bool `json:"mlDisabled,omitempty"`
  1280. // Name: The unique identifier of this intent.
  1281. // Required for Intents.UpdateIntent and
  1282. // Intents.BatchUpdateIntents
  1283. // methods.
  1284. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  1285. Name string `json:"name,omitempty"`
  1286. // OutputContexts: Optional. The collection of contexts that are
  1287. // activated when the intent
  1288. // is matched. Context messages in this collection should not set
  1289. // the
  1290. // parameters field. Setting the `lifespan_count` to 0 will reset the
  1291. // context
  1292. // when the intent is matched.
  1293. // Format: `projects/<Project ID>/agent/sessions/-/contexts/<Context
  1294. // ID>`.
  1295. OutputContexts []*GoogleCloudDialogflowV2Context `json:"outputContexts,omitempty"`
  1296. // Parameters: Optional. The collection of parameters associated with
  1297. // the intent.
  1298. Parameters []*GoogleCloudDialogflowV2IntentParameter `json:"parameters,omitempty"`
  1299. // ParentFollowupIntentName: Read-only after creation. The unique
  1300. // identifier of the parent intent in the
  1301. // chain of followup intents. You can set this field when creating an
  1302. // intent,
  1303. // for example with CreateIntent or BatchUpdateIntents, in order to
  1304. // make this intent a followup intent.
  1305. //
  1306. // It identifies the parent followup intent.
  1307. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  1308. ParentFollowupIntentName string `json:"parentFollowupIntentName,omitempty"`
  1309. // Priority: Optional. The priority of this intent. Higher numbers
  1310. // represent higher
  1311. // priorities. If this is zero or unspecified, we use the
  1312. // default
  1313. // priority 500000.
  1314. //
  1315. // Negative numbers mean that the intent is disabled.
  1316. Priority int64 `json:"priority,omitempty"`
  1317. // ResetContexts: Optional. Indicates whether to delete all contexts in
  1318. // the current
  1319. // session when this intent is matched.
  1320. ResetContexts bool `json:"resetContexts,omitempty"`
  1321. // RootFollowupIntentName: Read-only. The unique identifier of the root
  1322. // intent in the chain of
  1323. // followup intents. It identifies the correct followup intents chain
  1324. // for
  1325. // this intent. We populate this field only in the output.
  1326. //
  1327. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  1328. RootFollowupIntentName string `json:"rootFollowupIntentName,omitempty"`
  1329. // TrainingPhrases: Optional. The collection of examples that the agent
  1330. // is
  1331. // trained on.
  1332. TrainingPhrases []*GoogleCloudDialogflowV2IntentTrainingPhrase `json:"trainingPhrases,omitempty"`
  1333. // WebhookState: Optional. Indicates whether webhooks are enabled for
  1334. // the intent.
  1335. //
  1336. // Possible values:
  1337. // "WEBHOOK_STATE_UNSPECIFIED" - Webhook is disabled in the agent and
  1338. // in the intent.
  1339. // "WEBHOOK_STATE_ENABLED" - Webhook is enabled in the agent and in
  1340. // the intent.
  1341. // "WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING" - Webhook is enabled in
  1342. // the agent and in the intent. Also, each slot
  1343. // filling prompt is forwarded to the webhook.
  1344. WebhookState string `json:"webhookState,omitempty"`
  1345. // ServerResponse contains the HTTP response code and headers from the
  1346. // server.
  1347. googleapi.ServerResponse `json:"-"`
  1348. // ForceSendFields is a list of field names (e.g. "Action") to
  1349. // unconditionally include in API requests. By default, fields with
  1350. // empty values are omitted from API requests. However, any non-pointer,
  1351. // non-interface field appearing in ForceSendFields will be sent to the
  1352. // server regardless of whether the field is empty or not. This may be
  1353. // used to include empty fields in Patch requests.
  1354. ForceSendFields []string `json:"-"`
  1355. // NullFields is a list of field names (e.g. "Action") to include in API
  1356. // requests with the JSON null value. By default, fields with empty
  1357. // values are omitted from API requests. However, any field with an
  1358. // empty value appearing in NullFields will be sent to the server as
  1359. // null. It is an error if a field in this list has a non-empty value.
  1360. // This may be used to include null fields in Patch requests.
  1361. NullFields []string `json:"-"`
  1362. }
  1363. func (s *GoogleCloudDialogflowV2Intent) MarshalJSON() ([]byte, error) {
  1364. type NoMethod GoogleCloudDialogflowV2Intent
  1365. raw := NoMethod(*s)
  1366. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1367. }
  1368. // GoogleCloudDialogflowV2IntentBatch: This message is a wrapper around
  1369. // a collection of intents.
  1370. type GoogleCloudDialogflowV2IntentBatch struct {
  1371. // Intents: A collection of intents.
  1372. Intents []*GoogleCloudDialogflowV2Intent `json:"intents,omitempty"`
  1373. // ForceSendFields is a list of field names (e.g. "Intents") to
  1374. // unconditionally include in API requests. By default, fields with
  1375. // empty values are omitted from API requests. However, any non-pointer,
  1376. // non-interface field appearing in ForceSendFields will be sent to the
  1377. // server regardless of whether the field is empty or not. This may be
  1378. // used to include empty fields in Patch requests.
  1379. ForceSendFields []string `json:"-"`
  1380. // NullFields is a list of field names (e.g. "Intents") to include in
  1381. // API requests with the JSON null value. By default, fields with empty
  1382. // values are omitted from API requests. However, any field with an
  1383. // empty value appearing in NullFields will be sent to the server as
  1384. // null. It is an error if a field in this list has a non-empty value.
  1385. // This may be used to include null fields in Patch requests.
  1386. NullFields []string `json:"-"`
  1387. }
  1388. func (s *GoogleCloudDialogflowV2IntentBatch) MarshalJSON() ([]byte, error) {
  1389. type NoMethod GoogleCloudDialogflowV2IntentBatch
  1390. raw := NoMethod(*s)
  1391. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1392. }
  1393. // GoogleCloudDialogflowV2IntentFollowupIntentInfo: Represents a single
  1394. // followup intent in the chain.
  1395. type GoogleCloudDialogflowV2IntentFollowupIntentInfo struct {
  1396. // FollowupIntentName: The unique identifier of the followup
  1397. // intent.
  1398. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  1399. FollowupIntentName string `json:"followupIntentName,omitempty"`
  1400. // ParentFollowupIntentName: The unique identifier of the followup
  1401. // intent's parent.
  1402. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  1403. ParentFollowupIntentName string `json:"parentFollowupIntentName,omitempty"`
  1404. // ForceSendFields is a list of field names (e.g. "FollowupIntentName")
  1405. // to 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. // NullFields is a list of field names (e.g. "FollowupIntentName") to
  1412. // include in API requests with the JSON null value. By default, fields
  1413. // with empty values are omitted from API requests. However, any field
  1414. // with an empty value appearing in NullFields will be sent to the
  1415. // server as null. It is an error if a field in this list has a
  1416. // non-empty value. This may be used to include null fields in Patch
  1417. // requests.
  1418. NullFields []string `json:"-"`
  1419. }
  1420. func (s *GoogleCloudDialogflowV2IntentFollowupIntentInfo) MarshalJSON() ([]byte, error) {
  1421. type NoMethod GoogleCloudDialogflowV2IntentFollowupIntentInfo
  1422. raw := NoMethod(*s)
  1423. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1424. }
  1425. // GoogleCloudDialogflowV2IntentMessage: Corresponds to the `Response`
  1426. // field in the Dialogflow console.
  1427. type GoogleCloudDialogflowV2IntentMessage struct {
  1428. // BasicCard: The basic card response for Actions on Google.
  1429. BasicCard *GoogleCloudDialogflowV2IntentMessageBasicCard `json:"basicCard,omitempty"`
  1430. // Card: The card response.
  1431. Card *GoogleCloudDialogflowV2IntentMessageCard `json:"card,omitempty"`
  1432. // CarouselSelect: The carousel card response for Actions on Google.
  1433. CarouselSelect *GoogleCloudDialogflowV2IntentMessageCarouselSelect `json:"carouselSelect,omitempty"`
  1434. // Image: The image response.
  1435. Image *GoogleCloudDialogflowV2IntentMessageImage `json:"image,omitempty"`
  1436. // LinkOutSuggestion: The link out suggestion chip for Actions on
  1437. // Google.
  1438. LinkOutSuggestion *GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion `json:"linkOutSuggestion,omitempty"`
  1439. // ListSelect: The list card response for Actions on Google.
  1440. ListSelect *GoogleCloudDialogflowV2IntentMessageListSelect `json:"listSelect,omitempty"`
  1441. // Payload: Returns a response containing a custom, platform-specific
  1442. // payload.
  1443. // See the Intent.Message.Platform type for a description of
  1444. // the
  1445. // structure that may be required for your platform.
  1446. Payload googleapi.RawMessage `json:"payload,omitempty"`
  1447. // Platform: Optional. The platform that this message is intended for.
  1448. //
  1449. // Possible values:
  1450. // "PLATFORM_UNSPECIFIED" - Not specified.
  1451. // "FACEBOOK" - Facebook.
  1452. // "SLACK" - Slack.
  1453. // "TELEGRAM" - Telegram.
  1454. // "KIK" - Kik.
  1455. // "SKYPE" - Skype.
  1456. // "LINE" - Line.
  1457. // "VIBER" - Viber.
  1458. // "ACTIONS_ON_GOOGLE" - Actions on Google.
  1459. // When using Actions on Google, you can choose one of the
  1460. // specific
  1461. // Intent.Message types that mention support for Actions on Google,
  1462. // or you can use the advanced Intent.Message.payload field.
  1463. // The payload field provides access to AoG features not available in
  1464. // the
  1465. // specific message types.
  1466. // If using the Intent.Message.payload field, it should have a
  1467. // structure
  1468. // similar to the JSON message shown here. For more information,
  1469. // see
  1470. // [Actions on Google
  1471. // Webhook
  1472. // Format](https://developers.google.com/actions/dialogflow/webho
  1473. // ok)
  1474. // <pre>{
  1475. // "expectUserResponse": true,
  1476. // "isSsml": false,
  1477. // "noInputPrompts": [],
  1478. // "richResponse": {
  1479. // "items": [
  1480. // {
  1481. // "simpleResponse": {
  1482. // "displayText": "hi",
  1483. // "textToSpeech": "hello"
  1484. // }
  1485. // }
  1486. // ],
  1487. // "suggestions": [
  1488. // {
  1489. // "title": "Say this"
  1490. // },
  1491. // {
  1492. // "title": "or this"
  1493. // }
  1494. // ]
  1495. // },
  1496. // "systemIntent": {
  1497. // "data": {
  1498. // "@type":
  1499. // "type.googleapis.com/google.actions.v2.OptionValueSpec",
  1500. // "listSelect": {
  1501. // "items": [
  1502. // {
  1503. // "optionInfo": {
  1504. // "key": "key1",
  1505. // "synonyms": [
  1506. // "key one"
  1507. // ]
  1508. // },
  1509. // "title": "must not be empty, but unique"
  1510. // },
  1511. // {
  1512. // "optionInfo": {
  1513. // "key": "key2",
  1514. // "synonyms": [
  1515. // "key two"
  1516. // ]
  1517. // },
  1518. // "title": "must not be empty, but unique"
  1519. // }
  1520. // ]
  1521. // }
  1522. // },
  1523. // "intent": "actions.intent.OPTION"
  1524. // }
  1525. // }</pre>
  1526. Platform string `json:"platform,omitempty"`
  1527. // QuickReplies: The quick replies response.
  1528. QuickReplies *GoogleCloudDialogflowV2IntentMessageQuickReplies `json:"quickReplies,omitempty"`
  1529. // SimpleResponses: The voice and text-only responses for Actions on
  1530. // Google.
  1531. SimpleResponses *GoogleCloudDialogflowV2IntentMessageSimpleResponses `json:"simpleResponses,omitempty"`
  1532. // Suggestions: The suggestion chips for Actions on Google.
  1533. Suggestions *GoogleCloudDialogflowV2IntentMessageSuggestions `json:"suggestions,omitempty"`
  1534. // Text: The text response.
  1535. Text *GoogleCloudDialogflowV2IntentMessageText `json:"text,omitempty"`
  1536. // ForceSendFields is a list of field names (e.g. "BasicCard") to
  1537. // unconditionally include in API requests. By default, fields with
  1538. // empty values are omitted from API requests. However, any non-pointer,
  1539. // non-interface field appearing in ForceSendFields will be sent to the
  1540. // server regardless of whether the field is empty or not. This may be
  1541. // used to include empty fields in Patch requests.
  1542. ForceSendFields []string `json:"-"`
  1543. // NullFields is a list of field names (e.g. "BasicCard") to include in
  1544. // API requests with the JSON null value. By default, fields with empty
  1545. // values are omitted from API requests. However, any field with an
  1546. // empty value appearing in NullFields will be sent to the server as
  1547. // null. It is an error if a field in this list has a non-empty value.
  1548. // This may be used to include null fields in Patch requests.
  1549. NullFields []string `json:"-"`
  1550. }
  1551. func (s *GoogleCloudDialogflowV2IntentMessage) MarshalJSON() ([]byte, error) {
  1552. type NoMethod GoogleCloudDialogflowV2IntentMessage
  1553. raw := NoMethod(*s)
  1554. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1555. }
  1556. // GoogleCloudDialogflowV2IntentMessageBasicCard: The basic card
  1557. // message. Useful for displaying information.
  1558. type GoogleCloudDialogflowV2IntentMessageBasicCard struct {
  1559. // Buttons: Optional. The collection of card buttons.
  1560. Buttons []*GoogleCloudDialogflowV2IntentMessageBasicCardButton `json:"buttons,omitempty"`
  1561. // FormattedText: Required, unless image is present. The body text of
  1562. // the card.
  1563. FormattedText string `json:"formattedText,omitempty"`
  1564. // Image: Optional. The image for the card.
  1565. Image *GoogleCloudDialogflowV2IntentMessageImage `json:"image,omitempty"`
  1566. // Subtitle: Optional. The subtitle of the card.
  1567. Subtitle string `json:"subtitle,omitempty"`
  1568. // Title: Optional. The title of the card.
  1569. Title string `json:"title,omitempty"`
  1570. // ForceSendFields is a list of field names (e.g. "Buttons") to
  1571. // unconditionally include in API requests. By default, fields with
  1572. // empty values are omitted from API requests. However, any non-pointer,
  1573. // non-interface field appearing in ForceSendFields will be sent to the
  1574. // server regardless of whether the field is empty or not. This may be
  1575. // used to include empty fields in Patch requests.
  1576. ForceSendFields []string `json:"-"`
  1577. // NullFields is a list of field names (e.g. "Buttons") to include in
  1578. // API requests with the JSON null value. By default, fields with empty
  1579. // values are omitted from API requests. However, any field with an
  1580. // empty value appearing in NullFields will be sent to the server as
  1581. // null. It is an error if a field in this list has a non-empty value.
  1582. // This may be used to include null fields in Patch requests.
  1583. NullFields []string `json:"-"`
  1584. }
  1585. func (s *GoogleCloudDialogflowV2IntentMessageBasicCard) MarshalJSON() ([]byte, error) {
  1586. type NoMethod GoogleCloudDialogflowV2IntentMessageBasicCard
  1587. raw := NoMethod(*s)
  1588. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1589. }
  1590. // GoogleCloudDialogflowV2IntentMessageBasicCardButton: The button
  1591. // object that appears at the bottom of a card.
  1592. type GoogleCloudDialogflowV2IntentMessageBasicCardButton struct {
  1593. // OpenUriAction: Required. Action to take when a user taps on the
  1594. // button.
  1595. OpenUriAction *GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction `json:"openUriAction,omitempty"`
  1596. // Title: Required. The title of the button.
  1597. Title string `json:"title,omitempty"`
  1598. // ForceSendFields is a list of field names (e.g. "OpenUriAction") to
  1599. // unconditionally include in API requests. By default, fields with
  1600. // empty values are omitted from API requests. However, any non-pointer,
  1601. // non-interface field appearing in ForceSendFields will be sent to the
  1602. // server regardless of whether the field is empty or not. This may be
  1603. // used to include empty fields in Patch requests.
  1604. ForceSendFields []string `json:"-"`
  1605. // NullFields is a list of field names (e.g. "OpenUriAction") to include
  1606. // in API requests with the JSON null value. By default, fields with
  1607. // empty values are omitted from API requests. However, any field with
  1608. // an empty value appearing in NullFields will be sent to the server as
  1609. // null. It is an error if a field in this list has a non-empty value.
  1610. // This may be used to include null fields in Patch requests.
  1611. NullFields []string `json:"-"`
  1612. }
  1613. func (s *GoogleCloudDialogflowV2IntentMessageBasicCardButton) MarshalJSON() ([]byte, error) {
  1614. type NoMethod GoogleCloudDialogflowV2IntentMessageBasicCardButton
  1615. raw := NoMethod(*s)
  1616. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1617. }
  1618. // GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction:
  1619. // Opens the given URI.
  1620. type GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction struct {
  1621. // Uri: Required. The HTTP or HTTPS scheme URI.
  1622. Uri string `json:"uri,omitempty"`
  1623. // ForceSendFields is a list of field names (e.g. "Uri") to
  1624. // unconditionally include in API requests. By default, fields with
  1625. // empty values are omitted from API requests. However, any non-pointer,
  1626. // non-interface field appearing in ForceSendFields will be sent to the
  1627. // server regardless of whether the field is empty or not. This may be
  1628. // used to include empty fields in Patch requests.
  1629. ForceSendFields []string `json:"-"`
  1630. // NullFields is a list of field names (e.g. "Uri") to include in API
  1631. // requests with the JSON null value. By default, fields with empty
  1632. // values are omitted from API requests. However, any field with an
  1633. // empty value appearing in NullFields will be sent to the server as
  1634. // null. It is an error if a field in this list has a non-empty value.
  1635. // This may be used to include null fields in Patch requests.
  1636. NullFields []string `json:"-"`
  1637. }
  1638. func (s *GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction) MarshalJSON() ([]byte, error) {
  1639. type NoMethod GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction
  1640. raw := NoMethod(*s)
  1641. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1642. }
  1643. // GoogleCloudDialogflowV2IntentMessageCard: The card response message.
  1644. type GoogleCloudDialogflowV2IntentMessageCard struct {
  1645. // Buttons: Optional. The collection of card buttons.
  1646. Buttons []*GoogleCloudDialogflowV2IntentMessageCardButton `json:"buttons,omitempty"`
  1647. // ImageUri: Optional. The public URI to an image file for the card.
  1648. ImageUri string `json:"imageUri,omitempty"`
  1649. // Subtitle: Optional. The subtitle of the card.
  1650. Subtitle string `json:"subtitle,omitempty"`
  1651. // Title: Optional. The title of the card.
  1652. Title string `json:"title,omitempty"`
  1653. // ForceSendFields is a list of field names (e.g. "Buttons") to
  1654. // unconditionally include in API requests. By default, fields with
  1655. // empty values are omitted from API requests. However, any non-pointer,
  1656. // non-interface field appearing in ForceSendFields will be sent to the
  1657. // server regardless of whether the field is empty or not. This may be
  1658. // used to include empty fields in Patch requests.
  1659. ForceSendFields []string `json:"-"`
  1660. // NullFields is a list of field names (e.g. "Buttons") to include in
  1661. // API requests with the JSON null value. By default, fields with empty
  1662. // values are omitted from API requests. However, any field with an
  1663. // empty value appearing in NullFields will be sent to the server as
  1664. // null. It is an error if a field in this list has a non-empty value.
  1665. // This may be used to include null fields in Patch requests.
  1666. NullFields []string `json:"-"`
  1667. }
  1668. func (s *GoogleCloudDialogflowV2IntentMessageCard) MarshalJSON() ([]byte, error) {
  1669. type NoMethod GoogleCloudDialogflowV2IntentMessageCard
  1670. raw := NoMethod(*s)
  1671. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1672. }
  1673. // GoogleCloudDialogflowV2IntentMessageCardButton: Optional. Contains
  1674. // information about a button.
  1675. type GoogleCloudDialogflowV2IntentMessageCardButton struct {
  1676. // Postback: Optional. The text to send back to the Dialogflow API or a
  1677. // URI to
  1678. // open.
  1679. Postback string `json:"postback,omitempty"`
  1680. // Text: Optional. The text to show on the button.
  1681. Text string `json:"text,omitempty"`
  1682. // ForceSendFields is a list of field names (e.g. "Postback") to
  1683. // unconditionally include in API requests. By default, fields with
  1684. // empty values are omitted from API requests. However, any non-pointer,
  1685. // non-interface field appearing in ForceSendFields will be sent to the
  1686. // server regardless of whether the field is empty or not. This may be
  1687. // used to include empty fields in Patch requests.
  1688. ForceSendFields []string `json:"-"`
  1689. // NullFields is a list of field names (e.g. "Postback") to include in
  1690. // API requests with the JSON null value. By default, fields with empty
  1691. // values are omitted from API requests. However, any field with an
  1692. // empty value appearing in NullFields will be sent to the server as
  1693. // null. It is an error if a field in this list has a non-empty value.
  1694. // This may be used to include null fields in Patch requests.
  1695. NullFields []string `json:"-"`
  1696. }
  1697. func (s *GoogleCloudDialogflowV2IntentMessageCardButton) MarshalJSON() ([]byte, error) {
  1698. type NoMethod GoogleCloudDialogflowV2IntentMessageCardButton
  1699. raw := NoMethod(*s)
  1700. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1701. }
  1702. // GoogleCloudDialogflowV2IntentMessageCarouselSelect: The card for
  1703. // presenting a carousel of options to select from.
  1704. type GoogleCloudDialogflowV2IntentMessageCarouselSelect struct {
  1705. // Items: Required. Carousel items.
  1706. Items []*GoogleCloudDialogflowV2IntentMessageCarouselSelectItem `json:"items,omitempty"`
  1707. // ForceSendFields is a list of field names (e.g. "Items") to
  1708. // unconditionally include in API requests. By default, fields with
  1709. // empty values are omitted from API requests. However, any non-pointer,
  1710. // non-interface field appearing in ForceSendFields will be sent to the
  1711. // server regardless of whether the field is empty or not. This may be
  1712. // used to include empty fields in Patch requests.
  1713. ForceSendFields []string `json:"-"`
  1714. // NullFields is a list of field names (e.g. "Items") to include in API
  1715. // requests with the JSON null value. By default, fields with empty
  1716. // values are omitted from API requests. However, any field with an
  1717. // empty value appearing in NullFields will be sent to the server as
  1718. // null. It is an error if a field in this list has a non-empty value.
  1719. // This may be used to include null fields in Patch requests.
  1720. NullFields []string `json:"-"`
  1721. }
  1722. func (s *GoogleCloudDialogflowV2IntentMessageCarouselSelect) MarshalJSON() ([]byte, error) {
  1723. type NoMethod GoogleCloudDialogflowV2IntentMessageCarouselSelect
  1724. raw := NoMethod(*s)
  1725. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1726. }
  1727. // GoogleCloudDialogflowV2IntentMessageCarouselSelectItem: An item in
  1728. // the carousel.
  1729. type GoogleCloudDialogflowV2IntentMessageCarouselSelectItem struct {
  1730. // Description: Optional. The body text of the card.
  1731. Description string `json:"description,omitempty"`
  1732. // Image: Optional. The image to display.
  1733. Image *GoogleCloudDialogflowV2IntentMessageImage `json:"image,omitempty"`
  1734. // Info: Required. Additional info about the option item.
  1735. Info *GoogleCloudDialogflowV2IntentMessageSelectItemInfo `json:"info,omitempty"`
  1736. // Title: Required. Title of the carousel item.
  1737. Title string `json:"title,omitempty"`
  1738. // ForceSendFields is a list of field names (e.g. "Description") to
  1739. // unconditionally include in API requests. By default, fields with
  1740. // empty values are omitted from API requests. However, any non-pointer,
  1741. // non-interface field appearing in ForceSendFields will be sent to the
  1742. // server regardless of whether the field is empty or not. This may be
  1743. // used to include empty fields in Patch requests.
  1744. ForceSendFields []string `json:"-"`
  1745. // NullFields is a list of field names (e.g. "Description") to include
  1746. // in API requests with the JSON null value. By default, fields with
  1747. // empty values are omitted from API requests. However, any field with
  1748. // an empty value appearing in NullFields will be sent to the server as
  1749. // null. It is an error if a field in this list has a non-empty value.
  1750. // This may be used to include null fields in Patch requests.
  1751. NullFields []string `json:"-"`
  1752. }
  1753. func (s *GoogleCloudDialogflowV2IntentMessageCarouselSelectItem) MarshalJSON() ([]byte, error) {
  1754. type NoMethod GoogleCloudDialogflowV2IntentMessageCarouselSelectItem
  1755. raw := NoMethod(*s)
  1756. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1757. }
  1758. // GoogleCloudDialogflowV2IntentMessageImage: The image response
  1759. // message.
  1760. type GoogleCloudDialogflowV2IntentMessageImage struct {
  1761. // AccessibilityText: Optional. A text description of the image to be
  1762. // used for accessibility,
  1763. // e.g., screen readers.
  1764. AccessibilityText string `json:"accessibilityText,omitempty"`
  1765. // ImageUri: Optional. The public URI to an image file.
  1766. ImageUri string `json:"imageUri,omitempty"`
  1767. // ForceSendFields is a list of field names (e.g. "AccessibilityText")
  1768. // to unconditionally include in API requests. By default, fields with
  1769. // empty values are omitted from API requests. However, any non-pointer,
  1770. // non-interface field appearing in ForceSendFields will be sent to the
  1771. // server regardless of whether the field is empty or not. This may be
  1772. // used to include empty fields in Patch requests.
  1773. ForceSendFields []string `json:"-"`
  1774. // NullFields is a list of field names (e.g. "AccessibilityText") to
  1775. // include in API requests with the JSON null value. By default, fields
  1776. // with empty values are omitted from API requests. However, any field
  1777. // with an empty value appearing in NullFields will be sent to the
  1778. // server as null. It is an error if a field in this list has a
  1779. // non-empty value. This may be used to include null fields in Patch
  1780. // requests.
  1781. NullFields []string `json:"-"`
  1782. }
  1783. func (s *GoogleCloudDialogflowV2IntentMessageImage) MarshalJSON() ([]byte, error) {
  1784. type NoMethod GoogleCloudDialogflowV2IntentMessageImage
  1785. raw := NoMethod(*s)
  1786. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1787. }
  1788. // GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion: The suggestion
  1789. // chip message that allows the user to jump out to the app
  1790. // or website associated with this agent.
  1791. type GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion struct {
  1792. // DestinationName: Required. The name of the app or site this chip is
  1793. // linking to.
  1794. DestinationName string `json:"destinationName,omitempty"`
  1795. // Uri: Required. The URI of the app or site to open when the user taps
  1796. // the
  1797. // suggestion chip.
  1798. Uri string `json:"uri,omitempty"`
  1799. // ForceSendFields is a list of field names (e.g. "DestinationName") to
  1800. // unconditionally include in API requests. By default, fields with
  1801. // empty values are omitted from API requests. However, any non-pointer,
  1802. // non-interface field appearing in ForceSendFields will be sent to the
  1803. // server regardless of whether the field is empty or not. This may be
  1804. // used to include empty fields in Patch requests.
  1805. ForceSendFields []string `json:"-"`
  1806. // NullFields is a list of field names (e.g. "DestinationName") to
  1807. // include in API requests with the JSON null value. By default, fields
  1808. // with empty values are omitted from API requests. However, any field
  1809. // with an empty value appearing in NullFields will be sent to the
  1810. // server as null. It is an error if a field in this list has a
  1811. // non-empty value. This may be used to include null fields in Patch
  1812. // requests.
  1813. NullFields []string `json:"-"`
  1814. }
  1815. func (s *GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion) MarshalJSON() ([]byte, error) {
  1816. type NoMethod GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion
  1817. raw := NoMethod(*s)
  1818. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1819. }
  1820. // GoogleCloudDialogflowV2IntentMessageListSelect: The card for
  1821. // presenting a list of options to select from.
  1822. type GoogleCloudDialogflowV2IntentMessageListSelect struct {
  1823. // Items: Required. List items.
  1824. Items []*GoogleCloudDialogflowV2IntentMessageListSelectItem `json:"items,omitempty"`
  1825. // Title: Optional. The overall title of the list.
  1826. Title string `json:"title,omitempty"`
  1827. // ForceSendFields is a list of field names (e.g. "Items") to
  1828. // unconditionally include in API requests. By default, fields with
  1829. // empty values are omitted from API requests. However, any non-pointer,
  1830. // non-interface field appearing in ForceSendFields will be sent to the
  1831. // server regardless of whether the field is empty or not. This may be
  1832. // used to include empty fields in Patch requests.
  1833. ForceSendFields []string `json:"-"`
  1834. // NullFields is a list of field names (e.g. "Items") to include in API
  1835. // requests with the JSON null value. By default, fields with empty
  1836. // values are omitted from API requests. However, any field with an
  1837. // empty value appearing in NullFields will be sent to the server as
  1838. // null. It is an error if a field in this list has a non-empty value.
  1839. // This may be used to include null fields in Patch requests.
  1840. NullFields []string `json:"-"`
  1841. }
  1842. func (s *GoogleCloudDialogflowV2IntentMessageListSelect) MarshalJSON() ([]byte, error) {
  1843. type NoMethod GoogleCloudDialogflowV2IntentMessageListSelect
  1844. raw := NoMethod(*s)
  1845. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1846. }
  1847. // GoogleCloudDialogflowV2IntentMessageListSelectItem: An item in the
  1848. // list.
  1849. type GoogleCloudDialogflowV2IntentMessageListSelectItem struct {
  1850. // Description: Optional. The main text describing the item.
  1851. Description string `json:"description,omitempty"`
  1852. // Image: Optional. The image to display.
  1853. Image *GoogleCloudDialogflowV2IntentMessageImage `json:"image,omitempty"`
  1854. // Info: Required. Additional information about this option.
  1855. Info *GoogleCloudDialogflowV2IntentMessageSelectItemInfo `json:"info,omitempty"`
  1856. // Title: Required. The title of the list item.
  1857. Title string `json:"title,omitempty"`
  1858. // ForceSendFields is a list of field names (e.g. "Description") to
  1859. // unconditionally include in API requests. By default, fields with
  1860. // empty values are omitted from API requests. However, any non-pointer,
  1861. // non-interface field appearing in ForceSendFields will be sent to the
  1862. // server regardless of whether the field is empty or not. This may be
  1863. // used to include empty fields in Patch requests.
  1864. ForceSendFields []string `json:"-"`
  1865. // NullFields is a list of field names (e.g. "Description") to include
  1866. // in API requests with the JSON null value. By default, fields with
  1867. // empty values are omitted from API requests. However, any field with
  1868. // an empty value appearing in NullFields will be sent to the server as
  1869. // null. It is an error if a field in this list has a non-empty value.
  1870. // This may be used to include null fields in Patch requests.
  1871. NullFields []string `json:"-"`
  1872. }
  1873. func (s *GoogleCloudDialogflowV2IntentMessageListSelectItem) MarshalJSON() ([]byte, error) {
  1874. type NoMethod GoogleCloudDialogflowV2IntentMessageListSelectItem
  1875. raw := NoMethod(*s)
  1876. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1877. }
  1878. // GoogleCloudDialogflowV2IntentMessageQuickReplies: The quick replies
  1879. // response message.
  1880. type GoogleCloudDialogflowV2IntentMessageQuickReplies struct {
  1881. // QuickReplies: Optional. The collection of quick replies.
  1882. QuickReplies []string `json:"quickReplies,omitempty"`
  1883. // Title: Optional. The title of the collection of quick replies.
  1884. Title string `json:"title,omitempty"`
  1885. // ForceSendFields is a list of field names (e.g. "QuickReplies") to
  1886. // unconditionally include in API requests. By default, fields with
  1887. // empty values are omitted from API requests. However, any non-pointer,
  1888. // non-interface field appearing in ForceSendFields will be sent to the
  1889. // server regardless of whether the field is empty or not. This may be
  1890. // used to include empty fields in Patch requests.
  1891. ForceSendFields []string `json:"-"`
  1892. // NullFields is a list of field names (e.g. "QuickReplies") to include
  1893. // in API requests with the JSON null value. By default, fields with
  1894. // empty values are omitted from API requests. However, any field with
  1895. // an empty value appearing in NullFields will be sent to the server as
  1896. // null. It is an error if a field in this list has a non-empty value.
  1897. // This may be used to include null fields in Patch requests.
  1898. NullFields []string `json:"-"`
  1899. }
  1900. func (s *GoogleCloudDialogflowV2IntentMessageQuickReplies) MarshalJSON() ([]byte, error) {
  1901. type NoMethod GoogleCloudDialogflowV2IntentMessageQuickReplies
  1902. raw := NoMethod(*s)
  1903. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1904. }
  1905. // GoogleCloudDialogflowV2IntentMessageSelectItemInfo: Additional info
  1906. // about the select item for when it is triggered in a
  1907. // dialog.
  1908. type GoogleCloudDialogflowV2IntentMessageSelectItemInfo struct {
  1909. // Key: Required. A unique key that will be sent back to the agent if
  1910. // this
  1911. // response is given.
  1912. Key string `json:"key,omitempty"`
  1913. // Synonyms: Optional. A list of synonyms that can also be used to
  1914. // trigger this
  1915. // item in dialog.
  1916. Synonyms []string `json:"synonyms,omitempty"`
  1917. // ForceSendFields is a list of field names (e.g. "Key") to
  1918. // unconditionally include in API requests. By default, fields with
  1919. // empty values are omitted from API requests. However, any non-pointer,
  1920. // non-interface field appearing in ForceSendFields will be sent to the
  1921. // server regardless of whether the field is empty or not. This may be
  1922. // used to include empty fields in Patch requests.
  1923. ForceSendFields []string `json:"-"`
  1924. // NullFields is a list of field names (e.g. "Key") to include in API
  1925. // requests with the JSON null value. By default, fields with empty
  1926. // values are omitted from API requests. However, any field with an
  1927. // empty value appearing in NullFields will be sent to the server as
  1928. // null. It is an error if a field in this list has a non-empty value.
  1929. // This may be used to include null fields in Patch requests.
  1930. NullFields []string `json:"-"`
  1931. }
  1932. func (s *GoogleCloudDialogflowV2IntentMessageSelectItemInfo) MarshalJSON() ([]byte, error) {
  1933. type NoMethod GoogleCloudDialogflowV2IntentMessageSelectItemInfo
  1934. raw := NoMethod(*s)
  1935. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1936. }
  1937. // GoogleCloudDialogflowV2IntentMessageSimpleResponse: The simple
  1938. // response message containing speech or text.
  1939. type GoogleCloudDialogflowV2IntentMessageSimpleResponse struct {
  1940. // DisplayText: Optional. The text to display.
  1941. DisplayText string `json:"displayText,omitempty"`
  1942. // Ssml: One of text_to_speech or ssml must be provided. Structured
  1943. // spoken
  1944. // response to the user in the SSML format. Mutually exclusive
  1945. // with
  1946. // text_to_speech.
  1947. Ssml string `json:"ssml,omitempty"`
  1948. // TextToSpeech: One of text_to_speech or ssml must be provided. The
  1949. // plain text of the
  1950. // speech output. Mutually exclusive with ssml.
  1951. TextToSpeech string `json:"textToSpeech,omitempty"`
  1952. // ForceSendFields is a list of field names (e.g. "DisplayText") to
  1953. // unconditionally include in API requests. By default, fields with
  1954. // empty values are omitted from API requests. However, any non-pointer,
  1955. // non-interface field appearing in ForceSendFields will be sent to the
  1956. // server regardless of whether the field is empty or not. This may be
  1957. // used to include empty fields in Patch requests.
  1958. ForceSendFields []string `json:"-"`
  1959. // NullFields is a list of field names (e.g. "DisplayText") to include
  1960. // in API requests with the JSON null value. By default, fields with
  1961. // empty values are omitted from API requests. However, any field with
  1962. // an empty value appearing in NullFields will be sent to the server as
  1963. // null. It is an error if a field in this list has a non-empty value.
  1964. // This may be used to include null fields in Patch requests.
  1965. NullFields []string `json:"-"`
  1966. }
  1967. func (s *GoogleCloudDialogflowV2IntentMessageSimpleResponse) MarshalJSON() ([]byte, error) {
  1968. type NoMethod GoogleCloudDialogflowV2IntentMessageSimpleResponse
  1969. raw := NoMethod(*s)
  1970. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1971. }
  1972. // GoogleCloudDialogflowV2IntentMessageSimpleResponses: The collection
  1973. // of simple response candidates.
  1974. // This message in `QueryResult.fulfillment_messages`
  1975. // and
  1976. // `WebhookResponse.fulfillment_messages` should contain only
  1977. // one
  1978. // `SimpleResponse`.
  1979. type GoogleCloudDialogflowV2IntentMessageSimpleResponses struct {
  1980. // SimpleResponses: Required. The list of simple responses.
  1981. SimpleResponses []*GoogleCloudDialogflowV2IntentMessageSimpleResponse `json:"simpleResponses,omitempty"`
  1982. // ForceSendFields is a list of field names (e.g. "SimpleResponses") to
  1983. // unconditionally include in API requests. By default, fields with
  1984. // empty values are omitted from API requests. However, any non-pointer,
  1985. // non-interface field appearing in ForceSendFields will be sent to the
  1986. // server regardless of whether the field is empty or not. This may be
  1987. // used to include empty fields in Patch requests.
  1988. ForceSendFields []string `json:"-"`
  1989. // NullFields is a list of field names (e.g. "SimpleResponses") to
  1990. // include in API requests with the JSON null value. By default, fields
  1991. // with empty values are omitted from API requests. However, any field
  1992. // with an empty value appearing in NullFields will be sent to the
  1993. // server as null. It is an error if a field in this list has a
  1994. // non-empty value. This may be used to include null fields in Patch
  1995. // requests.
  1996. NullFields []string `json:"-"`
  1997. }
  1998. func (s *GoogleCloudDialogflowV2IntentMessageSimpleResponses) MarshalJSON() ([]byte, error) {
  1999. type NoMethod GoogleCloudDialogflowV2IntentMessageSimpleResponses
  2000. raw := NoMethod(*s)
  2001. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2002. }
  2003. // GoogleCloudDialogflowV2IntentMessageSuggestion: The suggestion chip
  2004. // message that the user can tap to quickly post a reply
  2005. // to the conversation.
  2006. type GoogleCloudDialogflowV2IntentMessageSuggestion struct {
  2007. // Title: Required. The text shown the in the suggestion chip.
  2008. Title string `json:"title,omitempty"`
  2009. // ForceSendFields is a list of field names (e.g. "Title") to
  2010. // unconditionally include in API requests. By default, fields with
  2011. // empty values are omitted from API requests. However, any non-pointer,
  2012. // non-interface field appearing in ForceSendFields will be sent to the
  2013. // server regardless of whether the field is empty or not. This may be
  2014. // used to include empty fields in Patch requests.
  2015. ForceSendFields []string `json:"-"`
  2016. // NullFields is a list of field names (e.g. "Title") to include in API
  2017. // requests with the JSON null value. By default, fields with empty
  2018. // values are omitted from API requests. However, any field with an
  2019. // empty value appearing in NullFields will be sent to the server as
  2020. // null. It is an error if a field in this list has a non-empty value.
  2021. // This may be used to include null fields in Patch requests.
  2022. NullFields []string `json:"-"`
  2023. }
  2024. func (s *GoogleCloudDialogflowV2IntentMessageSuggestion) MarshalJSON() ([]byte, error) {
  2025. type NoMethod GoogleCloudDialogflowV2IntentMessageSuggestion
  2026. raw := NoMethod(*s)
  2027. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2028. }
  2029. // GoogleCloudDialogflowV2IntentMessageSuggestions: The collection of
  2030. // suggestions.
  2031. type GoogleCloudDialogflowV2IntentMessageSuggestions struct {
  2032. // Suggestions: Required. The list of suggested replies.
  2033. Suggestions []*GoogleCloudDialogflowV2IntentMessageSuggestion `json:"suggestions,omitempty"`
  2034. // ForceSendFields is a list of field names (e.g. "Suggestions") to
  2035. // unconditionally include in API requests. By default, fields with
  2036. // empty values are omitted from API requests. However, any non-pointer,
  2037. // non-interface field appearing in ForceSendFields will be sent to the
  2038. // server regardless of whether the field is empty or not. This may be
  2039. // used to include empty fields in Patch requests.
  2040. ForceSendFields []string `json:"-"`
  2041. // NullFields is a list of field names (e.g. "Suggestions") to include
  2042. // in API requests with the JSON null value. By default, fields with
  2043. // empty values are omitted from API requests. However, any field with
  2044. // an empty value appearing in NullFields will be sent to the server as
  2045. // null. It is an error if a field in this list has a non-empty value.
  2046. // This may be used to include null fields in Patch requests.
  2047. NullFields []string `json:"-"`
  2048. }
  2049. func (s *GoogleCloudDialogflowV2IntentMessageSuggestions) MarshalJSON() ([]byte, error) {
  2050. type NoMethod GoogleCloudDialogflowV2IntentMessageSuggestions
  2051. raw := NoMethod(*s)
  2052. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2053. }
  2054. // GoogleCloudDialogflowV2IntentMessageText: The text response message.
  2055. type GoogleCloudDialogflowV2IntentMessageText struct {
  2056. // Text: Optional. The collection of the agent's responses.
  2057. Text []string `json:"text,omitempty"`
  2058. // ForceSendFields is a list of field names (e.g. "Text") 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. // NullFields is a list of field names (e.g. "Text") to include in API
  2066. // requests with the JSON null value. By default, fields with empty
  2067. // values are omitted from API requests. However, any field with an
  2068. // empty value appearing in NullFields will be sent to the server as
  2069. // null. It is an error if a field in this list has a non-empty value.
  2070. // This may be used to include null fields in Patch requests.
  2071. NullFields []string `json:"-"`
  2072. }
  2073. func (s *GoogleCloudDialogflowV2IntentMessageText) MarshalJSON() ([]byte, error) {
  2074. type NoMethod GoogleCloudDialogflowV2IntentMessageText
  2075. raw := NoMethod(*s)
  2076. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2077. }
  2078. // GoogleCloudDialogflowV2IntentParameter: Represents intent parameters.
  2079. type GoogleCloudDialogflowV2IntentParameter struct {
  2080. // DefaultValue: Optional. The default value to use when the `value`
  2081. // yields an empty
  2082. // result.
  2083. // Default values can be extracted from contexts by using the
  2084. // following
  2085. // syntax: `#context_name.parameter_name`.
  2086. DefaultValue string `json:"defaultValue,omitempty"`
  2087. // DisplayName: Required. The name of the parameter.
  2088. DisplayName string `json:"displayName,omitempty"`
  2089. // EntityTypeDisplayName: Optional. The name of the entity type,
  2090. // prefixed with `@`, that
  2091. // describes values of the parameter. If the parameter is
  2092. // required, this must be provided.
  2093. EntityTypeDisplayName string `json:"entityTypeDisplayName,omitempty"`
  2094. // IsList: Optional. Indicates whether the parameter represents a list
  2095. // of values.
  2096. IsList bool `json:"isList,omitempty"`
  2097. // Mandatory: Optional. Indicates whether the parameter is required.
  2098. // That is,
  2099. // whether the intent cannot be completed without collecting the
  2100. // parameter
  2101. // value.
  2102. Mandatory bool `json:"mandatory,omitempty"`
  2103. // Name: The unique identifier of this parameter.
  2104. Name string `json:"name,omitempty"`
  2105. // Prompts: Optional. The collection of prompts that the agent can
  2106. // present to the
  2107. // user in order to collect value for the parameter.
  2108. Prompts []string `json:"prompts,omitempty"`
  2109. // Value: Optional. The definition of the parameter value. It can be:
  2110. // - a constant string,
  2111. // - a parameter value defined as `$parameter_name`,
  2112. // - an original parameter value defined as
  2113. // `$parameter_name.original`,
  2114. // - a parameter value from some context defined as
  2115. // `#context_name.parameter_name`.
  2116. Value string `json:"value,omitempty"`
  2117. // ForceSendFields is a list of field names (e.g. "DefaultValue") to
  2118. // unconditionally include in API requests. By default, fields with
  2119. // empty values are omitted from API requests. However, any non-pointer,
  2120. // non-interface field appearing in ForceSendFields will be sent to the
  2121. // server regardless of whether the field is empty or not. This may be
  2122. // used to include empty fields in Patch requests.
  2123. ForceSendFields []string `json:"-"`
  2124. // NullFields is a list of field names (e.g. "DefaultValue") to include
  2125. // in API requests with the JSON null value. By default, fields with
  2126. // empty values are omitted from API requests. However, any field with
  2127. // an empty value appearing in NullFields will be sent to the server as
  2128. // null. It is an error if a field in this list has a non-empty value.
  2129. // This may be used to include null fields in Patch requests.
  2130. NullFields []string `json:"-"`
  2131. }
  2132. func (s *GoogleCloudDialogflowV2IntentParameter) MarshalJSON() ([]byte, error) {
  2133. type NoMethod GoogleCloudDialogflowV2IntentParameter
  2134. raw := NoMethod(*s)
  2135. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2136. }
  2137. // GoogleCloudDialogflowV2IntentTrainingPhrase: Represents an example
  2138. // that the agent is trained on.
  2139. type GoogleCloudDialogflowV2IntentTrainingPhrase struct {
  2140. // Name: Output only. The unique identifier of this training phrase.
  2141. Name string `json:"name,omitempty"`
  2142. // Parts: Required. The ordered list of training phrase parts.
  2143. // The parts are concatenated in order to form the training
  2144. // phrase.
  2145. //
  2146. // Note: The API does not automatically annotate training phrases like
  2147. // the
  2148. // Dialogflow Console does.
  2149. //
  2150. // Note: Do not forget to include whitespace at part boundaries,
  2151. // so the training phrase is well formatted when the parts are
  2152. // concatenated.
  2153. //
  2154. // If the training phrase does not need to be annotated with
  2155. // parameters,
  2156. // you just need a single part with only the Part.text field set.
  2157. //
  2158. // If you want to annotate the training phrase, you must create
  2159. // multiple
  2160. // parts, where the fields of each part are populated in one of two
  2161. // ways:
  2162. //
  2163. // - `Part.text` is set to a part of the phrase that has no
  2164. // parameters.
  2165. // - `Part.text` is set to a part of the phrase that you want to
  2166. // annotate,
  2167. // and the `entity_type`, `alias`, and `user_defined` fields are
  2168. // all
  2169. // set.
  2170. Parts []*GoogleCloudDialogflowV2IntentTrainingPhrasePart `json:"parts,omitempty"`
  2171. // TimesAddedCount: Optional. Indicates how many times this example was
  2172. // added to
  2173. // the intent. Each time a developer adds an existing sample by editing
  2174. // an
  2175. // intent or training, this counter is increased.
  2176. TimesAddedCount int64 `json:"timesAddedCount,omitempty"`
  2177. // Type: Required. The type of the training phrase.
  2178. //
  2179. // Possible values:
  2180. // "TYPE_UNSPECIFIED" - Not specified. This value should never be
  2181. // used.
  2182. // "EXAMPLE" - Examples do not contain @-prefixed entity type names,
  2183. // but example parts
  2184. // can be annotated with entity types.
  2185. // "TEMPLATE" - Templates are not annotated with entity types, but
  2186. // they can contain
  2187. // @-prefixed entity type names as substrings.
  2188. // Template mode has been deprecated. Example mode is the only
  2189. // supported
  2190. // way to create new training phrases. If you have existing
  2191. // training
  2192. // phrases that you've created in template mode, those will continue
  2193. // to
  2194. // work.
  2195. Type string `json:"type,omitempty"`
  2196. // ForceSendFields is a list of field names (e.g. "Name") to
  2197. // unconditionally include in API requests. By default, fields with
  2198. // empty values are omitted from API requests. However, any non-pointer,
  2199. // non-interface field appearing in ForceSendFields will be sent to the
  2200. // server regardless of whether the field is empty or not. This may be
  2201. // used to include empty fields in Patch requests.
  2202. ForceSendFields []string `json:"-"`
  2203. // NullFields is a list of field names (e.g. "Name") to include in API
  2204. // requests with the JSON null value. By default, fields with empty
  2205. // values are omitted from API requests. However, any field with an
  2206. // empty value appearing in NullFields will be sent to the server as
  2207. // null. It is an error if a field in this list has a non-empty value.
  2208. // This may be used to include null fields in Patch requests.
  2209. NullFields []string `json:"-"`
  2210. }
  2211. func (s *GoogleCloudDialogflowV2IntentTrainingPhrase) MarshalJSON() ([]byte, error) {
  2212. type NoMethod GoogleCloudDialogflowV2IntentTrainingPhrase
  2213. raw := NoMethod(*s)
  2214. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2215. }
  2216. // GoogleCloudDialogflowV2IntentTrainingPhrasePart: Represents a part of
  2217. // a training phrase.
  2218. type GoogleCloudDialogflowV2IntentTrainingPhrasePart struct {
  2219. // Alias: Optional. The parameter name for the value extracted from
  2220. // the
  2221. // annotated part of the example.
  2222. // This field is required for annotated parts of the training phrase.
  2223. Alias string `json:"alias,omitempty"`
  2224. // EntityType: Optional. The entity type name prefixed with `@`.
  2225. // This field is required for annotated parts of the training phrase.
  2226. EntityType string `json:"entityType,omitempty"`
  2227. // Text: Required. The text for this part.
  2228. Text string `json:"text,omitempty"`
  2229. // UserDefined: Optional. Indicates whether the text was manually
  2230. // annotated.
  2231. // This field is set to true when the Dialogflow Console is used
  2232. // to
  2233. // manually annotate the part. When creating an annotated part with
  2234. // the
  2235. // API, you must set this to true.
  2236. UserDefined bool `json:"userDefined,omitempty"`
  2237. // ForceSendFields is a list of field names (e.g. "Alias") to
  2238. // unconditionally include in API requests. By default, fields with
  2239. // empty values are omitted from API requests. However, any non-pointer,
  2240. // non-interface field appearing in ForceSendFields will be sent to the
  2241. // server regardless of whether the field is empty or not. This may be
  2242. // used to include empty fields in Patch requests.
  2243. ForceSendFields []string `json:"-"`
  2244. // NullFields is a list of field names (e.g. "Alias") to include in API
  2245. // requests with the JSON null value. By default, fields with empty
  2246. // values are omitted from API requests. However, any field with an
  2247. // empty value appearing in NullFields will be sent to the server as
  2248. // null. It is an error if a field in this list has a non-empty value.
  2249. // This may be used to include null fields in Patch requests.
  2250. NullFields []string `json:"-"`
  2251. }
  2252. func (s *GoogleCloudDialogflowV2IntentTrainingPhrasePart) MarshalJSON() ([]byte, error) {
  2253. type NoMethod GoogleCloudDialogflowV2IntentTrainingPhrasePart
  2254. raw := NoMethod(*s)
  2255. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2256. }
  2257. // GoogleCloudDialogflowV2ListContextsResponse: The response message for
  2258. // Contexts.ListContexts.
  2259. type GoogleCloudDialogflowV2ListContextsResponse struct {
  2260. // Contexts: The list of contexts. There will be a maximum number of
  2261. // items
  2262. // returned based on the page_size field in the request.
  2263. Contexts []*GoogleCloudDialogflowV2Context `json:"contexts,omitempty"`
  2264. // NextPageToken: Token to retrieve the next page of results, or empty
  2265. // if there are no
  2266. // more results in the list.
  2267. NextPageToken string `json:"nextPageToken,omitempty"`
  2268. // ServerResponse contains the HTTP response code and headers from the
  2269. // server.
  2270. googleapi.ServerResponse `json:"-"`
  2271. // ForceSendFields is a list of field names (e.g. "Contexts") to
  2272. // unconditionally include in API requests. By default, fields with
  2273. // empty values are omitted from API requests. However, any non-pointer,
  2274. // non-interface field appearing in ForceSendFields will be sent to the
  2275. // server regardless of whether the field is empty or not. This may be
  2276. // used to include empty fields in Patch requests.
  2277. ForceSendFields []string `json:"-"`
  2278. // NullFields is a list of field names (e.g. "Contexts") to include in
  2279. // API requests with the JSON null value. By default, fields with empty
  2280. // values are omitted from API requests. However, any field with an
  2281. // 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. func (s *GoogleCloudDialogflowV2ListContextsResponse) MarshalJSON() ([]byte, error) {
  2287. type NoMethod GoogleCloudDialogflowV2ListContextsResponse
  2288. raw := NoMethod(*s)
  2289. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2290. }
  2291. // GoogleCloudDialogflowV2ListEntityTypesResponse: The response message
  2292. // for EntityTypes.ListEntityTypes.
  2293. type GoogleCloudDialogflowV2ListEntityTypesResponse struct {
  2294. // EntityTypes: The list of agent entity types. There will be a maximum
  2295. // number of items
  2296. // returned based on the page_size field in the request.
  2297. EntityTypes []*GoogleCloudDialogflowV2EntityType `json:"entityTypes,omitempty"`
  2298. // NextPageToken: Token to retrieve the next page of results, or empty
  2299. // if there are no
  2300. // more results in the list.
  2301. NextPageToken string `json:"nextPageToken,omitempty"`
  2302. // ServerResponse contains the HTTP response code and headers from the
  2303. // server.
  2304. googleapi.ServerResponse `json:"-"`
  2305. // ForceSendFields is a list of field names (e.g. "EntityTypes") to
  2306. // unconditionally include in API requests. By default, fields with
  2307. // empty values are omitted from API requests. However, any non-pointer,
  2308. // non-interface field appearing in ForceSendFields will be sent to the
  2309. // server regardless of whether the field is empty or not. This may be
  2310. // used to include empty fields in Patch requests.
  2311. ForceSendFields []string `json:"-"`
  2312. // NullFields is a list of field names (e.g. "EntityTypes") to include
  2313. // in API requests with the JSON null value. By default, fields with
  2314. // empty values are omitted from API requests. However, any field with
  2315. // an empty value appearing in NullFields will be sent to the server as
  2316. // null. It is an error if a field in this list has a non-empty value.
  2317. // This may be used to include null fields in Patch requests.
  2318. NullFields []string `json:"-"`
  2319. }
  2320. func (s *GoogleCloudDialogflowV2ListEntityTypesResponse) MarshalJSON() ([]byte, error) {
  2321. type NoMethod GoogleCloudDialogflowV2ListEntityTypesResponse
  2322. raw := NoMethod(*s)
  2323. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2324. }
  2325. // GoogleCloudDialogflowV2ListIntentsResponse: The response message for
  2326. // Intents.ListIntents.
  2327. type GoogleCloudDialogflowV2ListIntentsResponse struct {
  2328. // Intents: The list of agent intents. There will be a maximum number of
  2329. // items
  2330. // returned based on the page_size field in the request.
  2331. Intents []*GoogleCloudDialogflowV2Intent `json:"intents,omitempty"`
  2332. // NextPageToken: Token to retrieve the next page of results, or empty
  2333. // if there are no
  2334. // more results in the list.
  2335. NextPageToken string `json:"nextPageToken,omitempty"`
  2336. // ServerResponse contains the HTTP response code and headers from the
  2337. // server.
  2338. googleapi.ServerResponse `json:"-"`
  2339. // ForceSendFields is a list of field names (e.g. "Intents") to
  2340. // unconditionally include in API requests. By default, fields with
  2341. // empty values are omitted from API requests. However, any non-pointer,
  2342. // non-interface field appearing in ForceSendFields will be sent to the
  2343. // server regardless of whether the field is empty or not. This may be
  2344. // used to include empty fields in Patch requests.
  2345. ForceSendFields []string `json:"-"`
  2346. // NullFields is a list of field names (e.g. "Intents") to include in
  2347. // API requests with the JSON null value. By default, fields with empty
  2348. // values are omitted from API requests. However, any field with an
  2349. // empty value appearing in NullFields will be sent to the server as
  2350. // null. It is an error if a field in this list has a non-empty value.
  2351. // This may be used to include null fields in Patch requests.
  2352. NullFields []string `json:"-"`
  2353. }
  2354. func (s *GoogleCloudDialogflowV2ListIntentsResponse) MarshalJSON() ([]byte, error) {
  2355. type NoMethod GoogleCloudDialogflowV2ListIntentsResponse
  2356. raw := NoMethod(*s)
  2357. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2358. }
  2359. // GoogleCloudDialogflowV2ListSessionEntityTypesResponse: The response
  2360. // message for SessionEntityTypes.ListSessionEntityTypes.
  2361. type GoogleCloudDialogflowV2ListSessionEntityTypesResponse struct {
  2362. // NextPageToken: Token to retrieve the next page of results, or empty
  2363. // if there are no
  2364. // more results in the list.
  2365. NextPageToken string `json:"nextPageToken,omitempty"`
  2366. // SessionEntityTypes: The list of session entity types. There will be a
  2367. // maximum number of items
  2368. // returned based on the page_size field in the request.
  2369. SessionEntityTypes []*GoogleCloudDialogflowV2SessionEntityType `json:"sessionEntityTypes,omitempty"`
  2370. // ServerResponse contains the HTTP response code and headers from the
  2371. // server.
  2372. googleapi.ServerResponse `json:"-"`
  2373. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  2374. // unconditionally include in API requests. By default, fields with
  2375. // empty values are omitted from API requests. However, any non-pointer,
  2376. // non-interface field appearing in ForceSendFields will be sent to the
  2377. // server regardless of whether the field is empty or not. This may be
  2378. // used to include empty fields in Patch requests.
  2379. ForceSendFields []string `json:"-"`
  2380. // NullFields is a list of field names (e.g. "NextPageToken") to include
  2381. // in API requests with the JSON null value. By default, fields with
  2382. // empty values are omitted from API requests. However, any field with
  2383. // an empty value appearing in NullFields will be sent to the server as
  2384. // null. It is an error if a field in this list has a non-empty value.
  2385. // This may be used to include null fields in Patch requests.
  2386. NullFields []string `json:"-"`
  2387. }
  2388. func (s *GoogleCloudDialogflowV2ListSessionEntityTypesResponse) MarshalJSON() ([]byte, error) {
  2389. type NoMethod GoogleCloudDialogflowV2ListSessionEntityTypesResponse
  2390. raw := NoMethod(*s)
  2391. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2392. }
  2393. // GoogleCloudDialogflowV2OriginalDetectIntentRequest: Represents the
  2394. // contents of the original request that was passed to
  2395. // the `[Streaming]DetectIntent` call.
  2396. type GoogleCloudDialogflowV2OriginalDetectIntentRequest struct {
  2397. // Payload: Optional. This field is set to the value of the
  2398. // `QueryParameters.payload`
  2399. // field passed in the request. Some integrations that query a
  2400. // Dialogflow
  2401. // agent may provide additional information in the payload.
  2402. //
  2403. // In particular for the Telephony Gateway this field has the
  2404. // form:
  2405. // <pre>{
  2406. // "telephony": {
  2407. // "caller_id": "+18558363987"
  2408. // }
  2409. // }</pre>
  2410. // Note: The caller ID field (`caller_id`) will be redacted for
  2411. // Standard
  2412. // Edition agents and populated with the caller ID in
  2413. // [E.164
  2414. // format](https://en.wikipedia.org/wiki/E.164) for Enterprise Edition
  2415. // agents.
  2416. Payload googleapi.RawMessage `json:"payload,omitempty"`
  2417. // Source: The source of this request, e.g., `google`, `facebook`,
  2418. // `slack`. It is set
  2419. // by Dialogflow-owned servers.
  2420. Source string `json:"source,omitempty"`
  2421. // Version: Optional. The version of the protocol used for this
  2422. // request.
  2423. // This field is AoG-specific.
  2424. Version string `json:"version,omitempty"`
  2425. // ForceSendFields is a list of field names (e.g. "Payload") to
  2426. // unconditionally include in API requests. By default, fields with
  2427. // empty values are omitted from API requests. However, any non-pointer,
  2428. // non-interface field appearing in ForceSendFields will be sent to the
  2429. // server regardless of whether the field is empty or not. This may be
  2430. // used to include empty fields in Patch requests.
  2431. ForceSendFields []string `json:"-"`
  2432. // NullFields is a list of field names (e.g. "Payload") to include in
  2433. // API requests with the JSON null value. By default, fields with empty
  2434. // values are omitted from API requests. However, any field with an
  2435. // empty value appearing in NullFields will be sent to the server as
  2436. // null. It is an error if a field in this list has a non-empty value.
  2437. // This may be used to include null fields in Patch requests.
  2438. NullFields []string `json:"-"`
  2439. }
  2440. func (s *GoogleCloudDialogflowV2OriginalDetectIntentRequest) MarshalJSON() ([]byte, error) {
  2441. type NoMethod GoogleCloudDialogflowV2OriginalDetectIntentRequest
  2442. raw := NoMethod(*s)
  2443. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2444. }
  2445. // GoogleCloudDialogflowV2QueryInput: Represents the query input. It can
  2446. // contain either:
  2447. //
  2448. // 1. An audio config which
  2449. // instructs the speech recognizer how to process the speech
  2450. // audio.
  2451. //
  2452. // 2. A conversational query in the form of text,.
  2453. //
  2454. // 3. An event that specifies which intent to trigger.
  2455. type GoogleCloudDialogflowV2QueryInput struct {
  2456. // AudioConfig: Instructs the speech recognizer how to process the
  2457. // speech audio.
  2458. AudioConfig *GoogleCloudDialogflowV2InputAudioConfig `json:"audioConfig,omitempty"`
  2459. // Event: The event to be processed.
  2460. Event *GoogleCloudDialogflowV2EventInput `json:"event,omitempty"`
  2461. // Text: The natural language text to be processed.
  2462. Text *GoogleCloudDialogflowV2TextInput `json:"text,omitempty"`
  2463. // ForceSendFields is a list of field names (e.g. "AudioConfig") to
  2464. // unconditionally include in API requests. By default, fields with
  2465. // empty values are omitted from API requests. However, any non-pointer,
  2466. // non-interface field appearing in ForceSendFields will be sent to the
  2467. // server regardless of whether the field is empty or not. This may be
  2468. // used to include empty fields in Patch requests.
  2469. ForceSendFields []string `json:"-"`
  2470. // NullFields is a list of field names (e.g. "AudioConfig") to include
  2471. // in API requests with the JSON null value. By default, fields with
  2472. // empty values are omitted from API requests. However, any field with
  2473. // an empty value appearing in NullFields will be sent to the server as
  2474. // null. It is an error if a field in this list has a non-empty value.
  2475. // This may be used to include null fields in Patch requests.
  2476. NullFields []string `json:"-"`
  2477. }
  2478. func (s *GoogleCloudDialogflowV2QueryInput) MarshalJSON() ([]byte, error) {
  2479. type NoMethod GoogleCloudDialogflowV2QueryInput
  2480. raw := NoMethod(*s)
  2481. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2482. }
  2483. // GoogleCloudDialogflowV2QueryParameters: Represents the parameters of
  2484. // the conversational query.
  2485. type GoogleCloudDialogflowV2QueryParameters struct {
  2486. // Contexts: Optional. The collection of contexts to be activated before
  2487. // this query is
  2488. // executed.
  2489. Contexts []*GoogleCloudDialogflowV2Context `json:"contexts,omitempty"`
  2490. // GeoLocation: Optional. The geo location of this conversational query.
  2491. GeoLocation *GoogleTypeLatLng `json:"geoLocation,omitempty"`
  2492. // Payload: Optional. This field can be used to pass custom data into
  2493. // the webhook
  2494. // associated with the agent. Arbitrary JSON objects are supported.
  2495. Payload googleapi.RawMessage `json:"payload,omitempty"`
  2496. // ResetContexts: Optional. Specifies whether to delete all contexts in
  2497. // the current session
  2498. // before the new ones are activated.
  2499. ResetContexts bool `json:"resetContexts,omitempty"`
  2500. // SessionEntityTypes: Optional. Additional session entity types to
  2501. // replace or extend developer
  2502. // entity types with. The entity synonyms apply to all languages and
  2503. // persist
  2504. // for the session of this query.
  2505. SessionEntityTypes []*GoogleCloudDialogflowV2SessionEntityType `json:"sessionEntityTypes,omitempty"`
  2506. // TimeZone: Optional. The time zone of this conversational query from
  2507. // the
  2508. // [time zone database](https://www.iana.org/time-zones),
  2509. // e.g.,
  2510. // America/New_York, Europe/Paris. If not provided, the time zone
  2511. // specified in
  2512. // agent settings is used.
  2513. TimeZone string `json:"timeZone,omitempty"`
  2514. // ForceSendFields is a list of field names (e.g. "Contexts") to
  2515. // unconditionally include in API requests. By default, fields with
  2516. // empty values are omitted from API requests. However, any non-pointer,
  2517. // non-interface field appearing in ForceSendFields will be sent to the
  2518. // server regardless of whether the field is empty or not. This may be
  2519. // used to include empty fields in Patch requests.
  2520. ForceSendFields []string `json:"-"`
  2521. // NullFields is a list of field names (e.g. "Contexts") to include in
  2522. // API requests with the JSON null value. By default, fields with empty
  2523. // values are omitted from API requests. However, any field with an
  2524. // empty value appearing in NullFields will be sent to the server as
  2525. // null. It is an error if a field in this list has a non-empty value.
  2526. // This may be used to include null fields in Patch requests.
  2527. NullFields []string `json:"-"`
  2528. }
  2529. func (s *GoogleCloudDialogflowV2QueryParameters) MarshalJSON() ([]byte, error) {
  2530. type NoMethod GoogleCloudDialogflowV2QueryParameters
  2531. raw := NoMethod(*s)
  2532. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2533. }
  2534. // GoogleCloudDialogflowV2QueryResult: Represents the result of
  2535. // conversational query or event processing.
  2536. type GoogleCloudDialogflowV2QueryResult struct {
  2537. // Action: The action name from the matched intent.
  2538. Action string `json:"action,omitempty"`
  2539. // AllRequiredParamsPresent: This field is set to:
  2540. // - `false` if the matched intent has required parameters and not all
  2541. // of
  2542. // the required parameter values have been collected.
  2543. // - `true` if all required parameter values have been collected, or if
  2544. // the
  2545. // matched intent doesn't contain any required parameters.
  2546. AllRequiredParamsPresent bool `json:"allRequiredParamsPresent,omitempty"`
  2547. // DiagnosticInfo: The free-form diagnostic info. For example, this
  2548. // field could contain
  2549. // webhook call latency. The string keys of the Struct's fields map can
  2550. // change
  2551. // without notice.
  2552. DiagnosticInfo googleapi.RawMessage `json:"diagnosticInfo,omitempty"`
  2553. // FulfillmentMessages: The collection of rich messages to present to
  2554. // the user.
  2555. FulfillmentMessages []*GoogleCloudDialogflowV2IntentMessage `json:"fulfillmentMessages,omitempty"`
  2556. // FulfillmentText: The text to be pronounced to the user or shown on
  2557. // the screen.
  2558. // Note: This is a legacy field, `fulfillment_messages` should be
  2559. // preferred.
  2560. FulfillmentText string `json:"fulfillmentText,omitempty"`
  2561. // Intent: The intent that matched the conversational query. Some,
  2562. // not
  2563. // all fields are filled in this message, including but not limited
  2564. // to:
  2565. // `name`, `display_name` and `webhook_state`.
  2566. Intent *GoogleCloudDialogflowV2Intent `json:"intent,omitempty"`
  2567. // IntentDetectionConfidence: The intent detection confidence. Values
  2568. // range from 0.0
  2569. // (completely uncertain) to 1.0 (completely certain).
  2570. // If there are `multiple knowledge_answers` messages, this value is set
  2571. // to
  2572. // the greatest `knowledgeAnswers.match_confidence` value in the list.
  2573. IntentDetectionConfidence float64 `json:"intentDetectionConfidence,omitempty"`
  2574. // LanguageCode: The language that was triggered during intent
  2575. // detection.
  2576. // See [Language
  2577. // Support](https://dialogflow.com/docs/reference/language)
  2578. // for a list of the currently supported language codes.
  2579. LanguageCode string `json:"languageCode,omitempty"`
  2580. // OutputContexts: The collection of output contexts. If
  2581. // applicable,
  2582. // `output_contexts.parameters` contains entries with name
  2583. // `<parameter name>.original` containing the original parameter
  2584. // values
  2585. // before the query.
  2586. OutputContexts []*GoogleCloudDialogflowV2Context `json:"outputContexts,omitempty"`
  2587. // Parameters: The collection of extracted parameters.
  2588. Parameters googleapi.RawMessage `json:"parameters,omitempty"`
  2589. // QueryText: The original conversational query text:
  2590. // - If natural language text was provided as input, `query_text`
  2591. // contains
  2592. // a copy of the input.
  2593. // - If natural language speech audio was provided as input,
  2594. // `query_text`
  2595. // contains the speech recognition result. If speech recognizer
  2596. // produced
  2597. // multiple alternatives, a particular one is picked.
  2598. // - If an event was provided as input, `query_text` is not set.
  2599. QueryText string `json:"queryText,omitempty"`
  2600. // SpeechRecognitionConfidence: The Speech recognition confidence
  2601. // between 0.0 and 1.0. A higher number
  2602. // indicates an estimated greater likelihood that the recognized words
  2603. // are
  2604. // correct. The default of 0.0 is a sentinel value indicating that
  2605. // confidence
  2606. // was not set.
  2607. //
  2608. // This field is not guaranteed to be accurate or set. In particular
  2609. // this
  2610. // field isn't set for StreamingDetectIntent since the streaming
  2611. // endpoint has
  2612. // separate confidence estimates per portion of the audio
  2613. // in
  2614. // StreamingRecognitionResult.
  2615. SpeechRecognitionConfidence float64 `json:"speechRecognitionConfidence,omitempty"`
  2616. // WebhookPayload: If the query was fulfilled by a webhook call, this
  2617. // field is set to the
  2618. // value of the `payload` field returned in the webhook response.
  2619. WebhookPayload googleapi.RawMessage `json:"webhookPayload,omitempty"`
  2620. // WebhookSource: If the query was fulfilled by a webhook call, this
  2621. // field is set to the
  2622. // value of the `source` field returned in the webhook response.
  2623. WebhookSource string `json:"webhookSource,omitempty"`
  2624. // ForceSendFields is a list of field names (e.g. "Action") to
  2625. // unconditionally include in API requests. By default, fields with
  2626. // empty values are omitted from API requests. However, any non-pointer,
  2627. // non-interface field appearing in ForceSendFields will be sent to the
  2628. // server regardless of whether the field is empty or not. This may be
  2629. // used to include empty fields in Patch requests.
  2630. ForceSendFields []string `json:"-"`
  2631. // NullFields is a list of field names (e.g. "Action") to include in API
  2632. // requests with the JSON null value. By default, fields with empty
  2633. // values are omitted from API requests. However, any field with an
  2634. // empty value appearing in NullFields will be sent to the server as
  2635. // null. It is an error if a field in this list has a non-empty value.
  2636. // This may be used to include null fields in Patch requests.
  2637. NullFields []string `json:"-"`
  2638. }
  2639. func (s *GoogleCloudDialogflowV2QueryResult) MarshalJSON() ([]byte, error) {
  2640. type NoMethod GoogleCloudDialogflowV2QueryResult
  2641. raw := NoMethod(*s)
  2642. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2643. }
  2644. func (s *GoogleCloudDialogflowV2QueryResult) UnmarshalJSON(data []byte) error {
  2645. type NoMethod GoogleCloudDialogflowV2QueryResult
  2646. var s1 struct {
  2647. IntentDetectionConfidence gensupport.JSONFloat64 `json:"intentDetectionConfidence"`
  2648. SpeechRecognitionConfidence gensupport.JSONFloat64 `json:"speechRecognitionConfidence"`
  2649. *NoMethod
  2650. }
  2651. s1.NoMethod = (*NoMethod)(s)
  2652. if err := json.Unmarshal(data, &s1); err != nil {
  2653. return err
  2654. }
  2655. s.IntentDetectionConfidence = float64(s1.IntentDetectionConfidence)
  2656. s.SpeechRecognitionConfidence = float64(s1.SpeechRecognitionConfidence)
  2657. return nil
  2658. }
  2659. // GoogleCloudDialogflowV2RestoreAgentRequest: The request message for
  2660. // Agents.RestoreAgent.
  2661. type GoogleCloudDialogflowV2RestoreAgentRequest struct {
  2662. // AgentContent: The agent to restore.
  2663. //
  2664. // Example for how to restore an agent via the command line:
  2665. // <pre>curl \
  2666. //
  2667. // 'https://dialogflow.googleapis.com/v2/projects/&lt;project_name&gt;/ag
  2668. // ent:restore\
  2669. // -X POST \
  2670. // -H 'Authorization: Bearer '$(gcloud auth application-default
  2671. // print-access-token) \
  2672. // -H 'Accept: application/json' \
  2673. // -H 'Content-Type: application/json' \
  2674. // --compressed \
  2675. // --data-binary "{
  2676. // 'agentContent': '$(cat &lt;agent zip file&gt; | base64 -w 0)'
  2677. // }"</pre>
  2678. AgentContent string `json:"agentContent,omitempty"`
  2679. // AgentUri: The URI to a Google Cloud Storage file containing the agent
  2680. // to restore.
  2681. // Note: The URI must start with "gs://".
  2682. AgentUri string `json:"agentUri,omitempty"`
  2683. // ForceSendFields is a list of field names (e.g. "AgentContent") to
  2684. // unconditionally include in API requests. By default, fields with
  2685. // empty values are omitted from API requests. However, any non-pointer,
  2686. // non-interface field appearing in ForceSendFields will be sent to the
  2687. // server regardless of whether the field is empty or not. This may be
  2688. // used to include empty fields in Patch requests.
  2689. ForceSendFields []string `json:"-"`
  2690. // NullFields is a list of field names (e.g. "AgentContent") to include
  2691. // in API requests with the JSON null value. By default, fields with
  2692. // empty values are omitted from API requests. However, any field with
  2693. // an empty value appearing in NullFields will be sent to the server as
  2694. // null. It is an error if a field in this list has a non-empty value.
  2695. // This may be used to include null fields in Patch requests.
  2696. NullFields []string `json:"-"`
  2697. }
  2698. func (s *GoogleCloudDialogflowV2RestoreAgentRequest) MarshalJSON() ([]byte, error) {
  2699. type NoMethod GoogleCloudDialogflowV2RestoreAgentRequest
  2700. raw := NoMethod(*s)
  2701. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2702. }
  2703. // GoogleCloudDialogflowV2SearchAgentsResponse: The response message for
  2704. // Agents.SearchAgents.
  2705. type GoogleCloudDialogflowV2SearchAgentsResponse struct {
  2706. // Agents: The list of agents. There will be a maximum number of items
  2707. // returned based
  2708. // on the page_size field in the request.
  2709. Agents []*GoogleCloudDialogflowV2Agent `json:"agents,omitempty"`
  2710. // NextPageToken: Token to retrieve the next page of results, or empty
  2711. // if there are no
  2712. // more results in the list.
  2713. NextPageToken string `json:"nextPageToken,omitempty"`
  2714. // ServerResponse contains the HTTP response code and headers from the
  2715. // server.
  2716. googleapi.ServerResponse `json:"-"`
  2717. // ForceSendFields is a list of field names (e.g. "Agents") to
  2718. // unconditionally include in API requests. By default, fields with
  2719. // empty values are omitted from API requests. However, any non-pointer,
  2720. // non-interface field appearing in ForceSendFields will be sent to the
  2721. // server regardless of whether the field is empty or not. This may be
  2722. // used to include empty fields in Patch requests.
  2723. ForceSendFields []string `json:"-"`
  2724. // NullFields is a list of field names (e.g. "Agents") to include in API
  2725. // requests with the JSON null value. By default, fields with empty
  2726. // values are omitted from API requests. However, any field with an
  2727. // empty value appearing in NullFields will be sent to the server as
  2728. // null. It is an error if a field in this list has a non-empty value.
  2729. // This may be used to include null fields in Patch requests.
  2730. NullFields []string `json:"-"`
  2731. }
  2732. func (s *GoogleCloudDialogflowV2SearchAgentsResponse) MarshalJSON() ([]byte, error) {
  2733. type NoMethod GoogleCloudDialogflowV2SearchAgentsResponse
  2734. raw := NoMethod(*s)
  2735. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2736. }
  2737. // GoogleCloudDialogflowV2SessionEntityType: Represents a session entity
  2738. // type.
  2739. //
  2740. // Extends or replaces a developer entity type at the user session level
  2741. // (we
  2742. // refer to the entity types defined at the agent level as "developer
  2743. // entity
  2744. // types").
  2745. //
  2746. // Note: session entity types apply to all queries, regardless of the
  2747. // language.
  2748. type GoogleCloudDialogflowV2SessionEntityType struct {
  2749. // Entities: Required. The collection of entities associated with this
  2750. // session entity
  2751. // type.
  2752. Entities []*GoogleCloudDialogflowV2EntityTypeEntity `json:"entities,omitempty"`
  2753. // EntityOverrideMode: Required. Indicates whether the additional data
  2754. // should override or
  2755. // supplement the developer entity type definition.
  2756. //
  2757. // Possible values:
  2758. // "ENTITY_OVERRIDE_MODE_UNSPECIFIED" - Not specified. This value
  2759. // should be never used.
  2760. // "ENTITY_OVERRIDE_MODE_OVERRIDE" - The collection of session
  2761. // entities overrides the collection of entities
  2762. // in the corresponding developer entity type.
  2763. // "ENTITY_OVERRIDE_MODE_SUPPLEMENT" - The collection of session
  2764. // entities extends the collection of entities in
  2765. // the corresponding developer entity type.
  2766. //
  2767. // Note: Even in this override mode calls to
  2768. // `ListSessionEntityTypes`,
  2769. // `GetSessionEntityType`, `CreateSessionEntityType`
  2770. // and
  2771. // `UpdateSessionEntityType` only return the additional entities added
  2772. // in
  2773. // this session entity type. If you want to get the supplemented
  2774. // list,
  2775. // please call EntityTypes.GetEntityType on the developer entity
  2776. // type
  2777. // and merge.
  2778. EntityOverrideMode string `json:"entityOverrideMode,omitempty"`
  2779. // Name: Required. The unique identifier of this session entity type.
  2780. // Format:
  2781. // `projects/<Project ID>/agent/sessions/<Session
  2782. // ID>/entityTypes/<Entity Type
  2783. // Display Name>`.
  2784. //
  2785. // `<Entity Type Display Name>` must be the display name of an existing
  2786. // entity
  2787. // type in the same agent that will be overridden or supplemented.
  2788. Name string `json:"name,omitempty"`
  2789. // ServerResponse contains the HTTP response code and headers from the
  2790. // server.
  2791. googleapi.ServerResponse `json:"-"`
  2792. // ForceSendFields is a list of field names (e.g. "Entities") to
  2793. // unconditionally include in API requests. By default, fields with
  2794. // empty values are omitted from API requests. However, any non-pointer,
  2795. // non-interface field appearing in ForceSendFields will be sent to the
  2796. // server regardless of whether the field is empty or not. This may be
  2797. // used to include empty fields in Patch requests.
  2798. ForceSendFields []string `json:"-"`
  2799. // NullFields is a list of field names (e.g. "Entities") to include in
  2800. // API requests with the JSON null value. By default, fields with empty
  2801. // values are omitted from API requests. However, any field with an
  2802. // empty value appearing in NullFields will be sent to the server as
  2803. // null. It is an error if a field in this list has a non-empty value.
  2804. // This may be used to include null fields in Patch requests.
  2805. NullFields []string `json:"-"`
  2806. }
  2807. func (s *GoogleCloudDialogflowV2SessionEntityType) MarshalJSON() ([]byte, error) {
  2808. type NoMethod GoogleCloudDialogflowV2SessionEntityType
  2809. raw := NoMethod(*s)
  2810. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2811. }
  2812. // GoogleCloudDialogflowV2TextInput: Represents the natural language
  2813. // text to be processed.
  2814. type GoogleCloudDialogflowV2TextInput struct {
  2815. // LanguageCode: Required. The language of this conversational query.
  2816. // See [Language
  2817. // Support](https://dialogflow.com/docs/languages) for a list of
  2818. // the
  2819. // currently supported language codes. Note that queries in the same
  2820. // session
  2821. // do not necessarily need to specify the same language.
  2822. LanguageCode string `json:"languageCode,omitempty"`
  2823. // Text: Required. The UTF-8 encoded natural language text to be
  2824. // processed.
  2825. // Text length must not exceed 256 characters.
  2826. Text string `json:"text,omitempty"`
  2827. // ForceSendFields is a list of field names (e.g. "LanguageCode") to
  2828. // unconditionally include in API requests. By default, fields with
  2829. // empty values are omitted from API requests. However, any non-pointer,
  2830. // non-interface field appearing in ForceSendFields will be sent to the
  2831. // server regardless of whether the field is empty or not. This may be
  2832. // used to include empty fields in Patch requests.
  2833. ForceSendFields []string `json:"-"`
  2834. // NullFields is a list of field names (e.g. "LanguageCode") to include
  2835. // in API requests with the JSON null value. By default, fields with
  2836. // empty values are omitted from API requests. However, any field with
  2837. // an empty value appearing in NullFields will be sent to the server as
  2838. // null. It is an error if a field in this list has a non-empty value.
  2839. // This may be used to include null fields in Patch requests.
  2840. NullFields []string `json:"-"`
  2841. }
  2842. func (s *GoogleCloudDialogflowV2TextInput) MarshalJSON() ([]byte, error) {
  2843. type NoMethod GoogleCloudDialogflowV2TextInput
  2844. raw := NoMethod(*s)
  2845. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2846. }
  2847. // GoogleCloudDialogflowV2TrainAgentRequest: The request message for
  2848. // Agents.TrainAgent.
  2849. type GoogleCloudDialogflowV2TrainAgentRequest struct {
  2850. }
  2851. // GoogleCloudDialogflowV2WebhookRequest: The request message for a
  2852. // webhook call.
  2853. type GoogleCloudDialogflowV2WebhookRequest struct {
  2854. // OriginalDetectIntentRequest: Optional. The contents of the original
  2855. // request that was passed to
  2856. // `[Streaming]DetectIntent` call.
  2857. OriginalDetectIntentRequest *GoogleCloudDialogflowV2OriginalDetectIntentRequest `json:"originalDetectIntentRequest,omitempty"`
  2858. // QueryResult: The result of the conversational query or event
  2859. // processing. Contains the
  2860. // same value as `[Streaming]DetectIntentResponse.query_result`.
  2861. QueryResult *GoogleCloudDialogflowV2QueryResult `json:"queryResult,omitempty"`
  2862. // ResponseId: The unique identifier of the response. Contains the same
  2863. // value as
  2864. // `[Streaming]DetectIntentResponse.response_id`.
  2865. ResponseId string `json:"responseId,omitempty"`
  2866. // Session: The unique identifier of detectIntent request session.
  2867. // Can be used to identify end-user inside webhook
  2868. // implementation.
  2869. // Format: `projects/<Project ID>/agent/sessions/<Session ID>`,
  2870. // or
  2871. // `projects/<Project ID>/agent/environments/<Environment
  2872. // ID>/users/<User
  2873. // ID>/sessions/<Session ID>`.
  2874. Session string `json:"session,omitempty"`
  2875. // ForceSendFields is a list of field names (e.g.
  2876. // "OriginalDetectIntentRequest") to unconditionally include in API
  2877. // requests. By default, fields with empty values are omitted from API
  2878. // requests. However, any non-pointer, non-interface field appearing in
  2879. // ForceSendFields will be sent to the server regardless of whether the
  2880. // field is empty or not. This may be used to include empty fields in
  2881. // Patch requests.
  2882. ForceSendFields []string `json:"-"`
  2883. // NullFields is a list of field names (e.g.
  2884. // "OriginalDetectIntentRequest") to include in API requests with the
  2885. // JSON null value. By default, fields with empty values are omitted
  2886. // from API requests. However, any field with an empty value appearing
  2887. // in NullFields will be sent to the server as null. It is an error if a
  2888. // field in this list has a non-empty value. This may be used to include
  2889. // null fields in Patch requests.
  2890. NullFields []string `json:"-"`
  2891. }
  2892. func (s *GoogleCloudDialogflowV2WebhookRequest) MarshalJSON() ([]byte, error) {
  2893. type NoMethod GoogleCloudDialogflowV2WebhookRequest
  2894. raw := NoMethod(*s)
  2895. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2896. }
  2897. // GoogleCloudDialogflowV2WebhookResponse: The response message for a
  2898. // webhook call.
  2899. type GoogleCloudDialogflowV2WebhookResponse struct {
  2900. // FollowupEventInput: Optional. Makes the platform immediately invoke
  2901. // another `DetectIntent` call
  2902. // internally with the specified event as input.
  2903. FollowupEventInput *GoogleCloudDialogflowV2EventInput `json:"followupEventInput,omitempty"`
  2904. // FulfillmentMessages: Optional. The collection of rich messages to
  2905. // present to the user. This
  2906. // value is passed directly to `QueryResult.fulfillment_messages`.
  2907. FulfillmentMessages []*GoogleCloudDialogflowV2IntentMessage `json:"fulfillmentMessages,omitempty"`
  2908. // FulfillmentText: Optional. The text to be shown on the screen. This
  2909. // value is passed directly
  2910. // to `QueryResult.fulfillment_text`.
  2911. FulfillmentText string `json:"fulfillmentText,omitempty"`
  2912. // OutputContexts: Optional. The collection of output contexts. This
  2913. // value is passed directly
  2914. // to `QueryResult.output_contexts`.
  2915. OutputContexts []*GoogleCloudDialogflowV2Context `json:"outputContexts,omitempty"`
  2916. // Payload: Optional. This value is passed directly to
  2917. // `QueryResult.webhook_payload`.
  2918. // See the related `fulfillment_messages[i].payload field`, which may be
  2919. // used
  2920. // as an alternative to this field.
  2921. //
  2922. // This field can be used for Actions on Google responses.
  2923. // It should have a structure similar to the JSON message shown here.
  2924. // For more
  2925. // information, see
  2926. // [Actions on Google
  2927. // Webhook
  2928. // Format](https://developers.google.com/actions/dialogflow/webho
  2929. // ok)
  2930. // <pre>{
  2931. // "google": {
  2932. // "expectUserResponse": true,
  2933. // "richResponse": {
  2934. // "items": [
  2935. // {
  2936. // "simpleResponse": {
  2937. // "textToSpeech": "this is a simple response"
  2938. // }
  2939. // }
  2940. // ]
  2941. // }
  2942. // }
  2943. // }</pre>
  2944. Payload googleapi.RawMessage `json:"payload,omitempty"`
  2945. // Source: Optional. This value is passed directly to
  2946. // `QueryResult.webhook_source`.
  2947. Source string `json:"source,omitempty"`
  2948. // ForceSendFields is a list of field names (e.g. "FollowupEventInput")
  2949. // to unconditionally include in API requests. By default, fields with
  2950. // empty values are omitted from API requests. However, any non-pointer,
  2951. // non-interface field appearing in ForceSendFields will be sent to the
  2952. // server regardless of whether the field is empty or not. This may be
  2953. // used to include empty fields in Patch requests.
  2954. ForceSendFields []string `json:"-"`
  2955. // NullFields is a list of field names (e.g. "FollowupEventInput") to
  2956. // include in API requests with the JSON null value. By default, fields
  2957. // with empty values are omitted from API requests. However, any field
  2958. // with an empty value appearing in NullFields will be sent to the
  2959. // server as null. It is an error if a field in this list has a
  2960. // non-empty value. This may be used to include null fields in Patch
  2961. // requests.
  2962. NullFields []string `json:"-"`
  2963. }
  2964. func (s *GoogleCloudDialogflowV2WebhookResponse) MarshalJSON() ([]byte, error) {
  2965. type NoMethod GoogleCloudDialogflowV2WebhookResponse
  2966. raw := NoMethod(*s)
  2967. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2968. }
  2969. // GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesResponse: The
  2970. // response message for EntityTypes.BatchUpdateEntityTypes.
  2971. type GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesResponse struct {
  2972. // EntityTypes: The collection of updated or created entity types.
  2973. EntityTypes []*GoogleCloudDialogflowV2beta1EntityType `json:"entityTypes,omitempty"`
  2974. // ForceSendFields is a list of field names (e.g. "EntityTypes") to
  2975. // unconditionally include in API requests. By default, fields with
  2976. // empty values are omitted from API requests. However, any non-pointer,
  2977. // non-interface field appearing in ForceSendFields will be sent to the
  2978. // server regardless of whether the field is empty or not. This may be
  2979. // used to include empty fields in Patch requests.
  2980. ForceSendFields []string `json:"-"`
  2981. // NullFields is a list of field names (e.g. "EntityTypes") to include
  2982. // in API requests with the JSON null value. By default, fields with
  2983. // empty values are omitted from API requests. However, any field with
  2984. // an empty value appearing in NullFields will be sent to the server as
  2985. // null. It is an error if a field in this list has a non-empty value.
  2986. // This may be used to include null fields in Patch requests.
  2987. NullFields []string `json:"-"`
  2988. }
  2989. func (s *GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesResponse) MarshalJSON() ([]byte, error) {
  2990. type NoMethod GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesResponse
  2991. raw := NoMethod(*s)
  2992. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2993. }
  2994. // GoogleCloudDialogflowV2beta1BatchUpdateIntentsResponse: The response
  2995. // message for Intents.BatchUpdateIntents.
  2996. type GoogleCloudDialogflowV2beta1BatchUpdateIntentsResponse struct {
  2997. // Intents: The collection of updated or created intents.
  2998. Intents []*GoogleCloudDialogflowV2beta1Intent `json:"intents,omitempty"`
  2999. // ForceSendFields is a list of field names (e.g. "Intents") to
  3000. // unconditionally include in API requests. By default, fields with
  3001. // empty values are omitted from API requests. However, any non-pointer,
  3002. // non-interface field appearing in ForceSendFields will be sent to the
  3003. // server regardless of whether the field is empty or not. This may be
  3004. // used to include empty fields in Patch requests.
  3005. ForceSendFields []string `json:"-"`
  3006. // NullFields is a list of field names (e.g. "Intents") to include in
  3007. // API requests with the JSON null value. By default, fields with empty
  3008. // values are omitted from API requests. However, any field with an
  3009. // empty value appearing in NullFields will be sent to the server as
  3010. // null. It is an error if a field in this list has a non-empty value.
  3011. // This may be used to include null fields in Patch requests.
  3012. NullFields []string `json:"-"`
  3013. }
  3014. func (s *GoogleCloudDialogflowV2beta1BatchUpdateIntentsResponse) MarshalJSON() ([]byte, error) {
  3015. type NoMethod GoogleCloudDialogflowV2beta1BatchUpdateIntentsResponse
  3016. raw := NoMethod(*s)
  3017. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3018. }
  3019. // GoogleCloudDialogflowV2beta1Context: Represents a context.
  3020. type GoogleCloudDialogflowV2beta1Context struct {
  3021. // LifespanCount: Optional. The number of conversational query requests
  3022. // after which the
  3023. // context expires. If set to `0` (the default) the context
  3024. // expires
  3025. // immediately. Contexts expire automatically after 20 minutes if
  3026. // there
  3027. // are no matching queries.
  3028. LifespanCount int64 `json:"lifespanCount,omitempty"`
  3029. // Name: Required. The unique identifier of the context.
  3030. // Format:
  3031. // `projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context
  3032. // ID>`,
  3033. // or `projects/<Project ID>/agent/environments/<Environment
  3034. // ID>/users/<User
  3035. // ID>/sessions/<Session ID>/contexts/<Context ID>`.
  3036. //
  3037. // The `Context ID` is always converted to lowercase, may only
  3038. // contain
  3039. // characters in a-zA-Z0-9_-% and may be at most 250 bytes long.
  3040. //
  3041. // If `Environment ID` is not specified, we assume default
  3042. // 'draft'
  3043. // environment. If `User ID` is not specified, we assume default '-'
  3044. // user.
  3045. Name string `json:"name,omitempty"`
  3046. // Parameters: Optional. The collection of parameters associated with
  3047. // this context.
  3048. // Refer to [this
  3049. // doc](https://dialogflow.com/docs/actions-and-parameters) for
  3050. // syntax.
  3051. Parameters googleapi.RawMessage `json:"parameters,omitempty"`
  3052. // ForceSendFields is a list of field names (e.g. "LifespanCount") to
  3053. // unconditionally include in API requests. By default, fields with
  3054. // empty values are omitted from API requests. However, any non-pointer,
  3055. // non-interface field appearing in ForceSendFields will be sent to the
  3056. // server regardless of whether the field is empty or not. This may be
  3057. // used to include empty fields in Patch requests.
  3058. ForceSendFields []string `json:"-"`
  3059. // NullFields is a list of field names (e.g. "LifespanCount") to include
  3060. // in API requests with the JSON null value. By default, fields with
  3061. // empty values are omitted from API requests. However, any field with
  3062. // an empty value appearing in NullFields will be sent to the server as
  3063. // null. It is an error if a field in this list has a non-empty value.
  3064. // This may be used to include null fields in Patch requests.
  3065. NullFields []string `json:"-"`
  3066. }
  3067. func (s *GoogleCloudDialogflowV2beta1Context) MarshalJSON() ([]byte, error) {
  3068. type NoMethod GoogleCloudDialogflowV2beta1Context
  3069. raw := NoMethod(*s)
  3070. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3071. }
  3072. // GoogleCloudDialogflowV2beta1EntityType: Represents an entity
  3073. // type.
  3074. // Entity types serve as a tool for extracting parameter values from
  3075. // natural
  3076. // language queries.
  3077. type GoogleCloudDialogflowV2beta1EntityType struct {
  3078. // AutoExpansionMode: Optional. Indicates whether the entity type can be
  3079. // automatically
  3080. // expanded.
  3081. //
  3082. // Possible values:
  3083. // "AUTO_EXPANSION_MODE_UNSPECIFIED" - Auto expansion disabled for the
  3084. // entity.
  3085. // "AUTO_EXPANSION_MODE_DEFAULT" - Allows an agent to recognize values
  3086. // that have not been explicitly
  3087. // listed in the entity.
  3088. AutoExpansionMode string `json:"autoExpansionMode,omitempty"`
  3089. // DisplayName: Required. The name of the entity type.
  3090. DisplayName string `json:"displayName,omitempty"`
  3091. // Entities: Optional. The collection of entity entries associated with
  3092. // the entity type.
  3093. Entities []*GoogleCloudDialogflowV2beta1EntityTypeEntity `json:"entities,omitempty"`
  3094. // Kind: Required. Indicates the kind of entity type.
  3095. //
  3096. // Possible values:
  3097. // "KIND_UNSPECIFIED" - Not specified. This value should be never
  3098. // used.
  3099. // "KIND_MAP" - Map entity types allow mapping of a group of synonyms
  3100. // to a canonical
  3101. // value.
  3102. // "KIND_LIST" - List entity types contain a set of entries that do
  3103. // not map to canonical
  3104. // values. However, list entity types can contain references to other
  3105. // entity
  3106. // types (with or without aliases).
  3107. Kind string `json:"kind,omitempty"`
  3108. // Name: The unique identifier of the entity type.
  3109. // Required for EntityTypes.UpdateEntityType
  3110. // and
  3111. // EntityTypes.BatchUpdateEntityTypes methods.
  3112. // Format: `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.
  3113. Name string `json:"name,omitempty"`
  3114. // ForceSendFields is a list of field names (e.g. "AutoExpansionMode")
  3115. // to unconditionally include in API requests. By default, fields with
  3116. // empty values are omitted from API requests. However, any non-pointer,
  3117. // non-interface field appearing in ForceSendFields will be sent to the
  3118. // server regardless of whether the field is empty or not. This may be
  3119. // used to include empty fields in Patch requests.
  3120. ForceSendFields []string `json:"-"`
  3121. // NullFields is a list of field names (e.g. "AutoExpansionMode") to
  3122. // include in API requests with the JSON null value. By default, fields
  3123. // with empty values are omitted from API requests. However, any field
  3124. // with an empty value appearing in NullFields will be sent to the
  3125. // server as null. It is an error if a field in this list has a
  3126. // non-empty value. This may be used to include null fields in Patch
  3127. // requests.
  3128. NullFields []string `json:"-"`
  3129. }
  3130. func (s *GoogleCloudDialogflowV2beta1EntityType) MarshalJSON() ([]byte, error) {
  3131. type NoMethod GoogleCloudDialogflowV2beta1EntityType
  3132. raw := NoMethod(*s)
  3133. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3134. }
  3135. // GoogleCloudDialogflowV2beta1EntityTypeEntity: An **entity entry** for
  3136. // an associated entity type.
  3137. type GoogleCloudDialogflowV2beta1EntityTypeEntity struct {
  3138. // Synonyms: Required. A collection of value synonyms. For example, if
  3139. // the entity type
  3140. // is *vegetable*, and `value` is *scallions*, a synonym could be
  3141. // *green
  3142. // onions*.
  3143. //
  3144. // For `KIND_LIST` entity types:
  3145. //
  3146. // * This collection must contain exactly one synonym equal to
  3147. // `value`.
  3148. Synonyms []string `json:"synonyms,omitempty"`
  3149. // Value: Required. The primary value associated with this entity
  3150. // entry.
  3151. // For example, if the entity type is *vegetable*, the value could
  3152. // be
  3153. // *scallions*.
  3154. //
  3155. // For `KIND_MAP` entity types:
  3156. //
  3157. // * A canonical value to be used in place of synonyms.
  3158. //
  3159. // For `KIND_LIST` entity types:
  3160. //
  3161. // * A string that can contain references to other entity types (with
  3162. // or
  3163. // without aliases).
  3164. Value string `json:"value,omitempty"`
  3165. // ForceSendFields is a list of field names (e.g. "Synonyms") to
  3166. // unconditionally include in API requests. By default, fields with
  3167. // empty values are omitted from API requests. However, any non-pointer,
  3168. // non-interface field appearing in ForceSendFields will be sent to the
  3169. // server regardless of whether the field is empty or not. This may be
  3170. // used to include empty fields in Patch requests.
  3171. ForceSendFields []string `json:"-"`
  3172. // NullFields is a list of field names (e.g. "Synonyms") to include in
  3173. // API requests with the JSON null value. By default, fields with empty
  3174. // values are omitted from API requests. However, any field with an
  3175. // empty value appearing in NullFields will be sent to the server as
  3176. // null. It is an error if a field in this list has a non-empty value.
  3177. // This may be used to include null fields in Patch requests.
  3178. NullFields []string `json:"-"`
  3179. }
  3180. func (s *GoogleCloudDialogflowV2beta1EntityTypeEntity) MarshalJSON() ([]byte, error) {
  3181. type NoMethod GoogleCloudDialogflowV2beta1EntityTypeEntity
  3182. raw := NoMethod(*s)
  3183. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3184. }
  3185. // GoogleCloudDialogflowV2beta1EventInput: Events allow for matching
  3186. // intents by event name instead of the natural
  3187. // language input. For instance, input `<event: { name:
  3188. // "welcome_event",
  3189. // parameters: { name: "Sam" } }>` can trigger a personalized welcome
  3190. // response.
  3191. // The parameter `name` may be used by the agent in the
  3192. // response:
  3193. // "Hello #welcome_event.name! What can I do for you today?".
  3194. type GoogleCloudDialogflowV2beta1EventInput struct {
  3195. // LanguageCode: Required. The language of this query. See
  3196. // [Language
  3197. // Support](https://dialogflow.com/docs/languages) for a list of
  3198. // the
  3199. // currently supported language codes. Note that queries in the same
  3200. // session
  3201. // do not necessarily need to specify the same language.
  3202. LanguageCode string `json:"languageCode,omitempty"`
  3203. // Name: Required. The unique identifier of the event.
  3204. Name string `json:"name,omitempty"`
  3205. // Parameters: Optional. The collection of parameters associated with
  3206. // the event.
  3207. Parameters googleapi.RawMessage `json:"parameters,omitempty"`
  3208. // ForceSendFields is a list of field names (e.g. "LanguageCode") to
  3209. // unconditionally include in API requests. By default, fields with
  3210. // empty values are omitted from API requests. However, any non-pointer,
  3211. // non-interface field appearing in ForceSendFields will be sent to the
  3212. // server regardless of whether the field is empty or not. This may be
  3213. // used to include empty fields in Patch requests.
  3214. ForceSendFields []string `json:"-"`
  3215. // NullFields is a list of field names (e.g. "LanguageCode") to include
  3216. // in API requests with the JSON null value. By default, fields with
  3217. // empty values are omitted from API requests. However, any field with
  3218. // an empty value appearing in NullFields will be sent to the server as
  3219. // null. It is an error if a field in this list has a non-empty value.
  3220. // This may be used to include null fields in Patch requests.
  3221. NullFields []string `json:"-"`
  3222. }
  3223. func (s *GoogleCloudDialogflowV2beta1EventInput) MarshalJSON() ([]byte, error) {
  3224. type NoMethod GoogleCloudDialogflowV2beta1EventInput
  3225. raw := NoMethod(*s)
  3226. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3227. }
  3228. // GoogleCloudDialogflowV2beta1ExportAgentResponse: The response message
  3229. // for Agents.ExportAgent.
  3230. type GoogleCloudDialogflowV2beta1ExportAgentResponse struct {
  3231. // AgentContent: The exported agent.
  3232. //
  3233. // Example for how to export an agent to a zip file via a command
  3234. // line:
  3235. // <pre>curl \
  3236. //
  3237. // 'https://dialogflow.googleapis.com/v2beta1/projects/&lt;project_name&g
  3238. // t;/agent:export'\
  3239. // -X POST \
  3240. // -H 'Authorization: Bearer '$(gcloud auth application-default
  3241. // print-access-token) \
  3242. // -H 'Accept: application/json' \
  3243. // -H 'Content-Type: application/json' \
  3244. // --compressed \
  3245. // --data-binary '{}' \
  3246. // | grep agentContent | sed -e 's/.*"agentContent": "\([^"]*\)".*/\1/'
  3247. // \
  3248. // | base64 --decode > &lt;agent zip file&gt;</pre>
  3249. AgentContent string `json:"agentContent,omitempty"`
  3250. // AgentUri: The URI to a file containing the exported agent. This field
  3251. // is populated
  3252. // only if `agent_uri` is specified in `ExportAgentRequest`.
  3253. AgentUri string `json:"agentUri,omitempty"`
  3254. // ForceSendFields is a list of field names (e.g. "AgentContent") to
  3255. // unconditionally include in API requests. By default, fields with
  3256. // empty values are omitted from API requests. However, any non-pointer,
  3257. // non-interface field appearing in ForceSendFields will be sent to the
  3258. // server regardless of whether the field is empty or not. This may be
  3259. // used to include empty fields in Patch requests.
  3260. ForceSendFields []string `json:"-"`
  3261. // NullFields is a list of field names (e.g. "AgentContent") to include
  3262. // in API requests with the JSON null value. By default, fields with
  3263. // empty values are omitted from API requests. However, any field with
  3264. // an empty value appearing in NullFields will be sent to the server as
  3265. // null. It is an error if a field in this list has a non-empty value.
  3266. // This may be used to include null fields in Patch requests.
  3267. NullFields []string `json:"-"`
  3268. }
  3269. func (s *GoogleCloudDialogflowV2beta1ExportAgentResponse) MarshalJSON() ([]byte, error) {
  3270. type NoMethod GoogleCloudDialogflowV2beta1ExportAgentResponse
  3271. raw := NoMethod(*s)
  3272. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3273. }
  3274. // GoogleCloudDialogflowV2beta1Intent: Represents an intent.
  3275. // Intents convert a number of user expressions or patterns into an
  3276. // action. An
  3277. // action is an extraction of a user command or sentence semantics.
  3278. type GoogleCloudDialogflowV2beta1Intent struct {
  3279. // Action: Optional. The name of the action associated with the
  3280. // intent.
  3281. // Note: The action name must not contain whitespaces.
  3282. Action string `json:"action,omitempty"`
  3283. // DefaultResponsePlatforms: Optional. The list of platforms for which
  3284. // the first response will be
  3285. // taken from among the messages assigned to the DEFAULT_PLATFORM.
  3286. //
  3287. // Possible values:
  3288. // "PLATFORM_UNSPECIFIED" - Not specified.
  3289. // "FACEBOOK" - Facebook.
  3290. // "SLACK" - Slack.
  3291. // "TELEGRAM" - Telegram.
  3292. // "KIK" - Kik.
  3293. // "SKYPE" - Skype.
  3294. // "LINE" - Line.
  3295. // "VIBER" - Viber.
  3296. // "ACTIONS_ON_GOOGLE" - Actions on Google.
  3297. // When using Actions on Google, you can choose one of the
  3298. // specific
  3299. // Intent.Message types that mention support for Actions on Google,
  3300. // or you can use the advanced Intent.Message.payload field.
  3301. // The payload field provides access to AoG features not available in
  3302. // the
  3303. // specific message types.
  3304. // If using the Intent.Message.payload field, it should have a
  3305. // structure
  3306. // similar to the JSON message shown here. For more information,
  3307. // see
  3308. // [Actions on Google
  3309. // Webhook
  3310. // Format](https://developers.google.com/actions/dialogflow/webho
  3311. // ok)
  3312. // <pre>{
  3313. // "expectUserResponse": true,
  3314. // "isSsml": false,
  3315. // "noInputPrompts": [],
  3316. // "richResponse": {
  3317. // "items": [
  3318. // {
  3319. // "simpleResponse": {
  3320. // "displayText": "hi",
  3321. // "textToSpeech": "hello"
  3322. // }
  3323. // }
  3324. // ],
  3325. // "suggestions": [
  3326. // {
  3327. // "title": "Say this"
  3328. // },
  3329. // {
  3330. // "title": "or this"
  3331. // }
  3332. // ]
  3333. // },
  3334. // "systemIntent": {
  3335. // "data": {
  3336. // "@type":
  3337. // "type.googleapis.com/google.actions.v2.OptionValueSpec",
  3338. // "listSelect": {
  3339. // "items": [
  3340. // {
  3341. // "optionInfo": {
  3342. // "key": "key1",
  3343. // "synonyms": [
  3344. // "key one"
  3345. // ]
  3346. // },
  3347. // "title": "must not be empty, but unique"
  3348. // },
  3349. // {
  3350. // "optionInfo": {
  3351. // "key": "key2",
  3352. // "synonyms": [
  3353. // "key two"
  3354. // ]
  3355. // },
  3356. // "title": "must not be empty, but unique"
  3357. // }
  3358. // ]
  3359. // }
  3360. // },
  3361. // "intent": "actions.intent.OPTION"
  3362. // }
  3363. // }</pre>
  3364. // "TELEPHONY" - Telephony Gateway.
  3365. DefaultResponsePlatforms []string `json:"defaultResponsePlatforms,omitempty"`
  3366. // DisplayName: Required. The name of this intent.
  3367. DisplayName string `json:"displayName,omitempty"`
  3368. // EndInteraction: Optional. Indicates that this intent ends an
  3369. // interaction. Some integrations
  3370. // (e.g., Actions on Google or Dialogflow phone gateway) use this
  3371. // information
  3372. // to close interaction with an end user. Default is false.
  3373. EndInteraction bool `json:"endInteraction,omitempty"`
  3374. // Events: Optional. The collection of event names that trigger the
  3375. // intent.
  3376. // If the collection of input contexts is not empty, all of the contexts
  3377. // must
  3378. // be present in the active user session for an event to trigger this
  3379. // intent.
  3380. Events []string `json:"events,omitempty"`
  3381. // FollowupIntentInfo: Read-only. Information about all followup intents
  3382. // that have this intent as
  3383. // a direct or indirect parent. We populate this field only in the
  3384. // output.
  3385. FollowupIntentInfo []*GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo `json:"followupIntentInfo,omitempty"`
  3386. // InputContextNames: Optional. The list of context names required for
  3387. // this intent to be
  3388. // triggered.
  3389. // Format: `projects/<Project ID>/agent/sessions/-/contexts/<Context
  3390. // ID>`.
  3391. InputContextNames []string `json:"inputContextNames,omitempty"`
  3392. // IsFallback: Optional. Indicates whether this is a fallback intent.
  3393. IsFallback bool `json:"isFallback,omitempty"`
  3394. // Messages: Optional. The collection of rich messages corresponding to
  3395. // the
  3396. // `Response` field in the Dialogflow console.
  3397. Messages []*GoogleCloudDialogflowV2beta1IntentMessage `json:"messages,omitempty"`
  3398. // MlDisabled: Optional. Indicates whether Machine Learning is disabled
  3399. // for the intent.
  3400. // Note: If `ml_disabled` setting is set to true, then this intent is
  3401. // not
  3402. // taken into account during inference in `ML ONLY` match mode.
  3403. // Also,
  3404. // auto-markup in the UI is turned off.
  3405. MlDisabled bool `json:"mlDisabled,omitempty"`
  3406. // MlEnabled: Optional. Indicates whether Machine Learning is enabled
  3407. // for the intent.
  3408. // Note: If `ml_enabled` setting is set to false, then this intent is
  3409. // not
  3410. // taken into account during inference in `ML ONLY` match mode.
  3411. // Also,
  3412. // auto-markup in the UI is turned off.
  3413. // DEPRECATED! Please use `ml_disabled` field instead.
  3414. // NOTE: If both `ml_enabled` and `ml_disabled` are either not set or
  3415. // false,
  3416. // then the default value is determined as follows:
  3417. // - Before April 15th, 2018 the default is:
  3418. // ml_enabled = false / ml_disabled = true.
  3419. // - After April 15th, 2018 the default is:
  3420. // ml_enabled = true / ml_disabled = false.
  3421. MlEnabled bool `json:"mlEnabled,omitempty"`
  3422. // Name: The unique identifier of this intent.
  3423. // Required for Intents.UpdateIntent and
  3424. // Intents.BatchUpdateIntents
  3425. // methods.
  3426. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  3427. Name string `json:"name,omitempty"`
  3428. // OutputContexts: Optional. The collection of contexts that are
  3429. // activated when the intent
  3430. // is matched. Context messages in this collection should not set
  3431. // the
  3432. // parameters field. Setting the `lifespan_count` to 0 will reset the
  3433. // context
  3434. // when the intent is matched.
  3435. // Format: `projects/<Project ID>/agent/sessions/-/contexts/<Context
  3436. // ID>`.
  3437. OutputContexts []*GoogleCloudDialogflowV2beta1Context `json:"outputContexts,omitempty"`
  3438. // Parameters: Optional. The collection of parameters associated with
  3439. // the intent.
  3440. Parameters []*GoogleCloudDialogflowV2beta1IntentParameter `json:"parameters,omitempty"`
  3441. // ParentFollowupIntentName: Read-only after creation. The unique
  3442. // identifier of the parent intent in the
  3443. // chain of followup intents. You can set this field when creating an
  3444. // intent,
  3445. // for example with CreateIntent or BatchUpdateIntents, in order to
  3446. // make this intent a followup intent.
  3447. //
  3448. // It identifies the parent followup intent.
  3449. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  3450. ParentFollowupIntentName string `json:"parentFollowupIntentName,omitempty"`
  3451. // Priority: Optional. The priority of this intent. Higher numbers
  3452. // represent higher
  3453. // priorities. If this is zero or unspecified, we use the
  3454. // default
  3455. // priority 500000.
  3456. //
  3457. // Negative numbers mean that the intent is disabled.
  3458. Priority int64 `json:"priority,omitempty"`
  3459. // ResetContexts: Optional. Indicates whether to delete all contexts in
  3460. // the current
  3461. // session when this intent is matched.
  3462. ResetContexts bool `json:"resetContexts,omitempty"`
  3463. // RootFollowupIntentName: Read-only. The unique identifier of the root
  3464. // intent in the chain of
  3465. // followup intents. It identifies the correct followup intents chain
  3466. // for
  3467. // this intent. We populate this field only in the output.
  3468. //
  3469. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  3470. RootFollowupIntentName string `json:"rootFollowupIntentName,omitempty"`
  3471. // TrainingPhrases: Optional. The collection of examples that the agent
  3472. // is
  3473. // trained on.
  3474. TrainingPhrases []*GoogleCloudDialogflowV2beta1IntentTrainingPhrase `json:"trainingPhrases,omitempty"`
  3475. // WebhookState: Optional. Indicates whether webhooks are enabled for
  3476. // the intent.
  3477. //
  3478. // Possible values:
  3479. // "WEBHOOK_STATE_UNSPECIFIED" - Webhook is disabled in the agent and
  3480. // in the intent.
  3481. // "WEBHOOK_STATE_ENABLED" - Webhook is enabled in the agent and in
  3482. // the intent.
  3483. // "WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING" - Webhook is enabled in
  3484. // the agent and in the intent. Also, each slot
  3485. // filling prompt is forwarded to the webhook.
  3486. WebhookState string `json:"webhookState,omitempty"`
  3487. // ForceSendFields is a list of field names (e.g. "Action") to
  3488. // unconditionally include in API requests. By default, fields with
  3489. // empty values are omitted from API requests. However, any non-pointer,
  3490. // non-interface field appearing in ForceSendFields will be sent to the
  3491. // server regardless of whether the field is empty or not. This may be
  3492. // used to include empty fields in Patch requests.
  3493. ForceSendFields []string `json:"-"`
  3494. // NullFields is a list of field names (e.g. "Action") to include in API
  3495. // requests with the JSON null value. By default, fields with empty
  3496. // values are omitted from API requests. However, any field with an
  3497. // empty value appearing in NullFields will be sent to the server as
  3498. // null. It is an error if a field in this list has a non-empty value.
  3499. // This may be used to include null fields in Patch requests.
  3500. NullFields []string `json:"-"`
  3501. }
  3502. func (s *GoogleCloudDialogflowV2beta1Intent) MarshalJSON() ([]byte, error) {
  3503. type NoMethod GoogleCloudDialogflowV2beta1Intent
  3504. raw := NoMethod(*s)
  3505. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3506. }
  3507. // GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo: Represents a
  3508. // single followup intent in the chain.
  3509. type GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo struct {
  3510. // FollowupIntentName: The unique identifier of the followup
  3511. // intent.
  3512. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  3513. FollowupIntentName string `json:"followupIntentName,omitempty"`
  3514. // ParentFollowupIntentName: The unique identifier of the followup
  3515. // intent's parent.
  3516. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  3517. ParentFollowupIntentName string `json:"parentFollowupIntentName,omitempty"`
  3518. // ForceSendFields is a list of field names (e.g. "FollowupIntentName")
  3519. // to unconditionally include in API requests. By default, fields with
  3520. // empty values are omitted from API requests. However, any non-pointer,
  3521. // non-interface field appearing in ForceSendFields will be sent to the
  3522. // server regardless of whether the field is empty or not. This may be
  3523. // used to include empty fields in Patch requests.
  3524. ForceSendFields []string `json:"-"`
  3525. // NullFields is a list of field names (e.g. "FollowupIntentName") to
  3526. // include in API requests with the JSON null value. By default, fields
  3527. // with empty values are omitted from API requests. However, any field
  3528. // with an empty value appearing in NullFields will be sent to the
  3529. // server as null. It is an error if a field in this list has a
  3530. // non-empty value. This may be used to include null fields in Patch
  3531. // requests.
  3532. NullFields []string `json:"-"`
  3533. }
  3534. func (s *GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo) MarshalJSON() ([]byte, error) {
  3535. type NoMethod GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo
  3536. raw := NoMethod(*s)
  3537. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3538. }
  3539. // GoogleCloudDialogflowV2beta1IntentMessage: Corresponds to the
  3540. // `Response` field in the Dialogflow console.
  3541. type GoogleCloudDialogflowV2beta1IntentMessage struct {
  3542. // BasicCard: Displays a basic card for Actions on Google.
  3543. BasicCard *GoogleCloudDialogflowV2beta1IntentMessageBasicCard `json:"basicCard,omitempty"`
  3544. // Card: Displays a card.
  3545. Card *GoogleCloudDialogflowV2beta1IntentMessageCard `json:"card,omitempty"`
  3546. // CarouselSelect: Displays a carousel card for Actions on Google.
  3547. CarouselSelect *GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect `json:"carouselSelect,omitempty"`
  3548. // Image: Displays an image.
  3549. Image *GoogleCloudDialogflowV2beta1IntentMessageImage `json:"image,omitempty"`
  3550. // LinkOutSuggestion: Displays a link out suggestion chip for Actions on
  3551. // Google.
  3552. LinkOutSuggestion *GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion `json:"linkOutSuggestion,omitempty"`
  3553. // ListSelect: Displays a list card for Actions on Google.
  3554. ListSelect *GoogleCloudDialogflowV2beta1IntentMessageListSelect `json:"listSelect,omitempty"`
  3555. // Payload: Returns a response containing a custom, platform-specific
  3556. // payload.
  3557. // See the Intent.Message.Platform type for a description of
  3558. // the
  3559. // structure that may be required for your platform.
  3560. Payload googleapi.RawMessage `json:"payload,omitempty"`
  3561. // Platform: Optional. The platform that this message is intended for.
  3562. //
  3563. // Possible values:
  3564. // "PLATFORM_UNSPECIFIED" - Not specified.
  3565. // "FACEBOOK" - Facebook.
  3566. // "SLACK" - Slack.
  3567. // "TELEGRAM" - Telegram.
  3568. // "KIK" - Kik.
  3569. // "SKYPE" - Skype.
  3570. // "LINE" - Line.
  3571. // "VIBER" - Viber.
  3572. // "ACTIONS_ON_GOOGLE" - Actions on Google.
  3573. // When using Actions on Google, you can choose one of the
  3574. // specific
  3575. // Intent.Message types that mention support for Actions on Google,
  3576. // or you can use the advanced Intent.Message.payload field.
  3577. // The payload field provides access to AoG features not available in
  3578. // the
  3579. // specific message types.
  3580. // If using the Intent.Message.payload field, it should have a
  3581. // structure
  3582. // similar to the JSON message shown here. For more information,
  3583. // see
  3584. // [Actions on Google
  3585. // Webhook
  3586. // Format](https://developers.google.com/actions/dialogflow/webho
  3587. // ok)
  3588. // <pre>{
  3589. // "expectUserResponse": true,
  3590. // "isSsml": false,
  3591. // "noInputPrompts": [],
  3592. // "richResponse": {
  3593. // "items": [
  3594. // {
  3595. // "simpleResponse": {
  3596. // "displayText": "hi",
  3597. // "textToSpeech": "hello"
  3598. // }
  3599. // }
  3600. // ],
  3601. // "suggestions": [
  3602. // {
  3603. // "title": "Say this"
  3604. // },
  3605. // {
  3606. // "title": "or this"
  3607. // }
  3608. // ]
  3609. // },
  3610. // "systemIntent": {
  3611. // "data": {
  3612. // "@type":
  3613. // "type.googleapis.com/google.actions.v2.OptionValueSpec",
  3614. // "listSelect": {
  3615. // "items": [
  3616. // {
  3617. // "optionInfo": {
  3618. // "key": "key1",
  3619. // "synonyms": [
  3620. // "key one"
  3621. // ]
  3622. // },
  3623. // "title": "must not be empty, but unique"
  3624. // },
  3625. // {
  3626. // "optionInfo": {
  3627. // "key": "key2",
  3628. // "synonyms": [
  3629. // "key two"
  3630. // ]
  3631. // },
  3632. // "title": "must not be empty, but unique"
  3633. // }
  3634. // ]
  3635. // }
  3636. // },
  3637. // "intent": "actions.intent.OPTION"
  3638. // }
  3639. // }</pre>
  3640. // "TELEPHONY" - Telephony Gateway.
  3641. Platform string `json:"platform,omitempty"`
  3642. // QuickReplies: Displays quick replies.
  3643. QuickReplies *GoogleCloudDialogflowV2beta1IntentMessageQuickReplies `json:"quickReplies,omitempty"`
  3644. // SimpleResponses: Returns a voice or text-only response for Actions on
  3645. // Google.
  3646. SimpleResponses *GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses `json:"simpleResponses,omitempty"`
  3647. // Suggestions: Displays suggestion chips for Actions on Google.
  3648. Suggestions *GoogleCloudDialogflowV2beta1IntentMessageSuggestions `json:"suggestions,omitempty"`
  3649. // TelephonyPlayAudio: Plays audio from a file in Telephony Gateway.
  3650. TelephonyPlayAudio *GoogleCloudDialogflowV2beta1IntentMessageTelephonyPlayAudio `json:"telephonyPlayAudio,omitempty"`
  3651. // TelephonySynthesizeSpeech: Synthesizes speech in Telephony Gateway.
  3652. TelephonySynthesizeSpeech *GoogleCloudDialogflowV2beta1IntentMessageTelephonySynthesizeSpeech `json:"telephonySynthesizeSpeech,omitempty"`
  3653. // TelephonyTransferCall: Transfers the call in Telephony Gateway.
  3654. TelephonyTransferCall *GoogleCloudDialogflowV2beta1IntentMessageTelephonyTransferCall `json:"telephonyTransferCall,omitempty"`
  3655. // Text: Returns a text response.
  3656. Text *GoogleCloudDialogflowV2beta1IntentMessageText `json:"text,omitempty"`
  3657. // ForceSendFields is a list of field names (e.g. "BasicCard") to
  3658. // unconditionally include in API requests. By default, fields with
  3659. // empty values are omitted from API requests. However, any non-pointer,
  3660. // non-interface field appearing in ForceSendFields will be sent to the
  3661. // server regardless of whether the field is empty or not. This may be
  3662. // used to include empty fields in Patch requests.
  3663. ForceSendFields []string `json:"-"`
  3664. // NullFields is a list of field names (e.g. "BasicCard") to include in
  3665. // API requests with the JSON null value. By default, fields with empty
  3666. // values are omitted from API requests. However, any field with an
  3667. // empty value appearing in NullFields will be sent to the server as
  3668. // null. It is an error if a field in this list has a non-empty value.
  3669. // This may be used to include null fields in Patch requests.
  3670. NullFields []string `json:"-"`
  3671. }
  3672. func (s *GoogleCloudDialogflowV2beta1IntentMessage) MarshalJSON() ([]byte, error) {
  3673. type NoMethod GoogleCloudDialogflowV2beta1IntentMessage
  3674. raw := NoMethod(*s)
  3675. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3676. }
  3677. // GoogleCloudDialogflowV2beta1IntentMessageBasicCard: The basic card
  3678. // message. Useful for displaying information.
  3679. type GoogleCloudDialogflowV2beta1IntentMessageBasicCard struct {
  3680. // Buttons: Optional. The collection of card buttons.
  3681. Buttons []*GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton `json:"buttons,omitempty"`
  3682. // FormattedText: Required, unless image is present. The body text of
  3683. // the card.
  3684. FormattedText string `json:"formattedText,omitempty"`
  3685. // Image: Optional. The image for the card.
  3686. Image *GoogleCloudDialogflowV2beta1IntentMessageImage `json:"image,omitempty"`
  3687. // Subtitle: Optional. The subtitle of the card.
  3688. Subtitle string `json:"subtitle,omitempty"`
  3689. // Title: Optional. The title of the card.
  3690. Title string `json:"title,omitempty"`
  3691. // ForceSendFields is a list of field names (e.g. "Buttons") 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. // NullFields is a list of field names (e.g. "Buttons") to include in
  3699. // API requests with the JSON null value. By default, fields with empty
  3700. // values are omitted from API requests. However, any field with an
  3701. // empty value appearing in NullFields will be sent to the server as
  3702. // null. It is an error if a field in this list has a non-empty value.
  3703. // This may be used to include null fields in Patch requests.
  3704. NullFields []string `json:"-"`
  3705. }
  3706. func (s *GoogleCloudDialogflowV2beta1IntentMessageBasicCard) MarshalJSON() ([]byte, error) {
  3707. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageBasicCard
  3708. raw := NoMethod(*s)
  3709. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3710. }
  3711. // GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton: The button
  3712. // object that appears at the bottom of a card.
  3713. type GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton struct {
  3714. // OpenUriAction: Required. Action to take when a user taps on the
  3715. // button.
  3716. OpenUriAction *GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction `json:"openUriAction,omitempty"`
  3717. // Title: Required. The title of the button.
  3718. Title string `json:"title,omitempty"`
  3719. // ForceSendFields is a list of field names (e.g. "OpenUriAction") to
  3720. // unconditionally include in API requests. By default, fields with
  3721. // empty values are omitted from API requests. However, any non-pointer,
  3722. // non-interface field appearing in ForceSendFields will be sent to the
  3723. // server regardless of whether the field is empty or not. This may be
  3724. // used to include empty fields in Patch requests.
  3725. ForceSendFields []string `json:"-"`
  3726. // NullFields is a list of field names (e.g. "OpenUriAction") to include
  3727. // in API requests with the JSON null value. By default, fields with
  3728. // empty values are omitted from API requests. However, any field with
  3729. // an empty value appearing in NullFields will be sent to the server as
  3730. // null. It is an error if a field in this list has a non-empty value.
  3731. // This may be used to include null fields in Patch requests.
  3732. NullFields []string `json:"-"`
  3733. }
  3734. func (s *GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton) MarshalJSON() ([]byte, error) {
  3735. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton
  3736. raw := NoMethod(*s)
  3737. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3738. }
  3739. // GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction:
  3740. // Opens the given URI.
  3741. type GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction struct {
  3742. // Uri: Required. The HTTP or HTTPS scheme URI.
  3743. Uri string `json:"uri,omitempty"`
  3744. // ForceSendFields is a list of field names (e.g. "Uri") to
  3745. // unconditionally include in API requests. By default, fields with
  3746. // empty values are omitted from API requests. However, any non-pointer,
  3747. // non-interface field appearing in ForceSendFields will be sent to the
  3748. // server regardless of whether the field is empty or not. This may be
  3749. // used to include empty fields in Patch requests.
  3750. ForceSendFields []string `json:"-"`
  3751. // NullFields is a list of field names (e.g. "Uri") to include in API
  3752. // requests with the JSON null value. By default, fields with empty
  3753. // values are omitted from API requests. However, any field with an
  3754. // empty value appearing in NullFields will be sent to the server as
  3755. // null. It is an error if a field in this list has a non-empty value.
  3756. // This may be used to include null fields in Patch requests.
  3757. NullFields []string `json:"-"`
  3758. }
  3759. func (s *GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction) MarshalJSON() ([]byte, error) {
  3760. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction
  3761. raw := NoMethod(*s)
  3762. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3763. }
  3764. // GoogleCloudDialogflowV2beta1IntentMessageCard: The card response
  3765. // message.
  3766. type GoogleCloudDialogflowV2beta1IntentMessageCard struct {
  3767. // Buttons: Optional. The collection of card buttons.
  3768. Buttons []*GoogleCloudDialogflowV2beta1IntentMessageCardButton `json:"buttons,omitempty"`
  3769. // ImageUri: Optional. The public URI to an image file for the card.
  3770. ImageUri string `json:"imageUri,omitempty"`
  3771. // Subtitle: Optional. The subtitle of the card.
  3772. Subtitle string `json:"subtitle,omitempty"`
  3773. // Title: Optional. The title of the card.
  3774. Title string `json:"title,omitempty"`
  3775. // ForceSendFields is a list of field names (e.g. "Buttons") to
  3776. // unconditionally include in API requests. By default, fields with
  3777. // empty values are omitted from API requests. However, any non-pointer,
  3778. // non-interface field appearing in ForceSendFields will be sent to the
  3779. // server regardless of whether the field is empty or not. This may be
  3780. // used to include empty fields in Patch requests.
  3781. ForceSendFields []string `json:"-"`
  3782. // NullFields is a list of field names (e.g. "Buttons") to include in
  3783. // API requests with the JSON null value. By default, fields with empty
  3784. // values are omitted from API requests. However, any field with an
  3785. // empty value appearing in NullFields will be sent to the server as
  3786. // null. It is an error if a field in this list has a non-empty value.
  3787. // This may be used to include null fields in Patch requests.
  3788. NullFields []string `json:"-"`
  3789. }
  3790. func (s *GoogleCloudDialogflowV2beta1IntentMessageCard) MarshalJSON() ([]byte, error) {
  3791. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageCard
  3792. raw := NoMethod(*s)
  3793. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3794. }
  3795. // GoogleCloudDialogflowV2beta1IntentMessageCardButton: Optional.
  3796. // Contains information about a button.
  3797. type GoogleCloudDialogflowV2beta1IntentMessageCardButton struct {
  3798. // Postback: Optional. The text to send back to the Dialogflow API or a
  3799. // URI to
  3800. // open.
  3801. Postback string `json:"postback,omitempty"`
  3802. // Text: Optional. The text to show on the button.
  3803. Text string `json:"text,omitempty"`
  3804. // ForceSendFields is a list of field names (e.g. "Postback") to
  3805. // unconditionally include in API requests. By default, fields with
  3806. // empty values are omitted from API requests. However, any non-pointer,
  3807. // non-interface field appearing in ForceSendFields will be sent to the
  3808. // server regardless of whether the field is empty or not. This may be
  3809. // used to include empty fields in Patch requests.
  3810. ForceSendFields []string `json:"-"`
  3811. // NullFields is a list of field names (e.g. "Postback") to include in
  3812. // API requests with the JSON null value. By default, fields with empty
  3813. // values are omitted from API requests. However, any field with an
  3814. // empty value appearing in NullFields will be sent to the server as
  3815. // null. It is an error if a field in this list has a non-empty value.
  3816. // This may be used to include null fields in Patch requests.
  3817. NullFields []string `json:"-"`
  3818. }
  3819. func (s *GoogleCloudDialogflowV2beta1IntentMessageCardButton) MarshalJSON() ([]byte, error) {
  3820. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageCardButton
  3821. raw := NoMethod(*s)
  3822. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3823. }
  3824. // GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect: The card for
  3825. // presenting a carousel of options to select from.
  3826. type GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect struct {
  3827. // Items: Required. Carousel items.
  3828. Items []*GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem `json:"items,omitempty"`
  3829. // ForceSendFields is a list of field names (e.g. "Items") to
  3830. // unconditionally include in API requests. By default, fields with
  3831. // empty values are omitted from API requests. However, any non-pointer,
  3832. // non-interface field appearing in ForceSendFields will be sent to the
  3833. // server regardless of whether the field is empty or not. This may be
  3834. // used to include empty fields in Patch requests.
  3835. ForceSendFields []string `json:"-"`
  3836. // NullFields is a list of field names (e.g. "Items") to include in API
  3837. // requests with the JSON null value. By default, fields with empty
  3838. // values are omitted from API requests. However, any field with an
  3839. // empty value appearing in NullFields will be sent to the server as
  3840. // null. It is an error if a field in this list has a non-empty value.
  3841. // This may be used to include null fields in Patch requests.
  3842. NullFields []string `json:"-"`
  3843. }
  3844. func (s *GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect) MarshalJSON() ([]byte, error) {
  3845. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect
  3846. raw := NoMethod(*s)
  3847. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3848. }
  3849. // GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem: An item
  3850. // in the carousel.
  3851. type GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem struct {
  3852. // Description: Optional. The body text of the card.
  3853. Description string `json:"description,omitempty"`
  3854. // Image: Optional. The image to display.
  3855. Image *GoogleCloudDialogflowV2beta1IntentMessageImage `json:"image,omitempty"`
  3856. // Info: Required. Additional info about the option item.
  3857. Info *GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo `json:"info,omitempty"`
  3858. // Title: Required. Title of the carousel item.
  3859. Title string `json:"title,omitempty"`
  3860. // ForceSendFields is a list of field names (e.g. "Description") to
  3861. // unconditionally include in API requests. By default, fields with
  3862. // empty values are omitted from API requests. However, any non-pointer,
  3863. // non-interface field appearing in ForceSendFields will be sent to the
  3864. // server regardless of whether the field is empty or not. This may be
  3865. // used to include empty fields in Patch requests.
  3866. ForceSendFields []string `json:"-"`
  3867. // NullFields is a list of field names (e.g. "Description") to include
  3868. // in API requests with the JSON null value. By default, fields with
  3869. // empty values are omitted from API requests. However, any field with
  3870. // an empty value appearing in NullFields will be sent to the server as
  3871. // null. It is an error if a field in this list has a non-empty value.
  3872. // This may be used to include null fields in Patch requests.
  3873. NullFields []string `json:"-"`
  3874. }
  3875. func (s *GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem) MarshalJSON() ([]byte, error) {
  3876. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem
  3877. raw := NoMethod(*s)
  3878. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3879. }
  3880. // GoogleCloudDialogflowV2beta1IntentMessageImage: The image response
  3881. // message.
  3882. type GoogleCloudDialogflowV2beta1IntentMessageImage struct {
  3883. // AccessibilityText: A text description of the image to be used for
  3884. // accessibility,
  3885. // e.g., screen readers. Required if image_uri is set for
  3886. // CarouselSelect.
  3887. AccessibilityText string `json:"accessibilityText,omitempty"`
  3888. // ImageUri: Optional. The public URI to an image file.
  3889. ImageUri string `json:"imageUri,omitempty"`
  3890. // ForceSendFields is a list of field names (e.g. "AccessibilityText")
  3891. // to unconditionally include in API requests. By default, fields with
  3892. // empty values are omitted from API requests. However, any non-pointer,
  3893. // non-interface field appearing in ForceSendFields will be sent to the
  3894. // server regardless of whether the field is empty or not. This may be
  3895. // used to include empty fields in Patch requests.
  3896. ForceSendFields []string `json:"-"`
  3897. // NullFields is a list of field names (e.g. "AccessibilityText") to
  3898. // include in API requests with the JSON null value. By default, fields
  3899. // with empty values are omitted from API requests. However, any field
  3900. // with an empty value appearing in NullFields will be sent to the
  3901. // server as null. It is an error if a field in this list has a
  3902. // non-empty value. This may be used to include null fields in Patch
  3903. // requests.
  3904. NullFields []string `json:"-"`
  3905. }
  3906. func (s *GoogleCloudDialogflowV2beta1IntentMessageImage) MarshalJSON() ([]byte, error) {
  3907. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageImage
  3908. raw := NoMethod(*s)
  3909. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3910. }
  3911. // GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion: The
  3912. // suggestion chip message that allows the user to jump out to the
  3913. // app
  3914. // or website associated with this agent.
  3915. type GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion struct {
  3916. // DestinationName: Required. The name of the app or site this chip is
  3917. // linking to.
  3918. DestinationName string `json:"destinationName,omitempty"`
  3919. // Uri: Required. The URI of the app or site to open when the user taps
  3920. // the
  3921. // suggestion chip.
  3922. Uri string `json:"uri,omitempty"`
  3923. // ForceSendFields is a list of field names (e.g. "DestinationName") to
  3924. // unconditionally include in API requests. By default, fields with
  3925. // empty values are omitted from API requests. However, any non-pointer,
  3926. // non-interface field appearing in ForceSendFields will be sent to the
  3927. // server regardless of whether the field is empty or not. This may be
  3928. // used to include empty fields in Patch requests.
  3929. ForceSendFields []string `json:"-"`
  3930. // NullFields is a list of field names (e.g. "DestinationName") to
  3931. // include in API requests with the JSON null value. By default, fields
  3932. // with empty values are omitted from API requests. However, any field
  3933. // with an empty value appearing in NullFields will be sent to the
  3934. // server as null. It is an error if a field in this list has a
  3935. // non-empty value. This may be used to include null fields in Patch
  3936. // requests.
  3937. NullFields []string `json:"-"`
  3938. }
  3939. func (s *GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion) MarshalJSON() ([]byte, error) {
  3940. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion
  3941. raw := NoMethod(*s)
  3942. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3943. }
  3944. // GoogleCloudDialogflowV2beta1IntentMessageListSelect: The card for
  3945. // presenting a list of options to select from.
  3946. type GoogleCloudDialogflowV2beta1IntentMessageListSelect struct {
  3947. // Items: Required. List items.
  3948. Items []*GoogleCloudDialogflowV2beta1IntentMessageListSelectItem `json:"items,omitempty"`
  3949. // Title: Optional. The overall title of the list.
  3950. Title string `json:"title,omitempty"`
  3951. // ForceSendFields is a list of field names (e.g. "Items") to
  3952. // unconditionally include in API requests. By default, fields with
  3953. // empty values are omitted from API requests. However, any non-pointer,
  3954. // non-interface field appearing in ForceSendFields will be sent to the
  3955. // server regardless of whether the field is empty or not. This may be
  3956. // used to include empty fields in Patch requests.
  3957. ForceSendFields []string `json:"-"`
  3958. // NullFields is a list of field names (e.g. "Items") to include in API
  3959. // requests with the JSON null value. By default, fields with empty
  3960. // values are omitted from API requests. However, any field with an
  3961. // empty value appearing in NullFields will be sent to the server as
  3962. // null. It is an error if a field in this list has a non-empty value.
  3963. // This may be used to include null fields in Patch requests.
  3964. NullFields []string `json:"-"`
  3965. }
  3966. func (s *GoogleCloudDialogflowV2beta1IntentMessageListSelect) MarshalJSON() ([]byte, error) {
  3967. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageListSelect
  3968. raw := NoMethod(*s)
  3969. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3970. }
  3971. // GoogleCloudDialogflowV2beta1IntentMessageListSelectItem: An item in
  3972. // the list.
  3973. type GoogleCloudDialogflowV2beta1IntentMessageListSelectItem struct {
  3974. // Description: Optional. The main text describing the item.
  3975. Description string `json:"description,omitempty"`
  3976. // Image: Optional. The image to display.
  3977. Image *GoogleCloudDialogflowV2beta1IntentMessageImage `json:"image,omitempty"`
  3978. // Info: Required. Additional information about this option.
  3979. Info *GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo `json:"info,omitempty"`
  3980. // Title: Required. The title of the list item.
  3981. Title string `json:"title,omitempty"`
  3982. // ForceSendFields is a list of field names (e.g. "Description") to
  3983. // unconditionally include in API requests. By default, fields with
  3984. // empty values are omitted from API requests. However, any non-pointer,
  3985. // non-interface field appearing in ForceSendFields will be sent to the
  3986. // server regardless of whether the field is empty or not. This may be
  3987. // used to include empty fields in Patch requests.
  3988. ForceSendFields []string `json:"-"`
  3989. // NullFields is a list of field names (e.g. "Description") to include
  3990. // in API requests with the JSON null value. By default, fields with
  3991. // empty values are omitted from API requests. However, any field with
  3992. // an empty value appearing in NullFields will be sent to the server as
  3993. // null. It is an error if a field in this list has a non-empty value.
  3994. // This may be used to include null fields in Patch requests.
  3995. NullFields []string `json:"-"`
  3996. }
  3997. func (s *GoogleCloudDialogflowV2beta1IntentMessageListSelectItem) MarshalJSON() ([]byte, error) {
  3998. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageListSelectItem
  3999. raw := NoMethod(*s)
  4000. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4001. }
  4002. // GoogleCloudDialogflowV2beta1IntentMessageQuickReplies: The quick
  4003. // replies response message.
  4004. type GoogleCloudDialogflowV2beta1IntentMessageQuickReplies struct {
  4005. // QuickReplies: Optional. The collection of quick replies.
  4006. QuickReplies []string `json:"quickReplies,omitempty"`
  4007. // Title: Optional. The title of the collection of quick replies.
  4008. Title string `json:"title,omitempty"`
  4009. // ForceSendFields is a list of field names (e.g. "QuickReplies") to
  4010. // unconditionally include in API requests. By default, fields with
  4011. // empty values are omitted from API requests. However, any non-pointer,
  4012. // non-interface field appearing in ForceSendFields will be sent to the
  4013. // server regardless of whether the field is empty or not. This may be
  4014. // used to include empty fields in Patch requests.
  4015. ForceSendFields []string `json:"-"`
  4016. // NullFields is a list of field names (e.g. "QuickReplies") to include
  4017. // in API requests with the JSON null value. By default, fields with
  4018. // empty values are omitted from API requests. However, any field with
  4019. // an empty value appearing in NullFields will be sent to the server as
  4020. // null. It is an error if a field in this list has a non-empty value.
  4021. // This may be used to include null fields in Patch requests.
  4022. NullFields []string `json:"-"`
  4023. }
  4024. func (s *GoogleCloudDialogflowV2beta1IntentMessageQuickReplies) MarshalJSON() ([]byte, error) {
  4025. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageQuickReplies
  4026. raw := NoMethod(*s)
  4027. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4028. }
  4029. // GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo: Additional
  4030. // info about the select item for when it is triggered in a
  4031. // dialog.
  4032. type GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo struct {
  4033. // Key: Required. A unique key that will be sent back to the agent if
  4034. // this
  4035. // response is given.
  4036. Key string `json:"key,omitempty"`
  4037. // Synonyms: Optional. A list of synonyms that can also be used to
  4038. // trigger this
  4039. // item in dialog.
  4040. Synonyms []string `json:"synonyms,omitempty"`
  4041. // ForceSendFields is a list of field names (e.g. "Key") to
  4042. // unconditionally include in API requests. By default, fields with
  4043. // empty values are omitted from API requests. However, any non-pointer,
  4044. // non-interface field appearing in ForceSendFields will be sent to the
  4045. // server regardless of whether the field is empty or not. This may be
  4046. // used to include empty fields in Patch requests.
  4047. ForceSendFields []string `json:"-"`
  4048. // NullFields is a list of field names (e.g. "Key") to include in API
  4049. // requests with the JSON null value. By default, fields with empty
  4050. // values are omitted from API requests. However, any field with an
  4051. // empty value appearing in NullFields will be sent to the server as
  4052. // null. It is an error if a field in this list has a non-empty value.
  4053. // This may be used to include null fields in Patch requests.
  4054. NullFields []string `json:"-"`
  4055. }
  4056. func (s *GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo) MarshalJSON() ([]byte, error) {
  4057. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo
  4058. raw := NoMethod(*s)
  4059. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4060. }
  4061. // GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse: The simple
  4062. // response message containing speech or text.
  4063. type GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse struct {
  4064. // DisplayText: Optional. The text to display.
  4065. DisplayText string `json:"displayText,omitempty"`
  4066. // Ssml: One of text_to_speech or ssml must be provided. Structured
  4067. // spoken
  4068. // response to the user in the SSML format. Mutually exclusive
  4069. // with
  4070. // text_to_speech.
  4071. Ssml string `json:"ssml,omitempty"`
  4072. // TextToSpeech: One of text_to_speech or ssml must be provided. The
  4073. // plain text of the
  4074. // speech output. Mutually exclusive with ssml.
  4075. TextToSpeech string `json:"textToSpeech,omitempty"`
  4076. // ForceSendFields is a list of field names (e.g. "DisplayText") to
  4077. // unconditionally include in API requests. By default, fields with
  4078. // empty values are omitted from API requests. However, any non-pointer,
  4079. // non-interface field appearing in ForceSendFields will be sent to the
  4080. // server regardless of whether the field is empty or not. This may be
  4081. // used to include empty fields in Patch requests.
  4082. ForceSendFields []string `json:"-"`
  4083. // NullFields is a list of field names (e.g. "DisplayText") to include
  4084. // in API requests with the JSON null value. By default, fields with
  4085. // empty values are omitted from API requests. However, any field with
  4086. // an empty value appearing in NullFields will be sent to the server as
  4087. // null. It is an error if a field in this list has a non-empty value.
  4088. // This may be used to include null fields in Patch requests.
  4089. NullFields []string `json:"-"`
  4090. }
  4091. func (s *GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse) MarshalJSON() ([]byte, error) {
  4092. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse
  4093. raw := NoMethod(*s)
  4094. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4095. }
  4096. // GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses: The
  4097. // collection of simple response candidates.
  4098. // This message in `QueryResult.fulfillment_messages`
  4099. // and
  4100. // `WebhookResponse.fulfillment_messages` should contain only
  4101. // one
  4102. // `SimpleResponse`.
  4103. type GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses struct {
  4104. // SimpleResponses: Required. The list of simple responses.
  4105. SimpleResponses []*GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse `json:"simpleResponses,omitempty"`
  4106. // ForceSendFields is a list of field names (e.g. "SimpleResponses") to
  4107. // unconditionally include in API requests. By default, fields with
  4108. // empty values are omitted from API requests. However, any non-pointer,
  4109. // non-interface field appearing in ForceSendFields will be sent to the
  4110. // server regardless of whether the field is empty or not. This may be
  4111. // used to include empty fields in Patch requests.
  4112. ForceSendFields []string `json:"-"`
  4113. // NullFields is a list of field names (e.g. "SimpleResponses") to
  4114. // include in API requests with the JSON null value. By default, fields
  4115. // with empty values are omitted from API requests. However, any field
  4116. // with an empty value appearing in NullFields will be sent to the
  4117. // server as null. It is an error if a field in this list has a
  4118. // non-empty value. This may be used to include null fields in Patch
  4119. // requests.
  4120. NullFields []string `json:"-"`
  4121. }
  4122. func (s *GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses) MarshalJSON() ([]byte, error) {
  4123. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses
  4124. raw := NoMethod(*s)
  4125. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4126. }
  4127. // GoogleCloudDialogflowV2beta1IntentMessageSuggestion: The suggestion
  4128. // chip message that the user can tap to quickly post a reply
  4129. // to the conversation.
  4130. type GoogleCloudDialogflowV2beta1IntentMessageSuggestion struct {
  4131. // Title: Required. The text shown the in the suggestion chip.
  4132. Title string `json:"title,omitempty"`
  4133. // ForceSendFields is a list of field names (e.g. "Title") to
  4134. // unconditionally include in API requests. By default, fields with
  4135. // empty values are omitted from API requests. However, any non-pointer,
  4136. // non-interface field appearing in ForceSendFields will be sent to the
  4137. // server regardless of whether the field is empty or not. This may be
  4138. // used to include empty fields in Patch requests.
  4139. ForceSendFields []string `json:"-"`
  4140. // NullFields is a list of field names (e.g. "Title") to include in API
  4141. // requests with the JSON null value. By default, fields with empty
  4142. // values are omitted from API requests. However, any field with an
  4143. // empty value appearing in NullFields will be sent to the server as
  4144. // null. It is an error if a field in this list has a non-empty value.
  4145. // This may be used to include null fields in Patch requests.
  4146. NullFields []string `json:"-"`
  4147. }
  4148. func (s *GoogleCloudDialogflowV2beta1IntentMessageSuggestion) MarshalJSON() ([]byte, error) {
  4149. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageSuggestion
  4150. raw := NoMethod(*s)
  4151. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4152. }
  4153. // GoogleCloudDialogflowV2beta1IntentMessageSuggestions: The collection
  4154. // of suggestions.
  4155. type GoogleCloudDialogflowV2beta1IntentMessageSuggestions struct {
  4156. // Suggestions: Required. The list of suggested replies.
  4157. Suggestions []*GoogleCloudDialogflowV2beta1IntentMessageSuggestion `json:"suggestions,omitempty"`
  4158. // ForceSendFields is a list of field names (e.g. "Suggestions") to
  4159. // unconditionally include in API requests. By default, fields with
  4160. // empty values are omitted from API requests. However, any non-pointer,
  4161. // non-interface field appearing in ForceSendFields will be sent to the
  4162. // server regardless of whether the field is empty or not. This may be
  4163. // used to include empty fields in Patch requests.
  4164. ForceSendFields []string `json:"-"`
  4165. // NullFields is a list of field names (e.g. "Suggestions") to include
  4166. // in API requests with the JSON null value. By default, fields with
  4167. // empty values are omitted from API requests. However, any field with
  4168. // an empty value appearing in NullFields will be sent to the server as
  4169. // null. It is an error if a field in this list has a non-empty value.
  4170. // This may be used to include null fields in Patch requests.
  4171. NullFields []string `json:"-"`
  4172. }
  4173. func (s *GoogleCloudDialogflowV2beta1IntentMessageSuggestions) MarshalJSON() ([]byte, error) {
  4174. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageSuggestions
  4175. raw := NoMethod(*s)
  4176. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4177. }
  4178. // GoogleCloudDialogflowV2beta1IntentMessageTelephonyPlayAudio: Plays
  4179. // audio from a file in Telephony Gateway.
  4180. type GoogleCloudDialogflowV2beta1IntentMessageTelephonyPlayAudio struct {
  4181. // AudioUri: Required. URI to a Google Cloud Storage object containing
  4182. // the audio to
  4183. // play, e.g., "gs://bucket/object". The object must contain a
  4184. // single
  4185. // channel (mono) of linear PCM audio (2 bytes / sample) at 8kHz.
  4186. //
  4187. // This object must be readable by the
  4188. // `service-<Project
  4189. // Number>@gcp-sa-dialogflow.iam.gserviceaccount.com` service
  4190. // account
  4191. // where <Project Number> is the number of the Telephony Gateway
  4192. // project
  4193. // (usually the same as the Dialogflow agent project). If the Google
  4194. // Cloud
  4195. // Storage bucket is in the Telephony Gateway project, this permission
  4196. // is
  4197. // added by default when enabling the Dialogflow V2 API.
  4198. //
  4199. // For audio from other sources, consider using
  4200. // the
  4201. // `TelephonySynthesizeSpeech` message with SSML.
  4202. AudioUri string `json:"audioUri,omitempty"`
  4203. // ForceSendFields is a list of field names (e.g. "AudioUri") to
  4204. // unconditionally include in API requests. By default, fields with
  4205. // empty values are omitted from API requests. However, any non-pointer,
  4206. // non-interface field appearing in ForceSendFields will be sent to the
  4207. // server regardless of whether the field is empty or not. This may be
  4208. // used to include empty fields in Patch requests.
  4209. ForceSendFields []string `json:"-"`
  4210. // NullFields is a list of field names (e.g. "AudioUri") to include in
  4211. // API requests with the JSON null value. By default, fields with empty
  4212. // values are omitted from API requests. However, any field with an
  4213. // empty value appearing in NullFields will be sent to the server as
  4214. // null. It is an error if a field in this list has a non-empty value.
  4215. // This may be used to include null fields in Patch requests.
  4216. NullFields []string `json:"-"`
  4217. }
  4218. func (s *GoogleCloudDialogflowV2beta1IntentMessageTelephonyPlayAudio) MarshalJSON() ([]byte, error) {
  4219. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageTelephonyPlayAudio
  4220. raw := NoMethod(*s)
  4221. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4222. }
  4223. // GoogleCloudDialogflowV2beta1IntentMessageTelephonySynthesizeSpeech:
  4224. // Synthesizes speech and plays back the synthesized audio to the caller
  4225. // in
  4226. // Telephony Gateway.
  4227. //
  4228. // Telephony Gateway takes the synthesizer settings
  4229. // from
  4230. // `DetectIntentResponse.output_audio_config` which can either be set
  4231. // at request-level or can come from the agent-level synthesizer config.
  4232. type GoogleCloudDialogflowV2beta1IntentMessageTelephonySynthesizeSpeech struct {
  4233. // Ssml: The SSML to be synthesized. For more information,
  4234. // see
  4235. // [SSML](https://developers.google.com/actions/reference/ssml).
  4236. Ssml string `json:"ssml,omitempty"`
  4237. // Text: The raw text to be synthesized.
  4238. Text string `json:"text,omitempty"`
  4239. // ForceSendFields is a list of field names (e.g. "Ssml") to
  4240. // unconditionally include in API requests. By default, fields with
  4241. // empty values are omitted from API requests. However, any non-pointer,
  4242. // non-interface field appearing in ForceSendFields will be sent to the
  4243. // server regardless of whether the field is empty or not. This may be
  4244. // used to include empty fields in Patch requests.
  4245. ForceSendFields []string `json:"-"`
  4246. // NullFields is a list of field names (e.g. "Ssml") to include in API
  4247. // requests with the JSON null value. By default, fields with empty
  4248. // values are omitted from API requests. However, any field with an
  4249. // empty value appearing in NullFields will be sent to the server as
  4250. // null. It is an error if a field in this list has a non-empty value.
  4251. // This may be used to include null fields in Patch requests.
  4252. NullFields []string `json:"-"`
  4253. }
  4254. func (s *GoogleCloudDialogflowV2beta1IntentMessageTelephonySynthesizeSpeech) MarshalJSON() ([]byte, error) {
  4255. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageTelephonySynthesizeSpeech
  4256. raw := NoMethod(*s)
  4257. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4258. }
  4259. // GoogleCloudDialogflowV2beta1IntentMessageTelephonyTransferCall:
  4260. // Transfers the call in Telephony Gateway.
  4261. type GoogleCloudDialogflowV2beta1IntentMessageTelephonyTransferCall struct {
  4262. // PhoneNumber: Required. The phone number to transfer the call to
  4263. // in [E.164 format](https://en.wikipedia.org/wiki/E.164).
  4264. //
  4265. // We currently only allow transferring to US numbers (+1xxxyyyzzzz).
  4266. PhoneNumber string `json:"phoneNumber,omitempty"`
  4267. // ForceSendFields is a list of field names (e.g. "PhoneNumber") to
  4268. // unconditionally include in API requests. By default, fields with
  4269. // empty values are omitted from API requests. However, any non-pointer,
  4270. // non-interface field appearing in ForceSendFields will be sent to the
  4271. // server regardless of whether the field is empty or not. This may be
  4272. // used to include empty fields in Patch requests.
  4273. ForceSendFields []string `json:"-"`
  4274. // NullFields is a list of field names (e.g. "PhoneNumber") to include
  4275. // in API requests with the JSON null value. By default, fields with
  4276. // empty values are omitted from API requests. However, any field with
  4277. // an empty value appearing in NullFields will be sent to the server as
  4278. // null. It is an error if a field in this list has a non-empty value.
  4279. // This may be used to include null fields in Patch requests.
  4280. NullFields []string `json:"-"`
  4281. }
  4282. func (s *GoogleCloudDialogflowV2beta1IntentMessageTelephonyTransferCall) MarshalJSON() ([]byte, error) {
  4283. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageTelephonyTransferCall
  4284. raw := NoMethod(*s)
  4285. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4286. }
  4287. // GoogleCloudDialogflowV2beta1IntentMessageText: The text response
  4288. // message.
  4289. type GoogleCloudDialogflowV2beta1IntentMessageText struct {
  4290. // Text: Optional. The collection of the agent's responses.
  4291. Text []string `json:"text,omitempty"`
  4292. // ForceSendFields is a list of field names (e.g. "Text") to
  4293. // unconditionally include in API requests. By default, fields with
  4294. // empty values are omitted from API requests. However, any non-pointer,
  4295. // non-interface field appearing in ForceSendFields will be sent to the
  4296. // server regardless of whether the field is empty or not. This may be
  4297. // used to include empty fields in Patch requests.
  4298. ForceSendFields []string `json:"-"`
  4299. // NullFields is a list of field names (e.g. "Text") to include in API
  4300. // requests with the JSON null value. By default, fields with empty
  4301. // values are omitted from API requests. However, any field with an
  4302. // empty value appearing in NullFields will be sent to the server as
  4303. // null. It is an error if a field in this list has a non-empty value.
  4304. // This may be used to include null fields in Patch requests.
  4305. NullFields []string `json:"-"`
  4306. }
  4307. func (s *GoogleCloudDialogflowV2beta1IntentMessageText) MarshalJSON() ([]byte, error) {
  4308. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageText
  4309. raw := NoMethod(*s)
  4310. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4311. }
  4312. // GoogleCloudDialogflowV2beta1IntentParameter: Represents intent
  4313. // parameters.
  4314. type GoogleCloudDialogflowV2beta1IntentParameter struct {
  4315. // DefaultValue: Optional. The default value to use when the `value`
  4316. // yields an empty
  4317. // result.
  4318. // Default values can be extracted from contexts by using the
  4319. // following
  4320. // syntax: `#context_name.parameter_name`.
  4321. DefaultValue string `json:"defaultValue,omitempty"`
  4322. // DisplayName: Required. The name of the parameter.
  4323. DisplayName string `json:"displayName,omitempty"`
  4324. // EntityTypeDisplayName: Optional. The name of the entity type,
  4325. // prefixed with `@`, that
  4326. // describes values of the parameter. If the parameter is
  4327. // required, this must be provided.
  4328. EntityTypeDisplayName string `json:"entityTypeDisplayName,omitempty"`
  4329. // IsList: Optional. Indicates whether the parameter represents a list
  4330. // of values.
  4331. IsList bool `json:"isList,omitempty"`
  4332. // Mandatory: Optional. Indicates whether the parameter is required.
  4333. // That is,
  4334. // whether the intent cannot be completed without collecting the
  4335. // parameter
  4336. // value.
  4337. Mandatory bool `json:"mandatory,omitempty"`
  4338. // Name: The unique identifier of this parameter.
  4339. Name string `json:"name,omitempty"`
  4340. // Prompts: Optional. The collection of prompts that the agent can
  4341. // present to the
  4342. // user in order to collect value for the parameter.
  4343. Prompts []string `json:"prompts,omitempty"`
  4344. // Value: Optional. The definition of the parameter value. It can be:
  4345. // - a constant string,
  4346. // - a parameter value defined as `$parameter_name`,
  4347. // - an original parameter value defined as
  4348. // `$parameter_name.original`,
  4349. // - a parameter value from some context defined as
  4350. // `#context_name.parameter_name`.
  4351. Value string `json:"value,omitempty"`
  4352. // ForceSendFields is a list of field names (e.g. "DefaultValue") to
  4353. // unconditionally include in API requests. By default, fields with
  4354. // empty values are omitted from API requests. However, any non-pointer,
  4355. // non-interface field appearing in ForceSendFields will be sent to the
  4356. // server regardless of whether the field is empty or not. This may be
  4357. // used to include empty fields in Patch requests.
  4358. ForceSendFields []string `json:"-"`
  4359. // NullFields is a list of field names (e.g. "DefaultValue") to include
  4360. // in API requests with the JSON null value. By default, fields with
  4361. // empty values are omitted from API requests. However, any field with
  4362. // an empty value appearing in NullFields will be sent to the server as
  4363. // null. It is an error if a field in this list has a non-empty value.
  4364. // This may be used to include null fields in Patch requests.
  4365. NullFields []string `json:"-"`
  4366. }
  4367. func (s *GoogleCloudDialogflowV2beta1IntentParameter) MarshalJSON() ([]byte, error) {
  4368. type NoMethod GoogleCloudDialogflowV2beta1IntentParameter
  4369. raw := NoMethod(*s)
  4370. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4371. }
  4372. // GoogleCloudDialogflowV2beta1IntentTrainingPhrase: Represents an
  4373. // example that the agent is trained on.
  4374. type GoogleCloudDialogflowV2beta1IntentTrainingPhrase struct {
  4375. // Name: Output only. The unique identifier of this training phrase.
  4376. Name string `json:"name,omitempty"`
  4377. // Parts: Required. The ordered list of training phrase parts.
  4378. // The parts are concatenated in order to form the training
  4379. // phrase.
  4380. //
  4381. // Note: The API does not automatically annotate training phrases like
  4382. // the
  4383. // Dialogflow Console does.
  4384. //
  4385. // Note: Do not forget to include whitespace at part boundaries,
  4386. // so the training phrase is well formatted when the parts are
  4387. // concatenated.
  4388. //
  4389. // If the training phrase does not need to be annotated with
  4390. // parameters,
  4391. // you just need a single part with only the Part.text field set.
  4392. //
  4393. // If you want to annotate the training phrase, you must create
  4394. // multiple
  4395. // parts, where the fields of each part are populated in one of two
  4396. // ways:
  4397. //
  4398. // - `Part.text` is set to a part of the phrase that has no
  4399. // parameters.
  4400. // - `Part.text` is set to a part of the phrase that you want to
  4401. // annotate,
  4402. // and the `entity_type`, `alias`, and `user_defined` fields are
  4403. // all
  4404. // set.
  4405. Parts []*GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart `json:"parts,omitempty"`
  4406. // TimesAddedCount: Optional. Indicates how many times this example was
  4407. // added to
  4408. // the intent. Each time a developer adds an existing sample by editing
  4409. // an
  4410. // intent or training, this counter is increased.
  4411. TimesAddedCount int64 `json:"timesAddedCount,omitempty"`
  4412. // Type: Required. The type of the training phrase.
  4413. //
  4414. // Possible values:
  4415. // "TYPE_UNSPECIFIED" - Not specified. This value should never be
  4416. // used.
  4417. // "EXAMPLE" - Examples do not contain @-prefixed entity type names,
  4418. // but example parts
  4419. // can be annotated with entity types.
  4420. // "TEMPLATE" - Templates are not annotated with entity types, but
  4421. // they can contain
  4422. // @-prefixed entity type names as substrings.
  4423. // Template mode has been deprecated. Example mode is the only
  4424. // supported
  4425. // way to create new training phrases. If you have existing
  4426. // training
  4427. // phrases that you've created in template mode, those will continue
  4428. // to
  4429. // work.
  4430. Type string `json:"type,omitempty"`
  4431. // ForceSendFields is a list of field names (e.g. "Name") to
  4432. // unconditionally include in API requests. By default, fields with
  4433. // empty values are omitted from API requests. However, any non-pointer,
  4434. // non-interface field appearing in ForceSendFields will be sent to the
  4435. // server regardless of whether the field is empty or not. This may be
  4436. // used to include empty fields in Patch requests.
  4437. ForceSendFields []string `json:"-"`
  4438. // NullFields is a list of field names (e.g. "Name") to include in API
  4439. // requests with the JSON null value. By default, fields with empty
  4440. // values are omitted from API requests. However, any field with an
  4441. // empty value appearing in NullFields will be sent to the server as
  4442. // null. It is an error if a field in this list has a non-empty value.
  4443. // This may be used to include null fields in Patch requests.
  4444. NullFields []string `json:"-"`
  4445. }
  4446. func (s *GoogleCloudDialogflowV2beta1IntentTrainingPhrase) MarshalJSON() ([]byte, error) {
  4447. type NoMethod GoogleCloudDialogflowV2beta1IntentTrainingPhrase
  4448. raw := NoMethod(*s)
  4449. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4450. }
  4451. // GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart: Represents a
  4452. // part of a training phrase.
  4453. type GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart struct {
  4454. // Alias: Optional. The parameter name for the value extracted from
  4455. // the
  4456. // annotated part of the example.
  4457. // This field is required for annotated parts of the training phrase.
  4458. Alias string `json:"alias,omitempty"`
  4459. // EntityType: Optional. The entity type name prefixed with `@`.
  4460. // This field is required for annotated parts of the training phrase.
  4461. EntityType string `json:"entityType,omitempty"`
  4462. // Text: Required. The text for this part.
  4463. Text string `json:"text,omitempty"`
  4464. // UserDefined: Optional. Indicates whether the text was manually
  4465. // annotated.
  4466. // This field is set to true when the Dialogflow Console is used
  4467. // to
  4468. // manually annotate the part. When creating an annotated part with
  4469. // the
  4470. // API, you must set this to true.
  4471. UserDefined bool `json:"userDefined,omitempty"`
  4472. // ForceSendFields is a list of field names (e.g. "Alias") to
  4473. // unconditionally include in API requests. By default, fields with
  4474. // empty values are omitted from API requests. However, any non-pointer,
  4475. // non-interface field appearing in ForceSendFields will be sent to the
  4476. // server regardless of whether the field is empty or not. This may be
  4477. // used to include empty fields in Patch requests.
  4478. ForceSendFields []string `json:"-"`
  4479. // NullFields is a list of field names (e.g. "Alias") to include in API
  4480. // requests with the JSON null value. By default, fields with empty
  4481. // values are omitted from API requests. However, any field with an
  4482. // empty value appearing in NullFields will be sent to the server as
  4483. // null. It is an error if a field in this list has a non-empty value.
  4484. // This may be used to include null fields in Patch requests.
  4485. NullFields []string `json:"-"`
  4486. }
  4487. func (s *GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart) MarshalJSON() ([]byte, error) {
  4488. type NoMethod GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart
  4489. raw := NoMethod(*s)
  4490. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4491. }
  4492. // GoogleCloudDialogflowV2beta1KnowledgeAnswers: Represents the result
  4493. // of querying a Knowledge base.
  4494. type GoogleCloudDialogflowV2beta1KnowledgeAnswers struct {
  4495. // Answers: A list of answers from Knowledge Connector.
  4496. Answers []*GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer `json:"answers,omitempty"`
  4497. // ForceSendFields is a list of field names (e.g. "Answers") to
  4498. // unconditionally include in API requests. By default, fields with
  4499. // empty values are omitted from API requests. However, any non-pointer,
  4500. // non-interface field appearing in ForceSendFields will be sent to the
  4501. // server regardless of whether the field is empty or not. This may be
  4502. // used to include empty fields in Patch requests.
  4503. ForceSendFields []string `json:"-"`
  4504. // NullFields is a list of field names (e.g. "Answers") to include in
  4505. // API requests with the JSON null value. By default, fields with empty
  4506. // values are omitted from API requests. However, any field with an
  4507. // empty value appearing in NullFields will be sent to the server as
  4508. // null. It is an error if a field in this list has a non-empty value.
  4509. // This may be used to include null fields in Patch requests.
  4510. NullFields []string `json:"-"`
  4511. }
  4512. func (s *GoogleCloudDialogflowV2beta1KnowledgeAnswers) MarshalJSON() ([]byte, error) {
  4513. type NoMethod GoogleCloudDialogflowV2beta1KnowledgeAnswers
  4514. raw := NoMethod(*s)
  4515. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4516. }
  4517. // GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer: An answer from
  4518. // Knowledge Connector.
  4519. type GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer struct {
  4520. // Answer: The piece of text from the `source` knowledge base document
  4521. // that answers
  4522. // this conversational query.
  4523. Answer string `json:"answer,omitempty"`
  4524. // FaqQuestion: The corresponding FAQ question if the answer was
  4525. // extracted from a FAQ
  4526. // Document, empty otherwise.
  4527. FaqQuestion string `json:"faqQuestion,omitempty"`
  4528. // MatchConfidence: The system's confidence score that this Knowledge
  4529. // answer is a good match
  4530. // for this conversational query.
  4531. // The range is from 0.0 (completely uncertain) to 1.0 (completely
  4532. // certain).
  4533. // Note: The confidence score is likely to vary somewhat (possibly even
  4534. // for
  4535. // identical requests), as the underlying model is under
  4536. // constant
  4537. // improvement. It may be deprecated in the future. We recommend
  4538. // using
  4539. // `match_confidence_level` which should be generally more stable.
  4540. MatchConfidence float64 `json:"matchConfidence,omitempty"`
  4541. // MatchConfidenceLevel: The system's confidence level that this
  4542. // knowledge answer is a good match
  4543. // for this conversational query.
  4544. // NOTE: The confidence level for a given `<query, answer>` pair may
  4545. // change
  4546. // without notice, as it depends on models that are constantly
  4547. // being
  4548. // improved. However, it will change less frequently than the
  4549. // confidence
  4550. // score below, and should be preferred for referencing the quality of
  4551. // an
  4552. // answer.
  4553. //
  4554. // Possible values:
  4555. // "MATCH_CONFIDENCE_LEVEL_UNSPECIFIED" - Not specified.
  4556. // "LOW" - Indicates that the confidence is low.
  4557. // "MEDIUM" - Indicates our confidence is medium.
  4558. // "HIGH" - Indicates our confidence is high.
  4559. MatchConfidenceLevel string `json:"matchConfidenceLevel,omitempty"`
  4560. // Source: Indicates which Knowledge Document this answer was extracted
  4561. // from.
  4562. // Format: `projects/<Project ID>/knowledgeBases/<Knowledge
  4563. // Base
  4564. // ID>/documents/<Document ID>`.
  4565. Source string `json:"source,omitempty"`
  4566. // ForceSendFields is a list of field names (e.g. "Answer") to
  4567. // unconditionally include in API requests. By default, fields with
  4568. // empty values are omitted from API requests. However, any non-pointer,
  4569. // non-interface field appearing in ForceSendFields will be sent to the
  4570. // server regardless of whether the field is empty or not. This may be
  4571. // used to include empty fields in Patch requests.
  4572. ForceSendFields []string `json:"-"`
  4573. // NullFields is a list of field names (e.g. "Answer") to include in API
  4574. // requests with the JSON null value. By default, fields with empty
  4575. // values are omitted from API requests. However, any field with an
  4576. // empty value appearing in NullFields will be sent to the server as
  4577. // null. It is an error if a field in this list has a non-empty value.
  4578. // This may be used to include null fields in Patch requests.
  4579. NullFields []string `json:"-"`
  4580. }
  4581. func (s *GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer) MarshalJSON() ([]byte, error) {
  4582. type NoMethod GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer
  4583. raw := NoMethod(*s)
  4584. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4585. }
  4586. func (s *GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer) UnmarshalJSON(data []byte) error {
  4587. type NoMethod GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer
  4588. var s1 struct {
  4589. MatchConfidence gensupport.JSONFloat64 `json:"matchConfidence"`
  4590. *NoMethod
  4591. }
  4592. s1.NoMethod = (*NoMethod)(s)
  4593. if err := json.Unmarshal(data, &s1); err != nil {
  4594. return err
  4595. }
  4596. s.MatchConfidence = float64(s1.MatchConfidence)
  4597. return nil
  4598. }
  4599. // GoogleCloudDialogflowV2beta1KnowledgeOperationMetadata: Metadata in
  4600. // google::longrunning::Operation for Knowledge operations.
  4601. type GoogleCloudDialogflowV2beta1KnowledgeOperationMetadata struct {
  4602. // State: Required. The current state of this operation.
  4603. //
  4604. // Possible values:
  4605. // "STATE_UNSPECIFIED" - State unspecified.
  4606. // "PENDING" - The operation has been created.
  4607. // "RUNNING" - The operation is currently running.
  4608. // "DONE" - The operation is done, either cancelled or completed.
  4609. State string `json:"state,omitempty"`
  4610. // ForceSendFields is a list of field names (e.g. "State") to
  4611. // unconditionally include in API requests. By default, fields with
  4612. // empty values are omitted from API requests. However, any non-pointer,
  4613. // non-interface field appearing in ForceSendFields will be sent to the
  4614. // server regardless of whether the field is empty or not. This may be
  4615. // used to include empty fields in Patch requests.
  4616. ForceSendFields []string `json:"-"`
  4617. // NullFields is a list of field names (e.g. "State") to include in API
  4618. // requests with the JSON null value. By default, fields with empty
  4619. // values are omitted from API requests. However, any field with an
  4620. // empty value appearing in NullFields will be sent to the server as
  4621. // null. It is an error if a field in this list has a non-empty value.
  4622. // This may be used to include null fields in Patch requests.
  4623. NullFields []string `json:"-"`
  4624. }
  4625. func (s *GoogleCloudDialogflowV2beta1KnowledgeOperationMetadata) MarshalJSON() ([]byte, error) {
  4626. type NoMethod GoogleCloudDialogflowV2beta1KnowledgeOperationMetadata
  4627. raw := NoMethod(*s)
  4628. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4629. }
  4630. // GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest: Represents
  4631. // the contents of the original request that was passed to
  4632. // the `[Streaming]DetectIntent` call.
  4633. type GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest struct {
  4634. // Payload: Optional. This field is set to the value of the
  4635. // `QueryParameters.payload`
  4636. // field passed in the request. Some integrations that query a
  4637. // Dialogflow
  4638. // agent may provide additional information in the payload.
  4639. //
  4640. // In particular for the Telephony Gateway this field has the
  4641. // form:
  4642. // <pre>{
  4643. // "telephony": {
  4644. // "caller_id": "+18558363987"
  4645. // }
  4646. // }</pre>
  4647. // Note: The caller ID field (`caller_id`) will be redacted for
  4648. // Standard
  4649. // Edition agents and populated with the caller ID in
  4650. // [E.164
  4651. // format](https://en.wikipedia.org/wiki/E.164) for Enterprise Edition
  4652. // agents.
  4653. Payload googleapi.RawMessage `json:"payload,omitempty"`
  4654. // Source: The source of this request, e.g., `google`, `facebook`,
  4655. // `slack`. It is set
  4656. // by Dialogflow-owned servers.
  4657. Source string `json:"source,omitempty"`
  4658. // Version: Optional. The version of the protocol used for this
  4659. // request.
  4660. // This field is AoG-specific.
  4661. Version string `json:"version,omitempty"`
  4662. // ForceSendFields is a list of field names (e.g. "Payload") to
  4663. // unconditionally include in API requests. By default, fields with
  4664. // empty values are omitted from API requests. However, any non-pointer,
  4665. // non-interface field appearing in ForceSendFields will be sent to the
  4666. // server regardless of whether the field is empty or not. This may be
  4667. // used to include empty fields in Patch requests.
  4668. ForceSendFields []string `json:"-"`
  4669. // NullFields is a list of field names (e.g. "Payload") to include in
  4670. // API requests with the JSON null value. By default, fields with empty
  4671. // values are omitted from API requests. However, any field with an
  4672. // empty value appearing in NullFields will be sent to the server as
  4673. // null. It is an error if a field in this list has a non-empty value.
  4674. // This may be used to include null fields in Patch requests.
  4675. NullFields []string `json:"-"`
  4676. }
  4677. func (s *GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest) MarshalJSON() ([]byte, error) {
  4678. type NoMethod GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest
  4679. raw := NoMethod(*s)
  4680. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4681. }
  4682. // GoogleCloudDialogflowV2beta1QueryResult: Represents the result of
  4683. // conversational query or event processing.
  4684. type GoogleCloudDialogflowV2beta1QueryResult struct {
  4685. // Action: The action name from the matched intent.
  4686. Action string `json:"action,omitempty"`
  4687. // AllRequiredParamsPresent: This field is set to:
  4688. // - `false` if the matched intent has required parameters and not all
  4689. // of
  4690. // the required parameter values have been collected.
  4691. // - `true` if all required parameter values have been collected, or if
  4692. // the
  4693. // matched intent doesn't contain any required parameters.
  4694. AllRequiredParamsPresent bool `json:"allRequiredParamsPresent,omitempty"`
  4695. // DiagnosticInfo: The free-form diagnostic info. For example, this
  4696. // field could contain
  4697. // webhook call latency. The string keys of the Struct's fields map can
  4698. // change
  4699. // without notice.
  4700. DiagnosticInfo googleapi.RawMessage `json:"diagnosticInfo,omitempty"`
  4701. // FulfillmentMessages: The collection of rich messages to present to
  4702. // the user.
  4703. FulfillmentMessages []*GoogleCloudDialogflowV2beta1IntentMessage `json:"fulfillmentMessages,omitempty"`
  4704. // FulfillmentText: The text to be pronounced to the user or shown on
  4705. // the screen.
  4706. // Note: This is a legacy field, `fulfillment_messages` should be
  4707. // preferred.
  4708. FulfillmentText string `json:"fulfillmentText,omitempty"`
  4709. // Intent: The intent that matched the conversational query. Some,
  4710. // not
  4711. // all fields are filled in this message, including but not limited
  4712. // to:
  4713. // `name`, `display_name` and `webhook_state`.
  4714. Intent *GoogleCloudDialogflowV2beta1Intent `json:"intent,omitempty"`
  4715. // IntentDetectionConfidence: The intent detection confidence. Values
  4716. // range from 0.0
  4717. // (completely uncertain) to 1.0 (completely certain).
  4718. // If there are `multiple knowledge_answers` messages, this value is set
  4719. // to
  4720. // the greatest `knowledgeAnswers.match_confidence` value in the list.
  4721. IntentDetectionConfidence float64 `json:"intentDetectionConfidence,omitempty"`
  4722. // KnowledgeAnswers: The result from Knowledge Connector (if any),
  4723. // ordered by decreasing
  4724. // `KnowledgeAnswers.match_confidence`.
  4725. KnowledgeAnswers *GoogleCloudDialogflowV2beta1KnowledgeAnswers `json:"knowledgeAnswers,omitempty"`
  4726. // LanguageCode: The language that was triggered during intent
  4727. // detection.
  4728. // See [Language
  4729. // Support](https://dialogflow.com/docs/reference/language)
  4730. // for a list of the currently supported language codes.
  4731. LanguageCode string `json:"languageCode,omitempty"`
  4732. // OutputContexts: The collection of output contexts. If
  4733. // applicable,
  4734. // `output_contexts.parameters` contains entries with name
  4735. // `<parameter name>.original` containing the original parameter
  4736. // values
  4737. // before the query.
  4738. OutputContexts []*GoogleCloudDialogflowV2beta1Context `json:"outputContexts,omitempty"`
  4739. // Parameters: The collection of extracted parameters.
  4740. Parameters googleapi.RawMessage `json:"parameters,omitempty"`
  4741. // QueryText: The original conversational query text:
  4742. // - If natural language text was provided as input, `query_text`
  4743. // contains
  4744. // a copy of the input.
  4745. // - If natural language speech audio was provided as input,
  4746. // `query_text`
  4747. // contains the speech recognition result. If speech recognizer
  4748. // produced
  4749. // multiple alternatives, a particular one is picked.
  4750. // - If an event was provided as input, `query_text` is not set.
  4751. QueryText string `json:"queryText,omitempty"`
  4752. // SentimentAnalysisResult: The sentiment analysis result, which depends
  4753. // on the
  4754. // `sentiment_analysis_request_config` specified in the request.
  4755. SentimentAnalysisResult *GoogleCloudDialogflowV2beta1SentimentAnalysisResult `json:"sentimentAnalysisResult,omitempty"`
  4756. // SpeechRecognitionConfidence: The Speech recognition confidence
  4757. // between 0.0 and 1.0. A higher number
  4758. // indicates an estimated greater likelihood that the recognized words
  4759. // are
  4760. // correct. The default of 0.0 is a sentinel value indicating that
  4761. // confidence
  4762. // was not set.
  4763. //
  4764. // This field is not guaranteed to be accurate or set. In particular
  4765. // this
  4766. // field isn't set for StreamingDetectIntent since the streaming
  4767. // endpoint has
  4768. // separate confidence estimates per portion of the audio
  4769. // in
  4770. // StreamingRecognitionResult.
  4771. SpeechRecognitionConfidence float64 `json:"speechRecognitionConfidence,omitempty"`
  4772. // WebhookPayload: If the query was fulfilled by a webhook call, this
  4773. // field is set to the
  4774. // value of the `payload` field returned in the webhook response.
  4775. WebhookPayload googleapi.RawMessage `json:"webhookPayload,omitempty"`
  4776. // WebhookSource: If the query was fulfilled by a webhook call, this
  4777. // field is set to the
  4778. // value of the `source` field returned in the webhook response.
  4779. WebhookSource string `json:"webhookSource,omitempty"`
  4780. // ForceSendFields is a list of field names (e.g. "Action") to
  4781. // unconditionally include in API requests. By default, fields with
  4782. // empty values are omitted from API requests. However, any non-pointer,
  4783. // non-interface field appearing in ForceSendFields will be sent to the
  4784. // server regardless of whether the field is empty or not. This may be
  4785. // used to include empty fields in Patch requests.
  4786. ForceSendFields []string `json:"-"`
  4787. // NullFields is a list of field names (e.g. "Action") to include in API
  4788. // requests with the JSON null value. By default, fields with empty
  4789. // values are omitted from API requests. However, any field with an
  4790. // empty value appearing in NullFields will be sent to the server as
  4791. // null. It is an error if a field in this list has a non-empty value.
  4792. // This may be used to include null fields in Patch requests.
  4793. NullFields []string `json:"-"`
  4794. }
  4795. func (s *GoogleCloudDialogflowV2beta1QueryResult) MarshalJSON() ([]byte, error) {
  4796. type NoMethod GoogleCloudDialogflowV2beta1QueryResult
  4797. raw := NoMethod(*s)
  4798. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4799. }
  4800. func (s *GoogleCloudDialogflowV2beta1QueryResult) UnmarshalJSON(data []byte) error {
  4801. type NoMethod GoogleCloudDialogflowV2beta1QueryResult
  4802. var s1 struct {
  4803. IntentDetectionConfidence gensupport.JSONFloat64 `json:"intentDetectionConfidence"`
  4804. SpeechRecognitionConfidence gensupport.JSONFloat64 `json:"speechRecognitionConfidence"`
  4805. *NoMethod
  4806. }
  4807. s1.NoMethod = (*NoMethod)(s)
  4808. if err := json.Unmarshal(data, &s1); err != nil {
  4809. return err
  4810. }
  4811. s.IntentDetectionConfidence = float64(s1.IntentDetectionConfidence)
  4812. s.SpeechRecognitionConfidence = float64(s1.SpeechRecognitionConfidence)
  4813. return nil
  4814. }
  4815. // GoogleCloudDialogflowV2beta1Sentiment: The sentiment, such as
  4816. // positive/negative feeling or association, for a unit
  4817. // of analysis, such as the query text.
  4818. type GoogleCloudDialogflowV2beta1Sentiment struct {
  4819. // Magnitude: A non-negative number in the [0, +inf) range, which
  4820. // represents the absolute
  4821. // magnitude of sentiment, regardless of score (positive or negative).
  4822. Magnitude float64 `json:"magnitude,omitempty"`
  4823. // Score: Sentiment score between -1.0 (negative sentiment) and 1.0
  4824. // (positive
  4825. // sentiment).
  4826. Score float64 `json:"score,omitempty"`
  4827. // ForceSendFields is a list of field names (e.g. "Magnitude") to
  4828. // unconditionally include in API requests. By default, fields with
  4829. // empty values are omitted from API requests. However, any non-pointer,
  4830. // non-interface field appearing in ForceSendFields will be sent to the
  4831. // server regardless of whether the field is empty or not. This may be
  4832. // used to include empty fields in Patch requests.
  4833. ForceSendFields []string `json:"-"`
  4834. // NullFields is a list of field names (e.g. "Magnitude") to include in
  4835. // API requests with the JSON null value. By default, fields with empty
  4836. // values are omitted from API requests. However, any field with an
  4837. // empty value appearing in NullFields will be sent to the server as
  4838. // null. It is an error if a field in this list has a non-empty value.
  4839. // This may be used to include null fields in Patch requests.
  4840. NullFields []string `json:"-"`
  4841. }
  4842. func (s *GoogleCloudDialogflowV2beta1Sentiment) MarshalJSON() ([]byte, error) {
  4843. type NoMethod GoogleCloudDialogflowV2beta1Sentiment
  4844. raw := NoMethod(*s)
  4845. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4846. }
  4847. func (s *GoogleCloudDialogflowV2beta1Sentiment) UnmarshalJSON(data []byte) error {
  4848. type NoMethod GoogleCloudDialogflowV2beta1Sentiment
  4849. var s1 struct {
  4850. Magnitude gensupport.JSONFloat64 `json:"magnitude"`
  4851. Score gensupport.JSONFloat64 `json:"score"`
  4852. *NoMethod
  4853. }
  4854. s1.NoMethod = (*NoMethod)(s)
  4855. if err := json.Unmarshal(data, &s1); err != nil {
  4856. return err
  4857. }
  4858. s.Magnitude = float64(s1.Magnitude)
  4859. s.Score = float64(s1.Score)
  4860. return nil
  4861. }
  4862. // GoogleCloudDialogflowV2beta1SentimentAnalysisResult: The result of
  4863. // sentiment analysis as configured
  4864. // by
  4865. // `sentiment_analysis_request_config`.
  4866. type GoogleCloudDialogflowV2beta1SentimentAnalysisResult struct {
  4867. // QueryTextSentiment: The sentiment analysis result for `query_text`.
  4868. QueryTextSentiment *GoogleCloudDialogflowV2beta1Sentiment `json:"queryTextSentiment,omitempty"`
  4869. // ForceSendFields is a list of field names (e.g. "QueryTextSentiment")
  4870. // to 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. // NullFields is a list of field names (e.g. "QueryTextSentiment") to
  4877. // include in API requests with the JSON null value. By default, fields
  4878. // with empty values are omitted from API requests. However, any field
  4879. // with an empty value appearing in NullFields will be sent to the
  4880. // server as null. It is an error if a field in this list has a
  4881. // non-empty value. This may be used to include null fields in Patch
  4882. // requests.
  4883. NullFields []string `json:"-"`
  4884. }
  4885. func (s *GoogleCloudDialogflowV2beta1SentimentAnalysisResult) MarshalJSON() ([]byte, error) {
  4886. type NoMethod GoogleCloudDialogflowV2beta1SentimentAnalysisResult
  4887. raw := NoMethod(*s)
  4888. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4889. }
  4890. // GoogleCloudDialogflowV2beta1WebhookRequest: The request message for a
  4891. // webhook call.
  4892. type GoogleCloudDialogflowV2beta1WebhookRequest struct {
  4893. // AlternativeQueryResults: Alternative query results from
  4894. // KnowledgeService.
  4895. AlternativeQueryResults []*GoogleCloudDialogflowV2beta1QueryResult `json:"alternativeQueryResults,omitempty"`
  4896. // OriginalDetectIntentRequest: Optional. The contents of the original
  4897. // request that was passed to
  4898. // `[Streaming]DetectIntent` call.
  4899. OriginalDetectIntentRequest *GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest `json:"originalDetectIntentRequest,omitempty"`
  4900. // QueryResult: The result of the conversational query or event
  4901. // processing. Contains the
  4902. // same value as `[Streaming]DetectIntentResponse.query_result`.
  4903. QueryResult *GoogleCloudDialogflowV2beta1QueryResult `json:"queryResult,omitempty"`
  4904. // ResponseId: The unique identifier of the response. Contains the same
  4905. // value as
  4906. // `[Streaming]DetectIntentResponse.response_id`.
  4907. ResponseId string `json:"responseId,omitempty"`
  4908. // Session: The unique identifier of detectIntent request session.
  4909. // Can be used to identify end-user inside webhook
  4910. // implementation.
  4911. // Format: `projects/<Project ID>/agent/sessions/<Session ID>`,
  4912. // or
  4913. // `projects/<Project ID>/agent/environments/<Environment
  4914. // ID>/users/<User
  4915. // ID>/sessions/<Session ID>`.
  4916. Session string `json:"session,omitempty"`
  4917. // ForceSendFields is a list of field names (e.g.
  4918. // "AlternativeQueryResults") to unconditionally include in API
  4919. // requests. By default, fields with empty values are omitted from API
  4920. // requests. However, any non-pointer, non-interface field appearing in
  4921. // ForceSendFields will be sent to the server regardless of whether the
  4922. // field is empty or not. This may be used to include empty fields in
  4923. // Patch requests.
  4924. ForceSendFields []string `json:"-"`
  4925. // NullFields is a list of field names (e.g. "AlternativeQueryResults")
  4926. // to include in API requests with the JSON null value. By default,
  4927. // fields with empty values are omitted from API requests. However, any
  4928. // field with an empty value appearing in NullFields will be sent to the
  4929. // server as null. It is an error if a field in this list has a
  4930. // non-empty value. This may be used to include null fields in Patch
  4931. // requests.
  4932. NullFields []string `json:"-"`
  4933. }
  4934. func (s *GoogleCloudDialogflowV2beta1WebhookRequest) MarshalJSON() ([]byte, error) {
  4935. type NoMethod GoogleCloudDialogflowV2beta1WebhookRequest
  4936. raw := NoMethod(*s)
  4937. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4938. }
  4939. // GoogleCloudDialogflowV2beta1WebhookResponse: The response message for
  4940. // a webhook call.
  4941. type GoogleCloudDialogflowV2beta1WebhookResponse struct {
  4942. // EndInteraction: Optional. Indicates that this intent ends an
  4943. // interaction. Some integrations
  4944. // (e.g., Actions on Google or Dialogflow phone gateway) use this
  4945. // information
  4946. // to close interaction with an end user. Default is false.
  4947. EndInteraction bool `json:"endInteraction,omitempty"`
  4948. // FollowupEventInput: Optional. Makes the platform immediately invoke
  4949. // another `DetectIntent` call
  4950. // internally with the specified event as input.
  4951. FollowupEventInput *GoogleCloudDialogflowV2beta1EventInput `json:"followupEventInput,omitempty"`
  4952. // FulfillmentMessages: Optional. The collection of rich messages to
  4953. // present to the user. This
  4954. // value is passed directly to `QueryResult.fulfillment_messages`.
  4955. FulfillmentMessages []*GoogleCloudDialogflowV2beta1IntentMessage `json:"fulfillmentMessages,omitempty"`
  4956. // FulfillmentText: Optional. The text to be shown on the screen. This
  4957. // value is passed directly
  4958. // to `QueryResult.fulfillment_text`.
  4959. FulfillmentText string `json:"fulfillmentText,omitempty"`
  4960. // OutputContexts: Optional. The collection of output contexts. This
  4961. // value is passed directly
  4962. // to `QueryResult.output_contexts`.
  4963. OutputContexts []*GoogleCloudDialogflowV2beta1Context `json:"outputContexts,omitempty"`
  4964. // Payload: Optional. This value is passed directly to
  4965. // `QueryResult.webhook_payload`.
  4966. // See the related `fulfillment_messages[i].payload field`, which may be
  4967. // used
  4968. // as an alternative to this field.
  4969. //
  4970. // This field can be used for Actions on Google responses.
  4971. // It should have a structure similar to the JSON message shown here.
  4972. // For more
  4973. // information, see
  4974. // [Actions on Google
  4975. // Webhook
  4976. // Format](https://developers.google.com/actions/dialogflow/webho
  4977. // ok)
  4978. // <pre>{
  4979. // "google": {
  4980. // "expectUserResponse": true,
  4981. // "richResponse": {
  4982. // "items": [
  4983. // {
  4984. // "simpleResponse": {
  4985. // "textToSpeech": "this is a simple response"
  4986. // }
  4987. // }
  4988. // ]
  4989. // }
  4990. // }
  4991. // }</pre>
  4992. Payload googleapi.RawMessage `json:"payload,omitempty"`
  4993. // Source: Optional. This value is passed directly to
  4994. // `QueryResult.webhook_source`.
  4995. Source string `json:"source,omitempty"`
  4996. // ForceSendFields is a list of field names (e.g. "EndInteraction") to
  4997. // unconditionally include in API requests. By default, fields with
  4998. // empty values are omitted from API requests. However, any non-pointer,
  4999. // non-interface field appearing in ForceSendFields will be sent to the
  5000. // server regardless of whether the field is empty or not. This may be
  5001. // used to include empty fields in Patch requests.
  5002. ForceSendFields []string `json:"-"`
  5003. // NullFields is a list of field names (e.g. "EndInteraction") to
  5004. // include in API requests with the JSON null value. By default, fields
  5005. // with empty values are omitted from API requests. However, any field
  5006. // with an empty value appearing in NullFields will be sent to the
  5007. // server as null. It is an error if a field in this list has a
  5008. // non-empty value. This may be used to include null fields in Patch
  5009. // requests.
  5010. NullFields []string `json:"-"`
  5011. }
  5012. func (s *GoogleCloudDialogflowV2beta1WebhookResponse) MarshalJSON() ([]byte, error) {
  5013. type NoMethod GoogleCloudDialogflowV2beta1WebhookResponse
  5014. raw := NoMethod(*s)
  5015. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5016. }
  5017. // GoogleLongrunningOperation: This resource represents a long-running
  5018. // operation that is the result of a
  5019. // network API call.
  5020. type GoogleLongrunningOperation struct {
  5021. // Done: If the value is `false`, it means the operation is still in
  5022. // progress.
  5023. // If `true`, the operation is completed, and either `error` or
  5024. // `response` is
  5025. // available.
  5026. Done bool `json:"done,omitempty"`
  5027. // Error: The error result of the operation in case of failure or
  5028. // cancellation.
  5029. Error *GoogleRpcStatus `json:"error,omitempty"`
  5030. // Metadata: Service-specific metadata associated with the operation.
  5031. // It typically
  5032. // contains progress information and common metadata such as create
  5033. // time.
  5034. // Some services might not provide such metadata. Any method that
  5035. // returns a
  5036. // long-running operation should document the metadata type, if any.
  5037. Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  5038. // Name: The server-assigned name, which is only unique within the same
  5039. // service that
  5040. // originally returns it. If you use the default HTTP mapping,
  5041. // the
  5042. // `name` should have the format of `operations/some/unique/name`.
  5043. Name string `json:"name,omitempty"`
  5044. // Response: The normal response of the operation in case of success.
  5045. // If the original
  5046. // method returns no data on success, such as `Delete`, the response
  5047. // is
  5048. // `google.protobuf.Empty`. If the original method is
  5049. // standard
  5050. // `Get`/`Create`/`Update`, the response should be the resource. For
  5051. // other
  5052. // methods, the response should have the type `XxxResponse`, where
  5053. // `Xxx`
  5054. // is the original method name. For example, if the original method
  5055. // name
  5056. // is `TakeSnapshot()`, the inferred response type
  5057. // is
  5058. // `TakeSnapshotResponse`.
  5059. Response googleapi.RawMessage `json:"response,omitempty"`
  5060. // ServerResponse contains the HTTP response code and headers from the
  5061. // server.
  5062. googleapi.ServerResponse `json:"-"`
  5063. // ForceSendFields is a list of field names (e.g. "Done") to
  5064. // unconditionally include in API requests. By default, fields with
  5065. // empty values are omitted from API requests. However, any non-pointer,
  5066. // non-interface field appearing in ForceSendFields will be sent to the
  5067. // server regardless of whether the field is empty or not. This may be
  5068. // used to include empty fields in Patch requests.
  5069. ForceSendFields []string `json:"-"`
  5070. // NullFields is a list of field names (e.g. "Done") to include in API
  5071. // requests with the JSON null value. By default, fields with empty
  5072. // values are omitted from API requests. However, any field with an
  5073. // empty value appearing in NullFields will be sent to the server as
  5074. // null. It is an error if a field in this list has a non-empty value.
  5075. // This may be used to include null fields in Patch requests.
  5076. NullFields []string `json:"-"`
  5077. }
  5078. func (s *GoogleLongrunningOperation) MarshalJSON() ([]byte, error) {
  5079. type NoMethod GoogleLongrunningOperation
  5080. raw := NoMethod(*s)
  5081. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5082. }
  5083. // GoogleProtobufEmpty: A generic empty message that you can re-use to
  5084. // avoid defining duplicated
  5085. // empty messages in your APIs. A typical example is to use it as the
  5086. // request
  5087. // or the response type of an API method. For instance:
  5088. //
  5089. // service Foo {
  5090. // rpc Bar(google.protobuf.Empty) returns
  5091. // (google.protobuf.Empty);
  5092. // }
  5093. //
  5094. // The JSON representation for `Empty` is empty JSON object `{}`.
  5095. type GoogleProtobufEmpty struct {
  5096. // ServerResponse contains the HTTP response code and headers from the
  5097. // server.
  5098. googleapi.ServerResponse `json:"-"`
  5099. }
  5100. // GoogleRpcStatus: The `Status` type defines a logical error model that
  5101. // is suitable for
  5102. // different programming environments, including REST APIs and RPC APIs.
  5103. // It is
  5104. // used by [gRPC](https://github.com/grpc). The error model is designed
  5105. // to be:
  5106. //
  5107. // - Simple to use and understand for most users
  5108. // - Flexible enough to meet unexpected needs
  5109. //
  5110. // # Overview
  5111. //
  5112. // The `Status` message contains three pieces of data: error code,
  5113. // error
  5114. // message, and error details. The error code should be an enum value
  5115. // of
  5116. // google.rpc.Code, but it may accept additional error codes if needed.
  5117. // The
  5118. // error message should be a developer-facing English message that
  5119. // helps
  5120. // developers *understand* and *resolve* the error. If a localized
  5121. // user-facing
  5122. // error message is needed, put the localized message in the error
  5123. // details or
  5124. // localize it in the client. The optional error details may contain
  5125. // arbitrary
  5126. // information about the error. There is a predefined set of error
  5127. // detail types
  5128. // in the package `google.rpc` that can be used for common error
  5129. // conditions.
  5130. //
  5131. // # Language mapping
  5132. //
  5133. // The `Status` message is the logical representation of the error
  5134. // model, but it
  5135. // is not necessarily the actual wire format. When the `Status` message
  5136. // is
  5137. // exposed in different client libraries and different wire protocols,
  5138. // it can be
  5139. // mapped differently. For example, it will likely be mapped to some
  5140. // exceptions
  5141. // in Java, but more likely mapped to some error codes in C.
  5142. //
  5143. // # Other uses
  5144. //
  5145. // The error model and the `Status` message can be used in a variety
  5146. // of
  5147. // environments, either with or without APIs, to provide a
  5148. // consistent developer experience across different
  5149. // environments.
  5150. //
  5151. // Example uses of this error model include:
  5152. //
  5153. // - Partial errors. If a service needs to return partial errors to the
  5154. // client,
  5155. // it may embed the `Status` in the normal response to indicate the
  5156. // partial
  5157. // errors.
  5158. //
  5159. // - Workflow errors. A typical workflow has multiple steps. Each step
  5160. // may
  5161. // have a `Status` message for error reporting.
  5162. //
  5163. // - Batch operations. If a client uses batch request and batch
  5164. // response, the
  5165. // `Status` message should be used directly inside batch response,
  5166. // one for
  5167. // each error sub-response.
  5168. //
  5169. // - Asynchronous operations. If an API call embeds asynchronous
  5170. // operation
  5171. // results in its response, the status of those operations should
  5172. // be
  5173. // represented directly using the `Status` message.
  5174. //
  5175. // - Logging. If some API errors are stored in logs, the message
  5176. // `Status` could
  5177. // be used directly after any stripping needed for security/privacy
  5178. // reasons.
  5179. type GoogleRpcStatus struct {
  5180. // Code: The status code, which should be an enum value of
  5181. // google.rpc.Code.
  5182. Code int64 `json:"code,omitempty"`
  5183. // Details: A list of messages that carry the error details. There is a
  5184. // common set of
  5185. // message types for APIs to use.
  5186. Details []googleapi.RawMessage `json:"details,omitempty"`
  5187. // Message: A developer-facing error message, which should be in
  5188. // English. Any
  5189. // user-facing error message should be localized and sent in
  5190. // the
  5191. // google.rpc.Status.details field, or localized by the client.
  5192. Message string `json:"message,omitempty"`
  5193. // ForceSendFields is a list of field names (e.g. "Code") to
  5194. // unconditionally include in API requests. By default, fields with
  5195. // empty values are omitted from API requests. However, any non-pointer,
  5196. // non-interface field appearing in ForceSendFields will be sent to the
  5197. // server regardless of whether the field is empty or not. This may be
  5198. // used to include empty fields in Patch requests.
  5199. ForceSendFields []string `json:"-"`
  5200. // NullFields is a list of field names (e.g. "Code") to include in API
  5201. // requests with the JSON null value. By default, fields with empty
  5202. // values are omitted from API requests. However, any field with an
  5203. // empty value appearing in NullFields will be sent to the server as
  5204. // null. It is an error if a field in this list has a non-empty value.
  5205. // This may be used to include null fields in Patch requests.
  5206. NullFields []string `json:"-"`
  5207. }
  5208. func (s *GoogleRpcStatus) MarshalJSON() ([]byte, error) {
  5209. type NoMethod GoogleRpcStatus
  5210. raw := NoMethod(*s)
  5211. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5212. }
  5213. // GoogleTypeLatLng: An object representing a latitude/longitude pair.
  5214. // This is expressed as a pair
  5215. // of doubles representing degrees latitude and degrees longitude.
  5216. // Unless
  5217. // specified otherwise, this must conform to the
  5218. // <a
  5219. // href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
  5220. // st
  5221. // andard</a>. Values must be within normalized ranges.
  5222. type GoogleTypeLatLng struct {
  5223. // Latitude: The latitude in degrees. It must be in the range [-90.0,
  5224. // +90.0].
  5225. Latitude float64 `json:"latitude,omitempty"`
  5226. // Longitude: The longitude in degrees. It must be in the range [-180.0,
  5227. // +180.0].
  5228. Longitude float64 `json:"longitude,omitempty"`
  5229. // ForceSendFields is a list of field names (e.g. "Latitude") to
  5230. // unconditionally include in API requests. By default, fields with
  5231. // empty values are omitted from API requests. However, any non-pointer,
  5232. // non-interface field appearing in ForceSendFields will be sent to the
  5233. // server regardless of whether the field is empty or not. This may be
  5234. // used to include empty fields in Patch requests.
  5235. ForceSendFields []string `json:"-"`
  5236. // NullFields is a list of field names (e.g. "Latitude") to include in
  5237. // API requests with the JSON null value. By default, fields with empty
  5238. // values are omitted from API requests. However, any field with an
  5239. // empty value appearing in NullFields will be sent to the server as
  5240. // null. It is an error if a field in this list has a non-empty value.
  5241. // This may be used to include null fields in Patch requests.
  5242. NullFields []string `json:"-"`
  5243. }
  5244. func (s *GoogleTypeLatLng) MarshalJSON() ([]byte, error) {
  5245. type NoMethod GoogleTypeLatLng
  5246. raw := NoMethod(*s)
  5247. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5248. }
  5249. func (s *GoogleTypeLatLng) UnmarshalJSON(data []byte) error {
  5250. type NoMethod GoogleTypeLatLng
  5251. var s1 struct {
  5252. Latitude gensupport.JSONFloat64 `json:"latitude"`
  5253. Longitude gensupport.JSONFloat64 `json:"longitude"`
  5254. *NoMethod
  5255. }
  5256. s1.NoMethod = (*NoMethod)(s)
  5257. if err := json.Unmarshal(data, &s1); err != nil {
  5258. return err
  5259. }
  5260. s.Latitude = float64(s1.Latitude)
  5261. s.Longitude = float64(s1.Longitude)
  5262. return nil
  5263. }
  5264. // method id "dialogflow.projects.getAgent":
  5265. type ProjectsGetAgentCall struct {
  5266. s *Service
  5267. parent string
  5268. urlParams_ gensupport.URLParams
  5269. ifNoneMatch_ string
  5270. ctx_ context.Context
  5271. header_ http.Header
  5272. }
  5273. // GetAgent: Retrieves the specified agent.
  5274. func (r *ProjectsService) GetAgent(parent string) *ProjectsGetAgentCall {
  5275. c := &ProjectsGetAgentCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5276. c.parent = parent
  5277. return c
  5278. }
  5279. // Fields allows partial responses to be retrieved. See
  5280. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5281. // for more information.
  5282. func (c *ProjectsGetAgentCall) Fields(s ...googleapi.Field) *ProjectsGetAgentCall {
  5283. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5284. return c
  5285. }
  5286. // IfNoneMatch sets the optional parameter which makes the operation
  5287. // fail if the object's ETag matches the given value. This is useful for
  5288. // getting updates only after the object has changed since the last
  5289. // request. Use googleapi.IsNotModified to check whether the response
  5290. // error from Do is the result of In-None-Match.
  5291. func (c *ProjectsGetAgentCall) IfNoneMatch(entityTag string) *ProjectsGetAgentCall {
  5292. c.ifNoneMatch_ = entityTag
  5293. return c
  5294. }
  5295. // Context sets the context to be used in this call's Do method. Any
  5296. // pending HTTP request will be aborted if the provided context is
  5297. // canceled.
  5298. func (c *ProjectsGetAgentCall) Context(ctx context.Context) *ProjectsGetAgentCall {
  5299. c.ctx_ = ctx
  5300. return c
  5301. }
  5302. // Header returns an http.Header that can be modified by the caller to
  5303. // add HTTP headers to the request.
  5304. func (c *ProjectsGetAgentCall) Header() http.Header {
  5305. if c.header_ == nil {
  5306. c.header_ = make(http.Header)
  5307. }
  5308. return c.header_
  5309. }
  5310. func (c *ProjectsGetAgentCall) doRequest(alt string) (*http.Response, error) {
  5311. reqHeaders := make(http.Header)
  5312. for k, v := range c.header_ {
  5313. reqHeaders[k] = v
  5314. }
  5315. reqHeaders.Set("User-Agent", c.s.userAgent())
  5316. if c.ifNoneMatch_ != "" {
  5317. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5318. }
  5319. var body io.Reader = nil
  5320. c.urlParams_.Set("alt", alt)
  5321. c.urlParams_.Set("prettyPrint", "false")
  5322. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/agent")
  5323. urls += "?" + c.urlParams_.Encode()
  5324. req, err := http.NewRequest("GET", urls, body)
  5325. if err != nil {
  5326. return nil, err
  5327. }
  5328. req.Header = reqHeaders
  5329. googleapi.Expand(req.URL, map[string]string{
  5330. "parent": c.parent,
  5331. })
  5332. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5333. }
  5334. // Do executes the "dialogflow.projects.getAgent" call.
  5335. // Exactly one of *GoogleCloudDialogflowV2Agent or error will be
  5336. // non-nil. Any non-2xx status code is an error. Response headers are in
  5337. // either *GoogleCloudDialogflowV2Agent.ServerResponse.Header or (if a
  5338. // response was returned at all) in error.(*googleapi.Error).Header. Use
  5339. // googleapi.IsNotModified to check whether the returned error was
  5340. // because http.StatusNotModified was returned.
  5341. func (c *ProjectsGetAgentCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2Agent, error) {
  5342. gensupport.SetOptions(c.urlParams_, opts...)
  5343. res, err := c.doRequest("json")
  5344. if res != nil && res.StatusCode == http.StatusNotModified {
  5345. if res.Body != nil {
  5346. res.Body.Close()
  5347. }
  5348. return nil, &googleapi.Error{
  5349. Code: res.StatusCode,
  5350. Header: res.Header,
  5351. }
  5352. }
  5353. if err != nil {
  5354. return nil, err
  5355. }
  5356. defer googleapi.CloseBody(res)
  5357. if err := googleapi.CheckResponse(res); err != nil {
  5358. return nil, err
  5359. }
  5360. ret := &GoogleCloudDialogflowV2Agent{
  5361. ServerResponse: googleapi.ServerResponse{
  5362. Header: res.Header,
  5363. HTTPStatusCode: res.StatusCode,
  5364. },
  5365. }
  5366. target := &ret
  5367. if err := gensupport.DecodeResponse(target, res); err != nil {
  5368. return nil, err
  5369. }
  5370. return ret, nil
  5371. // {
  5372. // "description": "Retrieves the specified agent.",
  5373. // "flatPath": "v2/projects/{projectsId}/agent",
  5374. // "httpMethod": "GET",
  5375. // "id": "dialogflow.projects.getAgent",
  5376. // "parameterOrder": [
  5377. // "parent"
  5378. // ],
  5379. // "parameters": {
  5380. // "parent": {
  5381. // "description": "Required. The project that the agent to fetch is associated with.\nFormat: `projects/\u003cProject ID\u003e`.",
  5382. // "location": "path",
  5383. // "pattern": "^projects/[^/]+$",
  5384. // "required": true,
  5385. // "type": "string"
  5386. // }
  5387. // },
  5388. // "path": "v2/{+parent}/agent",
  5389. // "response": {
  5390. // "$ref": "GoogleCloudDialogflowV2Agent"
  5391. // },
  5392. // "scopes": [
  5393. // "https://www.googleapis.com/auth/cloud-platform",
  5394. // "https://www.googleapis.com/auth/dialogflow"
  5395. // ]
  5396. // }
  5397. }
  5398. // method id "dialogflow.projects.agent.export":
  5399. type ProjectsAgentExportCall struct {
  5400. s *Service
  5401. parent string
  5402. googleclouddialogflowv2exportagentrequest *GoogleCloudDialogflowV2ExportAgentRequest
  5403. urlParams_ gensupport.URLParams
  5404. ctx_ context.Context
  5405. header_ http.Header
  5406. }
  5407. // Export: Exports the specified agent to a ZIP file.
  5408. //
  5409. // Operation <response: ExportAgentResponse>
  5410. func (r *ProjectsAgentService) Export(parent string, googleclouddialogflowv2exportagentrequest *GoogleCloudDialogflowV2ExportAgentRequest) *ProjectsAgentExportCall {
  5411. c := &ProjectsAgentExportCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5412. c.parent = parent
  5413. c.googleclouddialogflowv2exportagentrequest = googleclouddialogflowv2exportagentrequest
  5414. return c
  5415. }
  5416. // Fields allows partial responses to be retrieved. See
  5417. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5418. // for more information.
  5419. func (c *ProjectsAgentExportCall) Fields(s ...googleapi.Field) *ProjectsAgentExportCall {
  5420. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5421. return c
  5422. }
  5423. // Context sets the context to be used in this call's Do method. Any
  5424. // pending HTTP request will be aborted if the provided context is
  5425. // canceled.
  5426. func (c *ProjectsAgentExportCall) Context(ctx context.Context) *ProjectsAgentExportCall {
  5427. c.ctx_ = ctx
  5428. return c
  5429. }
  5430. // Header returns an http.Header that can be modified by the caller to
  5431. // add HTTP headers to the request.
  5432. func (c *ProjectsAgentExportCall) Header() http.Header {
  5433. if c.header_ == nil {
  5434. c.header_ = make(http.Header)
  5435. }
  5436. return c.header_
  5437. }
  5438. func (c *ProjectsAgentExportCall) doRequest(alt string) (*http.Response, error) {
  5439. reqHeaders := make(http.Header)
  5440. for k, v := range c.header_ {
  5441. reqHeaders[k] = v
  5442. }
  5443. reqHeaders.Set("User-Agent", c.s.userAgent())
  5444. var body io.Reader = nil
  5445. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2exportagentrequest)
  5446. if err != nil {
  5447. return nil, err
  5448. }
  5449. reqHeaders.Set("Content-Type", "application/json")
  5450. c.urlParams_.Set("alt", alt)
  5451. c.urlParams_.Set("prettyPrint", "false")
  5452. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/agent:export")
  5453. urls += "?" + c.urlParams_.Encode()
  5454. req, err := http.NewRequest("POST", urls, body)
  5455. if err != nil {
  5456. return nil, err
  5457. }
  5458. req.Header = reqHeaders
  5459. googleapi.Expand(req.URL, map[string]string{
  5460. "parent": c.parent,
  5461. })
  5462. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5463. }
  5464. // Do executes the "dialogflow.projects.agent.export" call.
  5465. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  5466. // Any non-2xx status code is an error. Response headers are in either
  5467. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  5468. // was returned at all) in error.(*googleapi.Error).Header. Use
  5469. // googleapi.IsNotModified to check whether the returned error was
  5470. // because http.StatusNotModified was returned.
  5471. func (c *ProjectsAgentExportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  5472. gensupport.SetOptions(c.urlParams_, opts...)
  5473. res, err := c.doRequest("json")
  5474. if res != nil && res.StatusCode == http.StatusNotModified {
  5475. if res.Body != nil {
  5476. res.Body.Close()
  5477. }
  5478. return nil, &googleapi.Error{
  5479. Code: res.StatusCode,
  5480. Header: res.Header,
  5481. }
  5482. }
  5483. if err != nil {
  5484. return nil, err
  5485. }
  5486. defer googleapi.CloseBody(res)
  5487. if err := googleapi.CheckResponse(res); err != nil {
  5488. return nil, err
  5489. }
  5490. ret := &GoogleLongrunningOperation{
  5491. ServerResponse: googleapi.ServerResponse{
  5492. Header: res.Header,
  5493. HTTPStatusCode: res.StatusCode,
  5494. },
  5495. }
  5496. target := &ret
  5497. if err := gensupport.DecodeResponse(target, res); err != nil {
  5498. return nil, err
  5499. }
  5500. return ret, nil
  5501. // {
  5502. // "description": "Exports the specified agent to a ZIP file.\n\nOperation \u003cresponse: ExportAgentResponse\u003e",
  5503. // "flatPath": "v2/projects/{projectsId}/agent:export",
  5504. // "httpMethod": "POST",
  5505. // "id": "dialogflow.projects.agent.export",
  5506. // "parameterOrder": [
  5507. // "parent"
  5508. // ],
  5509. // "parameters": {
  5510. // "parent": {
  5511. // "description": "Required. The project that the agent to export is associated with.\nFormat: `projects/\u003cProject ID\u003e`.",
  5512. // "location": "path",
  5513. // "pattern": "^projects/[^/]+$",
  5514. // "required": true,
  5515. // "type": "string"
  5516. // }
  5517. // },
  5518. // "path": "v2/{+parent}/agent:export",
  5519. // "request": {
  5520. // "$ref": "GoogleCloudDialogflowV2ExportAgentRequest"
  5521. // },
  5522. // "response": {
  5523. // "$ref": "GoogleLongrunningOperation"
  5524. // },
  5525. // "scopes": [
  5526. // "https://www.googleapis.com/auth/cloud-platform",
  5527. // "https://www.googleapis.com/auth/dialogflow"
  5528. // ]
  5529. // }
  5530. }
  5531. // method id "dialogflow.projects.agent.import":
  5532. type ProjectsAgentImportCall struct {
  5533. s *Service
  5534. parent string
  5535. googleclouddialogflowv2importagentrequest *GoogleCloudDialogflowV2ImportAgentRequest
  5536. urlParams_ gensupport.URLParams
  5537. ctx_ context.Context
  5538. header_ http.Header
  5539. }
  5540. // Import: Imports the specified agent from a ZIP file.
  5541. //
  5542. // Uploads new intents and entity types without deleting the existing
  5543. // ones.
  5544. // Intents and entity types with the same name are replaced with the
  5545. // new
  5546. // versions from ImportAgentRequest.
  5547. //
  5548. // Operation <response: google.protobuf.Empty>
  5549. func (r *ProjectsAgentService) Import(parent string, googleclouddialogflowv2importagentrequest *GoogleCloudDialogflowV2ImportAgentRequest) *ProjectsAgentImportCall {
  5550. c := &ProjectsAgentImportCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5551. c.parent = parent
  5552. c.googleclouddialogflowv2importagentrequest = googleclouddialogflowv2importagentrequest
  5553. return c
  5554. }
  5555. // Fields allows partial responses to be retrieved. See
  5556. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5557. // for more information.
  5558. func (c *ProjectsAgentImportCall) Fields(s ...googleapi.Field) *ProjectsAgentImportCall {
  5559. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5560. return c
  5561. }
  5562. // Context sets the context to be used in this call's Do method. Any
  5563. // pending HTTP request will be aborted if the provided context is
  5564. // canceled.
  5565. func (c *ProjectsAgentImportCall) Context(ctx context.Context) *ProjectsAgentImportCall {
  5566. c.ctx_ = ctx
  5567. return c
  5568. }
  5569. // Header returns an http.Header that can be modified by the caller to
  5570. // add HTTP headers to the request.
  5571. func (c *ProjectsAgentImportCall) Header() http.Header {
  5572. if c.header_ == nil {
  5573. c.header_ = make(http.Header)
  5574. }
  5575. return c.header_
  5576. }
  5577. func (c *ProjectsAgentImportCall) doRequest(alt string) (*http.Response, error) {
  5578. reqHeaders := make(http.Header)
  5579. for k, v := range c.header_ {
  5580. reqHeaders[k] = v
  5581. }
  5582. reqHeaders.Set("User-Agent", c.s.userAgent())
  5583. var body io.Reader = nil
  5584. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2importagentrequest)
  5585. if err != nil {
  5586. return nil, err
  5587. }
  5588. reqHeaders.Set("Content-Type", "application/json")
  5589. c.urlParams_.Set("alt", alt)
  5590. c.urlParams_.Set("prettyPrint", "false")
  5591. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/agent:import")
  5592. urls += "?" + c.urlParams_.Encode()
  5593. req, err := http.NewRequest("POST", urls, body)
  5594. if err != nil {
  5595. return nil, err
  5596. }
  5597. req.Header = reqHeaders
  5598. googleapi.Expand(req.URL, map[string]string{
  5599. "parent": c.parent,
  5600. })
  5601. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5602. }
  5603. // Do executes the "dialogflow.projects.agent.import" call.
  5604. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  5605. // Any non-2xx status code is an error. Response headers are in either
  5606. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  5607. // was returned at all) in error.(*googleapi.Error).Header. Use
  5608. // googleapi.IsNotModified to check whether the returned error was
  5609. // because http.StatusNotModified was returned.
  5610. func (c *ProjectsAgentImportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  5611. gensupport.SetOptions(c.urlParams_, opts...)
  5612. res, err := c.doRequest("json")
  5613. if res != nil && res.StatusCode == http.StatusNotModified {
  5614. if res.Body != nil {
  5615. res.Body.Close()
  5616. }
  5617. return nil, &googleapi.Error{
  5618. Code: res.StatusCode,
  5619. Header: res.Header,
  5620. }
  5621. }
  5622. if err != nil {
  5623. return nil, err
  5624. }
  5625. defer googleapi.CloseBody(res)
  5626. if err := googleapi.CheckResponse(res); err != nil {
  5627. return nil, err
  5628. }
  5629. ret := &GoogleLongrunningOperation{
  5630. ServerResponse: googleapi.ServerResponse{
  5631. Header: res.Header,
  5632. HTTPStatusCode: res.StatusCode,
  5633. },
  5634. }
  5635. target := &ret
  5636. if err := gensupport.DecodeResponse(target, res); err != nil {
  5637. return nil, err
  5638. }
  5639. return ret, nil
  5640. // {
  5641. // "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",
  5642. // "flatPath": "v2/projects/{projectsId}/agent:import",
  5643. // "httpMethod": "POST",
  5644. // "id": "dialogflow.projects.agent.import",
  5645. // "parameterOrder": [
  5646. // "parent"
  5647. // ],
  5648. // "parameters": {
  5649. // "parent": {
  5650. // "description": "Required. The project that the agent to import is associated with.\nFormat: `projects/\u003cProject ID\u003e`.",
  5651. // "location": "path",
  5652. // "pattern": "^projects/[^/]+$",
  5653. // "required": true,
  5654. // "type": "string"
  5655. // }
  5656. // },
  5657. // "path": "v2/{+parent}/agent:import",
  5658. // "request": {
  5659. // "$ref": "GoogleCloudDialogflowV2ImportAgentRequest"
  5660. // },
  5661. // "response": {
  5662. // "$ref": "GoogleLongrunningOperation"
  5663. // },
  5664. // "scopes": [
  5665. // "https://www.googleapis.com/auth/cloud-platform",
  5666. // "https://www.googleapis.com/auth/dialogflow"
  5667. // ]
  5668. // }
  5669. }
  5670. // method id "dialogflow.projects.agent.restore":
  5671. type ProjectsAgentRestoreCall struct {
  5672. s *Service
  5673. parent string
  5674. googleclouddialogflowv2restoreagentrequest *GoogleCloudDialogflowV2RestoreAgentRequest
  5675. urlParams_ gensupport.URLParams
  5676. ctx_ context.Context
  5677. header_ http.Header
  5678. }
  5679. // Restore: Restores the specified agent from a ZIP file.
  5680. //
  5681. // Replaces the current agent version with a new one. All the intents
  5682. // and
  5683. // entity types in the older version are deleted.
  5684. //
  5685. // Operation <response: google.protobuf.Empty>
  5686. func (r *ProjectsAgentService) Restore(parent string, googleclouddialogflowv2restoreagentrequest *GoogleCloudDialogflowV2RestoreAgentRequest) *ProjectsAgentRestoreCall {
  5687. c := &ProjectsAgentRestoreCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5688. c.parent = parent
  5689. c.googleclouddialogflowv2restoreagentrequest = googleclouddialogflowv2restoreagentrequest
  5690. return c
  5691. }
  5692. // Fields allows partial responses to be retrieved. See
  5693. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5694. // for more information.
  5695. func (c *ProjectsAgentRestoreCall) Fields(s ...googleapi.Field) *ProjectsAgentRestoreCall {
  5696. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5697. return c
  5698. }
  5699. // Context sets the context to be used in this call's Do method. Any
  5700. // pending HTTP request will be aborted if the provided context is
  5701. // canceled.
  5702. func (c *ProjectsAgentRestoreCall) Context(ctx context.Context) *ProjectsAgentRestoreCall {
  5703. c.ctx_ = ctx
  5704. return c
  5705. }
  5706. // Header returns an http.Header that can be modified by the caller to
  5707. // add HTTP headers to the request.
  5708. func (c *ProjectsAgentRestoreCall) Header() http.Header {
  5709. if c.header_ == nil {
  5710. c.header_ = make(http.Header)
  5711. }
  5712. return c.header_
  5713. }
  5714. func (c *ProjectsAgentRestoreCall) doRequest(alt string) (*http.Response, error) {
  5715. reqHeaders := make(http.Header)
  5716. for k, v := range c.header_ {
  5717. reqHeaders[k] = v
  5718. }
  5719. reqHeaders.Set("User-Agent", c.s.userAgent())
  5720. var body io.Reader = nil
  5721. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2restoreagentrequest)
  5722. if err != nil {
  5723. return nil, err
  5724. }
  5725. reqHeaders.Set("Content-Type", "application/json")
  5726. c.urlParams_.Set("alt", alt)
  5727. c.urlParams_.Set("prettyPrint", "false")
  5728. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/agent:restore")
  5729. urls += "?" + c.urlParams_.Encode()
  5730. req, err := http.NewRequest("POST", urls, body)
  5731. if err != nil {
  5732. return nil, err
  5733. }
  5734. req.Header = reqHeaders
  5735. googleapi.Expand(req.URL, map[string]string{
  5736. "parent": c.parent,
  5737. })
  5738. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5739. }
  5740. // Do executes the "dialogflow.projects.agent.restore" call.
  5741. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  5742. // Any non-2xx status code is an error. Response headers are in either
  5743. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  5744. // was returned at all) in error.(*googleapi.Error).Header. Use
  5745. // googleapi.IsNotModified to check whether the returned error was
  5746. // because http.StatusNotModified was returned.
  5747. func (c *ProjectsAgentRestoreCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  5748. gensupport.SetOptions(c.urlParams_, opts...)
  5749. res, err := c.doRequest("json")
  5750. if res != nil && res.StatusCode == http.StatusNotModified {
  5751. if res.Body != nil {
  5752. res.Body.Close()
  5753. }
  5754. return nil, &googleapi.Error{
  5755. Code: res.StatusCode,
  5756. Header: res.Header,
  5757. }
  5758. }
  5759. if err != nil {
  5760. return nil, err
  5761. }
  5762. defer googleapi.CloseBody(res)
  5763. if err := googleapi.CheckResponse(res); err != nil {
  5764. return nil, err
  5765. }
  5766. ret := &GoogleLongrunningOperation{
  5767. ServerResponse: googleapi.ServerResponse{
  5768. Header: res.Header,
  5769. HTTPStatusCode: res.StatusCode,
  5770. },
  5771. }
  5772. target := &ret
  5773. if err := gensupport.DecodeResponse(target, res); err != nil {
  5774. return nil, err
  5775. }
  5776. return ret, nil
  5777. // {
  5778. // "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",
  5779. // "flatPath": "v2/projects/{projectsId}/agent:restore",
  5780. // "httpMethod": "POST",
  5781. // "id": "dialogflow.projects.agent.restore",
  5782. // "parameterOrder": [
  5783. // "parent"
  5784. // ],
  5785. // "parameters": {
  5786. // "parent": {
  5787. // "description": "Required. The project that the agent to restore is associated with.\nFormat: `projects/\u003cProject ID\u003e`.",
  5788. // "location": "path",
  5789. // "pattern": "^projects/[^/]+$",
  5790. // "required": true,
  5791. // "type": "string"
  5792. // }
  5793. // },
  5794. // "path": "v2/{+parent}/agent:restore",
  5795. // "request": {
  5796. // "$ref": "GoogleCloudDialogflowV2RestoreAgentRequest"
  5797. // },
  5798. // "response": {
  5799. // "$ref": "GoogleLongrunningOperation"
  5800. // },
  5801. // "scopes": [
  5802. // "https://www.googleapis.com/auth/cloud-platform",
  5803. // "https://www.googleapis.com/auth/dialogflow"
  5804. // ]
  5805. // }
  5806. }
  5807. // method id "dialogflow.projects.agent.search":
  5808. type ProjectsAgentSearchCall struct {
  5809. s *Service
  5810. parent string
  5811. urlParams_ gensupport.URLParams
  5812. ifNoneMatch_ string
  5813. ctx_ context.Context
  5814. header_ http.Header
  5815. }
  5816. // Search: Returns the list of agents.
  5817. //
  5818. // Since there is at most one conversational agent per project, this
  5819. // method is
  5820. // useful primarily for listing all agents across projects the caller
  5821. // has
  5822. // access to. One can achieve that with a wildcard project collection id
  5823. // "-".
  5824. // Refer to
  5825. // [List
  5826. // Sub-Collections](https://cloud.google.com/apis/design/design_pat
  5827. // terns#list_sub-collections).
  5828. func (r *ProjectsAgentService) Search(parent string) *ProjectsAgentSearchCall {
  5829. c := &ProjectsAgentSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5830. c.parent = parent
  5831. return c
  5832. }
  5833. // PageSize sets the optional parameter "pageSize": The maximum number
  5834. // of items to return in a single page. By
  5835. // default 100 and at most 1000.
  5836. func (c *ProjectsAgentSearchCall) PageSize(pageSize int64) *ProjectsAgentSearchCall {
  5837. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  5838. return c
  5839. }
  5840. // PageToken sets the optional parameter "pageToken": The
  5841. // next_page_token value returned from a previous list request.
  5842. func (c *ProjectsAgentSearchCall) PageToken(pageToken string) *ProjectsAgentSearchCall {
  5843. c.urlParams_.Set("pageToken", pageToken)
  5844. return c
  5845. }
  5846. // Fields allows partial responses to be retrieved. See
  5847. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5848. // for more information.
  5849. func (c *ProjectsAgentSearchCall) Fields(s ...googleapi.Field) *ProjectsAgentSearchCall {
  5850. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5851. return c
  5852. }
  5853. // IfNoneMatch sets the optional parameter which makes the operation
  5854. // fail if the object's ETag matches the given value. This is useful for
  5855. // getting updates only after the object has changed since the last
  5856. // request. Use googleapi.IsNotModified to check whether the response
  5857. // error from Do is the result of In-None-Match.
  5858. func (c *ProjectsAgentSearchCall) IfNoneMatch(entityTag string) *ProjectsAgentSearchCall {
  5859. c.ifNoneMatch_ = entityTag
  5860. return c
  5861. }
  5862. // Context sets the context to be used in this call's Do method. Any
  5863. // pending HTTP request will be aborted if the provided context is
  5864. // canceled.
  5865. func (c *ProjectsAgentSearchCall) Context(ctx context.Context) *ProjectsAgentSearchCall {
  5866. c.ctx_ = ctx
  5867. return c
  5868. }
  5869. // Header returns an http.Header that can be modified by the caller to
  5870. // add HTTP headers to the request.
  5871. func (c *ProjectsAgentSearchCall) Header() http.Header {
  5872. if c.header_ == nil {
  5873. c.header_ = make(http.Header)
  5874. }
  5875. return c.header_
  5876. }
  5877. func (c *ProjectsAgentSearchCall) doRequest(alt string) (*http.Response, error) {
  5878. reqHeaders := make(http.Header)
  5879. for k, v := range c.header_ {
  5880. reqHeaders[k] = v
  5881. }
  5882. reqHeaders.Set("User-Agent", c.s.userAgent())
  5883. if c.ifNoneMatch_ != "" {
  5884. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5885. }
  5886. var body io.Reader = nil
  5887. c.urlParams_.Set("alt", alt)
  5888. c.urlParams_.Set("prettyPrint", "false")
  5889. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/agent:search")
  5890. urls += "?" + c.urlParams_.Encode()
  5891. req, err := http.NewRequest("GET", urls, body)
  5892. if err != nil {
  5893. return nil, err
  5894. }
  5895. req.Header = reqHeaders
  5896. googleapi.Expand(req.URL, map[string]string{
  5897. "parent": c.parent,
  5898. })
  5899. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5900. }
  5901. // Do executes the "dialogflow.projects.agent.search" call.
  5902. // Exactly one of *GoogleCloudDialogflowV2SearchAgentsResponse or error
  5903. // will be non-nil. Any non-2xx status code is an error. Response
  5904. // headers are in either
  5905. // *GoogleCloudDialogflowV2SearchAgentsResponse.ServerResponse.Header or
  5906. // (if a response was returned at all) in
  5907. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5908. // whether the returned error was because http.StatusNotModified was
  5909. // returned.
  5910. func (c *ProjectsAgentSearchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2SearchAgentsResponse, error) {
  5911. gensupport.SetOptions(c.urlParams_, opts...)
  5912. res, err := c.doRequest("json")
  5913. if res != nil && res.StatusCode == http.StatusNotModified {
  5914. if res.Body != nil {
  5915. res.Body.Close()
  5916. }
  5917. return nil, &googleapi.Error{
  5918. Code: res.StatusCode,
  5919. Header: res.Header,
  5920. }
  5921. }
  5922. if err != nil {
  5923. return nil, err
  5924. }
  5925. defer googleapi.CloseBody(res)
  5926. if err := googleapi.CheckResponse(res); err != nil {
  5927. return nil, err
  5928. }
  5929. ret := &GoogleCloudDialogflowV2SearchAgentsResponse{
  5930. ServerResponse: googleapi.ServerResponse{
  5931. Header: res.Header,
  5932. HTTPStatusCode: res.StatusCode,
  5933. },
  5934. }
  5935. target := &ret
  5936. if err := gensupport.DecodeResponse(target, res); err != nil {
  5937. return nil, err
  5938. }
  5939. return ret, nil
  5940. // {
  5941. // "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).",
  5942. // "flatPath": "v2/projects/{projectsId}/agent:search",
  5943. // "httpMethod": "GET",
  5944. // "id": "dialogflow.projects.agent.search",
  5945. // "parameterOrder": [
  5946. // "parent"
  5947. // ],
  5948. // "parameters": {
  5949. // "pageSize": {
  5950. // "description": "Optional. The maximum number of items to return in a single page. By\ndefault 100 and at most 1000.",
  5951. // "format": "int32",
  5952. // "location": "query",
  5953. // "type": "integer"
  5954. // },
  5955. // "pageToken": {
  5956. // "description": "Optional. The next_page_token value returned from a previous list request.",
  5957. // "location": "query",
  5958. // "type": "string"
  5959. // },
  5960. // "parent": {
  5961. // "description": "Required. The project to list agents from.\nFormat: `projects/\u003cProject ID or '-'\u003e`.",
  5962. // "location": "path",
  5963. // "pattern": "^projects/[^/]+$",
  5964. // "required": true,
  5965. // "type": "string"
  5966. // }
  5967. // },
  5968. // "path": "v2/{+parent}/agent:search",
  5969. // "response": {
  5970. // "$ref": "GoogleCloudDialogflowV2SearchAgentsResponse"
  5971. // },
  5972. // "scopes": [
  5973. // "https://www.googleapis.com/auth/cloud-platform",
  5974. // "https://www.googleapis.com/auth/dialogflow"
  5975. // ]
  5976. // }
  5977. }
  5978. // Pages invokes f for each page of results.
  5979. // A non-nil error returned from f will halt the iteration.
  5980. // The provided context supersedes any context provided to the Context method.
  5981. func (c *ProjectsAgentSearchCall) Pages(ctx context.Context, f func(*GoogleCloudDialogflowV2SearchAgentsResponse) error) error {
  5982. c.ctx_ = ctx
  5983. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  5984. for {
  5985. x, err := c.Do()
  5986. if err != nil {
  5987. return err
  5988. }
  5989. if err := f(x); err != nil {
  5990. return err
  5991. }
  5992. if x.NextPageToken == "" {
  5993. return nil
  5994. }
  5995. c.PageToken(x.NextPageToken)
  5996. }
  5997. }
  5998. // method id "dialogflow.projects.agent.train":
  5999. type ProjectsAgentTrainCall struct {
  6000. s *Service
  6001. parent string
  6002. googleclouddialogflowv2trainagentrequest *GoogleCloudDialogflowV2TrainAgentRequest
  6003. urlParams_ gensupport.URLParams
  6004. ctx_ context.Context
  6005. header_ http.Header
  6006. }
  6007. // Train: Trains the specified agent.
  6008. //
  6009. // Operation <response: google.protobuf.Empty>
  6010. func (r *ProjectsAgentService) Train(parent string, googleclouddialogflowv2trainagentrequest *GoogleCloudDialogflowV2TrainAgentRequest) *ProjectsAgentTrainCall {
  6011. c := &ProjectsAgentTrainCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6012. c.parent = parent
  6013. c.googleclouddialogflowv2trainagentrequest = googleclouddialogflowv2trainagentrequest
  6014. return c
  6015. }
  6016. // Fields allows partial responses to be retrieved. See
  6017. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6018. // for more information.
  6019. func (c *ProjectsAgentTrainCall) Fields(s ...googleapi.Field) *ProjectsAgentTrainCall {
  6020. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6021. return c
  6022. }
  6023. // Context sets the context to be used in this call's Do method. Any
  6024. // pending HTTP request will be aborted if the provided context is
  6025. // canceled.
  6026. func (c *ProjectsAgentTrainCall) Context(ctx context.Context) *ProjectsAgentTrainCall {
  6027. c.ctx_ = ctx
  6028. return c
  6029. }
  6030. // Header returns an http.Header that can be modified by the caller to
  6031. // add HTTP headers to the request.
  6032. func (c *ProjectsAgentTrainCall) Header() http.Header {
  6033. if c.header_ == nil {
  6034. c.header_ = make(http.Header)
  6035. }
  6036. return c.header_
  6037. }
  6038. func (c *ProjectsAgentTrainCall) doRequest(alt string) (*http.Response, error) {
  6039. reqHeaders := make(http.Header)
  6040. for k, v := range c.header_ {
  6041. reqHeaders[k] = v
  6042. }
  6043. reqHeaders.Set("User-Agent", c.s.userAgent())
  6044. var body io.Reader = nil
  6045. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2trainagentrequest)
  6046. if err != nil {
  6047. return nil, err
  6048. }
  6049. reqHeaders.Set("Content-Type", "application/json")
  6050. c.urlParams_.Set("alt", alt)
  6051. c.urlParams_.Set("prettyPrint", "false")
  6052. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/agent:train")
  6053. urls += "?" + c.urlParams_.Encode()
  6054. req, err := http.NewRequest("POST", urls, body)
  6055. if err != nil {
  6056. return nil, err
  6057. }
  6058. req.Header = reqHeaders
  6059. googleapi.Expand(req.URL, map[string]string{
  6060. "parent": c.parent,
  6061. })
  6062. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6063. }
  6064. // Do executes the "dialogflow.projects.agent.train" call.
  6065. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  6066. // Any non-2xx status code is an error. Response headers are in either
  6067. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  6068. // was returned at all) in error.(*googleapi.Error).Header. Use
  6069. // googleapi.IsNotModified to check whether the returned error was
  6070. // because http.StatusNotModified was returned.
  6071. func (c *ProjectsAgentTrainCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  6072. gensupport.SetOptions(c.urlParams_, opts...)
  6073. res, err := c.doRequest("json")
  6074. if res != nil && res.StatusCode == http.StatusNotModified {
  6075. if res.Body != nil {
  6076. res.Body.Close()
  6077. }
  6078. return nil, &googleapi.Error{
  6079. Code: res.StatusCode,
  6080. Header: res.Header,
  6081. }
  6082. }
  6083. if err != nil {
  6084. return nil, err
  6085. }
  6086. defer googleapi.CloseBody(res)
  6087. if err := googleapi.CheckResponse(res); err != nil {
  6088. return nil, err
  6089. }
  6090. ret := &GoogleLongrunningOperation{
  6091. ServerResponse: googleapi.ServerResponse{
  6092. Header: res.Header,
  6093. HTTPStatusCode: res.StatusCode,
  6094. },
  6095. }
  6096. target := &ret
  6097. if err := gensupport.DecodeResponse(target, res); err != nil {
  6098. return nil, err
  6099. }
  6100. return ret, nil
  6101. // {
  6102. // "description": "Trains the specified agent.\n\nOperation \u003cresponse: google.protobuf.Empty\u003e",
  6103. // "flatPath": "v2/projects/{projectsId}/agent:train",
  6104. // "httpMethod": "POST",
  6105. // "id": "dialogflow.projects.agent.train",
  6106. // "parameterOrder": [
  6107. // "parent"
  6108. // ],
  6109. // "parameters": {
  6110. // "parent": {
  6111. // "description": "Required. The project that the agent to train is associated with.\nFormat: `projects/\u003cProject ID\u003e`.",
  6112. // "location": "path",
  6113. // "pattern": "^projects/[^/]+$",
  6114. // "required": true,
  6115. // "type": "string"
  6116. // }
  6117. // },
  6118. // "path": "v2/{+parent}/agent:train",
  6119. // "request": {
  6120. // "$ref": "GoogleCloudDialogflowV2TrainAgentRequest"
  6121. // },
  6122. // "response": {
  6123. // "$ref": "GoogleLongrunningOperation"
  6124. // },
  6125. // "scopes": [
  6126. // "https://www.googleapis.com/auth/cloud-platform",
  6127. // "https://www.googleapis.com/auth/dialogflow"
  6128. // ]
  6129. // }
  6130. }
  6131. // method id "dialogflow.projects.agent.entityTypes.batchDelete":
  6132. type ProjectsAgentEntityTypesBatchDeleteCall struct {
  6133. s *Service
  6134. parent string
  6135. googleclouddialogflowv2batchdeleteentitytypesrequest *GoogleCloudDialogflowV2BatchDeleteEntityTypesRequest
  6136. urlParams_ gensupport.URLParams
  6137. ctx_ context.Context
  6138. header_ http.Header
  6139. }
  6140. // BatchDelete: Deletes entity types in the specified agent.
  6141. //
  6142. // Operation <response: google.protobuf.Empty>
  6143. func (r *ProjectsAgentEntityTypesService) BatchDelete(parent string, googleclouddialogflowv2batchdeleteentitytypesrequest *GoogleCloudDialogflowV2BatchDeleteEntityTypesRequest) *ProjectsAgentEntityTypesBatchDeleteCall {
  6144. c := &ProjectsAgentEntityTypesBatchDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6145. c.parent = parent
  6146. c.googleclouddialogflowv2batchdeleteentitytypesrequest = googleclouddialogflowv2batchdeleteentitytypesrequest
  6147. return c
  6148. }
  6149. // Fields allows partial responses to be retrieved. See
  6150. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6151. // for more information.
  6152. func (c *ProjectsAgentEntityTypesBatchDeleteCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesBatchDeleteCall {
  6153. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6154. return c
  6155. }
  6156. // Context sets the context to be used in this call's Do method. Any
  6157. // pending HTTP request will be aborted if the provided context is
  6158. // canceled.
  6159. func (c *ProjectsAgentEntityTypesBatchDeleteCall) Context(ctx context.Context) *ProjectsAgentEntityTypesBatchDeleteCall {
  6160. c.ctx_ = ctx
  6161. return c
  6162. }
  6163. // Header returns an http.Header that can be modified by the caller to
  6164. // add HTTP headers to the request.
  6165. func (c *ProjectsAgentEntityTypesBatchDeleteCall) Header() http.Header {
  6166. if c.header_ == nil {
  6167. c.header_ = make(http.Header)
  6168. }
  6169. return c.header_
  6170. }
  6171. func (c *ProjectsAgentEntityTypesBatchDeleteCall) doRequest(alt string) (*http.Response, error) {
  6172. reqHeaders := make(http.Header)
  6173. for k, v := range c.header_ {
  6174. reqHeaders[k] = v
  6175. }
  6176. reqHeaders.Set("User-Agent", c.s.userAgent())
  6177. var body io.Reader = nil
  6178. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2batchdeleteentitytypesrequest)
  6179. if err != nil {
  6180. return nil, err
  6181. }
  6182. reqHeaders.Set("Content-Type", "application/json")
  6183. c.urlParams_.Set("alt", alt)
  6184. c.urlParams_.Set("prettyPrint", "false")
  6185. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/entityTypes:batchDelete")
  6186. urls += "?" + c.urlParams_.Encode()
  6187. req, err := http.NewRequest("POST", urls, body)
  6188. if err != nil {
  6189. return nil, err
  6190. }
  6191. req.Header = reqHeaders
  6192. googleapi.Expand(req.URL, map[string]string{
  6193. "parent": c.parent,
  6194. })
  6195. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6196. }
  6197. // Do executes the "dialogflow.projects.agent.entityTypes.batchDelete" call.
  6198. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  6199. // Any non-2xx status code is an error. Response headers are in either
  6200. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  6201. // was returned at all) in error.(*googleapi.Error).Header. Use
  6202. // googleapi.IsNotModified to check whether the returned error was
  6203. // because http.StatusNotModified was returned.
  6204. func (c *ProjectsAgentEntityTypesBatchDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  6205. gensupport.SetOptions(c.urlParams_, opts...)
  6206. res, err := c.doRequest("json")
  6207. if res != nil && res.StatusCode == http.StatusNotModified {
  6208. if res.Body != nil {
  6209. res.Body.Close()
  6210. }
  6211. return nil, &googleapi.Error{
  6212. Code: res.StatusCode,
  6213. Header: res.Header,
  6214. }
  6215. }
  6216. if err != nil {
  6217. return nil, err
  6218. }
  6219. defer googleapi.CloseBody(res)
  6220. if err := googleapi.CheckResponse(res); err != nil {
  6221. return nil, err
  6222. }
  6223. ret := &GoogleLongrunningOperation{
  6224. ServerResponse: googleapi.ServerResponse{
  6225. Header: res.Header,
  6226. HTTPStatusCode: res.StatusCode,
  6227. },
  6228. }
  6229. target := &ret
  6230. if err := gensupport.DecodeResponse(target, res); err != nil {
  6231. return nil, err
  6232. }
  6233. return ret, nil
  6234. // {
  6235. // "description": "Deletes entity types in the specified agent.\n\nOperation \u003cresponse: google.protobuf.Empty\u003e",
  6236. // "flatPath": "v2/projects/{projectsId}/agent/entityTypes:batchDelete",
  6237. // "httpMethod": "POST",
  6238. // "id": "dialogflow.projects.agent.entityTypes.batchDelete",
  6239. // "parameterOrder": [
  6240. // "parent"
  6241. // ],
  6242. // "parameters": {
  6243. // "parent": {
  6244. // "description": "Required. The name of the agent to delete all entities types for. Format:\n`projects/\u003cProject ID\u003e/agent`.",
  6245. // "location": "path",
  6246. // "pattern": "^projects/[^/]+/agent$",
  6247. // "required": true,
  6248. // "type": "string"
  6249. // }
  6250. // },
  6251. // "path": "v2/{+parent}/entityTypes:batchDelete",
  6252. // "request": {
  6253. // "$ref": "GoogleCloudDialogflowV2BatchDeleteEntityTypesRequest"
  6254. // },
  6255. // "response": {
  6256. // "$ref": "GoogleLongrunningOperation"
  6257. // },
  6258. // "scopes": [
  6259. // "https://www.googleapis.com/auth/cloud-platform",
  6260. // "https://www.googleapis.com/auth/dialogflow"
  6261. // ]
  6262. // }
  6263. }
  6264. // method id "dialogflow.projects.agent.entityTypes.batchUpdate":
  6265. type ProjectsAgentEntityTypesBatchUpdateCall struct {
  6266. s *Service
  6267. parent string
  6268. googleclouddialogflowv2batchupdateentitytypesrequest *GoogleCloudDialogflowV2BatchUpdateEntityTypesRequest
  6269. urlParams_ gensupport.URLParams
  6270. ctx_ context.Context
  6271. header_ http.Header
  6272. }
  6273. // BatchUpdate: Updates/Creates multiple entity types in the specified
  6274. // agent.
  6275. //
  6276. // Operation <response: BatchUpdateEntityTypesResponse>
  6277. func (r *ProjectsAgentEntityTypesService) BatchUpdate(parent string, googleclouddialogflowv2batchupdateentitytypesrequest *GoogleCloudDialogflowV2BatchUpdateEntityTypesRequest) *ProjectsAgentEntityTypesBatchUpdateCall {
  6278. c := &ProjectsAgentEntityTypesBatchUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6279. c.parent = parent
  6280. c.googleclouddialogflowv2batchupdateentitytypesrequest = googleclouddialogflowv2batchupdateentitytypesrequest
  6281. return c
  6282. }
  6283. // Fields allows partial responses to be retrieved. See
  6284. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6285. // for more information.
  6286. func (c *ProjectsAgentEntityTypesBatchUpdateCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesBatchUpdateCall {
  6287. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6288. return c
  6289. }
  6290. // Context sets the context to be used in this call's Do method. Any
  6291. // pending HTTP request will be aborted if the provided context is
  6292. // canceled.
  6293. func (c *ProjectsAgentEntityTypesBatchUpdateCall) Context(ctx context.Context) *ProjectsAgentEntityTypesBatchUpdateCall {
  6294. c.ctx_ = ctx
  6295. return c
  6296. }
  6297. // Header returns an http.Header that can be modified by the caller to
  6298. // add HTTP headers to the request.
  6299. func (c *ProjectsAgentEntityTypesBatchUpdateCall) Header() http.Header {
  6300. if c.header_ == nil {
  6301. c.header_ = make(http.Header)
  6302. }
  6303. return c.header_
  6304. }
  6305. func (c *ProjectsAgentEntityTypesBatchUpdateCall) doRequest(alt string) (*http.Response, error) {
  6306. reqHeaders := make(http.Header)
  6307. for k, v := range c.header_ {
  6308. reqHeaders[k] = v
  6309. }
  6310. reqHeaders.Set("User-Agent", c.s.userAgent())
  6311. var body io.Reader = nil
  6312. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2batchupdateentitytypesrequest)
  6313. if err != nil {
  6314. return nil, err
  6315. }
  6316. reqHeaders.Set("Content-Type", "application/json")
  6317. c.urlParams_.Set("alt", alt)
  6318. c.urlParams_.Set("prettyPrint", "false")
  6319. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/entityTypes:batchUpdate")
  6320. urls += "?" + c.urlParams_.Encode()
  6321. req, err := http.NewRequest("POST", urls, body)
  6322. if err != nil {
  6323. return nil, err
  6324. }
  6325. req.Header = reqHeaders
  6326. googleapi.Expand(req.URL, map[string]string{
  6327. "parent": c.parent,
  6328. })
  6329. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6330. }
  6331. // Do executes the "dialogflow.projects.agent.entityTypes.batchUpdate" call.
  6332. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  6333. // Any non-2xx status code is an error. Response headers are in either
  6334. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  6335. // was returned at all) in error.(*googleapi.Error).Header. Use
  6336. // googleapi.IsNotModified to check whether the returned error was
  6337. // because http.StatusNotModified was returned.
  6338. func (c *ProjectsAgentEntityTypesBatchUpdateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  6339. gensupport.SetOptions(c.urlParams_, opts...)
  6340. res, err := c.doRequest("json")
  6341. if res != nil && res.StatusCode == http.StatusNotModified {
  6342. if res.Body != nil {
  6343. res.Body.Close()
  6344. }
  6345. return nil, &googleapi.Error{
  6346. Code: res.StatusCode,
  6347. Header: res.Header,
  6348. }
  6349. }
  6350. if err != nil {
  6351. return nil, err
  6352. }
  6353. defer googleapi.CloseBody(res)
  6354. if err := googleapi.CheckResponse(res); err != nil {
  6355. return nil, err
  6356. }
  6357. ret := &GoogleLongrunningOperation{
  6358. ServerResponse: googleapi.ServerResponse{
  6359. Header: res.Header,
  6360. HTTPStatusCode: res.StatusCode,
  6361. },
  6362. }
  6363. target := &ret
  6364. if err := gensupport.DecodeResponse(target, res); err != nil {
  6365. return nil, err
  6366. }
  6367. return ret, nil
  6368. // {
  6369. // "description": "Updates/Creates multiple entity types in the specified agent.\n\nOperation \u003cresponse: BatchUpdateEntityTypesResponse\u003e",
  6370. // "flatPath": "v2/projects/{projectsId}/agent/entityTypes:batchUpdate",
  6371. // "httpMethod": "POST",
  6372. // "id": "dialogflow.projects.agent.entityTypes.batchUpdate",
  6373. // "parameterOrder": [
  6374. // "parent"
  6375. // ],
  6376. // "parameters": {
  6377. // "parent": {
  6378. // "description": "Required. The name of the agent to update or create entity types in.\nFormat: `projects/\u003cProject ID\u003e/agent`.",
  6379. // "location": "path",
  6380. // "pattern": "^projects/[^/]+/agent$",
  6381. // "required": true,
  6382. // "type": "string"
  6383. // }
  6384. // },
  6385. // "path": "v2/{+parent}/entityTypes:batchUpdate",
  6386. // "request": {
  6387. // "$ref": "GoogleCloudDialogflowV2BatchUpdateEntityTypesRequest"
  6388. // },
  6389. // "response": {
  6390. // "$ref": "GoogleLongrunningOperation"
  6391. // },
  6392. // "scopes": [
  6393. // "https://www.googleapis.com/auth/cloud-platform",
  6394. // "https://www.googleapis.com/auth/dialogflow"
  6395. // ]
  6396. // }
  6397. }
  6398. // method id "dialogflow.projects.agent.entityTypes.create":
  6399. type ProjectsAgentEntityTypesCreateCall struct {
  6400. s *Service
  6401. parent string
  6402. googleclouddialogflowv2entitytype *GoogleCloudDialogflowV2EntityType
  6403. urlParams_ gensupport.URLParams
  6404. ctx_ context.Context
  6405. header_ http.Header
  6406. }
  6407. // Create: Creates an entity type in the specified agent.
  6408. func (r *ProjectsAgentEntityTypesService) Create(parent string, googleclouddialogflowv2entitytype *GoogleCloudDialogflowV2EntityType) *ProjectsAgentEntityTypesCreateCall {
  6409. c := &ProjectsAgentEntityTypesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6410. c.parent = parent
  6411. c.googleclouddialogflowv2entitytype = googleclouddialogflowv2entitytype
  6412. return c
  6413. }
  6414. // LanguageCode sets the optional parameter "languageCode": The language
  6415. // of entity synonyms defined in `entity_type`. If not
  6416. // specified, the agent's default language is used.
  6417. // [More than a
  6418. // dozen
  6419. // languages](https://dialogflow.com/docs/reference/language) are
  6420. // supported.
  6421. // Note: languages must be enabled in the agent, before they can be
  6422. // used.
  6423. func (c *ProjectsAgentEntityTypesCreateCall) LanguageCode(languageCode string) *ProjectsAgentEntityTypesCreateCall {
  6424. c.urlParams_.Set("languageCode", languageCode)
  6425. return c
  6426. }
  6427. // Fields allows partial responses to be retrieved. See
  6428. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6429. // for more information.
  6430. func (c *ProjectsAgentEntityTypesCreateCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesCreateCall {
  6431. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6432. return c
  6433. }
  6434. // Context sets the context to be used in this call's Do method. Any
  6435. // pending HTTP request will be aborted if the provided context is
  6436. // canceled.
  6437. func (c *ProjectsAgentEntityTypesCreateCall) Context(ctx context.Context) *ProjectsAgentEntityTypesCreateCall {
  6438. c.ctx_ = ctx
  6439. return c
  6440. }
  6441. // Header returns an http.Header that can be modified by the caller to
  6442. // add HTTP headers to the request.
  6443. func (c *ProjectsAgentEntityTypesCreateCall) Header() http.Header {
  6444. if c.header_ == nil {
  6445. c.header_ = make(http.Header)
  6446. }
  6447. return c.header_
  6448. }
  6449. func (c *ProjectsAgentEntityTypesCreateCall) doRequest(alt string) (*http.Response, error) {
  6450. reqHeaders := make(http.Header)
  6451. for k, v := range c.header_ {
  6452. reqHeaders[k] = v
  6453. }
  6454. reqHeaders.Set("User-Agent", c.s.userAgent())
  6455. var body io.Reader = nil
  6456. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2entitytype)
  6457. if err != nil {
  6458. return nil, err
  6459. }
  6460. reqHeaders.Set("Content-Type", "application/json")
  6461. c.urlParams_.Set("alt", alt)
  6462. c.urlParams_.Set("prettyPrint", "false")
  6463. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/entityTypes")
  6464. urls += "?" + c.urlParams_.Encode()
  6465. req, err := http.NewRequest("POST", urls, body)
  6466. if err != nil {
  6467. return nil, err
  6468. }
  6469. req.Header = reqHeaders
  6470. googleapi.Expand(req.URL, map[string]string{
  6471. "parent": c.parent,
  6472. })
  6473. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6474. }
  6475. // Do executes the "dialogflow.projects.agent.entityTypes.create" call.
  6476. // Exactly one of *GoogleCloudDialogflowV2EntityType or error will be
  6477. // non-nil. Any non-2xx status code is an error. Response headers are in
  6478. // either *GoogleCloudDialogflowV2EntityType.ServerResponse.Header or
  6479. // (if a response was returned at all) in
  6480. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6481. // whether the returned error was because http.StatusNotModified was
  6482. // returned.
  6483. func (c *ProjectsAgentEntityTypesCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2EntityType, error) {
  6484. gensupport.SetOptions(c.urlParams_, opts...)
  6485. res, err := c.doRequest("json")
  6486. if res != nil && res.StatusCode == http.StatusNotModified {
  6487. if res.Body != nil {
  6488. res.Body.Close()
  6489. }
  6490. return nil, &googleapi.Error{
  6491. Code: res.StatusCode,
  6492. Header: res.Header,
  6493. }
  6494. }
  6495. if err != nil {
  6496. return nil, err
  6497. }
  6498. defer googleapi.CloseBody(res)
  6499. if err := googleapi.CheckResponse(res); err != nil {
  6500. return nil, err
  6501. }
  6502. ret := &GoogleCloudDialogflowV2EntityType{
  6503. ServerResponse: googleapi.ServerResponse{
  6504. Header: res.Header,
  6505. HTTPStatusCode: res.StatusCode,
  6506. },
  6507. }
  6508. target := &ret
  6509. if err := gensupport.DecodeResponse(target, res); err != nil {
  6510. return nil, err
  6511. }
  6512. return ret, nil
  6513. // {
  6514. // "description": "Creates an entity type in the specified agent.",
  6515. // "flatPath": "v2/projects/{projectsId}/agent/entityTypes",
  6516. // "httpMethod": "POST",
  6517. // "id": "dialogflow.projects.agent.entityTypes.create",
  6518. // "parameterOrder": [
  6519. // "parent"
  6520. // ],
  6521. // "parameters": {
  6522. // "languageCode": {
  6523. // "description": "Optional. The language of entity synonyms defined in `entity_type`. If not\nspecified, the agent's default language is used.\n[More than a dozen\nlanguages](https://dialogflow.com/docs/reference/language) are supported.\nNote: languages must be enabled in the agent, before they can be used.",
  6524. // "location": "query",
  6525. // "type": "string"
  6526. // },
  6527. // "parent": {
  6528. // "description": "Required. The agent to create a entity type for.\nFormat: `projects/\u003cProject ID\u003e/agent`.",
  6529. // "location": "path",
  6530. // "pattern": "^projects/[^/]+/agent$",
  6531. // "required": true,
  6532. // "type": "string"
  6533. // }
  6534. // },
  6535. // "path": "v2/{+parent}/entityTypes",
  6536. // "request": {
  6537. // "$ref": "GoogleCloudDialogflowV2EntityType"
  6538. // },
  6539. // "response": {
  6540. // "$ref": "GoogleCloudDialogflowV2EntityType"
  6541. // },
  6542. // "scopes": [
  6543. // "https://www.googleapis.com/auth/cloud-platform",
  6544. // "https://www.googleapis.com/auth/dialogflow"
  6545. // ]
  6546. // }
  6547. }
  6548. // method id "dialogflow.projects.agent.entityTypes.delete":
  6549. type ProjectsAgentEntityTypesDeleteCall struct {
  6550. s *Service
  6551. name string
  6552. urlParams_ gensupport.URLParams
  6553. ctx_ context.Context
  6554. header_ http.Header
  6555. }
  6556. // Delete: Deletes the specified entity type.
  6557. func (r *ProjectsAgentEntityTypesService) Delete(name string) *ProjectsAgentEntityTypesDeleteCall {
  6558. c := &ProjectsAgentEntityTypesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6559. c.name = name
  6560. return c
  6561. }
  6562. // Fields allows partial responses to be retrieved. See
  6563. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6564. // for more information.
  6565. func (c *ProjectsAgentEntityTypesDeleteCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesDeleteCall {
  6566. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6567. return c
  6568. }
  6569. // Context sets the context to be used in this call's Do method. Any
  6570. // pending HTTP request will be aborted if the provided context is
  6571. // canceled.
  6572. func (c *ProjectsAgentEntityTypesDeleteCall) Context(ctx context.Context) *ProjectsAgentEntityTypesDeleteCall {
  6573. c.ctx_ = ctx
  6574. return c
  6575. }
  6576. // Header returns an http.Header that can be modified by the caller to
  6577. // add HTTP headers to the request.
  6578. func (c *ProjectsAgentEntityTypesDeleteCall) Header() http.Header {
  6579. if c.header_ == nil {
  6580. c.header_ = make(http.Header)
  6581. }
  6582. return c.header_
  6583. }
  6584. func (c *ProjectsAgentEntityTypesDeleteCall) doRequest(alt string) (*http.Response, error) {
  6585. reqHeaders := make(http.Header)
  6586. for k, v := range c.header_ {
  6587. reqHeaders[k] = v
  6588. }
  6589. reqHeaders.Set("User-Agent", c.s.userAgent())
  6590. var body io.Reader = nil
  6591. c.urlParams_.Set("alt", alt)
  6592. c.urlParams_.Set("prettyPrint", "false")
  6593. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  6594. urls += "?" + c.urlParams_.Encode()
  6595. req, err := http.NewRequest("DELETE", urls, body)
  6596. if err != nil {
  6597. return nil, err
  6598. }
  6599. req.Header = reqHeaders
  6600. googleapi.Expand(req.URL, map[string]string{
  6601. "name": c.name,
  6602. })
  6603. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6604. }
  6605. // Do executes the "dialogflow.projects.agent.entityTypes.delete" call.
  6606. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  6607. // non-2xx status code is an error. Response headers are in either
  6608. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  6609. // returned at all) in error.(*googleapi.Error).Header. Use
  6610. // googleapi.IsNotModified to check whether the returned error was
  6611. // because http.StatusNotModified was returned.
  6612. func (c *ProjectsAgentEntityTypesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  6613. gensupport.SetOptions(c.urlParams_, opts...)
  6614. res, err := c.doRequest("json")
  6615. if res != nil && res.StatusCode == http.StatusNotModified {
  6616. if res.Body != nil {
  6617. res.Body.Close()
  6618. }
  6619. return nil, &googleapi.Error{
  6620. Code: res.StatusCode,
  6621. Header: res.Header,
  6622. }
  6623. }
  6624. if err != nil {
  6625. return nil, err
  6626. }
  6627. defer googleapi.CloseBody(res)
  6628. if err := googleapi.CheckResponse(res); err != nil {
  6629. return nil, err
  6630. }
  6631. ret := &GoogleProtobufEmpty{
  6632. ServerResponse: googleapi.ServerResponse{
  6633. Header: res.Header,
  6634. HTTPStatusCode: res.StatusCode,
  6635. },
  6636. }
  6637. target := &ret
  6638. if err := gensupport.DecodeResponse(target, res); err != nil {
  6639. return nil, err
  6640. }
  6641. return ret, nil
  6642. // {
  6643. // "description": "Deletes the specified entity type.",
  6644. // "flatPath": "v2/projects/{projectsId}/agent/entityTypes/{entityTypesId}",
  6645. // "httpMethod": "DELETE",
  6646. // "id": "dialogflow.projects.agent.entityTypes.delete",
  6647. // "parameterOrder": [
  6648. // "name"
  6649. // ],
  6650. // "parameters": {
  6651. // "name": {
  6652. // "description": "Required. The name of the entity type to delete.\nFormat: `projects/\u003cProject ID\u003e/agent/entityTypes/\u003cEntityType ID\u003e`.",
  6653. // "location": "path",
  6654. // "pattern": "^projects/[^/]+/agent/entityTypes/[^/]+$",
  6655. // "required": true,
  6656. // "type": "string"
  6657. // }
  6658. // },
  6659. // "path": "v2/{+name}",
  6660. // "response": {
  6661. // "$ref": "GoogleProtobufEmpty"
  6662. // },
  6663. // "scopes": [
  6664. // "https://www.googleapis.com/auth/cloud-platform",
  6665. // "https://www.googleapis.com/auth/dialogflow"
  6666. // ]
  6667. // }
  6668. }
  6669. // method id "dialogflow.projects.agent.entityTypes.get":
  6670. type ProjectsAgentEntityTypesGetCall struct {
  6671. s *Service
  6672. name string
  6673. urlParams_ gensupport.URLParams
  6674. ifNoneMatch_ string
  6675. ctx_ context.Context
  6676. header_ http.Header
  6677. }
  6678. // Get: Retrieves the specified entity type.
  6679. func (r *ProjectsAgentEntityTypesService) Get(name string) *ProjectsAgentEntityTypesGetCall {
  6680. c := &ProjectsAgentEntityTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6681. c.name = name
  6682. return c
  6683. }
  6684. // LanguageCode sets the optional parameter "languageCode": The language
  6685. // to retrieve entity synonyms for. If not specified,
  6686. // the agent's default language is used.
  6687. // [More than a
  6688. // dozen
  6689. // languages](https://dialogflow.com/docs/reference/language) are
  6690. // supported.
  6691. // Note: languages must be enabled in the agent, before they can be
  6692. // used.
  6693. func (c *ProjectsAgentEntityTypesGetCall) LanguageCode(languageCode string) *ProjectsAgentEntityTypesGetCall {
  6694. c.urlParams_.Set("languageCode", languageCode)
  6695. return c
  6696. }
  6697. // Fields allows partial responses to be retrieved. See
  6698. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6699. // for more information.
  6700. func (c *ProjectsAgentEntityTypesGetCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesGetCall {
  6701. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6702. return c
  6703. }
  6704. // IfNoneMatch sets the optional parameter which makes the operation
  6705. // fail if the object's ETag matches the given value. This is useful for
  6706. // getting updates only after the object has changed since the last
  6707. // request. Use googleapi.IsNotModified to check whether the response
  6708. // error from Do is the result of In-None-Match.
  6709. func (c *ProjectsAgentEntityTypesGetCall) IfNoneMatch(entityTag string) *ProjectsAgentEntityTypesGetCall {
  6710. c.ifNoneMatch_ = entityTag
  6711. return c
  6712. }
  6713. // Context sets the context to be used in this call's Do method. Any
  6714. // pending HTTP request will be aborted if the provided context is
  6715. // canceled.
  6716. func (c *ProjectsAgentEntityTypesGetCall) Context(ctx context.Context) *ProjectsAgentEntityTypesGetCall {
  6717. c.ctx_ = ctx
  6718. return c
  6719. }
  6720. // Header returns an http.Header that can be modified by the caller to
  6721. // add HTTP headers to the request.
  6722. func (c *ProjectsAgentEntityTypesGetCall) Header() http.Header {
  6723. if c.header_ == nil {
  6724. c.header_ = make(http.Header)
  6725. }
  6726. return c.header_
  6727. }
  6728. func (c *ProjectsAgentEntityTypesGetCall) doRequest(alt string) (*http.Response, error) {
  6729. reqHeaders := make(http.Header)
  6730. for k, v := range c.header_ {
  6731. reqHeaders[k] = v
  6732. }
  6733. reqHeaders.Set("User-Agent", c.s.userAgent())
  6734. if c.ifNoneMatch_ != "" {
  6735. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6736. }
  6737. var body io.Reader = nil
  6738. c.urlParams_.Set("alt", alt)
  6739. c.urlParams_.Set("prettyPrint", "false")
  6740. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  6741. urls += "?" + c.urlParams_.Encode()
  6742. req, err := http.NewRequest("GET", urls, body)
  6743. if err != nil {
  6744. return nil, err
  6745. }
  6746. req.Header = reqHeaders
  6747. googleapi.Expand(req.URL, map[string]string{
  6748. "name": c.name,
  6749. })
  6750. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6751. }
  6752. // Do executes the "dialogflow.projects.agent.entityTypes.get" call.
  6753. // Exactly one of *GoogleCloudDialogflowV2EntityType or error will be
  6754. // non-nil. Any non-2xx status code is an error. Response headers are in
  6755. // either *GoogleCloudDialogflowV2EntityType.ServerResponse.Header or
  6756. // (if a response was returned at all) in
  6757. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6758. // whether the returned error was because http.StatusNotModified was
  6759. // returned.
  6760. func (c *ProjectsAgentEntityTypesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2EntityType, error) {
  6761. gensupport.SetOptions(c.urlParams_, opts...)
  6762. res, err := c.doRequest("json")
  6763. if res != nil && res.StatusCode == http.StatusNotModified {
  6764. if res.Body != nil {
  6765. res.Body.Close()
  6766. }
  6767. return nil, &googleapi.Error{
  6768. Code: res.StatusCode,
  6769. Header: res.Header,
  6770. }
  6771. }
  6772. if err != nil {
  6773. return nil, err
  6774. }
  6775. defer googleapi.CloseBody(res)
  6776. if err := googleapi.CheckResponse(res); err != nil {
  6777. return nil, err
  6778. }
  6779. ret := &GoogleCloudDialogflowV2EntityType{
  6780. ServerResponse: googleapi.ServerResponse{
  6781. Header: res.Header,
  6782. HTTPStatusCode: res.StatusCode,
  6783. },
  6784. }
  6785. target := &ret
  6786. if err := gensupport.DecodeResponse(target, res); err != nil {
  6787. return nil, err
  6788. }
  6789. return ret, nil
  6790. // {
  6791. // "description": "Retrieves the specified entity type.",
  6792. // "flatPath": "v2/projects/{projectsId}/agent/entityTypes/{entityTypesId}",
  6793. // "httpMethod": "GET",
  6794. // "id": "dialogflow.projects.agent.entityTypes.get",
  6795. // "parameterOrder": [
  6796. // "name"
  6797. // ],
  6798. // "parameters": {
  6799. // "languageCode": {
  6800. // "description": "Optional. The language to retrieve entity synonyms for. If not specified,\nthe agent's default language is used.\n[More than a dozen\nlanguages](https://dialogflow.com/docs/reference/language) are supported.\nNote: languages must be enabled in the agent, before they can be used.",
  6801. // "location": "query",
  6802. // "type": "string"
  6803. // },
  6804. // "name": {
  6805. // "description": "Required. The name of the entity type.\nFormat: `projects/\u003cProject ID\u003e/agent/entityTypes/\u003cEntityType ID\u003e`.",
  6806. // "location": "path",
  6807. // "pattern": "^projects/[^/]+/agent/entityTypes/[^/]+$",
  6808. // "required": true,
  6809. // "type": "string"
  6810. // }
  6811. // },
  6812. // "path": "v2/{+name}",
  6813. // "response": {
  6814. // "$ref": "GoogleCloudDialogflowV2EntityType"
  6815. // },
  6816. // "scopes": [
  6817. // "https://www.googleapis.com/auth/cloud-platform",
  6818. // "https://www.googleapis.com/auth/dialogflow"
  6819. // ]
  6820. // }
  6821. }
  6822. // method id "dialogflow.projects.agent.entityTypes.list":
  6823. type ProjectsAgentEntityTypesListCall struct {
  6824. s *Service
  6825. parent string
  6826. urlParams_ gensupport.URLParams
  6827. ifNoneMatch_ string
  6828. ctx_ context.Context
  6829. header_ http.Header
  6830. }
  6831. // List: Returns the list of all entity types in the specified agent.
  6832. func (r *ProjectsAgentEntityTypesService) List(parent string) *ProjectsAgentEntityTypesListCall {
  6833. c := &ProjectsAgentEntityTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6834. c.parent = parent
  6835. return c
  6836. }
  6837. // LanguageCode sets the optional parameter "languageCode": The language
  6838. // to list entity synonyms for. If not specified,
  6839. // the agent's default language is used.
  6840. // [More than a
  6841. // dozen
  6842. // languages](https://dialogflow.com/docs/reference/language) are
  6843. // supported.
  6844. // Note: languages must be enabled in the agent, before they can be
  6845. // used.
  6846. func (c *ProjectsAgentEntityTypesListCall) LanguageCode(languageCode string) *ProjectsAgentEntityTypesListCall {
  6847. c.urlParams_.Set("languageCode", languageCode)
  6848. return c
  6849. }
  6850. // PageSize sets the optional parameter "pageSize": The maximum number
  6851. // of items to return in a single page. By
  6852. // default 100 and at most 1000.
  6853. func (c *ProjectsAgentEntityTypesListCall) PageSize(pageSize int64) *ProjectsAgentEntityTypesListCall {
  6854. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  6855. return c
  6856. }
  6857. // PageToken sets the optional parameter "pageToken": The
  6858. // next_page_token value returned from a previous list request.
  6859. func (c *ProjectsAgentEntityTypesListCall) PageToken(pageToken string) *ProjectsAgentEntityTypesListCall {
  6860. c.urlParams_.Set("pageToken", pageToken)
  6861. return c
  6862. }
  6863. // Fields allows partial responses to be retrieved. See
  6864. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6865. // for more information.
  6866. func (c *ProjectsAgentEntityTypesListCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesListCall {
  6867. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6868. return c
  6869. }
  6870. // IfNoneMatch sets the optional parameter which makes the operation
  6871. // fail if the object's ETag matches the given value. This is useful for
  6872. // getting updates only after the object has changed since the last
  6873. // request. Use googleapi.IsNotModified to check whether the response
  6874. // error from Do is the result of In-None-Match.
  6875. func (c *ProjectsAgentEntityTypesListCall) IfNoneMatch(entityTag string) *ProjectsAgentEntityTypesListCall {
  6876. c.ifNoneMatch_ = entityTag
  6877. return c
  6878. }
  6879. // Context sets the context to be used in this call's Do method. Any
  6880. // pending HTTP request will be aborted if the provided context is
  6881. // canceled.
  6882. func (c *ProjectsAgentEntityTypesListCall) Context(ctx context.Context) *ProjectsAgentEntityTypesListCall {
  6883. c.ctx_ = ctx
  6884. return c
  6885. }
  6886. // Header returns an http.Header that can be modified by the caller to
  6887. // add HTTP headers to the request.
  6888. func (c *ProjectsAgentEntityTypesListCall) Header() http.Header {
  6889. if c.header_ == nil {
  6890. c.header_ = make(http.Header)
  6891. }
  6892. return c.header_
  6893. }
  6894. func (c *ProjectsAgentEntityTypesListCall) doRequest(alt string) (*http.Response, error) {
  6895. reqHeaders := make(http.Header)
  6896. for k, v := range c.header_ {
  6897. reqHeaders[k] = v
  6898. }
  6899. reqHeaders.Set("User-Agent", c.s.userAgent())
  6900. if c.ifNoneMatch_ != "" {
  6901. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6902. }
  6903. var body io.Reader = nil
  6904. c.urlParams_.Set("alt", alt)
  6905. c.urlParams_.Set("prettyPrint", "false")
  6906. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/entityTypes")
  6907. urls += "?" + c.urlParams_.Encode()
  6908. req, err := http.NewRequest("GET", urls, body)
  6909. if err != nil {
  6910. return nil, err
  6911. }
  6912. req.Header = reqHeaders
  6913. googleapi.Expand(req.URL, map[string]string{
  6914. "parent": c.parent,
  6915. })
  6916. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6917. }
  6918. // Do executes the "dialogflow.projects.agent.entityTypes.list" call.
  6919. // Exactly one of *GoogleCloudDialogflowV2ListEntityTypesResponse or
  6920. // error will be non-nil. Any non-2xx status code is an error. Response
  6921. // headers are in either
  6922. // *GoogleCloudDialogflowV2ListEntityTypesResponse.ServerResponse.Header
  6923. // or (if a response was returned at all) in
  6924. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6925. // whether the returned error was because http.StatusNotModified was
  6926. // returned.
  6927. func (c *ProjectsAgentEntityTypesListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2ListEntityTypesResponse, error) {
  6928. gensupport.SetOptions(c.urlParams_, opts...)
  6929. res, err := c.doRequest("json")
  6930. if res != nil && res.StatusCode == http.StatusNotModified {
  6931. if res.Body != nil {
  6932. res.Body.Close()
  6933. }
  6934. return nil, &googleapi.Error{
  6935. Code: res.StatusCode,
  6936. Header: res.Header,
  6937. }
  6938. }
  6939. if err != nil {
  6940. return nil, err
  6941. }
  6942. defer googleapi.CloseBody(res)
  6943. if err := googleapi.CheckResponse(res); err != nil {
  6944. return nil, err
  6945. }
  6946. ret := &GoogleCloudDialogflowV2ListEntityTypesResponse{
  6947. ServerResponse: googleapi.ServerResponse{
  6948. Header: res.Header,
  6949. HTTPStatusCode: res.StatusCode,
  6950. },
  6951. }
  6952. target := &ret
  6953. if err := gensupport.DecodeResponse(target, res); err != nil {
  6954. return nil, err
  6955. }
  6956. return ret, nil
  6957. // {
  6958. // "description": "Returns the list of all entity types in the specified agent.",
  6959. // "flatPath": "v2/projects/{projectsId}/agent/entityTypes",
  6960. // "httpMethod": "GET",
  6961. // "id": "dialogflow.projects.agent.entityTypes.list",
  6962. // "parameterOrder": [
  6963. // "parent"
  6964. // ],
  6965. // "parameters": {
  6966. // "languageCode": {
  6967. // "description": "Optional. The language to list entity synonyms for. If not specified,\nthe agent's default language is used.\n[More than a dozen\nlanguages](https://dialogflow.com/docs/reference/language) are supported.\nNote: languages must be enabled in the agent, before they can be used.",
  6968. // "location": "query",
  6969. // "type": "string"
  6970. // },
  6971. // "pageSize": {
  6972. // "description": "Optional. The maximum number of items to return in a single page. By\ndefault 100 and at most 1000.",
  6973. // "format": "int32",
  6974. // "location": "query",
  6975. // "type": "integer"
  6976. // },
  6977. // "pageToken": {
  6978. // "description": "Optional. The next_page_token value returned from a previous list request.",
  6979. // "location": "query",
  6980. // "type": "string"
  6981. // },
  6982. // "parent": {
  6983. // "description": "Required. The agent to list all entity types from.\nFormat: `projects/\u003cProject ID\u003e/agent`.",
  6984. // "location": "path",
  6985. // "pattern": "^projects/[^/]+/agent$",
  6986. // "required": true,
  6987. // "type": "string"
  6988. // }
  6989. // },
  6990. // "path": "v2/{+parent}/entityTypes",
  6991. // "response": {
  6992. // "$ref": "GoogleCloudDialogflowV2ListEntityTypesResponse"
  6993. // },
  6994. // "scopes": [
  6995. // "https://www.googleapis.com/auth/cloud-platform",
  6996. // "https://www.googleapis.com/auth/dialogflow"
  6997. // ]
  6998. // }
  6999. }
  7000. // Pages invokes f for each page of results.
  7001. // A non-nil error returned from f will halt the iteration.
  7002. // The provided context supersedes any context provided to the Context method.
  7003. func (c *ProjectsAgentEntityTypesListCall) Pages(ctx context.Context, f func(*GoogleCloudDialogflowV2ListEntityTypesResponse) error) error {
  7004. c.ctx_ = ctx
  7005. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  7006. for {
  7007. x, err := c.Do()
  7008. if err != nil {
  7009. return err
  7010. }
  7011. if err := f(x); err != nil {
  7012. return err
  7013. }
  7014. if x.NextPageToken == "" {
  7015. return nil
  7016. }
  7017. c.PageToken(x.NextPageToken)
  7018. }
  7019. }
  7020. // method id "dialogflow.projects.agent.entityTypes.patch":
  7021. type ProjectsAgentEntityTypesPatchCall struct {
  7022. s *Service
  7023. nameid string
  7024. googleclouddialogflowv2entitytype *GoogleCloudDialogflowV2EntityType
  7025. urlParams_ gensupport.URLParams
  7026. ctx_ context.Context
  7027. header_ http.Header
  7028. }
  7029. // Patch: Updates the specified entity type.
  7030. func (r *ProjectsAgentEntityTypesService) Patch(nameid string, googleclouddialogflowv2entitytype *GoogleCloudDialogflowV2EntityType) *ProjectsAgentEntityTypesPatchCall {
  7031. c := &ProjectsAgentEntityTypesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7032. c.nameid = nameid
  7033. c.googleclouddialogflowv2entitytype = googleclouddialogflowv2entitytype
  7034. return c
  7035. }
  7036. // LanguageCode sets the optional parameter "languageCode": The language
  7037. // of entity synonyms defined in `entity_type`. If not
  7038. // specified, the agent's default language is used.
  7039. // [More than a
  7040. // dozen
  7041. // languages](https://dialogflow.com/docs/reference/language) are
  7042. // supported.
  7043. // Note: languages must be enabled in the agent, before they can be
  7044. // used.
  7045. func (c *ProjectsAgentEntityTypesPatchCall) LanguageCode(languageCode string) *ProjectsAgentEntityTypesPatchCall {
  7046. c.urlParams_.Set("languageCode", languageCode)
  7047. return c
  7048. }
  7049. // UpdateMask sets the optional parameter "updateMask": The mask to
  7050. // control which fields get updated.
  7051. func (c *ProjectsAgentEntityTypesPatchCall) UpdateMask(updateMask string) *ProjectsAgentEntityTypesPatchCall {
  7052. c.urlParams_.Set("updateMask", updateMask)
  7053. return c
  7054. }
  7055. // Fields allows partial responses to be retrieved. See
  7056. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7057. // for more information.
  7058. func (c *ProjectsAgentEntityTypesPatchCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesPatchCall {
  7059. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7060. return c
  7061. }
  7062. // Context sets the context to be used in this call's Do method. Any
  7063. // pending HTTP request will be aborted if the provided context is
  7064. // canceled.
  7065. func (c *ProjectsAgentEntityTypesPatchCall) Context(ctx context.Context) *ProjectsAgentEntityTypesPatchCall {
  7066. c.ctx_ = ctx
  7067. return c
  7068. }
  7069. // Header returns an http.Header that can be modified by the caller to
  7070. // add HTTP headers to the request.
  7071. func (c *ProjectsAgentEntityTypesPatchCall) Header() http.Header {
  7072. if c.header_ == nil {
  7073. c.header_ = make(http.Header)
  7074. }
  7075. return c.header_
  7076. }
  7077. func (c *ProjectsAgentEntityTypesPatchCall) doRequest(alt string) (*http.Response, error) {
  7078. reqHeaders := make(http.Header)
  7079. for k, v := range c.header_ {
  7080. reqHeaders[k] = v
  7081. }
  7082. reqHeaders.Set("User-Agent", c.s.userAgent())
  7083. var body io.Reader = nil
  7084. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2entitytype)
  7085. if err != nil {
  7086. return nil, err
  7087. }
  7088. reqHeaders.Set("Content-Type", "application/json")
  7089. c.urlParams_.Set("alt", alt)
  7090. c.urlParams_.Set("prettyPrint", "false")
  7091. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  7092. urls += "?" + c.urlParams_.Encode()
  7093. req, err := http.NewRequest("PATCH", urls, body)
  7094. if err != nil {
  7095. return nil, err
  7096. }
  7097. req.Header = reqHeaders
  7098. googleapi.Expand(req.URL, map[string]string{
  7099. "name": c.nameid,
  7100. })
  7101. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7102. }
  7103. // Do executes the "dialogflow.projects.agent.entityTypes.patch" call.
  7104. // Exactly one of *GoogleCloudDialogflowV2EntityType or error will be
  7105. // non-nil. Any non-2xx status code is an error. Response headers are in
  7106. // either *GoogleCloudDialogflowV2EntityType.ServerResponse.Header or
  7107. // (if a response was returned at all) in
  7108. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7109. // whether the returned error was because http.StatusNotModified was
  7110. // returned.
  7111. func (c *ProjectsAgentEntityTypesPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2EntityType, error) {
  7112. gensupport.SetOptions(c.urlParams_, opts...)
  7113. res, err := c.doRequest("json")
  7114. if res != nil && res.StatusCode == http.StatusNotModified {
  7115. if res.Body != nil {
  7116. res.Body.Close()
  7117. }
  7118. return nil, &googleapi.Error{
  7119. Code: res.StatusCode,
  7120. Header: res.Header,
  7121. }
  7122. }
  7123. if err != nil {
  7124. return nil, err
  7125. }
  7126. defer googleapi.CloseBody(res)
  7127. if err := googleapi.CheckResponse(res); err != nil {
  7128. return nil, err
  7129. }
  7130. ret := &GoogleCloudDialogflowV2EntityType{
  7131. ServerResponse: googleapi.ServerResponse{
  7132. Header: res.Header,
  7133. HTTPStatusCode: res.StatusCode,
  7134. },
  7135. }
  7136. target := &ret
  7137. if err := gensupport.DecodeResponse(target, res); err != nil {
  7138. return nil, err
  7139. }
  7140. return ret, nil
  7141. // {
  7142. // "description": "Updates the specified entity type.",
  7143. // "flatPath": "v2/projects/{projectsId}/agent/entityTypes/{entityTypesId}",
  7144. // "httpMethod": "PATCH",
  7145. // "id": "dialogflow.projects.agent.entityTypes.patch",
  7146. // "parameterOrder": [
  7147. // "name"
  7148. // ],
  7149. // "parameters": {
  7150. // "languageCode": {
  7151. // "description": "Optional. The language of entity synonyms defined in `entity_type`. If not\nspecified, the agent's default language is used.\n[More than a dozen\nlanguages](https://dialogflow.com/docs/reference/language) are supported.\nNote: languages must be enabled in the agent, before they can be used.",
  7152. // "location": "query",
  7153. // "type": "string"
  7154. // },
  7155. // "name": {
  7156. // "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`.",
  7157. // "location": "path",
  7158. // "pattern": "^projects/[^/]+/agent/entityTypes/[^/]+$",
  7159. // "required": true,
  7160. // "type": "string"
  7161. // },
  7162. // "updateMask": {
  7163. // "description": "Optional. The mask to control which fields get updated.",
  7164. // "format": "google-fieldmask",
  7165. // "location": "query",
  7166. // "type": "string"
  7167. // }
  7168. // },
  7169. // "path": "v2/{+name}",
  7170. // "request": {
  7171. // "$ref": "GoogleCloudDialogflowV2EntityType"
  7172. // },
  7173. // "response": {
  7174. // "$ref": "GoogleCloudDialogflowV2EntityType"
  7175. // },
  7176. // "scopes": [
  7177. // "https://www.googleapis.com/auth/cloud-platform",
  7178. // "https://www.googleapis.com/auth/dialogflow"
  7179. // ]
  7180. // }
  7181. }
  7182. // method id "dialogflow.projects.agent.entityTypes.entities.batchCreate":
  7183. type ProjectsAgentEntityTypesEntitiesBatchCreateCall struct {
  7184. s *Service
  7185. parent string
  7186. googleclouddialogflowv2batchcreateentitiesrequest *GoogleCloudDialogflowV2BatchCreateEntitiesRequest
  7187. urlParams_ gensupport.URLParams
  7188. ctx_ context.Context
  7189. header_ http.Header
  7190. }
  7191. // BatchCreate: Creates multiple new entities in the specified entity
  7192. // type.
  7193. //
  7194. // Operation <response: google.protobuf.Empty>
  7195. func (r *ProjectsAgentEntityTypesEntitiesService) BatchCreate(parent string, googleclouddialogflowv2batchcreateentitiesrequest *GoogleCloudDialogflowV2BatchCreateEntitiesRequest) *ProjectsAgentEntityTypesEntitiesBatchCreateCall {
  7196. c := &ProjectsAgentEntityTypesEntitiesBatchCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7197. c.parent = parent
  7198. c.googleclouddialogflowv2batchcreateentitiesrequest = googleclouddialogflowv2batchcreateentitiesrequest
  7199. return c
  7200. }
  7201. // Fields allows partial responses to be retrieved. See
  7202. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7203. // for more information.
  7204. func (c *ProjectsAgentEntityTypesEntitiesBatchCreateCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesEntitiesBatchCreateCall {
  7205. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7206. return c
  7207. }
  7208. // Context sets the context to be used in this call's Do method. Any
  7209. // pending HTTP request will be aborted if the provided context is
  7210. // canceled.
  7211. func (c *ProjectsAgentEntityTypesEntitiesBatchCreateCall) Context(ctx context.Context) *ProjectsAgentEntityTypesEntitiesBatchCreateCall {
  7212. c.ctx_ = ctx
  7213. return c
  7214. }
  7215. // Header returns an http.Header that can be modified by the caller to
  7216. // add HTTP headers to the request.
  7217. func (c *ProjectsAgentEntityTypesEntitiesBatchCreateCall) Header() http.Header {
  7218. if c.header_ == nil {
  7219. c.header_ = make(http.Header)
  7220. }
  7221. return c.header_
  7222. }
  7223. func (c *ProjectsAgentEntityTypesEntitiesBatchCreateCall) doRequest(alt string) (*http.Response, error) {
  7224. reqHeaders := make(http.Header)
  7225. for k, v := range c.header_ {
  7226. reqHeaders[k] = v
  7227. }
  7228. reqHeaders.Set("User-Agent", c.s.userAgent())
  7229. var body io.Reader = nil
  7230. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2batchcreateentitiesrequest)
  7231. if err != nil {
  7232. return nil, err
  7233. }
  7234. reqHeaders.Set("Content-Type", "application/json")
  7235. c.urlParams_.Set("alt", alt)
  7236. c.urlParams_.Set("prettyPrint", "false")
  7237. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/entities:batchCreate")
  7238. urls += "?" + c.urlParams_.Encode()
  7239. req, err := http.NewRequest("POST", urls, body)
  7240. if err != nil {
  7241. return nil, err
  7242. }
  7243. req.Header = reqHeaders
  7244. googleapi.Expand(req.URL, map[string]string{
  7245. "parent": c.parent,
  7246. })
  7247. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7248. }
  7249. // Do executes the "dialogflow.projects.agent.entityTypes.entities.batchCreate" call.
  7250. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  7251. // Any non-2xx status code is an error. Response headers are in either
  7252. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  7253. // was returned at all) in error.(*googleapi.Error).Header. Use
  7254. // googleapi.IsNotModified to check whether the returned error was
  7255. // because http.StatusNotModified was returned.
  7256. func (c *ProjectsAgentEntityTypesEntitiesBatchCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  7257. gensupport.SetOptions(c.urlParams_, opts...)
  7258. res, err := c.doRequest("json")
  7259. if res != nil && res.StatusCode == http.StatusNotModified {
  7260. if res.Body != nil {
  7261. res.Body.Close()
  7262. }
  7263. return nil, &googleapi.Error{
  7264. Code: res.StatusCode,
  7265. Header: res.Header,
  7266. }
  7267. }
  7268. if err != nil {
  7269. return nil, err
  7270. }
  7271. defer googleapi.CloseBody(res)
  7272. if err := googleapi.CheckResponse(res); err != nil {
  7273. return nil, err
  7274. }
  7275. ret := &GoogleLongrunningOperation{
  7276. ServerResponse: googleapi.ServerResponse{
  7277. Header: res.Header,
  7278. HTTPStatusCode: res.StatusCode,
  7279. },
  7280. }
  7281. target := &ret
  7282. if err := gensupport.DecodeResponse(target, res); err != nil {
  7283. return nil, err
  7284. }
  7285. return ret, nil
  7286. // {
  7287. // "description": "Creates multiple new entities in the specified entity type.\n\nOperation \u003cresponse: google.protobuf.Empty\u003e",
  7288. // "flatPath": "v2/projects/{projectsId}/agent/entityTypes/{entityTypesId}/entities:batchCreate",
  7289. // "httpMethod": "POST",
  7290. // "id": "dialogflow.projects.agent.entityTypes.entities.batchCreate",
  7291. // "parameterOrder": [
  7292. // "parent"
  7293. // ],
  7294. // "parameters": {
  7295. // "parent": {
  7296. // "description": "Required. The name of the entity type to create entities in. Format:\n`projects/\u003cProject ID\u003e/agent/entityTypes/\u003cEntity Type ID\u003e`.",
  7297. // "location": "path",
  7298. // "pattern": "^projects/[^/]+/agent/entityTypes/[^/]+$",
  7299. // "required": true,
  7300. // "type": "string"
  7301. // }
  7302. // },
  7303. // "path": "v2/{+parent}/entities:batchCreate",
  7304. // "request": {
  7305. // "$ref": "GoogleCloudDialogflowV2BatchCreateEntitiesRequest"
  7306. // },
  7307. // "response": {
  7308. // "$ref": "GoogleLongrunningOperation"
  7309. // },
  7310. // "scopes": [
  7311. // "https://www.googleapis.com/auth/cloud-platform",
  7312. // "https://www.googleapis.com/auth/dialogflow"
  7313. // ]
  7314. // }
  7315. }
  7316. // method id "dialogflow.projects.agent.entityTypes.entities.batchDelete":
  7317. type ProjectsAgentEntityTypesEntitiesBatchDeleteCall struct {
  7318. s *Service
  7319. parent string
  7320. googleclouddialogflowv2batchdeleteentitiesrequest *GoogleCloudDialogflowV2BatchDeleteEntitiesRequest
  7321. urlParams_ gensupport.URLParams
  7322. ctx_ context.Context
  7323. header_ http.Header
  7324. }
  7325. // BatchDelete: Deletes entities in the specified entity
  7326. // type.
  7327. //
  7328. // Operation <response: google.protobuf.Empty>
  7329. func (r *ProjectsAgentEntityTypesEntitiesService) BatchDelete(parent string, googleclouddialogflowv2batchdeleteentitiesrequest *GoogleCloudDialogflowV2BatchDeleteEntitiesRequest) *ProjectsAgentEntityTypesEntitiesBatchDeleteCall {
  7330. c := &ProjectsAgentEntityTypesEntitiesBatchDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7331. c.parent = parent
  7332. c.googleclouddialogflowv2batchdeleteentitiesrequest = googleclouddialogflowv2batchdeleteentitiesrequest
  7333. return c
  7334. }
  7335. // Fields allows partial responses to be retrieved. See
  7336. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7337. // for more information.
  7338. func (c *ProjectsAgentEntityTypesEntitiesBatchDeleteCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesEntitiesBatchDeleteCall {
  7339. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7340. return c
  7341. }
  7342. // Context sets the context to be used in this call's Do method. Any
  7343. // pending HTTP request will be aborted if the provided context is
  7344. // canceled.
  7345. func (c *ProjectsAgentEntityTypesEntitiesBatchDeleteCall) Context(ctx context.Context) *ProjectsAgentEntityTypesEntitiesBatchDeleteCall {
  7346. c.ctx_ = ctx
  7347. return c
  7348. }
  7349. // Header returns an http.Header that can be modified by the caller to
  7350. // add HTTP headers to the request.
  7351. func (c *ProjectsAgentEntityTypesEntitiesBatchDeleteCall) Header() http.Header {
  7352. if c.header_ == nil {
  7353. c.header_ = make(http.Header)
  7354. }
  7355. return c.header_
  7356. }
  7357. func (c *ProjectsAgentEntityTypesEntitiesBatchDeleteCall) doRequest(alt string) (*http.Response, error) {
  7358. reqHeaders := make(http.Header)
  7359. for k, v := range c.header_ {
  7360. reqHeaders[k] = v
  7361. }
  7362. reqHeaders.Set("User-Agent", c.s.userAgent())
  7363. var body io.Reader = nil
  7364. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2batchdeleteentitiesrequest)
  7365. if err != nil {
  7366. return nil, err
  7367. }
  7368. reqHeaders.Set("Content-Type", "application/json")
  7369. c.urlParams_.Set("alt", alt)
  7370. c.urlParams_.Set("prettyPrint", "false")
  7371. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/entities:batchDelete")
  7372. urls += "?" + c.urlParams_.Encode()
  7373. req, err := http.NewRequest("POST", urls, body)
  7374. if err != nil {
  7375. return nil, err
  7376. }
  7377. req.Header = reqHeaders
  7378. googleapi.Expand(req.URL, map[string]string{
  7379. "parent": c.parent,
  7380. })
  7381. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7382. }
  7383. // Do executes the "dialogflow.projects.agent.entityTypes.entities.batchDelete" call.
  7384. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  7385. // Any non-2xx status code is an error. Response headers are in either
  7386. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  7387. // was returned at all) in error.(*googleapi.Error).Header. Use
  7388. // googleapi.IsNotModified to check whether the returned error was
  7389. // because http.StatusNotModified was returned.
  7390. func (c *ProjectsAgentEntityTypesEntitiesBatchDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  7391. gensupport.SetOptions(c.urlParams_, opts...)
  7392. res, err := c.doRequest("json")
  7393. if res != nil && res.StatusCode == http.StatusNotModified {
  7394. if res.Body != nil {
  7395. res.Body.Close()
  7396. }
  7397. return nil, &googleapi.Error{
  7398. Code: res.StatusCode,
  7399. Header: res.Header,
  7400. }
  7401. }
  7402. if err != nil {
  7403. return nil, err
  7404. }
  7405. defer googleapi.CloseBody(res)
  7406. if err := googleapi.CheckResponse(res); err != nil {
  7407. return nil, err
  7408. }
  7409. ret := &GoogleLongrunningOperation{
  7410. ServerResponse: googleapi.ServerResponse{
  7411. Header: res.Header,
  7412. HTTPStatusCode: res.StatusCode,
  7413. },
  7414. }
  7415. target := &ret
  7416. if err := gensupport.DecodeResponse(target, res); err != nil {
  7417. return nil, err
  7418. }
  7419. return ret, nil
  7420. // {
  7421. // "description": "Deletes entities in the specified entity type.\n\nOperation \u003cresponse: google.protobuf.Empty\u003e",
  7422. // "flatPath": "v2/projects/{projectsId}/agent/entityTypes/{entityTypesId}/entities:batchDelete",
  7423. // "httpMethod": "POST",
  7424. // "id": "dialogflow.projects.agent.entityTypes.entities.batchDelete",
  7425. // "parameterOrder": [
  7426. // "parent"
  7427. // ],
  7428. // "parameters": {
  7429. // "parent": {
  7430. // "description": "Required. The name of the entity type to delete entries for. Format:\n`projects/\u003cProject ID\u003e/agent/entityTypes/\u003cEntity Type ID\u003e`.",
  7431. // "location": "path",
  7432. // "pattern": "^projects/[^/]+/agent/entityTypes/[^/]+$",
  7433. // "required": true,
  7434. // "type": "string"
  7435. // }
  7436. // },
  7437. // "path": "v2/{+parent}/entities:batchDelete",
  7438. // "request": {
  7439. // "$ref": "GoogleCloudDialogflowV2BatchDeleteEntitiesRequest"
  7440. // },
  7441. // "response": {
  7442. // "$ref": "GoogleLongrunningOperation"
  7443. // },
  7444. // "scopes": [
  7445. // "https://www.googleapis.com/auth/cloud-platform",
  7446. // "https://www.googleapis.com/auth/dialogflow"
  7447. // ]
  7448. // }
  7449. }
  7450. // method id "dialogflow.projects.agent.entityTypes.entities.batchUpdate":
  7451. type ProjectsAgentEntityTypesEntitiesBatchUpdateCall struct {
  7452. s *Service
  7453. parent string
  7454. googleclouddialogflowv2batchupdateentitiesrequest *GoogleCloudDialogflowV2BatchUpdateEntitiesRequest
  7455. urlParams_ gensupport.URLParams
  7456. ctx_ context.Context
  7457. header_ http.Header
  7458. }
  7459. // BatchUpdate: Updates or creates multiple entities in the specified
  7460. // entity type. This
  7461. // method does not affect entities in the entity type that aren't
  7462. // explicitly
  7463. // specified in the request.
  7464. //
  7465. // Operation <response: google.protobuf.Empty>
  7466. func (r *ProjectsAgentEntityTypesEntitiesService) BatchUpdate(parent string, googleclouddialogflowv2batchupdateentitiesrequest *GoogleCloudDialogflowV2BatchUpdateEntitiesRequest) *ProjectsAgentEntityTypesEntitiesBatchUpdateCall {
  7467. c := &ProjectsAgentEntityTypesEntitiesBatchUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7468. c.parent = parent
  7469. c.googleclouddialogflowv2batchupdateentitiesrequest = googleclouddialogflowv2batchupdateentitiesrequest
  7470. return c
  7471. }
  7472. // Fields allows partial responses to be retrieved. See
  7473. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7474. // for more information.
  7475. func (c *ProjectsAgentEntityTypesEntitiesBatchUpdateCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesEntitiesBatchUpdateCall {
  7476. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7477. return c
  7478. }
  7479. // Context sets the context to be used in this call's Do method. Any
  7480. // pending HTTP request will be aborted if the provided context is
  7481. // canceled.
  7482. func (c *ProjectsAgentEntityTypesEntitiesBatchUpdateCall) Context(ctx context.Context) *ProjectsAgentEntityTypesEntitiesBatchUpdateCall {
  7483. c.ctx_ = ctx
  7484. return c
  7485. }
  7486. // Header returns an http.Header that can be modified by the caller to
  7487. // add HTTP headers to the request.
  7488. func (c *ProjectsAgentEntityTypesEntitiesBatchUpdateCall) Header() http.Header {
  7489. if c.header_ == nil {
  7490. c.header_ = make(http.Header)
  7491. }
  7492. return c.header_
  7493. }
  7494. func (c *ProjectsAgentEntityTypesEntitiesBatchUpdateCall) doRequest(alt string) (*http.Response, error) {
  7495. reqHeaders := make(http.Header)
  7496. for k, v := range c.header_ {
  7497. reqHeaders[k] = v
  7498. }
  7499. reqHeaders.Set("User-Agent", c.s.userAgent())
  7500. var body io.Reader = nil
  7501. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2batchupdateentitiesrequest)
  7502. if err != nil {
  7503. return nil, err
  7504. }
  7505. reqHeaders.Set("Content-Type", "application/json")
  7506. c.urlParams_.Set("alt", alt)
  7507. c.urlParams_.Set("prettyPrint", "false")
  7508. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/entities:batchUpdate")
  7509. urls += "?" + c.urlParams_.Encode()
  7510. req, err := http.NewRequest("POST", urls, body)
  7511. if err != nil {
  7512. return nil, err
  7513. }
  7514. req.Header = reqHeaders
  7515. googleapi.Expand(req.URL, map[string]string{
  7516. "parent": c.parent,
  7517. })
  7518. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7519. }
  7520. // Do executes the "dialogflow.projects.agent.entityTypes.entities.batchUpdate" call.
  7521. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  7522. // Any non-2xx status code is an error. Response headers are in either
  7523. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  7524. // was returned at all) in error.(*googleapi.Error).Header. Use
  7525. // googleapi.IsNotModified to check whether the returned error was
  7526. // because http.StatusNotModified was returned.
  7527. func (c *ProjectsAgentEntityTypesEntitiesBatchUpdateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  7528. gensupport.SetOptions(c.urlParams_, opts...)
  7529. res, err := c.doRequest("json")
  7530. if res != nil && res.StatusCode == http.StatusNotModified {
  7531. if res.Body != nil {
  7532. res.Body.Close()
  7533. }
  7534. return nil, &googleapi.Error{
  7535. Code: res.StatusCode,
  7536. Header: res.Header,
  7537. }
  7538. }
  7539. if err != nil {
  7540. return nil, err
  7541. }
  7542. defer googleapi.CloseBody(res)
  7543. if err := googleapi.CheckResponse(res); err != nil {
  7544. return nil, err
  7545. }
  7546. ret := &GoogleLongrunningOperation{
  7547. ServerResponse: googleapi.ServerResponse{
  7548. Header: res.Header,
  7549. HTTPStatusCode: res.StatusCode,
  7550. },
  7551. }
  7552. target := &ret
  7553. if err := gensupport.DecodeResponse(target, res); err != nil {
  7554. return nil, err
  7555. }
  7556. return ret, nil
  7557. // {
  7558. // "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",
  7559. // "flatPath": "v2/projects/{projectsId}/agent/entityTypes/{entityTypesId}/entities:batchUpdate",
  7560. // "httpMethod": "POST",
  7561. // "id": "dialogflow.projects.agent.entityTypes.entities.batchUpdate",
  7562. // "parameterOrder": [
  7563. // "parent"
  7564. // ],
  7565. // "parameters": {
  7566. // "parent": {
  7567. // "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`.",
  7568. // "location": "path",
  7569. // "pattern": "^projects/[^/]+/agent/entityTypes/[^/]+$",
  7570. // "required": true,
  7571. // "type": "string"
  7572. // }
  7573. // },
  7574. // "path": "v2/{+parent}/entities:batchUpdate",
  7575. // "request": {
  7576. // "$ref": "GoogleCloudDialogflowV2BatchUpdateEntitiesRequest"
  7577. // },
  7578. // "response": {
  7579. // "$ref": "GoogleLongrunningOperation"
  7580. // },
  7581. // "scopes": [
  7582. // "https://www.googleapis.com/auth/cloud-platform",
  7583. // "https://www.googleapis.com/auth/dialogflow"
  7584. // ]
  7585. // }
  7586. }
  7587. // method id "dialogflow.projects.agent.intents.batchDelete":
  7588. type ProjectsAgentIntentsBatchDeleteCall struct {
  7589. s *Service
  7590. parent string
  7591. googleclouddialogflowv2batchdeleteintentsrequest *GoogleCloudDialogflowV2BatchDeleteIntentsRequest
  7592. urlParams_ gensupport.URLParams
  7593. ctx_ context.Context
  7594. header_ http.Header
  7595. }
  7596. // BatchDelete: Deletes intents in the specified agent.
  7597. //
  7598. // Operation <response: google.protobuf.Empty>
  7599. func (r *ProjectsAgentIntentsService) BatchDelete(parent string, googleclouddialogflowv2batchdeleteintentsrequest *GoogleCloudDialogflowV2BatchDeleteIntentsRequest) *ProjectsAgentIntentsBatchDeleteCall {
  7600. c := &ProjectsAgentIntentsBatchDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7601. c.parent = parent
  7602. c.googleclouddialogflowv2batchdeleteintentsrequest = googleclouddialogflowv2batchdeleteintentsrequest
  7603. return c
  7604. }
  7605. // Fields allows partial responses to be retrieved. See
  7606. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7607. // for more information.
  7608. func (c *ProjectsAgentIntentsBatchDeleteCall) Fields(s ...googleapi.Field) *ProjectsAgentIntentsBatchDeleteCall {
  7609. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7610. return c
  7611. }
  7612. // Context sets the context to be used in this call's Do method. Any
  7613. // pending HTTP request will be aborted if the provided context is
  7614. // canceled.
  7615. func (c *ProjectsAgentIntentsBatchDeleteCall) Context(ctx context.Context) *ProjectsAgentIntentsBatchDeleteCall {
  7616. c.ctx_ = ctx
  7617. return c
  7618. }
  7619. // Header returns an http.Header that can be modified by the caller to
  7620. // add HTTP headers to the request.
  7621. func (c *ProjectsAgentIntentsBatchDeleteCall) Header() http.Header {
  7622. if c.header_ == nil {
  7623. c.header_ = make(http.Header)
  7624. }
  7625. return c.header_
  7626. }
  7627. func (c *ProjectsAgentIntentsBatchDeleteCall) doRequest(alt string) (*http.Response, error) {
  7628. reqHeaders := make(http.Header)
  7629. for k, v := range c.header_ {
  7630. reqHeaders[k] = v
  7631. }
  7632. reqHeaders.Set("User-Agent", c.s.userAgent())
  7633. var body io.Reader = nil
  7634. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2batchdeleteintentsrequest)
  7635. if err != nil {
  7636. return nil, err
  7637. }
  7638. reqHeaders.Set("Content-Type", "application/json")
  7639. c.urlParams_.Set("alt", alt)
  7640. c.urlParams_.Set("prettyPrint", "false")
  7641. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/intents:batchDelete")
  7642. urls += "?" + c.urlParams_.Encode()
  7643. req, err := http.NewRequest("POST", urls, body)
  7644. if err != nil {
  7645. return nil, err
  7646. }
  7647. req.Header = reqHeaders
  7648. googleapi.Expand(req.URL, map[string]string{
  7649. "parent": c.parent,
  7650. })
  7651. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7652. }
  7653. // Do executes the "dialogflow.projects.agent.intents.batchDelete" call.
  7654. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  7655. // Any non-2xx status code is an error. Response headers are in either
  7656. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  7657. // was returned at all) in error.(*googleapi.Error).Header. Use
  7658. // googleapi.IsNotModified to check whether the returned error was
  7659. // because http.StatusNotModified was returned.
  7660. func (c *ProjectsAgentIntentsBatchDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  7661. gensupport.SetOptions(c.urlParams_, opts...)
  7662. res, err := c.doRequest("json")
  7663. if res != nil && res.StatusCode == http.StatusNotModified {
  7664. if res.Body != nil {
  7665. res.Body.Close()
  7666. }
  7667. return nil, &googleapi.Error{
  7668. Code: res.StatusCode,
  7669. Header: res.Header,
  7670. }
  7671. }
  7672. if err != nil {
  7673. return nil, err
  7674. }
  7675. defer googleapi.CloseBody(res)
  7676. if err := googleapi.CheckResponse(res); err != nil {
  7677. return nil, err
  7678. }
  7679. ret := &GoogleLongrunningOperation{
  7680. ServerResponse: googleapi.ServerResponse{
  7681. Header: res.Header,
  7682. HTTPStatusCode: res.StatusCode,
  7683. },
  7684. }
  7685. target := &ret
  7686. if err := gensupport.DecodeResponse(target, res); err != nil {
  7687. return nil, err
  7688. }
  7689. return ret, nil
  7690. // {
  7691. // "description": "Deletes intents in the specified agent.\n\nOperation \u003cresponse: google.protobuf.Empty\u003e",
  7692. // "flatPath": "v2/projects/{projectsId}/agent/intents:batchDelete",
  7693. // "httpMethod": "POST",
  7694. // "id": "dialogflow.projects.agent.intents.batchDelete",
  7695. // "parameterOrder": [
  7696. // "parent"
  7697. // ],
  7698. // "parameters": {
  7699. // "parent": {
  7700. // "description": "Required. The name of the agent to delete all entities types for. Format:\n`projects/\u003cProject ID\u003e/agent`.",
  7701. // "location": "path",
  7702. // "pattern": "^projects/[^/]+/agent$",
  7703. // "required": true,
  7704. // "type": "string"
  7705. // }
  7706. // },
  7707. // "path": "v2/{+parent}/intents:batchDelete",
  7708. // "request": {
  7709. // "$ref": "GoogleCloudDialogflowV2BatchDeleteIntentsRequest"
  7710. // },
  7711. // "response": {
  7712. // "$ref": "GoogleLongrunningOperation"
  7713. // },
  7714. // "scopes": [
  7715. // "https://www.googleapis.com/auth/cloud-platform",
  7716. // "https://www.googleapis.com/auth/dialogflow"
  7717. // ]
  7718. // }
  7719. }
  7720. // method id "dialogflow.projects.agent.intents.batchUpdate":
  7721. type ProjectsAgentIntentsBatchUpdateCall struct {
  7722. s *Service
  7723. parent string
  7724. googleclouddialogflowv2batchupdateintentsrequest *GoogleCloudDialogflowV2BatchUpdateIntentsRequest
  7725. urlParams_ gensupport.URLParams
  7726. ctx_ context.Context
  7727. header_ http.Header
  7728. }
  7729. // BatchUpdate: Updates/Creates multiple intents in the specified
  7730. // agent.
  7731. //
  7732. // Operation <response: BatchUpdateIntentsResponse>
  7733. func (r *ProjectsAgentIntentsService) BatchUpdate(parent string, googleclouddialogflowv2batchupdateintentsrequest *GoogleCloudDialogflowV2BatchUpdateIntentsRequest) *ProjectsAgentIntentsBatchUpdateCall {
  7734. c := &ProjectsAgentIntentsBatchUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7735. c.parent = parent
  7736. c.googleclouddialogflowv2batchupdateintentsrequest = googleclouddialogflowv2batchupdateintentsrequest
  7737. return c
  7738. }
  7739. // Fields allows partial responses to be retrieved. See
  7740. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7741. // for more information.
  7742. func (c *ProjectsAgentIntentsBatchUpdateCall) Fields(s ...googleapi.Field) *ProjectsAgentIntentsBatchUpdateCall {
  7743. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7744. return c
  7745. }
  7746. // Context sets the context to be used in this call's Do method. Any
  7747. // pending HTTP request will be aborted if the provided context is
  7748. // canceled.
  7749. func (c *ProjectsAgentIntentsBatchUpdateCall) Context(ctx context.Context) *ProjectsAgentIntentsBatchUpdateCall {
  7750. c.ctx_ = ctx
  7751. return c
  7752. }
  7753. // Header returns an http.Header that can be modified by the caller to
  7754. // add HTTP headers to the request.
  7755. func (c *ProjectsAgentIntentsBatchUpdateCall) Header() http.Header {
  7756. if c.header_ == nil {
  7757. c.header_ = make(http.Header)
  7758. }
  7759. return c.header_
  7760. }
  7761. func (c *ProjectsAgentIntentsBatchUpdateCall) doRequest(alt string) (*http.Response, error) {
  7762. reqHeaders := make(http.Header)
  7763. for k, v := range c.header_ {
  7764. reqHeaders[k] = v
  7765. }
  7766. reqHeaders.Set("User-Agent", c.s.userAgent())
  7767. var body io.Reader = nil
  7768. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2batchupdateintentsrequest)
  7769. if err != nil {
  7770. return nil, err
  7771. }
  7772. reqHeaders.Set("Content-Type", "application/json")
  7773. c.urlParams_.Set("alt", alt)
  7774. c.urlParams_.Set("prettyPrint", "false")
  7775. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/intents:batchUpdate")
  7776. urls += "?" + c.urlParams_.Encode()
  7777. req, err := http.NewRequest("POST", urls, body)
  7778. if err != nil {
  7779. return nil, err
  7780. }
  7781. req.Header = reqHeaders
  7782. googleapi.Expand(req.URL, map[string]string{
  7783. "parent": c.parent,
  7784. })
  7785. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7786. }
  7787. // Do executes the "dialogflow.projects.agent.intents.batchUpdate" call.
  7788. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  7789. // Any non-2xx status code is an error. Response headers are in either
  7790. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  7791. // was returned at all) in error.(*googleapi.Error).Header. Use
  7792. // googleapi.IsNotModified to check whether the returned error was
  7793. // because http.StatusNotModified was returned.
  7794. func (c *ProjectsAgentIntentsBatchUpdateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  7795. gensupport.SetOptions(c.urlParams_, opts...)
  7796. res, err := c.doRequest("json")
  7797. if res != nil && res.StatusCode == http.StatusNotModified {
  7798. if res.Body != nil {
  7799. res.Body.Close()
  7800. }
  7801. return nil, &googleapi.Error{
  7802. Code: res.StatusCode,
  7803. Header: res.Header,
  7804. }
  7805. }
  7806. if err != nil {
  7807. return nil, err
  7808. }
  7809. defer googleapi.CloseBody(res)
  7810. if err := googleapi.CheckResponse(res); err != nil {
  7811. return nil, err
  7812. }
  7813. ret := &GoogleLongrunningOperation{
  7814. ServerResponse: googleapi.ServerResponse{
  7815. Header: res.Header,
  7816. HTTPStatusCode: res.StatusCode,
  7817. },
  7818. }
  7819. target := &ret
  7820. if err := gensupport.DecodeResponse(target, res); err != nil {
  7821. return nil, err
  7822. }
  7823. return ret, nil
  7824. // {
  7825. // "description": "Updates/Creates multiple intents in the specified agent.\n\nOperation \u003cresponse: BatchUpdateIntentsResponse\u003e",
  7826. // "flatPath": "v2/projects/{projectsId}/agent/intents:batchUpdate",
  7827. // "httpMethod": "POST",
  7828. // "id": "dialogflow.projects.agent.intents.batchUpdate",
  7829. // "parameterOrder": [
  7830. // "parent"
  7831. // ],
  7832. // "parameters": {
  7833. // "parent": {
  7834. // "description": "Required. The name of the agent to update or create intents in.\nFormat: `projects/\u003cProject ID\u003e/agent`.",
  7835. // "location": "path",
  7836. // "pattern": "^projects/[^/]+/agent$",
  7837. // "required": true,
  7838. // "type": "string"
  7839. // }
  7840. // },
  7841. // "path": "v2/{+parent}/intents:batchUpdate",
  7842. // "request": {
  7843. // "$ref": "GoogleCloudDialogflowV2BatchUpdateIntentsRequest"
  7844. // },
  7845. // "response": {
  7846. // "$ref": "GoogleLongrunningOperation"
  7847. // },
  7848. // "scopes": [
  7849. // "https://www.googleapis.com/auth/cloud-platform",
  7850. // "https://www.googleapis.com/auth/dialogflow"
  7851. // ]
  7852. // }
  7853. }
  7854. // method id "dialogflow.projects.agent.intents.create":
  7855. type ProjectsAgentIntentsCreateCall struct {
  7856. s *Service
  7857. parent string
  7858. googleclouddialogflowv2intent *GoogleCloudDialogflowV2Intent
  7859. urlParams_ gensupport.URLParams
  7860. ctx_ context.Context
  7861. header_ http.Header
  7862. }
  7863. // Create: Creates an intent in the specified agent.
  7864. func (r *ProjectsAgentIntentsService) Create(parent string, googleclouddialogflowv2intent *GoogleCloudDialogflowV2Intent) *ProjectsAgentIntentsCreateCall {
  7865. c := &ProjectsAgentIntentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7866. c.parent = parent
  7867. c.googleclouddialogflowv2intent = googleclouddialogflowv2intent
  7868. return c
  7869. }
  7870. // IntentView sets the optional parameter "intentView": The resource
  7871. // view to apply to the returned intent.
  7872. //
  7873. // Possible values:
  7874. // "INTENT_VIEW_UNSPECIFIED"
  7875. // "INTENT_VIEW_FULL"
  7876. func (c *ProjectsAgentIntentsCreateCall) IntentView(intentView string) *ProjectsAgentIntentsCreateCall {
  7877. c.urlParams_.Set("intentView", intentView)
  7878. return c
  7879. }
  7880. // LanguageCode sets the optional parameter "languageCode": The language
  7881. // of training phrases, parameters and rich messages
  7882. // defined in `intent`. If not specified, the agent's default language
  7883. // is
  7884. // used. [More than a
  7885. // dozen
  7886. // languages](https://dialogflow.com/docs/reference/language) are
  7887. // supported.
  7888. // Note: languages must be enabled in the agent, before they can be
  7889. // used.
  7890. func (c *ProjectsAgentIntentsCreateCall) LanguageCode(languageCode string) *ProjectsAgentIntentsCreateCall {
  7891. c.urlParams_.Set("languageCode", languageCode)
  7892. return c
  7893. }
  7894. // Fields allows partial responses to be retrieved. See
  7895. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7896. // for more information.
  7897. func (c *ProjectsAgentIntentsCreateCall) Fields(s ...googleapi.Field) *ProjectsAgentIntentsCreateCall {
  7898. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7899. return c
  7900. }
  7901. // Context sets the context to be used in this call's Do method. Any
  7902. // pending HTTP request will be aborted if the provided context is
  7903. // canceled.
  7904. func (c *ProjectsAgentIntentsCreateCall) Context(ctx context.Context) *ProjectsAgentIntentsCreateCall {
  7905. c.ctx_ = ctx
  7906. return c
  7907. }
  7908. // Header returns an http.Header that can be modified by the caller to
  7909. // add HTTP headers to the request.
  7910. func (c *ProjectsAgentIntentsCreateCall) Header() http.Header {
  7911. if c.header_ == nil {
  7912. c.header_ = make(http.Header)
  7913. }
  7914. return c.header_
  7915. }
  7916. func (c *ProjectsAgentIntentsCreateCall) doRequest(alt string) (*http.Response, error) {
  7917. reqHeaders := make(http.Header)
  7918. for k, v := range c.header_ {
  7919. reqHeaders[k] = v
  7920. }
  7921. reqHeaders.Set("User-Agent", c.s.userAgent())
  7922. var body io.Reader = nil
  7923. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2intent)
  7924. if err != nil {
  7925. return nil, err
  7926. }
  7927. reqHeaders.Set("Content-Type", "application/json")
  7928. c.urlParams_.Set("alt", alt)
  7929. c.urlParams_.Set("prettyPrint", "false")
  7930. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/intents")
  7931. urls += "?" + c.urlParams_.Encode()
  7932. req, err := http.NewRequest("POST", urls, body)
  7933. if err != nil {
  7934. return nil, err
  7935. }
  7936. req.Header = reqHeaders
  7937. googleapi.Expand(req.URL, map[string]string{
  7938. "parent": c.parent,
  7939. })
  7940. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7941. }
  7942. // Do executes the "dialogflow.projects.agent.intents.create" call.
  7943. // Exactly one of *GoogleCloudDialogflowV2Intent or error will be
  7944. // non-nil. Any non-2xx status code is an error. Response headers are in
  7945. // either *GoogleCloudDialogflowV2Intent.ServerResponse.Header or (if a
  7946. // response was returned at all) in error.(*googleapi.Error).Header. Use
  7947. // googleapi.IsNotModified to check whether the returned error was
  7948. // because http.StatusNotModified was returned.
  7949. func (c *ProjectsAgentIntentsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2Intent, error) {
  7950. gensupport.SetOptions(c.urlParams_, opts...)
  7951. res, err := c.doRequest("json")
  7952. if res != nil && res.StatusCode == http.StatusNotModified {
  7953. if res.Body != nil {
  7954. res.Body.Close()
  7955. }
  7956. return nil, &googleapi.Error{
  7957. Code: res.StatusCode,
  7958. Header: res.Header,
  7959. }
  7960. }
  7961. if err != nil {
  7962. return nil, err
  7963. }
  7964. defer googleapi.CloseBody(res)
  7965. if err := googleapi.CheckResponse(res); err != nil {
  7966. return nil, err
  7967. }
  7968. ret := &GoogleCloudDialogflowV2Intent{
  7969. ServerResponse: googleapi.ServerResponse{
  7970. Header: res.Header,
  7971. HTTPStatusCode: res.StatusCode,
  7972. },
  7973. }
  7974. target := &ret
  7975. if err := gensupport.DecodeResponse(target, res); err != nil {
  7976. return nil, err
  7977. }
  7978. return ret, nil
  7979. // {
  7980. // "description": "Creates an intent in the specified agent.",
  7981. // "flatPath": "v2/projects/{projectsId}/agent/intents",
  7982. // "httpMethod": "POST",
  7983. // "id": "dialogflow.projects.agent.intents.create",
  7984. // "parameterOrder": [
  7985. // "parent"
  7986. // ],
  7987. // "parameters": {
  7988. // "intentView": {
  7989. // "description": "Optional. The resource view to apply to the returned intent.",
  7990. // "enum": [
  7991. // "INTENT_VIEW_UNSPECIFIED",
  7992. // "INTENT_VIEW_FULL"
  7993. // ],
  7994. // "location": "query",
  7995. // "type": "string"
  7996. // },
  7997. // "languageCode": {
  7998. // "description": "Optional. The language of training phrases, parameters and rich messages\ndefined in `intent`. If not specified, the agent's default language is\nused. [More than a dozen\nlanguages](https://dialogflow.com/docs/reference/language) are supported.\nNote: languages must be enabled in the agent, before they can be used.",
  7999. // "location": "query",
  8000. // "type": "string"
  8001. // },
  8002. // "parent": {
  8003. // "description": "Required. The agent to create a intent for.\nFormat: `projects/\u003cProject ID\u003e/agent`.",
  8004. // "location": "path",
  8005. // "pattern": "^projects/[^/]+/agent$",
  8006. // "required": true,
  8007. // "type": "string"
  8008. // }
  8009. // },
  8010. // "path": "v2/{+parent}/intents",
  8011. // "request": {
  8012. // "$ref": "GoogleCloudDialogflowV2Intent"
  8013. // },
  8014. // "response": {
  8015. // "$ref": "GoogleCloudDialogflowV2Intent"
  8016. // },
  8017. // "scopes": [
  8018. // "https://www.googleapis.com/auth/cloud-platform",
  8019. // "https://www.googleapis.com/auth/dialogflow"
  8020. // ]
  8021. // }
  8022. }
  8023. // method id "dialogflow.projects.agent.intents.delete":
  8024. type ProjectsAgentIntentsDeleteCall struct {
  8025. s *Service
  8026. name string
  8027. urlParams_ gensupport.URLParams
  8028. ctx_ context.Context
  8029. header_ http.Header
  8030. }
  8031. // Delete: Deletes the specified intent and its direct or indirect
  8032. // followup intents.
  8033. func (r *ProjectsAgentIntentsService) Delete(name string) *ProjectsAgentIntentsDeleteCall {
  8034. c := &ProjectsAgentIntentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8035. c.name = name
  8036. return c
  8037. }
  8038. // Fields allows partial responses to be retrieved. See
  8039. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8040. // for more information.
  8041. func (c *ProjectsAgentIntentsDeleteCall) Fields(s ...googleapi.Field) *ProjectsAgentIntentsDeleteCall {
  8042. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8043. return c
  8044. }
  8045. // Context sets the context to be used in this call's Do method. Any
  8046. // pending HTTP request will be aborted if the provided context is
  8047. // canceled.
  8048. func (c *ProjectsAgentIntentsDeleteCall) Context(ctx context.Context) *ProjectsAgentIntentsDeleteCall {
  8049. c.ctx_ = ctx
  8050. return c
  8051. }
  8052. // Header returns an http.Header that can be modified by the caller to
  8053. // add HTTP headers to the request.
  8054. func (c *ProjectsAgentIntentsDeleteCall) Header() http.Header {
  8055. if c.header_ == nil {
  8056. c.header_ = make(http.Header)
  8057. }
  8058. return c.header_
  8059. }
  8060. func (c *ProjectsAgentIntentsDeleteCall) doRequest(alt string) (*http.Response, error) {
  8061. reqHeaders := make(http.Header)
  8062. for k, v := range c.header_ {
  8063. reqHeaders[k] = v
  8064. }
  8065. reqHeaders.Set("User-Agent", c.s.userAgent())
  8066. var body io.Reader = nil
  8067. c.urlParams_.Set("alt", alt)
  8068. c.urlParams_.Set("prettyPrint", "false")
  8069. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  8070. urls += "?" + c.urlParams_.Encode()
  8071. req, err := http.NewRequest("DELETE", urls, body)
  8072. if err != nil {
  8073. return nil, err
  8074. }
  8075. req.Header = reqHeaders
  8076. googleapi.Expand(req.URL, map[string]string{
  8077. "name": c.name,
  8078. })
  8079. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8080. }
  8081. // Do executes the "dialogflow.projects.agent.intents.delete" call.
  8082. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  8083. // non-2xx status code is an error. Response headers are in either
  8084. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  8085. // returned at all) in error.(*googleapi.Error).Header. Use
  8086. // googleapi.IsNotModified to check whether the returned error was
  8087. // because http.StatusNotModified was returned.
  8088. func (c *ProjectsAgentIntentsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  8089. gensupport.SetOptions(c.urlParams_, opts...)
  8090. res, err := c.doRequest("json")
  8091. if res != nil && res.StatusCode == http.StatusNotModified {
  8092. if res.Body != nil {
  8093. res.Body.Close()
  8094. }
  8095. return nil, &googleapi.Error{
  8096. Code: res.StatusCode,
  8097. Header: res.Header,
  8098. }
  8099. }
  8100. if err != nil {
  8101. return nil, err
  8102. }
  8103. defer googleapi.CloseBody(res)
  8104. if err := googleapi.CheckResponse(res); err != nil {
  8105. return nil, err
  8106. }
  8107. ret := &GoogleProtobufEmpty{
  8108. ServerResponse: googleapi.ServerResponse{
  8109. Header: res.Header,
  8110. HTTPStatusCode: res.StatusCode,
  8111. },
  8112. }
  8113. target := &ret
  8114. if err := gensupport.DecodeResponse(target, res); err != nil {
  8115. return nil, err
  8116. }
  8117. return ret, nil
  8118. // {
  8119. // "description": "Deletes the specified intent and its direct or indirect followup intents.",
  8120. // "flatPath": "v2/projects/{projectsId}/agent/intents/{intentsId}",
  8121. // "httpMethod": "DELETE",
  8122. // "id": "dialogflow.projects.agent.intents.delete",
  8123. // "parameterOrder": [
  8124. // "name"
  8125. // ],
  8126. // "parameters": {
  8127. // "name": {
  8128. // "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`.",
  8129. // "location": "path",
  8130. // "pattern": "^projects/[^/]+/agent/intents/[^/]+$",
  8131. // "required": true,
  8132. // "type": "string"
  8133. // }
  8134. // },
  8135. // "path": "v2/{+name}",
  8136. // "response": {
  8137. // "$ref": "GoogleProtobufEmpty"
  8138. // },
  8139. // "scopes": [
  8140. // "https://www.googleapis.com/auth/cloud-platform",
  8141. // "https://www.googleapis.com/auth/dialogflow"
  8142. // ]
  8143. // }
  8144. }
  8145. // method id "dialogflow.projects.agent.intents.get":
  8146. type ProjectsAgentIntentsGetCall struct {
  8147. s *Service
  8148. name string
  8149. urlParams_ gensupport.URLParams
  8150. ifNoneMatch_ string
  8151. ctx_ context.Context
  8152. header_ http.Header
  8153. }
  8154. // Get: Retrieves the specified intent.
  8155. func (r *ProjectsAgentIntentsService) Get(name string) *ProjectsAgentIntentsGetCall {
  8156. c := &ProjectsAgentIntentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8157. c.name = name
  8158. return c
  8159. }
  8160. // IntentView sets the optional parameter "intentView": The resource
  8161. // view to apply to the returned intent.
  8162. //
  8163. // Possible values:
  8164. // "INTENT_VIEW_UNSPECIFIED"
  8165. // "INTENT_VIEW_FULL"
  8166. func (c *ProjectsAgentIntentsGetCall) IntentView(intentView string) *ProjectsAgentIntentsGetCall {
  8167. c.urlParams_.Set("intentView", intentView)
  8168. return c
  8169. }
  8170. // LanguageCode sets the optional parameter "languageCode": The language
  8171. // to retrieve training phrases, parameters and rich
  8172. // messages for. If not specified, the agent's default language is
  8173. // used.
  8174. // [More than a
  8175. // dozen
  8176. // languages](https://dialogflow.com/docs/reference/language) are
  8177. // supported.
  8178. // Note: languages must be enabled in the agent, before they can be
  8179. // used.
  8180. func (c *ProjectsAgentIntentsGetCall) LanguageCode(languageCode string) *ProjectsAgentIntentsGetCall {
  8181. c.urlParams_.Set("languageCode", languageCode)
  8182. return c
  8183. }
  8184. // Fields allows partial responses to be retrieved. See
  8185. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8186. // for more information.
  8187. func (c *ProjectsAgentIntentsGetCall) Fields(s ...googleapi.Field) *ProjectsAgentIntentsGetCall {
  8188. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8189. return c
  8190. }
  8191. // IfNoneMatch sets the optional parameter which makes the operation
  8192. // fail if the object's ETag matches the given value. This is useful for
  8193. // getting updates only after the object has changed since the last
  8194. // request. Use googleapi.IsNotModified to check whether the response
  8195. // error from Do is the result of In-None-Match.
  8196. func (c *ProjectsAgentIntentsGetCall) IfNoneMatch(entityTag string) *ProjectsAgentIntentsGetCall {
  8197. c.ifNoneMatch_ = entityTag
  8198. return c
  8199. }
  8200. // Context sets the context to be used in this call's Do method. Any
  8201. // pending HTTP request will be aborted if the provided context is
  8202. // canceled.
  8203. func (c *ProjectsAgentIntentsGetCall) Context(ctx context.Context) *ProjectsAgentIntentsGetCall {
  8204. c.ctx_ = ctx
  8205. return c
  8206. }
  8207. // Header returns an http.Header that can be modified by the caller to
  8208. // add HTTP headers to the request.
  8209. func (c *ProjectsAgentIntentsGetCall) Header() http.Header {
  8210. if c.header_ == nil {
  8211. c.header_ = make(http.Header)
  8212. }
  8213. return c.header_
  8214. }
  8215. func (c *ProjectsAgentIntentsGetCall) doRequest(alt string) (*http.Response, error) {
  8216. reqHeaders := make(http.Header)
  8217. for k, v := range c.header_ {
  8218. reqHeaders[k] = v
  8219. }
  8220. reqHeaders.Set("User-Agent", c.s.userAgent())
  8221. if c.ifNoneMatch_ != "" {
  8222. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8223. }
  8224. var body io.Reader = nil
  8225. c.urlParams_.Set("alt", alt)
  8226. c.urlParams_.Set("prettyPrint", "false")
  8227. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  8228. urls += "?" + c.urlParams_.Encode()
  8229. req, err := http.NewRequest("GET", urls, body)
  8230. if err != nil {
  8231. return nil, err
  8232. }
  8233. req.Header = reqHeaders
  8234. googleapi.Expand(req.URL, map[string]string{
  8235. "name": c.name,
  8236. })
  8237. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8238. }
  8239. // Do executes the "dialogflow.projects.agent.intents.get" call.
  8240. // Exactly one of *GoogleCloudDialogflowV2Intent or error will be
  8241. // non-nil. Any non-2xx status code is an error. Response headers are in
  8242. // either *GoogleCloudDialogflowV2Intent.ServerResponse.Header or (if a
  8243. // response was returned at all) in error.(*googleapi.Error).Header. Use
  8244. // googleapi.IsNotModified to check whether the returned error was
  8245. // because http.StatusNotModified was returned.
  8246. func (c *ProjectsAgentIntentsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2Intent, error) {
  8247. gensupport.SetOptions(c.urlParams_, opts...)
  8248. res, err := c.doRequest("json")
  8249. if res != nil && res.StatusCode == http.StatusNotModified {
  8250. if res.Body != nil {
  8251. res.Body.Close()
  8252. }
  8253. return nil, &googleapi.Error{
  8254. Code: res.StatusCode,
  8255. Header: res.Header,
  8256. }
  8257. }
  8258. if err != nil {
  8259. return nil, err
  8260. }
  8261. defer googleapi.CloseBody(res)
  8262. if err := googleapi.CheckResponse(res); err != nil {
  8263. return nil, err
  8264. }
  8265. ret := &GoogleCloudDialogflowV2Intent{
  8266. ServerResponse: googleapi.ServerResponse{
  8267. Header: res.Header,
  8268. HTTPStatusCode: res.StatusCode,
  8269. },
  8270. }
  8271. target := &ret
  8272. if err := gensupport.DecodeResponse(target, res); err != nil {
  8273. return nil, err
  8274. }
  8275. return ret, nil
  8276. // {
  8277. // "description": "Retrieves the specified intent.",
  8278. // "flatPath": "v2/projects/{projectsId}/agent/intents/{intentsId}",
  8279. // "httpMethod": "GET",
  8280. // "id": "dialogflow.projects.agent.intents.get",
  8281. // "parameterOrder": [
  8282. // "name"
  8283. // ],
  8284. // "parameters": {
  8285. // "intentView": {
  8286. // "description": "Optional. The resource view to apply to the returned intent.",
  8287. // "enum": [
  8288. // "INTENT_VIEW_UNSPECIFIED",
  8289. // "INTENT_VIEW_FULL"
  8290. // ],
  8291. // "location": "query",
  8292. // "type": "string"
  8293. // },
  8294. // "languageCode": {
  8295. // "description": "Optional. The language to retrieve training phrases, parameters and rich\nmessages for. If not specified, the agent's default language is used.\n[More than a dozen\nlanguages](https://dialogflow.com/docs/reference/language) are supported.\nNote: languages must be enabled in the agent, before they can be used.",
  8296. // "location": "query",
  8297. // "type": "string"
  8298. // },
  8299. // "name": {
  8300. // "description": "Required. The name of the intent.\nFormat: `projects/\u003cProject ID\u003e/agent/intents/\u003cIntent ID\u003e`.",
  8301. // "location": "path",
  8302. // "pattern": "^projects/[^/]+/agent/intents/[^/]+$",
  8303. // "required": true,
  8304. // "type": "string"
  8305. // }
  8306. // },
  8307. // "path": "v2/{+name}",
  8308. // "response": {
  8309. // "$ref": "GoogleCloudDialogflowV2Intent"
  8310. // },
  8311. // "scopes": [
  8312. // "https://www.googleapis.com/auth/cloud-platform",
  8313. // "https://www.googleapis.com/auth/dialogflow"
  8314. // ]
  8315. // }
  8316. }
  8317. // method id "dialogflow.projects.agent.intents.list":
  8318. type ProjectsAgentIntentsListCall struct {
  8319. s *Service
  8320. parent string
  8321. urlParams_ gensupport.URLParams
  8322. ifNoneMatch_ string
  8323. ctx_ context.Context
  8324. header_ http.Header
  8325. }
  8326. // List: Returns the list of all intents in the specified agent.
  8327. func (r *ProjectsAgentIntentsService) List(parent string) *ProjectsAgentIntentsListCall {
  8328. c := &ProjectsAgentIntentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8329. c.parent = parent
  8330. return c
  8331. }
  8332. // IntentView sets the optional parameter "intentView": The resource
  8333. // view to apply to the returned intent.
  8334. //
  8335. // Possible values:
  8336. // "INTENT_VIEW_UNSPECIFIED"
  8337. // "INTENT_VIEW_FULL"
  8338. func (c *ProjectsAgentIntentsListCall) IntentView(intentView string) *ProjectsAgentIntentsListCall {
  8339. c.urlParams_.Set("intentView", intentView)
  8340. return c
  8341. }
  8342. // LanguageCode sets the optional parameter "languageCode": The language
  8343. // to list training phrases, parameters and rich
  8344. // messages for. If not specified, the agent's default language is
  8345. // used.
  8346. // [More than a
  8347. // dozen
  8348. // languages](https://dialogflow.com/docs/reference/language) are
  8349. // supported.
  8350. // Note: languages must be enabled in the agent before they can be used.
  8351. func (c *ProjectsAgentIntentsListCall) LanguageCode(languageCode string) *ProjectsAgentIntentsListCall {
  8352. c.urlParams_.Set("languageCode", languageCode)
  8353. return c
  8354. }
  8355. // PageSize sets the optional parameter "pageSize": The maximum number
  8356. // of items to return in a single page. By
  8357. // default 100 and at most 1000.
  8358. func (c *ProjectsAgentIntentsListCall) PageSize(pageSize int64) *ProjectsAgentIntentsListCall {
  8359. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  8360. return c
  8361. }
  8362. // PageToken sets the optional parameter "pageToken": The
  8363. // next_page_token value returned from a previous list request.
  8364. func (c *ProjectsAgentIntentsListCall) PageToken(pageToken string) *ProjectsAgentIntentsListCall {
  8365. c.urlParams_.Set("pageToken", pageToken)
  8366. return c
  8367. }
  8368. // Fields allows partial responses to be retrieved. See
  8369. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8370. // for more information.
  8371. func (c *ProjectsAgentIntentsListCall) Fields(s ...googleapi.Field) *ProjectsAgentIntentsListCall {
  8372. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8373. return c
  8374. }
  8375. // IfNoneMatch sets the optional parameter which makes the operation
  8376. // fail if the object's ETag matches the given value. This is useful for
  8377. // getting updates only after the object has changed since the last
  8378. // request. Use googleapi.IsNotModified to check whether the response
  8379. // error from Do is the result of In-None-Match.
  8380. func (c *ProjectsAgentIntentsListCall) IfNoneMatch(entityTag string) *ProjectsAgentIntentsListCall {
  8381. c.ifNoneMatch_ = entityTag
  8382. return c
  8383. }
  8384. // Context sets the context to be used in this call's Do method. Any
  8385. // pending HTTP request will be aborted if the provided context is
  8386. // canceled.
  8387. func (c *ProjectsAgentIntentsListCall) Context(ctx context.Context) *ProjectsAgentIntentsListCall {
  8388. c.ctx_ = ctx
  8389. return c
  8390. }
  8391. // Header returns an http.Header that can be modified by the caller to
  8392. // add HTTP headers to the request.
  8393. func (c *ProjectsAgentIntentsListCall) Header() http.Header {
  8394. if c.header_ == nil {
  8395. c.header_ = make(http.Header)
  8396. }
  8397. return c.header_
  8398. }
  8399. func (c *ProjectsAgentIntentsListCall) doRequest(alt string) (*http.Response, error) {
  8400. reqHeaders := make(http.Header)
  8401. for k, v := range c.header_ {
  8402. reqHeaders[k] = v
  8403. }
  8404. reqHeaders.Set("User-Agent", c.s.userAgent())
  8405. if c.ifNoneMatch_ != "" {
  8406. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8407. }
  8408. var body io.Reader = nil
  8409. c.urlParams_.Set("alt", alt)
  8410. c.urlParams_.Set("prettyPrint", "false")
  8411. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/intents")
  8412. urls += "?" + c.urlParams_.Encode()
  8413. req, err := http.NewRequest("GET", urls, body)
  8414. if err != nil {
  8415. return nil, err
  8416. }
  8417. req.Header = reqHeaders
  8418. googleapi.Expand(req.URL, map[string]string{
  8419. "parent": c.parent,
  8420. })
  8421. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8422. }
  8423. // Do executes the "dialogflow.projects.agent.intents.list" call.
  8424. // Exactly one of *GoogleCloudDialogflowV2ListIntentsResponse or error
  8425. // will be non-nil. Any non-2xx status code is an error. Response
  8426. // headers are in either
  8427. // *GoogleCloudDialogflowV2ListIntentsResponse.ServerResponse.Header or
  8428. // (if a response was returned at all) in
  8429. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8430. // whether the returned error was because http.StatusNotModified was
  8431. // returned.
  8432. func (c *ProjectsAgentIntentsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2ListIntentsResponse, error) {
  8433. gensupport.SetOptions(c.urlParams_, opts...)
  8434. res, err := c.doRequest("json")
  8435. if res != nil && res.StatusCode == http.StatusNotModified {
  8436. if res.Body != nil {
  8437. res.Body.Close()
  8438. }
  8439. return nil, &googleapi.Error{
  8440. Code: res.StatusCode,
  8441. Header: res.Header,
  8442. }
  8443. }
  8444. if err != nil {
  8445. return nil, err
  8446. }
  8447. defer googleapi.CloseBody(res)
  8448. if err := googleapi.CheckResponse(res); err != nil {
  8449. return nil, err
  8450. }
  8451. ret := &GoogleCloudDialogflowV2ListIntentsResponse{
  8452. ServerResponse: googleapi.ServerResponse{
  8453. Header: res.Header,
  8454. HTTPStatusCode: res.StatusCode,
  8455. },
  8456. }
  8457. target := &ret
  8458. if err := gensupport.DecodeResponse(target, res); err != nil {
  8459. return nil, err
  8460. }
  8461. return ret, nil
  8462. // {
  8463. // "description": "Returns the list of all intents in the specified agent.",
  8464. // "flatPath": "v2/projects/{projectsId}/agent/intents",
  8465. // "httpMethod": "GET",
  8466. // "id": "dialogflow.projects.agent.intents.list",
  8467. // "parameterOrder": [
  8468. // "parent"
  8469. // ],
  8470. // "parameters": {
  8471. // "intentView": {
  8472. // "description": "Optional. The resource view to apply to the returned intent.",
  8473. // "enum": [
  8474. // "INTENT_VIEW_UNSPECIFIED",
  8475. // "INTENT_VIEW_FULL"
  8476. // ],
  8477. // "location": "query",
  8478. // "type": "string"
  8479. // },
  8480. // "languageCode": {
  8481. // "description": "Optional. The language to list training phrases, parameters and rich\nmessages for. If not specified, the agent's default language is used.\n[More than a dozen\nlanguages](https://dialogflow.com/docs/reference/language) are supported.\nNote: languages must be enabled in the agent before they can be used.",
  8482. // "location": "query",
  8483. // "type": "string"
  8484. // },
  8485. // "pageSize": {
  8486. // "description": "Optional. The maximum number of items to return in a single page. By\ndefault 100 and at most 1000.",
  8487. // "format": "int32",
  8488. // "location": "query",
  8489. // "type": "integer"
  8490. // },
  8491. // "pageToken": {
  8492. // "description": "Optional. The next_page_token value returned from a previous list request.",
  8493. // "location": "query",
  8494. // "type": "string"
  8495. // },
  8496. // "parent": {
  8497. // "description": "Required. The agent to list all intents from.\nFormat: `projects/\u003cProject ID\u003e/agent`.",
  8498. // "location": "path",
  8499. // "pattern": "^projects/[^/]+/agent$",
  8500. // "required": true,
  8501. // "type": "string"
  8502. // }
  8503. // },
  8504. // "path": "v2/{+parent}/intents",
  8505. // "response": {
  8506. // "$ref": "GoogleCloudDialogflowV2ListIntentsResponse"
  8507. // },
  8508. // "scopes": [
  8509. // "https://www.googleapis.com/auth/cloud-platform",
  8510. // "https://www.googleapis.com/auth/dialogflow"
  8511. // ]
  8512. // }
  8513. }
  8514. // Pages invokes f for each page of results.
  8515. // A non-nil error returned from f will halt the iteration.
  8516. // The provided context supersedes any context provided to the Context method.
  8517. func (c *ProjectsAgentIntentsListCall) Pages(ctx context.Context, f func(*GoogleCloudDialogflowV2ListIntentsResponse) error) error {
  8518. c.ctx_ = ctx
  8519. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  8520. for {
  8521. x, err := c.Do()
  8522. if err != nil {
  8523. return err
  8524. }
  8525. if err := f(x); err != nil {
  8526. return err
  8527. }
  8528. if x.NextPageToken == "" {
  8529. return nil
  8530. }
  8531. c.PageToken(x.NextPageToken)
  8532. }
  8533. }
  8534. // method id "dialogflow.projects.agent.intents.patch":
  8535. type ProjectsAgentIntentsPatchCall struct {
  8536. s *Service
  8537. nameid string
  8538. googleclouddialogflowv2intent *GoogleCloudDialogflowV2Intent
  8539. urlParams_ gensupport.URLParams
  8540. ctx_ context.Context
  8541. header_ http.Header
  8542. }
  8543. // Patch: Updates the specified intent.
  8544. func (r *ProjectsAgentIntentsService) Patch(nameid string, googleclouddialogflowv2intent *GoogleCloudDialogflowV2Intent) *ProjectsAgentIntentsPatchCall {
  8545. c := &ProjectsAgentIntentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8546. c.nameid = nameid
  8547. c.googleclouddialogflowv2intent = googleclouddialogflowv2intent
  8548. return c
  8549. }
  8550. // IntentView sets the optional parameter "intentView": The resource
  8551. // view to apply to the returned intent.
  8552. //
  8553. // Possible values:
  8554. // "INTENT_VIEW_UNSPECIFIED"
  8555. // "INTENT_VIEW_FULL"
  8556. func (c *ProjectsAgentIntentsPatchCall) IntentView(intentView string) *ProjectsAgentIntentsPatchCall {
  8557. c.urlParams_.Set("intentView", intentView)
  8558. return c
  8559. }
  8560. // LanguageCode sets the optional parameter "languageCode": The language
  8561. // of training phrases, parameters and rich messages
  8562. // defined in `intent`. If not specified, the agent's default language
  8563. // is
  8564. // used. [More than a
  8565. // dozen
  8566. // languages](https://dialogflow.com/docs/reference/language) are
  8567. // supported.
  8568. // Note: languages must be enabled in the agent, before they can be
  8569. // used.
  8570. func (c *ProjectsAgentIntentsPatchCall) LanguageCode(languageCode string) *ProjectsAgentIntentsPatchCall {
  8571. c.urlParams_.Set("languageCode", languageCode)
  8572. return c
  8573. }
  8574. // UpdateMask sets the optional parameter "updateMask": The mask to
  8575. // control which fields get updated.
  8576. func (c *ProjectsAgentIntentsPatchCall) UpdateMask(updateMask string) *ProjectsAgentIntentsPatchCall {
  8577. c.urlParams_.Set("updateMask", updateMask)
  8578. return c
  8579. }
  8580. // Fields allows partial responses to be retrieved. See
  8581. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8582. // for more information.
  8583. func (c *ProjectsAgentIntentsPatchCall) Fields(s ...googleapi.Field) *ProjectsAgentIntentsPatchCall {
  8584. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8585. return c
  8586. }
  8587. // Context sets the context to be used in this call's Do method. Any
  8588. // pending HTTP request will be aborted if the provided context is
  8589. // canceled.
  8590. func (c *ProjectsAgentIntentsPatchCall) Context(ctx context.Context) *ProjectsAgentIntentsPatchCall {
  8591. c.ctx_ = ctx
  8592. return c
  8593. }
  8594. // Header returns an http.Header that can be modified by the caller to
  8595. // add HTTP headers to the request.
  8596. func (c *ProjectsAgentIntentsPatchCall) Header() http.Header {
  8597. if c.header_ == nil {
  8598. c.header_ = make(http.Header)
  8599. }
  8600. return c.header_
  8601. }
  8602. func (c *ProjectsAgentIntentsPatchCall) doRequest(alt string) (*http.Response, error) {
  8603. reqHeaders := make(http.Header)
  8604. for k, v := range c.header_ {
  8605. reqHeaders[k] = v
  8606. }
  8607. reqHeaders.Set("User-Agent", c.s.userAgent())
  8608. var body io.Reader = nil
  8609. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2intent)
  8610. if err != nil {
  8611. return nil, err
  8612. }
  8613. reqHeaders.Set("Content-Type", "application/json")
  8614. c.urlParams_.Set("alt", alt)
  8615. c.urlParams_.Set("prettyPrint", "false")
  8616. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  8617. urls += "?" + c.urlParams_.Encode()
  8618. req, err := http.NewRequest("PATCH", urls, body)
  8619. if err != nil {
  8620. return nil, err
  8621. }
  8622. req.Header = reqHeaders
  8623. googleapi.Expand(req.URL, map[string]string{
  8624. "name": c.nameid,
  8625. })
  8626. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8627. }
  8628. // Do executes the "dialogflow.projects.agent.intents.patch" call.
  8629. // Exactly one of *GoogleCloudDialogflowV2Intent or error will be
  8630. // non-nil. Any non-2xx status code is an error. Response headers are in
  8631. // either *GoogleCloudDialogflowV2Intent.ServerResponse.Header or (if a
  8632. // response was returned at all) in error.(*googleapi.Error).Header. Use
  8633. // googleapi.IsNotModified to check whether the returned error was
  8634. // because http.StatusNotModified was returned.
  8635. func (c *ProjectsAgentIntentsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2Intent, error) {
  8636. gensupport.SetOptions(c.urlParams_, opts...)
  8637. res, err := c.doRequest("json")
  8638. if res != nil && res.StatusCode == http.StatusNotModified {
  8639. if res.Body != nil {
  8640. res.Body.Close()
  8641. }
  8642. return nil, &googleapi.Error{
  8643. Code: res.StatusCode,
  8644. Header: res.Header,
  8645. }
  8646. }
  8647. if err != nil {
  8648. return nil, err
  8649. }
  8650. defer googleapi.CloseBody(res)
  8651. if err := googleapi.CheckResponse(res); err != nil {
  8652. return nil, err
  8653. }
  8654. ret := &GoogleCloudDialogflowV2Intent{
  8655. ServerResponse: googleapi.ServerResponse{
  8656. Header: res.Header,
  8657. HTTPStatusCode: res.StatusCode,
  8658. },
  8659. }
  8660. target := &ret
  8661. if err := gensupport.DecodeResponse(target, res); err != nil {
  8662. return nil, err
  8663. }
  8664. return ret, nil
  8665. // {
  8666. // "description": "Updates the specified intent.",
  8667. // "flatPath": "v2/projects/{projectsId}/agent/intents/{intentsId}",
  8668. // "httpMethod": "PATCH",
  8669. // "id": "dialogflow.projects.agent.intents.patch",
  8670. // "parameterOrder": [
  8671. // "name"
  8672. // ],
  8673. // "parameters": {
  8674. // "intentView": {
  8675. // "description": "Optional. The resource view to apply to the returned intent.",
  8676. // "enum": [
  8677. // "INTENT_VIEW_UNSPECIFIED",
  8678. // "INTENT_VIEW_FULL"
  8679. // ],
  8680. // "location": "query",
  8681. // "type": "string"
  8682. // },
  8683. // "languageCode": {
  8684. // "description": "Optional. The language of training phrases, parameters and rich messages\ndefined in `intent`. If not specified, the agent's default language is\nused. [More than a dozen\nlanguages](https://dialogflow.com/docs/reference/language) are supported.\nNote: languages must be enabled in the agent, before they can be used.",
  8685. // "location": "query",
  8686. // "type": "string"
  8687. // },
  8688. // "name": {
  8689. // "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`.",
  8690. // "location": "path",
  8691. // "pattern": "^projects/[^/]+/agent/intents/[^/]+$",
  8692. // "required": true,
  8693. // "type": "string"
  8694. // },
  8695. // "updateMask": {
  8696. // "description": "Optional. The mask to control which fields get updated.",
  8697. // "format": "google-fieldmask",
  8698. // "location": "query",
  8699. // "type": "string"
  8700. // }
  8701. // },
  8702. // "path": "v2/{+name}",
  8703. // "request": {
  8704. // "$ref": "GoogleCloudDialogflowV2Intent"
  8705. // },
  8706. // "response": {
  8707. // "$ref": "GoogleCloudDialogflowV2Intent"
  8708. // },
  8709. // "scopes": [
  8710. // "https://www.googleapis.com/auth/cloud-platform",
  8711. // "https://www.googleapis.com/auth/dialogflow"
  8712. // ]
  8713. // }
  8714. }
  8715. // method id "dialogflow.projects.agent.sessions.deleteContexts":
  8716. type ProjectsAgentSessionsDeleteContextsCall struct {
  8717. s *Service
  8718. parent string
  8719. urlParams_ gensupport.URLParams
  8720. ctx_ context.Context
  8721. header_ http.Header
  8722. }
  8723. // DeleteContexts: Deletes all active contexts in the specified session.
  8724. func (r *ProjectsAgentSessionsService) DeleteContexts(parent string) *ProjectsAgentSessionsDeleteContextsCall {
  8725. c := &ProjectsAgentSessionsDeleteContextsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8726. c.parent = parent
  8727. return c
  8728. }
  8729. // Fields allows partial responses to be retrieved. See
  8730. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8731. // for more information.
  8732. func (c *ProjectsAgentSessionsDeleteContextsCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsDeleteContextsCall {
  8733. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8734. return c
  8735. }
  8736. // Context sets the context to be used in this call's Do method. Any
  8737. // pending HTTP request will be aborted if the provided context is
  8738. // canceled.
  8739. func (c *ProjectsAgentSessionsDeleteContextsCall) Context(ctx context.Context) *ProjectsAgentSessionsDeleteContextsCall {
  8740. c.ctx_ = ctx
  8741. return c
  8742. }
  8743. // Header returns an http.Header that can be modified by the caller to
  8744. // add HTTP headers to the request.
  8745. func (c *ProjectsAgentSessionsDeleteContextsCall) Header() http.Header {
  8746. if c.header_ == nil {
  8747. c.header_ = make(http.Header)
  8748. }
  8749. return c.header_
  8750. }
  8751. func (c *ProjectsAgentSessionsDeleteContextsCall) doRequest(alt string) (*http.Response, error) {
  8752. reqHeaders := make(http.Header)
  8753. for k, v := range c.header_ {
  8754. reqHeaders[k] = v
  8755. }
  8756. reqHeaders.Set("User-Agent", c.s.userAgent())
  8757. var body io.Reader = nil
  8758. c.urlParams_.Set("alt", alt)
  8759. c.urlParams_.Set("prettyPrint", "false")
  8760. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/contexts")
  8761. urls += "?" + c.urlParams_.Encode()
  8762. req, err := http.NewRequest("DELETE", urls, body)
  8763. if err != nil {
  8764. return nil, err
  8765. }
  8766. req.Header = reqHeaders
  8767. googleapi.Expand(req.URL, map[string]string{
  8768. "parent": c.parent,
  8769. })
  8770. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8771. }
  8772. // Do executes the "dialogflow.projects.agent.sessions.deleteContexts" call.
  8773. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  8774. // non-2xx status code is an error. Response headers are in either
  8775. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  8776. // returned at all) in error.(*googleapi.Error).Header. Use
  8777. // googleapi.IsNotModified to check whether the returned error was
  8778. // because http.StatusNotModified was returned.
  8779. func (c *ProjectsAgentSessionsDeleteContextsCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  8780. gensupport.SetOptions(c.urlParams_, opts...)
  8781. res, err := c.doRequest("json")
  8782. if res != nil && res.StatusCode == http.StatusNotModified {
  8783. if res.Body != nil {
  8784. res.Body.Close()
  8785. }
  8786. return nil, &googleapi.Error{
  8787. Code: res.StatusCode,
  8788. Header: res.Header,
  8789. }
  8790. }
  8791. if err != nil {
  8792. return nil, err
  8793. }
  8794. defer googleapi.CloseBody(res)
  8795. if err := googleapi.CheckResponse(res); err != nil {
  8796. return nil, err
  8797. }
  8798. ret := &GoogleProtobufEmpty{
  8799. ServerResponse: googleapi.ServerResponse{
  8800. Header: res.Header,
  8801. HTTPStatusCode: res.StatusCode,
  8802. },
  8803. }
  8804. target := &ret
  8805. if err := gensupport.DecodeResponse(target, res); err != nil {
  8806. return nil, err
  8807. }
  8808. return ret, nil
  8809. // {
  8810. // "description": "Deletes all active contexts in the specified session.",
  8811. // "flatPath": "v2/projects/{projectsId}/agent/sessions/{sessionsId}/contexts",
  8812. // "httpMethod": "DELETE",
  8813. // "id": "dialogflow.projects.agent.sessions.deleteContexts",
  8814. // "parameterOrder": [
  8815. // "parent"
  8816. // ],
  8817. // "parameters": {
  8818. // "parent": {
  8819. // "description": "Required. The name of the session to delete all contexts from. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e`.",
  8820. // "location": "path",
  8821. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+$",
  8822. // "required": true,
  8823. // "type": "string"
  8824. // }
  8825. // },
  8826. // "path": "v2/{+parent}/contexts",
  8827. // "response": {
  8828. // "$ref": "GoogleProtobufEmpty"
  8829. // },
  8830. // "scopes": [
  8831. // "https://www.googleapis.com/auth/cloud-platform",
  8832. // "https://www.googleapis.com/auth/dialogflow"
  8833. // ]
  8834. // }
  8835. }
  8836. // method id "dialogflow.projects.agent.sessions.detectIntent":
  8837. type ProjectsAgentSessionsDetectIntentCall struct {
  8838. s *Service
  8839. sessionid string
  8840. googleclouddialogflowv2detectintentrequest *GoogleCloudDialogflowV2DetectIntentRequest
  8841. urlParams_ gensupport.URLParams
  8842. ctx_ context.Context
  8843. header_ http.Header
  8844. }
  8845. // DetectIntent: Processes a natural language query and returns
  8846. // structured, actionable data
  8847. // as a result. This method is not idempotent, because it may cause
  8848. // contexts
  8849. // and session entity types to be updated, which in turn might
  8850. // affect
  8851. // results of future queries.
  8852. func (r *ProjectsAgentSessionsService) DetectIntent(sessionid string, googleclouddialogflowv2detectintentrequest *GoogleCloudDialogflowV2DetectIntentRequest) *ProjectsAgentSessionsDetectIntentCall {
  8853. c := &ProjectsAgentSessionsDetectIntentCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8854. c.sessionid = sessionid
  8855. c.googleclouddialogflowv2detectintentrequest = googleclouddialogflowv2detectintentrequest
  8856. return c
  8857. }
  8858. // Fields allows partial responses to be retrieved. See
  8859. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8860. // for more information.
  8861. func (c *ProjectsAgentSessionsDetectIntentCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsDetectIntentCall {
  8862. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8863. return c
  8864. }
  8865. // Context sets the context to be used in this call's Do method. Any
  8866. // pending HTTP request will be aborted if the provided context is
  8867. // canceled.
  8868. func (c *ProjectsAgentSessionsDetectIntentCall) Context(ctx context.Context) *ProjectsAgentSessionsDetectIntentCall {
  8869. c.ctx_ = ctx
  8870. return c
  8871. }
  8872. // Header returns an http.Header that can be modified by the caller to
  8873. // add HTTP headers to the request.
  8874. func (c *ProjectsAgentSessionsDetectIntentCall) Header() http.Header {
  8875. if c.header_ == nil {
  8876. c.header_ = make(http.Header)
  8877. }
  8878. return c.header_
  8879. }
  8880. func (c *ProjectsAgentSessionsDetectIntentCall) doRequest(alt string) (*http.Response, error) {
  8881. reqHeaders := make(http.Header)
  8882. for k, v := range c.header_ {
  8883. reqHeaders[k] = v
  8884. }
  8885. reqHeaders.Set("User-Agent", c.s.userAgent())
  8886. var body io.Reader = nil
  8887. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2detectintentrequest)
  8888. if err != nil {
  8889. return nil, err
  8890. }
  8891. reqHeaders.Set("Content-Type", "application/json")
  8892. c.urlParams_.Set("alt", alt)
  8893. c.urlParams_.Set("prettyPrint", "false")
  8894. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+session}:detectIntent")
  8895. urls += "?" + c.urlParams_.Encode()
  8896. req, err := http.NewRequest("POST", urls, body)
  8897. if err != nil {
  8898. return nil, err
  8899. }
  8900. req.Header = reqHeaders
  8901. googleapi.Expand(req.URL, map[string]string{
  8902. "session": c.sessionid,
  8903. })
  8904. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8905. }
  8906. // Do executes the "dialogflow.projects.agent.sessions.detectIntent" call.
  8907. // Exactly one of *GoogleCloudDialogflowV2DetectIntentResponse or error
  8908. // will be non-nil. Any non-2xx status code is an error. Response
  8909. // headers are in either
  8910. // *GoogleCloudDialogflowV2DetectIntentResponse.ServerResponse.Header or
  8911. // (if a response was returned at all) in
  8912. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8913. // whether the returned error was because http.StatusNotModified was
  8914. // returned.
  8915. func (c *ProjectsAgentSessionsDetectIntentCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2DetectIntentResponse, error) {
  8916. gensupport.SetOptions(c.urlParams_, opts...)
  8917. res, err := c.doRequest("json")
  8918. if res != nil && res.StatusCode == http.StatusNotModified {
  8919. if res.Body != nil {
  8920. res.Body.Close()
  8921. }
  8922. return nil, &googleapi.Error{
  8923. Code: res.StatusCode,
  8924. Header: res.Header,
  8925. }
  8926. }
  8927. if err != nil {
  8928. return nil, err
  8929. }
  8930. defer googleapi.CloseBody(res)
  8931. if err := googleapi.CheckResponse(res); err != nil {
  8932. return nil, err
  8933. }
  8934. ret := &GoogleCloudDialogflowV2DetectIntentResponse{
  8935. ServerResponse: googleapi.ServerResponse{
  8936. Header: res.Header,
  8937. HTTPStatusCode: res.StatusCode,
  8938. },
  8939. }
  8940. target := &ret
  8941. if err := gensupport.DecodeResponse(target, res); err != nil {
  8942. return nil, err
  8943. }
  8944. return ret, nil
  8945. // {
  8946. // "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.",
  8947. // "flatPath": "v2/projects/{projectsId}/agent/sessions/{sessionsId}:detectIntent",
  8948. // "httpMethod": "POST",
  8949. // "id": "dialogflow.projects.agent.sessions.detectIntent",
  8950. // "parameterOrder": [
  8951. // "session"
  8952. // ],
  8953. // "parameters": {
  8954. // "session": {
  8955. // "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.",
  8956. // "location": "path",
  8957. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+$",
  8958. // "required": true,
  8959. // "type": "string"
  8960. // }
  8961. // },
  8962. // "path": "v2/{+session}:detectIntent",
  8963. // "request": {
  8964. // "$ref": "GoogleCloudDialogflowV2DetectIntentRequest"
  8965. // },
  8966. // "response": {
  8967. // "$ref": "GoogleCloudDialogflowV2DetectIntentResponse"
  8968. // },
  8969. // "scopes": [
  8970. // "https://www.googleapis.com/auth/cloud-platform",
  8971. // "https://www.googleapis.com/auth/dialogflow"
  8972. // ]
  8973. // }
  8974. }
  8975. // method id "dialogflow.projects.agent.sessions.contexts.create":
  8976. type ProjectsAgentSessionsContextsCreateCall struct {
  8977. s *Service
  8978. parent string
  8979. googleclouddialogflowv2context *GoogleCloudDialogflowV2Context
  8980. urlParams_ gensupport.URLParams
  8981. ctx_ context.Context
  8982. header_ http.Header
  8983. }
  8984. // Create: Creates a context.
  8985. //
  8986. // If the specified context already exists, overrides the context.
  8987. func (r *ProjectsAgentSessionsContextsService) Create(parent string, googleclouddialogflowv2context *GoogleCloudDialogflowV2Context) *ProjectsAgentSessionsContextsCreateCall {
  8988. c := &ProjectsAgentSessionsContextsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8989. c.parent = parent
  8990. c.googleclouddialogflowv2context = googleclouddialogflowv2context
  8991. return c
  8992. }
  8993. // Fields allows partial responses to be retrieved. See
  8994. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8995. // for more information.
  8996. func (c *ProjectsAgentSessionsContextsCreateCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsContextsCreateCall {
  8997. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8998. return c
  8999. }
  9000. // Context sets the context to be used in this call's Do method. Any
  9001. // pending HTTP request will be aborted if the provided context is
  9002. // canceled.
  9003. func (c *ProjectsAgentSessionsContextsCreateCall) Context(ctx context.Context) *ProjectsAgentSessionsContextsCreateCall {
  9004. c.ctx_ = ctx
  9005. return c
  9006. }
  9007. // Header returns an http.Header that can be modified by the caller to
  9008. // add HTTP headers to the request.
  9009. func (c *ProjectsAgentSessionsContextsCreateCall) Header() http.Header {
  9010. if c.header_ == nil {
  9011. c.header_ = make(http.Header)
  9012. }
  9013. return c.header_
  9014. }
  9015. func (c *ProjectsAgentSessionsContextsCreateCall) doRequest(alt string) (*http.Response, error) {
  9016. reqHeaders := make(http.Header)
  9017. for k, v := range c.header_ {
  9018. reqHeaders[k] = v
  9019. }
  9020. reqHeaders.Set("User-Agent", c.s.userAgent())
  9021. var body io.Reader = nil
  9022. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2context)
  9023. if err != nil {
  9024. return nil, err
  9025. }
  9026. reqHeaders.Set("Content-Type", "application/json")
  9027. c.urlParams_.Set("alt", alt)
  9028. c.urlParams_.Set("prettyPrint", "false")
  9029. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/contexts")
  9030. urls += "?" + c.urlParams_.Encode()
  9031. req, err := http.NewRequest("POST", urls, body)
  9032. if err != nil {
  9033. return nil, err
  9034. }
  9035. req.Header = reqHeaders
  9036. googleapi.Expand(req.URL, map[string]string{
  9037. "parent": c.parent,
  9038. })
  9039. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9040. }
  9041. // Do executes the "dialogflow.projects.agent.sessions.contexts.create" call.
  9042. // Exactly one of *GoogleCloudDialogflowV2Context or error will be
  9043. // non-nil. Any non-2xx status code is an error. Response headers are in
  9044. // either *GoogleCloudDialogflowV2Context.ServerResponse.Header or (if a
  9045. // response was returned at all) in error.(*googleapi.Error).Header. Use
  9046. // googleapi.IsNotModified to check whether the returned error was
  9047. // because http.StatusNotModified was returned.
  9048. func (c *ProjectsAgentSessionsContextsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2Context, error) {
  9049. gensupport.SetOptions(c.urlParams_, opts...)
  9050. res, err := c.doRequest("json")
  9051. if res != nil && res.StatusCode == http.StatusNotModified {
  9052. if res.Body != nil {
  9053. res.Body.Close()
  9054. }
  9055. return nil, &googleapi.Error{
  9056. Code: res.StatusCode,
  9057. Header: res.Header,
  9058. }
  9059. }
  9060. if err != nil {
  9061. return nil, err
  9062. }
  9063. defer googleapi.CloseBody(res)
  9064. if err := googleapi.CheckResponse(res); err != nil {
  9065. return nil, err
  9066. }
  9067. ret := &GoogleCloudDialogflowV2Context{
  9068. ServerResponse: googleapi.ServerResponse{
  9069. Header: res.Header,
  9070. HTTPStatusCode: res.StatusCode,
  9071. },
  9072. }
  9073. target := &ret
  9074. if err := gensupport.DecodeResponse(target, res); err != nil {
  9075. return nil, err
  9076. }
  9077. return ret, nil
  9078. // {
  9079. // "description": "Creates a context.\n\nIf the specified context already exists, overrides the context.",
  9080. // "flatPath": "v2/projects/{projectsId}/agent/sessions/{sessionsId}/contexts",
  9081. // "httpMethod": "POST",
  9082. // "id": "dialogflow.projects.agent.sessions.contexts.create",
  9083. // "parameterOrder": [
  9084. // "parent"
  9085. // ],
  9086. // "parameters": {
  9087. // "parent": {
  9088. // "description": "Required. The session to create a context for.\nFormat: `projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e`.",
  9089. // "location": "path",
  9090. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+$",
  9091. // "required": true,
  9092. // "type": "string"
  9093. // }
  9094. // },
  9095. // "path": "v2/{+parent}/contexts",
  9096. // "request": {
  9097. // "$ref": "GoogleCloudDialogflowV2Context"
  9098. // },
  9099. // "response": {
  9100. // "$ref": "GoogleCloudDialogflowV2Context"
  9101. // },
  9102. // "scopes": [
  9103. // "https://www.googleapis.com/auth/cloud-platform",
  9104. // "https://www.googleapis.com/auth/dialogflow"
  9105. // ]
  9106. // }
  9107. }
  9108. // method id "dialogflow.projects.agent.sessions.contexts.delete":
  9109. type ProjectsAgentSessionsContextsDeleteCall struct {
  9110. s *Service
  9111. name string
  9112. urlParams_ gensupport.URLParams
  9113. ctx_ context.Context
  9114. header_ http.Header
  9115. }
  9116. // Delete: Deletes the specified context.
  9117. func (r *ProjectsAgentSessionsContextsService) Delete(name string) *ProjectsAgentSessionsContextsDeleteCall {
  9118. c := &ProjectsAgentSessionsContextsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9119. c.name = name
  9120. return c
  9121. }
  9122. // Fields allows partial responses to be retrieved. See
  9123. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9124. // for more information.
  9125. func (c *ProjectsAgentSessionsContextsDeleteCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsContextsDeleteCall {
  9126. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9127. return c
  9128. }
  9129. // Context sets the context to be used in this call's Do method. Any
  9130. // pending HTTP request will be aborted if the provided context is
  9131. // canceled.
  9132. func (c *ProjectsAgentSessionsContextsDeleteCall) Context(ctx context.Context) *ProjectsAgentSessionsContextsDeleteCall {
  9133. c.ctx_ = ctx
  9134. return c
  9135. }
  9136. // Header returns an http.Header that can be modified by the caller to
  9137. // add HTTP headers to the request.
  9138. func (c *ProjectsAgentSessionsContextsDeleteCall) Header() http.Header {
  9139. if c.header_ == nil {
  9140. c.header_ = make(http.Header)
  9141. }
  9142. return c.header_
  9143. }
  9144. func (c *ProjectsAgentSessionsContextsDeleteCall) doRequest(alt string) (*http.Response, error) {
  9145. reqHeaders := make(http.Header)
  9146. for k, v := range c.header_ {
  9147. reqHeaders[k] = v
  9148. }
  9149. reqHeaders.Set("User-Agent", c.s.userAgent())
  9150. var body io.Reader = nil
  9151. c.urlParams_.Set("alt", alt)
  9152. c.urlParams_.Set("prettyPrint", "false")
  9153. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  9154. urls += "?" + c.urlParams_.Encode()
  9155. req, err := http.NewRequest("DELETE", urls, body)
  9156. if err != nil {
  9157. return nil, err
  9158. }
  9159. req.Header = reqHeaders
  9160. googleapi.Expand(req.URL, map[string]string{
  9161. "name": c.name,
  9162. })
  9163. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9164. }
  9165. // Do executes the "dialogflow.projects.agent.sessions.contexts.delete" call.
  9166. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  9167. // non-2xx status code is an error. Response headers are in either
  9168. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  9169. // returned at all) in error.(*googleapi.Error).Header. Use
  9170. // googleapi.IsNotModified to check whether the returned error was
  9171. // because http.StatusNotModified was returned.
  9172. func (c *ProjectsAgentSessionsContextsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  9173. gensupport.SetOptions(c.urlParams_, opts...)
  9174. res, err := c.doRequest("json")
  9175. if res != nil && res.StatusCode == http.StatusNotModified {
  9176. if res.Body != nil {
  9177. res.Body.Close()
  9178. }
  9179. return nil, &googleapi.Error{
  9180. Code: res.StatusCode,
  9181. Header: res.Header,
  9182. }
  9183. }
  9184. if err != nil {
  9185. return nil, err
  9186. }
  9187. defer googleapi.CloseBody(res)
  9188. if err := googleapi.CheckResponse(res); err != nil {
  9189. return nil, err
  9190. }
  9191. ret := &GoogleProtobufEmpty{
  9192. ServerResponse: googleapi.ServerResponse{
  9193. Header: res.Header,
  9194. HTTPStatusCode: res.StatusCode,
  9195. },
  9196. }
  9197. target := &ret
  9198. if err := gensupport.DecodeResponse(target, res); err != nil {
  9199. return nil, err
  9200. }
  9201. return ret, nil
  9202. // {
  9203. // "description": "Deletes the specified context.",
  9204. // "flatPath": "v2/projects/{projectsId}/agent/sessions/{sessionsId}/contexts/{contextsId}",
  9205. // "httpMethod": "DELETE",
  9206. // "id": "dialogflow.projects.agent.sessions.contexts.delete",
  9207. // "parameterOrder": [
  9208. // "name"
  9209. // ],
  9210. // "parameters": {
  9211. // "name": {
  9212. // "description": "Required. The name of the context to delete. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e/contexts/\u003cContext ID\u003e`.",
  9213. // "location": "path",
  9214. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+/contexts/[^/]+$",
  9215. // "required": true,
  9216. // "type": "string"
  9217. // }
  9218. // },
  9219. // "path": "v2/{+name}",
  9220. // "response": {
  9221. // "$ref": "GoogleProtobufEmpty"
  9222. // },
  9223. // "scopes": [
  9224. // "https://www.googleapis.com/auth/cloud-platform",
  9225. // "https://www.googleapis.com/auth/dialogflow"
  9226. // ]
  9227. // }
  9228. }
  9229. // method id "dialogflow.projects.agent.sessions.contexts.get":
  9230. type ProjectsAgentSessionsContextsGetCall struct {
  9231. s *Service
  9232. name string
  9233. urlParams_ gensupport.URLParams
  9234. ifNoneMatch_ string
  9235. ctx_ context.Context
  9236. header_ http.Header
  9237. }
  9238. // Get: Retrieves the specified context.
  9239. func (r *ProjectsAgentSessionsContextsService) Get(name string) *ProjectsAgentSessionsContextsGetCall {
  9240. c := &ProjectsAgentSessionsContextsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9241. c.name = name
  9242. return c
  9243. }
  9244. // Fields allows partial responses to be retrieved. See
  9245. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9246. // for more information.
  9247. func (c *ProjectsAgentSessionsContextsGetCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsContextsGetCall {
  9248. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9249. return c
  9250. }
  9251. // IfNoneMatch sets the optional parameter which makes the operation
  9252. // fail if the object's ETag matches the given value. This is useful for
  9253. // getting updates only after the object has changed since the last
  9254. // request. Use googleapi.IsNotModified to check whether the response
  9255. // error from Do is the result of In-None-Match.
  9256. func (c *ProjectsAgentSessionsContextsGetCall) IfNoneMatch(entityTag string) *ProjectsAgentSessionsContextsGetCall {
  9257. c.ifNoneMatch_ = entityTag
  9258. return c
  9259. }
  9260. // Context sets the context to be used in this call's Do method. Any
  9261. // pending HTTP request will be aborted if the provided context is
  9262. // canceled.
  9263. func (c *ProjectsAgentSessionsContextsGetCall) Context(ctx context.Context) *ProjectsAgentSessionsContextsGetCall {
  9264. c.ctx_ = ctx
  9265. return c
  9266. }
  9267. // Header returns an http.Header that can be modified by the caller to
  9268. // add HTTP headers to the request.
  9269. func (c *ProjectsAgentSessionsContextsGetCall) Header() http.Header {
  9270. if c.header_ == nil {
  9271. c.header_ = make(http.Header)
  9272. }
  9273. return c.header_
  9274. }
  9275. func (c *ProjectsAgentSessionsContextsGetCall) doRequest(alt string) (*http.Response, error) {
  9276. reqHeaders := make(http.Header)
  9277. for k, v := range c.header_ {
  9278. reqHeaders[k] = v
  9279. }
  9280. reqHeaders.Set("User-Agent", c.s.userAgent())
  9281. if c.ifNoneMatch_ != "" {
  9282. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9283. }
  9284. var body io.Reader = nil
  9285. c.urlParams_.Set("alt", alt)
  9286. c.urlParams_.Set("prettyPrint", "false")
  9287. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  9288. urls += "?" + c.urlParams_.Encode()
  9289. req, err := http.NewRequest("GET", urls, body)
  9290. if err != nil {
  9291. return nil, err
  9292. }
  9293. req.Header = reqHeaders
  9294. googleapi.Expand(req.URL, map[string]string{
  9295. "name": c.name,
  9296. })
  9297. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9298. }
  9299. // Do executes the "dialogflow.projects.agent.sessions.contexts.get" call.
  9300. // Exactly one of *GoogleCloudDialogflowV2Context or error will be
  9301. // non-nil. Any non-2xx status code is an error. Response headers are in
  9302. // either *GoogleCloudDialogflowV2Context.ServerResponse.Header or (if a
  9303. // response was returned at all) in error.(*googleapi.Error).Header. Use
  9304. // googleapi.IsNotModified to check whether the returned error was
  9305. // because http.StatusNotModified was returned.
  9306. func (c *ProjectsAgentSessionsContextsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2Context, error) {
  9307. gensupport.SetOptions(c.urlParams_, opts...)
  9308. res, err := c.doRequest("json")
  9309. if res != nil && res.StatusCode == http.StatusNotModified {
  9310. if res.Body != nil {
  9311. res.Body.Close()
  9312. }
  9313. return nil, &googleapi.Error{
  9314. Code: res.StatusCode,
  9315. Header: res.Header,
  9316. }
  9317. }
  9318. if err != nil {
  9319. return nil, err
  9320. }
  9321. defer googleapi.CloseBody(res)
  9322. if err := googleapi.CheckResponse(res); err != nil {
  9323. return nil, err
  9324. }
  9325. ret := &GoogleCloudDialogflowV2Context{
  9326. ServerResponse: googleapi.ServerResponse{
  9327. Header: res.Header,
  9328. HTTPStatusCode: res.StatusCode,
  9329. },
  9330. }
  9331. target := &ret
  9332. if err := gensupport.DecodeResponse(target, res); err != nil {
  9333. return nil, err
  9334. }
  9335. return ret, nil
  9336. // {
  9337. // "description": "Retrieves the specified context.",
  9338. // "flatPath": "v2/projects/{projectsId}/agent/sessions/{sessionsId}/contexts/{contextsId}",
  9339. // "httpMethod": "GET",
  9340. // "id": "dialogflow.projects.agent.sessions.contexts.get",
  9341. // "parameterOrder": [
  9342. // "name"
  9343. // ],
  9344. // "parameters": {
  9345. // "name": {
  9346. // "description": "Required. The name of the context. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e/contexts/\u003cContext ID\u003e`.",
  9347. // "location": "path",
  9348. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+/contexts/[^/]+$",
  9349. // "required": true,
  9350. // "type": "string"
  9351. // }
  9352. // },
  9353. // "path": "v2/{+name}",
  9354. // "response": {
  9355. // "$ref": "GoogleCloudDialogflowV2Context"
  9356. // },
  9357. // "scopes": [
  9358. // "https://www.googleapis.com/auth/cloud-platform",
  9359. // "https://www.googleapis.com/auth/dialogflow"
  9360. // ]
  9361. // }
  9362. }
  9363. // method id "dialogflow.projects.agent.sessions.contexts.list":
  9364. type ProjectsAgentSessionsContextsListCall struct {
  9365. s *Service
  9366. parent string
  9367. urlParams_ gensupport.URLParams
  9368. ifNoneMatch_ string
  9369. ctx_ context.Context
  9370. header_ http.Header
  9371. }
  9372. // List: Returns the list of all contexts in the specified session.
  9373. func (r *ProjectsAgentSessionsContextsService) List(parent string) *ProjectsAgentSessionsContextsListCall {
  9374. c := &ProjectsAgentSessionsContextsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9375. c.parent = parent
  9376. return c
  9377. }
  9378. // PageSize sets the optional parameter "pageSize": The maximum number
  9379. // of items to return in a single page. By
  9380. // default 100 and at most 1000.
  9381. func (c *ProjectsAgentSessionsContextsListCall) PageSize(pageSize int64) *ProjectsAgentSessionsContextsListCall {
  9382. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  9383. return c
  9384. }
  9385. // PageToken sets the optional parameter "pageToken": The
  9386. // next_page_token value returned from a previous list request.
  9387. func (c *ProjectsAgentSessionsContextsListCall) PageToken(pageToken string) *ProjectsAgentSessionsContextsListCall {
  9388. c.urlParams_.Set("pageToken", pageToken)
  9389. return c
  9390. }
  9391. // Fields allows partial responses to be retrieved. See
  9392. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9393. // for more information.
  9394. func (c *ProjectsAgentSessionsContextsListCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsContextsListCall {
  9395. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9396. return c
  9397. }
  9398. // IfNoneMatch sets the optional parameter which makes the operation
  9399. // fail if the object's ETag matches the given value. This is useful for
  9400. // getting updates only after the object has changed since the last
  9401. // request. Use googleapi.IsNotModified to check whether the response
  9402. // error from Do is the result of In-None-Match.
  9403. func (c *ProjectsAgentSessionsContextsListCall) IfNoneMatch(entityTag string) *ProjectsAgentSessionsContextsListCall {
  9404. c.ifNoneMatch_ = entityTag
  9405. return c
  9406. }
  9407. // Context sets the context to be used in this call's Do method. Any
  9408. // pending HTTP request will be aborted if the provided context is
  9409. // canceled.
  9410. func (c *ProjectsAgentSessionsContextsListCall) Context(ctx context.Context) *ProjectsAgentSessionsContextsListCall {
  9411. c.ctx_ = ctx
  9412. return c
  9413. }
  9414. // Header returns an http.Header that can be modified by the caller to
  9415. // add HTTP headers to the request.
  9416. func (c *ProjectsAgentSessionsContextsListCall) Header() http.Header {
  9417. if c.header_ == nil {
  9418. c.header_ = make(http.Header)
  9419. }
  9420. return c.header_
  9421. }
  9422. func (c *ProjectsAgentSessionsContextsListCall) doRequest(alt string) (*http.Response, error) {
  9423. reqHeaders := make(http.Header)
  9424. for k, v := range c.header_ {
  9425. reqHeaders[k] = v
  9426. }
  9427. reqHeaders.Set("User-Agent", c.s.userAgent())
  9428. if c.ifNoneMatch_ != "" {
  9429. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9430. }
  9431. var body io.Reader = nil
  9432. c.urlParams_.Set("alt", alt)
  9433. c.urlParams_.Set("prettyPrint", "false")
  9434. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/contexts")
  9435. urls += "?" + c.urlParams_.Encode()
  9436. req, err := http.NewRequest("GET", urls, body)
  9437. if err != nil {
  9438. return nil, err
  9439. }
  9440. req.Header = reqHeaders
  9441. googleapi.Expand(req.URL, map[string]string{
  9442. "parent": c.parent,
  9443. })
  9444. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9445. }
  9446. // Do executes the "dialogflow.projects.agent.sessions.contexts.list" call.
  9447. // Exactly one of *GoogleCloudDialogflowV2ListContextsResponse or error
  9448. // will be non-nil. Any non-2xx status code is an error. Response
  9449. // headers are in either
  9450. // *GoogleCloudDialogflowV2ListContextsResponse.ServerResponse.Header or
  9451. // (if a response was returned at all) in
  9452. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9453. // whether the returned error was because http.StatusNotModified was
  9454. // returned.
  9455. func (c *ProjectsAgentSessionsContextsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2ListContextsResponse, error) {
  9456. gensupport.SetOptions(c.urlParams_, opts...)
  9457. res, err := c.doRequest("json")
  9458. if res != nil && res.StatusCode == http.StatusNotModified {
  9459. if res.Body != nil {
  9460. res.Body.Close()
  9461. }
  9462. return nil, &googleapi.Error{
  9463. Code: res.StatusCode,
  9464. Header: res.Header,
  9465. }
  9466. }
  9467. if err != nil {
  9468. return nil, err
  9469. }
  9470. defer googleapi.CloseBody(res)
  9471. if err := googleapi.CheckResponse(res); err != nil {
  9472. return nil, err
  9473. }
  9474. ret := &GoogleCloudDialogflowV2ListContextsResponse{
  9475. ServerResponse: googleapi.ServerResponse{
  9476. Header: res.Header,
  9477. HTTPStatusCode: res.StatusCode,
  9478. },
  9479. }
  9480. target := &ret
  9481. if err := gensupport.DecodeResponse(target, res); err != nil {
  9482. return nil, err
  9483. }
  9484. return ret, nil
  9485. // {
  9486. // "description": "Returns the list of all contexts in the specified session.",
  9487. // "flatPath": "v2/projects/{projectsId}/agent/sessions/{sessionsId}/contexts",
  9488. // "httpMethod": "GET",
  9489. // "id": "dialogflow.projects.agent.sessions.contexts.list",
  9490. // "parameterOrder": [
  9491. // "parent"
  9492. // ],
  9493. // "parameters": {
  9494. // "pageSize": {
  9495. // "description": "Optional. The maximum number of items to return in a single page. By\ndefault 100 and at most 1000.",
  9496. // "format": "int32",
  9497. // "location": "query",
  9498. // "type": "integer"
  9499. // },
  9500. // "pageToken": {
  9501. // "description": "Optional. The next_page_token value returned from a previous list request.",
  9502. // "location": "query",
  9503. // "type": "string"
  9504. // },
  9505. // "parent": {
  9506. // "description": "Required. The session to list all contexts from.\nFormat: `projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e`.",
  9507. // "location": "path",
  9508. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+$",
  9509. // "required": true,
  9510. // "type": "string"
  9511. // }
  9512. // },
  9513. // "path": "v2/{+parent}/contexts",
  9514. // "response": {
  9515. // "$ref": "GoogleCloudDialogflowV2ListContextsResponse"
  9516. // },
  9517. // "scopes": [
  9518. // "https://www.googleapis.com/auth/cloud-platform",
  9519. // "https://www.googleapis.com/auth/dialogflow"
  9520. // ]
  9521. // }
  9522. }
  9523. // Pages invokes f for each page of results.
  9524. // A non-nil error returned from f will halt the iteration.
  9525. // The provided context supersedes any context provided to the Context method.
  9526. func (c *ProjectsAgentSessionsContextsListCall) Pages(ctx context.Context, f func(*GoogleCloudDialogflowV2ListContextsResponse) error) error {
  9527. c.ctx_ = ctx
  9528. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  9529. for {
  9530. x, err := c.Do()
  9531. if err != nil {
  9532. return err
  9533. }
  9534. if err := f(x); err != nil {
  9535. return err
  9536. }
  9537. if x.NextPageToken == "" {
  9538. return nil
  9539. }
  9540. c.PageToken(x.NextPageToken)
  9541. }
  9542. }
  9543. // method id "dialogflow.projects.agent.sessions.contexts.patch":
  9544. type ProjectsAgentSessionsContextsPatchCall struct {
  9545. s *Service
  9546. nameid string
  9547. googleclouddialogflowv2context *GoogleCloudDialogflowV2Context
  9548. urlParams_ gensupport.URLParams
  9549. ctx_ context.Context
  9550. header_ http.Header
  9551. }
  9552. // Patch: Updates the specified context.
  9553. func (r *ProjectsAgentSessionsContextsService) Patch(nameid string, googleclouddialogflowv2context *GoogleCloudDialogflowV2Context) *ProjectsAgentSessionsContextsPatchCall {
  9554. c := &ProjectsAgentSessionsContextsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9555. c.nameid = nameid
  9556. c.googleclouddialogflowv2context = googleclouddialogflowv2context
  9557. return c
  9558. }
  9559. // UpdateMask sets the optional parameter "updateMask": The mask to
  9560. // control which fields get updated.
  9561. func (c *ProjectsAgentSessionsContextsPatchCall) UpdateMask(updateMask string) *ProjectsAgentSessionsContextsPatchCall {
  9562. c.urlParams_.Set("updateMask", updateMask)
  9563. return c
  9564. }
  9565. // Fields allows partial responses to be retrieved. See
  9566. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9567. // for more information.
  9568. func (c *ProjectsAgentSessionsContextsPatchCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsContextsPatchCall {
  9569. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9570. return c
  9571. }
  9572. // Context sets the context to be used in this call's Do method. Any
  9573. // pending HTTP request will be aborted if the provided context is
  9574. // canceled.
  9575. func (c *ProjectsAgentSessionsContextsPatchCall) Context(ctx context.Context) *ProjectsAgentSessionsContextsPatchCall {
  9576. c.ctx_ = ctx
  9577. return c
  9578. }
  9579. // Header returns an http.Header that can be modified by the caller to
  9580. // add HTTP headers to the request.
  9581. func (c *ProjectsAgentSessionsContextsPatchCall) Header() http.Header {
  9582. if c.header_ == nil {
  9583. c.header_ = make(http.Header)
  9584. }
  9585. return c.header_
  9586. }
  9587. func (c *ProjectsAgentSessionsContextsPatchCall) doRequest(alt string) (*http.Response, error) {
  9588. reqHeaders := make(http.Header)
  9589. for k, v := range c.header_ {
  9590. reqHeaders[k] = v
  9591. }
  9592. reqHeaders.Set("User-Agent", c.s.userAgent())
  9593. var body io.Reader = nil
  9594. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2context)
  9595. if err != nil {
  9596. return nil, err
  9597. }
  9598. reqHeaders.Set("Content-Type", "application/json")
  9599. c.urlParams_.Set("alt", alt)
  9600. c.urlParams_.Set("prettyPrint", "false")
  9601. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  9602. urls += "?" + c.urlParams_.Encode()
  9603. req, err := http.NewRequest("PATCH", urls, body)
  9604. if err != nil {
  9605. return nil, err
  9606. }
  9607. req.Header = reqHeaders
  9608. googleapi.Expand(req.URL, map[string]string{
  9609. "name": c.nameid,
  9610. })
  9611. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9612. }
  9613. // Do executes the "dialogflow.projects.agent.sessions.contexts.patch" call.
  9614. // Exactly one of *GoogleCloudDialogflowV2Context or error will be
  9615. // non-nil. Any non-2xx status code is an error. Response headers are in
  9616. // either *GoogleCloudDialogflowV2Context.ServerResponse.Header or (if a
  9617. // response was returned at all) in error.(*googleapi.Error).Header. Use
  9618. // googleapi.IsNotModified to check whether the returned error was
  9619. // because http.StatusNotModified was returned.
  9620. func (c *ProjectsAgentSessionsContextsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2Context, error) {
  9621. gensupport.SetOptions(c.urlParams_, opts...)
  9622. res, err := c.doRequest("json")
  9623. if res != nil && res.StatusCode == http.StatusNotModified {
  9624. if res.Body != nil {
  9625. res.Body.Close()
  9626. }
  9627. return nil, &googleapi.Error{
  9628. Code: res.StatusCode,
  9629. Header: res.Header,
  9630. }
  9631. }
  9632. if err != nil {
  9633. return nil, err
  9634. }
  9635. defer googleapi.CloseBody(res)
  9636. if err := googleapi.CheckResponse(res); err != nil {
  9637. return nil, err
  9638. }
  9639. ret := &GoogleCloudDialogflowV2Context{
  9640. ServerResponse: googleapi.ServerResponse{
  9641. Header: res.Header,
  9642. HTTPStatusCode: res.StatusCode,
  9643. },
  9644. }
  9645. target := &ret
  9646. if err := gensupport.DecodeResponse(target, res); err != nil {
  9647. return nil, err
  9648. }
  9649. return ret, nil
  9650. // {
  9651. // "description": "Updates the specified context.",
  9652. // "flatPath": "v2/projects/{projectsId}/agent/sessions/{sessionsId}/contexts/{contextsId}",
  9653. // "httpMethod": "PATCH",
  9654. // "id": "dialogflow.projects.agent.sessions.contexts.patch",
  9655. // "parameterOrder": [
  9656. // "name"
  9657. // ],
  9658. // "parameters": {
  9659. // "name": {
  9660. // "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.",
  9661. // "location": "path",
  9662. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+/contexts/[^/]+$",
  9663. // "required": true,
  9664. // "type": "string"
  9665. // },
  9666. // "updateMask": {
  9667. // "description": "Optional. The mask to control which fields get updated.",
  9668. // "format": "google-fieldmask",
  9669. // "location": "query",
  9670. // "type": "string"
  9671. // }
  9672. // },
  9673. // "path": "v2/{+name}",
  9674. // "request": {
  9675. // "$ref": "GoogleCloudDialogflowV2Context"
  9676. // },
  9677. // "response": {
  9678. // "$ref": "GoogleCloudDialogflowV2Context"
  9679. // },
  9680. // "scopes": [
  9681. // "https://www.googleapis.com/auth/cloud-platform",
  9682. // "https://www.googleapis.com/auth/dialogflow"
  9683. // ]
  9684. // }
  9685. }
  9686. // method id "dialogflow.projects.agent.sessions.entityTypes.create":
  9687. type ProjectsAgentSessionsEntityTypesCreateCall struct {
  9688. s *Service
  9689. parent string
  9690. googleclouddialogflowv2sessionentitytype *GoogleCloudDialogflowV2SessionEntityType
  9691. urlParams_ gensupport.URLParams
  9692. ctx_ context.Context
  9693. header_ http.Header
  9694. }
  9695. // Create: Creates a session entity type.
  9696. //
  9697. // If the specified session entity type already exists, overrides the
  9698. // session
  9699. // entity type.
  9700. func (r *ProjectsAgentSessionsEntityTypesService) Create(parent string, googleclouddialogflowv2sessionentitytype *GoogleCloudDialogflowV2SessionEntityType) *ProjectsAgentSessionsEntityTypesCreateCall {
  9701. c := &ProjectsAgentSessionsEntityTypesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9702. c.parent = parent
  9703. c.googleclouddialogflowv2sessionentitytype = googleclouddialogflowv2sessionentitytype
  9704. return c
  9705. }
  9706. // Fields allows partial responses to be retrieved. See
  9707. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9708. // for more information.
  9709. func (c *ProjectsAgentSessionsEntityTypesCreateCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsEntityTypesCreateCall {
  9710. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9711. return c
  9712. }
  9713. // Context sets the context to be used in this call's Do method. Any
  9714. // pending HTTP request will be aborted if the provided context is
  9715. // canceled.
  9716. func (c *ProjectsAgentSessionsEntityTypesCreateCall) Context(ctx context.Context) *ProjectsAgentSessionsEntityTypesCreateCall {
  9717. c.ctx_ = ctx
  9718. return c
  9719. }
  9720. // Header returns an http.Header that can be modified by the caller to
  9721. // add HTTP headers to the request.
  9722. func (c *ProjectsAgentSessionsEntityTypesCreateCall) Header() http.Header {
  9723. if c.header_ == nil {
  9724. c.header_ = make(http.Header)
  9725. }
  9726. return c.header_
  9727. }
  9728. func (c *ProjectsAgentSessionsEntityTypesCreateCall) doRequest(alt string) (*http.Response, error) {
  9729. reqHeaders := make(http.Header)
  9730. for k, v := range c.header_ {
  9731. reqHeaders[k] = v
  9732. }
  9733. reqHeaders.Set("User-Agent", c.s.userAgent())
  9734. var body io.Reader = nil
  9735. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2sessionentitytype)
  9736. if err != nil {
  9737. return nil, err
  9738. }
  9739. reqHeaders.Set("Content-Type", "application/json")
  9740. c.urlParams_.Set("alt", alt)
  9741. c.urlParams_.Set("prettyPrint", "false")
  9742. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/entityTypes")
  9743. urls += "?" + c.urlParams_.Encode()
  9744. req, err := http.NewRequest("POST", urls, body)
  9745. if err != nil {
  9746. return nil, err
  9747. }
  9748. req.Header = reqHeaders
  9749. googleapi.Expand(req.URL, map[string]string{
  9750. "parent": c.parent,
  9751. })
  9752. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9753. }
  9754. // Do executes the "dialogflow.projects.agent.sessions.entityTypes.create" call.
  9755. // Exactly one of *GoogleCloudDialogflowV2SessionEntityType or error
  9756. // will be non-nil. Any non-2xx status code is an error. Response
  9757. // headers are in either
  9758. // *GoogleCloudDialogflowV2SessionEntityType.ServerResponse.Header or
  9759. // (if a response was returned at all) in
  9760. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9761. // whether the returned error was because http.StatusNotModified was
  9762. // returned.
  9763. func (c *ProjectsAgentSessionsEntityTypesCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2SessionEntityType, error) {
  9764. gensupport.SetOptions(c.urlParams_, opts...)
  9765. res, err := c.doRequest("json")
  9766. if res != nil && res.StatusCode == http.StatusNotModified {
  9767. if res.Body != nil {
  9768. res.Body.Close()
  9769. }
  9770. return nil, &googleapi.Error{
  9771. Code: res.StatusCode,
  9772. Header: res.Header,
  9773. }
  9774. }
  9775. if err != nil {
  9776. return nil, err
  9777. }
  9778. defer googleapi.CloseBody(res)
  9779. if err := googleapi.CheckResponse(res); err != nil {
  9780. return nil, err
  9781. }
  9782. ret := &GoogleCloudDialogflowV2SessionEntityType{
  9783. ServerResponse: googleapi.ServerResponse{
  9784. Header: res.Header,
  9785. HTTPStatusCode: res.StatusCode,
  9786. },
  9787. }
  9788. target := &ret
  9789. if err := gensupport.DecodeResponse(target, res); err != nil {
  9790. return nil, err
  9791. }
  9792. return ret, nil
  9793. // {
  9794. // "description": "Creates a session entity type.\n\nIf the specified session entity type already exists, overrides the session\nentity type.",
  9795. // "flatPath": "v2/projects/{projectsId}/agent/sessions/{sessionsId}/entityTypes",
  9796. // "httpMethod": "POST",
  9797. // "id": "dialogflow.projects.agent.sessions.entityTypes.create",
  9798. // "parameterOrder": [
  9799. // "parent"
  9800. // ],
  9801. // "parameters": {
  9802. // "parent": {
  9803. // "description": "Required. The session to create a session entity type for.\nFormat: `projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e`.",
  9804. // "location": "path",
  9805. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+$",
  9806. // "required": true,
  9807. // "type": "string"
  9808. // }
  9809. // },
  9810. // "path": "v2/{+parent}/entityTypes",
  9811. // "request": {
  9812. // "$ref": "GoogleCloudDialogflowV2SessionEntityType"
  9813. // },
  9814. // "response": {
  9815. // "$ref": "GoogleCloudDialogflowV2SessionEntityType"
  9816. // },
  9817. // "scopes": [
  9818. // "https://www.googleapis.com/auth/cloud-platform",
  9819. // "https://www.googleapis.com/auth/dialogflow"
  9820. // ]
  9821. // }
  9822. }
  9823. // method id "dialogflow.projects.agent.sessions.entityTypes.delete":
  9824. type ProjectsAgentSessionsEntityTypesDeleteCall struct {
  9825. s *Service
  9826. name string
  9827. urlParams_ gensupport.URLParams
  9828. ctx_ context.Context
  9829. header_ http.Header
  9830. }
  9831. // Delete: Deletes the specified session entity type.
  9832. func (r *ProjectsAgentSessionsEntityTypesService) Delete(name string) *ProjectsAgentSessionsEntityTypesDeleteCall {
  9833. c := &ProjectsAgentSessionsEntityTypesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9834. c.name = name
  9835. return c
  9836. }
  9837. // Fields allows partial responses to be retrieved. See
  9838. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9839. // for more information.
  9840. func (c *ProjectsAgentSessionsEntityTypesDeleteCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsEntityTypesDeleteCall {
  9841. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9842. return c
  9843. }
  9844. // Context sets the context to be used in this call's Do method. Any
  9845. // pending HTTP request will be aborted if the provided context is
  9846. // canceled.
  9847. func (c *ProjectsAgentSessionsEntityTypesDeleteCall) Context(ctx context.Context) *ProjectsAgentSessionsEntityTypesDeleteCall {
  9848. c.ctx_ = ctx
  9849. return c
  9850. }
  9851. // Header returns an http.Header that can be modified by the caller to
  9852. // add HTTP headers to the request.
  9853. func (c *ProjectsAgentSessionsEntityTypesDeleteCall) Header() http.Header {
  9854. if c.header_ == nil {
  9855. c.header_ = make(http.Header)
  9856. }
  9857. return c.header_
  9858. }
  9859. func (c *ProjectsAgentSessionsEntityTypesDeleteCall) doRequest(alt string) (*http.Response, error) {
  9860. reqHeaders := make(http.Header)
  9861. for k, v := range c.header_ {
  9862. reqHeaders[k] = v
  9863. }
  9864. reqHeaders.Set("User-Agent", c.s.userAgent())
  9865. var body io.Reader = nil
  9866. c.urlParams_.Set("alt", alt)
  9867. c.urlParams_.Set("prettyPrint", "false")
  9868. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  9869. urls += "?" + c.urlParams_.Encode()
  9870. req, err := http.NewRequest("DELETE", urls, body)
  9871. if err != nil {
  9872. return nil, err
  9873. }
  9874. req.Header = reqHeaders
  9875. googleapi.Expand(req.URL, map[string]string{
  9876. "name": c.name,
  9877. })
  9878. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9879. }
  9880. // Do executes the "dialogflow.projects.agent.sessions.entityTypes.delete" call.
  9881. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  9882. // non-2xx status code is an error. Response headers are in either
  9883. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  9884. // returned at all) in error.(*googleapi.Error).Header. Use
  9885. // googleapi.IsNotModified to check whether the returned error was
  9886. // because http.StatusNotModified was returned.
  9887. func (c *ProjectsAgentSessionsEntityTypesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  9888. gensupport.SetOptions(c.urlParams_, opts...)
  9889. res, err := c.doRequest("json")
  9890. if res != nil && res.StatusCode == http.StatusNotModified {
  9891. if res.Body != nil {
  9892. res.Body.Close()
  9893. }
  9894. return nil, &googleapi.Error{
  9895. Code: res.StatusCode,
  9896. Header: res.Header,
  9897. }
  9898. }
  9899. if err != nil {
  9900. return nil, err
  9901. }
  9902. defer googleapi.CloseBody(res)
  9903. if err := googleapi.CheckResponse(res); err != nil {
  9904. return nil, err
  9905. }
  9906. ret := &GoogleProtobufEmpty{
  9907. ServerResponse: googleapi.ServerResponse{
  9908. Header: res.Header,
  9909. HTTPStatusCode: res.StatusCode,
  9910. },
  9911. }
  9912. target := &ret
  9913. if err := gensupport.DecodeResponse(target, res); err != nil {
  9914. return nil, err
  9915. }
  9916. return ret, nil
  9917. // {
  9918. // "description": "Deletes the specified session entity type.",
  9919. // "flatPath": "v2/projects/{projectsId}/agent/sessions/{sessionsId}/entityTypes/{entityTypesId}",
  9920. // "httpMethod": "DELETE",
  9921. // "id": "dialogflow.projects.agent.sessions.entityTypes.delete",
  9922. // "parameterOrder": [
  9923. // "name"
  9924. // ],
  9925. // "parameters": {
  9926. // "name": {
  9927. // "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`.",
  9928. // "location": "path",
  9929. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+/entityTypes/[^/]+$",
  9930. // "required": true,
  9931. // "type": "string"
  9932. // }
  9933. // },
  9934. // "path": "v2/{+name}",
  9935. // "response": {
  9936. // "$ref": "GoogleProtobufEmpty"
  9937. // },
  9938. // "scopes": [
  9939. // "https://www.googleapis.com/auth/cloud-platform",
  9940. // "https://www.googleapis.com/auth/dialogflow"
  9941. // ]
  9942. // }
  9943. }
  9944. // method id "dialogflow.projects.agent.sessions.entityTypes.get":
  9945. type ProjectsAgentSessionsEntityTypesGetCall struct {
  9946. s *Service
  9947. name string
  9948. urlParams_ gensupport.URLParams
  9949. ifNoneMatch_ string
  9950. ctx_ context.Context
  9951. header_ http.Header
  9952. }
  9953. // Get: Retrieves the specified session entity type.
  9954. func (r *ProjectsAgentSessionsEntityTypesService) Get(name string) *ProjectsAgentSessionsEntityTypesGetCall {
  9955. c := &ProjectsAgentSessionsEntityTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9956. c.name = name
  9957. return c
  9958. }
  9959. // Fields allows partial responses to be retrieved. See
  9960. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9961. // for more information.
  9962. func (c *ProjectsAgentSessionsEntityTypesGetCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsEntityTypesGetCall {
  9963. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9964. return c
  9965. }
  9966. // IfNoneMatch sets the optional parameter which makes the operation
  9967. // fail if the object's ETag matches the given value. This is useful for
  9968. // getting updates only after the object has changed since the last
  9969. // request. Use googleapi.IsNotModified to check whether the response
  9970. // error from Do is the result of In-None-Match.
  9971. func (c *ProjectsAgentSessionsEntityTypesGetCall) IfNoneMatch(entityTag string) *ProjectsAgentSessionsEntityTypesGetCall {
  9972. c.ifNoneMatch_ = entityTag
  9973. return c
  9974. }
  9975. // Context sets the context to be used in this call's Do method. Any
  9976. // pending HTTP request will be aborted if the provided context is
  9977. // canceled.
  9978. func (c *ProjectsAgentSessionsEntityTypesGetCall) Context(ctx context.Context) *ProjectsAgentSessionsEntityTypesGetCall {
  9979. c.ctx_ = ctx
  9980. return c
  9981. }
  9982. // Header returns an http.Header that can be modified by the caller to
  9983. // add HTTP headers to the request.
  9984. func (c *ProjectsAgentSessionsEntityTypesGetCall) Header() http.Header {
  9985. if c.header_ == nil {
  9986. c.header_ = make(http.Header)
  9987. }
  9988. return c.header_
  9989. }
  9990. func (c *ProjectsAgentSessionsEntityTypesGetCall) doRequest(alt string) (*http.Response, error) {
  9991. reqHeaders := make(http.Header)
  9992. for k, v := range c.header_ {
  9993. reqHeaders[k] = v
  9994. }
  9995. reqHeaders.Set("User-Agent", c.s.userAgent())
  9996. if c.ifNoneMatch_ != "" {
  9997. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9998. }
  9999. var body io.Reader = nil
  10000. c.urlParams_.Set("alt", alt)
  10001. c.urlParams_.Set("prettyPrint", "false")
  10002. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  10003. urls += "?" + c.urlParams_.Encode()
  10004. req, err := http.NewRequest("GET", urls, body)
  10005. if err != nil {
  10006. return nil, err
  10007. }
  10008. req.Header = reqHeaders
  10009. googleapi.Expand(req.URL, map[string]string{
  10010. "name": c.name,
  10011. })
  10012. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10013. }
  10014. // Do executes the "dialogflow.projects.agent.sessions.entityTypes.get" call.
  10015. // Exactly one of *GoogleCloudDialogflowV2SessionEntityType or error
  10016. // will be non-nil. Any non-2xx status code is an error. Response
  10017. // headers are in either
  10018. // *GoogleCloudDialogflowV2SessionEntityType.ServerResponse.Header or
  10019. // (if a response was returned at all) in
  10020. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  10021. // whether the returned error was because http.StatusNotModified was
  10022. // returned.
  10023. func (c *ProjectsAgentSessionsEntityTypesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2SessionEntityType, error) {
  10024. gensupport.SetOptions(c.urlParams_, opts...)
  10025. res, err := c.doRequest("json")
  10026. if res != nil && res.StatusCode == http.StatusNotModified {
  10027. if res.Body != nil {
  10028. res.Body.Close()
  10029. }
  10030. return nil, &googleapi.Error{
  10031. Code: res.StatusCode,
  10032. Header: res.Header,
  10033. }
  10034. }
  10035. if err != nil {
  10036. return nil, err
  10037. }
  10038. defer googleapi.CloseBody(res)
  10039. if err := googleapi.CheckResponse(res); err != nil {
  10040. return nil, err
  10041. }
  10042. ret := &GoogleCloudDialogflowV2SessionEntityType{
  10043. ServerResponse: googleapi.ServerResponse{
  10044. Header: res.Header,
  10045. HTTPStatusCode: res.StatusCode,
  10046. },
  10047. }
  10048. target := &ret
  10049. if err := gensupport.DecodeResponse(target, res); err != nil {
  10050. return nil, err
  10051. }
  10052. return ret, nil
  10053. // {
  10054. // "description": "Retrieves the specified session entity type.",
  10055. // "flatPath": "v2/projects/{projectsId}/agent/sessions/{sessionsId}/entityTypes/{entityTypesId}",
  10056. // "httpMethod": "GET",
  10057. // "id": "dialogflow.projects.agent.sessions.entityTypes.get",
  10058. // "parameterOrder": [
  10059. // "name"
  10060. // ],
  10061. // "parameters": {
  10062. // "name": {
  10063. // "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`.",
  10064. // "location": "path",
  10065. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+/entityTypes/[^/]+$",
  10066. // "required": true,
  10067. // "type": "string"
  10068. // }
  10069. // },
  10070. // "path": "v2/{+name}",
  10071. // "response": {
  10072. // "$ref": "GoogleCloudDialogflowV2SessionEntityType"
  10073. // },
  10074. // "scopes": [
  10075. // "https://www.googleapis.com/auth/cloud-platform",
  10076. // "https://www.googleapis.com/auth/dialogflow"
  10077. // ]
  10078. // }
  10079. }
  10080. // method id "dialogflow.projects.agent.sessions.entityTypes.list":
  10081. type ProjectsAgentSessionsEntityTypesListCall struct {
  10082. s *Service
  10083. parent string
  10084. urlParams_ gensupport.URLParams
  10085. ifNoneMatch_ string
  10086. ctx_ context.Context
  10087. header_ http.Header
  10088. }
  10089. // List: Returns the list of all session entity types in the specified
  10090. // session.
  10091. func (r *ProjectsAgentSessionsEntityTypesService) List(parent string) *ProjectsAgentSessionsEntityTypesListCall {
  10092. c := &ProjectsAgentSessionsEntityTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10093. c.parent = parent
  10094. return c
  10095. }
  10096. // PageSize sets the optional parameter "pageSize": The maximum number
  10097. // of items to return in a single page. By
  10098. // default 100 and at most 1000.
  10099. func (c *ProjectsAgentSessionsEntityTypesListCall) PageSize(pageSize int64) *ProjectsAgentSessionsEntityTypesListCall {
  10100. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  10101. return c
  10102. }
  10103. // PageToken sets the optional parameter "pageToken": The
  10104. // next_page_token value returned from a previous list request.
  10105. func (c *ProjectsAgentSessionsEntityTypesListCall) PageToken(pageToken string) *ProjectsAgentSessionsEntityTypesListCall {
  10106. c.urlParams_.Set("pageToken", pageToken)
  10107. return c
  10108. }
  10109. // Fields allows partial responses to be retrieved. See
  10110. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10111. // for more information.
  10112. func (c *ProjectsAgentSessionsEntityTypesListCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsEntityTypesListCall {
  10113. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10114. return c
  10115. }
  10116. // IfNoneMatch sets the optional parameter which makes the operation
  10117. // fail if the object's ETag matches the given value. This is useful for
  10118. // getting updates only after the object has changed since the last
  10119. // request. Use googleapi.IsNotModified to check whether the response
  10120. // error from Do is the result of In-None-Match.
  10121. func (c *ProjectsAgentSessionsEntityTypesListCall) IfNoneMatch(entityTag string) *ProjectsAgentSessionsEntityTypesListCall {
  10122. c.ifNoneMatch_ = entityTag
  10123. return c
  10124. }
  10125. // Context sets the context to be used in this call's Do method. Any
  10126. // pending HTTP request will be aborted if the provided context is
  10127. // canceled.
  10128. func (c *ProjectsAgentSessionsEntityTypesListCall) Context(ctx context.Context) *ProjectsAgentSessionsEntityTypesListCall {
  10129. c.ctx_ = ctx
  10130. return c
  10131. }
  10132. // Header returns an http.Header that can be modified by the caller to
  10133. // add HTTP headers to the request.
  10134. func (c *ProjectsAgentSessionsEntityTypesListCall) Header() http.Header {
  10135. if c.header_ == nil {
  10136. c.header_ = make(http.Header)
  10137. }
  10138. return c.header_
  10139. }
  10140. func (c *ProjectsAgentSessionsEntityTypesListCall) doRequest(alt string) (*http.Response, error) {
  10141. reqHeaders := make(http.Header)
  10142. for k, v := range c.header_ {
  10143. reqHeaders[k] = v
  10144. }
  10145. reqHeaders.Set("User-Agent", c.s.userAgent())
  10146. if c.ifNoneMatch_ != "" {
  10147. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10148. }
  10149. var body io.Reader = nil
  10150. c.urlParams_.Set("alt", alt)
  10151. c.urlParams_.Set("prettyPrint", "false")
  10152. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/entityTypes")
  10153. urls += "?" + c.urlParams_.Encode()
  10154. req, err := http.NewRequest("GET", urls, body)
  10155. if err != nil {
  10156. return nil, err
  10157. }
  10158. req.Header = reqHeaders
  10159. googleapi.Expand(req.URL, map[string]string{
  10160. "parent": c.parent,
  10161. })
  10162. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10163. }
  10164. // Do executes the "dialogflow.projects.agent.sessions.entityTypes.list" call.
  10165. // Exactly one of *GoogleCloudDialogflowV2ListSessionEntityTypesResponse
  10166. // or error will be non-nil. Any non-2xx status code is an error.
  10167. // Response headers are in either
  10168. // *GoogleCloudDialogflowV2ListSessionEntityTypesResponse.ServerResponse.
  10169. // Header or (if a response was returned at all) in
  10170. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  10171. // whether the returned error was because http.StatusNotModified was
  10172. // returned.
  10173. func (c *ProjectsAgentSessionsEntityTypesListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2ListSessionEntityTypesResponse, error) {
  10174. gensupport.SetOptions(c.urlParams_, opts...)
  10175. res, err := c.doRequest("json")
  10176. if res != nil && res.StatusCode == http.StatusNotModified {
  10177. if res.Body != nil {
  10178. res.Body.Close()
  10179. }
  10180. return nil, &googleapi.Error{
  10181. Code: res.StatusCode,
  10182. Header: res.Header,
  10183. }
  10184. }
  10185. if err != nil {
  10186. return nil, err
  10187. }
  10188. defer googleapi.CloseBody(res)
  10189. if err := googleapi.CheckResponse(res); err != nil {
  10190. return nil, err
  10191. }
  10192. ret := &GoogleCloudDialogflowV2ListSessionEntityTypesResponse{
  10193. ServerResponse: googleapi.ServerResponse{
  10194. Header: res.Header,
  10195. HTTPStatusCode: res.StatusCode,
  10196. },
  10197. }
  10198. target := &ret
  10199. if err := gensupport.DecodeResponse(target, res); err != nil {
  10200. return nil, err
  10201. }
  10202. return ret, nil
  10203. // {
  10204. // "description": "Returns the list of all session entity types in the specified session.",
  10205. // "flatPath": "v2/projects/{projectsId}/agent/sessions/{sessionsId}/entityTypes",
  10206. // "httpMethod": "GET",
  10207. // "id": "dialogflow.projects.agent.sessions.entityTypes.list",
  10208. // "parameterOrder": [
  10209. // "parent"
  10210. // ],
  10211. // "parameters": {
  10212. // "pageSize": {
  10213. // "description": "Optional. The maximum number of items to return in a single page. By\ndefault 100 and at most 1000.",
  10214. // "format": "int32",
  10215. // "location": "query",
  10216. // "type": "integer"
  10217. // },
  10218. // "pageToken": {
  10219. // "description": "Optional. The next_page_token value returned from a previous list request.",
  10220. // "location": "query",
  10221. // "type": "string"
  10222. // },
  10223. // "parent": {
  10224. // "description": "Required. The session to list all session entity types from.\nFormat: `projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e`.",
  10225. // "location": "path",
  10226. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+$",
  10227. // "required": true,
  10228. // "type": "string"
  10229. // }
  10230. // },
  10231. // "path": "v2/{+parent}/entityTypes",
  10232. // "response": {
  10233. // "$ref": "GoogleCloudDialogflowV2ListSessionEntityTypesResponse"
  10234. // },
  10235. // "scopes": [
  10236. // "https://www.googleapis.com/auth/cloud-platform",
  10237. // "https://www.googleapis.com/auth/dialogflow"
  10238. // ]
  10239. // }
  10240. }
  10241. // Pages invokes f for each page of results.
  10242. // A non-nil error returned from f will halt the iteration.
  10243. // The provided context supersedes any context provided to the Context method.
  10244. func (c *ProjectsAgentSessionsEntityTypesListCall) Pages(ctx context.Context, f func(*GoogleCloudDialogflowV2ListSessionEntityTypesResponse) error) error {
  10245. c.ctx_ = ctx
  10246. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  10247. for {
  10248. x, err := c.Do()
  10249. if err != nil {
  10250. return err
  10251. }
  10252. if err := f(x); err != nil {
  10253. return err
  10254. }
  10255. if x.NextPageToken == "" {
  10256. return nil
  10257. }
  10258. c.PageToken(x.NextPageToken)
  10259. }
  10260. }
  10261. // method id "dialogflow.projects.agent.sessions.entityTypes.patch":
  10262. type ProjectsAgentSessionsEntityTypesPatchCall struct {
  10263. s *Service
  10264. nameid string
  10265. googleclouddialogflowv2sessionentitytype *GoogleCloudDialogflowV2SessionEntityType
  10266. urlParams_ gensupport.URLParams
  10267. ctx_ context.Context
  10268. header_ http.Header
  10269. }
  10270. // Patch: Updates the specified session entity type.
  10271. func (r *ProjectsAgentSessionsEntityTypesService) Patch(nameid string, googleclouddialogflowv2sessionentitytype *GoogleCloudDialogflowV2SessionEntityType) *ProjectsAgentSessionsEntityTypesPatchCall {
  10272. c := &ProjectsAgentSessionsEntityTypesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10273. c.nameid = nameid
  10274. c.googleclouddialogflowv2sessionentitytype = googleclouddialogflowv2sessionentitytype
  10275. return c
  10276. }
  10277. // UpdateMask sets the optional parameter "updateMask": The mask to
  10278. // control which fields get updated.
  10279. func (c *ProjectsAgentSessionsEntityTypesPatchCall) UpdateMask(updateMask string) *ProjectsAgentSessionsEntityTypesPatchCall {
  10280. c.urlParams_.Set("updateMask", updateMask)
  10281. return c
  10282. }
  10283. // Fields allows partial responses to be retrieved. See
  10284. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10285. // for more information.
  10286. func (c *ProjectsAgentSessionsEntityTypesPatchCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsEntityTypesPatchCall {
  10287. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10288. return c
  10289. }
  10290. // Context sets the context to be used in this call's Do method. Any
  10291. // pending HTTP request will be aborted if the provided context is
  10292. // canceled.
  10293. func (c *ProjectsAgentSessionsEntityTypesPatchCall) Context(ctx context.Context) *ProjectsAgentSessionsEntityTypesPatchCall {
  10294. c.ctx_ = ctx
  10295. return c
  10296. }
  10297. // Header returns an http.Header that can be modified by the caller to
  10298. // add HTTP headers to the request.
  10299. func (c *ProjectsAgentSessionsEntityTypesPatchCall) Header() http.Header {
  10300. if c.header_ == nil {
  10301. c.header_ = make(http.Header)
  10302. }
  10303. return c.header_
  10304. }
  10305. func (c *ProjectsAgentSessionsEntityTypesPatchCall) doRequest(alt string) (*http.Response, error) {
  10306. reqHeaders := make(http.Header)
  10307. for k, v := range c.header_ {
  10308. reqHeaders[k] = v
  10309. }
  10310. reqHeaders.Set("User-Agent", c.s.userAgent())
  10311. var body io.Reader = nil
  10312. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2sessionentitytype)
  10313. if err != nil {
  10314. return nil, err
  10315. }
  10316. reqHeaders.Set("Content-Type", "application/json")
  10317. c.urlParams_.Set("alt", alt)
  10318. c.urlParams_.Set("prettyPrint", "false")
  10319. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  10320. urls += "?" + c.urlParams_.Encode()
  10321. req, err := http.NewRequest("PATCH", urls, body)
  10322. if err != nil {
  10323. return nil, err
  10324. }
  10325. req.Header = reqHeaders
  10326. googleapi.Expand(req.URL, map[string]string{
  10327. "name": c.nameid,
  10328. })
  10329. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10330. }
  10331. // Do executes the "dialogflow.projects.agent.sessions.entityTypes.patch" call.
  10332. // Exactly one of *GoogleCloudDialogflowV2SessionEntityType or error
  10333. // will be non-nil. Any non-2xx status code is an error. Response
  10334. // headers are in either
  10335. // *GoogleCloudDialogflowV2SessionEntityType.ServerResponse.Header or
  10336. // (if a response was returned at all) in
  10337. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  10338. // whether the returned error was because http.StatusNotModified was
  10339. // returned.
  10340. func (c *ProjectsAgentSessionsEntityTypesPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2SessionEntityType, error) {
  10341. gensupport.SetOptions(c.urlParams_, opts...)
  10342. res, err := c.doRequest("json")
  10343. if res != nil && res.StatusCode == http.StatusNotModified {
  10344. if res.Body != nil {
  10345. res.Body.Close()
  10346. }
  10347. return nil, &googleapi.Error{
  10348. Code: res.StatusCode,
  10349. Header: res.Header,
  10350. }
  10351. }
  10352. if err != nil {
  10353. return nil, err
  10354. }
  10355. defer googleapi.CloseBody(res)
  10356. if err := googleapi.CheckResponse(res); err != nil {
  10357. return nil, err
  10358. }
  10359. ret := &GoogleCloudDialogflowV2SessionEntityType{
  10360. ServerResponse: googleapi.ServerResponse{
  10361. Header: res.Header,
  10362. HTTPStatusCode: res.StatusCode,
  10363. },
  10364. }
  10365. target := &ret
  10366. if err := gensupport.DecodeResponse(target, res); err != nil {
  10367. return nil, err
  10368. }
  10369. return ret, nil
  10370. // {
  10371. // "description": "Updates the specified session entity type.",
  10372. // "flatPath": "v2/projects/{projectsId}/agent/sessions/{sessionsId}/entityTypes/{entityTypesId}",
  10373. // "httpMethod": "PATCH",
  10374. // "id": "dialogflow.projects.agent.sessions.entityTypes.patch",
  10375. // "parameterOrder": [
  10376. // "name"
  10377. // ],
  10378. // "parameters": {
  10379. // "name": {
  10380. // "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.",
  10381. // "location": "path",
  10382. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+/entityTypes/[^/]+$",
  10383. // "required": true,
  10384. // "type": "string"
  10385. // },
  10386. // "updateMask": {
  10387. // "description": "Optional. The mask to control which fields get updated.",
  10388. // "format": "google-fieldmask",
  10389. // "location": "query",
  10390. // "type": "string"
  10391. // }
  10392. // },
  10393. // "path": "v2/{+name}",
  10394. // "request": {
  10395. // "$ref": "GoogleCloudDialogflowV2SessionEntityType"
  10396. // },
  10397. // "response": {
  10398. // "$ref": "GoogleCloudDialogflowV2SessionEntityType"
  10399. // },
  10400. // "scopes": [
  10401. // "https://www.googleapis.com/auth/cloud-platform",
  10402. // "https://www.googleapis.com/auth/dialogflow"
  10403. // ]
  10404. // }
  10405. }
  10406. // method id "dialogflow.projects.operations.get":
  10407. type ProjectsOperationsGetCall struct {
  10408. s *Service
  10409. name string
  10410. urlParams_ gensupport.URLParams
  10411. ifNoneMatch_ string
  10412. ctx_ context.Context
  10413. header_ http.Header
  10414. }
  10415. // Get: Gets the latest state of a long-running operation. Clients can
  10416. // use this
  10417. // method to poll the operation result at intervals as recommended by
  10418. // the API
  10419. // service.
  10420. func (r *ProjectsOperationsService) Get(name string) *ProjectsOperationsGetCall {
  10421. c := &ProjectsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10422. c.name = name
  10423. return c
  10424. }
  10425. // Fields allows partial responses to be retrieved. See
  10426. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10427. // for more information.
  10428. func (c *ProjectsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsOperationsGetCall {
  10429. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10430. return c
  10431. }
  10432. // IfNoneMatch sets the optional parameter which makes the operation
  10433. // fail if the object's ETag matches the given value. This is useful for
  10434. // getting updates only after the object has changed since the last
  10435. // request. Use googleapi.IsNotModified to check whether the response
  10436. // error from Do is the result of In-None-Match.
  10437. func (c *ProjectsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsOperationsGetCall {
  10438. c.ifNoneMatch_ = entityTag
  10439. return c
  10440. }
  10441. // Context sets the context to be used in this call's Do method. Any
  10442. // pending HTTP request will be aborted if the provided context is
  10443. // canceled.
  10444. func (c *ProjectsOperationsGetCall) Context(ctx context.Context) *ProjectsOperationsGetCall {
  10445. c.ctx_ = ctx
  10446. return c
  10447. }
  10448. // Header returns an http.Header that can be modified by the caller to
  10449. // add HTTP headers to the request.
  10450. func (c *ProjectsOperationsGetCall) Header() http.Header {
  10451. if c.header_ == nil {
  10452. c.header_ = make(http.Header)
  10453. }
  10454. return c.header_
  10455. }
  10456. func (c *ProjectsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  10457. reqHeaders := make(http.Header)
  10458. for k, v := range c.header_ {
  10459. reqHeaders[k] = v
  10460. }
  10461. reqHeaders.Set("User-Agent", c.s.userAgent())
  10462. if c.ifNoneMatch_ != "" {
  10463. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10464. }
  10465. var body io.Reader = nil
  10466. c.urlParams_.Set("alt", alt)
  10467. c.urlParams_.Set("prettyPrint", "false")
  10468. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  10469. urls += "?" + c.urlParams_.Encode()
  10470. req, err := http.NewRequest("GET", urls, body)
  10471. if err != nil {
  10472. return nil, err
  10473. }
  10474. req.Header = reqHeaders
  10475. googleapi.Expand(req.URL, map[string]string{
  10476. "name": c.name,
  10477. })
  10478. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10479. }
  10480. // Do executes the "dialogflow.projects.operations.get" call.
  10481. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  10482. // Any non-2xx status code is an error. Response headers are in either
  10483. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  10484. // was returned at all) in error.(*googleapi.Error).Header. Use
  10485. // googleapi.IsNotModified to check whether the returned error was
  10486. // because http.StatusNotModified was returned.
  10487. func (c *ProjectsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  10488. gensupport.SetOptions(c.urlParams_, opts...)
  10489. res, err := c.doRequest("json")
  10490. if res != nil && res.StatusCode == http.StatusNotModified {
  10491. if res.Body != nil {
  10492. res.Body.Close()
  10493. }
  10494. return nil, &googleapi.Error{
  10495. Code: res.StatusCode,
  10496. Header: res.Header,
  10497. }
  10498. }
  10499. if err != nil {
  10500. return nil, err
  10501. }
  10502. defer googleapi.CloseBody(res)
  10503. if err := googleapi.CheckResponse(res); err != nil {
  10504. return nil, err
  10505. }
  10506. ret := &GoogleLongrunningOperation{
  10507. ServerResponse: googleapi.ServerResponse{
  10508. Header: res.Header,
  10509. HTTPStatusCode: res.StatusCode,
  10510. },
  10511. }
  10512. target := &ret
  10513. if err := gensupport.DecodeResponse(target, res); err != nil {
  10514. return nil, err
  10515. }
  10516. return ret, nil
  10517. // {
  10518. // "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.",
  10519. // "flatPath": "v2/projects/{projectsId}/operations/{operationsId}",
  10520. // "httpMethod": "GET",
  10521. // "id": "dialogflow.projects.operations.get",
  10522. // "parameterOrder": [
  10523. // "name"
  10524. // ],
  10525. // "parameters": {
  10526. // "name": {
  10527. // "description": "The name of the operation resource.",
  10528. // "location": "path",
  10529. // "pattern": "^projects/[^/]+/operations/[^/]+$",
  10530. // "required": true,
  10531. // "type": "string"
  10532. // }
  10533. // },
  10534. // "path": "v2/{+name}",
  10535. // "response": {
  10536. // "$ref": "GoogleLongrunningOperation"
  10537. // },
  10538. // "scopes": [
  10539. // "https://www.googleapis.com/auth/cloud-platform",
  10540. // "https://www.googleapis.com/auth/dialogflow"
  10541. // ]
  10542. // }
  10543. }