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.
 
 
 

17541 lines
665 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/v2beta1"
  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/v2beta1"
  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:v2beta1"
  73. const apiName = "dialogflow"
  74. const apiVersion = "v2beta1"
  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.KnowledgeBases = NewProjectsKnowledgeBasesService(s)
  133. rs.Operations = NewProjectsOperationsService(s)
  134. return rs
  135. }
  136. type ProjectsService struct {
  137. s *Service
  138. Agent *ProjectsAgentService
  139. KnowledgeBases *ProjectsKnowledgeBasesService
  140. Operations *ProjectsOperationsService
  141. }
  142. func NewProjectsAgentService(s *Service) *ProjectsAgentService {
  143. rs := &ProjectsAgentService{s: s}
  144. rs.EntityTypes = NewProjectsAgentEntityTypesService(s)
  145. rs.Environments = NewProjectsAgentEnvironmentsService(s)
  146. rs.Intents = NewProjectsAgentIntentsService(s)
  147. rs.KnowledgeBases = NewProjectsAgentKnowledgeBasesService(s)
  148. rs.Sessions = NewProjectsAgentSessionsService(s)
  149. return rs
  150. }
  151. type ProjectsAgentService struct {
  152. s *Service
  153. EntityTypes *ProjectsAgentEntityTypesService
  154. Environments *ProjectsAgentEnvironmentsService
  155. Intents *ProjectsAgentIntentsService
  156. KnowledgeBases *ProjectsAgentKnowledgeBasesService
  157. Sessions *ProjectsAgentSessionsService
  158. }
  159. func NewProjectsAgentEntityTypesService(s *Service) *ProjectsAgentEntityTypesService {
  160. rs := &ProjectsAgentEntityTypesService{s: s}
  161. rs.Entities = NewProjectsAgentEntityTypesEntitiesService(s)
  162. return rs
  163. }
  164. type ProjectsAgentEntityTypesService struct {
  165. s *Service
  166. Entities *ProjectsAgentEntityTypesEntitiesService
  167. }
  168. func NewProjectsAgentEntityTypesEntitiesService(s *Service) *ProjectsAgentEntityTypesEntitiesService {
  169. rs := &ProjectsAgentEntityTypesEntitiesService{s: s}
  170. return rs
  171. }
  172. type ProjectsAgentEntityTypesEntitiesService struct {
  173. s *Service
  174. }
  175. func NewProjectsAgentEnvironmentsService(s *Service) *ProjectsAgentEnvironmentsService {
  176. rs := &ProjectsAgentEnvironmentsService{s: s}
  177. rs.Users = NewProjectsAgentEnvironmentsUsersService(s)
  178. return rs
  179. }
  180. type ProjectsAgentEnvironmentsService struct {
  181. s *Service
  182. Users *ProjectsAgentEnvironmentsUsersService
  183. }
  184. func NewProjectsAgentEnvironmentsUsersService(s *Service) *ProjectsAgentEnvironmentsUsersService {
  185. rs := &ProjectsAgentEnvironmentsUsersService{s: s}
  186. rs.Sessions = NewProjectsAgentEnvironmentsUsersSessionsService(s)
  187. return rs
  188. }
  189. type ProjectsAgentEnvironmentsUsersService struct {
  190. s *Service
  191. Sessions *ProjectsAgentEnvironmentsUsersSessionsService
  192. }
  193. func NewProjectsAgentEnvironmentsUsersSessionsService(s *Service) *ProjectsAgentEnvironmentsUsersSessionsService {
  194. rs := &ProjectsAgentEnvironmentsUsersSessionsService{s: s}
  195. rs.Contexts = NewProjectsAgentEnvironmentsUsersSessionsContextsService(s)
  196. rs.EntityTypes = NewProjectsAgentEnvironmentsUsersSessionsEntityTypesService(s)
  197. return rs
  198. }
  199. type ProjectsAgentEnvironmentsUsersSessionsService struct {
  200. s *Service
  201. Contexts *ProjectsAgentEnvironmentsUsersSessionsContextsService
  202. EntityTypes *ProjectsAgentEnvironmentsUsersSessionsEntityTypesService
  203. }
  204. func NewProjectsAgentEnvironmentsUsersSessionsContextsService(s *Service) *ProjectsAgentEnvironmentsUsersSessionsContextsService {
  205. rs := &ProjectsAgentEnvironmentsUsersSessionsContextsService{s: s}
  206. return rs
  207. }
  208. type ProjectsAgentEnvironmentsUsersSessionsContextsService struct {
  209. s *Service
  210. }
  211. func NewProjectsAgentEnvironmentsUsersSessionsEntityTypesService(s *Service) *ProjectsAgentEnvironmentsUsersSessionsEntityTypesService {
  212. rs := &ProjectsAgentEnvironmentsUsersSessionsEntityTypesService{s: s}
  213. return rs
  214. }
  215. type ProjectsAgentEnvironmentsUsersSessionsEntityTypesService struct {
  216. s *Service
  217. }
  218. func NewProjectsAgentIntentsService(s *Service) *ProjectsAgentIntentsService {
  219. rs := &ProjectsAgentIntentsService{s: s}
  220. return rs
  221. }
  222. type ProjectsAgentIntentsService struct {
  223. s *Service
  224. }
  225. func NewProjectsAgentKnowledgeBasesService(s *Service) *ProjectsAgentKnowledgeBasesService {
  226. rs := &ProjectsAgentKnowledgeBasesService{s: s}
  227. rs.Documents = NewProjectsAgentKnowledgeBasesDocumentsService(s)
  228. return rs
  229. }
  230. type ProjectsAgentKnowledgeBasesService struct {
  231. s *Service
  232. Documents *ProjectsAgentKnowledgeBasesDocumentsService
  233. }
  234. func NewProjectsAgentKnowledgeBasesDocumentsService(s *Service) *ProjectsAgentKnowledgeBasesDocumentsService {
  235. rs := &ProjectsAgentKnowledgeBasesDocumentsService{s: s}
  236. return rs
  237. }
  238. type ProjectsAgentKnowledgeBasesDocumentsService struct {
  239. s *Service
  240. }
  241. func NewProjectsAgentSessionsService(s *Service) *ProjectsAgentSessionsService {
  242. rs := &ProjectsAgentSessionsService{s: s}
  243. rs.Contexts = NewProjectsAgentSessionsContextsService(s)
  244. rs.EntityTypes = NewProjectsAgentSessionsEntityTypesService(s)
  245. return rs
  246. }
  247. type ProjectsAgentSessionsService struct {
  248. s *Service
  249. Contexts *ProjectsAgentSessionsContextsService
  250. EntityTypes *ProjectsAgentSessionsEntityTypesService
  251. }
  252. func NewProjectsAgentSessionsContextsService(s *Service) *ProjectsAgentSessionsContextsService {
  253. rs := &ProjectsAgentSessionsContextsService{s: s}
  254. return rs
  255. }
  256. type ProjectsAgentSessionsContextsService struct {
  257. s *Service
  258. }
  259. func NewProjectsAgentSessionsEntityTypesService(s *Service) *ProjectsAgentSessionsEntityTypesService {
  260. rs := &ProjectsAgentSessionsEntityTypesService{s: s}
  261. return rs
  262. }
  263. type ProjectsAgentSessionsEntityTypesService struct {
  264. s *Service
  265. }
  266. func NewProjectsKnowledgeBasesService(s *Service) *ProjectsKnowledgeBasesService {
  267. rs := &ProjectsKnowledgeBasesService{s: s}
  268. rs.Documents = NewProjectsKnowledgeBasesDocumentsService(s)
  269. return rs
  270. }
  271. type ProjectsKnowledgeBasesService struct {
  272. s *Service
  273. Documents *ProjectsKnowledgeBasesDocumentsService
  274. }
  275. func NewProjectsKnowledgeBasesDocumentsService(s *Service) *ProjectsKnowledgeBasesDocumentsService {
  276. rs := &ProjectsKnowledgeBasesDocumentsService{s: s}
  277. return rs
  278. }
  279. type ProjectsKnowledgeBasesDocumentsService struct {
  280. s *Service
  281. }
  282. func NewProjectsOperationsService(s *Service) *ProjectsOperationsService {
  283. rs := &ProjectsOperationsService{s: s}
  284. return rs
  285. }
  286. type ProjectsOperationsService struct {
  287. s *Service
  288. }
  289. // GoogleCloudDialogflowV2BatchUpdateEntityTypesResponse: The response
  290. // message for EntityTypes.BatchUpdateEntityTypes.
  291. type GoogleCloudDialogflowV2BatchUpdateEntityTypesResponse struct {
  292. // EntityTypes: The collection of updated or created entity types.
  293. EntityTypes []*GoogleCloudDialogflowV2EntityType `json:"entityTypes,omitempty"`
  294. // ForceSendFields is a list of field names (e.g. "EntityTypes") to
  295. // unconditionally include in API requests. By default, fields with
  296. // empty values are omitted from API requests. However, any non-pointer,
  297. // non-interface field appearing in ForceSendFields will be sent to the
  298. // server regardless of whether the field is empty or not. This may be
  299. // used to include empty fields in Patch requests.
  300. ForceSendFields []string `json:"-"`
  301. // NullFields is a list of field names (e.g. "EntityTypes") to include
  302. // in API requests with the JSON null value. By default, fields with
  303. // empty values are omitted from API requests. However, any field with
  304. // an empty value appearing in NullFields will be sent to the server as
  305. // null. It is an error if a field in this list has a non-empty value.
  306. // This may be used to include null fields in Patch requests.
  307. NullFields []string `json:"-"`
  308. }
  309. func (s *GoogleCloudDialogflowV2BatchUpdateEntityTypesResponse) MarshalJSON() ([]byte, error) {
  310. type NoMethod GoogleCloudDialogflowV2BatchUpdateEntityTypesResponse
  311. raw := NoMethod(*s)
  312. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  313. }
  314. // GoogleCloudDialogflowV2BatchUpdateIntentsResponse: The response
  315. // message for Intents.BatchUpdateIntents.
  316. type GoogleCloudDialogflowV2BatchUpdateIntentsResponse struct {
  317. // Intents: The collection of updated or created intents.
  318. Intents []*GoogleCloudDialogflowV2Intent `json:"intents,omitempty"`
  319. // ForceSendFields is a list of field names (e.g. "Intents") to
  320. // unconditionally include in API requests. By default, fields with
  321. // empty values are omitted from API requests. However, any non-pointer,
  322. // non-interface field appearing in ForceSendFields will be sent to the
  323. // server regardless of whether the field is empty or not. This may be
  324. // used to include empty fields in Patch requests.
  325. ForceSendFields []string `json:"-"`
  326. // NullFields is a list of field names (e.g. "Intents") to include in
  327. // API requests with the JSON null value. By default, fields with empty
  328. // values are omitted from API requests. However, any field with an
  329. // empty value appearing in NullFields will be sent to the server as
  330. // null. It is an error if a field in this list has a non-empty value.
  331. // This may be used to include null fields in Patch requests.
  332. NullFields []string `json:"-"`
  333. }
  334. func (s *GoogleCloudDialogflowV2BatchUpdateIntentsResponse) MarshalJSON() ([]byte, error) {
  335. type NoMethod GoogleCloudDialogflowV2BatchUpdateIntentsResponse
  336. raw := NoMethod(*s)
  337. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  338. }
  339. // GoogleCloudDialogflowV2Context: Represents a context.
  340. type GoogleCloudDialogflowV2Context struct {
  341. // LifespanCount: Optional. The number of conversational query requests
  342. // after which the
  343. // context expires. If set to `0` (the default) the context
  344. // expires
  345. // immediately. Contexts expire automatically after 20 minutes if
  346. // there
  347. // are no matching queries.
  348. LifespanCount int64 `json:"lifespanCount,omitempty"`
  349. // Name: Required. The unique identifier of the context.
  350. // Format:
  351. // `projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context
  352. // ID>`.
  353. //
  354. // The `Context ID` is always converted to lowercase, may only
  355. // contain
  356. // characters in [a-zA-Z0-9_-%] and may be at most 250 bytes long.
  357. Name string `json:"name,omitempty"`
  358. // Parameters: Optional. The collection of parameters associated with
  359. // this context.
  360. // Refer to [this
  361. // doc](https://dialogflow.com/docs/actions-and-parameters) for
  362. // syntax.
  363. Parameters googleapi.RawMessage `json:"parameters,omitempty"`
  364. // ForceSendFields is a list of field names (e.g. "LifespanCount") to
  365. // unconditionally include in API requests. By default, fields with
  366. // empty values are omitted from API requests. However, any non-pointer,
  367. // non-interface field appearing in ForceSendFields will be sent to the
  368. // server regardless of whether the field is empty or not. This may be
  369. // used to include empty fields in Patch requests.
  370. ForceSendFields []string `json:"-"`
  371. // NullFields is a list of field names (e.g. "LifespanCount") to include
  372. // in API requests with the JSON null value. By default, fields with
  373. // empty values are omitted from API requests. However, any field with
  374. // an empty value appearing in NullFields will be sent to the server as
  375. // null. It is an error if a field in this list has a non-empty value.
  376. // This may be used to include null fields in Patch requests.
  377. NullFields []string `json:"-"`
  378. }
  379. func (s *GoogleCloudDialogflowV2Context) MarshalJSON() ([]byte, error) {
  380. type NoMethod GoogleCloudDialogflowV2Context
  381. raw := NoMethod(*s)
  382. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  383. }
  384. // GoogleCloudDialogflowV2EntityType: Represents an entity type.
  385. // Entity types serve as a tool for extracting parameter values from
  386. // natural
  387. // language queries.
  388. type GoogleCloudDialogflowV2EntityType struct {
  389. // AutoExpansionMode: Optional. Indicates whether the entity type can be
  390. // automatically
  391. // expanded.
  392. //
  393. // Possible values:
  394. // "AUTO_EXPANSION_MODE_UNSPECIFIED" - Auto expansion disabled for the
  395. // entity.
  396. // "AUTO_EXPANSION_MODE_DEFAULT" - Allows an agent to recognize values
  397. // that have not been explicitly
  398. // listed in the entity.
  399. AutoExpansionMode string `json:"autoExpansionMode,omitempty"`
  400. // DisplayName: Required. The name of the entity type.
  401. DisplayName string `json:"displayName,omitempty"`
  402. // Entities: Optional. The collection of entity entries associated with
  403. // the entity type.
  404. Entities []*GoogleCloudDialogflowV2EntityTypeEntity `json:"entities,omitempty"`
  405. // Kind: Required. Indicates the kind of entity type.
  406. //
  407. // Possible values:
  408. // "KIND_UNSPECIFIED" - Not specified. This value should be never
  409. // used.
  410. // "KIND_MAP" - Map entity types allow mapping of a group of synonyms
  411. // to a canonical
  412. // value.
  413. // "KIND_LIST" - List entity types contain a set of entries that do
  414. // not map to canonical
  415. // values. However, list entity types can contain references to other
  416. // entity
  417. // types (with or without aliases).
  418. Kind string `json:"kind,omitempty"`
  419. // Name: The unique identifier of the entity type.
  420. // Required for EntityTypes.UpdateEntityType
  421. // and
  422. // EntityTypes.BatchUpdateEntityTypes methods.
  423. // Format: `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.
  424. Name string `json:"name,omitempty"`
  425. // ForceSendFields is a list of field names (e.g. "AutoExpansionMode")
  426. // to unconditionally include in API requests. By default, fields with
  427. // empty values are omitted from API requests. However, any non-pointer,
  428. // non-interface field appearing in ForceSendFields will be sent to the
  429. // server regardless of whether the field is empty or not. This may be
  430. // used to include empty fields in Patch requests.
  431. ForceSendFields []string `json:"-"`
  432. // NullFields is a list of field names (e.g. "AutoExpansionMode") to
  433. // include in API requests with the JSON null value. By default, fields
  434. // with empty values are omitted from API requests. However, any field
  435. // with an empty value appearing in NullFields will be sent to the
  436. // server as null. It is an error if a field in this list has a
  437. // non-empty value. This may be used to include null fields in Patch
  438. // requests.
  439. NullFields []string `json:"-"`
  440. }
  441. func (s *GoogleCloudDialogflowV2EntityType) MarshalJSON() ([]byte, error) {
  442. type NoMethod GoogleCloudDialogflowV2EntityType
  443. raw := NoMethod(*s)
  444. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  445. }
  446. // GoogleCloudDialogflowV2EntityTypeEntity: An **entity entry** for an
  447. // associated entity type.
  448. type GoogleCloudDialogflowV2EntityTypeEntity struct {
  449. // Synonyms: Required. A collection of value synonyms. For example, if
  450. // the entity type
  451. // is *vegetable*, and `value` is *scallions*, a synonym could be
  452. // *green
  453. // onions*.
  454. //
  455. // For `KIND_LIST` entity types:
  456. //
  457. // * This collection must contain exactly one synonym equal to
  458. // `value`.
  459. Synonyms []string `json:"synonyms,omitempty"`
  460. // Value: Required. The primary value associated with this entity
  461. // entry.
  462. // For example, if the entity type is *vegetable*, the value could
  463. // be
  464. // *scallions*.
  465. //
  466. // For `KIND_MAP` entity types:
  467. //
  468. // * A canonical value to be used in place of synonyms.
  469. //
  470. // For `KIND_LIST` entity types:
  471. //
  472. // * A string that can contain references to other entity types (with
  473. // or
  474. // without aliases).
  475. Value string `json:"value,omitempty"`
  476. // ForceSendFields is a list of field names (e.g. "Synonyms") to
  477. // unconditionally include in API requests. By default, fields with
  478. // empty values are omitted from API requests. However, any non-pointer,
  479. // non-interface field appearing in ForceSendFields will be sent to the
  480. // server regardless of whether the field is empty or not. This may be
  481. // used to include empty fields in Patch requests.
  482. ForceSendFields []string `json:"-"`
  483. // NullFields is a list of field names (e.g. "Synonyms") to include in
  484. // API requests with the JSON null value. By default, fields with empty
  485. // values are omitted from API requests. However, any field with an
  486. // empty value appearing in NullFields will be sent to the server as
  487. // null. It is an error if a field in this list has a non-empty value.
  488. // This may be used to include null fields in Patch requests.
  489. NullFields []string `json:"-"`
  490. }
  491. func (s *GoogleCloudDialogflowV2EntityTypeEntity) MarshalJSON() ([]byte, error) {
  492. type NoMethod GoogleCloudDialogflowV2EntityTypeEntity
  493. raw := NoMethod(*s)
  494. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  495. }
  496. // GoogleCloudDialogflowV2EventInput: Events allow for matching intents
  497. // by event name instead of the natural
  498. // language input. For instance, input `<event: { name:
  499. // "welcome_event",
  500. // parameters: { name: "Sam" } }>` can trigger a personalized welcome
  501. // response.
  502. // The parameter `name` may be used by the agent in the
  503. // response:
  504. // "Hello #welcome_event.name! What can I do for you today?".
  505. type GoogleCloudDialogflowV2EventInput struct {
  506. // LanguageCode: Required. The language of this query. See
  507. // [Language
  508. // Support](https://dialogflow.com/docs/languages) for a list of
  509. // the
  510. // currently supported language codes. Note that queries in the same
  511. // session
  512. // do not necessarily need to specify the same language.
  513. LanguageCode string `json:"languageCode,omitempty"`
  514. // Name: Required. The unique identifier of the event.
  515. Name string `json:"name,omitempty"`
  516. // Parameters: Optional. The collection of parameters associated with
  517. // the event.
  518. Parameters googleapi.RawMessage `json:"parameters,omitempty"`
  519. // ForceSendFields is a list of field names (e.g. "LanguageCode") to
  520. // unconditionally include in API requests. By default, fields with
  521. // empty values are omitted from API requests. However, any non-pointer,
  522. // non-interface field appearing in ForceSendFields will be sent to the
  523. // server regardless of whether the field is empty or not. This may be
  524. // used to include empty fields in Patch requests.
  525. ForceSendFields []string `json:"-"`
  526. // NullFields is a list of field names (e.g. "LanguageCode") to include
  527. // in API requests with the JSON null value. By default, fields with
  528. // empty values are omitted from API requests. However, any field with
  529. // an empty value appearing in NullFields will be sent to the server as
  530. // null. It is an error if a field in this list has a non-empty value.
  531. // This may be used to include null fields in Patch requests.
  532. NullFields []string `json:"-"`
  533. }
  534. func (s *GoogleCloudDialogflowV2EventInput) MarshalJSON() ([]byte, error) {
  535. type NoMethod GoogleCloudDialogflowV2EventInput
  536. raw := NoMethod(*s)
  537. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  538. }
  539. // GoogleCloudDialogflowV2ExportAgentResponse: The response message for
  540. // Agents.ExportAgent.
  541. type GoogleCloudDialogflowV2ExportAgentResponse struct {
  542. // AgentContent: The exported agent.
  543. //
  544. // Example for how to export an agent to a zip file via a command
  545. // line:
  546. // <pre>curl \
  547. //
  548. // 'https://dialogflow.googleapis.com/v2/projects/&lt;project_name&gt;/ag
  549. // ent:export'\
  550. // -X POST \
  551. // -H 'Authorization: Bearer '$(gcloud auth application-default
  552. // print-access-token) \
  553. // -H 'Accept: application/json' \
  554. // -H 'Content-Type: application/json' \
  555. // --compressed \
  556. // --data-binary '{}' \
  557. // | grep agentContent | sed -e 's/.*"agentContent": "\([^"]*\)".*/\1/'
  558. // \
  559. // | base64 --decode > &lt;agent zip file&gt;</pre>
  560. AgentContent string `json:"agentContent,omitempty"`
  561. // AgentUri: The URI to a file containing the exported agent. This field
  562. // is populated
  563. // only if `agent_uri` is specified in `ExportAgentRequest`.
  564. AgentUri string `json:"agentUri,omitempty"`
  565. // ForceSendFields is a list of field names (e.g. "AgentContent") to
  566. // unconditionally include in API requests. By default, fields with
  567. // empty values are omitted from API requests. However, any non-pointer,
  568. // non-interface field appearing in ForceSendFields will be sent to the
  569. // server regardless of whether the field is empty or not. This may be
  570. // used to include empty fields in Patch requests.
  571. ForceSendFields []string `json:"-"`
  572. // NullFields is a list of field names (e.g. "AgentContent") to include
  573. // in API requests with the JSON null value. By default, fields with
  574. // empty values are omitted from API requests. However, any field with
  575. // an empty value appearing in NullFields will be sent to the server as
  576. // null. It is an error if a field in this list has a non-empty value.
  577. // This may be used to include null fields in Patch requests.
  578. NullFields []string `json:"-"`
  579. }
  580. func (s *GoogleCloudDialogflowV2ExportAgentResponse) MarshalJSON() ([]byte, error) {
  581. type NoMethod GoogleCloudDialogflowV2ExportAgentResponse
  582. raw := NoMethod(*s)
  583. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  584. }
  585. // GoogleCloudDialogflowV2Intent: Represents an intent.
  586. // Intents convert a number of user expressions or patterns into an
  587. // action. An
  588. // action is an extraction of a user command or sentence semantics.
  589. type GoogleCloudDialogflowV2Intent struct {
  590. // Action: Optional. The name of the action associated with the
  591. // intent.
  592. // Note: The action name must not contain whitespaces.
  593. Action string `json:"action,omitempty"`
  594. // DefaultResponsePlatforms: Optional. The list of platforms for which
  595. // the first response will be
  596. // taken from among the messages assigned to the DEFAULT_PLATFORM.
  597. //
  598. // Possible values:
  599. // "PLATFORM_UNSPECIFIED" - Not specified.
  600. // "FACEBOOK" - Facebook.
  601. // "SLACK" - Slack.
  602. // "TELEGRAM" - Telegram.
  603. // "KIK" - Kik.
  604. // "SKYPE" - Skype.
  605. // "LINE" - Line.
  606. // "VIBER" - Viber.
  607. // "ACTIONS_ON_GOOGLE" - Actions on Google.
  608. // When using Actions on Google, you can choose one of the
  609. // specific
  610. // Intent.Message types that mention support for Actions on Google,
  611. // or you can use the advanced Intent.Message.payload field.
  612. // The payload field provides access to AoG features not available in
  613. // the
  614. // specific message types.
  615. // If using the Intent.Message.payload field, it should have a
  616. // structure
  617. // similar to the JSON message shown here. For more information,
  618. // see
  619. // [Actions on Google
  620. // Webhook
  621. // Format](https://developers.google.com/actions/dialogflow/webho
  622. // ok)
  623. // <pre>{
  624. // "expectUserResponse": true,
  625. // "isSsml": false,
  626. // "noInputPrompts": [],
  627. // "richResponse": {
  628. // "items": [
  629. // {
  630. // "simpleResponse": {
  631. // "displayText": "hi",
  632. // "textToSpeech": "hello"
  633. // }
  634. // }
  635. // ],
  636. // "suggestions": [
  637. // {
  638. // "title": "Say this"
  639. // },
  640. // {
  641. // "title": "or this"
  642. // }
  643. // ]
  644. // },
  645. // "systemIntent": {
  646. // "data": {
  647. // "@type":
  648. // "type.googleapis.com/google.actions.v2.OptionValueSpec",
  649. // "listSelect": {
  650. // "items": [
  651. // {
  652. // "optionInfo": {
  653. // "key": "key1",
  654. // "synonyms": [
  655. // "key one"
  656. // ]
  657. // },
  658. // "title": "must not be empty, but unique"
  659. // },
  660. // {
  661. // "optionInfo": {
  662. // "key": "key2",
  663. // "synonyms": [
  664. // "key two"
  665. // ]
  666. // },
  667. // "title": "must not be empty, but unique"
  668. // }
  669. // ]
  670. // }
  671. // },
  672. // "intent": "actions.intent.OPTION"
  673. // }
  674. // }</pre>
  675. DefaultResponsePlatforms []string `json:"defaultResponsePlatforms,omitempty"`
  676. // DisplayName: Required. The name of this intent.
  677. DisplayName string `json:"displayName,omitempty"`
  678. // Events: Optional. The collection of event names that trigger the
  679. // intent.
  680. // If the collection of input contexts is not empty, all of the contexts
  681. // must
  682. // be present in the active user session for an event to trigger this
  683. // intent.
  684. Events []string `json:"events,omitempty"`
  685. // FollowupIntentInfo: Read-only. Information about all followup intents
  686. // that have this intent as
  687. // a direct or indirect parent. We populate this field only in the
  688. // output.
  689. FollowupIntentInfo []*GoogleCloudDialogflowV2IntentFollowupIntentInfo `json:"followupIntentInfo,omitempty"`
  690. // InputContextNames: Optional. The list of context names required for
  691. // this intent to be
  692. // triggered.
  693. // Format: `projects/<Project ID>/agent/sessions/-/contexts/<Context
  694. // ID>`.
  695. InputContextNames []string `json:"inputContextNames,omitempty"`
  696. // IsFallback: Optional. Indicates whether this is a fallback intent.
  697. IsFallback bool `json:"isFallback,omitempty"`
  698. // Messages: Optional. The collection of rich messages corresponding to
  699. // the
  700. // `Response` field in the Dialogflow console.
  701. Messages []*GoogleCloudDialogflowV2IntentMessage `json:"messages,omitempty"`
  702. // MlDisabled: Optional. Indicates whether Machine Learning is disabled
  703. // for the intent.
  704. // Note: If `ml_diabled` setting is set to true, then this intent is
  705. // not
  706. // taken into account during inference in `ML ONLY` match mode.
  707. // Also,
  708. // auto-markup in the UI is turned off.
  709. MlDisabled bool `json:"mlDisabled,omitempty"`
  710. // Name: The unique identifier of this intent.
  711. // Required for Intents.UpdateIntent and
  712. // Intents.BatchUpdateIntents
  713. // methods.
  714. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  715. Name string `json:"name,omitempty"`
  716. // OutputContexts: Optional. The collection of contexts that are
  717. // activated when the intent
  718. // is matched. Context messages in this collection should not set
  719. // the
  720. // parameters field. Setting the `lifespan_count` to 0 will reset the
  721. // context
  722. // when the intent is matched.
  723. // Format: `projects/<Project ID>/agent/sessions/-/contexts/<Context
  724. // ID>`.
  725. OutputContexts []*GoogleCloudDialogflowV2Context `json:"outputContexts,omitempty"`
  726. // Parameters: Optional. The collection of parameters associated with
  727. // the intent.
  728. Parameters []*GoogleCloudDialogflowV2IntentParameter `json:"parameters,omitempty"`
  729. // ParentFollowupIntentName: Read-only after creation. The unique
  730. // identifier of the parent intent in the
  731. // chain of followup intents. You can set this field when creating an
  732. // intent,
  733. // for example with CreateIntent or BatchUpdateIntents, in order to
  734. // make this intent a followup intent.
  735. //
  736. // It identifies the parent followup intent.
  737. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  738. ParentFollowupIntentName string `json:"parentFollowupIntentName,omitempty"`
  739. // Priority: Optional. The priority of this intent. Higher numbers
  740. // represent higher
  741. // priorities. If this is zero or unspecified, we use the
  742. // default
  743. // priority 500000.
  744. //
  745. // Negative numbers mean that the intent is disabled.
  746. Priority int64 `json:"priority,omitempty"`
  747. // ResetContexts: Optional. Indicates whether to delete all contexts in
  748. // the current
  749. // session when this intent is matched.
  750. ResetContexts bool `json:"resetContexts,omitempty"`
  751. // RootFollowupIntentName: Read-only. The unique identifier of the root
  752. // intent in the chain of
  753. // followup intents. It identifies the correct followup intents chain
  754. // for
  755. // this intent. We populate this field only in the output.
  756. //
  757. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  758. RootFollowupIntentName string `json:"rootFollowupIntentName,omitempty"`
  759. // TrainingPhrases: Optional. The collection of examples that the agent
  760. // is
  761. // trained on.
  762. TrainingPhrases []*GoogleCloudDialogflowV2IntentTrainingPhrase `json:"trainingPhrases,omitempty"`
  763. // WebhookState: Optional. Indicates whether webhooks are enabled for
  764. // the intent.
  765. //
  766. // Possible values:
  767. // "WEBHOOK_STATE_UNSPECIFIED" - Webhook is disabled in the agent and
  768. // in the intent.
  769. // "WEBHOOK_STATE_ENABLED" - Webhook is enabled in the agent and in
  770. // the intent.
  771. // "WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING" - Webhook is enabled in
  772. // the agent and in the intent. Also, each slot
  773. // filling prompt is forwarded to the webhook.
  774. WebhookState string `json:"webhookState,omitempty"`
  775. // ForceSendFields is a list of field names (e.g. "Action") to
  776. // unconditionally include in API requests. By default, fields with
  777. // empty values are omitted from API requests. However, any non-pointer,
  778. // non-interface field appearing in ForceSendFields will be sent to the
  779. // server regardless of whether the field is empty or not. This may be
  780. // used to include empty fields in Patch requests.
  781. ForceSendFields []string `json:"-"`
  782. // NullFields is a list of field names (e.g. "Action") to include in API
  783. // requests with the JSON null value. By default, fields with empty
  784. // values are omitted from API requests. However, any field with an
  785. // empty value appearing in NullFields will be sent to the server as
  786. // null. It is an error if a field in this list has a non-empty value.
  787. // This may be used to include null fields in Patch requests.
  788. NullFields []string `json:"-"`
  789. }
  790. func (s *GoogleCloudDialogflowV2Intent) MarshalJSON() ([]byte, error) {
  791. type NoMethod GoogleCloudDialogflowV2Intent
  792. raw := NoMethod(*s)
  793. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  794. }
  795. // GoogleCloudDialogflowV2IntentFollowupIntentInfo: Represents a single
  796. // followup intent in the chain.
  797. type GoogleCloudDialogflowV2IntentFollowupIntentInfo struct {
  798. // FollowupIntentName: The unique identifier of the followup
  799. // intent.
  800. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  801. FollowupIntentName string `json:"followupIntentName,omitempty"`
  802. // ParentFollowupIntentName: The unique identifier of the followup
  803. // intent's parent.
  804. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  805. ParentFollowupIntentName string `json:"parentFollowupIntentName,omitempty"`
  806. // ForceSendFields is a list of field names (e.g. "FollowupIntentName")
  807. // to unconditionally include in API requests. By default, fields with
  808. // empty values are omitted from API requests. However, any non-pointer,
  809. // non-interface field appearing in ForceSendFields will be sent to the
  810. // server regardless of whether the field is empty or not. This may be
  811. // used to include empty fields in Patch requests.
  812. ForceSendFields []string `json:"-"`
  813. // NullFields is a list of field names (e.g. "FollowupIntentName") to
  814. // include in API requests with the JSON null value. By default, fields
  815. // with empty values are omitted from API requests. However, any field
  816. // with an empty value appearing in NullFields will be sent to the
  817. // server as null. It is an error if a field in this list has a
  818. // non-empty value. This may be used to include null fields in Patch
  819. // requests.
  820. NullFields []string `json:"-"`
  821. }
  822. func (s *GoogleCloudDialogflowV2IntentFollowupIntentInfo) MarshalJSON() ([]byte, error) {
  823. type NoMethod GoogleCloudDialogflowV2IntentFollowupIntentInfo
  824. raw := NoMethod(*s)
  825. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  826. }
  827. // GoogleCloudDialogflowV2IntentMessage: Corresponds to the `Response`
  828. // field in the Dialogflow console.
  829. type GoogleCloudDialogflowV2IntentMessage struct {
  830. // BasicCard: The basic card response for Actions on Google.
  831. BasicCard *GoogleCloudDialogflowV2IntentMessageBasicCard `json:"basicCard,omitempty"`
  832. // Card: The card response.
  833. Card *GoogleCloudDialogflowV2IntentMessageCard `json:"card,omitempty"`
  834. // CarouselSelect: The carousel card response for Actions on Google.
  835. CarouselSelect *GoogleCloudDialogflowV2IntentMessageCarouselSelect `json:"carouselSelect,omitempty"`
  836. // Image: The image response.
  837. Image *GoogleCloudDialogflowV2IntentMessageImage `json:"image,omitempty"`
  838. // LinkOutSuggestion: The link out suggestion chip for Actions on
  839. // Google.
  840. LinkOutSuggestion *GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion `json:"linkOutSuggestion,omitempty"`
  841. // ListSelect: The list card response for Actions on Google.
  842. ListSelect *GoogleCloudDialogflowV2IntentMessageListSelect `json:"listSelect,omitempty"`
  843. // Payload: Returns a response containing a custom, platform-specific
  844. // payload.
  845. // See the Intent.Message.Platform type for a description of
  846. // the
  847. // structure that may be required for your platform.
  848. Payload googleapi.RawMessage `json:"payload,omitempty"`
  849. // Platform: Optional. The platform that this message is intended for.
  850. //
  851. // Possible values:
  852. // "PLATFORM_UNSPECIFIED" - Not specified.
  853. // "FACEBOOK" - Facebook.
  854. // "SLACK" - Slack.
  855. // "TELEGRAM" - Telegram.
  856. // "KIK" - Kik.
  857. // "SKYPE" - Skype.
  858. // "LINE" - Line.
  859. // "VIBER" - Viber.
  860. // "ACTIONS_ON_GOOGLE" - Actions on Google.
  861. // When using Actions on Google, you can choose one of the
  862. // specific
  863. // Intent.Message types that mention support for Actions on Google,
  864. // or you can use the advanced Intent.Message.payload field.
  865. // The payload field provides access to AoG features not available in
  866. // the
  867. // specific message types.
  868. // If using the Intent.Message.payload field, it should have a
  869. // structure
  870. // similar to the JSON message shown here. For more information,
  871. // see
  872. // [Actions on Google
  873. // Webhook
  874. // Format](https://developers.google.com/actions/dialogflow/webho
  875. // ok)
  876. // <pre>{
  877. // "expectUserResponse": true,
  878. // "isSsml": false,
  879. // "noInputPrompts": [],
  880. // "richResponse": {
  881. // "items": [
  882. // {
  883. // "simpleResponse": {
  884. // "displayText": "hi",
  885. // "textToSpeech": "hello"
  886. // }
  887. // }
  888. // ],
  889. // "suggestions": [
  890. // {
  891. // "title": "Say this"
  892. // },
  893. // {
  894. // "title": "or this"
  895. // }
  896. // ]
  897. // },
  898. // "systemIntent": {
  899. // "data": {
  900. // "@type":
  901. // "type.googleapis.com/google.actions.v2.OptionValueSpec",
  902. // "listSelect": {
  903. // "items": [
  904. // {
  905. // "optionInfo": {
  906. // "key": "key1",
  907. // "synonyms": [
  908. // "key one"
  909. // ]
  910. // },
  911. // "title": "must not be empty, but unique"
  912. // },
  913. // {
  914. // "optionInfo": {
  915. // "key": "key2",
  916. // "synonyms": [
  917. // "key two"
  918. // ]
  919. // },
  920. // "title": "must not be empty, but unique"
  921. // }
  922. // ]
  923. // }
  924. // },
  925. // "intent": "actions.intent.OPTION"
  926. // }
  927. // }</pre>
  928. Platform string `json:"platform,omitempty"`
  929. // QuickReplies: The quick replies response.
  930. QuickReplies *GoogleCloudDialogflowV2IntentMessageQuickReplies `json:"quickReplies,omitempty"`
  931. // SimpleResponses: The voice and text-only responses for Actions on
  932. // Google.
  933. SimpleResponses *GoogleCloudDialogflowV2IntentMessageSimpleResponses `json:"simpleResponses,omitempty"`
  934. // Suggestions: The suggestion chips for Actions on Google.
  935. Suggestions *GoogleCloudDialogflowV2IntentMessageSuggestions `json:"suggestions,omitempty"`
  936. // Text: The text response.
  937. Text *GoogleCloudDialogflowV2IntentMessageText `json:"text,omitempty"`
  938. // ForceSendFields is a list of field names (e.g. "BasicCard") to
  939. // unconditionally include in API requests. By default, fields with
  940. // empty values are omitted from API requests. However, any non-pointer,
  941. // non-interface field appearing in ForceSendFields will be sent to the
  942. // server regardless of whether the field is empty or not. This may be
  943. // used to include empty fields in Patch requests.
  944. ForceSendFields []string `json:"-"`
  945. // NullFields is a list of field names (e.g. "BasicCard") to include in
  946. // API requests with the JSON null value. By default, fields with empty
  947. // values are omitted from API requests. However, any field with an
  948. // empty value appearing in NullFields will be sent to the server as
  949. // null. It is an error if a field in this list has a non-empty value.
  950. // This may be used to include null fields in Patch requests.
  951. NullFields []string `json:"-"`
  952. }
  953. func (s *GoogleCloudDialogflowV2IntentMessage) MarshalJSON() ([]byte, error) {
  954. type NoMethod GoogleCloudDialogflowV2IntentMessage
  955. raw := NoMethod(*s)
  956. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  957. }
  958. // GoogleCloudDialogflowV2IntentMessageBasicCard: The basic card
  959. // message. Useful for displaying information.
  960. type GoogleCloudDialogflowV2IntentMessageBasicCard struct {
  961. // Buttons: Optional. The collection of card buttons.
  962. Buttons []*GoogleCloudDialogflowV2IntentMessageBasicCardButton `json:"buttons,omitempty"`
  963. // FormattedText: Required, unless image is present. The body text of
  964. // the card.
  965. FormattedText string `json:"formattedText,omitempty"`
  966. // Image: Optional. The image for the card.
  967. Image *GoogleCloudDialogflowV2IntentMessageImage `json:"image,omitempty"`
  968. // Subtitle: Optional. The subtitle of the card.
  969. Subtitle string `json:"subtitle,omitempty"`
  970. // Title: Optional. The title of the card.
  971. Title string `json:"title,omitempty"`
  972. // ForceSendFields is a list of field names (e.g. "Buttons") to
  973. // unconditionally include in API requests. By default, fields with
  974. // empty values are omitted from API requests. However, any non-pointer,
  975. // non-interface field appearing in ForceSendFields will be sent to the
  976. // server regardless of whether the field is empty or not. This may be
  977. // used to include empty fields in Patch requests.
  978. ForceSendFields []string `json:"-"`
  979. // NullFields is a list of field names (e.g. "Buttons") to include in
  980. // API requests with the JSON null value. By default, fields with empty
  981. // values are omitted from API requests. However, any field with an
  982. // empty value appearing in NullFields will be sent to the server as
  983. // null. It is an error if a field in this list has a non-empty value.
  984. // This may be used to include null fields in Patch requests.
  985. NullFields []string `json:"-"`
  986. }
  987. func (s *GoogleCloudDialogflowV2IntentMessageBasicCard) MarshalJSON() ([]byte, error) {
  988. type NoMethod GoogleCloudDialogflowV2IntentMessageBasicCard
  989. raw := NoMethod(*s)
  990. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  991. }
  992. // GoogleCloudDialogflowV2IntentMessageBasicCardButton: The button
  993. // object that appears at the bottom of a card.
  994. type GoogleCloudDialogflowV2IntentMessageBasicCardButton struct {
  995. // OpenUriAction: Required. Action to take when a user taps on the
  996. // button.
  997. OpenUriAction *GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction `json:"openUriAction,omitempty"`
  998. // Title: Required. The title of the button.
  999. Title string `json:"title,omitempty"`
  1000. // ForceSendFields is a list of field names (e.g. "OpenUriAction") to
  1001. // unconditionally include in API requests. By default, fields with
  1002. // empty values are omitted from API requests. However, any non-pointer,
  1003. // non-interface field appearing in ForceSendFields will be sent to the
  1004. // server regardless of whether the field is empty or not. This may be
  1005. // used to include empty fields in Patch requests.
  1006. ForceSendFields []string `json:"-"`
  1007. // NullFields is a list of field names (e.g. "OpenUriAction") to include
  1008. // in API requests with the JSON null value. By default, fields with
  1009. // empty values are omitted from API requests. However, any field with
  1010. // an empty value appearing in NullFields will be sent to the server as
  1011. // null. It is an error if a field in this list has a non-empty value.
  1012. // This may be used to include null fields in Patch requests.
  1013. NullFields []string `json:"-"`
  1014. }
  1015. func (s *GoogleCloudDialogflowV2IntentMessageBasicCardButton) MarshalJSON() ([]byte, error) {
  1016. type NoMethod GoogleCloudDialogflowV2IntentMessageBasicCardButton
  1017. raw := NoMethod(*s)
  1018. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1019. }
  1020. // GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction:
  1021. // Opens the given URI.
  1022. type GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction struct {
  1023. // Uri: Required. The HTTP or HTTPS scheme URI.
  1024. Uri string `json:"uri,omitempty"`
  1025. // ForceSendFields is a list of field names (e.g. "Uri") to
  1026. // unconditionally include in API requests. By default, fields with
  1027. // empty values are omitted from API requests. However, any non-pointer,
  1028. // non-interface field appearing in ForceSendFields will be sent to the
  1029. // server regardless of whether the field is empty or not. This may be
  1030. // used to include empty fields in Patch requests.
  1031. ForceSendFields []string `json:"-"`
  1032. // NullFields is a list of field names (e.g. "Uri") to include in API
  1033. // requests with the JSON null value. By default, fields with empty
  1034. // values are omitted from API requests. However, any field with an
  1035. // empty value appearing in NullFields will be sent to the server as
  1036. // null. It is an error if a field in this list has a non-empty value.
  1037. // This may be used to include null fields in Patch requests.
  1038. NullFields []string `json:"-"`
  1039. }
  1040. func (s *GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction) MarshalJSON() ([]byte, error) {
  1041. type NoMethod GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction
  1042. raw := NoMethod(*s)
  1043. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1044. }
  1045. // GoogleCloudDialogflowV2IntentMessageCard: The card response message.
  1046. type GoogleCloudDialogflowV2IntentMessageCard struct {
  1047. // Buttons: Optional. The collection of card buttons.
  1048. Buttons []*GoogleCloudDialogflowV2IntentMessageCardButton `json:"buttons,omitempty"`
  1049. // ImageUri: Optional. The public URI to an image file for the card.
  1050. ImageUri string `json:"imageUri,omitempty"`
  1051. // Subtitle: Optional. The subtitle of the card.
  1052. Subtitle string `json:"subtitle,omitempty"`
  1053. // Title: Optional. The title of the card.
  1054. Title string `json:"title,omitempty"`
  1055. // ForceSendFields is a list of field names (e.g. "Buttons") to
  1056. // unconditionally include in API requests. By default, fields with
  1057. // empty values are omitted from API requests. However, any non-pointer,
  1058. // non-interface field appearing in ForceSendFields will be sent to the
  1059. // server regardless of whether the field is empty or not. This may be
  1060. // used to include empty fields in Patch requests.
  1061. ForceSendFields []string `json:"-"`
  1062. // NullFields is a list of field names (e.g. "Buttons") to include in
  1063. // API requests with the JSON null value. By default, fields with empty
  1064. // values are omitted from API requests. However, any field with an
  1065. // empty value appearing in NullFields will be sent to the server as
  1066. // null. It is an error if a field in this list has a non-empty value.
  1067. // This may be used to include null fields in Patch requests.
  1068. NullFields []string `json:"-"`
  1069. }
  1070. func (s *GoogleCloudDialogflowV2IntentMessageCard) MarshalJSON() ([]byte, error) {
  1071. type NoMethod GoogleCloudDialogflowV2IntentMessageCard
  1072. raw := NoMethod(*s)
  1073. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1074. }
  1075. // GoogleCloudDialogflowV2IntentMessageCardButton: Optional. Contains
  1076. // information about a button.
  1077. type GoogleCloudDialogflowV2IntentMessageCardButton struct {
  1078. // Postback: Optional. The text to send back to the Dialogflow API or a
  1079. // URI to
  1080. // open.
  1081. Postback string `json:"postback,omitempty"`
  1082. // Text: Optional. The text to show on the button.
  1083. Text string `json:"text,omitempty"`
  1084. // ForceSendFields is a list of field names (e.g. "Postback") to
  1085. // unconditionally include in API requests. By default, fields with
  1086. // empty values are omitted from API requests. However, any non-pointer,
  1087. // non-interface field appearing in ForceSendFields will be sent to the
  1088. // server regardless of whether the field is empty or not. This may be
  1089. // used to include empty fields in Patch requests.
  1090. ForceSendFields []string `json:"-"`
  1091. // NullFields is a list of field names (e.g. "Postback") to include in
  1092. // API requests with the JSON null value. By default, fields with empty
  1093. // values are omitted from API requests. However, any field with an
  1094. // empty value appearing in NullFields will be sent to the server as
  1095. // null. It is an error if a field in this list has a non-empty value.
  1096. // This may be used to include null fields in Patch requests.
  1097. NullFields []string `json:"-"`
  1098. }
  1099. func (s *GoogleCloudDialogflowV2IntentMessageCardButton) MarshalJSON() ([]byte, error) {
  1100. type NoMethod GoogleCloudDialogflowV2IntentMessageCardButton
  1101. raw := NoMethod(*s)
  1102. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1103. }
  1104. // GoogleCloudDialogflowV2IntentMessageCarouselSelect: The card for
  1105. // presenting a carousel of options to select from.
  1106. type GoogleCloudDialogflowV2IntentMessageCarouselSelect struct {
  1107. // Items: Required. Carousel items.
  1108. Items []*GoogleCloudDialogflowV2IntentMessageCarouselSelectItem `json:"items,omitempty"`
  1109. // ForceSendFields is a list of field names (e.g. "Items") to
  1110. // unconditionally include in API requests. By default, fields with
  1111. // empty values are omitted from API requests. However, any non-pointer,
  1112. // non-interface field appearing in ForceSendFields will be sent to the
  1113. // server regardless of whether the field is empty or not. This may be
  1114. // used to include empty fields in Patch requests.
  1115. ForceSendFields []string `json:"-"`
  1116. // NullFields is a list of field names (e.g. "Items") to include in API
  1117. // requests with the JSON null value. By default, fields with empty
  1118. // values are omitted from API requests. However, any field with an
  1119. // empty value appearing in NullFields will be sent to the server as
  1120. // null. It is an error if a field in this list has a non-empty value.
  1121. // This may be used to include null fields in Patch requests.
  1122. NullFields []string `json:"-"`
  1123. }
  1124. func (s *GoogleCloudDialogflowV2IntentMessageCarouselSelect) MarshalJSON() ([]byte, error) {
  1125. type NoMethod GoogleCloudDialogflowV2IntentMessageCarouselSelect
  1126. raw := NoMethod(*s)
  1127. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1128. }
  1129. // GoogleCloudDialogflowV2IntentMessageCarouselSelectItem: An item in
  1130. // the carousel.
  1131. type GoogleCloudDialogflowV2IntentMessageCarouselSelectItem struct {
  1132. // Description: Optional. The body text of the card.
  1133. Description string `json:"description,omitempty"`
  1134. // Image: Optional. The image to display.
  1135. Image *GoogleCloudDialogflowV2IntentMessageImage `json:"image,omitempty"`
  1136. // Info: Required. Additional info about the option item.
  1137. Info *GoogleCloudDialogflowV2IntentMessageSelectItemInfo `json:"info,omitempty"`
  1138. // Title: Required. Title of the carousel item.
  1139. Title string `json:"title,omitempty"`
  1140. // ForceSendFields is a list of field names (e.g. "Description") to
  1141. // unconditionally include in API requests. By default, fields with
  1142. // empty values are omitted from API requests. However, any non-pointer,
  1143. // non-interface field appearing in ForceSendFields will be sent to the
  1144. // server regardless of whether the field is empty or not. This may be
  1145. // used to include empty fields in Patch requests.
  1146. ForceSendFields []string `json:"-"`
  1147. // NullFields is a list of field names (e.g. "Description") to include
  1148. // in API requests with the JSON null value. By default, fields with
  1149. // empty values are omitted from API requests. However, any field with
  1150. // an empty value appearing in NullFields will be sent to the server as
  1151. // null. It is an error if a field in this list has a non-empty value.
  1152. // This may be used to include null fields in Patch requests.
  1153. NullFields []string `json:"-"`
  1154. }
  1155. func (s *GoogleCloudDialogflowV2IntentMessageCarouselSelectItem) MarshalJSON() ([]byte, error) {
  1156. type NoMethod GoogleCloudDialogflowV2IntentMessageCarouselSelectItem
  1157. raw := NoMethod(*s)
  1158. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1159. }
  1160. // GoogleCloudDialogflowV2IntentMessageImage: The image response
  1161. // message.
  1162. type GoogleCloudDialogflowV2IntentMessageImage struct {
  1163. // AccessibilityText: Optional. A text description of the image to be
  1164. // used for accessibility,
  1165. // e.g., screen readers.
  1166. AccessibilityText string `json:"accessibilityText,omitempty"`
  1167. // ImageUri: Optional. The public URI to an image file.
  1168. ImageUri string `json:"imageUri,omitempty"`
  1169. // ForceSendFields is a list of field names (e.g. "AccessibilityText")
  1170. // to unconditionally include in API requests. By default, fields with
  1171. // empty values are omitted from API requests. However, any non-pointer,
  1172. // non-interface field appearing in ForceSendFields will be sent to the
  1173. // server regardless of whether the field is empty or not. This may be
  1174. // used to include empty fields in Patch requests.
  1175. ForceSendFields []string `json:"-"`
  1176. // NullFields is a list of field names (e.g. "AccessibilityText") to
  1177. // include in API requests with the JSON null value. By default, fields
  1178. // with empty values are omitted from API requests. However, any field
  1179. // with an empty value appearing in NullFields will be sent to the
  1180. // server as null. It is an error if a field in this list has a
  1181. // non-empty value. This may be used to include null fields in Patch
  1182. // requests.
  1183. NullFields []string `json:"-"`
  1184. }
  1185. func (s *GoogleCloudDialogflowV2IntentMessageImage) MarshalJSON() ([]byte, error) {
  1186. type NoMethod GoogleCloudDialogflowV2IntentMessageImage
  1187. raw := NoMethod(*s)
  1188. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1189. }
  1190. // GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion: The suggestion
  1191. // chip message that allows the user to jump out to the app
  1192. // or website associated with this agent.
  1193. type GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion struct {
  1194. // DestinationName: Required. The name of the app or site this chip is
  1195. // linking to.
  1196. DestinationName string `json:"destinationName,omitempty"`
  1197. // Uri: Required. The URI of the app or site to open when the user taps
  1198. // the
  1199. // suggestion chip.
  1200. Uri string `json:"uri,omitempty"`
  1201. // ForceSendFields is a list of field names (e.g. "DestinationName") to
  1202. // unconditionally include in API requests. By default, fields with
  1203. // empty values are omitted from API requests. However, any non-pointer,
  1204. // non-interface field appearing in ForceSendFields will be sent to the
  1205. // server regardless of whether the field is empty or not. This may be
  1206. // used to include empty fields in Patch requests.
  1207. ForceSendFields []string `json:"-"`
  1208. // NullFields is a list of field names (e.g. "DestinationName") to
  1209. // include in API requests with the JSON null value. By default, fields
  1210. // with empty values are omitted from API requests. However, any field
  1211. // with an empty value appearing in NullFields will be sent to the
  1212. // server as null. It is an error if a field in this list has a
  1213. // non-empty value. This may be used to include null fields in Patch
  1214. // requests.
  1215. NullFields []string `json:"-"`
  1216. }
  1217. func (s *GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion) MarshalJSON() ([]byte, error) {
  1218. type NoMethod GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion
  1219. raw := NoMethod(*s)
  1220. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1221. }
  1222. // GoogleCloudDialogflowV2IntentMessageListSelect: The card for
  1223. // presenting a list of options to select from.
  1224. type GoogleCloudDialogflowV2IntentMessageListSelect struct {
  1225. // Items: Required. List items.
  1226. Items []*GoogleCloudDialogflowV2IntentMessageListSelectItem `json:"items,omitempty"`
  1227. // Title: Optional. The overall title of the list.
  1228. Title string `json:"title,omitempty"`
  1229. // ForceSendFields is a list of field names (e.g. "Items") to
  1230. // unconditionally include in API requests. By default, fields with
  1231. // empty values are omitted from API requests. However, any non-pointer,
  1232. // non-interface field appearing in ForceSendFields will be sent to the
  1233. // server regardless of whether the field is empty or not. This may be
  1234. // used to include empty fields in Patch requests.
  1235. ForceSendFields []string `json:"-"`
  1236. // NullFields is a list of field names (e.g. "Items") to include in API
  1237. // requests with the JSON null value. By default, fields with empty
  1238. // values are omitted from API requests. However, any field with an
  1239. // empty value appearing in NullFields will be sent to the server as
  1240. // null. It is an error if a field in this list has a non-empty value.
  1241. // This may be used to include null fields in Patch requests.
  1242. NullFields []string `json:"-"`
  1243. }
  1244. func (s *GoogleCloudDialogflowV2IntentMessageListSelect) MarshalJSON() ([]byte, error) {
  1245. type NoMethod GoogleCloudDialogflowV2IntentMessageListSelect
  1246. raw := NoMethod(*s)
  1247. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1248. }
  1249. // GoogleCloudDialogflowV2IntentMessageListSelectItem: An item in the
  1250. // list.
  1251. type GoogleCloudDialogflowV2IntentMessageListSelectItem struct {
  1252. // Description: Optional. The main text describing the item.
  1253. Description string `json:"description,omitempty"`
  1254. // Image: Optional. The image to display.
  1255. Image *GoogleCloudDialogflowV2IntentMessageImage `json:"image,omitempty"`
  1256. // Info: Required. Additional information about this option.
  1257. Info *GoogleCloudDialogflowV2IntentMessageSelectItemInfo `json:"info,omitempty"`
  1258. // Title: Required. The title of the list item.
  1259. Title string `json:"title,omitempty"`
  1260. // ForceSendFields is a list of field names (e.g. "Description") to
  1261. // unconditionally include in API requests. By default, fields with
  1262. // empty values are omitted from API requests. However, any non-pointer,
  1263. // non-interface field appearing in ForceSendFields will be sent to the
  1264. // server regardless of whether the field is empty or not. This may be
  1265. // used to include empty fields in Patch requests.
  1266. ForceSendFields []string `json:"-"`
  1267. // NullFields is a list of field names (e.g. "Description") to include
  1268. // in API requests with the JSON null value. By default, fields with
  1269. // empty values are omitted from API requests. However, any field with
  1270. // an empty value appearing in NullFields will be sent to the server as
  1271. // null. It is an error if a field in this list has a non-empty value.
  1272. // This may be used to include null fields in Patch requests.
  1273. NullFields []string `json:"-"`
  1274. }
  1275. func (s *GoogleCloudDialogflowV2IntentMessageListSelectItem) MarshalJSON() ([]byte, error) {
  1276. type NoMethod GoogleCloudDialogflowV2IntentMessageListSelectItem
  1277. raw := NoMethod(*s)
  1278. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1279. }
  1280. // GoogleCloudDialogflowV2IntentMessageQuickReplies: The quick replies
  1281. // response message.
  1282. type GoogleCloudDialogflowV2IntentMessageQuickReplies struct {
  1283. // QuickReplies: Optional. The collection of quick replies.
  1284. QuickReplies []string `json:"quickReplies,omitempty"`
  1285. // Title: Optional. The title of the collection of quick replies.
  1286. Title string `json:"title,omitempty"`
  1287. // ForceSendFields is a list of field names (e.g. "QuickReplies") to
  1288. // unconditionally include in API requests. By default, fields with
  1289. // empty values are omitted from API requests. However, any non-pointer,
  1290. // non-interface field appearing in ForceSendFields will be sent to the
  1291. // server regardless of whether the field is empty or not. This may be
  1292. // used to include empty fields in Patch requests.
  1293. ForceSendFields []string `json:"-"`
  1294. // NullFields is a list of field names (e.g. "QuickReplies") to include
  1295. // in API requests with the JSON null value. By default, fields with
  1296. // empty values are omitted from API requests. However, any field with
  1297. // an empty value appearing in NullFields will be sent to the server as
  1298. // null. It is an error if a field in this list has a non-empty value.
  1299. // This may be used to include null fields in Patch requests.
  1300. NullFields []string `json:"-"`
  1301. }
  1302. func (s *GoogleCloudDialogflowV2IntentMessageQuickReplies) MarshalJSON() ([]byte, error) {
  1303. type NoMethod GoogleCloudDialogflowV2IntentMessageQuickReplies
  1304. raw := NoMethod(*s)
  1305. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1306. }
  1307. // GoogleCloudDialogflowV2IntentMessageSelectItemInfo: Additional info
  1308. // about the select item for when it is triggered in a
  1309. // dialog.
  1310. type GoogleCloudDialogflowV2IntentMessageSelectItemInfo struct {
  1311. // Key: Required. A unique key that will be sent back to the agent if
  1312. // this
  1313. // response is given.
  1314. Key string `json:"key,omitempty"`
  1315. // Synonyms: Optional. A list of synonyms that can also be used to
  1316. // trigger this
  1317. // item in dialog.
  1318. Synonyms []string `json:"synonyms,omitempty"`
  1319. // ForceSendFields is a list of field names (e.g. "Key") to
  1320. // unconditionally include in API requests. By default, fields with
  1321. // empty values are omitted from API requests. However, any non-pointer,
  1322. // non-interface field appearing in ForceSendFields will be sent to the
  1323. // server regardless of whether the field is empty or not. This may be
  1324. // used to include empty fields in Patch requests.
  1325. ForceSendFields []string `json:"-"`
  1326. // NullFields is a list of field names (e.g. "Key") to include in API
  1327. // requests with the JSON null value. By default, fields with empty
  1328. // values are omitted from API requests. However, any field with an
  1329. // empty value appearing in NullFields will be sent to the server as
  1330. // null. It is an error if a field in this list has a non-empty value.
  1331. // This may be used to include null fields in Patch requests.
  1332. NullFields []string `json:"-"`
  1333. }
  1334. func (s *GoogleCloudDialogflowV2IntentMessageSelectItemInfo) MarshalJSON() ([]byte, error) {
  1335. type NoMethod GoogleCloudDialogflowV2IntentMessageSelectItemInfo
  1336. raw := NoMethod(*s)
  1337. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1338. }
  1339. // GoogleCloudDialogflowV2IntentMessageSimpleResponse: The simple
  1340. // response message containing speech or text.
  1341. type GoogleCloudDialogflowV2IntentMessageSimpleResponse struct {
  1342. // DisplayText: Optional. The text to display.
  1343. DisplayText string `json:"displayText,omitempty"`
  1344. // Ssml: One of text_to_speech or ssml must be provided. Structured
  1345. // spoken
  1346. // response to the user in the SSML format. Mutually exclusive
  1347. // with
  1348. // text_to_speech.
  1349. Ssml string `json:"ssml,omitempty"`
  1350. // TextToSpeech: One of text_to_speech or ssml must be provided. The
  1351. // plain text of the
  1352. // speech output. Mutually exclusive with ssml.
  1353. TextToSpeech string `json:"textToSpeech,omitempty"`
  1354. // ForceSendFields is a list of field names (e.g. "DisplayText") to
  1355. // unconditionally include in API requests. By default, fields with
  1356. // empty values are omitted from API requests. However, any non-pointer,
  1357. // non-interface field appearing in ForceSendFields will be sent to the
  1358. // server regardless of whether the field is empty or not. This may be
  1359. // used to include empty fields in Patch requests.
  1360. ForceSendFields []string `json:"-"`
  1361. // NullFields is a list of field names (e.g. "DisplayText") to include
  1362. // in API requests with the JSON null value. By default, fields with
  1363. // empty values are omitted from API requests. However, any field with
  1364. // an empty value appearing in NullFields will be sent to the server as
  1365. // null. It is an error if a field in this list has a non-empty value.
  1366. // This may be used to include null fields in Patch requests.
  1367. NullFields []string `json:"-"`
  1368. }
  1369. func (s *GoogleCloudDialogflowV2IntentMessageSimpleResponse) MarshalJSON() ([]byte, error) {
  1370. type NoMethod GoogleCloudDialogflowV2IntentMessageSimpleResponse
  1371. raw := NoMethod(*s)
  1372. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1373. }
  1374. // GoogleCloudDialogflowV2IntentMessageSimpleResponses: The collection
  1375. // of simple response candidates.
  1376. // This message in `QueryResult.fulfillment_messages`
  1377. // and
  1378. // `WebhookResponse.fulfillment_messages` should contain only
  1379. // one
  1380. // `SimpleResponse`.
  1381. type GoogleCloudDialogflowV2IntentMessageSimpleResponses struct {
  1382. // SimpleResponses: Required. The list of simple responses.
  1383. SimpleResponses []*GoogleCloudDialogflowV2IntentMessageSimpleResponse `json:"simpleResponses,omitempty"`
  1384. // ForceSendFields is a list of field names (e.g. "SimpleResponses") to
  1385. // unconditionally include in API requests. By default, fields with
  1386. // empty values are omitted from API requests. However, any non-pointer,
  1387. // non-interface field appearing in ForceSendFields will be sent to the
  1388. // server regardless of whether the field is empty or not. This may be
  1389. // used to include empty fields in Patch requests.
  1390. ForceSendFields []string `json:"-"`
  1391. // NullFields is a list of field names (e.g. "SimpleResponses") to
  1392. // include in API requests with the JSON null value. By default, fields
  1393. // with empty values are omitted from API requests. However, any field
  1394. // with an empty value appearing in NullFields will be sent to the
  1395. // server as null. It is an error if a field in this list has a
  1396. // non-empty value. This may be used to include null fields in Patch
  1397. // requests.
  1398. NullFields []string `json:"-"`
  1399. }
  1400. func (s *GoogleCloudDialogflowV2IntentMessageSimpleResponses) MarshalJSON() ([]byte, error) {
  1401. type NoMethod GoogleCloudDialogflowV2IntentMessageSimpleResponses
  1402. raw := NoMethod(*s)
  1403. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1404. }
  1405. // GoogleCloudDialogflowV2IntentMessageSuggestion: The suggestion chip
  1406. // message that the user can tap to quickly post a reply
  1407. // to the conversation.
  1408. type GoogleCloudDialogflowV2IntentMessageSuggestion struct {
  1409. // Title: Required. The text shown the in the suggestion chip.
  1410. Title string `json:"title,omitempty"`
  1411. // ForceSendFields is a list of field names (e.g. "Title") to
  1412. // unconditionally include in API requests. By default, fields with
  1413. // empty values are omitted from API requests. However, any non-pointer,
  1414. // non-interface field appearing in ForceSendFields will be sent to the
  1415. // server regardless of whether the field is empty or not. This may be
  1416. // used to include empty fields in Patch requests.
  1417. ForceSendFields []string `json:"-"`
  1418. // NullFields is a list of field names (e.g. "Title") to include in API
  1419. // requests with the JSON null value. By default, fields with empty
  1420. // values are omitted from API requests. However, any field with an
  1421. // empty value appearing in NullFields will be sent to the server as
  1422. // null. It is an error if a field in this list has a non-empty value.
  1423. // This may be used to include null fields in Patch requests.
  1424. NullFields []string `json:"-"`
  1425. }
  1426. func (s *GoogleCloudDialogflowV2IntentMessageSuggestion) MarshalJSON() ([]byte, error) {
  1427. type NoMethod GoogleCloudDialogflowV2IntentMessageSuggestion
  1428. raw := NoMethod(*s)
  1429. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1430. }
  1431. // GoogleCloudDialogflowV2IntentMessageSuggestions: The collection of
  1432. // suggestions.
  1433. type GoogleCloudDialogflowV2IntentMessageSuggestions struct {
  1434. // Suggestions: Required. The list of suggested replies.
  1435. Suggestions []*GoogleCloudDialogflowV2IntentMessageSuggestion `json:"suggestions,omitempty"`
  1436. // ForceSendFields is a list of field names (e.g. "Suggestions") to
  1437. // unconditionally include in API requests. By default, fields with
  1438. // empty values are omitted from API requests. However, any non-pointer,
  1439. // non-interface field appearing in ForceSendFields will be sent to the
  1440. // server regardless of whether the field is empty or not. This may be
  1441. // used to include empty fields in Patch requests.
  1442. ForceSendFields []string `json:"-"`
  1443. // NullFields is a list of field names (e.g. "Suggestions") to include
  1444. // in API requests with the JSON null value. By default, fields with
  1445. // empty values are omitted from API requests. However, any field with
  1446. // an empty value appearing in NullFields will be sent to the server as
  1447. // null. It is an error if a field in this list has a non-empty value.
  1448. // This may be used to include null fields in Patch requests.
  1449. NullFields []string `json:"-"`
  1450. }
  1451. func (s *GoogleCloudDialogflowV2IntentMessageSuggestions) MarshalJSON() ([]byte, error) {
  1452. type NoMethod GoogleCloudDialogflowV2IntentMessageSuggestions
  1453. raw := NoMethod(*s)
  1454. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1455. }
  1456. // GoogleCloudDialogflowV2IntentMessageText: The text response message.
  1457. type GoogleCloudDialogflowV2IntentMessageText struct {
  1458. // Text: Optional. The collection of the agent's responses.
  1459. Text []string `json:"text,omitempty"`
  1460. // ForceSendFields is a list of field names (e.g. "Text") to
  1461. // unconditionally include in API requests. By default, fields with
  1462. // empty values are omitted from API requests. However, any non-pointer,
  1463. // non-interface field appearing in ForceSendFields will be sent to the
  1464. // server regardless of whether the field is empty or not. This may be
  1465. // used to include empty fields in Patch requests.
  1466. ForceSendFields []string `json:"-"`
  1467. // NullFields is a list of field names (e.g. "Text") to include in API
  1468. // requests with the JSON null value. By default, fields with empty
  1469. // values are omitted from API requests. However, any field with an
  1470. // empty value appearing in NullFields will be sent to the server as
  1471. // null. It is an error if a field in this list has a non-empty value.
  1472. // This may be used to include null fields in Patch requests.
  1473. NullFields []string `json:"-"`
  1474. }
  1475. func (s *GoogleCloudDialogflowV2IntentMessageText) MarshalJSON() ([]byte, error) {
  1476. type NoMethod GoogleCloudDialogflowV2IntentMessageText
  1477. raw := NoMethod(*s)
  1478. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1479. }
  1480. // GoogleCloudDialogflowV2IntentParameter: Represents intent parameters.
  1481. type GoogleCloudDialogflowV2IntentParameter struct {
  1482. // DefaultValue: Optional. The default value to use when the `value`
  1483. // yields an empty
  1484. // result.
  1485. // Default values can be extracted from contexts by using the
  1486. // following
  1487. // syntax: `#context_name.parameter_name`.
  1488. DefaultValue string `json:"defaultValue,omitempty"`
  1489. // DisplayName: Required. The name of the parameter.
  1490. DisplayName string `json:"displayName,omitempty"`
  1491. // EntityTypeDisplayName: Optional. The name of the entity type,
  1492. // prefixed with `@`, that
  1493. // describes values of the parameter. If the parameter is
  1494. // required, this must be provided.
  1495. EntityTypeDisplayName string `json:"entityTypeDisplayName,omitempty"`
  1496. // IsList: Optional. Indicates whether the parameter represents a list
  1497. // of values.
  1498. IsList bool `json:"isList,omitempty"`
  1499. // Mandatory: Optional. Indicates whether the parameter is required.
  1500. // That is,
  1501. // whether the intent cannot be completed without collecting the
  1502. // parameter
  1503. // value.
  1504. Mandatory bool `json:"mandatory,omitempty"`
  1505. // Name: The unique identifier of this parameter.
  1506. Name string `json:"name,omitempty"`
  1507. // Prompts: Optional. The collection of prompts that the agent can
  1508. // present to the
  1509. // user in order to collect value for the parameter.
  1510. Prompts []string `json:"prompts,omitempty"`
  1511. // Value: Optional. The definition of the parameter value. It can be:
  1512. // - a constant string,
  1513. // - a parameter value defined as `$parameter_name`,
  1514. // - an original parameter value defined as
  1515. // `$parameter_name.original`,
  1516. // - a parameter value from some context defined as
  1517. // `#context_name.parameter_name`.
  1518. Value string `json:"value,omitempty"`
  1519. // ForceSendFields is a list of field names (e.g. "DefaultValue") to
  1520. // unconditionally include in API requests. By default, fields with
  1521. // empty values are omitted from API requests. However, any non-pointer,
  1522. // non-interface field appearing in ForceSendFields will be sent to the
  1523. // server regardless of whether the field is empty or not. This may be
  1524. // used to include empty fields in Patch requests.
  1525. ForceSendFields []string `json:"-"`
  1526. // NullFields is a list of field names (e.g. "DefaultValue") to include
  1527. // in API requests with the JSON null value. By default, fields with
  1528. // empty values are omitted from API requests. However, any field with
  1529. // an empty value appearing in NullFields will be sent to the server as
  1530. // null. It is an error if a field in this list has a non-empty value.
  1531. // This may be used to include null fields in Patch requests.
  1532. NullFields []string `json:"-"`
  1533. }
  1534. func (s *GoogleCloudDialogflowV2IntentParameter) MarshalJSON() ([]byte, error) {
  1535. type NoMethod GoogleCloudDialogflowV2IntentParameter
  1536. raw := NoMethod(*s)
  1537. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1538. }
  1539. // GoogleCloudDialogflowV2IntentTrainingPhrase: Represents an example
  1540. // that the agent is trained on.
  1541. type GoogleCloudDialogflowV2IntentTrainingPhrase struct {
  1542. // Name: Output only. The unique identifier of this training phrase.
  1543. Name string `json:"name,omitempty"`
  1544. // Parts: Required. The ordered list of training phrase parts.
  1545. // The parts are concatenated in order to form the training
  1546. // phrase.
  1547. //
  1548. // Note: The API does not automatically annotate training phrases like
  1549. // the
  1550. // Dialogflow Console does.
  1551. //
  1552. // Note: Do not forget to include whitespace at part boundaries,
  1553. // so the training phrase is well formatted when the parts are
  1554. // concatenated.
  1555. //
  1556. // If the training phrase does not need to be annotated with
  1557. // parameters,
  1558. // you just need a single part with only the Part.text field set.
  1559. //
  1560. // If you want to annotate the training phrase, you must create
  1561. // multiple
  1562. // parts, where the fields of each part are populated in one of two
  1563. // ways:
  1564. //
  1565. // - `Part.text` is set to a part of the phrase that has no
  1566. // parameters.
  1567. // - `Part.text` is set to a part of the phrase that you want to
  1568. // annotate,
  1569. // and the `entity_type`, `alias`, and `user_defined` fields are
  1570. // all
  1571. // set.
  1572. Parts []*GoogleCloudDialogflowV2IntentTrainingPhrasePart `json:"parts,omitempty"`
  1573. // TimesAddedCount: Optional. Indicates how many times this example was
  1574. // added to
  1575. // the intent. Each time a developer adds an existing sample by editing
  1576. // an
  1577. // intent or training, this counter is increased.
  1578. TimesAddedCount int64 `json:"timesAddedCount,omitempty"`
  1579. // Type: Required. The type of the training phrase.
  1580. //
  1581. // Possible values:
  1582. // "TYPE_UNSPECIFIED" - Not specified. This value should never be
  1583. // used.
  1584. // "EXAMPLE" - Examples do not contain @-prefixed entity type names,
  1585. // but example parts
  1586. // can be annotated with entity types.
  1587. // "TEMPLATE" - Templates are not annotated with entity types, but
  1588. // they can contain
  1589. // @-prefixed entity type names as substrings.
  1590. // Template mode has been deprecated. Example mode is the only
  1591. // supported
  1592. // way to create new training phrases. If you have existing
  1593. // training
  1594. // phrases that you've created in template mode, those will continue
  1595. // to
  1596. // work.
  1597. Type string `json:"type,omitempty"`
  1598. // ForceSendFields is a list of field names (e.g. "Name") 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. "Name") to include in API
  1606. // requests with the JSON null value. By default, fields with empty
  1607. // values are omitted from API requests. However, any field with an
  1608. // 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 *GoogleCloudDialogflowV2IntentTrainingPhrase) MarshalJSON() ([]byte, error) {
  1614. type NoMethod GoogleCloudDialogflowV2IntentTrainingPhrase
  1615. raw := NoMethod(*s)
  1616. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1617. }
  1618. // GoogleCloudDialogflowV2IntentTrainingPhrasePart: Represents a part of
  1619. // a training phrase.
  1620. type GoogleCloudDialogflowV2IntentTrainingPhrasePart struct {
  1621. // Alias: Optional. The parameter name for the value extracted from
  1622. // the
  1623. // annotated part of the example.
  1624. // This field is required for annotated parts of the training phrase.
  1625. Alias string `json:"alias,omitempty"`
  1626. // EntityType: Optional. The entity type name prefixed with `@`.
  1627. // This field is required for annotated parts of the training phrase.
  1628. EntityType string `json:"entityType,omitempty"`
  1629. // Text: Required. The text for this part.
  1630. Text string `json:"text,omitempty"`
  1631. // UserDefined: Optional. Indicates whether the text was manually
  1632. // annotated.
  1633. // This field is set to true when the Dialogflow Console is used
  1634. // to
  1635. // manually annotate the part. When creating an annotated part with
  1636. // the
  1637. // API, you must set this to true.
  1638. UserDefined bool `json:"userDefined,omitempty"`
  1639. // ForceSendFields is a list of field names (e.g. "Alias") to
  1640. // unconditionally include in API requests. By default, fields with
  1641. // empty values are omitted from API requests. However, any non-pointer,
  1642. // non-interface field appearing in ForceSendFields will be sent to the
  1643. // server regardless of whether the field is empty or not. This may be
  1644. // used to include empty fields in Patch requests.
  1645. ForceSendFields []string `json:"-"`
  1646. // NullFields is a list of field names (e.g. "Alias") to include in API
  1647. // requests with the JSON null value. By default, fields with empty
  1648. // values are omitted from API requests. However, any field with an
  1649. // empty value appearing in NullFields will be sent to the server as
  1650. // null. It is an error if a field in this list has a non-empty value.
  1651. // This may be used to include null fields in Patch requests.
  1652. NullFields []string `json:"-"`
  1653. }
  1654. func (s *GoogleCloudDialogflowV2IntentTrainingPhrasePart) MarshalJSON() ([]byte, error) {
  1655. type NoMethod GoogleCloudDialogflowV2IntentTrainingPhrasePart
  1656. raw := NoMethod(*s)
  1657. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1658. }
  1659. // GoogleCloudDialogflowV2OriginalDetectIntentRequest: Represents the
  1660. // contents of the original request that was passed to
  1661. // the `[Streaming]DetectIntent` call.
  1662. type GoogleCloudDialogflowV2OriginalDetectIntentRequest struct {
  1663. // Payload: Optional. This field is set to the value of the
  1664. // `QueryParameters.payload`
  1665. // field passed in the request. Some integrations that query a
  1666. // Dialogflow
  1667. // agent may provide additional information in the payload.
  1668. //
  1669. // In particular for the Telephony Gateway this field has the
  1670. // form:
  1671. // <pre>{
  1672. // "telephony": {
  1673. // "caller_id": "+18558363987"
  1674. // }
  1675. // }</pre>
  1676. // Note: The caller ID field (`caller_id`) will be redacted for
  1677. // Standard
  1678. // Edition agents and populated with the caller ID in
  1679. // [E.164
  1680. // format](https://en.wikipedia.org/wiki/E.164) for Enterprise Edition
  1681. // agents.
  1682. Payload googleapi.RawMessage `json:"payload,omitempty"`
  1683. // Source: The source of this request, e.g., `google`, `facebook`,
  1684. // `slack`. It is set
  1685. // by Dialogflow-owned servers.
  1686. Source string `json:"source,omitempty"`
  1687. // Version: Optional. The version of the protocol used for this
  1688. // request.
  1689. // This field is AoG-specific.
  1690. Version string `json:"version,omitempty"`
  1691. // ForceSendFields is a list of field names (e.g. "Payload") to
  1692. // unconditionally include in API requests. By default, fields with
  1693. // empty values are omitted from API requests. However, any non-pointer,
  1694. // non-interface field appearing in ForceSendFields will be sent to the
  1695. // server regardless of whether the field is empty or not. This may be
  1696. // used to include empty fields in Patch requests.
  1697. ForceSendFields []string `json:"-"`
  1698. // NullFields is a list of field names (e.g. "Payload") to include in
  1699. // API requests with the JSON null value. By default, fields with empty
  1700. // values are omitted from API requests. However, any field with an
  1701. // empty value appearing in NullFields will be sent to the server as
  1702. // null. It is an error if a field in this list has a non-empty value.
  1703. // This may be used to include null fields in Patch requests.
  1704. NullFields []string `json:"-"`
  1705. }
  1706. func (s *GoogleCloudDialogflowV2OriginalDetectIntentRequest) MarshalJSON() ([]byte, error) {
  1707. type NoMethod GoogleCloudDialogflowV2OriginalDetectIntentRequest
  1708. raw := NoMethod(*s)
  1709. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1710. }
  1711. // GoogleCloudDialogflowV2QueryResult: Represents the result of
  1712. // conversational query or event processing.
  1713. type GoogleCloudDialogflowV2QueryResult struct {
  1714. // Action: The action name from the matched intent.
  1715. Action string `json:"action,omitempty"`
  1716. // AllRequiredParamsPresent: This field is set to:
  1717. // - `false` if the matched intent has required parameters and not all
  1718. // of
  1719. // the required parameter values have been collected.
  1720. // - `true` if all required parameter values have been collected, or if
  1721. // the
  1722. // matched intent doesn't contain any required parameters.
  1723. AllRequiredParamsPresent bool `json:"allRequiredParamsPresent,omitempty"`
  1724. // DiagnosticInfo: The free-form diagnostic info. For example, this
  1725. // field could contain
  1726. // webhook call latency. The string keys of the Struct's fields map can
  1727. // change
  1728. // without notice.
  1729. DiagnosticInfo googleapi.RawMessage `json:"diagnosticInfo,omitempty"`
  1730. // FulfillmentMessages: The collection of rich messages to present to
  1731. // the user.
  1732. FulfillmentMessages []*GoogleCloudDialogflowV2IntentMessage `json:"fulfillmentMessages,omitempty"`
  1733. // FulfillmentText: The text to be pronounced to the user or shown on
  1734. // the screen.
  1735. // Note: This is a legacy field, `fulfillment_messages` should be
  1736. // preferred.
  1737. FulfillmentText string `json:"fulfillmentText,omitempty"`
  1738. // Intent: The intent that matched the conversational query. Some,
  1739. // not
  1740. // all fields are filled in this message, including but not limited
  1741. // to:
  1742. // `name`, `display_name` and `webhook_state`.
  1743. Intent *GoogleCloudDialogflowV2Intent `json:"intent,omitempty"`
  1744. // IntentDetectionConfidence: The intent detection confidence. Values
  1745. // range from 0.0
  1746. // (completely uncertain) to 1.0 (completely certain).
  1747. // If there are `multiple knowledge_answers` messages, this value is set
  1748. // to
  1749. // the greatest `knowledgeAnswers.match_confidence` value in the list.
  1750. IntentDetectionConfidence float64 `json:"intentDetectionConfidence,omitempty"`
  1751. // LanguageCode: The language that was triggered during intent
  1752. // detection.
  1753. // See [Language
  1754. // Support](https://dialogflow.com/docs/reference/language)
  1755. // for a list of the currently supported language codes.
  1756. LanguageCode string `json:"languageCode,omitempty"`
  1757. // OutputContexts: The collection of output contexts. If
  1758. // applicable,
  1759. // `output_contexts.parameters` contains entries with name
  1760. // `<parameter name>.original` containing the original parameter
  1761. // values
  1762. // before the query.
  1763. OutputContexts []*GoogleCloudDialogflowV2Context `json:"outputContexts,omitempty"`
  1764. // Parameters: The collection of extracted parameters.
  1765. Parameters googleapi.RawMessage `json:"parameters,omitempty"`
  1766. // QueryText: The original conversational query text:
  1767. // - If natural language text was provided as input, `query_text`
  1768. // contains
  1769. // a copy of the input.
  1770. // - If natural language speech audio was provided as input,
  1771. // `query_text`
  1772. // contains the speech recognition result. If speech recognizer
  1773. // produced
  1774. // multiple alternatives, a particular one is picked.
  1775. // - If an event was provided as input, `query_text` is not set.
  1776. QueryText string `json:"queryText,omitempty"`
  1777. // SpeechRecognitionConfidence: The Speech recognition confidence
  1778. // between 0.0 and 1.0. A higher number
  1779. // indicates an estimated greater likelihood that the recognized words
  1780. // are
  1781. // correct. The default of 0.0 is a sentinel value indicating that
  1782. // confidence
  1783. // was not set.
  1784. //
  1785. // This field is not guaranteed to be accurate or set. In particular
  1786. // this
  1787. // field isn't set for StreamingDetectIntent since the streaming
  1788. // endpoint has
  1789. // separate confidence estimates per portion of the audio
  1790. // in
  1791. // StreamingRecognitionResult.
  1792. SpeechRecognitionConfidence float64 `json:"speechRecognitionConfidence,omitempty"`
  1793. // WebhookPayload: If the query was fulfilled by a webhook call, this
  1794. // field is set to the
  1795. // value of the `payload` field returned in the webhook response.
  1796. WebhookPayload googleapi.RawMessage `json:"webhookPayload,omitempty"`
  1797. // WebhookSource: If the query was fulfilled by a webhook call, this
  1798. // field is set to the
  1799. // value of the `source` field returned in the webhook response.
  1800. WebhookSource string `json:"webhookSource,omitempty"`
  1801. // ForceSendFields is a list of field names (e.g. "Action") to
  1802. // unconditionally include in API requests. By default, fields with
  1803. // empty values are omitted from API requests. However, any non-pointer,
  1804. // non-interface field appearing in ForceSendFields will be sent to the
  1805. // server regardless of whether the field is empty or not. This may be
  1806. // used to include empty fields in Patch requests.
  1807. ForceSendFields []string `json:"-"`
  1808. // NullFields is a list of field names (e.g. "Action") to include in API
  1809. // requests with the JSON null value. By default, fields with empty
  1810. // values are omitted from API requests. However, any field with an
  1811. // empty value appearing in NullFields will be sent to the server as
  1812. // null. It is an error if a field in this list has a non-empty value.
  1813. // This may be used to include null fields in Patch requests.
  1814. NullFields []string `json:"-"`
  1815. }
  1816. func (s *GoogleCloudDialogflowV2QueryResult) MarshalJSON() ([]byte, error) {
  1817. type NoMethod GoogleCloudDialogflowV2QueryResult
  1818. raw := NoMethod(*s)
  1819. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1820. }
  1821. func (s *GoogleCloudDialogflowV2QueryResult) UnmarshalJSON(data []byte) error {
  1822. type NoMethod GoogleCloudDialogflowV2QueryResult
  1823. var s1 struct {
  1824. IntentDetectionConfidence gensupport.JSONFloat64 `json:"intentDetectionConfidence"`
  1825. SpeechRecognitionConfidence gensupport.JSONFloat64 `json:"speechRecognitionConfidence"`
  1826. *NoMethod
  1827. }
  1828. s1.NoMethod = (*NoMethod)(s)
  1829. if err := json.Unmarshal(data, &s1); err != nil {
  1830. return err
  1831. }
  1832. s.IntentDetectionConfidence = float64(s1.IntentDetectionConfidence)
  1833. s.SpeechRecognitionConfidence = float64(s1.SpeechRecognitionConfidence)
  1834. return nil
  1835. }
  1836. // GoogleCloudDialogflowV2WebhookRequest: The request message for a
  1837. // webhook call.
  1838. type GoogleCloudDialogflowV2WebhookRequest struct {
  1839. // OriginalDetectIntentRequest: Optional. The contents of the original
  1840. // request that was passed to
  1841. // `[Streaming]DetectIntent` call.
  1842. OriginalDetectIntentRequest *GoogleCloudDialogflowV2OriginalDetectIntentRequest `json:"originalDetectIntentRequest,omitempty"`
  1843. // QueryResult: The result of the conversational query or event
  1844. // processing. Contains the
  1845. // same value as `[Streaming]DetectIntentResponse.query_result`.
  1846. QueryResult *GoogleCloudDialogflowV2QueryResult `json:"queryResult,omitempty"`
  1847. // ResponseId: The unique identifier of the response. Contains the same
  1848. // value as
  1849. // `[Streaming]DetectIntentResponse.response_id`.
  1850. ResponseId string `json:"responseId,omitempty"`
  1851. // Session: The unique identifier of detectIntent request session.
  1852. // Can be used to identify end-user inside webhook
  1853. // implementation.
  1854. // Format: `projects/<Project ID>/agent/sessions/<Session ID>`,
  1855. // or
  1856. // `projects/<Project ID>/agent/environments/<Environment
  1857. // ID>/users/<User
  1858. // ID>/sessions/<Session ID>`.
  1859. Session string `json:"session,omitempty"`
  1860. // ForceSendFields is a list of field names (e.g.
  1861. // "OriginalDetectIntentRequest") to unconditionally include in API
  1862. // requests. By default, fields with empty values are omitted from API
  1863. // requests. However, any non-pointer, non-interface field appearing in
  1864. // ForceSendFields will be sent to the server regardless of whether the
  1865. // field is empty or not. This may be used to include empty fields in
  1866. // Patch requests.
  1867. ForceSendFields []string `json:"-"`
  1868. // NullFields is a list of field names (e.g.
  1869. // "OriginalDetectIntentRequest") to include in API requests with the
  1870. // JSON null value. By default, fields with empty values are omitted
  1871. // from API requests. However, any field with an empty value appearing
  1872. // in NullFields will be sent to the server as null. It is an error if a
  1873. // field in this list has a non-empty value. This may be used to include
  1874. // null fields in Patch requests.
  1875. NullFields []string `json:"-"`
  1876. }
  1877. func (s *GoogleCloudDialogflowV2WebhookRequest) MarshalJSON() ([]byte, error) {
  1878. type NoMethod GoogleCloudDialogflowV2WebhookRequest
  1879. raw := NoMethod(*s)
  1880. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1881. }
  1882. // GoogleCloudDialogflowV2WebhookResponse: The response message for a
  1883. // webhook call.
  1884. type GoogleCloudDialogflowV2WebhookResponse struct {
  1885. // FollowupEventInput: Optional. Makes the platform immediately invoke
  1886. // another `DetectIntent` call
  1887. // internally with the specified event as input.
  1888. FollowupEventInput *GoogleCloudDialogflowV2EventInput `json:"followupEventInput,omitempty"`
  1889. // FulfillmentMessages: Optional. The collection of rich messages to
  1890. // present to the user. This
  1891. // value is passed directly to `QueryResult.fulfillment_messages`.
  1892. FulfillmentMessages []*GoogleCloudDialogflowV2IntentMessage `json:"fulfillmentMessages,omitempty"`
  1893. // FulfillmentText: Optional. The text to be shown on the screen. This
  1894. // value is passed directly
  1895. // to `QueryResult.fulfillment_text`.
  1896. FulfillmentText string `json:"fulfillmentText,omitempty"`
  1897. // OutputContexts: Optional. The collection of output contexts. This
  1898. // value is passed directly
  1899. // to `QueryResult.output_contexts`.
  1900. OutputContexts []*GoogleCloudDialogflowV2Context `json:"outputContexts,omitempty"`
  1901. // Payload: Optional. This value is passed directly to
  1902. // `QueryResult.webhook_payload`.
  1903. // See the related `fulfillment_messages[i].payload field`, which may be
  1904. // used
  1905. // as an alternative to this field.
  1906. //
  1907. // This field can be used for Actions on Google responses.
  1908. // It should have a structure similar to the JSON message shown here.
  1909. // For more
  1910. // information, see
  1911. // [Actions on Google
  1912. // Webhook
  1913. // Format](https://developers.google.com/actions/dialogflow/webho
  1914. // ok)
  1915. // <pre>{
  1916. // "google": {
  1917. // "expectUserResponse": true,
  1918. // "richResponse": {
  1919. // "items": [
  1920. // {
  1921. // "simpleResponse": {
  1922. // "textToSpeech": "this is a simple response"
  1923. // }
  1924. // }
  1925. // ]
  1926. // }
  1927. // }
  1928. // }</pre>
  1929. Payload googleapi.RawMessage `json:"payload,omitempty"`
  1930. // Source: Optional. This value is passed directly to
  1931. // `QueryResult.webhook_source`.
  1932. Source string `json:"source,omitempty"`
  1933. // ForceSendFields is a list of field names (e.g. "FollowupEventInput")
  1934. // to unconditionally include in API requests. By default, fields with
  1935. // empty values are omitted from API requests. However, any non-pointer,
  1936. // non-interface field appearing in ForceSendFields will be sent to the
  1937. // server regardless of whether the field is empty or not. This may be
  1938. // used to include empty fields in Patch requests.
  1939. ForceSendFields []string `json:"-"`
  1940. // NullFields is a list of field names (e.g. "FollowupEventInput") to
  1941. // include in API requests with the JSON null value. By default, fields
  1942. // with empty values are omitted from API requests. However, any field
  1943. // with an empty value appearing in NullFields will be sent to the
  1944. // server as null. It is an error if a field in this list has a
  1945. // non-empty value. This may be used to include null fields in Patch
  1946. // requests.
  1947. NullFields []string `json:"-"`
  1948. }
  1949. func (s *GoogleCloudDialogflowV2WebhookResponse) MarshalJSON() ([]byte, error) {
  1950. type NoMethod GoogleCloudDialogflowV2WebhookResponse
  1951. raw := NoMethod(*s)
  1952. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1953. }
  1954. // GoogleCloudDialogflowV2beta1Agent: Represents a conversational agent.
  1955. type GoogleCloudDialogflowV2beta1Agent struct {
  1956. // AvatarUri: Optional. The URI of the agent's avatar.
  1957. // Avatars are used throughout the Dialogflow console and in the
  1958. // self-hosted
  1959. // [Web Demo](https://dialogflow.com/docs/integrations/web-demo)
  1960. // integration.
  1961. AvatarUri string `json:"avatarUri,omitempty"`
  1962. // ClassificationThreshold: Optional. To filter out false positive
  1963. // results and still get variety in
  1964. // matched natural language inputs for your agent, you can tune the
  1965. // machine
  1966. // learning classification threshold. If the returned score value is
  1967. // less than
  1968. // the threshold value, then a fallback intent will be triggered or, if
  1969. // there
  1970. // are no fallback intents defined, no intent will be triggered. The
  1971. // score
  1972. // values range from 0.0 (completely uncertain) to 1.0 (completely
  1973. // certain).
  1974. // If set to 0.0, the default of 0.3 is used.
  1975. ClassificationThreshold float64 `json:"classificationThreshold,omitempty"`
  1976. // DefaultLanguageCode: Required. The default language of the agent as a
  1977. // language tag. See
  1978. // [Language Support](https://dialogflow.com/docs/reference/language)
  1979. // for a
  1980. // list of the currently supported language codes.
  1981. // This field cannot be set by the `Update` method.
  1982. DefaultLanguageCode string `json:"defaultLanguageCode,omitempty"`
  1983. // Description: Optional. The description of this agent.
  1984. // The maximum length is 500 characters. If exceeded, the request is
  1985. // rejected.
  1986. Description string `json:"description,omitempty"`
  1987. // DisplayName: Required. The name of this agent.
  1988. DisplayName string `json:"displayName,omitempty"`
  1989. // EnableLogging: Optional. Determines whether this agent should log
  1990. // conversation queries.
  1991. EnableLogging bool `json:"enableLogging,omitempty"`
  1992. // MatchMode: Optional. Determines how intents are detected from user
  1993. // queries.
  1994. //
  1995. // Possible values:
  1996. // "MATCH_MODE_UNSPECIFIED" - Not specified.
  1997. // "MATCH_MODE_HYBRID" - Best for agents with a small number of
  1998. // examples in intents and/or wide
  1999. // use of templates syntax and composite entities.
  2000. // "MATCH_MODE_ML_ONLY" - Can be used for agents with a large number
  2001. // of examples in intents,
  2002. // especially the ones using @sys.any or very large developer entities.
  2003. MatchMode string `json:"matchMode,omitempty"`
  2004. // Parent: Required. The project of this agent.
  2005. // Format: `projects/<Project ID>`.
  2006. Parent string `json:"parent,omitempty"`
  2007. // SupportedLanguageCodes: Optional. The list of all languages supported
  2008. // by this agent (except for the
  2009. // `default_language_code`).
  2010. SupportedLanguageCodes []string `json:"supportedLanguageCodes,omitempty"`
  2011. // TimeZone: Required. The time zone of this agent from the
  2012. // [time zone database](https://www.iana.org/time-zones),
  2013. // e.g.,
  2014. // America/New_York, Europe/Paris.
  2015. TimeZone string `json:"timeZone,omitempty"`
  2016. // ServerResponse contains the HTTP response code and headers from the
  2017. // server.
  2018. googleapi.ServerResponse `json:"-"`
  2019. // ForceSendFields is a list of field names (e.g. "AvatarUri") to
  2020. // unconditionally include in API requests. By default, fields with
  2021. // empty values are omitted from API requests. However, any non-pointer,
  2022. // non-interface field appearing in ForceSendFields will be sent to the
  2023. // server regardless of whether the field is empty or not. This may be
  2024. // used to include empty fields in Patch requests.
  2025. ForceSendFields []string `json:"-"`
  2026. // NullFields is a list of field names (e.g. "AvatarUri") to include in
  2027. // API requests with the JSON null value. By default, fields with empty
  2028. // values are omitted from API requests. However, any field with an
  2029. // empty value appearing in NullFields will be sent to the server as
  2030. // null. It is an error if a field in this list has a non-empty value.
  2031. // This may be used to include null fields in Patch requests.
  2032. NullFields []string `json:"-"`
  2033. }
  2034. func (s *GoogleCloudDialogflowV2beta1Agent) MarshalJSON() ([]byte, error) {
  2035. type NoMethod GoogleCloudDialogflowV2beta1Agent
  2036. raw := NoMethod(*s)
  2037. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2038. }
  2039. func (s *GoogleCloudDialogflowV2beta1Agent) UnmarshalJSON(data []byte) error {
  2040. type NoMethod GoogleCloudDialogflowV2beta1Agent
  2041. var s1 struct {
  2042. ClassificationThreshold gensupport.JSONFloat64 `json:"classificationThreshold"`
  2043. *NoMethod
  2044. }
  2045. s1.NoMethod = (*NoMethod)(s)
  2046. if err := json.Unmarshal(data, &s1); err != nil {
  2047. return err
  2048. }
  2049. s.ClassificationThreshold = float64(s1.ClassificationThreshold)
  2050. return nil
  2051. }
  2052. // GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest: The request
  2053. // message for EntityTypes.BatchCreateEntities.
  2054. type GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest struct {
  2055. // Entities: Required. The entities to create.
  2056. Entities []*GoogleCloudDialogflowV2beta1EntityTypeEntity `json:"entities,omitempty"`
  2057. // LanguageCode: Optional. The language of entity synonyms defined in
  2058. // `entities`. If not
  2059. // specified, the agent's default language is used.
  2060. // [More than a
  2061. // dozen
  2062. // languages](https://dialogflow.com/docs/reference/language) are
  2063. // supported.
  2064. // Note: languages must be enabled in the agent, before they can be
  2065. // used.
  2066. LanguageCode string `json:"languageCode,omitempty"`
  2067. // ForceSendFields is a list of field names (e.g. "Entities") to
  2068. // unconditionally include in API requests. By default, fields with
  2069. // empty values are omitted from API requests. However, any non-pointer,
  2070. // non-interface field appearing in ForceSendFields will be sent to the
  2071. // server regardless of whether the field is empty or not. This may be
  2072. // used to include empty fields in Patch requests.
  2073. ForceSendFields []string `json:"-"`
  2074. // NullFields is a list of field names (e.g. "Entities") to include in
  2075. // API requests with the JSON null value. By default, fields with empty
  2076. // values are omitted from API requests. However, any field with an
  2077. // empty value appearing in NullFields will be sent to the server as
  2078. // null. It is an error if a field in this list has a non-empty value.
  2079. // This may be used to include null fields in Patch requests.
  2080. NullFields []string `json:"-"`
  2081. }
  2082. func (s *GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest) MarshalJSON() ([]byte, error) {
  2083. type NoMethod GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest
  2084. raw := NoMethod(*s)
  2085. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2086. }
  2087. // GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest: The request
  2088. // message for EntityTypes.BatchDeleteEntities.
  2089. type GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest struct {
  2090. // EntityValues: Required. The canonical `values` of the entities to
  2091. // delete. Note that
  2092. // these are not fully-qualified names, i.e. they don't start
  2093. // with
  2094. // `projects/<Project ID>`.
  2095. EntityValues []string `json:"entityValues,omitempty"`
  2096. // LanguageCode: Optional. The language of entity synonyms defined in
  2097. // `entities`. If not
  2098. // specified, the agent's default language is used.
  2099. // [More than a
  2100. // dozen
  2101. // languages](https://dialogflow.com/docs/reference/language) are
  2102. // supported.
  2103. // Note: languages must be enabled in the agent, before they can be
  2104. // used.
  2105. LanguageCode string `json:"languageCode,omitempty"`
  2106. // ForceSendFields is a list of field names (e.g. "EntityValues") to
  2107. // unconditionally include in API requests. By default, fields with
  2108. // empty values are omitted from API requests. However, any non-pointer,
  2109. // non-interface field appearing in ForceSendFields will be sent to the
  2110. // server regardless of whether the field is empty or not. This may be
  2111. // used to include empty fields in Patch requests.
  2112. ForceSendFields []string `json:"-"`
  2113. // NullFields is a list of field names (e.g. "EntityValues") to include
  2114. // in API requests with the JSON null value. By default, fields with
  2115. // empty values are omitted from API requests. However, any field with
  2116. // an empty value appearing in NullFields will be sent to the server as
  2117. // null. It is an error if a field in this list has a non-empty value.
  2118. // This may be used to include null fields in Patch requests.
  2119. NullFields []string `json:"-"`
  2120. }
  2121. func (s *GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest) MarshalJSON() ([]byte, error) {
  2122. type NoMethod GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest
  2123. raw := NoMethod(*s)
  2124. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2125. }
  2126. // GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest: The
  2127. // request message for EntityTypes.BatchDeleteEntityTypes.
  2128. type GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest struct {
  2129. // EntityTypeNames: Required. The names entity types to delete. All
  2130. // names must point to the
  2131. // same agent as `parent`.
  2132. EntityTypeNames []string `json:"entityTypeNames,omitempty"`
  2133. // ForceSendFields is a list of field names (e.g. "EntityTypeNames") to
  2134. // unconditionally include in API requests. By default, fields with
  2135. // empty values are omitted from API requests. However, any non-pointer,
  2136. // non-interface field appearing in ForceSendFields will be sent to the
  2137. // server regardless of whether the field is empty or not. This may be
  2138. // used to include empty fields in Patch requests.
  2139. ForceSendFields []string `json:"-"`
  2140. // NullFields is a list of field names (e.g. "EntityTypeNames") to
  2141. // include in API requests with the JSON null value. By default, fields
  2142. // with empty values are omitted from API requests. However, any field
  2143. // with an empty value appearing in NullFields will be sent to the
  2144. // server as null. It is an error if a field in this list has a
  2145. // non-empty value. This may be used to include null fields in Patch
  2146. // requests.
  2147. NullFields []string `json:"-"`
  2148. }
  2149. func (s *GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest) MarshalJSON() ([]byte, error) {
  2150. type NoMethod GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest
  2151. raw := NoMethod(*s)
  2152. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2153. }
  2154. // GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest: The request
  2155. // message for Intents.BatchDeleteIntents.
  2156. type GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest struct {
  2157. // Intents: Required. The collection of intents to delete. Only intent
  2158. // `name` must be
  2159. // filled in.
  2160. Intents []*GoogleCloudDialogflowV2beta1Intent `json:"intents,omitempty"`
  2161. // ForceSendFields is a list of field names (e.g. "Intents") to
  2162. // unconditionally include in API requests. By default, fields with
  2163. // empty values are omitted from API requests. However, any non-pointer,
  2164. // non-interface field appearing in ForceSendFields will be sent to the
  2165. // server regardless of whether the field is empty or not. This may be
  2166. // used to include empty fields in Patch requests.
  2167. ForceSendFields []string `json:"-"`
  2168. // NullFields is a list of field names (e.g. "Intents") to include in
  2169. // API requests with the JSON null value. By default, fields with empty
  2170. // values are omitted from API requests. However, any field with an
  2171. // empty value appearing in NullFields will be sent to the server as
  2172. // null. It is an error if a field in this list has a non-empty value.
  2173. // This may be used to include null fields in Patch requests.
  2174. NullFields []string `json:"-"`
  2175. }
  2176. func (s *GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest) MarshalJSON() ([]byte, error) {
  2177. type NoMethod GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest
  2178. raw := NoMethod(*s)
  2179. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2180. }
  2181. // GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest: The request
  2182. // message for EntityTypes.BatchUpdateEntities.
  2183. type GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest struct {
  2184. // Entities: Required. The entities to update or create.
  2185. Entities []*GoogleCloudDialogflowV2beta1EntityTypeEntity `json:"entities,omitempty"`
  2186. // LanguageCode: Optional. The language of entity synonyms defined in
  2187. // `entities`. If not
  2188. // specified, the agent's default language is used.
  2189. // [More than a
  2190. // dozen
  2191. // languages](https://dialogflow.com/docs/reference/language) are
  2192. // supported.
  2193. // Note: languages must be enabled in the agent, before they can be
  2194. // used.
  2195. LanguageCode string `json:"languageCode,omitempty"`
  2196. // UpdateMask: Optional. The mask to control which fields get updated.
  2197. UpdateMask string `json:"updateMask,omitempty"`
  2198. // ForceSendFields is a list of field names (e.g. "Entities") to
  2199. // unconditionally include in API requests. By default, fields with
  2200. // empty values are omitted from API requests. However, any non-pointer,
  2201. // non-interface field appearing in ForceSendFields will be sent to the
  2202. // server regardless of whether the field is empty or not. This may be
  2203. // used to include empty fields in Patch requests.
  2204. ForceSendFields []string `json:"-"`
  2205. // NullFields is a list of field names (e.g. "Entities") to include in
  2206. // API requests with the JSON null value. By default, fields with empty
  2207. // values are omitted from API requests. However, any field with an
  2208. // empty value appearing in NullFields will be sent to the server as
  2209. // null. It is an error if a field in this list has a non-empty value.
  2210. // This may be used to include null fields in Patch requests.
  2211. NullFields []string `json:"-"`
  2212. }
  2213. func (s *GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest) MarshalJSON() ([]byte, error) {
  2214. type NoMethod GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest
  2215. raw := NoMethod(*s)
  2216. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2217. }
  2218. // GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesRequest: The
  2219. // request message for EntityTypes.BatchUpdateEntityTypes.
  2220. type GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesRequest struct {
  2221. // EntityTypeBatchInline: The collection of entity types to update or
  2222. // create.
  2223. EntityTypeBatchInline *GoogleCloudDialogflowV2beta1EntityTypeBatch `json:"entityTypeBatchInline,omitempty"`
  2224. // EntityTypeBatchUri: The URI to a Google Cloud Storage file containing
  2225. // entity types to update
  2226. // or create. The file format can either be a serialized proto
  2227. // (of
  2228. // EntityBatch type) or a JSON object. Note: The URI must start
  2229. // with
  2230. // "gs://".
  2231. EntityTypeBatchUri string `json:"entityTypeBatchUri,omitempty"`
  2232. // LanguageCode: Optional. The language of entity synonyms defined in
  2233. // `entity_types`. If not
  2234. // specified, the agent's default language is used.
  2235. // [More than a
  2236. // dozen
  2237. // languages](https://dialogflow.com/docs/reference/language) are
  2238. // supported.
  2239. // Note: languages must be enabled in the agent, before they can be
  2240. // used.
  2241. LanguageCode string `json:"languageCode,omitempty"`
  2242. // UpdateMask: Optional. The mask to control which fields get updated.
  2243. UpdateMask string `json:"updateMask,omitempty"`
  2244. // ForceSendFields is a list of field names (e.g.
  2245. // "EntityTypeBatchInline") to unconditionally include in API requests.
  2246. // By default, fields with empty values are omitted from API requests.
  2247. // However, any non-pointer, non-interface field appearing in
  2248. // ForceSendFields will be sent to the server regardless of whether the
  2249. // field is empty or not. This may be used to include empty fields in
  2250. // Patch requests.
  2251. ForceSendFields []string `json:"-"`
  2252. // NullFields is a list of field names (e.g. "EntityTypeBatchInline") to
  2253. // include in API requests with the JSON null value. By default, fields
  2254. // with empty values are omitted from API requests. However, any field
  2255. // with an empty value appearing in NullFields will be sent to the
  2256. // server as null. It is an error if a field in this list has a
  2257. // non-empty value. This may be used to include null fields in Patch
  2258. // requests.
  2259. NullFields []string `json:"-"`
  2260. }
  2261. func (s *GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesRequest) MarshalJSON() ([]byte, error) {
  2262. type NoMethod GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesRequest
  2263. raw := NoMethod(*s)
  2264. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2265. }
  2266. // GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesResponse: The
  2267. // response message for EntityTypes.BatchUpdateEntityTypes.
  2268. type GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesResponse struct {
  2269. // EntityTypes: The collection of updated or created entity types.
  2270. EntityTypes []*GoogleCloudDialogflowV2beta1EntityType `json:"entityTypes,omitempty"`
  2271. // ForceSendFields is a list of field names (e.g. "EntityTypes") 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. "EntityTypes") to include
  2279. // in API requests with the JSON null value. By default, fields with
  2280. // empty values are omitted from API requests. However, any field with
  2281. // an empty value appearing in NullFields will be sent to the server as
  2282. // null. It is an error if a field in this list has a non-empty value.
  2283. // This may be used to include null fields in Patch requests.
  2284. NullFields []string `json:"-"`
  2285. }
  2286. func (s *GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesResponse) MarshalJSON() ([]byte, error) {
  2287. type NoMethod GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesResponse
  2288. raw := NoMethod(*s)
  2289. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2290. }
  2291. // GoogleCloudDialogflowV2beta1BatchUpdateIntentsRequest: The request
  2292. // message for Intents.BatchUpdateIntents.
  2293. type GoogleCloudDialogflowV2beta1BatchUpdateIntentsRequest struct {
  2294. // IntentBatchInline: The collection of intents to update or create.
  2295. IntentBatchInline *GoogleCloudDialogflowV2beta1IntentBatch `json:"intentBatchInline,omitempty"`
  2296. // IntentBatchUri: The URI to a Google Cloud Storage file containing
  2297. // intents to update or
  2298. // create. The file format can either be a serialized proto (of
  2299. // IntentBatch
  2300. // type) or JSON object. Note: The URI must start with "gs://".
  2301. IntentBatchUri string `json:"intentBatchUri,omitempty"`
  2302. // IntentView: Optional. The resource view to apply to the returned
  2303. // intent.
  2304. //
  2305. // Possible values:
  2306. // "INTENT_VIEW_UNSPECIFIED" - Training phrases field is not populated
  2307. // in the response.
  2308. // "INTENT_VIEW_FULL" - All fields are populated.
  2309. IntentView string `json:"intentView,omitempty"`
  2310. // LanguageCode: Optional. The language of training phrases, parameters
  2311. // and rich messages
  2312. // defined in `intents`. If not specified, the agent's default language
  2313. // is
  2314. // used. [More than a
  2315. // dozen
  2316. // languages](https://dialogflow.com/docs/reference/language) are
  2317. // supported.
  2318. // Note: languages must be enabled in the agent, before they can be
  2319. // used.
  2320. LanguageCode string `json:"languageCode,omitempty"`
  2321. // UpdateMask: Optional. The mask to control which fields get updated.
  2322. UpdateMask string `json:"updateMask,omitempty"`
  2323. // ForceSendFields is a list of field names (e.g. "IntentBatchInline")
  2324. // to unconditionally include in API requests. By default, fields with
  2325. // empty values are omitted from API requests. However, any non-pointer,
  2326. // non-interface field appearing in ForceSendFields will be sent to the
  2327. // server regardless of whether the field is empty or not. This may be
  2328. // used to include empty fields in Patch requests.
  2329. ForceSendFields []string `json:"-"`
  2330. // NullFields is a list of field names (e.g. "IntentBatchInline") to
  2331. // include in API requests with the JSON null value. By default, fields
  2332. // with empty values are omitted from API requests. However, any field
  2333. // with an empty value appearing in NullFields will be sent to the
  2334. // server as null. It is an error if a field in this list has a
  2335. // non-empty value. This may be used to include null fields in Patch
  2336. // requests.
  2337. NullFields []string `json:"-"`
  2338. }
  2339. func (s *GoogleCloudDialogflowV2beta1BatchUpdateIntentsRequest) MarshalJSON() ([]byte, error) {
  2340. type NoMethod GoogleCloudDialogflowV2beta1BatchUpdateIntentsRequest
  2341. raw := NoMethod(*s)
  2342. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2343. }
  2344. // GoogleCloudDialogflowV2beta1BatchUpdateIntentsResponse: The response
  2345. // message for Intents.BatchUpdateIntents.
  2346. type GoogleCloudDialogflowV2beta1BatchUpdateIntentsResponse struct {
  2347. // Intents: The collection of updated or created intents.
  2348. Intents []*GoogleCloudDialogflowV2beta1Intent `json:"intents,omitempty"`
  2349. // ForceSendFields is a list of field names (e.g. "Intents") to
  2350. // unconditionally include in API requests. By default, fields with
  2351. // empty values are omitted from API requests. However, any non-pointer,
  2352. // non-interface field appearing in ForceSendFields will be sent to the
  2353. // server regardless of whether the field is empty or not. This may be
  2354. // used to include empty fields in Patch requests.
  2355. ForceSendFields []string `json:"-"`
  2356. // NullFields is a list of field names (e.g. "Intents") to include in
  2357. // API requests with the JSON null value. By default, fields with empty
  2358. // values are omitted from API requests. However, any field with an
  2359. // empty value appearing in NullFields will be sent to the server as
  2360. // null. It is an error if a field in this list has a non-empty value.
  2361. // This may be used to include null fields in Patch requests.
  2362. NullFields []string `json:"-"`
  2363. }
  2364. func (s *GoogleCloudDialogflowV2beta1BatchUpdateIntentsResponse) MarshalJSON() ([]byte, error) {
  2365. type NoMethod GoogleCloudDialogflowV2beta1BatchUpdateIntentsResponse
  2366. raw := NoMethod(*s)
  2367. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2368. }
  2369. // GoogleCloudDialogflowV2beta1Context: Represents a context.
  2370. type GoogleCloudDialogflowV2beta1Context struct {
  2371. // LifespanCount: Optional. The number of conversational query requests
  2372. // after which the
  2373. // context expires. If set to `0` (the default) the context
  2374. // expires
  2375. // immediately. Contexts expire automatically after 20 minutes if
  2376. // there
  2377. // are no matching queries.
  2378. LifespanCount int64 `json:"lifespanCount,omitempty"`
  2379. // Name: Required. The unique identifier of the context.
  2380. // Format:
  2381. // `projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context
  2382. // ID>`,
  2383. // or `projects/<Project ID>/agent/environments/<Environment
  2384. // ID>/users/<User
  2385. // ID>/sessions/<Session ID>/contexts/<Context ID>`.
  2386. //
  2387. // The `Context ID` is always converted to lowercase, may only
  2388. // contain
  2389. // characters in a-zA-Z0-9_-% and may be at most 250 bytes long.
  2390. //
  2391. // If `Environment ID` is not specified, we assume default
  2392. // 'draft'
  2393. // environment. If `User ID` is not specified, we assume default '-'
  2394. // user.
  2395. Name string `json:"name,omitempty"`
  2396. // Parameters: Optional. The collection of parameters associated with
  2397. // this context.
  2398. // Refer to [this
  2399. // doc](https://dialogflow.com/docs/actions-and-parameters) for
  2400. // syntax.
  2401. Parameters googleapi.RawMessage `json:"parameters,omitempty"`
  2402. // ServerResponse contains the HTTP response code and headers from the
  2403. // server.
  2404. googleapi.ServerResponse `json:"-"`
  2405. // ForceSendFields is a list of field names (e.g. "LifespanCount") to
  2406. // unconditionally include in API requests. By default, fields with
  2407. // empty values are omitted from API requests. However, any non-pointer,
  2408. // non-interface field appearing in ForceSendFields will be sent to the
  2409. // server regardless of whether the field is empty or not. This may be
  2410. // used to include empty fields in Patch requests.
  2411. ForceSendFields []string `json:"-"`
  2412. // NullFields is a list of field names (e.g. "LifespanCount") to include
  2413. // in API requests with the JSON null value. By default, fields with
  2414. // empty values are omitted from API requests. However, any field with
  2415. // an empty value appearing in NullFields will be sent to the server as
  2416. // null. It is an error if a field in this list has a non-empty value.
  2417. // This may be used to include null fields in Patch requests.
  2418. NullFields []string `json:"-"`
  2419. }
  2420. func (s *GoogleCloudDialogflowV2beta1Context) MarshalJSON() ([]byte, error) {
  2421. type NoMethod GoogleCloudDialogflowV2beta1Context
  2422. raw := NoMethod(*s)
  2423. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2424. }
  2425. // GoogleCloudDialogflowV2beta1DetectIntentRequest: The request to
  2426. // detect user's intent.
  2427. type GoogleCloudDialogflowV2beta1DetectIntentRequest struct {
  2428. // InputAudio: Optional. The natural language speech audio to be
  2429. // processed. This field
  2430. // should be populated iff `query_input` is set to an input audio
  2431. // config.
  2432. // A single request can contain up to 1 minute of speech audio data.
  2433. InputAudio string `json:"inputAudio,omitempty"`
  2434. // OutputAudioConfig: Optional. Instructs the speech synthesizer how to
  2435. // generate the output
  2436. // audio. If this field is not set and agent-level speech synthesizer is
  2437. // not
  2438. // configured, no output audio is generated.
  2439. OutputAudioConfig *GoogleCloudDialogflowV2beta1OutputAudioConfig `json:"outputAudioConfig,omitempty"`
  2440. // QueryInput: Required. The input specification. It can be set to:
  2441. //
  2442. // 1. an audio config
  2443. // which instructs the speech recognizer how to process the speech
  2444. // audio,
  2445. //
  2446. // 2. a conversational query in the form of text, or
  2447. //
  2448. // 3. an event that specifies which intent to trigger.
  2449. QueryInput *GoogleCloudDialogflowV2beta1QueryInput `json:"queryInput,omitempty"`
  2450. // QueryParams: Optional. The parameters of this query.
  2451. QueryParams *GoogleCloudDialogflowV2beta1QueryParameters `json:"queryParams,omitempty"`
  2452. // ForceSendFields is a list of field names (e.g. "InputAudio") to
  2453. // unconditionally include in API requests. By default, fields with
  2454. // empty values are omitted from API requests. However, any non-pointer,
  2455. // non-interface field appearing in ForceSendFields will be sent to the
  2456. // server regardless of whether the field is empty or not. This may be
  2457. // used to include empty fields in Patch requests.
  2458. ForceSendFields []string `json:"-"`
  2459. // NullFields is a list of field names (e.g. "InputAudio") to include in
  2460. // API requests with the JSON null value. By default, fields with empty
  2461. // values are omitted from API requests. However, any field with an
  2462. // empty value appearing in NullFields will be sent to the server as
  2463. // null. It is an error if a field in this list has a non-empty value.
  2464. // This may be used to include null fields in Patch requests.
  2465. NullFields []string `json:"-"`
  2466. }
  2467. func (s *GoogleCloudDialogflowV2beta1DetectIntentRequest) MarshalJSON() ([]byte, error) {
  2468. type NoMethod GoogleCloudDialogflowV2beta1DetectIntentRequest
  2469. raw := NoMethod(*s)
  2470. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2471. }
  2472. // GoogleCloudDialogflowV2beta1DetectIntentResponse: The message
  2473. // returned from the DetectIntent method.
  2474. type GoogleCloudDialogflowV2beta1DetectIntentResponse struct {
  2475. // AlternativeQueryResults: If Knowledge Connectors are enabled, there
  2476. // could be more than one result
  2477. // returned for a given query or event, and this field will contain
  2478. // all
  2479. // results except for the top one, which is captured in query_result.
  2480. // The
  2481. // alternative results are ordered by
  2482. // decreasing
  2483. // `QueryResult.intent_detection_confidence`. If Knowledge Connectors
  2484. // are
  2485. // disabled, this field will be empty until multiple responses for
  2486. // regular
  2487. // intents are supported, at which point those additional results will
  2488. // be
  2489. // surfaced here.
  2490. AlternativeQueryResults []*GoogleCloudDialogflowV2beta1QueryResult `json:"alternativeQueryResults,omitempty"`
  2491. // OutputAudio: The audio data bytes encoded as specified in the
  2492. // request.
  2493. // Note: The output audio is generated based on the values of default
  2494. // platform
  2495. // text responses found in the `query_result.fulfillment_messages`
  2496. // field. If
  2497. // multiple default text responses exist, they will be concatenated
  2498. // when
  2499. // generating audio. If no default platform text responses exist,
  2500. // the
  2501. // generated audio content will be empty.
  2502. OutputAudio string `json:"outputAudio,omitempty"`
  2503. // OutputAudioConfig: Instructs the speech synthesizer how to generate
  2504. // the output audio. This
  2505. // field is populated from the agent-level speech synthesizer
  2506. // configuration,
  2507. // if enabled.
  2508. OutputAudioConfig *GoogleCloudDialogflowV2beta1OutputAudioConfig `json:"outputAudioConfig,omitempty"`
  2509. // QueryResult: The selected results of the conversational query or
  2510. // event processing.
  2511. // See `alternative_query_results` for additional potential results.
  2512. QueryResult *GoogleCloudDialogflowV2beta1QueryResult `json:"queryResult,omitempty"`
  2513. // ResponseId: The unique identifier of the response. It can be used
  2514. // to
  2515. // locate a response in the training example set or for reporting
  2516. // issues.
  2517. ResponseId string `json:"responseId,omitempty"`
  2518. // WebhookStatus: Specifies the status of the webhook request.
  2519. WebhookStatus *GoogleRpcStatus `json:"webhookStatus,omitempty"`
  2520. // ServerResponse contains the HTTP response code and headers from the
  2521. // server.
  2522. googleapi.ServerResponse `json:"-"`
  2523. // ForceSendFields is a list of field names (e.g.
  2524. // "AlternativeQueryResults") to unconditionally include in API
  2525. // requests. By default, fields with empty values are omitted from API
  2526. // requests. However, any non-pointer, non-interface field appearing in
  2527. // ForceSendFields will be sent to the server regardless of whether the
  2528. // field is empty or not. This may be used to include empty fields in
  2529. // Patch requests.
  2530. ForceSendFields []string `json:"-"`
  2531. // NullFields is a list of field names (e.g. "AlternativeQueryResults")
  2532. // to include in API requests with the JSON null value. By default,
  2533. // fields with empty values are omitted from API requests. However, any
  2534. // field with an empty value appearing in NullFields will be sent to the
  2535. // server as null. It is an error if a field in this list has a
  2536. // non-empty value. This may be used to include null fields in Patch
  2537. // requests.
  2538. NullFields []string `json:"-"`
  2539. }
  2540. func (s *GoogleCloudDialogflowV2beta1DetectIntentResponse) MarshalJSON() ([]byte, error) {
  2541. type NoMethod GoogleCloudDialogflowV2beta1DetectIntentResponse
  2542. raw := NoMethod(*s)
  2543. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2544. }
  2545. // GoogleCloudDialogflowV2beta1Document: A document resource.
  2546. //
  2547. // Note: resource `projects.agent.knowledgeBases.documents` is
  2548. // deprecated,
  2549. // please use `projects.knowledgeBases.documents` instead.
  2550. type GoogleCloudDialogflowV2beta1Document struct {
  2551. // Content: The raw content of the document. This field is only
  2552. // permitted for
  2553. // EXTRACTIVE_QA and FAQ knowledge types.
  2554. // Note: This field is in the process of being deprecated, please
  2555. // use
  2556. // raw_content instead.
  2557. Content string `json:"content,omitempty"`
  2558. // ContentUri: The URI where the file content is located.
  2559. //
  2560. // For documents stored in Google Cloud Storage, these URIs must
  2561. // have
  2562. // the form `gs://<bucket-name>/<object-name>`.
  2563. //
  2564. // NOTE: External URLs must correspond to public webpages, i.e., they
  2565. // must
  2566. // be indexed by Google Search. In particular, URLs for showing
  2567. // documents in
  2568. // Google Cloud Storage (i.e. the URL in your browser) are not
  2569. // supported.
  2570. // Instead use the `gs://` format URI described above.
  2571. ContentUri string `json:"contentUri,omitempty"`
  2572. // DisplayName: Required. The display name of the document. The name
  2573. // must be 1024 bytes or
  2574. // less; otherwise, the creation request fails.
  2575. DisplayName string `json:"displayName,omitempty"`
  2576. // KnowledgeTypes: Required. The knowledge type of document content.
  2577. //
  2578. // Possible values:
  2579. // "KNOWLEDGE_TYPE_UNSPECIFIED" - The type is unspecified or
  2580. // arbitrary.
  2581. // "FAQ" - The document content contains question and answer pairs as
  2582. // either HTML or
  2583. // CSV. Typical FAQ HTML formats are parsed accurately, but unusual
  2584. // formats
  2585. // may fail to be parsed.
  2586. //
  2587. // CSV must have questions in the first column and answers in the
  2588. // second,
  2589. // with no header. Because of this explicit format, they are always
  2590. // parsed
  2591. // accurately.
  2592. // "EXTRACTIVE_QA" - Documents for which unstructured text is
  2593. // extracted and used for
  2594. // question answering.
  2595. KnowledgeTypes []string `json:"knowledgeTypes,omitempty"`
  2596. // MimeType: Required. The MIME type of this document.
  2597. MimeType string `json:"mimeType,omitempty"`
  2598. // Name: The document resource name.
  2599. // The name must be empty when creating a document.
  2600. // Format: `projects/<Project ID>/knowledgeBases/<Knowledge
  2601. // Base
  2602. // ID>/documents/<Document ID>`.
  2603. Name string `json:"name,omitempty"`
  2604. // RawContent: The raw content of the document. This field is only
  2605. // permitted for
  2606. // EXTRACTIVE_QA and FAQ knowledge types.
  2607. RawContent string `json:"rawContent,omitempty"`
  2608. // ServerResponse contains the HTTP response code and headers from the
  2609. // server.
  2610. googleapi.ServerResponse `json:"-"`
  2611. // ForceSendFields is a list of field names (e.g. "Content") to
  2612. // unconditionally include in API requests. By default, fields with
  2613. // empty values are omitted from API requests. However, any non-pointer,
  2614. // non-interface field appearing in ForceSendFields will be sent to the
  2615. // server regardless of whether the field is empty or not. This may be
  2616. // used to include empty fields in Patch requests.
  2617. ForceSendFields []string `json:"-"`
  2618. // NullFields is a list of field names (e.g. "Content") to include in
  2619. // API requests with the JSON null value. By default, fields with empty
  2620. // values are omitted from API requests. However, any field with an
  2621. // empty value appearing in NullFields will be sent to the server as
  2622. // null. It is an error if a field in this list has a non-empty value.
  2623. // This may be used to include null fields in Patch requests.
  2624. NullFields []string `json:"-"`
  2625. }
  2626. func (s *GoogleCloudDialogflowV2beta1Document) MarshalJSON() ([]byte, error) {
  2627. type NoMethod GoogleCloudDialogflowV2beta1Document
  2628. raw := NoMethod(*s)
  2629. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2630. }
  2631. // GoogleCloudDialogflowV2beta1EntityType: Represents an entity
  2632. // type.
  2633. // Entity types serve as a tool for extracting parameter values from
  2634. // natural
  2635. // language queries.
  2636. type GoogleCloudDialogflowV2beta1EntityType struct {
  2637. // AutoExpansionMode: Optional. Indicates whether the entity type can be
  2638. // automatically
  2639. // expanded.
  2640. //
  2641. // Possible values:
  2642. // "AUTO_EXPANSION_MODE_UNSPECIFIED" - Auto expansion disabled for the
  2643. // entity.
  2644. // "AUTO_EXPANSION_MODE_DEFAULT" - Allows an agent to recognize values
  2645. // that have not been explicitly
  2646. // listed in the entity.
  2647. AutoExpansionMode string `json:"autoExpansionMode,omitempty"`
  2648. // DisplayName: Required. The name of the entity type.
  2649. DisplayName string `json:"displayName,omitempty"`
  2650. // Entities: Optional. The collection of entity entries associated with
  2651. // the entity type.
  2652. Entities []*GoogleCloudDialogflowV2beta1EntityTypeEntity `json:"entities,omitempty"`
  2653. // Kind: Required. Indicates the kind of entity type.
  2654. //
  2655. // Possible values:
  2656. // "KIND_UNSPECIFIED" - Not specified. This value should be never
  2657. // used.
  2658. // "KIND_MAP" - Map entity types allow mapping of a group of synonyms
  2659. // to a canonical
  2660. // value.
  2661. // "KIND_LIST" - List entity types contain a set of entries that do
  2662. // not map to canonical
  2663. // values. However, list entity types can contain references to other
  2664. // entity
  2665. // types (with or without aliases).
  2666. Kind string `json:"kind,omitempty"`
  2667. // Name: The unique identifier of the entity type.
  2668. // Required for EntityTypes.UpdateEntityType
  2669. // and
  2670. // EntityTypes.BatchUpdateEntityTypes methods.
  2671. // Format: `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.
  2672. Name string `json:"name,omitempty"`
  2673. // ServerResponse contains the HTTP response code and headers from the
  2674. // server.
  2675. googleapi.ServerResponse `json:"-"`
  2676. // ForceSendFields is a list of field names (e.g. "AutoExpansionMode")
  2677. // to unconditionally include in API requests. By default, fields with
  2678. // empty values are omitted from API requests. However, any non-pointer,
  2679. // non-interface field appearing in ForceSendFields will be sent to the
  2680. // server regardless of whether the field is empty or not. This may be
  2681. // used to include empty fields in Patch requests.
  2682. ForceSendFields []string `json:"-"`
  2683. // NullFields is a list of field names (e.g. "AutoExpansionMode") to
  2684. // include in API requests with the JSON null value. By default, fields
  2685. // with empty values are omitted from API requests. However, any field
  2686. // with an empty value appearing in NullFields will be sent to the
  2687. // server as null. It is an error if a field in this list has a
  2688. // non-empty value. This may be used to include null fields in Patch
  2689. // requests.
  2690. NullFields []string `json:"-"`
  2691. }
  2692. func (s *GoogleCloudDialogflowV2beta1EntityType) MarshalJSON() ([]byte, error) {
  2693. type NoMethod GoogleCloudDialogflowV2beta1EntityType
  2694. raw := NoMethod(*s)
  2695. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2696. }
  2697. // GoogleCloudDialogflowV2beta1EntityTypeBatch: This message is a
  2698. // wrapper around a collection of entity types.
  2699. type GoogleCloudDialogflowV2beta1EntityTypeBatch struct {
  2700. // EntityTypes: A collection of entity types.
  2701. EntityTypes []*GoogleCloudDialogflowV2beta1EntityType `json:"entityTypes,omitempty"`
  2702. // ForceSendFields is a list of field names (e.g. "EntityTypes") to
  2703. // unconditionally include in API requests. By default, fields with
  2704. // empty values are omitted from API requests. However, any non-pointer,
  2705. // non-interface field appearing in ForceSendFields will be sent to the
  2706. // server regardless of whether the field is empty or not. This may be
  2707. // used to include empty fields in Patch requests.
  2708. ForceSendFields []string `json:"-"`
  2709. // NullFields is a list of field names (e.g. "EntityTypes") to include
  2710. // in API requests with the JSON null value. By default, fields with
  2711. // empty values are omitted from API requests. However, any field with
  2712. // an empty value appearing in NullFields will be sent to the server as
  2713. // null. It is an error if a field in this list has a non-empty value.
  2714. // This may be used to include null fields in Patch requests.
  2715. NullFields []string `json:"-"`
  2716. }
  2717. func (s *GoogleCloudDialogflowV2beta1EntityTypeBatch) MarshalJSON() ([]byte, error) {
  2718. type NoMethod GoogleCloudDialogflowV2beta1EntityTypeBatch
  2719. raw := NoMethod(*s)
  2720. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2721. }
  2722. // GoogleCloudDialogflowV2beta1EntityTypeEntity: An **entity entry** for
  2723. // an associated entity type.
  2724. type GoogleCloudDialogflowV2beta1EntityTypeEntity struct {
  2725. // Synonyms: Required. A collection of value synonyms. For example, if
  2726. // the entity type
  2727. // is *vegetable*, and `value` is *scallions*, a synonym could be
  2728. // *green
  2729. // onions*.
  2730. //
  2731. // For `KIND_LIST` entity types:
  2732. //
  2733. // * This collection must contain exactly one synonym equal to
  2734. // `value`.
  2735. Synonyms []string `json:"synonyms,omitempty"`
  2736. // Value: Required. The primary value associated with this entity
  2737. // entry.
  2738. // For example, if the entity type is *vegetable*, the value could
  2739. // be
  2740. // *scallions*.
  2741. //
  2742. // For `KIND_MAP` entity types:
  2743. //
  2744. // * A canonical value to be used in place of synonyms.
  2745. //
  2746. // For `KIND_LIST` entity types:
  2747. //
  2748. // * A string that can contain references to other entity types (with
  2749. // or
  2750. // without aliases).
  2751. Value string `json:"value,omitempty"`
  2752. // ForceSendFields is a list of field names (e.g. "Synonyms") to
  2753. // unconditionally include in API requests. By default, fields with
  2754. // empty values are omitted from API requests. However, any non-pointer,
  2755. // non-interface field appearing in ForceSendFields will be sent to the
  2756. // server regardless of whether the field is empty or not. This may be
  2757. // used to include empty fields in Patch requests.
  2758. ForceSendFields []string `json:"-"`
  2759. // NullFields is a list of field names (e.g. "Synonyms") to include in
  2760. // API requests with the JSON null value. By default, fields with empty
  2761. // values are omitted from API requests. However, any field with an
  2762. // empty value appearing in NullFields will be sent to the server as
  2763. // null. It is an error if a field in this list has a non-empty value.
  2764. // This may be used to include null fields in Patch requests.
  2765. NullFields []string `json:"-"`
  2766. }
  2767. func (s *GoogleCloudDialogflowV2beta1EntityTypeEntity) MarshalJSON() ([]byte, error) {
  2768. type NoMethod GoogleCloudDialogflowV2beta1EntityTypeEntity
  2769. raw := NoMethod(*s)
  2770. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2771. }
  2772. // GoogleCloudDialogflowV2beta1EventInput: Events allow for matching
  2773. // intents by event name instead of the natural
  2774. // language input. For instance, input `<event: { name:
  2775. // "welcome_event",
  2776. // parameters: { name: "Sam" } }>` can trigger a personalized welcome
  2777. // response.
  2778. // The parameter `name` may be used by the agent in the
  2779. // response:
  2780. // "Hello #welcome_event.name! What can I do for you today?".
  2781. type GoogleCloudDialogflowV2beta1EventInput struct {
  2782. // LanguageCode: Required. The language of this query. See
  2783. // [Language
  2784. // Support](https://dialogflow.com/docs/languages) for a list of
  2785. // the
  2786. // currently supported language codes. Note that queries in the same
  2787. // session
  2788. // do not necessarily need to specify the same language.
  2789. LanguageCode string `json:"languageCode,omitempty"`
  2790. // Name: Required. The unique identifier of the event.
  2791. Name string `json:"name,omitempty"`
  2792. // Parameters: Optional. The collection of parameters associated with
  2793. // the event.
  2794. Parameters googleapi.RawMessage `json:"parameters,omitempty"`
  2795. // ForceSendFields is a list of field names (e.g. "LanguageCode") to
  2796. // unconditionally include in API requests. By default, fields with
  2797. // empty values are omitted from API requests. However, any non-pointer,
  2798. // non-interface field appearing in ForceSendFields will be sent to the
  2799. // server regardless of whether the field is empty or not. This may be
  2800. // used to include empty fields in Patch requests.
  2801. ForceSendFields []string `json:"-"`
  2802. // NullFields is a list of field names (e.g. "LanguageCode") to include
  2803. // in API requests with the JSON null value. By default, fields with
  2804. // empty values are omitted from API requests. However, any field with
  2805. // an empty value appearing in NullFields will be sent to the server as
  2806. // null. It is an error if a field in this list has a non-empty value.
  2807. // This may be used to include null fields in Patch requests.
  2808. NullFields []string `json:"-"`
  2809. }
  2810. func (s *GoogleCloudDialogflowV2beta1EventInput) MarshalJSON() ([]byte, error) {
  2811. type NoMethod GoogleCloudDialogflowV2beta1EventInput
  2812. raw := NoMethod(*s)
  2813. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2814. }
  2815. // GoogleCloudDialogflowV2beta1ExportAgentRequest: The request message
  2816. // for Agents.ExportAgent.
  2817. type GoogleCloudDialogflowV2beta1ExportAgentRequest struct {
  2818. // AgentUri: Optional. The
  2819. // [Google Cloud Storage](https://cloud.google.com/storage/docs/)
  2820. // URI to export the agent to.
  2821. // The format of this URI must be `gs://<bucket-name>/<object-name>`.
  2822. // If left unspecified, the serialized agent is returned inline.
  2823. AgentUri string `json:"agentUri,omitempty"`
  2824. // ForceSendFields is a list of field names (e.g. "AgentUri") to
  2825. // unconditionally include in API requests. By default, fields with
  2826. // empty values are omitted from API requests. However, any non-pointer,
  2827. // non-interface field appearing in ForceSendFields will be sent to the
  2828. // server regardless of whether the field is empty or not. This may be
  2829. // used to include empty fields in Patch requests.
  2830. ForceSendFields []string `json:"-"`
  2831. // NullFields is a list of field names (e.g. "AgentUri") to include in
  2832. // API requests with the JSON null value. By default, fields with empty
  2833. // values are omitted from API requests. However, any field with an
  2834. // empty value appearing in NullFields will be sent to the server as
  2835. // null. It is an error if a field in this list has a non-empty value.
  2836. // This may be used to include null fields in Patch requests.
  2837. NullFields []string `json:"-"`
  2838. }
  2839. func (s *GoogleCloudDialogflowV2beta1ExportAgentRequest) MarshalJSON() ([]byte, error) {
  2840. type NoMethod GoogleCloudDialogflowV2beta1ExportAgentRequest
  2841. raw := NoMethod(*s)
  2842. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2843. }
  2844. // GoogleCloudDialogflowV2beta1ExportAgentResponse: The response message
  2845. // for Agents.ExportAgent.
  2846. type GoogleCloudDialogflowV2beta1ExportAgentResponse struct {
  2847. // AgentContent: The exported agent.
  2848. //
  2849. // Example for how to export an agent to a zip file via a command
  2850. // line:
  2851. // <pre>curl \
  2852. //
  2853. // 'https://dialogflow.googleapis.com/v2beta1/projects/&lt;project_name&g
  2854. // t;/agent:export'\
  2855. // -X POST \
  2856. // -H 'Authorization: Bearer '$(gcloud auth application-default
  2857. // print-access-token) \
  2858. // -H 'Accept: application/json' \
  2859. // -H 'Content-Type: application/json' \
  2860. // --compressed \
  2861. // --data-binary '{}' \
  2862. // | grep agentContent | sed -e 's/.*"agentContent": "\([^"]*\)".*/\1/'
  2863. // \
  2864. // | base64 --decode > &lt;agent zip file&gt;</pre>
  2865. AgentContent string `json:"agentContent,omitempty"`
  2866. // AgentUri: The URI to a file containing the exported agent. This field
  2867. // is populated
  2868. // only if `agent_uri` is specified in `ExportAgentRequest`.
  2869. AgentUri string `json:"agentUri,omitempty"`
  2870. // ForceSendFields is a list of field names (e.g. "AgentContent") to
  2871. // unconditionally include in API requests. By default, fields with
  2872. // empty values are omitted from API requests. However, any non-pointer,
  2873. // non-interface field appearing in ForceSendFields will be sent to the
  2874. // server regardless of whether the field is empty or not. This may be
  2875. // used to include empty fields in Patch requests.
  2876. ForceSendFields []string `json:"-"`
  2877. // NullFields is a list of field names (e.g. "AgentContent") to include
  2878. // in API requests with the JSON null value. By default, fields with
  2879. // empty values are omitted from API requests. However, any field with
  2880. // an empty value appearing in NullFields will be sent to the server as
  2881. // null. It is an error if a field in this list has a non-empty value.
  2882. // This may be used to include null fields in Patch requests.
  2883. NullFields []string `json:"-"`
  2884. }
  2885. func (s *GoogleCloudDialogflowV2beta1ExportAgentResponse) MarshalJSON() ([]byte, error) {
  2886. type NoMethod GoogleCloudDialogflowV2beta1ExportAgentResponse
  2887. raw := NoMethod(*s)
  2888. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2889. }
  2890. // GoogleCloudDialogflowV2beta1ImportAgentRequest: The request message
  2891. // for Agents.ImportAgent.
  2892. type GoogleCloudDialogflowV2beta1ImportAgentRequest struct {
  2893. // AgentContent: The agent to import.
  2894. //
  2895. // Example for how to import an agent via the command line:
  2896. // <pre>curl \
  2897. //
  2898. // 'https://dialogflow.googleapis.com/v2beta1/projects/&lt;project_name&g
  2899. // t;/agent:import\
  2900. // -X POST \
  2901. // -H 'Authorization: Bearer '$(gcloud auth application-default
  2902. // print-access-token) \
  2903. // -H 'Accept: application/json' \
  2904. // -H 'Content-Type: application/json' \
  2905. // --compressed \
  2906. // --data-binary "{
  2907. // 'agentContent': '$(cat &lt;agent zip file&gt; | base64 -w 0)'
  2908. // }"</pre>
  2909. AgentContent string `json:"agentContent,omitempty"`
  2910. // AgentUri: The URI to a Google Cloud Storage file containing the agent
  2911. // to import.
  2912. // Note: The URI must start with "gs://".
  2913. AgentUri string `json:"agentUri,omitempty"`
  2914. // ForceSendFields is a list of field names (e.g. "AgentContent") to
  2915. // unconditionally include in API requests. By default, fields with
  2916. // empty values are omitted from API requests. However, any non-pointer,
  2917. // non-interface field appearing in ForceSendFields will be sent to the
  2918. // server regardless of whether the field is empty or not. This may be
  2919. // used to include empty fields in Patch requests.
  2920. ForceSendFields []string `json:"-"`
  2921. // NullFields is a list of field names (e.g. "AgentContent") to include
  2922. // in API requests with the JSON null value. By default, fields with
  2923. // empty values are omitted from API requests. However, any field with
  2924. // an empty value appearing in NullFields will be sent to the server as
  2925. // null. It is an error if a field in this list has a non-empty value.
  2926. // This may be used to include null fields in Patch requests.
  2927. NullFields []string `json:"-"`
  2928. }
  2929. func (s *GoogleCloudDialogflowV2beta1ImportAgentRequest) MarshalJSON() ([]byte, error) {
  2930. type NoMethod GoogleCloudDialogflowV2beta1ImportAgentRequest
  2931. raw := NoMethod(*s)
  2932. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2933. }
  2934. // GoogleCloudDialogflowV2beta1InputAudioConfig: Instructs the speech
  2935. // recognizer how to process the audio content.
  2936. type GoogleCloudDialogflowV2beta1InputAudioConfig struct {
  2937. // AudioEncoding: Required. Audio encoding of the audio content to
  2938. // process.
  2939. //
  2940. // Possible values:
  2941. // "AUDIO_ENCODING_UNSPECIFIED" - Not specified.
  2942. // "AUDIO_ENCODING_LINEAR_16" - Uncompressed 16-bit signed
  2943. // little-endian samples (Linear PCM).
  2944. // "AUDIO_ENCODING_FLAC" -
  2945. // [`FLAC`](https://xiph.org/flac/documentation.html) (Free Lossless
  2946. // Audio
  2947. // Codec) is the recommended encoding because it is lossless
  2948. // (therefore
  2949. // recognition is not compromised) and requires only about half
  2950. // the
  2951. // bandwidth of `LINEAR16`. `FLAC` stream encoding supports 16-bit
  2952. // and
  2953. // 24-bit samples, however, not all fields in `STREAMINFO` are
  2954. // supported.
  2955. // "AUDIO_ENCODING_MULAW" - 8-bit samples that compand 14-bit audio
  2956. // samples using G.711 PCMU/mu-law.
  2957. // "AUDIO_ENCODING_AMR" - Adaptive Multi-Rate Narrowband codec.
  2958. // `sample_rate_hertz` must be 8000.
  2959. // "AUDIO_ENCODING_AMR_WB" - Adaptive Multi-Rate Wideband codec.
  2960. // `sample_rate_hertz` must be 16000.
  2961. // "AUDIO_ENCODING_OGG_OPUS" - Opus encoded audio frames in Ogg
  2962. // container
  2963. // ([OggOpus](https://wiki.xiph.org/OggOpus)).
  2964. // `sample_rate_her
  2965. // tz` must be 16000.
  2966. // "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE" - Although the use of lossy
  2967. // encodings is not recommended, if a very low
  2968. // bitrate encoding is required, `OGG_OPUS` is highly preferred
  2969. // over
  2970. // Speex encoding. The [Speex](https://speex.org/) encoding supported
  2971. // by
  2972. // Dialogflow API has a header byte in each block, as in MIME
  2973. // type
  2974. // `audio/x-speex-with-header-byte`.
  2975. // It is a variant of the RTP Speex encoding defined in
  2976. // [RFC 5574](https://tools.ietf.org/html/rfc5574).
  2977. // The stream is a sequence of blocks, one block per RTP packet. Each
  2978. // block
  2979. // starts with a byte containing the length of the block, in bytes,
  2980. // followed
  2981. // by one or more frames of Speex data, padded to an integral number
  2982. // of
  2983. // bytes (octets) as specified in RFC 5574. In other words, each RTP
  2984. // header
  2985. // is replaced with a single byte containing the block length. Only
  2986. // Speex
  2987. // wideband is supported. `sample_rate_hertz` must be 16000.
  2988. AudioEncoding string `json:"audioEncoding,omitempty"`
  2989. // LanguageCode: Required. The language of the supplied audio.
  2990. // Dialogflow does not do
  2991. // translations. See
  2992. // [Language
  2993. // Support](https://dialogflow.com/docs/languages) for a list of
  2994. // the
  2995. // currently supported language codes. Note that queries in the same
  2996. // session
  2997. // do not necessarily need to specify the same language.
  2998. LanguageCode string `json:"languageCode,omitempty"`
  2999. // Model: Optional. Which Speech model to select for the given request.
  3000. // Select the
  3001. // model best suited to your domain to get best results. If a model is
  3002. // not
  3003. // explicitly specified, then we auto-select a model based on the
  3004. // parameters
  3005. // in the InputAudioConfig.
  3006. // If enhanced speech model is enabled for the agent and an
  3007. // enhanced
  3008. // version of the specified model for the language does not exist, then
  3009. // the
  3010. // speech is recognized using the standard version of the specified
  3011. // model.
  3012. // Refer to
  3013. // [Cloud Speech
  3014. // API
  3015. // documentation](https://cloud.google.com/speech-to-text/docs/basics
  3016. // #select-model)
  3017. // for more details.
  3018. Model string `json:"model,omitempty"`
  3019. // PhraseHints: Optional. The collection of phrase hints which are used
  3020. // to boost accuracy
  3021. // of speech recognition.
  3022. // Refer to
  3023. // [Cloud Speech
  3024. // API
  3025. // documentation](https://cloud.google.com/speech-to-text/docs/basics
  3026. // #phrase-hints)
  3027. // for more details.
  3028. PhraseHints []string `json:"phraseHints,omitempty"`
  3029. // SampleRateHertz: Required. Sample rate (in Hertz) of the audio
  3030. // content sent in the query.
  3031. // Refer to
  3032. // [Cloud Speech
  3033. // API
  3034. // documentation](https://cloud.google.com/speech-to-text/docs/basics
  3035. // ) for
  3036. // more details.
  3037. SampleRateHertz int64 `json:"sampleRateHertz,omitempty"`
  3038. // ForceSendFields is a list of field names (e.g. "AudioEncoding") to
  3039. // unconditionally include in API requests. By default, fields with
  3040. // empty values are omitted from API requests. However, any non-pointer,
  3041. // non-interface field appearing in ForceSendFields will be sent to the
  3042. // server regardless of whether the field is empty or not. This may be
  3043. // used to include empty fields in Patch requests.
  3044. ForceSendFields []string `json:"-"`
  3045. // NullFields is a list of field names (e.g. "AudioEncoding") to include
  3046. // in API requests with the JSON null value. By default, fields with
  3047. // empty values are omitted from API requests. However, any field with
  3048. // an empty value appearing in NullFields will be sent to the server as
  3049. // null. It is an error if a field in this list has a non-empty value.
  3050. // This may be used to include null fields in Patch requests.
  3051. NullFields []string `json:"-"`
  3052. }
  3053. func (s *GoogleCloudDialogflowV2beta1InputAudioConfig) MarshalJSON() ([]byte, error) {
  3054. type NoMethod GoogleCloudDialogflowV2beta1InputAudioConfig
  3055. raw := NoMethod(*s)
  3056. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3057. }
  3058. // GoogleCloudDialogflowV2beta1Intent: Represents an intent.
  3059. // Intents convert a number of user expressions or patterns into an
  3060. // action. An
  3061. // action is an extraction of a user command or sentence semantics.
  3062. type GoogleCloudDialogflowV2beta1Intent struct {
  3063. // Action: Optional. The name of the action associated with the
  3064. // intent.
  3065. // Note: The action name must not contain whitespaces.
  3066. Action string `json:"action,omitempty"`
  3067. // DefaultResponsePlatforms: Optional. The list of platforms for which
  3068. // the first response will be
  3069. // taken from among the messages assigned to the DEFAULT_PLATFORM.
  3070. //
  3071. // Possible values:
  3072. // "PLATFORM_UNSPECIFIED" - Not specified.
  3073. // "FACEBOOK" - Facebook.
  3074. // "SLACK" - Slack.
  3075. // "TELEGRAM" - Telegram.
  3076. // "KIK" - Kik.
  3077. // "SKYPE" - Skype.
  3078. // "LINE" - Line.
  3079. // "VIBER" - Viber.
  3080. // "ACTIONS_ON_GOOGLE" - Actions on Google.
  3081. // When using Actions on Google, you can choose one of the
  3082. // specific
  3083. // Intent.Message types that mention support for Actions on Google,
  3084. // or you can use the advanced Intent.Message.payload field.
  3085. // The payload field provides access to AoG features not available in
  3086. // the
  3087. // specific message types.
  3088. // If using the Intent.Message.payload field, it should have a
  3089. // structure
  3090. // similar to the JSON message shown here. For more information,
  3091. // see
  3092. // [Actions on Google
  3093. // Webhook
  3094. // Format](https://developers.google.com/actions/dialogflow/webho
  3095. // ok)
  3096. // <pre>{
  3097. // "expectUserResponse": true,
  3098. // "isSsml": false,
  3099. // "noInputPrompts": [],
  3100. // "richResponse": {
  3101. // "items": [
  3102. // {
  3103. // "simpleResponse": {
  3104. // "displayText": "hi",
  3105. // "textToSpeech": "hello"
  3106. // }
  3107. // }
  3108. // ],
  3109. // "suggestions": [
  3110. // {
  3111. // "title": "Say this"
  3112. // },
  3113. // {
  3114. // "title": "or this"
  3115. // }
  3116. // ]
  3117. // },
  3118. // "systemIntent": {
  3119. // "data": {
  3120. // "@type":
  3121. // "type.googleapis.com/google.actions.v2.OptionValueSpec",
  3122. // "listSelect": {
  3123. // "items": [
  3124. // {
  3125. // "optionInfo": {
  3126. // "key": "key1",
  3127. // "synonyms": [
  3128. // "key one"
  3129. // ]
  3130. // },
  3131. // "title": "must not be empty, but unique"
  3132. // },
  3133. // {
  3134. // "optionInfo": {
  3135. // "key": "key2",
  3136. // "synonyms": [
  3137. // "key two"
  3138. // ]
  3139. // },
  3140. // "title": "must not be empty, but unique"
  3141. // }
  3142. // ]
  3143. // }
  3144. // },
  3145. // "intent": "actions.intent.OPTION"
  3146. // }
  3147. // }</pre>
  3148. // "TELEPHONY" - Telephony Gateway.
  3149. DefaultResponsePlatforms []string `json:"defaultResponsePlatforms,omitempty"`
  3150. // DisplayName: Required. The name of this intent.
  3151. DisplayName string `json:"displayName,omitempty"`
  3152. // EndInteraction: Optional. Indicates that this intent ends an
  3153. // interaction. Some integrations
  3154. // (e.g., Actions on Google or Dialogflow phone gateway) use this
  3155. // information
  3156. // to close interaction with an end user. Default is false.
  3157. EndInteraction bool `json:"endInteraction,omitempty"`
  3158. // Events: Optional. The collection of event names that trigger the
  3159. // intent.
  3160. // If the collection of input contexts is not empty, all of the contexts
  3161. // must
  3162. // be present in the active user session for an event to trigger this
  3163. // intent.
  3164. Events []string `json:"events,omitempty"`
  3165. // FollowupIntentInfo: Read-only. Information about all followup intents
  3166. // that have this intent as
  3167. // a direct or indirect parent. We populate this field only in the
  3168. // output.
  3169. FollowupIntentInfo []*GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo `json:"followupIntentInfo,omitempty"`
  3170. // InputContextNames: Optional. The list of context names required for
  3171. // this intent to be
  3172. // triggered.
  3173. // Format: `projects/<Project ID>/agent/sessions/-/contexts/<Context
  3174. // ID>`.
  3175. InputContextNames []string `json:"inputContextNames,omitempty"`
  3176. // IsFallback: Optional. Indicates whether this is a fallback intent.
  3177. IsFallback bool `json:"isFallback,omitempty"`
  3178. // Messages: Optional. The collection of rich messages corresponding to
  3179. // the
  3180. // `Response` field in the Dialogflow console.
  3181. Messages []*GoogleCloudDialogflowV2beta1IntentMessage `json:"messages,omitempty"`
  3182. // MlDisabled: Optional. Indicates whether Machine Learning is disabled
  3183. // for the intent.
  3184. // Note: If `ml_disabled` setting is set to true, then this intent is
  3185. // not
  3186. // taken into account during inference in `ML ONLY` match mode.
  3187. // Also,
  3188. // auto-markup in the UI is turned off.
  3189. MlDisabled bool `json:"mlDisabled,omitempty"`
  3190. // MlEnabled: Optional. Indicates whether Machine Learning is enabled
  3191. // for the intent.
  3192. // Note: If `ml_enabled` setting is set to false, then this intent is
  3193. // not
  3194. // taken into account during inference in `ML ONLY` match mode.
  3195. // Also,
  3196. // auto-markup in the UI is turned off.
  3197. // DEPRECATED! Please use `ml_disabled` field instead.
  3198. // NOTE: If both `ml_enabled` and `ml_disabled` are either not set or
  3199. // false,
  3200. // then the default value is determined as follows:
  3201. // - Before April 15th, 2018 the default is:
  3202. // ml_enabled = false / ml_disabled = true.
  3203. // - After April 15th, 2018 the default is:
  3204. // ml_enabled = true / ml_disabled = false.
  3205. MlEnabled bool `json:"mlEnabled,omitempty"`
  3206. // Name: The unique identifier of this intent.
  3207. // Required for Intents.UpdateIntent and
  3208. // Intents.BatchUpdateIntents
  3209. // methods.
  3210. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  3211. Name string `json:"name,omitempty"`
  3212. // OutputContexts: Optional. The collection of contexts that are
  3213. // activated when the intent
  3214. // is matched. Context messages in this collection should not set
  3215. // the
  3216. // parameters field. Setting the `lifespan_count` to 0 will reset the
  3217. // context
  3218. // when the intent is matched.
  3219. // Format: `projects/<Project ID>/agent/sessions/-/contexts/<Context
  3220. // ID>`.
  3221. OutputContexts []*GoogleCloudDialogflowV2beta1Context `json:"outputContexts,omitempty"`
  3222. // Parameters: Optional. The collection of parameters associated with
  3223. // the intent.
  3224. Parameters []*GoogleCloudDialogflowV2beta1IntentParameter `json:"parameters,omitempty"`
  3225. // ParentFollowupIntentName: Read-only after creation. The unique
  3226. // identifier of the parent intent in the
  3227. // chain of followup intents. You can set this field when creating an
  3228. // intent,
  3229. // for example with CreateIntent or BatchUpdateIntents, in order to
  3230. // make this intent a followup intent.
  3231. //
  3232. // It identifies the parent followup intent.
  3233. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  3234. ParentFollowupIntentName string `json:"parentFollowupIntentName,omitempty"`
  3235. // Priority: Optional. The priority of this intent. Higher numbers
  3236. // represent higher
  3237. // priorities. If this is zero or unspecified, we use the
  3238. // default
  3239. // priority 500000.
  3240. //
  3241. // Negative numbers mean that the intent is disabled.
  3242. Priority int64 `json:"priority,omitempty"`
  3243. // ResetContexts: Optional. Indicates whether to delete all contexts in
  3244. // the current
  3245. // session when this intent is matched.
  3246. ResetContexts bool `json:"resetContexts,omitempty"`
  3247. // RootFollowupIntentName: Read-only. The unique identifier of the root
  3248. // intent in the chain of
  3249. // followup intents. It identifies the correct followup intents chain
  3250. // for
  3251. // this intent. We populate this field only in the output.
  3252. //
  3253. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  3254. RootFollowupIntentName string `json:"rootFollowupIntentName,omitempty"`
  3255. // TrainingPhrases: Optional. The collection of examples that the agent
  3256. // is
  3257. // trained on.
  3258. TrainingPhrases []*GoogleCloudDialogflowV2beta1IntentTrainingPhrase `json:"trainingPhrases,omitempty"`
  3259. // WebhookState: Optional. Indicates whether webhooks are enabled for
  3260. // the intent.
  3261. //
  3262. // Possible values:
  3263. // "WEBHOOK_STATE_UNSPECIFIED" - Webhook is disabled in the agent and
  3264. // in the intent.
  3265. // "WEBHOOK_STATE_ENABLED" - Webhook is enabled in the agent and in
  3266. // the intent.
  3267. // "WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING" - Webhook is enabled in
  3268. // the agent and in the intent. Also, each slot
  3269. // filling prompt is forwarded to the webhook.
  3270. WebhookState string `json:"webhookState,omitempty"`
  3271. // ServerResponse contains the HTTP response code and headers from the
  3272. // server.
  3273. googleapi.ServerResponse `json:"-"`
  3274. // ForceSendFields is a list of field names (e.g. "Action") to
  3275. // unconditionally include in API requests. By default, fields with
  3276. // empty values are omitted from API requests. However, any non-pointer,
  3277. // non-interface field appearing in ForceSendFields will be sent to the
  3278. // server regardless of whether the field is empty or not. This may be
  3279. // used to include empty fields in Patch requests.
  3280. ForceSendFields []string `json:"-"`
  3281. // NullFields is a list of field names (e.g. "Action") to include in API
  3282. // requests with the JSON null value. By default, fields with empty
  3283. // values are omitted from API requests. However, any field with an
  3284. // empty value appearing in NullFields will be sent to the server as
  3285. // null. It is an error if a field in this list has a non-empty value.
  3286. // This may be used to include null fields in Patch requests.
  3287. NullFields []string `json:"-"`
  3288. }
  3289. func (s *GoogleCloudDialogflowV2beta1Intent) MarshalJSON() ([]byte, error) {
  3290. type NoMethod GoogleCloudDialogflowV2beta1Intent
  3291. raw := NoMethod(*s)
  3292. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3293. }
  3294. // GoogleCloudDialogflowV2beta1IntentBatch: This message is a wrapper
  3295. // around a collection of intents.
  3296. type GoogleCloudDialogflowV2beta1IntentBatch struct {
  3297. // Intents: A collection of intents.
  3298. Intents []*GoogleCloudDialogflowV2beta1Intent `json:"intents,omitempty"`
  3299. // ForceSendFields is a list of field names (e.g. "Intents") to
  3300. // unconditionally include in API requests. By default, fields with
  3301. // empty values are omitted from API requests. However, any non-pointer,
  3302. // non-interface field appearing in ForceSendFields will be sent to the
  3303. // server regardless of whether the field is empty or not. This may be
  3304. // used to include empty fields in Patch requests.
  3305. ForceSendFields []string `json:"-"`
  3306. // NullFields is a list of field names (e.g. "Intents") to include in
  3307. // API requests with the JSON null value. By default, fields with empty
  3308. // values are omitted from API requests. However, any field with an
  3309. // empty value appearing in NullFields will be sent to the server as
  3310. // null. It is an error if a field in this list has a non-empty value.
  3311. // This may be used to include null fields in Patch requests.
  3312. NullFields []string `json:"-"`
  3313. }
  3314. func (s *GoogleCloudDialogflowV2beta1IntentBatch) MarshalJSON() ([]byte, error) {
  3315. type NoMethod GoogleCloudDialogflowV2beta1IntentBatch
  3316. raw := NoMethod(*s)
  3317. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3318. }
  3319. // GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo: Represents a
  3320. // single followup intent in the chain.
  3321. type GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo struct {
  3322. // FollowupIntentName: The unique identifier of the followup
  3323. // intent.
  3324. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  3325. FollowupIntentName string `json:"followupIntentName,omitempty"`
  3326. // ParentFollowupIntentName: The unique identifier of the followup
  3327. // intent's parent.
  3328. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  3329. ParentFollowupIntentName string `json:"parentFollowupIntentName,omitempty"`
  3330. // ForceSendFields is a list of field names (e.g. "FollowupIntentName")
  3331. // to unconditionally include in API requests. By default, fields with
  3332. // empty values are omitted from API requests. However, any non-pointer,
  3333. // non-interface field appearing in ForceSendFields will be sent to the
  3334. // server regardless of whether the field is empty or not. This may be
  3335. // used to include empty fields in Patch requests.
  3336. ForceSendFields []string `json:"-"`
  3337. // NullFields is a list of field names (e.g. "FollowupIntentName") to
  3338. // include in API requests with the JSON null value. By default, fields
  3339. // with empty values are omitted from API requests. However, any field
  3340. // with an empty value appearing in NullFields will be sent to the
  3341. // server as null. It is an error if a field in this list has a
  3342. // non-empty value. This may be used to include null fields in Patch
  3343. // requests.
  3344. NullFields []string `json:"-"`
  3345. }
  3346. func (s *GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo) MarshalJSON() ([]byte, error) {
  3347. type NoMethod GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo
  3348. raw := NoMethod(*s)
  3349. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3350. }
  3351. // GoogleCloudDialogflowV2beta1IntentMessage: Corresponds to the
  3352. // `Response` field in the Dialogflow console.
  3353. type GoogleCloudDialogflowV2beta1IntentMessage struct {
  3354. // BasicCard: Displays a basic card for Actions on Google.
  3355. BasicCard *GoogleCloudDialogflowV2beta1IntentMessageBasicCard `json:"basicCard,omitempty"`
  3356. // Card: Displays a card.
  3357. Card *GoogleCloudDialogflowV2beta1IntentMessageCard `json:"card,omitempty"`
  3358. // CarouselSelect: Displays a carousel card for Actions on Google.
  3359. CarouselSelect *GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect `json:"carouselSelect,omitempty"`
  3360. // Image: Displays an image.
  3361. Image *GoogleCloudDialogflowV2beta1IntentMessageImage `json:"image,omitempty"`
  3362. // LinkOutSuggestion: Displays a link out suggestion chip for Actions on
  3363. // Google.
  3364. LinkOutSuggestion *GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion `json:"linkOutSuggestion,omitempty"`
  3365. // ListSelect: Displays a list card for Actions on Google.
  3366. ListSelect *GoogleCloudDialogflowV2beta1IntentMessageListSelect `json:"listSelect,omitempty"`
  3367. // Payload: Returns a response containing a custom, platform-specific
  3368. // payload.
  3369. // See the Intent.Message.Platform type for a description of
  3370. // the
  3371. // structure that may be required for your platform.
  3372. Payload googleapi.RawMessage `json:"payload,omitempty"`
  3373. // Platform: Optional. The platform that this message is intended for.
  3374. //
  3375. // Possible values:
  3376. // "PLATFORM_UNSPECIFIED" - Not specified.
  3377. // "FACEBOOK" - Facebook.
  3378. // "SLACK" - Slack.
  3379. // "TELEGRAM" - Telegram.
  3380. // "KIK" - Kik.
  3381. // "SKYPE" - Skype.
  3382. // "LINE" - Line.
  3383. // "VIBER" - Viber.
  3384. // "ACTIONS_ON_GOOGLE" - Actions on Google.
  3385. // When using Actions on Google, you can choose one of the
  3386. // specific
  3387. // Intent.Message types that mention support for Actions on Google,
  3388. // or you can use the advanced Intent.Message.payload field.
  3389. // The payload field provides access to AoG features not available in
  3390. // the
  3391. // specific message types.
  3392. // If using the Intent.Message.payload field, it should have a
  3393. // structure
  3394. // similar to the JSON message shown here. For more information,
  3395. // see
  3396. // [Actions on Google
  3397. // Webhook
  3398. // Format](https://developers.google.com/actions/dialogflow/webho
  3399. // ok)
  3400. // <pre>{
  3401. // "expectUserResponse": true,
  3402. // "isSsml": false,
  3403. // "noInputPrompts": [],
  3404. // "richResponse": {
  3405. // "items": [
  3406. // {
  3407. // "simpleResponse": {
  3408. // "displayText": "hi",
  3409. // "textToSpeech": "hello"
  3410. // }
  3411. // }
  3412. // ],
  3413. // "suggestions": [
  3414. // {
  3415. // "title": "Say this"
  3416. // },
  3417. // {
  3418. // "title": "or this"
  3419. // }
  3420. // ]
  3421. // },
  3422. // "systemIntent": {
  3423. // "data": {
  3424. // "@type":
  3425. // "type.googleapis.com/google.actions.v2.OptionValueSpec",
  3426. // "listSelect": {
  3427. // "items": [
  3428. // {
  3429. // "optionInfo": {
  3430. // "key": "key1",
  3431. // "synonyms": [
  3432. // "key one"
  3433. // ]
  3434. // },
  3435. // "title": "must not be empty, but unique"
  3436. // },
  3437. // {
  3438. // "optionInfo": {
  3439. // "key": "key2",
  3440. // "synonyms": [
  3441. // "key two"
  3442. // ]
  3443. // },
  3444. // "title": "must not be empty, but unique"
  3445. // }
  3446. // ]
  3447. // }
  3448. // },
  3449. // "intent": "actions.intent.OPTION"
  3450. // }
  3451. // }</pre>
  3452. // "TELEPHONY" - Telephony Gateway.
  3453. Platform string `json:"platform,omitempty"`
  3454. // QuickReplies: Displays quick replies.
  3455. QuickReplies *GoogleCloudDialogflowV2beta1IntentMessageQuickReplies `json:"quickReplies,omitempty"`
  3456. // SimpleResponses: Returns a voice or text-only response for Actions on
  3457. // Google.
  3458. SimpleResponses *GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses `json:"simpleResponses,omitempty"`
  3459. // Suggestions: Displays suggestion chips for Actions on Google.
  3460. Suggestions *GoogleCloudDialogflowV2beta1IntentMessageSuggestions `json:"suggestions,omitempty"`
  3461. // TelephonyPlayAudio: Plays audio from a file in Telephony Gateway.
  3462. TelephonyPlayAudio *GoogleCloudDialogflowV2beta1IntentMessageTelephonyPlayAudio `json:"telephonyPlayAudio,omitempty"`
  3463. // TelephonySynthesizeSpeech: Synthesizes speech in Telephony Gateway.
  3464. TelephonySynthesizeSpeech *GoogleCloudDialogflowV2beta1IntentMessageTelephonySynthesizeSpeech `json:"telephonySynthesizeSpeech,omitempty"`
  3465. // TelephonyTransferCall: Transfers the call in Telephony Gateway.
  3466. TelephonyTransferCall *GoogleCloudDialogflowV2beta1IntentMessageTelephonyTransferCall `json:"telephonyTransferCall,omitempty"`
  3467. // Text: Returns a text response.
  3468. Text *GoogleCloudDialogflowV2beta1IntentMessageText `json:"text,omitempty"`
  3469. // ForceSendFields is a list of field names (e.g. "BasicCard") to
  3470. // unconditionally include in API requests. By default, fields with
  3471. // empty values are omitted from API requests. However, any non-pointer,
  3472. // non-interface field appearing in ForceSendFields will be sent to the
  3473. // server regardless of whether the field is empty or not. This may be
  3474. // used to include empty fields in Patch requests.
  3475. ForceSendFields []string `json:"-"`
  3476. // NullFields is a list of field names (e.g. "BasicCard") to include in
  3477. // API requests with the JSON null value. By default, fields with empty
  3478. // values are omitted from API requests. However, any field with an
  3479. // empty value appearing in NullFields will be sent to the server as
  3480. // null. It is an error if a field in this list has a non-empty value.
  3481. // This may be used to include null fields in Patch requests.
  3482. NullFields []string `json:"-"`
  3483. }
  3484. func (s *GoogleCloudDialogflowV2beta1IntentMessage) MarshalJSON() ([]byte, error) {
  3485. type NoMethod GoogleCloudDialogflowV2beta1IntentMessage
  3486. raw := NoMethod(*s)
  3487. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3488. }
  3489. // GoogleCloudDialogflowV2beta1IntentMessageBasicCard: The basic card
  3490. // message. Useful for displaying information.
  3491. type GoogleCloudDialogflowV2beta1IntentMessageBasicCard struct {
  3492. // Buttons: Optional. The collection of card buttons.
  3493. Buttons []*GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton `json:"buttons,omitempty"`
  3494. // FormattedText: Required, unless image is present. The body text of
  3495. // the card.
  3496. FormattedText string `json:"formattedText,omitempty"`
  3497. // Image: Optional. The image for the card.
  3498. Image *GoogleCloudDialogflowV2beta1IntentMessageImage `json:"image,omitempty"`
  3499. // Subtitle: Optional. The subtitle of the card.
  3500. Subtitle string `json:"subtitle,omitempty"`
  3501. // Title: Optional. The title of the card.
  3502. Title string `json:"title,omitempty"`
  3503. // ForceSendFields is a list of field names (e.g. "Buttons") to
  3504. // unconditionally include in API requests. By default, fields with
  3505. // empty values are omitted from API requests. However, any non-pointer,
  3506. // non-interface field appearing in ForceSendFields will be sent to the
  3507. // server regardless of whether the field is empty or not. This may be
  3508. // used to include empty fields in Patch requests.
  3509. ForceSendFields []string `json:"-"`
  3510. // NullFields is a list of field names (e.g. "Buttons") to include in
  3511. // API requests with the JSON null value. By default, fields with empty
  3512. // values are omitted from API requests. However, any field with an
  3513. // empty value appearing in NullFields will be sent to the server as
  3514. // null. It is an error if a field in this list has a non-empty value.
  3515. // This may be used to include null fields in Patch requests.
  3516. NullFields []string `json:"-"`
  3517. }
  3518. func (s *GoogleCloudDialogflowV2beta1IntentMessageBasicCard) MarshalJSON() ([]byte, error) {
  3519. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageBasicCard
  3520. raw := NoMethod(*s)
  3521. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3522. }
  3523. // GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton: The button
  3524. // object that appears at the bottom of a card.
  3525. type GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton struct {
  3526. // OpenUriAction: Required. Action to take when a user taps on the
  3527. // button.
  3528. OpenUriAction *GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction `json:"openUriAction,omitempty"`
  3529. // Title: Required. The title of the button.
  3530. Title string `json:"title,omitempty"`
  3531. // ForceSendFields is a list of field names (e.g. "OpenUriAction") to
  3532. // unconditionally include in API requests. By default, fields with
  3533. // empty values are omitted from API requests. However, any non-pointer,
  3534. // non-interface field appearing in ForceSendFields will be sent to the
  3535. // server regardless of whether the field is empty or not. This may be
  3536. // used to include empty fields in Patch requests.
  3537. ForceSendFields []string `json:"-"`
  3538. // NullFields is a list of field names (e.g. "OpenUriAction") to include
  3539. // in API requests with the JSON null value. By default, fields with
  3540. // empty values are omitted from API requests. However, any field with
  3541. // an empty value appearing in NullFields will be sent to the server as
  3542. // null. It is an error if a field in this list has a non-empty value.
  3543. // This may be used to include null fields in Patch requests.
  3544. NullFields []string `json:"-"`
  3545. }
  3546. func (s *GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton) MarshalJSON() ([]byte, error) {
  3547. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton
  3548. raw := NoMethod(*s)
  3549. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3550. }
  3551. // GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction:
  3552. // Opens the given URI.
  3553. type GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction struct {
  3554. // Uri: Required. The HTTP or HTTPS scheme URI.
  3555. Uri string `json:"uri,omitempty"`
  3556. // ForceSendFields is a list of field names (e.g. "Uri") to
  3557. // unconditionally include in API requests. By default, fields with
  3558. // empty values are omitted from API requests. However, any non-pointer,
  3559. // non-interface field appearing in ForceSendFields will be sent to the
  3560. // server regardless of whether the field is empty or not. This may be
  3561. // used to include empty fields in Patch requests.
  3562. ForceSendFields []string `json:"-"`
  3563. // NullFields is a list of field names (e.g. "Uri") to include in API
  3564. // requests with the JSON null value. By default, fields with empty
  3565. // values are omitted from API requests. However, any field with an
  3566. // empty value appearing in NullFields will be sent to the server as
  3567. // null. It is an error if a field in this list has a non-empty value.
  3568. // This may be used to include null fields in Patch requests.
  3569. NullFields []string `json:"-"`
  3570. }
  3571. func (s *GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction) MarshalJSON() ([]byte, error) {
  3572. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction
  3573. raw := NoMethod(*s)
  3574. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3575. }
  3576. // GoogleCloudDialogflowV2beta1IntentMessageCard: The card response
  3577. // message.
  3578. type GoogleCloudDialogflowV2beta1IntentMessageCard struct {
  3579. // Buttons: Optional. The collection of card buttons.
  3580. Buttons []*GoogleCloudDialogflowV2beta1IntentMessageCardButton `json:"buttons,omitempty"`
  3581. // ImageUri: Optional. The public URI to an image file for the card.
  3582. ImageUri string `json:"imageUri,omitempty"`
  3583. // Subtitle: Optional. The subtitle of the card.
  3584. Subtitle string `json:"subtitle,omitempty"`
  3585. // Title: Optional. The title of the card.
  3586. Title string `json:"title,omitempty"`
  3587. // ForceSendFields is a list of field names (e.g. "Buttons") to
  3588. // unconditionally include in API requests. By default, fields with
  3589. // empty values are omitted from API requests. However, any non-pointer,
  3590. // non-interface field appearing in ForceSendFields will be sent to the
  3591. // server regardless of whether the field is empty or not. This may be
  3592. // used to include empty fields in Patch requests.
  3593. ForceSendFields []string `json:"-"`
  3594. // NullFields is a list of field names (e.g. "Buttons") to include in
  3595. // API requests with the JSON null value. By default, fields with empty
  3596. // values are omitted from API requests. However, any field with an
  3597. // empty value appearing in NullFields will be sent to the server as
  3598. // null. It is an error if a field in this list has a non-empty value.
  3599. // This may be used to include null fields in Patch requests.
  3600. NullFields []string `json:"-"`
  3601. }
  3602. func (s *GoogleCloudDialogflowV2beta1IntentMessageCard) MarshalJSON() ([]byte, error) {
  3603. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageCard
  3604. raw := NoMethod(*s)
  3605. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3606. }
  3607. // GoogleCloudDialogflowV2beta1IntentMessageCardButton: Optional.
  3608. // Contains information about a button.
  3609. type GoogleCloudDialogflowV2beta1IntentMessageCardButton struct {
  3610. // Postback: Optional. The text to send back to the Dialogflow API or a
  3611. // URI to
  3612. // open.
  3613. Postback string `json:"postback,omitempty"`
  3614. // Text: Optional. The text to show on the button.
  3615. Text string `json:"text,omitempty"`
  3616. // ForceSendFields is a list of field names (e.g. "Postback") to
  3617. // unconditionally include in API requests. By default, fields with
  3618. // empty values are omitted from API requests. However, any non-pointer,
  3619. // non-interface field appearing in ForceSendFields will be sent to the
  3620. // server regardless of whether the field is empty or not. This may be
  3621. // used to include empty fields in Patch requests.
  3622. ForceSendFields []string `json:"-"`
  3623. // NullFields is a list of field names (e.g. "Postback") to include in
  3624. // API requests with the JSON null value. By default, fields with empty
  3625. // values are omitted from API requests. However, any field with an
  3626. // empty value appearing in NullFields will be sent to the server as
  3627. // null. It is an error if a field in this list has a non-empty value.
  3628. // This may be used to include null fields in Patch requests.
  3629. NullFields []string `json:"-"`
  3630. }
  3631. func (s *GoogleCloudDialogflowV2beta1IntentMessageCardButton) MarshalJSON() ([]byte, error) {
  3632. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageCardButton
  3633. raw := NoMethod(*s)
  3634. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3635. }
  3636. // GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect: The card for
  3637. // presenting a carousel of options to select from.
  3638. type GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect struct {
  3639. // Items: Required. Carousel items.
  3640. Items []*GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem `json:"items,omitempty"`
  3641. // ForceSendFields is a list of field names (e.g. "Items") to
  3642. // unconditionally include in API requests. By default, fields with
  3643. // empty values are omitted from API requests. However, any non-pointer,
  3644. // non-interface field appearing in ForceSendFields will be sent to the
  3645. // server regardless of whether the field is empty or not. This may be
  3646. // used to include empty fields in Patch requests.
  3647. ForceSendFields []string `json:"-"`
  3648. // NullFields is a list of field names (e.g. "Items") to include in API
  3649. // requests with the JSON null value. By default, fields with empty
  3650. // values are omitted from API requests. However, any field with an
  3651. // empty value appearing in NullFields will be sent to the server as
  3652. // null. It is an error if a field in this list has a non-empty value.
  3653. // This may be used to include null fields in Patch requests.
  3654. NullFields []string `json:"-"`
  3655. }
  3656. func (s *GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect) MarshalJSON() ([]byte, error) {
  3657. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect
  3658. raw := NoMethod(*s)
  3659. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3660. }
  3661. // GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem: An item
  3662. // in the carousel.
  3663. type GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem struct {
  3664. // Description: Optional. The body text of the card.
  3665. Description string `json:"description,omitempty"`
  3666. // Image: Optional. The image to display.
  3667. Image *GoogleCloudDialogflowV2beta1IntentMessageImage `json:"image,omitempty"`
  3668. // Info: Required. Additional info about the option item.
  3669. Info *GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo `json:"info,omitempty"`
  3670. // Title: Required. Title of the carousel item.
  3671. Title string `json:"title,omitempty"`
  3672. // ForceSendFields is a list of field names (e.g. "Description") to
  3673. // unconditionally include in API requests. By default, fields with
  3674. // empty values are omitted from API requests. However, any non-pointer,
  3675. // non-interface field appearing in ForceSendFields will be sent to the
  3676. // server regardless of whether the field is empty or not. This may be
  3677. // used to include empty fields in Patch requests.
  3678. ForceSendFields []string `json:"-"`
  3679. // NullFields is a list of field names (e.g. "Description") to include
  3680. // in API requests with the JSON null value. By default, fields with
  3681. // empty values are omitted from API requests. However, any field with
  3682. // an empty value appearing in NullFields will be sent to the server as
  3683. // null. It is an error if a field in this list has a non-empty value.
  3684. // This may be used to include null fields in Patch requests.
  3685. NullFields []string `json:"-"`
  3686. }
  3687. func (s *GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem) MarshalJSON() ([]byte, error) {
  3688. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem
  3689. raw := NoMethod(*s)
  3690. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3691. }
  3692. // GoogleCloudDialogflowV2beta1IntentMessageImage: The image response
  3693. // message.
  3694. type GoogleCloudDialogflowV2beta1IntentMessageImage struct {
  3695. // AccessibilityText: A text description of the image to be used for
  3696. // accessibility,
  3697. // e.g., screen readers. Required if image_uri is set for
  3698. // CarouselSelect.
  3699. AccessibilityText string `json:"accessibilityText,omitempty"`
  3700. // ImageUri: Optional. The public URI to an image file.
  3701. ImageUri string `json:"imageUri,omitempty"`
  3702. // ForceSendFields is a list of field names (e.g. "AccessibilityText")
  3703. // to unconditionally include in API requests. By default, fields with
  3704. // empty values are omitted from API requests. However, any non-pointer,
  3705. // non-interface field appearing in ForceSendFields will be sent to the
  3706. // server regardless of whether the field is empty or not. This may be
  3707. // used to include empty fields in Patch requests.
  3708. ForceSendFields []string `json:"-"`
  3709. // NullFields is a list of field names (e.g. "AccessibilityText") to
  3710. // include in API requests with the JSON null value. By default, fields
  3711. // with empty values are omitted from API requests. However, any field
  3712. // with an empty value appearing in NullFields will be sent to the
  3713. // server as null. It is an error if a field in this list has a
  3714. // non-empty value. This may be used to include null fields in Patch
  3715. // requests.
  3716. NullFields []string `json:"-"`
  3717. }
  3718. func (s *GoogleCloudDialogflowV2beta1IntentMessageImage) MarshalJSON() ([]byte, error) {
  3719. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageImage
  3720. raw := NoMethod(*s)
  3721. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3722. }
  3723. // GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion: The
  3724. // suggestion chip message that allows the user to jump out to the
  3725. // app
  3726. // or website associated with this agent.
  3727. type GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion struct {
  3728. // DestinationName: Required. The name of the app or site this chip is
  3729. // linking to.
  3730. DestinationName string `json:"destinationName,omitempty"`
  3731. // Uri: Required. The URI of the app or site to open when the user taps
  3732. // the
  3733. // suggestion chip.
  3734. Uri string `json:"uri,omitempty"`
  3735. // ForceSendFields is a list of field names (e.g. "DestinationName") to
  3736. // unconditionally include in API requests. By default, fields with
  3737. // empty values are omitted from API requests. However, any non-pointer,
  3738. // non-interface field appearing in ForceSendFields will be sent to the
  3739. // server regardless of whether the field is empty or not. This may be
  3740. // used to include empty fields in Patch requests.
  3741. ForceSendFields []string `json:"-"`
  3742. // NullFields is a list of field names (e.g. "DestinationName") to
  3743. // include in API requests with the JSON null value. By default, fields
  3744. // with empty values are omitted from API requests. However, any field
  3745. // with an empty value appearing in NullFields will be sent to the
  3746. // server as null. It is an error if a field in this list has a
  3747. // non-empty value. This may be used to include null fields in Patch
  3748. // requests.
  3749. NullFields []string `json:"-"`
  3750. }
  3751. func (s *GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion) MarshalJSON() ([]byte, error) {
  3752. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion
  3753. raw := NoMethod(*s)
  3754. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3755. }
  3756. // GoogleCloudDialogflowV2beta1IntentMessageListSelect: The card for
  3757. // presenting a list of options to select from.
  3758. type GoogleCloudDialogflowV2beta1IntentMessageListSelect struct {
  3759. // Items: Required. List items.
  3760. Items []*GoogleCloudDialogflowV2beta1IntentMessageListSelectItem `json:"items,omitempty"`
  3761. // Title: Optional. The overall title of the list.
  3762. Title string `json:"title,omitempty"`
  3763. // ForceSendFields is a list of field names (e.g. "Items") to
  3764. // unconditionally include in API requests. By default, fields with
  3765. // empty values are omitted from API requests. However, any non-pointer,
  3766. // non-interface field appearing in ForceSendFields will be sent to the
  3767. // server regardless of whether the field is empty or not. This may be
  3768. // used to include empty fields in Patch requests.
  3769. ForceSendFields []string `json:"-"`
  3770. // NullFields is a list of field names (e.g. "Items") to include in API
  3771. // requests with the JSON null value. By default, fields with empty
  3772. // values are omitted from API requests. However, any field with an
  3773. // empty value appearing in NullFields will be sent to the server as
  3774. // null. It is an error if a field in this list has a non-empty value.
  3775. // This may be used to include null fields in Patch requests.
  3776. NullFields []string `json:"-"`
  3777. }
  3778. func (s *GoogleCloudDialogflowV2beta1IntentMessageListSelect) MarshalJSON() ([]byte, error) {
  3779. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageListSelect
  3780. raw := NoMethod(*s)
  3781. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3782. }
  3783. // GoogleCloudDialogflowV2beta1IntentMessageListSelectItem: An item in
  3784. // the list.
  3785. type GoogleCloudDialogflowV2beta1IntentMessageListSelectItem struct {
  3786. // Description: Optional. The main text describing the item.
  3787. Description string `json:"description,omitempty"`
  3788. // Image: Optional. The image to display.
  3789. Image *GoogleCloudDialogflowV2beta1IntentMessageImage `json:"image,omitempty"`
  3790. // Info: Required. Additional information about this option.
  3791. Info *GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo `json:"info,omitempty"`
  3792. // Title: Required. The title of the list item.
  3793. Title string `json:"title,omitempty"`
  3794. // ForceSendFields is a list of field names (e.g. "Description") to
  3795. // unconditionally include in API requests. By default, fields with
  3796. // empty values are omitted from API requests. However, any non-pointer,
  3797. // non-interface field appearing in ForceSendFields will be sent to the
  3798. // server regardless of whether the field is empty or not. This may be
  3799. // used to include empty fields in Patch requests.
  3800. ForceSendFields []string `json:"-"`
  3801. // NullFields is a list of field names (e.g. "Description") to include
  3802. // in API requests with the JSON null value. By default, fields with
  3803. // empty values are omitted from API requests. However, any field with
  3804. // an empty value appearing in NullFields will be sent to the server as
  3805. // null. It is an error if a field in this list has a non-empty value.
  3806. // This may be used to include null fields in Patch requests.
  3807. NullFields []string `json:"-"`
  3808. }
  3809. func (s *GoogleCloudDialogflowV2beta1IntentMessageListSelectItem) MarshalJSON() ([]byte, error) {
  3810. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageListSelectItem
  3811. raw := NoMethod(*s)
  3812. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3813. }
  3814. // GoogleCloudDialogflowV2beta1IntentMessageQuickReplies: The quick
  3815. // replies response message.
  3816. type GoogleCloudDialogflowV2beta1IntentMessageQuickReplies struct {
  3817. // QuickReplies: Optional. The collection of quick replies.
  3818. QuickReplies []string `json:"quickReplies,omitempty"`
  3819. // Title: Optional. The title of the collection of quick replies.
  3820. Title string `json:"title,omitempty"`
  3821. // ForceSendFields is a list of field names (e.g. "QuickReplies") to
  3822. // unconditionally include in API requests. By default, fields with
  3823. // empty values are omitted from API requests. However, any non-pointer,
  3824. // non-interface field appearing in ForceSendFields will be sent to the
  3825. // server regardless of whether the field is empty or not. This may be
  3826. // used to include empty fields in Patch requests.
  3827. ForceSendFields []string `json:"-"`
  3828. // NullFields is a list of field names (e.g. "QuickReplies") to include
  3829. // in API requests with the JSON null value. By default, fields with
  3830. // empty values are omitted from API requests. However, any field with
  3831. // an empty value appearing in NullFields will be sent to the server as
  3832. // null. It is an error if a field in this list has a non-empty value.
  3833. // This may be used to include null fields in Patch requests.
  3834. NullFields []string `json:"-"`
  3835. }
  3836. func (s *GoogleCloudDialogflowV2beta1IntentMessageQuickReplies) MarshalJSON() ([]byte, error) {
  3837. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageQuickReplies
  3838. raw := NoMethod(*s)
  3839. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3840. }
  3841. // GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo: Additional
  3842. // info about the select item for when it is triggered in a
  3843. // dialog.
  3844. type GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo struct {
  3845. // Key: Required. A unique key that will be sent back to the agent if
  3846. // this
  3847. // response is given.
  3848. Key string `json:"key,omitempty"`
  3849. // Synonyms: Optional. A list of synonyms that can also be used to
  3850. // trigger this
  3851. // item in dialog.
  3852. Synonyms []string `json:"synonyms,omitempty"`
  3853. // ForceSendFields is a list of field names (e.g. "Key") to
  3854. // unconditionally include in API requests. By default, fields with
  3855. // empty values are omitted from API requests. However, any non-pointer,
  3856. // non-interface field appearing in ForceSendFields will be sent to the
  3857. // server regardless of whether the field is empty or not. This may be
  3858. // used to include empty fields in Patch requests.
  3859. ForceSendFields []string `json:"-"`
  3860. // NullFields is a list of field names (e.g. "Key") to include in API
  3861. // requests with the JSON null value. By default, fields with empty
  3862. // values are omitted from API requests. However, any field with an
  3863. // empty value appearing in NullFields will be sent to the server as
  3864. // null. It is an error if a field in this list has a non-empty value.
  3865. // This may be used to include null fields in Patch requests.
  3866. NullFields []string `json:"-"`
  3867. }
  3868. func (s *GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo) MarshalJSON() ([]byte, error) {
  3869. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo
  3870. raw := NoMethod(*s)
  3871. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3872. }
  3873. // GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse: The simple
  3874. // response message containing speech or text.
  3875. type GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse struct {
  3876. // DisplayText: Optional. The text to display.
  3877. DisplayText string `json:"displayText,omitempty"`
  3878. // Ssml: One of text_to_speech or ssml must be provided. Structured
  3879. // spoken
  3880. // response to the user in the SSML format. Mutually exclusive
  3881. // with
  3882. // text_to_speech.
  3883. Ssml string `json:"ssml,omitempty"`
  3884. // TextToSpeech: One of text_to_speech or ssml must be provided. The
  3885. // plain text of the
  3886. // speech output. Mutually exclusive with ssml.
  3887. TextToSpeech string `json:"textToSpeech,omitempty"`
  3888. // ForceSendFields is a list of field names (e.g. "DisplayText") to
  3889. // unconditionally include in API requests. By default, fields with
  3890. // empty values are omitted from API requests. However, any non-pointer,
  3891. // non-interface field appearing in ForceSendFields will be sent to the
  3892. // server regardless of whether the field is empty or not. This may be
  3893. // used to include empty fields in Patch requests.
  3894. ForceSendFields []string `json:"-"`
  3895. // NullFields is a list of field names (e.g. "DisplayText") to include
  3896. // in API requests with the JSON null value. By default, fields with
  3897. // empty values are omitted from API requests. However, any field with
  3898. // an empty value appearing in NullFields will be sent to the server as
  3899. // null. It is an error if a field in this list has a non-empty value.
  3900. // This may be used to include null fields in Patch requests.
  3901. NullFields []string `json:"-"`
  3902. }
  3903. func (s *GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse) MarshalJSON() ([]byte, error) {
  3904. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse
  3905. raw := NoMethod(*s)
  3906. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3907. }
  3908. // GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses: The
  3909. // collection of simple response candidates.
  3910. // This message in `QueryResult.fulfillment_messages`
  3911. // and
  3912. // `WebhookResponse.fulfillment_messages` should contain only
  3913. // one
  3914. // `SimpleResponse`.
  3915. type GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses struct {
  3916. // SimpleResponses: Required. The list of simple responses.
  3917. SimpleResponses []*GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse `json:"simpleResponses,omitempty"`
  3918. // ForceSendFields is a list of field names (e.g. "SimpleResponses") to
  3919. // unconditionally include in API requests. By default, fields with
  3920. // empty values are omitted from API requests. However, any non-pointer,
  3921. // non-interface field appearing in ForceSendFields will be sent to the
  3922. // server regardless of whether the field is empty or not. This may be
  3923. // used to include empty fields in Patch requests.
  3924. ForceSendFields []string `json:"-"`
  3925. // NullFields is a list of field names (e.g. "SimpleResponses") to
  3926. // include in API requests with the JSON null value. By default, fields
  3927. // with empty values are omitted from API requests. However, any field
  3928. // with an empty value appearing in NullFields will be sent to the
  3929. // server as null. It is an error if a field in this list has a
  3930. // non-empty value. This may be used to include null fields in Patch
  3931. // requests.
  3932. NullFields []string `json:"-"`
  3933. }
  3934. func (s *GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses) MarshalJSON() ([]byte, error) {
  3935. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses
  3936. raw := NoMethod(*s)
  3937. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3938. }
  3939. // GoogleCloudDialogflowV2beta1IntentMessageSuggestion: The suggestion
  3940. // chip message that the user can tap to quickly post a reply
  3941. // to the conversation.
  3942. type GoogleCloudDialogflowV2beta1IntentMessageSuggestion struct {
  3943. // Title: Required. The text shown the in the suggestion chip.
  3944. Title string `json:"title,omitempty"`
  3945. // ForceSendFields is a list of field names (e.g. "Title") to
  3946. // unconditionally include in API requests. By default, fields with
  3947. // empty values are omitted from API requests. However, any non-pointer,
  3948. // non-interface field appearing in ForceSendFields will be sent to the
  3949. // server regardless of whether the field is empty or not. This may be
  3950. // used to include empty fields in Patch requests.
  3951. ForceSendFields []string `json:"-"`
  3952. // NullFields is a list of field names (e.g. "Title") to include in API
  3953. // requests with the JSON null value. By default, fields with empty
  3954. // values are omitted from API requests. However, any field with an
  3955. // empty value appearing in NullFields will be sent to the server as
  3956. // null. It is an error if a field in this list has a non-empty value.
  3957. // This may be used to include null fields in Patch requests.
  3958. NullFields []string `json:"-"`
  3959. }
  3960. func (s *GoogleCloudDialogflowV2beta1IntentMessageSuggestion) MarshalJSON() ([]byte, error) {
  3961. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageSuggestion
  3962. raw := NoMethod(*s)
  3963. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3964. }
  3965. // GoogleCloudDialogflowV2beta1IntentMessageSuggestions: The collection
  3966. // of suggestions.
  3967. type GoogleCloudDialogflowV2beta1IntentMessageSuggestions struct {
  3968. // Suggestions: Required. The list of suggested replies.
  3969. Suggestions []*GoogleCloudDialogflowV2beta1IntentMessageSuggestion `json:"suggestions,omitempty"`
  3970. // ForceSendFields is a list of field names (e.g. "Suggestions") to
  3971. // unconditionally include in API requests. By default, fields with
  3972. // empty values are omitted from API requests. However, any non-pointer,
  3973. // non-interface field appearing in ForceSendFields will be sent to the
  3974. // server regardless of whether the field is empty or not. This may be
  3975. // used to include empty fields in Patch requests.
  3976. ForceSendFields []string `json:"-"`
  3977. // NullFields is a list of field names (e.g. "Suggestions") to include
  3978. // in API requests with the JSON null value. By default, fields with
  3979. // empty values are omitted from API requests. However, any field with
  3980. // an empty value appearing in NullFields will be sent to the server as
  3981. // null. It is an error if a field in this list has a non-empty value.
  3982. // This may be used to include null fields in Patch requests.
  3983. NullFields []string `json:"-"`
  3984. }
  3985. func (s *GoogleCloudDialogflowV2beta1IntentMessageSuggestions) MarshalJSON() ([]byte, error) {
  3986. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageSuggestions
  3987. raw := NoMethod(*s)
  3988. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3989. }
  3990. // GoogleCloudDialogflowV2beta1IntentMessageTelephonyPlayAudio: Plays
  3991. // audio from a file in Telephony Gateway.
  3992. type GoogleCloudDialogflowV2beta1IntentMessageTelephonyPlayAudio struct {
  3993. // AudioUri: Required. URI to a Google Cloud Storage object containing
  3994. // the audio to
  3995. // play, e.g., "gs://bucket/object". The object must contain a
  3996. // single
  3997. // channel (mono) of linear PCM audio (2 bytes / sample) at 8kHz.
  3998. //
  3999. // This object must be readable by the
  4000. // `service-<Project
  4001. // Number>@gcp-sa-dialogflow.iam.gserviceaccount.com` service
  4002. // account
  4003. // where <Project Number> is the number of the Telephony Gateway
  4004. // project
  4005. // (usually the same as the Dialogflow agent project). If the Google
  4006. // Cloud
  4007. // Storage bucket is in the Telephony Gateway project, this permission
  4008. // is
  4009. // added by default when enabling the Dialogflow V2 API.
  4010. //
  4011. // For audio from other sources, consider using
  4012. // the
  4013. // `TelephonySynthesizeSpeech` message with SSML.
  4014. AudioUri string `json:"audioUri,omitempty"`
  4015. // ForceSendFields is a list of field names (e.g. "AudioUri") to
  4016. // unconditionally include in API requests. By default, fields with
  4017. // empty values are omitted from API requests. However, any non-pointer,
  4018. // non-interface field appearing in ForceSendFields will be sent to the
  4019. // server regardless of whether the field is empty or not. This may be
  4020. // used to include empty fields in Patch requests.
  4021. ForceSendFields []string `json:"-"`
  4022. // NullFields is a list of field names (e.g. "AudioUri") to include in
  4023. // API requests with the JSON null value. By default, fields with empty
  4024. // values are omitted from API requests. However, any field with an
  4025. // empty value appearing in NullFields will be sent to the server as
  4026. // null. It is an error if a field in this list has a non-empty value.
  4027. // This may be used to include null fields in Patch requests.
  4028. NullFields []string `json:"-"`
  4029. }
  4030. func (s *GoogleCloudDialogflowV2beta1IntentMessageTelephonyPlayAudio) MarshalJSON() ([]byte, error) {
  4031. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageTelephonyPlayAudio
  4032. raw := NoMethod(*s)
  4033. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4034. }
  4035. // GoogleCloudDialogflowV2beta1IntentMessageTelephonySynthesizeSpeech:
  4036. // Synthesizes speech and plays back the synthesized audio to the caller
  4037. // in
  4038. // Telephony Gateway.
  4039. //
  4040. // Telephony Gateway takes the synthesizer settings
  4041. // from
  4042. // `DetectIntentResponse.output_audio_config` which can either be set
  4043. // at request-level or can come from the agent-level synthesizer config.
  4044. type GoogleCloudDialogflowV2beta1IntentMessageTelephonySynthesizeSpeech struct {
  4045. // Ssml: The SSML to be synthesized. For more information,
  4046. // see
  4047. // [SSML](https://developers.google.com/actions/reference/ssml).
  4048. Ssml string `json:"ssml,omitempty"`
  4049. // Text: The raw text to be synthesized.
  4050. Text string `json:"text,omitempty"`
  4051. // ForceSendFields is a list of field names (e.g. "Ssml") to
  4052. // unconditionally include in API requests. By default, fields with
  4053. // empty values are omitted from API requests. However, any non-pointer,
  4054. // non-interface field appearing in ForceSendFields will be sent to the
  4055. // server regardless of whether the field is empty or not. This may be
  4056. // used to include empty fields in Patch requests.
  4057. ForceSendFields []string `json:"-"`
  4058. // NullFields is a list of field names (e.g. "Ssml") to include in API
  4059. // requests with the JSON null value. By default, fields with empty
  4060. // values are omitted from API requests. However, any field with an
  4061. // empty value appearing in NullFields will be sent to the server as
  4062. // null. It is an error if a field in this list has a non-empty value.
  4063. // This may be used to include null fields in Patch requests.
  4064. NullFields []string `json:"-"`
  4065. }
  4066. func (s *GoogleCloudDialogflowV2beta1IntentMessageTelephonySynthesizeSpeech) MarshalJSON() ([]byte, error) {
  4067. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageTelephonySynthesizeSpeech
  4068. raw := NoMethod(*s)
  4069. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4070. }
  4071. // GoogleCloudDialogflowV2beta1IntentMessageTelephonyTransferCall:
  4072. // Transfers the call in Telephony Gateway.
  4073. type GoogleCloudDialogflowV2beta1IntentMessageTelephonyTransferCall struct {
  4074. // PhoneNumber: Required. The phone number to transfer the call to
  4075. // in [E.164 format](https://en.wikipedia.org/wiki/E.164).
  4076. //
  4077. // We currently only allow transferring to US numbers (+1xxxyyyzzzz).
  4078. PhoneNumber string `json:"phoneNumber,omitempty"`
  4079. // ForceSendFields is a list of field names (e.g. "PhoneNumber") to
  4080. // unconditionally include in API requests. By default, fields with
  4081. // empty values are omitted from API requests. However, any non-pointer,
  4082. // non-interface field appearing in ForceSendFields will be sent to the
  4083. // server regardless of whether the field is empty or not. This may be
  4084. // used to include empty fields in Patch requests.
  4085. ForceSendFields []string `json:"-"`
  4086. // NullFields is a list of field names (e.g. "PhoneNumber") to include
  4087. // in API requests with the JSON null value. By default, fields with
  4088. // empty values are omitted from API requests. However, any field with
  4089. // an empty value appearing in NullFields will be sent to the server as
  4090. // null. It is an error if a field in this list has a non-empty value.
  4091. // This may be used to include null fields in Patch requests.
  4092. NullFields []string `json:"-"`
  4093. }
  4094. func (s *GoogleCloudDialogflowV2beta1IntentMessageTelephonyTransferCall) MarshalJSON() ([]byte, error) {
  4095. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageTelephonyTransferCall
  4096. raw := NoMethod(*s)
  4097. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4098. }
  4099. // GoogleCloudDialogflowV2beta1IntentMessageText: The text response
  4100. // message.
  4101. type GoogleCloudDialogflowV2beta1IntentMessageText struct {
  4102. // Text: Optional. The collection of the agent's responses.
  4103. Text []string `json:"text,omitempty"`
  4104. // ForceSendFields is a list of field names (e.g. "Text") to
  4105. // unconditionally include in API requests. By default, fields with
  4106. // empty values are omitted from API requests. However, any non-pointer,
  4107. // non-interface field appearing in ForceSendFields will be sent to the
  4108. // server regardless of whether the field is empty or not. This may be
  4109. // used to include empty fields in Patch requests.
  4110. ForceSendFields []string `json:"-"`
  4111. // NullFields is a list of field names (e.g. "Text") to include in API
  4112. // requests with the JSON null value. By default, fields with empty
  4113. // values are omitted from API requests. However, any field with an
  4114. // empty value appearing in NullFields will be sent to the server as
  4115. // null. It is an error if a field in this list has a non-empty value.
  4116. // This may be used to include null fields in Patch requests.
  4117. NullFields []string `json:"-"`
  4118. }
  4119. func (s *GoogleCloudDialogflowV2beta1IntentMessageText) MarshalJSON() ([]byte, error) {
  4120. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageText
  4121. raw := NoMethod(*s)
  4122. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4123. }
  4124. // GoogleCloudDialogflowV2beta1IntentParameter: Represents intent
  4125. // parameters.
  4126. type GoogleCloudDialogflowV2beta1IntentParameter struct {
  4127. // DefaultValue: Optional. The default value to use when the `value`
  4128. // yields an empty
  4129. // result.
  4130. // Default values can be extracted from contexts by using the
  4131. // following
  4132. // syntax: `#context_name.parameter_name`.
  4133. DefaultValue string `json:"defaultValue,omitempty"`
  4134. // DisplayName: Required. The name of the parameter.
  4135. DisplayName string `json:"displayName,omitempty"`
  4136. // EntityTypeDisplayName: Optional. The name of the entity type,
  4137. // prefixed with `@`, that
  4138. // describes values of the parameter. If the parameter is
  4139. // required, this must be provided.
  4140. EntityTypeDisplayName string `json:"entityTypeDisplayName,omitempty"`
  4141. // IsList: Optional. Indicates whether the parameter represents a list
  4142. // of values.
  4143. IsList bool `json:"isList,omitempty"`
  4144. // Mandatory: Optional. Indicates whether the parameter is required.
  4145. // That is,
  4146. // whether the intent cannot be completed without collecting the
  4147. // parameter
  4148. // value.
  4149. Mandatory bool `json:"mandatory,omitempty"`
  4150. // Name: The unique identifier of this parameter.
  4151. Name string `json:"name,omitempty"`
  4152. // Prompts: Optional. The collection of prompts that the agent can
  4153. // present to the
  4154. // user in order to collect value for the parameter.
  4155. Prompts []string `json:"prompts,omitempty"`
  4156. // Value: Optional. The definition of the parameter value. It can be:
  4157. // - a constant string,
  4158. // - a parameter value defined as `$parameter_name`,
  4159. // - an original parameter value defined as
  4160. // `$parameter_name.original`,
  4161. // - a parameter value from some context defined as
  4162. // `#context_name.parameter_name`.
  4163. Value string `json:"value,omitempty"`
  4164. // ForceSendFields is a list of field names (e.g. "DefaultValue") to
  4165. // unconditionally include in API requests. By default, fields with
  4166. // empty values are omitted from API requests. However, any non-pointer,
  4167. // non-interface field appearing in ForceSendFields will be sent to the
  4168. // server regardless of whether the field is empty or not. This may be
  4169. // used to include empty fields in Patch requests.
  4170. ForceSendFields []string `json:"-"`
  4171. // NullFields is a list of field names (e.g. "DefaultValue") to include
  4172. // in API requests with the JSON null value. By default, fields with
  4173. // empty values are omitted from API requests. However, any field with
  4174. // an empty value appearing in NullFields will be sent to the server as
  4175. // null. It is an error if a field in this list has a non-empty value.
  4176. // This may be used to include null fields in Patch requests.
  4177. NullFields []string `json:"-"`
  4178. }
  4179. func (s *GoogleCloudDialogflowV2beta1IntentParameter) MarshalJSON() ([]byte, error) {
  4180. type NoMethod GoogleCloudDialogflowV2beta1IntentParameter
  4181. raw := NoMethod(*s)
  4182. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4183. }
  4184. // GoogleCloudDialogflowV2beta1IntentTrainingPhrase: Represents an
  4185. // example that the agent is trained on.
  4186. type GoogleCloudDialogflowV2beta1IntentTrainingPhrase struct {
  4187. // Name: Output only. The unique identifier of this training phrase.
  4188. Name string `json:"name,omitempty"`
  4189. // Parts: Required. The ordered list of training phrase parts.
  4190. // The parts are concatenated in order to form the training
  4191. // phrase.
  4192. //
  4193. // Note: The API does not automatically annotate training phrases like
  4194. // the
  4195. // Dialogflow Console does.
  4196. //
  4197. // Note: Do not forget to include whitespace at part boundaries,
  4198. // so the training phrase is well formatted when the parts are
  4199. // concatenated.
  4200. //
  4201. // If the training phrase does not need to be annotated with
  4202. // parameters,
  4203. // you just need a single part with only the Part.text field set.
  4204. //
  4205. // If you want to annotate the training phrase, you must create
  4206. // multiple
  4207. // parts, where the fields of each part are populated in one of two
  4208. // ways:
  4209. //
  4210. // - `Part.text` is set to a part of the phrase that has no
  4211. // parameters.
  4212. // - `Part.text` is set to a part of the phrase that you want to
  4213. // annotate,
  4214. // and the `entity_type`, `alias`, and `user_defined` fields are
  4215. // all
  4216. // set.
  4217. Parts []*GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart `json:"parts,omitempty"`
  4218. // TimesAddedCount: Optional. Indicates how many times this example was
  4219. // added to
  4220. // the intent. Each time a developer adds an existing sample by editing
  4221. // an
  4222. // intent or training, this counter is increased.
  4223. TimesAddedCount int64 `json:"timesAddedCount,omitempty"`
  4224. // Type: Required. The type of the training phrase.
  4225. //
  4226. // Possible values:
  4227. // "TYPE_UNSPECIFIED" - Not specified. This value should never be
  4228. // used.
  4229. // "EXAMPLE" - Examples do not contain @-prefixed entity type names,
  4230. // but example parts
  4231. // can be annotated with entity types.
  4232. // "TEMPLATE" - Templates are not annotated with entity types, but
  4233. // they can contain
  4234. // @-prefixed entity type names as substrings.
  4235. // Template mode has been deprecated. Example mode is the only
  4236. // supported
  4237. // way to create new training phrases. If you have existing
  4238. // training
  4239. // phrases that you've created in template mode, those will continue
  4240. // to
  4241. // work.
  4242. Type string `json:"type,omitempty"`
  4243. // ForceSendFields is a list of field names (e.g. "Name") to
  4244. // unconditionally include in API requests. By default, fields with
  4245. // empty values are omitted from API requests. However, any non-pointer,
  4246. // non-interface field appearing in ForceSendFields will be sent to the
  4247. // server regardless of whether the field is empty or not. This may be
  4248. // used to include empty fields in Patch requests.
  4249. ForceSendFields []string `json:"-"`
  4250. // NullFields is a list of field names (e.g. "Name") to include in API
  4251. // requests with the JSON null value. By default, fields with empty
  4252. // values are omitted from API requests. However, any field with an
  4253. // empty value appearing in NullFields will be sent to the server as
  4254. // null. It is an error if a field in this list has a non-empty value.
  4255. // This may be used to include null fields in Patch requests.
  4256. NullFields []string `json:"-"`
  4257. }
  4258. func (s *GoogleCloudDialogflowV2beta1IntentTrainingPhrase) MarshalJSON() ([]byte, error) {
  4259. type NoMethod GoogleCloudDialogflowV2beta1IntentTrainingPhrase
  4260. raw := NoMethod(*s)
  4261. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4262. }
  4263. // GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart: Represents a
  4264. // part of a training phrase.
  4265. type GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart struct {
  4266. // Alias: Optional. The parameter name for the value extracted from
  4267. // the
  4268. // annotated part of the example.
  4269. // This field is required for annotated parts of the training phrase.
  4270. Alias string `json:"alias,omitempty"`
  4271. // EntityType: Optional. The entity type name prefixed with `@`.
  4272. // This field is required for annotated parts of the training phrase.
  4273. EntityType string `json:"entityType,omitempty"`
  4274. // Text: Required. The text for this part.
  4275. Text string `json:"text,omitempty"`
  4276. // UserDefined: Optional. Indicates whether the text was manually
  4277. // annotated.
  4278. // This field is set to true when the Dialogflow Console is used
  4279. // to
  4280. // manually annotate the part. When creating an annotated part with
  4281. // the
  4282. // API, you must set this to true.
  4283. UserDefined bool `json:"userDefined,omitempty"`
  4284. // ForceSendFields is a list of field names (e.g. "Alias") to
  4285. // unconditionally include in API requests. By default, fields with
  4286. // empty values are omitted from API requests. However, any non-pointer,
  4287. // non-interface field appearing in ForceSendFields will be sent to the
  4288. // server regardless of whether the field is empty or not. This may be
  4289. // used to include empty fields in Patch requests.
  4290. ForceSendFields []string `json:"-"`
  4291. // NullFields is a list of field names (e.g. "Alias") to include in API
  4292. // requests with the JSON null value. By default, fields with empty
  4293. // values are omitted from API requests. However, any field with an
  4294. // empty value appearing in NullFields will be sent to the server as
  4295. // null. It is an error if a field in this list has a non-empty value.
  4296. // This may be used to include null fields in Patch requests.
  4297. NullFields []string `json:"-"`
  4298. }
  4299. func (s *GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart) MarshalJSON() ([]byte, error) {
  4300. type NoMethod GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart
  4301. raw := NoMethod(*s)
  4302. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4303. }
  4304. // GoogleCloudDialogflowV2beta1KnowledgeAnswers: Represents the result
  4305. // of querying a Knowledge base.
  4306. type GoogleCloudDialogflowV2beta1KnowledgeAnswers struct {
  4307. // Answers: A list of answers from Knowledge Connector.
  4308. Answers []*GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer `json:"answers,omitempty"`
  4309. // ForceSendFields is a list of field names (e.g. "Answers") to
  4310. // unconditionally include in API requests. By default, fields with
  4311. // empty values are omitted from API requests. However, any non-pointer,
  4312. // non-interface field appearing in ForceSendFields will be sent to the
  4313. // server regardless of whether the field is empty or not. This may be
  4314. // used to include empty fields in Patch requests.
  4315. ForceSendFields []string `json:"-"`
  4316. // NullFields is a list of field names (e.g. "Answers") to include in
  4317. // API requests with the JSON null value. By default, fields with empty
  4318. // values are omitted from API requests. However, any field with an
  4319. // empty value appearing in NullFields will be sent to the server as
  4320. // null. It is an error if a field in this list has a non-empty value.
  4321. // This may be used to include null fields in Patch requests.
  4322. NullFields []string `json:"-"`
  4323. }
  4324. func (s *GoogleCloudDialogflowV2beta1KnowledgeAnswers) MarshalJSON() ([]byte, error) {
  4325. type NoMethod GoogleCloudDialogflowV2beta1KnowledgeAnswers
  4326. raw := NoMethod(*s)
  4327. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4328. }
  4329. // GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer: An answer from
  4330. // Knowledge Connector.
  4331. type GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer struct {
  4332. // Answer: The piece of text from the `source` knowledge base document
  4333. // that answers
  4334. // this conversational query.
  4335. Answer string `json:"answer,omitempty"`
  4336. // FaqQuestion: The corresponding FAQ question if the answer was
  4337. // extracted from a FAQ
  4338. // Document, empty otherwise.
  4339. FaqQuestion string `json:"faqQuestion,omitempty"`
  4340. // MatchConfidence: The system's confidence score that this Knowledge
  4341. // answer is a good match
  4342. // for this conversational query.
  4343. // The range is from 0.0 (completely uncertain) to 1.0 (completely
  4344. // certain).
  4345. // Note: The confidence score is likely to vary somewhat (possibly even
  4346. // for
  4347. // identical requests), as the underlying model is under
  4348. // constant
  4349. // improvement. It may be deprecated in the future. We recommend
  4350. // using
  4351. // `match_confidence_level` which should be generally more stable.
  4352. MatchConfidence float64 `json:"matchConfidence,omitempty"`
  4353. // MatchConfidenceLevel: The system's confidence level that this
  4354. // knowledge answer is a good match
  4355. // for this conversational query.
  4356. // NOTE: The confidence level for a given `<query, answer>` pair may
  4357. // change
  4358. // without notice, as it depends on models that are constantly
  4359. // being
  4360. // improved. However, it will change less frequently than the
  4361. // confidence
  4362. // score below, and should be preferred for referencing the quality of
  4363. // an
  4364. // answer.
  4365. //
  4366. // Possible values:
  4367. // "MATCH_CONFIDENCE_LEVEL_UNSPECIFIED" - Not specified.
  4368. // "LOW" - Indicates that the confidence is low.
  4369. // "MEDIUM" - Indicates our confidence is medium.
  4370. // "HIGH" - Indicates our confidence is high.
  4371. MatchConfidenceLevel string `json:"matchConfidenceLevel,omitempty"`
  4372. // Source: Indicates which Knowledge Document this answer was extracted
  4373. // from.
  4374. // Format: `projects/<Project ID>/knowledgeBases/<Knowledge
  4375. // Base
  4376. // ID>/documents/<Document ID>`.
  4377. Source string `json:"source,omitempty"`
  4378. // ForceSendFields is a list of field names (e.g. "Answer") to
  4379. // unconditionally include in API requests. By default, fields with
  4380. // empty values are omitted from API requests. However, any non-pointer,
  4381. // non-interface field appearing in ForceSendFields will be sent to the
  4382. // server regardless of whether the field is empty or not. This may be
  4383. // used to include empty fields in Patch requests.
  4384. ForceSendFields []string `json:"-"`
  4385. // NullFields is a list of field names (e.g. "Answer") to include in API
  4386. // requests with the JSON null value. By default, fields with empty
  4387. // values are omitted from API requests. However, any field with an
  4388. // empty value appearing in NullFields will be sent to the server as
  4389. // null. It is an error if a field in this list has a non-empty value.
  4390. // This may be used to include null fields in Patch requests.
  4391. NullFields []string `json:"-"`
  4392. }
  4393. func (s *GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer) MarshalJSON() ([]byte, error) {
  4394. type NoMethod GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer
  4395. raw := NoMethod(*s)
  4396. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4397. }
  4398. func (s *GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer) UnmarshalJSON(data []byte) error {
  4399. type NoMethod GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer
  4400. var s1 struct {
  4401. MatchConfidence gensupport.JSONFloat64 `json:"matchConfidence"`
  4402. *NoMethod
  4403. }
  4404. s1.NoMethod = (*NoMethod)(s)
  4405. if err := json.Unmarshal(data, &s1); err != nil {
  4406. return err
  4407. }
  4408. s.MatchConfidence = float64(s1.MatchConfidence)
  4409. return nil
  4410. }
  4411. // GoogleCloudDialogflowV2beta1KnowledgeBase: Represents knowledge base
  4412. // resource.
  4413. //
  4414. // Note: resource `projects.agent.knowledgeBases` is deprecated, please
  4415. // use
  4416. // `projects.knowledgeBases` instead.
  4417. type GoogleCloudDialogflowV2beta1KnowledgeBase struct {
  4418. // DisplayName: Required. The display name of the knowledge base. The
  4419. // name must be 1024
  4420. // bytes or less; otherwise, the creation request fails.
  4421. DisplayName string `json:"displayName,omitempty"`
  4422. // Name: The knowledge base resource name.
  4423. // The name must be empty when creating a knowledge base.
  4424. // Format: `projects/<Project ID>/knowledgeBases/<Knowledge Base ID>`.
  4425. Name string `json:"name,omitempty"`
  4426. // ServerResponse contains the HTTP response code and headers from the
  4427. // server.
  4428. googleapi.ServerResponse `json:"-"`
  4429. // ForceSendFields is a list of field names (e.g. "DisplayName") to
  4430. // unconditionally include in API requests. By default, fields with
  4431. // empty values are omitted from API requests. However, any non-pointer,
  4432. // non-interface field appearing in ForceSendFields will be sent to the
  4433. // server regardless of whether the field is empty or not. This may be
  4434. // used to include empty fields in Patch requests.
  4435. ForceSendFields []string `json:"-"`
  4436. // NullFields is a list of field names (e.g. "DisplayName") to include
  4437. // in API requests with the JSON null value. By default, fields with
  4438. // empty values are omitted from API requests. However, any field with
  4439. // an empty value appearing in NullFields will be sent to the server as
  4440. // null. It is an error if a field in this list has a non-empty value.
  4441. // This may be used to include null fields in Patch requests.
  4442. NullFields []string `json:"-"`
  4443. }
  4444. func (s *GoogleCloudDialogflowV2beta1KnowledgeBase) MarshalJSON() ([]byte, error) {
  4445. type NoMethod GoogleCloudDialogflowV2beta1KnowledgeBase
  4446. raw := NoMethod(*s)
  4447. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4448. }
  4449. // GoogleCloudDialogflowV2beta1KnowledgeOperationMetadata: Metadata in
  4450. // google::longrunning::Operation for Knowledge operations.
  4451. type GoogleCloudDialogflowV2beta1KnowledgeOperationMetadata struct {
  4452. // State: Required. The current state of this operation.
  4453. //
  4454. // Possible values:
  4455. // "STATE_UNSPECIFIED" - State unspecified.
  4456. // "PENDING" - The operation has been created.
  4457. // "RUNNING" - The operation is currently running.
  4458. // "DONE" - The operation is done, either cancelled or completed.
  4459. State string `json:"state,omitempty"`
  4460. // ForceSendFields is a list of field names (e.g. "State") to
  4461. // unconditionally include in API requests. By default, fields with
  4462. // empty values are omitted from API requests. However, any non-pointer,
  4463. // non-interface field appearing in ForceSendFields will be sent to the
  4464. // server regardless of whether the field is empty or not. This may be
  4465. // used to include empty fields in Patch requests.
  4466. ForceSendFields []string `json:"-"`
  4467. // NullFields is a list of field names (e.g. "State") to include in API
  4468. // requests with the JSON null value. By default, fields with empty
  4469. // values are omitted from API requests. However, any field with an
  4470. // empty value appearing in NullFields will be sent to the server as
  4471. // null. It is an error if a field in this list has a non-empty value.
  4472. // This may be used to include null fields in Patch requests.
  4473. NullFields []string `json:"-"`
  4474. }
  4475. func (s *GoogleCloudDialogflowV2beta1KnowledgeOperationMetadata) MarshalJSON() ([]byte, error) {
  4476. type NoMethod GoogleCloudDialogflowV2beta1KnowledgeOperationMetadata
  4477. raw := NoMethod(*s)
  4478. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4479. }
  4480. // GoogleCloudDialogflowV2beta1ListContextsResponse: The response
  4481. // message for Contexts.ListContexts.
  4482. type GoogleCloudDialogflowV2beta1ListContextsResponse struct {
  4483. // Contexts: The list of contexts. There will be a maximum number of
  4484. // items
  4485. // returned based on the page_size field in the request.
  4486. Contexts []*GoogleCloudDialogflowV2beta1Context `json:"contexts,omitempty"`
  4487. // NextPageToken: Token to retrieve the next page of results, or empty
  4488. // if there are no
  4489. // more results in the list.
  4490. NextPageToken string `json:"nextPageToken,omitempty"`
  4491. // ServerResponse contains the HTTP response code and headers from the
  4492. // server.
  4493. googleapi.ServerResponse `json:"-"`
  4494. // ForceSendFields is a list of field names (e.g. "Contexts") to
  4495. // unconditionally include in API requests. By default, fields with
  4496. // empty values are omitted from API requests. However, any non-pointer,
  4497. // non-interface field appearing in ForceSendFields will be sent to the
  4498. // server regardless of whether the field is empty or not. This may be
  4499. // used to include empty fields in Patch requests.
  4500. ForceSendFields []string `json:"-"`
  4501. // NullFields is a list of field names (e.g. "Contexts") to include in
  4502. // API requests with the JSON null value. By default, fields with empty
  4503. // values are omitted from API requests. However, any field with an
  4504. // empty value appearing in NullFields will be sent to the server as
  4505. // null. It is an error if a field in this list has a non-empty value.
  4506. // This may be used to include null fields in Patch requests.
  4507. NullFields []string `json:"-"`
  4508. }
  4509. func (s *GoogleCloudDialogflowV2beta1ListContextsResponse) MarshalJSON() ([]byte, error) {
  4510. type NoMethod GoogleCloudDialogflowV2beta1ListContextsResponse
  4511. raw := NoMethod(*s)
  4512. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4513. }
  4514. // GoogleCloudDialogflowV2beta1ListDocumentsResponse: Response message
  4515. // for Documents.ListDocuments.
  4516. type GoogleCloudDialogflowV2beta1ListDocumentsResponse struct {
  4517. // Documents: The list of documents.
  4518. Documents []*GoogleCloudDialogflowV2beta1Document `json:"documents,omitempty"`
  4519. // NextPageToken: Token to retrieve the next page of results, or empty
  4520. // if there are no
  4521. // more results in the list.
  4522. NextPageToken string `json:"nextPageToken,omitempty"`
  4523. // ServerResponse contains the HTTP response code and headers from the
  4524. // server.
  4525. googleapi.ServerResponse `json:"-"`
  4526. // ForceSendFields is a list of field names (e.g. "Documents") to
  4527. // unconditionally include in API requests. By default, fields with
  4528. // empty values are omitted from API requests. However, any non-pointer,
  4529. // non-interface field appearing in ForceSendFields will be sent to the
  4530. // server regardless of whether the field is empty or not. This may be
  4531. // used to include empty fields in Patch requests.
  4532. ForceSendFields []string `json:"-"`
  4533. // NullFields is a list of field names (e.g. "Documents") to include in
  4534. // API requests with the JSON null value. By default, fields with empty
  4535. // values are omitted from API requests. However, any field with an
  4536. // empty value appearing in NullFields will be sent to the server as
  4537. // null. It is an error if a field in this list has a non-empty value.
  4538. // This may be used to include null fields in Patch requests.
  4539. NullFields []string `json:"-"`
  4540. }
  4541. func (s *GoogleCloudDialogflowV2beta1ListDocumentsResponse) MarshalJSON() ([]byte, error) {
  4542. type NoMethod GoogleCloudDialogflowV2beta1ListDocumentsResponse
  4543. raw := NoMethod(*s)
  4544. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4545. }
  4546. // GoogleCloudDialogflowV2beta1ListEntityTypesResponse: The response
  4547. // message for EntityTypes.ListEntityTypes.
  4548. type GoogleCloudDialogflowV2beta1ListEntityTypesResponse struct {
  4549. // EntityTypes: The list of agent entity types. There will be a maximum
  4550. // number of items
  4551. // returned based on the page_size field in the request.
  4552. EntityTypes []*GoogleCloudDialogflowV2beta1EntityType `json:"entityTypes,omitempty"`
  4553. // NextPageToken: Token to retrieve the next page of results, or empty
  4554. // if there are no
  4555. // more results in the list.
  4556. NextPageToken string `json:"nextPageToken,omitempty"`
  4557. // ServerResponse contains the HTTP response code and headers from the
  4558. // server.
  4559. googleapi.ServerResponse `json:"-"`
  4560. // ForceSendFields is a list of field names (e.g. "EntityTypes") to
  4561. // unconditionally include in API requests. By default, fields with
  4562. // empty values are omitted from API requests. However, any non-pointer,
  4563. // non-interface field appearing in ForceSendFields will be sent to the
  4564. // server regardless of whether the field is empty or not. This may be
  4565. // used to include empty fields in Patch requests.
  4566. ForceSendFields []string `json:"-"`
  4567. // NullFields is a list of field names (e.g. "EntityTypes") to include
  4568. // in API requests with the JSON null value. By default, fields with
  4569. // empty values are omitted from API requests. However, any field with
  4570. // an empty value appearing in NullFields will be sent to the server as
  4571. // null. It is an error if a field in this list has a non-empty value.
  4572. // This may be used to include null fields in Patch requests.
  4573. NullFields []string `json:"-"`
  4574. }
  4575. func (s *GoogleCloudDialogflowV2beta1ListEntityTypesResponse) MarshalJSON() ([]byte, error) {
  4576. type NoMethod GoogleCloudDialogflowV2beta1ListEntityTypesResponse
  4577. raw := NoMethod(*s)
  4578. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4579. }
  4580. // GoogleCloudDialogflowV2beta1ListIntentsResponse: The response message
  4581. // for Intents.ListIntents.
  4582. type GoogleCloudDialogflowV2beta1ListIntentsResponse struct {
  4583. // Intents: The list of agent intents. There will be a maximum number of
  4584. // items
  4585. // returned based on the page_size field in the request.
  4586. Intents []*GoogleCloudDialogflowV2beta1Intent `json:"intents,omitempty"`
  4587. // NextPageToken: Token to retrieve the next page of results, or empty
  4588. // if there are no
  4589. // more results in the list.
  4590. NextPageToken string `json:"nextPageToken,omitempty"`
  4591. // ServerResponse contains the HTTP response code and headers from the
  4592. // server.
  4593. googleapi.ServerResponse `json:"-"`
  4594. // ForceSendFields is a list of field names (e.g. "Intents") to
  4595. // unconditionally include in API requests. By default, fields with
  4596. // empty values are omitted from API requests. However, any non-pointer,
  4597. // non-interface field appearing in ForceSendFields will be sent to the
  4598. // server regardless of whether the field is empty or not. This may be
  4599. // used to include empty fields in Patch requests.
  4600. ForceSendFields []string `json:"-"`
  4601. // NullFields is a list of field names (e.g. "Intents") to include in
  4602. // API requests with the JSON null value. By default, fields with empty
  4603. // values are omitted from API requests. However, any field with an
  4604. // empty value appearing in NullFields will be sent to the server as
  4605. // null. It is an error if a field in this list has a non-empty value.
  4606. // This may be used to include null fields in Patch requests.
  4607. NullFields []string `json:"-"`
  4608. }
  4609. func (s *GoogleCloudDialogflowV2beta1ListIntentsResponse) MarshalJSON() ([]byte, error) {
  4610. type NoMethod GoogleCloudDialogflowV2beta1ListIntentsResponse
  4611. raw := NoMethod(*s)
  4612. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4613. }
  4614. // GoogleCloudDialogflowV2beta1ListKnowledgeBasesResponse: Response
  4615. // message for KnowledgeBases.ListKnowledgeBases.
  4616. type GoogleCloudDialogflowV2beta1ListKnowledgeBasesResponse struct {
  4617. // KnowledgeBases: The list of knowledge bases.
  4618. KnowledgeBases []*GoogleCloudDialogflowV2beta1KnowledgeBase `json:"knowledgeBases,omitempty"`
  4619. // NextPageToken: Token to retrieve the next page of results, or empty
  4620. // if there are no
  4621. // more results in the list.
  4622. NextPageToken string `json:"nextPageToken,omitempty"`
  4623. // ServerResponse contains the HTTP response code and headers from the
  4624. // server.
  4625. googleapi.ServerResponse `json:"-"`
  4626. // ForceSendFields is a list of field names (e.g. "KnowledgeBases") to
  4627. // unconditionally include in API requests. By default, fields with
  4628. // empty values are omitted from API requests. However, any non-pointer,
  4629. // non-interface field appearing in ForceSendFields will be sent to the
  4630. // server regardless of whether the field is empty or not. This may be
  4631. // used to include empty fields in Patch requests.
  4632. ForceSendFields []string `json:"-"`
  4633. // NullFields is a list of field names (e.g. "KnowledgeBases") to
  4634. // include in API requests with the JSON null value. By default, fields
  4635. // with empty values are omitted from API requests. However, any field
  4636. // with an empty value appearing in NullFields will be sent to the
  4637. // server as null. It is an error if a field in this list has a
  4638. // non-empty value. This may be used to include null fields in Patch
  4639. // requests.
  4640. NullFields []string `json:"-"`
  4641. }
  4642. func (s *GoogleCloudDialogflowV2beta1ListKnowledgeBasesResponse) MarshalJSON() ([]byte, error) {
  4643. type NoMethod GoogleCloudDialogflowV2beta1ListKnowledgeBasesResponse
  4644. raw := NoMethod(*s)
  4645. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4646. }
  4647. // GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse: The
  4648. // response message for SessionEntityTypes.ListSessionEntityTypes.
  4649. type GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse struct {
  4650. // NextPageToken: Token to retrieve the next page of results, or empty
  4651. // if there are no
  4652. // more results in the list.
  4653. NextPageToken string `json:"nextPageToken,omitempty"`
  4654. // SessionEntityTypes: The list of session entity types. There will be a
  4655. // maximum number of items
  4656. // returned based on the page_size field in the request.
  4657. SessionEntityTypes []*GoogleCloudDialogflowV2beta1SessionEntityType `json:"sessionEntityTypes,omitempty"`
  4658. // ServerResponse contains the HTTP response code and headers from the
  4659. // server.
  4660. googleapi.ServerResponse `json:"-"`
  4661. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  4662. // unconditionally include in API requests. By default, fields with
  4663. // empty values are omitted from API requests. However, any non-pointer,
  4664. // non-interface field appearing in ForceSendFields will be sent to the
  4665. // server regardless of whether the field is empty or not. This may be
  4666. // used to include empty fields in Patch requests.
  4667. ForceSendFields []string `json:"-"`
  4668. // NullFields is a list of field names (e.g. "NextPageToken") to include
  4669. // in API requests with the JSON null value. By default, fields with
  4670. // empty values are omitted from API requests. However, any field with
  4671. // an empty value appearing in NullFields will be sent to the server as
  4672. // null. It is an error if a field in this list has a non-empty value.
  4673. // This may be used to include null fields in Patch requests.
  4674. NullFields []string `json:"-"`
  4675. }
  4676. func (s *GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse) MarshalJSON() ([]byte, error) {
  4677. type NoMethod GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse
  4678. raw := NoMethod(*s)
  4679. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4680. }
  4681. // GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest: Represents
  4682. // the contents of the original request that was passed to
  4683. // the `[Streaming]DetectIntent` call.
  4684. type GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest struct {
  4685. // Payload: Optional. This field is set to the value of the
  4686. // `QueryParameters.payload`
  4687. // field passed in the request. Some integrations that query a
  4688. // Dialogflow
  4689. // agent may provide additional information in the payload.
  4690. //
  4691. // In particular for the Telephony Gateway this field has the
  4692. // form:
  4693. // <pre>{
  4694. // "telephony": {
  4695. // "caller_id": "+18558363987"
  4696. // }
  4697. // }</pre>
  4698. // Note: The caller ID field (`caller_id`) will be redacted for
  4699. // Standard
  4700. // Edition agents and populated with the caller ID in
  4701. // [E.164
  4702. // format](https://en.wikipedia.org/wiki/E.164) for Enterprise Edition
  4703. // agents.
  4704. Payload googleapi.RawMessage `json:"payload,omitempty"`
  4705. // Source: The source of this request, e.g., `google`, `facebook`,
  4706. // `slack`. It is set
  4707. // by Dialogflow-owned servers.
  4708. Source string `json:"source,omitempty"`
  4709. // Version: Optional. The version of the protocol used for this
  4710. // request.
  4711. // This field is AoG-specific.
  4712. Version string `json:"version,omitempty"`
  4713. // ForceSendFields is a list of field names (e.g. "Payload") to
  4714. // unconditionally include in API requests. By default, fields with
  4715. // empty values are omitted from API requests. However, any non-pointer,
  4716. // non-interface field appearing in ForceSendFields will be sent to the
  4717. // server regardless of whether the field is empty or not. This may be
  4718. // used to include empty fields in Patch requests.
  4719. ForceSendFields []string `json:"-"`
  4720. // NullFields is a list of field names (e.g. "Payload") to include in
  4721. // API requests with the JSON null value. By default, fields with empty
  4722. // values are omitted from API requests. However, any field with an
  4723. // empty value appearing in NullFields will be sent to the server as
  4724. // null. It is an error if a field in this list has a non-empty value.
  4725. // This may be used to include null fields in Patch requests.
  4726. NullFields []string `json:"-"`
  4727. }
  4728. func (s *GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest) MarshalJSON() ([]byte, error) {
  4729. type NoMethod GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest
  4730. raw := NoMethod(*s)
  4731. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4732. }
  4733. // GoogleCloudDialogflowV2beta1OutputAudioConfig: Instructs the speech
  4734. // synthesizer how to generate the output audio content.
  4735. type GoogleCloudDialogflowV2beta1OutputAudioConfig struct {
  4736. // AudioEncoding: Required. Audio encoding of the synthesized audio
  4737. // content.
  4738. //
  4739. // Possible values:
  4740. // "OUTPUT_AUDIO_ENCODING_UNSPECIFIED" - Not specified.
  4741. // "OUTPUT_AUDIO_ENCODING_LINEAR_16" - Uncompressed 16-bit signed
  4742. // little-endian samples (Linear PCM).
  4743. // Audio content returned as LINEAR16 also contains a WAV header.
  4744. // "OUTPUT_AUDIO_ENCODING_MP3" - MP3 audio.
  4745. // "OUTPUT_AUDIO_ENCODING_OGG_OPUS" - Opus encoded audio wrapped in an
  4746. // ogg container. The result will be a
  4747. // file which can be played natively on Android, and in browsers (at
  4748. // least
  4749. // Chrome and Firefox). The quality of the encoding is considerably
  4750. // higher
  4751. // than MP3 while using approximately the same bitrate.
  4752. AudioEncoding string `json:"audioEncoding,omitempty"`
  4753. // SampleRateHertz: Optional. The synthesis sample rate (in hertz) for
  4754. // this audio. If not
  4755. // provided, then the synthesizer will use the default sample rate based
  4756. // on
  4757. // the audio encoding. If this is different from the voice's natural
  4758. // sample
  4759. // rate, then the synthesizer will honor this request by converting to
  4760. // the
  4761. // desired sample rate (which might result in worse audio quality).
  4762. SampleRateHertz int64 `json:"sampleRateHertz,omitempty"`
  4763. // SynthesizeSpeechConfig: Optional. Configuration of how speech should
  4764. // be synthesized.
  4765. SynthesizeSpeechConfig *GoogleCloudDialogflowV2beta1SynthesizeSpeechConfig `json:"synthesizeSpeechConfig,omitempty"`
  4766. // ForceSendFields is a list of field names (e.g. "AudioEncoding") to
  4767. // unconditionally include in API requests. By default, fields with
  4768. // empty values are omitted from API requests. However, any non-pointer,
  4769. // non-interface field appearing in ForceSendFields will be sent to the
  4770. // server regardless of whether the field is empty or not. This may be
  4771. // used to include empty fields in Patch requests.
  4772. ForceSendFields []string `json:"-"`
  4773. // NullFields is a list of field names (e.g. "AudioEncoding") to include
  4774. // in API requests with the JSON null value. By default, fields with
  4775. // empty values are omitted from API requests. However, any field with
  4776. // an empty value appearing in NullFields will be sent to the server as
  4777. // null. It is an error if a field in this list has a non-empty value.
  4778. // This may be used to include null fields in Patch requests.
  4779. NullFields []string `json:"-"`
  4780. }
  4781. func (s *GoogleCloudDialogflowV2beta1OutputAudioConfig) MarshalJSON() ([]byte, error) {
  4782. type NoMethod GoogleCloudDialogflowV2beta1OutputAudioConfig
  4783. raw := NoMethod(*s)
  4784. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4785. }
  4786. // GoogleCloudDialogflowV2beta1QueryInput: Represents the query input.
  4787. // It can contain either:
  4788. //
  4789. // 1. An audio config which
  4790. // instructs the speech recognizer how to process the speech
  4791. // audio.
  4792. //
  4793. // 2. A conversational query in the form of text,.
  4794. //
  4795. // 3. An event that specifies which intent to trigger.
  4796. type GoogleCloudDialogflowV2beta1QueryInput struct {
  4797. // AudioConfig: Instructs the speech recognizer how to process the
  4798. // speech audio.
  4799. AudioConfig *GoogleCloudDialogflowV2beta1InputAudioConfig `json:"audioConfig,omitempty"`
  4800. // Event: The event to be processed.
  4801. Event *GoogleCloudDialogflowV2beta1EventInput `json:"event,omitempty"`
  4802. // Text: The natural language text to be processed.
  4803. Text *GoogleCloudDialogflowV2beta1TextInput `json:"text,omitempty"`
  4804. // ForceSendFields is a list of field names (e.g. "AudioConfig") to
  4805. // unconditionally include in API requests. By default, fields with
  4806. // empty values are omitted from API requests. However, any non-pointer,
  4807. // non-interface field appearing in ForceSendFields will be sent to the
  4808. // server regardless of whether the field is empty or not. This may be
  4809. // used to include empty fields in Patch requests.
  4810. ForceSendFields []string `json:"-"`
  4811. // NullFields is a list of field names (e.g. "AudioConfig") to include
  4812. // in API requests with the JSON null value. By default, fields with
  4813. // empty values are omitted from API requests. However, any field with
  4814. // an empty value appearing in NullFields will be sent to the server as
  4815. // null. It is an error if a field in this list has a non-empty value.
  4816. // This may be used to include null fields in Patch requests.
  4817. NullFields []string `json:"-"`
  4818. }
  4819. func (s *GoogleCloudDialogflowV2beta1QueryInput) MarshalJSON() ([]byte, error) {
  4820. type NoMethod GoogleCloudDialogflowV2beta1QueryInput
  4821. raw := NoMethod(*s)
  4822. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4823. }
  4824. // GoogleCloudDialogflowV2beta1QueryParameters: Represents the
  4825. // parameters of the conversational query.
  4826. type GoogleCloudDialogflowV2beta1QueryParameters struct {
  4827. // Contexts: Optional. The collection of contexts to be activated before
  4828. // this query is
  4829. // executed.
  4830. Contexts []*GoogleCloudDialogflowV2beta1Context `json:"contexts,omitempty"`
  4831. // GeoLocation: Optional. The geo location of this conversational query.
  4832. GeoLocation *GoogleTypeLatLng `json:"geoLocation,omitempty"`
  4833. // KnowledgeBaseNames: Optional. KnowledgeBases to get alternative
  4834. // results from. If not set, the
  4835. // KnowledgeBases enabled in the agent (through UI) will be
  4836. // used.
  4837. // Format: `projects/<Project ID>/knowledgeBases/<Knowledge Base ID>`.
  4838. KnowledgeBaseNames []string `json:"knowledgeBaseNames,omitempty"`
  4839. // Payload: Optional. This field can be used to pass custom data into
  4840. // the webhook
  4841. // associated with the agent. Arbitrary JSON objects are supported.
  4842. Payload googleapi.RawMessage `json:"payload,omitempty"`
  4843. // ResetContexts: Optional. Specifies whether to delete all contexts in
  4844. // the current session
  4845. // before the new ones are activated.
  4846. ResetContexts bool `json:"resetContexts,omitempty"`
  4847. // SentimentAnalysisRequestConfig: Optional. Configures the type of
  4848. // sentiment analysis to perform. If not
  4849. // provided, sentiment analysis is not performed.
  4850. // Note: Sentiment Analysis is only currently available for Enterprise
  4851. // Edition
  4852. // agents.
  4853. SentimentAnalysisRequestConfig *GoogleCloudDialogflowV2beta1SentimentAnalysisRequestConfig `json:"sentimentAnalysisRequestConfig,omitempty"`
  4854. // SessionEntityTypes: Optional. Additional session entity types to
  4855. // replace or extend developer
  4856. // entity types with. The entity synonyms apply to all languages and
  4857. // persist
  4858. // for the session of this query.
  4859. SessionEntityTypes []*GoogleCloudDialogflowV2beta1SessionEntityType `json:"sessionEntityTypes,omitempty"`
  4860. // TimeZone: Optional. The time zone of this conversational query from
  4861. // the
  4862. // [time zone database](https://www.iana.org/time-zones),
  4863. // e.g.,
  4864. // America/New_York, Europe/Paris. If not provided, the time zone
  4865. // specified in
  4866. // agent settings is used.
  4867. TimeZone string `json:"timeZone,omitempty"`
  4868. // ForceSendFields is a list of field names (e.g. "Contexts") to
  4869. // unconditionally include in API requests. By default, fields with
  4870. // empty values are omitted from API requests. However, any non-pointer,
  4871. // non-interface field appearing in ForceSendFields will be sent to the
  4872. // server regardless of whether the field is empty or not. This may be
  4873. // used to include empty fields in Patch requests.
  4874. ForceSendFields []string `json:"-"`
  4875. // NullFields is a list of field names (e.g. "Contexts") to include in
  4876. // API requests with the JSON null value. By default, fields with empty
  4877. // values are omitted from API requests. However, any field with an
  4878. // empty value appearing in NullFields will be sent to the server as
  4879. // null. It is an error if a field in this list has a non-empty value.
  4880. // This may be used to include null fields in Patch requests.
  4881. NullFields []string `json:"-"`
  4882. }
  4883. func (s *GoogleCloudDialogflowV2beta1QueryParameters) MarshalJSON() ([]byte, error) {
  4884. type NoMethod GoogleCloudDialogflowV2beta1QueryParameters
  4885. raw := NoMethod(*s)
  4886. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4887. }
  4888. // GoogleCloudDialogflowV2beta1QueryResult: Represents the result of
  4889. // conversational query or event processing.
  4890. type GoogleCloudDialogflowV2beta1QueryResult struct {
  4891. // Action: The action name from the matched intent.
  4892. Action string `json:"action,omitempty"`
  4893. // AllRequiredParamsPresent: This field is set to:
  4894. // - `false` if the matched intent has required parameters and not all
  4895. // of
  4896. // the required parameter values have been collected.
  4897. // - `true` if all required parameter values have been collected, or if
  4898. // the
  4899. // matched intent doesn't contain any required parameters.
  4900. AllRequiredParamsPresent bool `json:"allRequiredParamsPresent,omitempty"`
  4901. // DiagnosticInfo: The free-form diagnostic info. For example, this
  4902. // field could contain
  4903. // webhook call latency. The string keys of the Struct's fields map can
  4904. // change
  4905. // without notice.
  4906. DiagnosticInfo googleapi.RawMessage `json:"diagnosticInfo,omitempty"`
  4907. // FulfillmentMessages: The collection of rich messages to present to
  4908. // the user.
  4909. FulfillmentMessages []*GoogleCloudDialogflowV2beta1IntentMessage `json:"fulfillmentMessages,omitempty"`
  4910. // FulfillmentText: The text to be pronounced to the user or shown on
  4911. // the screen.
  4912. // Note: This is a legacy field, `fulfillment_messages` should be
  4913. // preferred.
  4914. FulfillmentText string `json:"fulfillmentText,omitempty"`
  4915. // Intent: The intent that matched the conversational query. Some,
  4916. // not
  4917. // all fields are filled in this message, including but not limited
  4918. // to:
  4919. // `name`, `display_name` and `webhook_state`.
  4920. Intent *GoogleCloudDialogflowV2beta1Intent `json:"intent,omitempty"`
  4921. // IntentDetectionConfidence: The intent detection confidence. Values
  4922. // range from 0.0
  4923. // (completely uncertain) to 1.0 (completely certain).
  4924. // If there are `multiple knowledge_answers` messages, this value is set
  4925. // to
  4926. // the greatest `knowledgeAnswers.match_confidence` value in the list.
  4927. IntentDetectionConfidence float64 `json:"intentDetectionConfidence,omitempty"`
  4928. // KnowledgeAnswers: The result from Knowledge Connector (if any),
  4929. // ordered by decreasing
  4930. // `KnowledgeAnswers.match_confidence`.
  4931. KnowledgeAnswers *GoogleCloudDialogflowV2beta1KnowledgeAnswers `json:"knowledgeAnswers,omitempty"`
  4932. // LanguageCode: The language that was triggered during intent
  4933. // detection.
  4934. // See [Language
  4935. // Support](https://dialogflow.com/docs/reference/language)
  4936. // for a list of the currently supported language codes.
  4937. LanguageCode string `json:"languageCode,omitempty"`
  4938. // OutputContexts: The collection of output contexts. If
  4939. // applicable,
  4940. // `output_contexts.parameters` contains entries with name
  4941. // `<parameter name>.original` containing the original parameter
  4942. // values
  4943. // before the query.
  4944. OutputContexts []*GoogleCloudDialogflowV2beta1Context `json:"outputContexts,omitempty"`
  4945. // Parameters: The collection of extracted parameters.
  4946. Parameters googleapi.RawMessage `json:"parameters,omitempty"`
  4947. // QueryText: The original conversational query text:
  4948. // - If natural language text was provided as input, `query_text`
  4949. // contains
  4950. // a copy of the input.
  4951. // - If natural language speech audio was provided as input,
  4952. // `query_text`
  4953. // contains the speech recognition result. If speech recognizer
  4954. // produced
  4955. // multiple alternatives, a particular one is picked.
  4956. // - If an event was provided as input, `query_text` is not set.
  4957. QueryText string `json:"queryText,omitempty"`
  4958. // SentimentAnalysisResult: The sentiment analysis result, which depends
  4959. // on the
  4960. // `sentiment_analysis_request_config` specified in the request.
  4961. SentimentAnalysisResult *GoogleCloudDialogflowV2beta1SentimentAnalysisResult `json:"sentimentAnalysisResult,omitempty"`
  4962. // SpeechRecognitionConfidence: The Speech recognition confidence
  4963. // between 0.0 and 1.0. A higher number
  4964. // indicates an estimated greater likelihood that the recognized words
  4965. // are
  4966. // correct. The default of 0.0 is a sentinel value indicating that
  4967. // confidence
  4968. // was not set.
  4969. //
  4970. // This field is not guaranteed to be accurate or set. In particular
  4971. // this
  4972. // field isn't set for StreamingDetectIntent since the streaming
  4973. // endpoint has
  4974. // separate confidence estimates per portion of the audio
  4975. // in
  4976. // StreamingRecognitionResult.
  4977. SpeechRecognitionConfidence float64 `json:"speechRecognitionConfidence,omitempty"`
  4978. // WebhookPayload: If the query was fulfilled by a webhook call, this
  4979. // field is set to the
  4980. // value of the `payload` field returned in the webhook response.
  4981. WebhookPayload googleapi.RawMessage `json:"webhookPayload,omitempty"`
  4982. // WebhookSource: If the query was fulfilled by a webhook call, this
  4983. // field is set to the
  4984. // value of the `source` field returned in the webhook response.
  4985. WebhookSource string `json:"webhookSource,omitempty"`
  4986. // ForceSendFields is a list of field names (e.g. "Action") to
  4987. // unconditionally include in API requests. By default, fields with
  4988. // empty values are omitted from API requests. However, any non-pointer,
  4989. // non-interface field appearing in ForceSendFields will be sent to the
  4990. // server regardless of whether the field is empty or not. This may be
  4991. // used to include empty fields in Patch requests.
  4992. ForceSendFields []string `json:"-"`
  4993. // NullFields is a list of field names (e.g. "Action") to include in API
  4994. // requests with the JSON null value. By default, fields with empty
  4995. // values are omitted from API requests. However, any field with an
  4996. // empty value appearing in NullFields will be sent to the server as
  4997. // null. It is an error if a field in this list has a non-empty value.
  4998. // This may be used to include null fields in Patch requests.
  4999. NullFields []string `json:"-"`
  5000. }
  5001. func (s *GoogleCloudDialogflowV2beta1QueryResult) MarshalJSON() ([]byte, error) {
  5002. type NoMethod GoogleCloudDialogflowV2beta1QueryResult
  5003. raw := NoMethod(*s)
  5004. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5005. }
  5006. func (s *GoogleCloudDialogflowV2beta1QueryResult) UnmarshalJSON(data []byte) error {
  5007. type NoMethod GoogleCloudDialogflowV2beta1QueryResult
  5008. var s1 struct {
  5009. IntentDetectionConfidence gensupport.JSONFloat64 `json:"intentDetectionConfidence"`
  5010. SpeechRecognitionConfidence gensupport.JSONFloat64 `json:"speechRecognitionConfidence"`
  5011. *NoMethod
  5012. }
  5013. s1.NoMethod = (*NoMethod)(s)
  5014. if err := json.Unmarshal(data, &s1); err != nil {
  5015. return err
  5016. }
  5017. s.IntentDetectionConfidence = float64(s1.IntentDetectionConfidence)
  5018. s.SpeechRecognitionConfidence = float64(s1.SpeechRecognitionConfidence)
  5019. return nil
  5020. }
  5021. // GoogleCloudDialogflowV2beta1ReloadDocumentRequest: Request message
  5022. // for Documents.ReloadDocument.
  5023. type GoogleCloudDialogflowV2beta1ReloadDocumentRequest struct {
  5024. }
  5025. // GoogleCloudDialogflowV2beta1RestoreAgentRequest: The request message
  5026. // for Agents.RestoreAgent.
  5027. type GoogleCloudDialogflowV2beta1RestoreAgentRequest struct {
  5028. // AgentContent: The agent to restore.
  5029. //
  5030. // Example for how to restore an agent via the command line:
  5031. // <pre>curl \
  5032. //
  5033. // 'https://dialogflow.googleapis.com/v2beta1/projects/&lt;project_name&g
  5034. // t;/agent:restore\
  5035. // -X POST \
  5036. // -H 'Authorization: Bearer '$(gcloud auth application-default
  5037. // print-access-token) \
  5038. // -H 'Accept: application/json' \
  5039. // -H 'Content-Type: application/json' \
  5040. // --compressed \
  5041. // --data-binary "{
  5042. // 'agentContent': '$(cat &lt;agent zip file&gt; | base64 -w 0)'
  5043. // }"</pre>
  5044. AgentContent string `json:"agentContent,omitempty"`
  5045. // AgentUri: The URI to a Google Cloud Storage file containing the agent
  5046. // to restore.
  5047. // Note: The URI must start with "gs://".
  5048. AgentUri string `json:"agentUri,omitempty"`
  5049. // ForceSendFields is a list of field names (e.g. "AgentContent") to
  5050. // unconditionally include in API requests. By default, fields with
  5051. // empty values are omitted from API requests. However, any non-pointer,
  5052. // non-interface field appearing in ForceSendFields will be sent to the
  5053. // server regardless of whether the field is empty or not. This may be
  5054. // used to include empty fields in Patch requests.
  5055. ForceSendFields []string `json:"-"`
  5056. // NullFields is a list of field names (e.g. "AgentContent") to include
  5057. // in API requests with the JSON null value. By default, fields with
  5058. // empty values are omitted from API requests. However, any field with
  5059. // an empty value appearing in NullFields will be sent to the server as
  5060. // null. It is an error if a field in this list has a non-empty value.
  5061. // This may be used to include null fields in Patch requests.
  5062. NullFields []string `json:"-"`
  5063. }
  5064. func (s *GoogleCloudDialogflowV2beta1RestoreAgentRequest) MarshalJSON() ([]byte, error) {
  5065. type NoMethod GoogleCloudDialogflowV2beta1RestoreAgentRequest
  5066. raw := NoMethod(*s)
  5067. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5068. }
  5069. // GoogleCloudDialogflowV2beta1SearchAgentsResponse: The response
  5070. // message for Agents.SearchAgents.
  5071. type GoogleCloudDialogflowV2beta1SearchAgentsResponse struct {
  5072. // Agents: The list of agents. There will be a maximum number of items
  5073. // returned based
  5074. // on the page_size field in the request.
  5075. Agents []*GoogleCloudDialogflowV2beta1Agent `json:"agents,omitempty"`
  5076. // NextPageToken: Token to retrieve the next page of results, or empty
  5077. // if there are no
  5078. // more results in the list.
  5079. NextPageToken string `json:"nextPageToken,omitempty"`
  5080. // ServerResponse contains the HTTP response code and headers from the
  5081. // server.
  5082. googleapi.ServerResponse `json:"-"`
  5083. // ForceSendFields is a list of field names (e.g. "Agents") to
  5084. // unconditionally include in API requests. By default, fields with
  5085. // empty values are omitted from API requests. However, any non-pointer,
  5086. // non-interface field appearing in ForceSendFields will be sent to the
  5087. // server regardless of whether the field is empty or not. This may be
  5088. // used to include empty fields in Patch requests.
  5089. ForceSendFields []string `json:"-"`
  5090. // NullFields is a list of field names (e.g. "Agents") to include in API
  5091. // requests with the JSON null value. By default, fields with empty
  5092. // values are omitted from API requests. However, any field with an
  5093. // empty value appearing in NullFields will be sent to the server as
  5094. // null. It is an error if a field in this list has a non-empty value.
  5095. // This may be used to include null fields in Patch requests.
  5096. NullFields []string `json:"-"`
  5097. }
  5098. func (s *GoogleCloudDialogflowV2beta1SearchAgentsResponse) MarshalJSON() ([]byte, error) {
  5099. type NoMethod GoogleCloudDialogflowV2beta1SearchAgentsResponse
  5100. raw := NoMethod(*s)
  5101. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5102. }
  5103. // GoogleCloudDialogflowV2beta1Sentiment: The sentiment, such as
  5104. // positive/negative feeling or association, for a unit
  5105. // of analysis, such as the query text.
  5106. type GoogleCloudDialogflowV2beta1Sentiment struct {
  5107. // Magnitude: A non-negative number in the [0, +inf) range, which
  5108. // represents the absolute
  5109. // magnitude of sentiment, regardless of score (positive or negative).
  5110. Magnitude float64 `json:"magnitude,omitempty"`
  5111. // Score: Sentiment score between -1.0 (negative sentiment) and 1.0
  5112. // (positive
  5113. // sentiment).
  5114. Score float64 `json:"score,omitempty"`
  5115. // ForceSendFields is a list of field names (e.g. "Magnitude") to
  5116. // unconditionally include in API requests. By default, fields with
  5117. // empty values are omitted from API requests. However, any non-pointer,
  5118. // non-interface field appearing in ForceSendFields will be sent to the
  5119. // server regardless of whether the field is empty or not. This may be
  5120. // used to include empty fields in Patch requests.
  5121. ForceSendFields []string `json:"-"`
  5122. // NullFields is a list of field names (e.g. "Magnitude") to include in
  5123. // API requests with the JSON null value. By default, fields with empty
  5124. // values are omitted from API requests. However, any field with an
  5125. // empty value appearing in NullFields will be sent to the server as
  5126. // null. It is an error if a field in this list has a non-empty value.
  5127. // This may be used to include null fields in Patch requests.
  5128. NullFields []string `json:"-"`
  5129. }
  5130. func (s *GoogleCloudDialogflowV2beta1Sentiment) MarshalJSON() ([]byte, error) {
  5131. type NoMethod GoogleCloudDialogflowV2beta1Sentiment
  5132. raw := NoMethod(*s)
  5133. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5134. }
  5135. func (s *GoogleCloudDialogflowV2beta1Sentiment) UnmarshalJSON(data []byte) error {
  5136. type NoMethod GoogleCloudDialogflowV2beta1Sentiment
  5137. var s1 struct {
  5138. Magnitude gensupport.JSONFloat64 `json:"magnitude"`
  5139. Score gensupport.JSONFloat64 `json:"score"`
  5140. *NoMethod
  5141. }
  5142. s1.NoMethod = (*NoMethod)(s)
  5143. if err := json.Unmarshal(data, &s1); err != nil {
  5144. return err
  5145. }
  5146. s.Magnitude = float64(s1.Magnitude)
  5147. s.Score = float64(s1.Score)
  5148. return nil
  5149. }
  5150. // GoogleCloudDialogflowV2beta1SentimentAnalysisRequestConfig:
  5151. // Configures the types of sentiment analysis to perform.
  5152. type GoogleCloudDialogflowV2beta1SentimentAnalysisRequestConfig struct {
  5153. // AnalyzeQueryTextSentiment: Optional. Instructs the service to perform
  5154. // sentiment analysis on
  5155. // `query_text`. If not provided, sentiment analysis is not performed
  5156. // on
  5157. // `query_text`.
  5158. AnalyzeQueryTextSentiment bool `json:"analyzeQueryTextSentiment,omitempty"`
  5159. // ForceSendFields is a list of field names (e.g.
  5160. // "AnalyzeQueryTextSentiment") to unconditionally include in API
  5161. // requests. By default, fields with empty values are omitted from API
  5162. // requests. However, any non-pointer, non-interface field appearing in
  5163. // ForceSendFields will be sent to the server regardless of whether the
  5164. // field is empty or not. This may be used to include empty fields in
  5165. // Patch requests.
  5166. ForceSendFields []string `json:"-"`
  5167. // NullFields is a list of field names (e.g.
  5168. // "AnalyzeQueryTextSentiment") to include in API requests with the JSON
  5169. // null value. By default, fields with empty values are omitted from API
  5170. // requests. However, any field with an empty value appearing in
  5171. // NullFields will be sent to the server as null. It is an error if a
  5172. // field in this list has a non-empty value. This may be used to include
  5173. // null fields in Patch requests.
  5174. NullFields []string `json:"-"`
  5175. }
  5176. func (s *GoogleCloudDialogflowV2beta1SentimentAnalysisRequestConfig) MarshalJSON() ([]byte, error) {
  5177. type NoMethod GoogleCloudDialogflowV2beta1SentimentAnalysisRequestConfig
  5178. raw := NoMethod(*s)
  5179. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5180. }
  5181. // GoogleCloudDialogflowV2beta1SentimentAnalysisResult: The result of
  5182. // sentiment analysis as configured
  5183. // by
  5184. // `sentiment_analysis_request_config`.
  5185. type GoogleCloudDialogflowV2beta1SentimentAnalysisResult struct {
  5186. // QueryTextSentiment: The sentiment analysis result for `query_text`.
  5187. QueryTextSentiment *GoogleCloudDialogflowV2beta1Sentiment `json:"queryTextSentiment,omitempty"`
  5188. // ForceSendFields is a list of field names (e.g. "QueryTextSentiment")
  5189. // to unconditionally include in API requests. By default, fields with
  5190. // empty values are omitted from API requests. However, any non-pointer,
  5191. // non-interface field appearing in ForceSendFields will be sent to the
  5192. // server regardless of whether the field is empty or not. This may be
  5193. // used to include empty fields in Patch requests.
  5194. ForceSendFields []string `json:"-"`
  5195. // NullFields is a list of field names (e.g. "QueryTextSentiment") to
  5196. // include in API requests with the JSON null value. By default, fields
  5197. // with empty values are omitted from API requests. However, any field
  5198. // with an empty value appearing in NullFields will be sent to the
  5199. // server as null. It is an error if a field in this list has a
  5200. // non-empty value. This may be used to include null fields in Patch
  5201. // requests.
  5202. NullFields []string `json:"-"`
  5203. }
  5204. func (s *GoogleCloudDialogflowV2beta1SentimentAnalysisResult) MarshalJSON() ([]byte, error) {
  5205. type NoMethod GoogleCloudDialogflowV2beta1SentimentAnalysisResult
  5206. raw := NoMethod(*s)
  5207. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5208. }
  5209. // GoogleCloudDialogflowV2beta1SessionEntityType: Represents a session
  5210. // entity type.
  5211. //
  5212. // Extends or replaces a developer entity type at the user session level
  5213. // (we
  5214. // refer to the entity types defined at the agent level as "developer
  5215. // entity
  5216. // types").
  5217. //
  5218. // Note: session entity types apply to all queries, regardless of the
  5219. // language.
  5220. type GoogleCloudDialogflowV2beta1SessionEntityType struct {
  5221. // Entities: Required. The collection of entities associated with this
  5222. // session entity
  5223. // type.
  5224. Entities []*GoogleCloudDialogflowV2beta1EntityTypeEntity `json:"entities,omitempty"`
  5225. // EntityOverrideMode: Required. Indicates whether the additional data
  5226. // should override or
  5227. // supplement the developer entity type definition.
  5228. //
  5229. // Possible values:
  5230. // "ENTITY_OVERRIDE_MODE_UNSPECIFIED" - Not specified. This value
  5231. // should be never used.
  5232. // "ENTITY_OVERRIDE_MODE_OVERRIDE" - The collection of session
  5233. // entities overrides the collection of entities
  5234. // in the corresponding developer entity type.
  5235. // "ENTITY_OVERRIDE_MODE_SUPPLEMENT" - The collection of session
  5236. // entities extends the collection of entities in
  5237. // the corresponding developer entity type.
  5238. //
  5239. // Note: Even in this override mode calls to
  5240. // `ListSessionEntityTypes`,
  5241. // `GetSessionEntityType`, `CreateSessionEntityType`
  5242. // and
  5243. // `UpdateSessionEntityType` only return the additional entities added
  5244. // in
  5245. // this session entity type. If you want to get the supplemented
  5246. // list,
  5247. // please call EntityTypes.GetEntityType on the developer entity
  5248. // type
  5249. // and merge.
  5250. EntityOverrideMode string `json:"entityOverrideMode,omitempty"`
  5251. // Name: Required. The unique identifier of this session entity type.
  5252. // Format:
  5253. // `projects/<Project ID>/agent/sessions/<Session
  5254. // ID>/entityTypes/<Entity Type
  5255. // Display Name>`, or
  5256. // `projects/<Project ID>/agent/environments/<Environment
  5257. // ID>/users/<User
  5258. // ID>/sessions/<Session ID>/entityTypes/<Entity Type Display Name>`.
  5259. // If `Environment ID` is not specified, we assume default
  5260. // 'draft'
  5261. // environment. If `User ID` is not specified, we assume default '-'
  5262. // user.
  5263. //
  5264. // `<Entity Type Display Name>` must be the display name of an existing
  5265. // entity
  5266. // type in the same agent that will be overridden or supplemented.
  5267. Name string `json:"name,omitempty"`
  5268. // ServerResponse contains the HTTP response code and headers from the
  5269. // server.
  5270. googleapi.ServerResponse `json:"-"`
  5271. // ForceSendFields is a list of field names (e.g. "Entities") to
  5272. // unconditionally include in API requests. By default, fields with
  5273. // empty values are omitted from API requests. However, any non-pointer,
  5274. // non-interface field appearing in ForceSendFields will be sent to the
  5275. // server regardless of whether the field is empty or not. This may be
  5276. // used to include empty fields in Patch requests.
  5277. ForceSendFields []string `json:"-"`
  5278. // NullFields is a list of field names (e.g. "Entities") to include in
  5279. // API requests with the JSON null value. By default, fields with empty
  5280. // values are omitted from API requests. However, any field with an
  5281. // empty value appearing in NullFields will be sent to the server as
  5282. // null. It is an error if a field in this list has a non-empty value.
  5283. // This may be used to include null fields in Patch requests.
  5284. NullFields []string `json:"-"`
  5285. }
  5286. func (s *GoogleCloudDialogflowV2beta1SessionEntityType) MarshalJSON() ([]byte, error) {
  5287. type NoMethod GoogleCloudDialogflowV2beta1SessionEntityType
  5288. raw := NoMethod(*s)
  5289. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5290. }
  5291. // GoogleCloudDialogflowV2beta1SynthesizeSpeechConfig: Configuration of
  5292. // how speech should be synthesized.
  5293. type GoogleCloudDialogflowV2beta1SynthesizeSpeechConfig struct {
  5294. // EffectsProfileId: Optional. An identifier which selects 'audio
  5295. // effects' profiles that are
  5296. // applied on (post synthesized) text to speech. Effects are applied on
  5297. // top of
  5298. // each other in the order they are given.
  5299. EffectsProfileId []string `json:"effectsProfileId,omitempty"`
  5300. // Pitch: Optional. Speaking pitch, in the range [-20.0, 20.0]. 20 means
  5301. // increase 20
  5302. // semitones from the original pitch. -20 means decrease 20 semitones
  5303. // from the
  5304. // original pitch.
  5305. Pitch float64 `json:"pitch,omitempty"`
  5306. // SpeakingRate: Optional. Speaking rate/speed, in the range [0.25,
  5307. // 4.0]. 1.0 is the normal
  5308. // native speed supported by the specific voice. 2.0 is twice as fast,
  5309. // and
  5310. // 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 speed.
  5311. // Any
  5312. // other values < 0.25 or > 4.0 will return an error.
  5313. SpeakingRate float64 `json:"speakingRate,omitempty"`
  5314. // Voice: Optional. The desired voice of the synthesized audio.
  5315. Voice *GoogleCloudDialogflowV2beta1VoiceSelectionParams `json:"voice,omitempty"`
  5316. // VolumeGainDb: Optional. Volume gain (in dB) of the normal native
  5317. // volume supported by the
  5318. // specific voice, in the range [-96.0, 16.0]. If unset, or set to a
  5319. // value of
  5320. // 0.0 (dB), will play at normal native signal amplitude. A value of
  5321. // -6.0 (dB)
  5322. // will play at approximately half the amplitude of the normal native
  5323. // signal
  5324. // amplitude. A value of +6.0 (dB) will play at approximately twice
  5325. // the
  5326. // amplitude of the normal native signal amplitude. We strongly
  5327. // recommend not
  5328. // to exceed +10 (dB) as there's usually no effective increase in
  5329. // loudness for
  5330. // any value greater than that.
  5331. VolumeGainDb float64 `json:"volumeGainDb,omitempty"`
  5332. // ForceSendFields is a list of field names (e.g. "EffectsProfileId") to
  5333. // unconditionally include in API requests. By default, fields with
  5334. // empty values are omitted from API requests. However, any non-pointer,
  5335. // non-interface field appearing in ForceSendFields will be sent to the
  5336. // server regardless of whether the field is empty or not. This may be
  5337. // used to include empty fields in Patch requests.
  5338. ForceSendFields []string `json:"-"`
  5339. // NullFields is a list of field names (e.g. "EffectsProfileId") to
  5340. // include in API requests with the JSON null value. By default, fields
  5341. // with empty values are omitted from API requests. However, any field
  5342. // with an empty value appearing in NullFields will be sent to the
  5343. // server as null. It is an error if a field in this list has a
  5344. // non-empty value. This may be used to include null fields in Patch
  5345. // requests.
  5346. NullFields []string `json:"-"`
  5347. }
  5348. func (s *GoogleCloudDialogflowV2beta1SynthesizeSpeechConfig) MarshalJSON() ([]byte, error) {
  5349. type NoMethod GoogleCloudDialogflowV2beta1SynthesizeSpeechConfig
  5350. raw := NoMethod(*s)
  5351. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5352. }
  5353. func (s *GoogleCloudDialogflowV2beta1SynthesizeSpeechConfig) UnmarshalJSON(data []byte) error {
  5354. type NoMethod GoogleCloudDialogflowV2beta1SynthesizeSpeechConfig
  5355. var s1 struct {
  5356. Pitch gensupport.JSONFloat64 `json:"pitch"`
  5357. SpeakingRate gensupport.JSONFloat64 `json:"speakingRate"`
  5358. VolumeGainDb gensupport.JSONFloat64 `json:"volumeGainDb"`
  5359. *NoMethod
  5360. }
  5361. s1.NoMethod = (*NoMethod)(s)
  5362. if err := json.Unmarshal(data, &s1); err != nil {
  5363. return err
  5364. }
  5365. s.Pitch = float64(s1.Pitch)
  5366. s.SpeakingRate = float64(s1.SpeakingRate)
  5367. s.VolumeGainDb = float64(s1.VolumeGainDb)
  5368. return nil
  5369. }
  5370. // GoogleCloudDialogflowV2beta1TextInput: Represents the natural
  5371. // language text to be processed.
  5372. type GoogleCloudDialogflowV2beta1TextInput struct {
  5373. // LanguageCode: Required. The language of this conversational query.
  5374. // See [Language
  5375. // Support](https://dialogflow.com/docs/languages) for a list of
  5376. // the
  5377. // currently supported language codes. Note that queries in the same
  5378. // session
  5379. // do not necessarily need to specify the same language.
  5380. LanguageCode string `json:"languageCode,omitempty"`
  5381. // Text: Required. The UTF-8 encoded natural language text to be
  5382. // processed.
  5383. // Text length must not exceed 256 characters.
  5384. Text string `json:"text,omitempty"`
  5385. // ForceSendFields is a list of field names (e.g. "LanguageCode") to
  5386. // unconditionally include in API requests. By default, fields with
  5387. // empty values are omitted from API requests. However, any non-pointer,
  5388. // non-interface field appearing in ForceSendFields will be sent to the
  5389. // server regardless of whether the field is empty or not. This may be
  5390. // used to include empty fields in Patch requests.
  5391. ForceSendFields []string `json:"-"`
  5392. // NullFields is a list of field names (e.g. "LanguageCode") to include
  5393. // in API requests with the JSON null value. By default, fields with
  5394. // empty values are omitted from API requests. However, any field with
  5395. // an empty value appearing in NullFields will be sent to the server as
  5396. // null. It is an error if a field in this list has a non-empty value.
  5397. // This may be used to include null fields in Patch requests.
  5398. NullFields []string `json:"-"`
  5399. }
  5400. func (s *GoogleCloudDialogflowV2beta1TextInput) MarshalJSON() ([]byte, error) {
  5401. type NoMethod GoogleCloudDialogflowV2beta1TextInput
  5402. raw := NoMethod(*s)
  5403. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5404. }
  5405. // GoogleCloudDialogflowV2beta1TrainAgentRequest: The request message
  5406. // for Agents.TrainAgent.
  5407. type GoogleCloudDialogflowV2beta1TrainAgentRequest struct {
  5408. }
  5409. // GoogleCloudDialogflowV2beta1VoiceSelectionParams: Description of
  5410. // which voice to use for speech synthesis.
  5411. type GoogleCloudDialogflowV2beta1VoiceSelectionParams struct {
  5412. // Name: Optional. The name of the voice. If not set, the service will
  5413. // choose a
  5414. // voice based on the other parameters such as language_code and gender.
  5415. Name string `json:"name,omitempty"`
  5416. // SsmlGender: Optional. The preferred gender of the voice. If not set,
  5417. // the service will
  5418. // choose a voice based on the other parameters such as language_code
  5419. // and
  5420. // name. Note that this is only a preference, not requirement. If
  5421. // a
  5422. // voice of the appropriate gender is not available, the synthesizer
  5423. // should
  5424. // substitute a voice with a different gender rather than failing the
  5425. // request.
  5426. //
  5427. // Possible values:
  5428. // "SSML_VOICE_GENDER_UNSPECIFIED" - An unspecified gender, which
  5429. // means that the client doesn't care which
  5430. // gender the selected voice will have.
  5431. // "SSML_VOICE_GENDER_MALE" - A male voice.
  5432. // "SSML_VOICE_GENDER_FEMALE" - A female voice.
  5433. // "SSML_VOICE_GENDER_NEUTRAL" - A gender-neutral voice.
  5434. SsmlGender string `json:"ssmlGender,omitempty"`
  5435. // ForceSendFields is a list of field names (e.g. "Name") to
  5436. // unconditionally include in API requests. By default, fields with
  5437. // empty values are omitted from API requests. However, any non-pointer,
  5438. // non-interface field appearing in ForceSendFields will be sent to the
  5439. // server regardless of whether the field is empty or not. This may be
  5440. // used to include empty fields in Patch requests.
  5441. ForceSendFields []string `json:"-"`
  5442. // NullFields is a list of field names (e.g. "Name") to include in API
  5443. // requests with the JSON null value. By default, fields with empty
  5444. // values are omitted from API requests. However, any field with an
  5445. // empty value appearing in NullFields will be sent to the server as
  5446. // null. It is an error if a field in this list has a non-empty value.
  5447. // This may be used to include null fields in Patch requests.
  5448. NullFields []string `json:"-"`
  5449. }
  5450. func (s *GoogleCloudDialogflowV2beta1VoiceSelectionParams) MarshalJSON() ([]byte, error) {
  5451. type NoMethod GoogleCloudDialogflowV2beta1VoiceSelectionParams
  5452. raw := NoMethod(*s)
  5453. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5454. }
  5455. // GoogleCloudDialogflowV2beta1WebhookRequest: The request message for a
  5456. // webhook call.
  5457. type GoogleCloudDialogflowV2beta1WebhookRequest struct {
  5458. // AlternativeQueryResults: Alternative query results from
  5459. // KnowledgeService.
  5460. AlternativeQueryResults []*GoogleCloudDialogflowV2beta1QueryResult `json:"alternativeQueryResults,omitempty"`
  5461. // OriginalDetectIntentRequest: Optional. The contents of the original
  5462. // request that was passed to
  5463. // `[Streaming]DetectIntent` call.
  5464. OriginalDetectIntentRequest *GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest `json:"originalDetectIntentRequest,omitempty"`
  5465. // QueryResult: The result of the conversational query or event
  5466. // processing. Contains the
  5467. // same value as `[Streaming]DetectIntentResponse.query_result`.
  5468. QueryResult *GoogleCloudDialogflowV2beta1QueryResult `json:"queryResult,omitempty"`
  5469. // ResponseId: The unique identifier of the response. Contains the same
  5470. // value as
  5471. // `[Streaming]DetectIntentResponse.response_id`.
  5472. ResponseId string `json:"responseId,omitempty"`
  5473. // Session: The unique identifier of detectIntent request session.
  5474. // Can be used to identify end-user inside webhook
  5475. // implementation.
  5476. // Format: `projects/<Project ID>/agent/sessions/<Session ID>`,
  5477. // or
  5478. // `projects/<Project ID>/agent/environments/<Environment
  5479. // ID>/users/<User
  5480. // ID>/sessions/<Session ID>`.
  5481. Session string `json:"session,omitempty"`
  5482. // ForceSendFields is a list of field names (e.g.
  5483. // "AlternativeQueryResults") to unconditionally include in API
  5484. // requests. By default, fields with empty values are omitted from API
  5485. // requests. However, any non-pointer, non-interface field appearing in
  5486. // ForceSendFields will be sent to the server regardless of whether the
  5487. // field is empty or not. This may be used to include empty fields in
  5488. // Patch requests.
  5489. ForceSendFields []string `json:"-"`
  5490. // NullFields is a list of field names (e.g. "AlternativeQueryResults")
  5491. // to include in API requests with the JSON null value. By default,
  5492. // fields with empty values are omitted from API requests. However, any
  5493. // field with an empty value appearing in NullFields will be sent to the
  5494. // server as null. It is an error if a field in this list has a
  5495. // non-empty value. This may be used to include null fields in Patch
  5496. // requests.
  5497. NullFields []string `json:"-"`
  5498. }
  5499. func (s *GoogleCloudDialogflowV2beta1WebhookRequest) MarshalJSON() ([]byte, error) {
  5500. type NoMethod GoogleCloudDialogflowV2beta1WebhookRequest
  5501. raw := NoMethod(*s)
  5502. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5503. }
  5504. // GoogleCloudDialogflowV2beta1WebhookResponse: The response message for
  5505. // a webhook call.
  5506. type GoogleCloudDialogflowV2beta1WebhookResponse struct {
  5507. // EndInteraction: Optional. Indicates that this intent ends an
  5508. // interaction. Some integrations
  5509. // (e.g., Actions on Google or Dialogflow phone gateway) use this
  5510. // information
  5511. // to close interaction with an end user. Default is false.
  5512. EndInteraction bool `json:"endInteraction,omitempty"`
  5513. // FollowupEventInput: Optional. Makes the platform immediately invoke
  5514. // another `DetectIntent` call
  5515. // internally with the specified event as input.
  5516. FollowupEventInput *GoogleCloudDialogflowV2beta1EventInput `json:"followupEventInput,omitempty"`
  5517. // FulfillmentMessages: Optional. The collection of rich messages to
  5518. // present to the user. This
  5519. // value is passed directly to `QueryResult.fulfillment_messages`.
  5520. FulfillmentMessages []*GoogleCloudDialogflowV2beta1IntentMessage `json:"fulfillmentMessages,omitempty"`
  5521. // FulfillmentText: Optional. The text to be shown on the screen. This
  5522. // value is passed directly
  5523. // to `QueryResult.fulfillment_text`.
  5524. FulfillmentText string `json:"fulfillmentText,omitempty"`
  5525. // OutputContexts: Optional. The collection of output contexts. This
  5526. // value is passed directly
  5527. // to `QueryResult.output_contexts`.
  5528. OutputContexts []*GoogleCloudDialogflowV2beta1Context `json:"outputContexts,omitempty"`
  5529. // Payload: Optional. This value is passed directly to
  5530. // `QueryResult.webhook_payload`.
  5531. // See the related `fulfillment_messages[i].payload field`, which may be
  5532. // used
  5533. // as an alternative to this field.
  5534. //
  5535. // This field can be used for Actions on Google responses.
  5536. // It should have a structure similar to the JSON message shown here.
  5537. // For more
  5538. // information, see
  5539. // [Actions on Google
  5540. // Webhook
  5541. // Format](https://developers.google.com/actions/dialogflow/webho
  5542. // ok)
  5543. // <pre>{
  5544. // "google": {
  5545. // "expectUserResponse": true,
  5546. // "richResponse": {
  5547. // "items": [
  5548. // {
  5549. // "simpleResponse": {
  5550. // "textToSpeech": "this is a simple response"
  5551. // }
  5552. // }
  5553. // ]
  5554. // }
  5555. // }
  5556. // }</pre>
  5557. Payload googleapi.RawMessage `json:"payload,omitempty"`
  5558. // Source: Optional. This value is passed directly to
  5559. // `QueryResult.webhook_source`.
  5560. Source string `json:"source,omitempty"`
  5561. // ForceSendFields is a list of field names (e.g. "EndInteraction") to
  5562. // unconditionally include in API requests. By default, fields with
  5563. // empty values are omitted from API requests. However, any non-pointer,
  5564. // non-interface field appearing in ForceSendFields will be sent to the
  5565. // server regardless of whether the field is empty or not. This may be
  5566. // used to include empty fields in Patch requests.
  5567. ForceSendFields []string `json:"-"`
  5568. // NullFields is a list of field names (e.g. "EndInteraction") to
  5569. // include in API requests with the JSON null value. By default, fields
  5570. // with empty values are omitted from API requests. However, any field
  5571. // with an empty value appearing in NullFields will be sent to the
  5572. // server as null. It is an error if a field in this list has a
  5573. // non-empty value. This may be used to include null fields in Patch
  5574. // requests.
  5575. NullFields []string `json:"-"`
  5576. }
  5577. func (s *GoogleCloudDialogflowV2beta1WebhookResponse) MarshalJSON() ([]byte, error) {
  5578. type NoMethod GoogleCloudDialogflowV2beta1WebhookResponse
  5579. raw := NoMethod(*s)
  5580. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5581. }
  5582. // GoogleLongrunningOperation: This resource represents a long-running
  5583. // operation that is the result of a
  5584. // network API call.
  5585. type GoogleLongrunningOperation struct {
  5586. // Done: If the value is `false`, it means the operation is still in
  5587. // progress.
  5588. // If `true`, the operation is completed, and either `error` or
  5589. // `response` is
  5590. // available.
  5591. Done bool `json:"done,omitempty"`
  5592. // Error: The error result of the operation in case of failure or
  5593. // cancellation.
  5594. Error *GoogleRpcStatus `json:"error,omitempty"`
  5595. // Metadata: Service-specific metadata associated with the operation.
  5596. // It typically
  5597. // contains progress information and common metadata such as create
  5598. // time.
  5599. // Some services might not provide such metadata. Any method that
  5600. // returns a
  5601. // long-running operation should document the metadata type, if any.
  5602. Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  5603. // Name: The server-assigned name, which is only unique within the same
  5604. // service that
  5605. // originally returns it. If you use the default HTTP mapping,
  5606. // the
  5607. // `name` should have the format of `operations/some/unique/name`.
  5608. Name string `json:"name,omitempty"`
  5609. // Response: The normal response of the operation in case of success.
  5610. // If the original
  5611. // method returns no data on success, such as `Delete`, the response
  5612. // is
  5613. // `google.protobuf.Empty`. If the original method is
  5614. // standard
  5615. // `Get`/`Create`/`Update`, the response should be the resource. For
  5616. // other
  5617. // methods, the response should have the type `XxxResponse`, where
  5618. // `Xxx`
  5619. // is the original method name. For example, if the original method
  5620. // name
  5621. // is `TakeSnapshot()`, the inferred response type
  5622. // is
  5623. // `TakeSnapshotResponse`.
  5624. Response googleapi.RawMessage `json:"response,omitempty"`
  5625. // ServerResponse contains the HTTP response code and headers from the
  5626. // server.
  5627. googleapi.ServerResponse `json:"-"`
  5628. // ForceSendFields is a list of field names (e.g. "Done") to
  5629. // unconditionally include in API requests. By default, fields with
  5630. // empty values are omitted from API requests. However, any non-pointer,
  5631. // non-interface field appearing in ForceSendFields will be sent to the
  5632. // server regardless of whether the field is empty or not. This may be
  5633. // used to include empty fields in Patch requests.
  5634. ForceSendFields []string `json:"-"`
  5635. // NullFields is a list of field names (e.g. "Done") to include in API
  5636. // requests with the JSON null value. By default, fields with empty
  5637. // values are omitted from API requests. However, any field with an
  5638. // empty value appearing in NullFields will be sent to the server as
  5639. // null. It is an error if a field in this list has a non-empty value.
  5640. // This may be used to include null fields in Patch requests.
  5641. NullFields []string `json:"-"`
  5642. }
  5643. func (s *GoogleLongrunningOperation) MarshalJSON() ([]byte, error) {
  5644. type NoMethod GoogleLongrunningOperation
  5645. raw := NoMethod(*s)
  5646. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5647. }
  5648. // GoogleProtobufEmpty: A generic empty message that you can re-use to
  5649. // avoid defining duplicated
  5650. // empty messages in your APIs. A typical example is to use it as the
  5651. // request
  5652. // or the response type of an API method. For instance:
  5653. //
  5654. // service Foo {
  5655. // rpc Bar(google.protobuf.Empty) returns
  5656. // (google.protobuf.Empty);
  5657. // }
  5658. //
  5659. // The JSON representation for `Empty` is empty JSON object `{}`.
  5660. type GoogleProtobufEmpty struct {
  5661. // ServerResponse contains the HTTP response code and headers from the
  5662. // server.
  5663. googleapi.ServerResponse `json:"-"`
  5664. }
  5665. // GoogleRpcStatus: The `Status` type defines a logical error model that
  5666. // is suitable for
  5667. // different programming environments, including REST APIs and RPC APIs.
  5668. // It is
  5669. // used by [gRPC](https://github.com/grpc). The error model is designed
  5670. // to be:
  5671. //
  5672. // - Simple to use and understand for most users
  5673. // - Flexible enough to meet unexpected needs
  5674. //
  5675. // # Overview
  5676. //
  5677. // The `Status` message contains three pieces of data: error code,
  5678. // error
  5679. // message, and error details. The error code should be an enum value
  5680. // of
  5681. // google.rpc.Code, but it may accept additional error codes if needed.
  5682. // The
  5683. // error message should be a developer-facing English message that
  5684. // helps
  5685. // developers *understand* and *resolve* the error. If a localized
  5686. // user-facing
  5687. // error message is needed, put the localized message in the error
  5688. // details or
  5689. // localize it in the client. The optional error details may contain
  5690. // arbitrary
  5691. // information about the error. There is a predefined set of error
  5692. // detail types
  5693. // in the package `google.rpc` that can be used for common error
  5694. // conditions.
  5695. //
  5696. // # Language mapping
  5697. //
  5698. // The `Status` message is the logical representation of the error
  5699. // model, but it
  5700. // is not necessarily the actual wire format. When the `Status` message
  5701. // is
  5702. // exposed in different client libraries and different wire protocols,
  5703. // it can be
  5704. // mapped differently. For example, it will likely be mapped to some
  5705. // exceptions
  5706. // in Java, but more likely mapped to some error codes in C.
  5707. //
  5708. // # Other uses
  5709. //
  5710. // The error model and the `Status` message can be used in a variety
  5711. // of
  5712. // environments, either with or without APIs, to provide a
  5713. // consistent developer experience across different
  5714. // environments.
  5715. //
  5716. // Example uses of this error model include:
  5717. //
  5718. // - Partial errors. If a service needs to return partial errors to the
  5719. // client,
  5720. // it may embed the `Status` in the normal response to indicate the
  5721. // partial
  5722. // errors.
  5723. //
  5724. // - Workflow errors. A typical workflow has multiple steps. Each step
  5725. // may
  5726. // have a `Status` message for error reporting.
  5727. //
  5728. // - Batch operations. If a client uses batch request and batch
  5729. // response, the
  5730. // `Status` message should be used directly inside batch response,
  5731. // one for
  5732. // each error sub-response.
  5733. //
  5734. // - Asynchronous operations. If an API call embeds asynchronous
  5735. // operation
  5736. // results in its response, the status of those operations should
  5737. // be
  5738. // represented directly using the `Status` message.
  5739. //
  5740. // - Logging. If some API errors are stored in logs, the message
  5741. // `Status` could
  5742. // be used directly after any stripping needed for security/privacy
  5743. // reasons.
  5744. type GoogleRpcStatus struct {
  5745. // Code: The status code, which should be an enum value of
  5746. // google.rpc.Code.
  5747. Code int64 `json:"code,omitempty"`
  5748. // Details: A list of messages that carry the error details. There is a
  5749. // common set of
  5750. // message types for APIs to use.
  5751. Details []googleapi.RawMessage `json:"details,omitempty"`
  5752. // Message: A developer-facing error message, which should be in
  5753. // English. Any
  5754. // user-facing error message should be localized and sent in
  5755. // the
  5756. // google.rpc.Status.details field, or localized by the client.
  5757. Message string `json:"message,omitempty"`
  5758. // ForceSendFields is a list of field names (e.g. "Code") to
  5759. // unconditionally include in API requests. By default, fields with
  5760. // empty values are omitted from API requests. However, any non-pointer,
  5761. // non-interface field appearing in ForceSendFields will be sent to the
  5762. // server regardless of whether the field is empty or not. This may be
  5763. // used to include empty fields in Patch requests.
  5764. ForceSendFields []string `json:"-"`
  5765. // NullFields is a list of field names (e.g. "Code") to include in API
  5766. // requests with the JSON null value. By default, fields with empty
  5767. // values are omitted from API requests. However, any field with an
  5768. // empty value appearing in NullFields will be sent to the server as
  5769. // null. It is an error if a field in this list has a non-empty value.
  5770. // This may be used to include null fields in Patch requests.
  5771. NullFields []string `json:"-"`
  5772. }
  5773. func (s *GoogleRpcStatus) MarshalJSON() ([]byte, error) {
  5774. type NoMethod GoogleRpcStatus
  5775. raw := NoMethod(*s)
  5776. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5777. }
  5778. // GoogleTypeLatLng: An object representing a latitude/longitude pair.
  5779. // This is expressed as a pair
  5780. // of doubles representing degrees latitude and degrees longitude.
  5781. // Unless
  5782. // specified otherwise, this must conform to the
  5783. // <a
  5784. // href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
  5785. // st
  5786. // andard</a>. Values must be within normalized ranges.
  5787. type GoogleTypeLatLng struct {
  5788. // Latitude: The latitude in degrees. It must be in the range [-90.0,
  5789. // +90.0].
  5790. Latitude float64 `json:"latitude,omitempty"`
  5791. // Longitude: The longitude in degrees. It must be in the range [-180.0,
  5792. // +180.0].
  5793. Longitude float64 `json:"longitude,omitempty"`
  5794. // ForceSendFields is a list of field names (e.g. "Latitude") to
  5795. // unconditionally include in API requests. By default, fields with
  5796. // empty values are omitted from API requests. However, any non-pointer,
  5797. // non-interface field appearing in ForceSendFields will be sent to the
  5798. // server regardless of whether the field is empty or not. This may be
  5799. // used to include empty fields in Patch requests.
  5800. ForceSendFields []string `json:"-"`
  5801. // NullFields is a list of field names (e.g. "Latitude") to include in
  5802. // API requests with the JSON null value. By default, fields with empty
  5803. // values are omitted from API requests. However, any field with an
  5804. // empty value appearing in NullFields will be sent to the server as
  5805. // null. It is an error if a field in this list has a non-empty value.
  5806. // This may be used to include null fields in Patch requests.
  5807. NullFields []string `json:"-"`
  5808. }
  5809. func (s *GoogleTypeLatLng) MarshalJSON() ([]byte, error) {
  5810. type NoMethod GoogleTypeLatLng
  5811. raw := NoMethod(*s)
  5812. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5813. }
  5814. func (s *GoogleTypeLatLng) UnmarshalJSON(data []byte) error {
  5815. type NoMethod GoogleTypeLatLng
  5816. var s1 struct {
  5817. Latitude gensupport.JSONFloat64 `json:"latitude"`
  5818. Longitude gensupport.JSONFloat64 `json:"longitude"`
  5819. *NoMethod
  5820. }
  5821. s1.NoMethod = (*NoMethod)(s)
  5822. if err := json.Unmarshal(data, &s1); err != nil {
  5823. return err
  5824. }
  5825. s.Latitude = float64(s1.Latitude)
  5826. s.Longitude = float64(s1.Longitude)
  5827. return nil
  5828. }
  5829. // method id "dialogflow.projects.getAgent":
  5830. type ProjectsGetAgentCall struct {
  5831. s *Service
  5832. parent string
  5833. urlParams_ gensupport.URLParams
  5834. ifNoneMatch_ string
  5835. ctx_ context.Context
  5836. header_ http.Header
  5837. }
  5838. // GetAgent: Retrieves the specified agent.
  5839. func (r *ProjectsService) GetAgent(parent string) *ProjectsGetAgentCall {
  5840. c := &ProjectsGetAgentCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5841. c.parent = parent
  5842. return c
  5843. }
  5844. // Fields allows partial responses to be retrieved. See
  5845. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5846. // for more information.
  5847. func (c *ProjectsGetAgentCall) Fields(s ...googleapi.Field) *ProjectsGetAgentCall {
  5848. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5849. return c
  5850. }
  5851. // IfNoneMatch sets the optional parameter which makes the operation
  5852. // fail if the object's ETag matches the given value. This is useful for
  5853. // getting updates only after the object has changed since the last
  5854. // request. Use googleapi.IsNotModified to check whether the response
  5855. // error from Do is the result of In-None-Match.
  5856. func (c *ProjectsGetAgentCall) IfNoneMatch(entityTag string) *ProjectsGetAgentCall {
  5857. c.ifNoneMatch_ = entityTag
  5858. return c
  5859. }
  5860. // Context sets the context to be used in this call's Do method. Any
  5861. // pending HTTP request will be aborted if the provided context is
  5862. // canceled.
  5863. func (c *ProjectsGetAgentCall) Context(ctx context.Context) *ProjectsGetAgentCall {
  5864. c.ctx_ = ctx
  5865. return c
  5866. }
  5867. // Header returns an http.Header that can be modified by the caller to
  5868. // add HTTP headers to the request.
  5869. func (c *ProjectsGetAgentCall) Header() http.Header {
  5870. if c.header_ == nil {
  5871. c.header_ = make(http.Header)
  5872. }
  5873. return c.header_
  5874. }
  5875. func (c *ProjectsGetAgentCall) doRequest(alt string) (*http.Response, error) {
  5876. reqHeaders := make(http.Header)
  5877. for k, v := range c.header_ {
  5878. reqHeaders[k] = v
  5879. }
  5880. reqHeaders.Set("User-Agent", c.s.userAgent())
  5881. if c.ifNoneMatch_ != "" {
  5882. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5883. }
  5884. var body io.Reader = nil
  5885. c.urlParams_.Set("alt", alt)
  5886. c.urlParams_.Set("prettyPrint", "false")
  5887. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/agent")
  5888. urls += "?" + c.urlParams_.Encode()
  5889. req, err := http.NewRequest("GET", urls, body)
  5890. if err != nil {
  5891. return nil, err
  5892. }
  5893. req.Header = reqHeaders
  5894. googleapi.Expand(req.URL, map[string]string{
  5895. "parent": c.parent,
  5896. })
  5897. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5898. }
  5899. // Do executes the "dialogflow.projects.getAgent" call.
  5900. // Exactly one of *GoogleCloudDialogflowV2beta1Agent or error will be
  5901. // non-nil. Any non-2xx status code is an error. Response headers are in
  5902. // either *GoogleCloudDialogflowV2beta1Agent.ServerResponse.Header or
  5903. // (if a response was returned at all) in
  5904. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5905. // whether the returned error was because http.StatusNotModified was
  5906. // returned.
  5907. func (c *ProjectsGetAgentCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1Agent, error) {
  5908. gensupport.SetOptions(c.urlParams_, opts...)
  5909. res, err := c.doRequest("json")
  5910. if res != nil && res.StatusCode == http.StatusNotModified {
  5911. if res.Body != nil {
  5912. res.Body.Close()
  5913. }
  5914. return nil, &googleapi.Error{
  5915. Code: res.StatusCode,
  5916. Header: res.Header,
  5917. }
  5918. }
  5919. if err != nil {
  5920. return nil, err
  5921. }
  5922. defer googleapi.CloseBody(res)
  5923. if err := googleapi.CheckResponse(res); err != nil {
  5924. return nil, err
  5925. }
  5926. ret := &GoogleCloudDialogflowV2beta1Agent{
  5927. ServerResponse: googleapi.ServerResponse{
  5928. Header: res.Header,
  5929. HTTPStatusCode: res.StatusCode,
  5930. },
  5931. }
  5932. target := &ret
  5933. if err := gensupport.DecodeResponse(target, res); err != nil {
  5934. return nil, err
  5935. }
  5936. return ret, nil
  5937. // {
  5938. // "description": "Retrieves the specified agent.",
  5939. // "flatPath": "v2beta1/projects/{projectsId}/agent",
  5940. // "httpMethod": "GET",
  5941. // "id": "dialogflow.projects.getAgent",
  5942. // "parameterOrder": [
  5943. // "parent"
  5944. // ],
  5945. // "parameters": {
  5946. // "parent": {
  5947. // "description": "Required. The project that the agent to fetch is associated with.\nFormat: `projects/\u003cProject ID\u003e`.",
  5948. // "location": "path",
  5949. // "pattern": "^projects/[^/]+$",
  5950. // "required": true,
  5951. // "type": "string"
  5952. // }
  5953. // },
  5954. // "path": "v2beta1/{+parent}/agent",
  5955. // "response": {
  5956. // "$ref": "GoogleCloudDialogflowV2beta1Agent"
  5957. // },
  5958. // "scopes": [
  5959. // "https://www.googleapis.com/auth/cloud-platform",
  5960. // "https://www.googleapis.com/auth/dialogflow"
  5961. // ]
  5962. // }
  5963. }
  5964. // method id "dialogflow.projects.agent.export":
  5965. type ProjectsAgentExportCall struct {
  5966. s *Service
  5967. parent string
  5968. googleclouddialogflowv2beta1exportagentrequest *GoogleCloudDialogflowV2beta1ExportAgentRequest
  5969. urlParams_ gensupport.URLParams
  5970. ctx_ context.Context
  5971. header_ http.Header
  5972. }
  5973. // Export: Exports the specified agent to a ZIP file.
  5974. //
  5975. //
  5976. // Operation <response: ExportAgentResponse>
  5977. func (r *ProjectsAgentService) Export(parent string, googleclouddialogflowv2beta1exportagentrequest *GoogleCloudDialogflowV2beta1ExportAgentRequest) *ProjectsAgentExportCall {
  5978. c := &ProjectsAgentExportCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5979. c.parent = parent
  5980. c.googleclouddialogflowv2beta1exportagentrequest = googleclouddialogflowv2beta1exportagentrequest
  5981. return c
  5982. }
  5983. // Fields allows partial responses to be retrieved. See
  5984. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5985. // for more information.
  5986. func (c *ProjectsAgentExportCall) Fields(s ...googleapi.Field) *ProjectsAgentExportCall {
  5987. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5988. return c
  5989. }
  5990. // Context sets the context to be used in this call's Do method. Any
  5991. // pending HTTP request will be aborted if the provided context is
  5992. // canceled.
  5993. func (c *ProjectsAgentExportCall) Context(ctx context.Context) *ProjectsAgentExportCall {
  5994. c.ctx_ = ctx
  5995. return c
  5996. }
  5997. // Header returns an http.Header that can be modified by the caller to
  5998. // add HTTP headers to the request.
  5999. func (c *ProjectsAgentExportCall) Header() http.Header {
  6000. if c.header_ == nil {
  6001. c.header_ = make(http.Header)
  6002. }
  6003. return c.header_
  6004. }
  6005. func (c *ProjectsAgentExportCall) doRequest(alt string) (*http.Response, error) {
  6006. reqHeaders := make(http.Header)
  6007. for k, v := range c.header_ {
  6008. reqHeaders[k] = v
  6009. }
  6010. reqHeaders.Set("User-Agent", c.s.userAgent())
  6011. var body io.Reader = nil
  6012. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1exportagentrequest)
  6013. if err != nil {
  6014. return nil, err
  6015. }
  6016. reqHeaders.Set("Content-Type", "application/json")
  6017. c.urlParams_.Set("alt", alt)
  6018. c.urlParams_.Set("prettyPrint", "false")
  6019. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/agent:export")
  6020. urls += "?" + c.urlParams_.Encode()
  6021. req, err := http.NewRequest("POST", urls, body)
  6022. if err != nil {
  6023. return nil, err
  6024. }
  6025. req.Header = reqHeaders
  6026. googleapi.Expand(req.URL, map[string]string{
  6027. "parent": c.parent,
  6028. })
  6029. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6030. }
  6031. // Do executes the "dialogflow.projects.agent.export" call.
  6032. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  6033. // Any non-2xx status code is an error. Response headers are in either
  6034. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  6035. // was returned at all) in error.(*googleapi.Error).Header. Use
  6036. // googleapi.IsNotModified to check whether the returned error was
  6037. // because http.StatusNotModified was returned.
  6038. func (c *ProjectsAgentExportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  6039. gensupport.SetOptions(c.urlParams_, opts...)
  6040. res, err := c.doRequest("json")
  6041. if res != nil && res.StatusCode == http.StatusNotModified {
  6042. if res.Body != nil {
  6043. res.Body.Close()
  6044. }
  6045. return nil, &googleapi.Error{
  6046. Code: res.StatusCode,
  6047. Header: res.Header,
  6048. }
  6049. }
  6050. if err != nil {
  6051. return nil, err
  6052. }
  6053. defer googleapi.CloseBody(res)
  6054. if err := googleapi.CheckResponse(res); err != nil {
  6055. return nil, err
  6056. }
  6057. ret := &GoogleLongrunningOperation{
  6058. ServerResponse: googleapi.ServerResponse{
  6059. Header: res.Header,
  6060. HTTPStatusCode: res.StatusCode,
  6061. },
  6062. }
  6063. target := &ret
  6064. if err := gensupport.DecodeResponse(target, res); err != nil {
  6065. return nil, err
  6066. }
  6067. return ret, nil
  6068. // {
  6069. // "description": "Exports the specified agent to a ZIP file.\n\n\nOperation \u003cresponse: ExportAgentResponse\u003e",
  6070. // "flatPath": "v2beta1/projects/{projectsId}/agent:export",
  6071. // "httpMethod": "POST",
  6072. // "id": "dialogflow.projects.agent.export",
  6073. // "parameterOrder": [
  6074. // "parent"
  6075. // ],
  6076. // "parameters": {
  6077. // "parent": {
  6078. // "description": "Required. The project that the agent to export is associated with.\nFormat: `projects/\u003cProject ID\u003e`.",
  6079. // "location": "path",
  6080. // "pattern": "^projects/[^/]+$",
  6081. // "required": true,
  6082. // "type": "string"
  6083. // }
  6084. // },
  6085. // "path": "v2beta1/{+parent}/agent:export",
  6086. // "request": {
  6087. // "$ref": "GoogleCloudDialogflowV2beta1ExportAgentRequest"
  6088. // },
  6089. // "response": {
  6090. // "$ref": "GoogleLongrunningOperation"
  6091. // },
  6092. // "scopes": [
  6093. // "https://www.googleapis.com/auth/cloud-platform",
  6094. // "https://www.googleapis.com/auth/dialogflow"
  6095. // ]
  6096. // }
  6097. }
  6098. // method id "dialogflow.projects.agent.import":
  6099. type ProjectsAgentImportCall struct {
  6100. s *Service
  6101. parent string
  6102. googleclouddialogflowv2beta1importagentrequest *GoogleCloudDialogflowV2beta1ImportAgentRequest
  6103. urlParams_ gensupport.URLParams
  6104. ctx_ context.Context
  6105. header_ http.Header
  6106. }
  6107. // Import: Imports the specified agent from a ZIP file.
  6108. //
  6109. // Uploads new intents and entity types without deleting the existing
  6110. // ones.
  6111. // Intents and entity types with the same name are replaced with the
  6112. // new
  6113. // versions from ImportAgentRequest.
  6114. //
  6115. //
  6116. // Operation <response: google.protobuf.Empty>
  6117. func (r *ProjectsAgentService) Import(parent string, googleclouddialogflowv2beta1importagentrequest *GoogleCloudDialogflowV2beta1ImportAgentRequest) *ProjectsAgentImportCall {
  6118. c := &ProjectsAgentImportCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6119. c.parent = parent
  6120. c.googleclouddialogflowv2beta1importagentrequest = googleclouddialogflowv2beta1importagentrequest
  6121. return c
  6122. }
  6123. // Fields allows partial responses to be retrieved. See
  6124. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6125. // for more information.
  6126. func (c *ProjectsAgentImportCall) Fields(s ...googleapi.Field) *ProjectsAgentImportCall {
  6127. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6128. return c
  6129. }
  6130. // Context sets the context to be used in this call's Do method. Any
  6131. // pending HTTP request will be aborted if the provided context is
  6132. // canceled.
  6133. func (c *ProjectsAgentImportCall) Context(ctx context.Context) *ProjectsAgentImportCall {
  6134. c.ctx_ = ctx
  6135. return c
  6136. }
  6137. // Header returns an http.Header that can be modified by the caller to
  6138. // add HTTP headers to the request.
  6139. func (c *ProjectsAgentImportCall) Header() http.Header {
  6140. if c.header_ == nil {
  6141. c.header_ = make(http.Header)
  6142. }
  6143. return c.header_
  6144. }
  6145. func (c *ProjectsAgentImportCall) doRequest(alt string) (*http.Response, error) {
  6146. reqHeaders := make(http.Header)
  6147. for k, v := range c.header_ {
  6148. reqHeaders[k] = v
  6149. }
  6150. reqHeaders.Set("User-Agent", c.s.userAgent())
  6151. var body io.Reader = nil
  6152. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1importagentrequest)
  6153. if err != nil {
  6154. return nil, err
  6155. }
  6156. reqHeaders.Set("Content-Type", "application/json")
  6157. c.urlParams_.Set("alt", alt)
  6158. c.urlParams_.Set("prettyPrint", "false")
  6159. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/agent:import")
  6160. urls += "?" + c.urlParams_.Encode()
  6161. req, err := http.NewRequest("POST", urls, body)
  6162. if err != nil {
  6163. return nil, err
  6164. }
  6165. req.Header = reqHeaders
  6166. googleapi.Expand(req.URL, map[string]string{
  6167. "parent": c.parent,
  6168. })
  6169. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6170. }
  6171. // Do executes the "dialogflow.projects.agent.import" call.
  6172. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  6173. // Any non-2xx status code is an error. Response headers are in either
  6174. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  6175. // was returned at all) in error.(*googleapi.Error).Header. Use
  6176. // googleapi.IsNotModified to check whether the returned error was
  6177. // because http.StatusNotModified was returned.
  6178. func (c *ProjectsAgentImportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  6179. gensupport.SetOptions(c.urlParams_, opts...)
  6180. res, err := c.doRequest("json")
  6181. if res != nil && res.StatusCode == http.StatusNotModified {
  6182. if res.Body != nil {
  6183. res.Body.Close()
  6184. }
  6185. return nil, &googleapi.Error{
  6186. Code: res.StatusCode,
  6187. Header: res.Header,
  6188. }
  6189. }
  6190. if err != nil {
  6191. return nil, err
  6192. }
  6193. defer googleapi.CloseBody(res)
  6194. if err := googleapi.CheckResponse(res); err != nil {
  6195. return nil, err
  6196. }
  6197. ret := &GoogleLongrunningOperation{
  6198. ServerResponse: googleapi.ServerResponse{
  6199. Header: res.Header,
  6200. HTTPStatusCode: res.StatusCode,
  6201. },
  6202. }
  6203. target := &ret
  6204. if err := gensupport.DecodeResponse(target, res); err != nil {
  6205. return nil, err
  6206. }
  6207. return ret, nil
  6208. // {
  6209. // "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\n\nOperation \u003cresponse: google.protobuf.Empty\u003e",
  6210. // "flatPath": "v2beta1/projects/{projectsId}/agent:import",
  6211. // "httpMethod": "POST",
  6212. // "id": "dialogflow.projects.agent.import",
  6213. // "parameterOrder": [
  6214. // "parent"
  6215. // ],
  6216. // "parameters": {
  6217. // "parent": {
  6218. // "description": "Required. The project that the agent to import is associated with.\nFormat: `projects/\u003cProject ID\u003e`.",
  6219. // "location": "path",
  6220. // "pattern": "^projects/[^/]+$",
  6221. // "required": true,
  6222. // "type": "string"
  6223. // }
  6224. // },
  6225. // "path": "v2beta1/{+parent}/agent:import",
  6226. // "request": {
  6227. // "$ref": "GoogleCloudDialogflowV2beta1ImportAgentRequest"
  6228. // },
  6229. // "response": {
  6230. // "$ref": "GoogleLongrunningOperation"
  6231. // },
  6232. // "scopes": [
  6233. // "https://www.googleapis.com/auth/cloud-platform",
  6234. // "https://www.googleapis.com/auth/dialogflow"
  6235. // ]
  6236. // }
  6237. }
  6238. // method id "dialogflow.projects.agent.restore":
  6239. type ProjectsAgentRestoreCall struct {
  6240. s *Service
  6241. parent string
  6242. googleclouddialogflowv2beta1restoreagentrequest *GoogleCloudDialogflowV2beta1RestoreAgentRequest
  6243. urlParams_ gensupport.URLParams
  6244. ctx_ context.Context
  6245. header_ http.Header
  6246. }
  6247. // Restore: Restores the specified agent from a ZIP file.
  6248. //
  6249. // Replaces the current agent version with a new one. All the intents
  6250. // and
  6251. // entity types in the older version are deleted.
  6252. //
  6253. //
  6254. // Operation <response: google.protobuf.Empty>
  6255. func (r *ProjectsAgentService) Restore(parent string, googleclouddialogflowv2beta1restoreagentrequest *GoogleCloudDialogflowV2beta1RestoreAgentRequest) *ProjectsAgentRestoreCall {
  6256. c := &ProjectsAgentRestoreCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6257. c.parent = parent
  6258. c.googleclouddialogflowv2beta1restoreagentrequest = googleclouddialogflowv2beta1restoreagentrequest
  6259. return c
  6260. }
  6261. // Fields allows partial responses to be retrieved. See
  6262. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6263. // for more information.
  6264. func (c *ProjectsAgentRestoreCall) Fields(s ...googleapi.Field) *ProjectsAgentRestoreCall {
  6265. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6266. return c
  6267. }
  6268. // Context sets the context to be used in this call's Do method. Any
  6269. // pending HTTP request will be aborted if the provided context is
  6270. // canceled.
  6271. func (c *ProjectsAgentRestoreCall) Context(ctx context.Context) *ProjectsAgentRestoreCall {
  6272. c.ctx_ = ctx
  6273. return c
  6274. }
  6275. // Header returns an http.Header that can be modified by the caller to
  6276. // add HTTP headers to the request.
  6277. func (c *ProjectsAgentRestoreCall) Header() http.Header {
  6278. if c.header_ == nil {
  6279. c.header_ = make(http.Header)
  6280. }
  6281. return c.header_
  6282. }
  6283. func (c *ProjectsAgentRestoreCall) doRequest(alt string) (*http.Response, error) {
  6284. reqHeaders := make(http.Header)
  6285. for k, v := range c.header_ {
  6286. reqHeaders[k] = v
  6287. }
  6288. reqHeaders.Set("User-Agent", c.s.userAgent())
  6289. var body io.Reader = nil
  6290. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1restoreagentrequest)
  6291. if err != nil {
  6292. return nil, err
  6293. }
  6294. reqHeaders.Set("Content-Type", "application/json")
  6295. c.urlParams_.Set("alt", alt)
  6296. c.urlParams_.Set("prettyPrint", "false")
  6297. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/agent:restore")
  6298. urls += "?" + c.urlParams_.Encode()
  6299. req, err := http.NewRequest("POST", urls, body)
  6300. if err != nil {
  6301. return nil, err
  6302. }
  6303. req.Header = reqHeaders
  6304. googleapi.Expand(req.URL, map[string]string{
  6305. "parent": c.parent,
  6306. })
  6307. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6308. }
  6309. // Do executes the "dialogflow.projects.agent.restore" call.
  6310. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  6311. // Any non-2xx status code is an error. Response headers are in either
  6312. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  6313. // was returned at all) in error.(*googleapi.Error).Header. Use
  6314. // googleapi.IsNotModified to check whether the returned error was
  6315. // because http.StatusNotModified was returned.
  6316. func (c *ProjectsAgentRestoreCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  6317. gensupport.SetOptions(c.urlParams_, opts...)
  6318. res, err := c.doRequest("json")
  6319. if res != nil && res.StatusCode == http.StatusNotModified {
  6320. if res.Body != nil {
  6321. res.Body.Close()
  6322. }
  6323. return nil, &googleapi.Error{
  6324. Code: res.StatusCode,
  6325. Header: res.Header,
  6326. }
  6327. }
  6328. if err != nil {
  6329. return nil, err
  6330. }
  6331. defer googleapi.CloseBody(res)
  6332. if err := googleapi.CheckResponse(res); err != nil {
  6333. return nil, err
  6334. }
  6335. ret := &GoogleLongrunningOperation{
  6336. ServerResponse: googleapi.ServerResponse{
  6337. Header: res.Header,
  6338. HTTPStatusCode: res.StatusCode,
  6339. },
  6340. }
  6341. target := &ret
  6342. if err := gensupport.DecodeResponse(target, res); err != nil {
  6343. return nil, err
  6344. }
  6345. return ret, nil
  6346. // {
  6347. // "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\n\nOperation \u003cresponse: google.protobuf.Empty\u003e",
  6348. // "flatPath": "v2beta1/projects/{projectsId}/agent:restore",
  6349. // "httpMethod": "POST",
  6350. // "id": "dialogflow.projects.agent.restore",
  6351. // "parameterOrder": [
  6352. // "parent"
  6353. // ],
  6354. // "parameters": {
  6355. // "parent": {
  6356. // "description": "Required. The project that the agent to restore is associated with.\nFormat: `projects/\u003cProject ID\u003e`.",
  6357. // "location": "path",
  6358. // "pattern": "^projects/[^/]+$",
  6359. // "required": true,
  6360. // "type": "string"
  6361. // }
  6362. // },
  6363. // "path": "v2beta1/{+parent}/agent:restore",
  6364. // "request": {
  6365. // "$ref": "GoogleCloudDialogflowV2beta1RestoreAgentRequest"
  6366. // },
  6367. // "response": {
  6368. // "$ref": "GoogleLongrunningOperation"
  6369. // },
  6370. // "scopes": [
  6371. // "https://www.googleapis.com/auth/cloud-platform",
  6372. // "https://www.googleapis.com/auth/dialogflow"
  6373. // ]
  6374. // }
  6375. }
  6376. // method id "dialogflow.projects.agent.search":
  6377. type ProjectsAgentSearchCall struct {
  6378. s *Service
  6379. parent string
  6380. urlParams_ gensupport.URLParams
  6381. ifNoneMatch_ string
  6382. ctx_ context.Context
  6383. header_ http.Header
  6384. }
  6385. // Search: Returns the list of agents.
  6386. //
  6387. // Since there is at most one conversational agent per project, this
  6388. // method is
  6389. // useful primarily for listing all agents across projects the caller
  6390. // has
  6391. // access to. One can achieve that with a wildcard project collection id
  6392. // "-".
  6393. // Refer to
  6394. // [List
  6395. // Sub-Collections](https://cloud.google.com/apis/design/design_pat
  6396. // terns#list_sub-collections).
  6397. func (r *ProjectsAgentService) Search(parent string) *ProjectsAgentSearchCall {
  6398. c := &ProjectsAgentSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6399. c.parent = parent
  6400. return c
  6401. }
  6402. // PageSize sets the optional parameter "pageSize": The maximum number
  6403. // of items to return in a single page. By
  6404. // default 100 and at most 1000.
  6405. func (c *ProjectsAgentSearchCall) PageSize(pageSize int64) *ProjectsAgentSearchCall {
  6406. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  6407. return c
  6408. }
  6409. // PageToken sets the optional parameter "pageToken": The
  6410. // next_page_token value returned from a previous list request.
  6411. func (c *ProjectsAgentSearchCall) PageToken(pageToken string) *ProjectsAgentSearchCall {
  6412. c.urlParams_.Set("pageToken", pageToken)
  6413. return c
  6414. }
  6415. // Fields allows partial responses to be retrieved. See
  6416. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6417. // for more information.
  6418. func (c *ProjectsAgentSearchCall) Fields(s ...googleapi.Field) *ProjectsAgentSearchCall {
  6419. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6420. return c
  6421. }
  6422. // IfNoneMatch sets the optional parameter which makes the operation
  6423. // fail if the object's ETag matches the given value. This is useful for
  6424. // getting updates only after the object has changed since the last
  6425. // request. Use googleapi.IsNotModified to check whether the response
  6426. // error from Do is the result of In-None-Match.
  6427. func (c *ProjectsAgentSearchCall) IfNoneMatch(entityTag string) *ProjectsAgentSearchCall {
  6428. c.ifNoneMatch_ = entityTag
  6429. return c
  6430. }
  6431. // Context sets the context to be used in this call's Do method. Any
  6432. // pending HTTP request will be aborted if the provided context is
  6433. // canceled.
  6434. func (c *ProjectsAgentSearchCall) Context(ctx context.Context) *ProjectsAgentSearchCall {
  6435. c.ctx_ = ctx
  6436. return c
  6437. }
  6438. // Header returns an http.Header that can be modified by the caller to
  6439. // add HTTP headers to the request.
  6440. func (c *ProjectsAgentSearchCall) Header() http.Header {
  6441. if c.header_ == nil {
  6442. c.header_ = make(http.Header)
  6443. }
  6444. return c.header_
  6445. }
  6446. func (c *ProjectsAgentSearchCall) doRequest(alt string) (*http.Response, error) {
  6447. reqHeaders := make(http.Header)
  6448. for k, v := range c.header_ {
  6449. reqHeaders[k] = v
  6450. }
  6451. reqHeaders.Set("User-Agent", c.s.userAgent())
  6452. if c.ifNoneMatch_ != "" {
  6453. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6454. }
  6455. var body io.Reader = nil
  6456. c.urlParams_.Set("alt", alt)
  6457. c.urlParams_.Set("prettyPrint", "false")
  6458. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/agent:search")
  6459. urls += "?" + c.urlParams_.Encode()
  6460. req, err := http.NewRequest("GET", urls, body)
  6461. if err != nil {
  6462. return nil, err
  6463. }
  6464. req.Header = reqHeaders
  6465. googleapi.Expand(req.URL, map[string]string{
  6466. "parent": c.parent,
  6467. })
  6468. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6469. }
  6470. // Do executes the "dialogflow.projects.agent.search" call.
  6471. // Exactly one of *GoogleCloudDialogflowV2beta1SearchAgentsResponse or
  6472. // error will be non-nil. Any non-2xx status code is an error. Response
  6473. // headers are in either
  6474. // *GoogleCloudDialogflowV2beta1SearchAgentsResponse.ServerResponse.Heade
  6475. // r or (if a response was returned at all) in
  6476. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6477. // whether the returned error was because http.StatusNotModified was
  6478. // returned.
  6479. func (c *ProjectsAgentSearchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1SearchAgentsResponse, error) {
  6480. gensupport.SetOptions(c.urlParams_, opts...)
  6481. res, err := c.doRequest("json")
  6482. if res != nil && res.StatusCode == http.StatusNotModified {
  6483. if res.Body != nil {
  6484. res.Body.Close()
  6485. }
  6486. return nil, &googleapi.Error{
  6487. Code: res.StatusCode,
  6488. Header: res.Header,
  6489. }
  6490. }
  6491. if err != nil {
  6492. return nil, err
  6493. }
  6494. defer googleapi.CloseBody(res)
  6495. if err := googleapi.CheckResponse(res); err != nil {
  6496. return nil, err
  6497. }
  6498. ret := &GoogleCloudDialogflowV2beta1SearchAgentsResponse{
  6499. ServerResponse: googleapi.ServerResponse{
  6500. Header: res.Header,
  6501. HTTPStatusCode: res.StatusCode,
  6502. },
  6503. }
  6504. target := &ret
  6505. if err := gensupport.DecodeResponse(target, res); err != nil {
  6506. return nil, err
  6507. }
  6508. return ret, nil
  6509. // {
  6510. // "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).",
  6511. // "flatPath": "v2beta1/projects/{projectsId}/agent:search",
  6512. // "httpMethod": "GET",
  6513. // "id": "dialogflow.projects.agent.search",
  6514. // "parameterOrder": [
  6515. // "parent"
  6516. // ],
  6517. // "parameters": {
  6518. // "pageSize": {
  6519. // "description": "Optional. The maximum number of items to return in a single page. By\ndefault 100 and at most 1000.",
  6520. // "format": "int32",
  6521. // "location": "query",
  6522. // "type": "integer"
  6523. // },
  6524. // "pageToken": {
  6525. // "description": "Optional. The next_page_token value returned from a previous list request.",
  6526. // "location": "query",
  6527. // "type": "string"
  6528. // },
  6529. // "parent": {
  6530. // "description": "Required. The project to list agents from.\nFormat: `projects/\u003cProject ID or '-'\u003e`.",
  6531. // "location": "path",
  6532. // "pattern": "^projects/[^/]+$",
  6533. // "required": true,
  6534. // "type": "string"
  6535. // }
  6536. // },
  6537. // "path": "v2beta1/{+parent}/agent:search",
  6538. // "response": {
  6539. // "$ref": "GoogleCloudDialogflowV2beta1SearchAgentsResponse"
  6540. // },
  6541. // "scopes": [
  6542. // "https://www.googleapis.com/auth/cloud-platform",
  6543. // "https://www.googleapis.com/auth/dialogflow"
  6544. // ]
  6545. // }
  6546. }
  6547. // Pages invokes f for each page of results.
  6548. // A non-nil error returned from f will halt the iteration.
  6549. // The provided context supersedes any context provided to the Context method.
  6550. func (c *ProjectsAgentSearchCall) Pages(ctx context.Context, f func(*GoogleCloudDialogflowV2beta1SearchAgentsResponse) error) error {
  6551. c.ctx_ = ctx
  6552. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  6553. for {
  6554. x, err := c.Do()
  6555. if err != nil {
  6556. return err
  6557. }
  6558. if err := f(x); err != nil {
  6559. return err
  6560. }
  6561. if x.NextPageToken == "" {
  6562. return nil
  6563. }
  6564. c.PageToken(x.NextPageToken)
  6565. }
  6566. }
  6567. // method id "dialogflow.projects.agent.train":
  6568. type ProjectsAgentTrainCall struct {
  6569. s *Service
  6570. parent string
  6571. googleclouddialogflowv2beta1trainagentrequest *GoogleCloudDialogflowV2beta1TrainAgentRequest
  6572. urlParams_ gensupport.URLParams
  6573. ctx_ context.Context
  6574. header_ http.Header
  6575. }
  6576. // Train: Trains the specified agent.
  6577. //
  6578. //
  6579. // Operation <response: google.protobuf.Empty>
  6580. func (r *ProjectsAgentService) Train(parent string, googleclouddialogflowv2beta1trainagentrequest *GoogleCloudDialogflowV2beta1TrainAgentRequest) *ProjectsAgentTrainCall {
  6581. c := &ProjectsAgentTrainCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6582. c.parent = parent
  6583. c.googleclouddialogflowv2beta1trainagentrequest = googleclouddialogflowv2beta1trainagentrequest
  6584. return c
  6585. }
  6586. // Fields allows partial responses to be retrieved. See
  6587. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6588. // for more information.
  6589. func (c *ProjectsAgentTrainCall) Fields(s ...googleapi.Field) *ProjectsAgentTrainCall {
  6590. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6591. return c
  6592. }
  6593. // Context sets the context to be used in this call's Do method. Any
  6594. // pending HTTP request will be aborted if the provided context is
  6595. // canceled.
  6596. func (c *ProjectsAgentTrainCall) Context(ctx context.Context) *ProjectsAgentTrainCall {
  6597. c.ctx_ = ctx
  6598. return c
  6599. }
  6600. // Header returns an http.Header that can be modified by the caller to
  6601. // add HTTP headers to the request.
  6602. func (c *ProjectsAgentTrainCall) Header() http.Header {
  6603. if c.header_ == nil {
  6604. c.header_ = make(http.Header)
  6605. }
  6606. return c.header_
  6607. }
  6608. func (c *ProjectsAgentTrainCall) doRequest(alt string) (*http.Response, error) {
  6609. reqHeaders := make(http.Header)
  6610. for k, v := range c.header_ {
  6611. reqHeaders[k] = v
  6612. }
  6613. reqHeaders.Set("User-Agent", c.s.userAgent())
  6614. var body io.Reader = nil
  6615. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1trainagentrequest)
  6616. if err != nil {
  6617. return nil, err
  6618. }
  6619. reqHeaders.Set("Content-Type", "application/json")
  6620. c.urlParams_.Set("alt", alt)
  6621. c.urlParams_.Set("prettyPrint", "false")
  6622. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/agent:train")
  6623. urls += "?" + c.urlParams_.Encode()
  6624. req, err := http.NewRequest("POST", urls, body)
  6625. if err != nil {
  6626. return nil, err
  6627. }
  6628. req.Header = reqHeaders
  6629. googleapi.Expand(req.URL, map[string]string{
  6630. "parent": c.parent,
  6631. })
  6632. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6633. }
  6634. // Do executes the "dialogflow.projects.agent.train" call.
  6635. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  6636. // Any non-2xx status code is an error. Response headers are in either
  6637. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  6638. // was returned at all) in error.(*googleapi.Error).Header. Use
  6639. // googleapi.IsNotModified to check whether the returned error was
  6640. // because http.StatusNotModified was returned.
  6641. func (c *ProjectsAgentTrainCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  6642. gensupport.SetOptions(c.urlParams_, opts...)
  6643. res, err := c.doRequest("json")
  6644. if res != nil && res.StatusCode == http.StatusNotModified {
  6645. if res.Body != nil {
  6646. res.Body.Close()
  6647. }
  6648. return nil, &googleapi.Error{
  6649. Code: res.StatusCode,
  6650. Header: res.Header,
  6651. }
  6652. }
  6653. if err != nil {
  6654. return nil, err
  6655. }
  6656. defer googleapi.CloseBody(res)
  6657. if err := googleapi.CheckResponse(res); err != nil {
  6658. return nil, err
  6659. }
  6660. ret := &GoogleLongrunningOperation{
  6661. ServerResponse: googleapi.ServerResponse{
  6662. Header: res.Header,
  6663. HTTPStatusCode: res.StatusCode,
  6664. },
  6665. }
  6666. target := &ret
  6667. if err := gensupport.DecodeResponse(target, res); err != nil {
  6668. return nil, err
  6669. }
  6670. return ret, nil
  6671. // {
  6672. // "description": "Trains the specified agent.\n\n\nOperation \u003cresponse: google.protobuf.Empty\u003e",
  6673. // "flatPath": "v2beta1/projects/{projectsId}/agent:train",
  6674. // "httpMethod": "POST",
  6675. // "id": "dialogflow.projects.agent.train",
  6676. // "parameterOrder": [
  6677. // "parent"
  6678. // ],
  6679. // "parameters": {
  6680. // "parent": {
  6681. // "description": "Required. The project that the agent to train is associated with.\nFormat: `projects/\u003cProject ID\u003e`.",
  6682. // "location": "path",
  6683. // "pattern": "^projects/[^/]+$",
  6684. // "required": true,
  6685. // "type": "string"
  6686. // }
  6687. // },
  6688. // "path": "v2beta1/{+parent}/agent:train",
  6689. // "request": {
  6690. // "$ref": "GoogleCloudDialogflowV2beta1TrainAgentRequest"
  6691. // },
  6692. // "response": {
  6693. // "$ref": "GoogleLongrunningOperation"
  6694. // },
  6695. // "scopes": [
  6696. // "https://www.googleapis.com/auth/cloud-platform",
  6697. // "https://www.googleapis.com/auth/dialogflow"
  6698. // ]
  6699. // }
  6700. }
  6701. // method id "dialogflow.projects.agent.entityTypes.batchDelete":
  6702. type ProjectsAgentEntityTypesBatchDeleteCall struct {
  6703. s *Service
  6704. parent string
  6705. googleclouddialogflowv2beta1batchdeleteentitytypesrequest *GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest
  6706. urlParams_ gensupport.URLParams
  6707. ctx_ context.Context
  6708. header_ http.Header
  6709. }
  6710. // BatchDelete: Deletes entity types in the specified agent.
  6711. //
  6712. // Operation <response: google.protobuf.Empty>
  6713. func (r *ProjectsAgentEntityTypesService) BatchDelete(parent string, googleclouddialogflowv2beta1batchdeleteentitytypesrequest *GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest) *ProjectsAgentEntityTypesBatchDeleteCall {
  6714. c := &ProjectsAgentEntityTypesBatchDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6715. c.parent = parent
  6716. c.googleclouddialogflowv2beta1batchdeleteentitytypesrequest = googleclouddialogflowv2beta1batchdeleteentitytypesrequest
  6717. return c
  6718. }
  6719. // Fields allows partial responses to be retrieved. See
  6720. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6721. // for more information.
  6722. func (c *ProjectsAgentEntityTypesBatchDeleteCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesBatchDeleteCall {
  6723. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6724. return c
  6725. }
  6726. // Context sets the context to be used in this call's Do method. Any
  6727. // pending HTTP request will be aborted if the provided context is
  6728. // canceled.
  6729. func (c *ProjectsAgentEntityTypesBatchDeleteCall) Context(ctx context.Context) *ProjectsAgentEntityTypesBatchDeleteCall {
  6730. c.ctx_ = ctx
  6731. return c
  6732. }
  6733. // Header returns an http.Header that can be modified by the caller to
  6734. // add HTTP headers to the request.
  6735. func (c *ProjectsAgentEntityTypesBatchDeleteCall) Header() http.Header {
  6736. if c.header_ == nil {
  6737. c.header_ = make(http.Header)
  6738. }
  6739. return c.header_
  6740. }
  6741. func (c *ProjectsAgentEntityTypesBatchDeleteCall) doRequest(alt string) (*http.Response, error) {
  6742. reqHeaders := make(http.Header)
  6743. for k, v := range c.header_ {
  6744. reqHeaders[k] = v
  6745. }
  6746. reqHeaders.Set("User-Agent", c.s.userAgent())
  6747. var body io.Reader = nil
  6748. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1batchdeleteentitytypesrequest)
  6749. if err != nil {
  6750. return nil, err
  6751. }
  6752. reqHeaders.Set("Content-Type", "application/json")
  6753. c.urlParams_.Set("alt", alt)
  6754. c.urlParams_.Set("prettyPrint", "false")
  6755. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/entityTypes:batchDelete")
  6756. urls += "?" + c.urlParams_.Encode()
  6757. req, err := http.NewRequest("POST", urls, body)
  6758. if err != nil {
  6759. return nil, err
  6760. }
  6761. req.Header = reqHeaders
  6762. googleapi.Expand(req.URL, map[string]string{
  6763. "parent": c.parent,
  6764. })
  6765. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6766. }
  6767. // Do executes the "dialogflow.projects.agent.entityTypes.batchDelete" call.
  6768. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  6769. // Any non-2xx status code is an error. Response headers are in either
  6770. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  6771. // was returned at all) in error.(*googleapi.Error).Header. Use
  6772. // googleapi.IsNotModified to check whether the returned error was
  6773. // because http.StatusNotModified was returned.
  6774. func (c *ProjectsAgentEntityTypesBatchDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  6775. gensupport.SetOptions(c.urlParams_, opts...)
  6776. res, err := c.doRequest("json")
  6777. if res != nil && res.StatusCode == http.StatusNotModified {
  6778. if res.Body != nil {
  6779. res.Body.Close()
  6780. }
  6781. return nil, &googleapi.Error{
  6782. Code: res.StatusCode,
  6783. Header: res.Header,
  6784. }
  6785. }
  6786. if err != nil {
  6787. return nil, err
  6788. }
  6789. defer googleapi.CloseBody(res)
  6790. if err := googleapi.CheckResponse(res); err != nil {
  6791. return nil, err
  6792. }
  6793. ret := &GoogleLongrunningOperation{
  6794. ServerResponse: googleapi.ServerResponse{
  6795. Header: res.Header,
  6796. HTTPStatusCode: res.StatusCode,
  6797. },
  6798. }
  6799. target := &ret
  6800. if err := gensupport.DecodeResponse(target, res); err != nil {
  6801. return nil, err
  6802. }
  6803. return ret, nil
  6804. // {
  6805. // "description": "Deletes entity types in the specified agent.\n\nOperation \u003cresponse: google.protobuf.Empty\u003e",
  6806. // "flatPath": "v2beta1/projects/{projectsId}/agent/entityTypes:batchDelete",
  6807. // "httpMethod": "POST",
  6808. // "id": "dialogflow.projects.agent.entityTypes.batchDelete",
  6809. // "parameterOrder": [
  6810. // "parent"
  6811. // ],
  6812. // "parameters": {
  6813. // "parent": {
  6814. // "description": "Required. The name of the agent to delete all entities types for. Format:\n`projects/\u003cProject ID\u003e/agent`.",
  6815. // "location": "path",
  6816. // "pattern": "^projects/[^/]+/agent$",
  6817. // "required": true,
  6818. // "type": "string"
  6819. // }
  6820. // },
  6821. // "path": "v2beta1/{+parent}/entityTypes:batchDelete",
  6822. // "request": {
  6823. // "$ref": "GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest"
  6824. // },
  6825. // "response": {
  6826. // "$ref": "GoogleLongrunningOperation"
  6827. // },
  6828. // "scopes": [
  6829. // "https://www.googleapis.com/auth/cloud-platform",
  6830. // "https://www.googleapis.com/auth/dialogflow"
  6831. // ]
  6832. // }
  6833. }
  6834. // method id "dialogflow.projects.agent.entityTypes.batchUpdate":
  6835. type ProjectsAgentEntityTypesBatchUpdateCall struct {
  6836. s *Service
  6837. parent string
  6838. googleclouddialogflowv2beta1batchupdateentitytypesrequest *GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesRequest
  6839. urlParams_ gensupport.URLParams
  6840. ctx_ context.Context
  6841. header_ http.Header
  6842. }
  6843. // BatchUpdate: Updates/Creates multiple entity types in the specified
  6844. // agent.
  6845. //
  6846. // Operation <response: BatchUpdateEntityTypesResponse>
  6847. func (r *ProjectsAgentEntityTypesService) BatchUpdate(parent string, googleclouddialogflowv2beta1batchupdateentitytypesrequest *GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesRequest) *ProjectsAgentEntityTypesBatchUpdateCall {
  6848. c := &ProjectsAgentEntityTypesBatchUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6849. c.parent = parent
  6850. c.googleclouddialogflowv2beta1batchupdateentitytypesrequest = googleclouddialogflowv2beta1batchupdateentitytypesrequest
  6851. return c
  6852. }
  6853. // Fields allows partial responses to be retrieved. See
  6854. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6855. // for more information.
  6856. func (c *ProjectsAgentEntityTypesBatchUpdateCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesBatchUpdateCall {
  6857. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6858. return c
  6859. }
  6860. // Context sets the context to be used in this call's Do method. Any
  6861. // pending HTTP request will be aborted if the provided context is
  6862. // canceled.
  6863. func (c *ProjectsAgentEntityTypesBatchUpdateCall) Context(ctx context.Context) *ProjectsAgentEntityTypesBatchUpdateCall {
  6864. c.ctx_ = ctx
  6865. return c
  6866. }
  6867. // Header returns an http.Header that can be modified by the caller to
  6868. // add HTTP headers to the request.
  6869. func (c *ProjectsAgentEntityTypesBatchUpdateCall) Header() http.Header {
  6870. if c.header_ == nil {
  6871. c.header_ = make(http.Header)
  6872. }
  6873. return c.header_
  6874. }
  6875. func (c *ProjectsAgentEntityTypesBatchUpdateCall) doRequest(alt string) (*http.Response, error) {
  6876. reqHeaders := make(http.Header)
  6877. for k, v := range c.header_ {
  6878. reqHeaders[k] = v
  6879. }
  6880. reqHeaders.Set("User-Agent", c.s.userAgent())
  6881. var body io.Reader = nil
  6882. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1batchupdateentitytypesrequest)
  6883. if err != nil {
  6884. return nil, err
  6885. }
  6886. reqHeaders.Set("Content-Type", "application/json")
  6887. c.urlParams_.Set("alt", alt)
  6888. c.urlParams_.Set("prettyPrint", "false")
  6889. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/entityTypes:batchUpdate")
  6890. urls += "?" + c.urlParams_.Encode()
  6891. req, err := http.NewRequest("POST", urls, body)
  6892. if err != nil {
  6893. return nil, err
  6894. }
  6895. req.Header = reqHeaders
  6896. googleapi.Expand(req.URL, map[string]string{
  6897. "parent": c.parent,
  6898. })
  6899. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6900. }
  6901. // Do executes the "dialogflow.projects.agent.entityTypes.batchUpdate" call.
  6902. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  6903. // Any non-2xx status code is an error. Response headers are in either
  6904. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  6905. // was returned at all) in error.(*googleapi.Error).Header. Use
  6906. // googleapi.IsNotModified to check whether the returned error was
  6907. // because http.StatusNotModified was returned.
  6908. func (c *ProjectsAgentEntityTypesBatchUpdateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  6909. gensupport.SetOptions(c.urlParams_, opts...)
  6910. res, err := c.doRequest("json")
  6911. if res != nil && res.StatusCode == http.StatusNotModified {
  6912. if res.Body != nil {
  6913. res.Body.Close()
  6914. }
  6915. return nil, &googleapi.Error{
  6916. Code: res.StatusCode,
  6917. Header: res.Header,
  6918. }
  6919. }
  6920. if err != nil {
  6921. return nil, err
  6922. }
  6923. defer googleapi.CloseBody(res)
  6924. if err := googleapi.CheckResponse(res); err != nil {
  6925. return nil, err
  6926. }
  6927. ret := &GoogleLongrunningOperation{
  6928. ServerResponse: googleapi.ServerResponse{
  6929. Header: res.Header,
  6930. HTTPStatusCode: res.StatusCode,
  6931. },
  6932. }
  6933. target := &ret
  6934. if err := gensupport.DecodeResponse(target, res); err != nil {
  6935. return nil, err
  6936. }
  6937. return ret, nil
  6938. // {
  6939. // "description": "Updates/Creates multiple entity types in the specified agent.\n\nOperation \u003cresponse: BatchUpdateEntityTypesResponse\u003e",
  6940. // "flatPath": "v2beta1/projects/{projectsId}/agent/entityTypes:batchUpdate",
  6941. // "httpMethod": "POST",
  6942. // "id": "dialogflow.projects.agent.entityTypes.batchUpdate",
  6943. // "parameterOrder": [
  6944. // "parent"
  6945. // ],
  6946. // "parameters": {
  6947. // "parent": {
  6948. // "description": "Required. The name of the agent to update or create entity types in.\nFormat: `projects/\u003cProject ID\u003e/agent`.",
  6949. // "location": "path",
  6950. // "pattern": "^projects/[^/]+/agent$",
  6951. // "required": true,
  6952. // "type": "string"
  6953. // }
  6954. // },
  6955. // "path": "v2beta1/{+parent}/entityTypes:batchUpdate",
  6956. // "request": {
  6957. // "$ref": "GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesRequest"
  6958. // },
  6959. // "response": {
  6960. // "$ref": "GoogleLongrunningOperation"
  6961. // },
  6962. // "scopes": [
  6963. // "https://www.googleapis.com/auth/cloud-platform",
  6964. // "https://www.googleapis.com/auth/dialogflow"
  6965. // ]
  6966. // }
  6967. }
  6968. // method id "dialogflow.projects.agent.entityTypes.create":
  6969. type ProjectsAgentEntityTypesCreateCall struct {
  6970. s *Service
  6971. parent string
  6972. googleclouddialogflowv2beta1entitytype *GoogleCloudDialogflowV2beta1EntityType
  6973. urlParams_ gensupport.URLParams
  6974. ctx_ context.Context
  6975. header_ http.Header
  6976. }
  6977. // Create: Creates an entity type in the specified agent.
  6978. func (r *ProjectsAgentEntityTypesService) Create(parent string, googleclouddialogflowv2beta1entitytype *GoogleCloudDialogflowV2beta1EntityType) *ProjectsAgentEntityTypesCreateCall {
  6979. c := &ProjectsAgentEntityTypesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6980. c.parent = parent
  6981. c.googleclouddialogflowv2beta1entitytype = googleclouddialogflowv2beta1entitytype
  6982. return c
  6983. }
  6984. // LanguageCode sets the optional parameter "languageCode": The language
  6985. // of entity synonyms defined in `entity_type`. If not
  6986. // specified, the agent's default language is used.
  6987. // [More than a
  6988. // dozen
  6989. // languages](https://dialogflow.com/docs/reference/language) are
  6990. // supported.
  6991. // Note: languages must be enabled in the agent, before they can be
  6992. // used.
  6993. func (c *ProjectsAgentEntityTypesCreateCall) LanguageCode(languageCode string) *ProjectsAgentEntityTypesCreateCall {
  6994. c.urlParams_.Set("languageCode", languageCode)
  6995. return c
  6996. }
  6997. // Fields allows partial responses to be retrieved. See
  6998. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6999. // for more information.
  7000. func (c *ProjectsAgentEntityTypesCreateCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesCreateCall {
  7001. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7002. return c
  7003. }
  7004. // Context sets the context to be used in this call's Do method. Any
  7005. // pending HTTP request will be aborted if the provided context is
  7006. // canceled.
  7007. func (c *ProjectsAgentEntityTypesCreateCall) Context(ctx context.Context) *ProjectsAgentEntityTypesCreateCall {
  7008. c.ctx_ = ctx
  7009. return c
  7010. }
  7011. // Header returns an http.Header that can be modified by the caller to
  7012. // add HTTP headers to the request.
  7013. func (c *ProjectsAgentEntityTypesCreateCall) Header() http.Header {
  7014. if c.header_ == nil {
  7015. c.header_ = make(http.Header)
  7016. }
  7017. return c.header_
  7018. }
  7019. func (c *ProjectsAgentEntityTypesCreateCall) doRequest(alt string) (*http.Response, error) {
  7020. reqHeaders := make(http.Header)
  7021. for k, v := range c.header_ {
  7022. reqHeaders[k] = v
  7023. }
  7024. reqHeaders.Set("User-Agent", c.s.userAgent())
  7025. var body io.Reader = nil
  7026. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1entitytype)
  7027. if err != nil {
  7028. return nil, err
  7029. }
  7030. reqHeaders.Set("Content-Type", "application/json")
  7031. c.urlParams_.Set("alt", alt)
  7032. c.urlParams_.Set("prettyPrint", "false")
  7033. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/entityTypes")
  7034. urls += "?" + c.urlParams_.Encode()
  7035. req, err := http.NewRequest("POST", urls, body)
  7036. if err != nil {
  7037. return nil, err
  7038. }
  7039. req.Header = reqHeaders
  7040. googleapi.Expand(req.URL, map[string]string{
  7041. "parent": c.parent,
  7042. })
  7043. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7044. }
  7045. // Do executes the "dialogflow.projects.agent.entityTypes.create" call.
  7046. // Exactly one of *GoogleCloudDialogflowV2beta1EntityType or error will
  7047. // be non-nil. Any non-2xx status code is an error. Response headers are
  7048. // in either
  7049. // *GoogleCloudDialogflowV2beta1EntityType.ServerResponse.Header or (if
  7050. // a response was returned at all) in error.(*googleapi.Error).Header.
  7051. // Use googleapi.IsNotModified to check whether the returned error was
  7052. // because http.StatusNotModified was returned.
  7053. func (c *ProjectsAgentEntityTypesCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1EntityType, error) {
  7054. gensupport.SetOptions(c.urlParams_, opts...)
  7055. res, err := c.doRequest("json")
  7056. if res != nil && res.StatusCode == http.StatusNotModified {
  7057. if res.Body != nil {
  7058. res.Body.Close()
  7059. }
  7060. return nil, &googleapi.Error{
  7061. Code: res.StatusCode,
  7062. Header: res.Header,
  7063. }
  7064. }
  7065. if err != nil {
  7066. return nil, err
  7067. }
  7068. defer googleapi.CloseBody(res)
  7069. if err := googleapi.CheckResponse(res); err != nil {
  7070. return nil, err
  7071. }
  7072. ret := &GoogleCloudDialogflowV2beta1EntityType{
  7073. ServerResponse: googleapi.ServerResponse{
  7074. Header: res.Header,
  7075. HTTPStatusCode: res.StatusCode,
  7076. },
  7077. }
  7078. target := &ret
  7079. if err := gensupport.DecodeResponse(target, res); err != nil {
  7080. return nil, err
  7081. }
  7082. return ret, nil
  7083. // {
  7084. // "description": "Creates an entity type in the specified agent.",
  7085. // "flatPath": "v2beta1/projects/{projectsId}/agent/entityTypes",
  7086. // "httpMethod": "POST",
  7087. // "id": "dialogflow.projects.agent.entityTypes.create",
  7088. // "parameterOrder": [
  7089. // "parent"
  7090. // ],
  7091. // "parameters": {
  7092. // "languageCode": {
  7093. // "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.",
  7094. // "location": "query",
  7095. // "type": "string"
  7096. // },
  7097. // "parent": {
  7098. // "description": "Required. The agent to create a entity type for.\nFormat: `projects/\u003cProject ID\u003e/agent`.",
  7099. // "location": "path",
  7100. // "pattern": "^projects/[^/]+/agent$",
  7101. // "required": true,
  7102. // "type": "string"
  7103. // }
  7104. // },
  7105. // "path": "v2beta1/{+parent}/entityTypes",
  7106. // "request": {
  7107. // "$ref": "GoogleCloudDialogflowV2beta1EntityType"
  7108. // },
  7109. // "response": {
  7110. // "$ref": "GoogleCloudDialogflowV2beta1EntityType"
  7111. // },
  7112. // "scopes": [
  7113. // "https://www.googleapis.com/auth/cloud-platform",
  7114. // "https://www.googleapis.com/auth/dialogflow"
  7115. // ]
  7116. // }
  7117. }
  7118. // method id "dialogflow.projects.agent.entityTypes.delete":
  7119. type ProjectsAgentEntityTypesDeleteCall struct {
  7120. s *Service
  7121. name string
  7122. urlParams_ gensupport.URLParams
  7123. ctx_ context.Context
  7124. header_ http.Header
  7125. }
  7126. // Delete: Deletes the specified entity type.
  7127. func (r *ProjectsAgentEntityTypesService) Delete(name string) *ProjectsAgentEntityTypesDeleteCall {
  7128. c := &ProjectsAgentEntityTypesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7129. c.name = name
  7130. return c
  7131. }
  7132. // Fields allows partial responses to be retrieved. See
  7133. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7134. // for more information.
  7135. func (c *ProjectsAgentEntityTypesDeleteCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesDeleteCall {
  7136. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7137. return c
  7138. }
  7139. // Context sets the context to be used in this call's Do method. Any
  7140. // pending HTTP request will be aborted if the provided context is
  7141. // canceled.
  7142. func (c *ProjectsAgentEntityTypesDeleteCall) Context(ctx context.Context) *ProjectsAgentEntityTypesDeleteCall {
  7143. c.ctx_ = ctx
  7144. return c
  7145. }
  7146. // Header returns an http.Header that can be modified by the caller to
  7147. // add HTTP headers to the request.
  7148. func (c *ProjectsAgentEntityTypesDeleteCall) Header() http.Header {
  7149. if c.header_ == nil {
  7150. c.header_ = make(http.Header)
  7151. }
  7152. return c.header_
  7153. }
  7154. func (c *ProjectsAgentEntityTypesDeleteCall) doRequest(alt string) (*http.Response, error) {
  7155. reqHeaders := make(http.Header)
  7156. for k, v := range c.header_ {
  7157. reqHeaders[k] = v
  7158. }
  7159. reqHeaders.Set("User-Agent", c.s.userAgent())
  7160. var body io.Reader = nil
  7161. c.urlParams_.Set("alt", alt)
  7162. c.urlParams_.Set("prettyPrint", "false")
  7163. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  7164. urls += "?" + c.urlParams_.Encode()
  7165. req, err := http.NewRequest("DELETE", urls, body)
  7166. if err != nil {
  7167. return nil, err
  7168. }
  7169. req.Header = reqHeaders
  7170. googleapi.Expand(req.URL, map[string]string{
  7171. "name": c.name,
  7172. })
  7173. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7174. }
  7175. // Do executes the "dialogflow.projects.agent.entityTypes.delete" call.
  7176. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  7177. // non-2xx status code is an error. Response headers are in either
  7178. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  7179. // returned at all) in error.(*googleapi.Error).Header. Use
  7180. // googleapi.IsNotModified to check whether the returned error was
  7181. // because http.StatusNotModified was returned.
  7182. func (c *ProjectsAgentEntityTypesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  7183. gensupport.SetOptions(c.urlParams_, opts...)
  7184. res, err := c.doRequest("json")
  7185. if res != nil && res.StatusCode == http.StatusNotModified {
  7186. if res.Body != nil {
  7187. res.Body.Close()
  7188. }
  7189. return nil, &googleapi.Error{
  7190. Code: res.StatusCode,
  7191. Header: res.Header,
  7192. }
  7193. }
  7194. if err != nil {
  7195. return nil, err
  7196. }
  7197. defer googleapi.CloseBody(res)
  7198. if err := googleapi.CheckResponse(res); err != nil {
  7199. return nil, err
  7200. }
  7201. ret := &GoogleProtobufEmpty{
  7202. ServerResponse: googleapi.ServerResponse{
  7203. Header: res.Header,
  7204. HTTPStatusCode: res.StatusCode,
  7205. },
  7206. }
  7207. target := &ret
  7208. if err := gensupport.DecodeResponse(target, res); err != nil {
  7209. return nil, err
  7210. }
  7211. return ret, nil
  7212. // {
  7213. // "description": "Deletes the specified entity type.",
  7214. // "flatPath": "v2beta1/projects/{projectsId}/agent/entityTypes/{entityTypesId}",
  7215. // "httpMethod": "DELETE",
  7216. // "id": "dialogflow.projects.agent.entityTypes.delete",
  7217. // "parameterOrder": [
  7218. // "name"
  7219. // ],
  7220. // "parameters": {
  7221. // "name": {
  7222. // "description": "Required. The name of the entity type to delete.\nFormat: `projects/\u003cProject ID\u003e/agent/entityTypes/\u003cEntityType ID\u003e`.",
  7223. // "location": "path",
  7224. // "pattern": "^projects/[^/]+/agent/entityTypes/[^/]+$",
  7225. // "required": true,
  7226. // "type": "string"
  7227. // }
  7228. // },
  7229. // "path": "v2beta1/{+name}",
  7230. // "response": {
  7231. // "$ref": "GoogleProtobufEmpty"
  7232. // },
  7233. // "scopes": [
  7234. // "https://www.googleapis.com/auth/cloud-platform",
  7235. // "https://www.googleapis.com/auth/dialogflow"
  7236. // ]
  7237. // }
  7238. }
  7239. // method id "dialogflow.projects.agent.entityTypes.get":
  7240. type ProjectsAgentEntityTypesGetCall struct {
  7241. s *Service
  7242. name string
  7243. urlParams_ gensupport.URLParams
  7244. ifNoneMatch_ string
  7245. ctx_ context.Context
  7246. header_ http.Header
  7247. }
  7248. // Get: Retrieves the specified entity type.
  7249. func (r *ProjectsAgentEntityTypesService) Get(name string) *ProjectsAgentEntityTypesGetCall {
  7250. c := &ProjectsAgentEntityTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7251. c.name = name
  7252. return c
  7253. }
  7254. // LanguageCode sets the optional parameter "languageCode": The language
  7255. // to retrieve entity synonyms for. If not specified,
  7256. // the agent's default language is used.
  7257. // [More than a
  7258. // dozen
  7259. // languages](https://dialogflow.com/docs/reference/language) are
  7260. // supported.
  7261. // Note: languages must be enabled in the agent, before they can be
  7262. // used.
  7263. func (c *ProjectsAgentEntityTypesGetCall) LanguageCode(languageCode string) *ProjectsAgentEntityTypesGetCall {
  7264. c.urlParams_.Set("languageCode", languageCode)
  7265. return c
  7266. }
  7267. // Fields allows partial responses to be retrieved. See
  7268. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7269. // for more information.
  7270. func (c *ProjectsAgentEntityTypesGetCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesGetCall {
  7271. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7272. return c
  7273. }
  7274. // IfNoneMatch sets the optional parameter which makes the operation
  7275. // fail if the object's ETag matches the given value. This is useful for
  7276. // getting updates only after the object has changed since the last
  7277. // request. Use googleapi.IsNotModified to check whether the response
  7278. // error from Do is the result of In-None-Match.
  7279. func (c *ProjectsAgentEntityTypesGetCall) IfNoneMatch(entityTag string) *ProjectsAgentEntityTypesGetCall {
  7280. c.ifNoneMatch_ = entityTag
  7281. return c
  7282. }
  7283. // Context sets the context to be used in this call's Do method. Any
  7284. // pending HTTP request will be aborted if the provided context is
  7285. // canceled.
  7286. func (c *ProjectsAgentEntityTypesGetCall) Context(ctx context.Context) *ProjectsAgentEntityTypesGetCall {
  7287. c.ctx_ = ctx
  7288. return c
  7289. }
  7290. // Header returns an http.Header that can be modified by the caller to
  7291. // add HTTP headers to the request.
  7292. func (c *ProjectsAgentEntityTypesGetCall) Header() http.Header {
  7293. if c.header_ == nil {
  7294. c.header_ = make(http.Header)
  7295. }
  7296. return c.header_
  7297. }
  7298. func (c *ProjectsAgentEntityTypesGetCall) doRequest(alt string) (*http.Response, error) {
  7299. reqHeaders := make(http.Header)
  7300. for k, v := range c.header_ {
  7301. reqHeaders[k] = v
  7302. }
  7303. reqHeaders.Set("User-Agent", c.s.userAgent())
  7304. if c.ifNoneMatch_ != "" {
  7305. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7306. }
  7307. var body io.Reader = nil
  7308. c.urlParams_.Set("alt", alt)
  7309. c.urlParams_.Set("prettyPrint", "false")
  7310. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  7311. urls += "?" + c.urlParams_.Encode()
  7312. req, err := http.NewRequest("GET", urls, body)
  7313. if err != nil {
  7314. return nil, err
  7315. }
  7316. req.Header = reqHeaders
  7317. googleapi.Expand(req.URL, map[string]string{
  7318. "name": c.name,
  7319. })
  7320. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7321. }
  7322. // Do executes the "dialogflow.projects.agent.entityTypes.get" call.
  7323. // Exactly one of *GoogleCloudDialogflowV2beta1EntityType or error will
  7324. // be non-nil. Any non-2xx status code is an error. Response headers are
  7325. // in either
  7326. // *GoogleCloudDialogflowV2beta1EntityType.ServerResponse.Header or (if
  7327. // a response was returned at all) in error.(*googleapi.Error).Header.
  7328. // Use googleapi.IsNotModified to check whether the returned error was
  7329. // because http.StatusNotModified was returned.
  7330. func (c *ProjectsAgentEntityTypesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1EntityType, error) {
  7331. gensupport.SetOptions(c.urlParams_, opts...)
  7332. res, err := c.doRequest("json")
  7333. if res != nil && res.StatusCode == http.StatusNotModified {
  7334. if res.Body != nil {
  7335. res.Body.Close()
  7336. }
  7337. return nil, &googleapi.Error{
  7338. Code: res.StatusCode,
  7339. Header: res.Header,
  7340. }
  7341. }
  7342. if err != nil {
  7343. return nil, err
  7344. }
  7345. defer googleapi.CloseBody(res)
  7346. if err := googleapi.CheckResponse(res); err != nil {
  7347. return nil, err
  7348. }
  7349. ret := &GoogleCloudDialogflowV2beta1EntityType{
  7350. ServerResponse: googleapi.ServerResponse{
  7351. Header: res.Header,
  7352. HTTPStatusCode: res.StatusCode,
  7353. },
  7354. }
  7355. target := &ret
  7356. if err := gensupport.DecodeResponse(target, res); err != nil {
  7357. return nil, err
  7358. }
  7359. return ret, nil
  7360. // {
  7361. // "description": "Retrieves the specified entity type.",
  7362. // "flatPath": "v2beta1/projects/{projectsId}/agent/entityTypes/{entityTypesId}",
  7363. // "httpMethod": "GET",
  7364. // "id": "dialogflow.projects.agent.entityTypes.get",
  7365. // "parameterOrder": [
  7366. // "name"
  7367. // ],
  7368. // "parameters": {
  7369. // "languageCode": {
  7370. // "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.",
  7371. // "location": "query",
  7372. // "type": "string"
  7373. // },
  7374. // "name": {
  7375. // "description": "Required. The name of the entity type.\nFormat: `projects/\u003cProject ID\u003e/agent/entityTypes/\u003cEntityType ID\u003e`.",
  7376. // "location": "path",
  7377. // "pattern": "^projects/[^/]+/agent/entityTypes/[^/]+$",
  7378. // "required": true,
  7379. // "type": "string"
  7380. // }
  7381. // },
  7382. // "path": "v2beta1/{+name}",
  7383. // "response": {
  7384. // "$ref": "GoogleCloudDialogflowV2beta1EntityType"
  7385. // },
  7386. // "scopes": [
  7387. // "https://www.googleapis.com/auth/cloud-platform",
  7388. // "https://www.googleapis.com/auth/dialogflow"
  7389. // ]
  7390. // }
  7391. }
  7392. // method id "dialogflow.projects.agent.entityTypes.list":
  7393. type ProjectsAgentEntityTypesListCall struct {
  7394. s *Service
  7395. parent string
  7396. urlParams_ gensupport.URLParams
  7397. ifNoneMatch_ string
  7398. ctx_ context.Context
  7399. header_ http.Header
  7400. }
  7401. // List: Returns the list of all entity types in the specified agent.
  7402. func (r *ProjectsAgentEntityTypesService) List(parent string) *ProjectsAgentEntityTypesListCall {
  7403. c := &ProjectsAgentEntityTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7404. c.parent = parent
  7405. return c
  7406. }
  7407. // LanguageCode sets the optional parameter "languageCode": The language
  7408. // to list entity synonyms for. If not specified,
  7409. // the agent's default language is used.
  7410. // [More than a
  7411. // dozen
  7412. // languages](https://dialogflow.com/docs/reference/language) are
  7413. // supported.
  7414. // Note: languages must be enabled in the agent, before they can be
  7415. // used.
  7416. func (c *ProjectsAgentEntityTypesListCall) LanguageCode(languageCode string) *ProjectsAgentEntityTypesListCall {
  7417. c.urlParams_.Set("languageCode", languageCode)
  7418. return c
  7419. }
  7420. // PageSize sets the optional parameter "pageSize": The maximum number
  7421. // of items to return in a single page. By
  7422. // default 100 and at most 1000.
  7423. func (c *ProjectsAgentEntityTypesListCall) PageSize(pageSize int64) *ProjectsAgentEntityTypesListCall {
  7424. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  7425. return c
  7426. }
  7427. // PageToken sets the optional parameter "pageToken": The
  7428. // next_page_token value returned from a previous list request.
  7429. func (c *ProjectsAgentEntityTypesListCall) PageToken(pageToken string) *ProjectsAgentEntityTypesListCall {
  7430. c.urlParams_.Set("pageToken", pageToken)
  7431. return c
  7432. }
  7433. // Fields allows partial responses to be retrieved. See
  7434. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7435. // for more information.
  7436. func (c *ProjectsAgentEntityTypesListCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesListCall {
  7437. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7438. return c
  7439. }
  7440. // IfNoneMatch sets the optional parameter which makes the operation
  7441. // fail if the object's ETag matches the given value. This is useful for
  7442. // getting updates only after the object has changed since the last
  7443. // request. Use googleapi.IsNotModified to check whether the response
  7444. // error from Do is the result of In-None-Match.
  7445. func (c *ProjectsAgentEntityTypesListCall) IfNoneMatch(entityTag string) *ProjectsAgentEntityTypesListCall {
  7446. c.ifNoneMatch_ = entityTag
  7447. return c
  7448. }
  7449. // Context sets the context to be used in this call's Do method. Any
  7450. // pending HTTP request will be aborted if the provided context is
  7451. // canceled.
  7452. func (c *ProjectsAgentEntityTypesListCall) Context(ctx context.Context) *ProjectsAgentEntityTypesListCall {
  7453. c.ctx_ = ctx
  7454. return c
  7455. }
  7456. // Header returns an http.Header that can be modified by the caller to
  7457. // add HTTP headers to the request.
  7458. func (c *ProjectsAgentEntityTypesListCall) Header() http.Header {
  7459. if c.header_ == nil {
  7460. c.header_ = make(http.Header)
  7461. }
  7462. return c.header_
  7463. }
  7464. func (c *ProjectsAgentEntityTypesListCall) doRequest(alt string) (*http.Response, error) {
  7465. reqHeaders := make(http.Header)
  7466. for k, v := range c.header_ {
  7467. reqHeaders[k] = v
  7468. }
  7469. reqHeaders.Set("User-Agent", c.s.userAgent())
  7470. if c.ifNoneMatch_ != "" {
  7471. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7472. }
  7473. var body io.Reader = nil
  7474. c.urlParams_.Set("alt", alt)
  7475. c.urlParams_.Set("prettyPrint", "false")
  7476. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/entityTypes")
  7477. urls += "?" + c.urlParams_.Encode()
  7478. req, err := http.NewRequest("GET", urls, body)
  7479. if err != nil {
  7480. return nil, err
  7481. }
  7482. req.Header = reqHeaders
  7483. googleapi.Expand(req.URL, map[string]string{
  7484. "parent": c.parent,
  7485. })
  7486. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7487. }
  7488. // Do executes the "dialogflow.projects.agent.entityTypes.list" call.
  7489. // Exactly one of *GoogleCloudDialogflowV2beta1ListEntityTypesResponse
  7490. // or error will be non-nil. Any non-2xx status code is an error.
  7491. // Response headers are in either
  7492. // *GoogleCloudDialogflowV2beta1ListEntityTypesResponse.ServerResponse.He
  7493. // ader or (if a response was returned at all) in
  7494. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7495. // whether the returned error was because http.StatusNotModified was
  7496. // returned.
  7497. func (c *ProjectsAgentEntityTypesListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1ListEntityTypesResponse, error) {
  7498. gensupport.SetOptions(c.urlParams_, opts...)
  7499. res, err := c.doRequest("json")
  7500. if res != nil && res.StatusCode == http.StatusNotModified {
  7501. if res.Body != nil {
  7502. res.Body.Close()
  7503. }
  7504. return nil, &googleapi.Error{
  7505. Code: res.StatusCode,
  7506. Header: res.Header,
  7507. }
  7508. }
  7509. if err != nil {
  7510. return nil, err
  7511. }
  7512. defer googleapi.CloseBody(res)
  7513. if err := googleapi.CheckResponse(res); err != nil {
  7514. return nil, err
  7515. }
  7516. ret := &GoogleCloudDialogflowV2beta1ListEntityTypesResponse{
  7517. ServerResponse: googleapi.ServerResponse{
  7518. Header: res.Header,
  7519. HTTPStatusCode: res.StatusCode,
  7520. },
  7521. }
  7522. target := &ret
  7523. if err := gensupport.DecodeResponse(target, res); err != nil {
  7524. return nil, err
  7525. }
  7526. return ret, nil
  7527. // {
  7528. // "description": "Returns the list of all entity types in the specified agent.",
  7529. // "flatPath": "v2beta1/projects/{projectsId}/agent/entityTypes",
  7530. // "httpMethod": "GET",
  7531. // "id": "dialogflow.projects.agent.entityTypes.list",
  7532. // "parameterOrder": [
  7533. // "parent"
  7534. // ],
  7535. // "parameters": {
  7536. // "languageCode": {
  7537. // "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.",
  7538. // "location": "query",
  7539. // "type": "string"
  7540. // },
  7541. // "pageSize": {
  7542. // "description": "Optional. The maximum number of items to return in a single page. By\ndefault 100 and at most 1000.",
  7543. // "format": "int32",
  7544. // "location": "query",
  7545. // "type": "integer"
  7546. // },
  7547. // "pageToken": {
  7548. // "description": "Optional. The next_page_token value returned from a previous list request.",
  7549. // "location": "query",
  7550. // "type": "string"
  7551. // },
  7552. // "parent": {
  7553. // "description": "Required. The agent to list all entity types from.\nFormat: `projects/\u003cProject ID\u003e/agent`.",
  7554. // "location": "path",
  7555. // "pattern": "^projects/[^/]+/agent$",
  7556. // "required": true,
  7557. // "type": "string"
  7558. // }
  7559. // },
  7560. // "path": "v2beta1/{+parent}/entityTypes",
  7561. // "response": {
  7562. // "$ref": "GoogleCloudDialogflowV2beta1ListEntityTypesResponse"
  7563. // },
  7564. // "scopes": [
  7565. // "https://www.googleapis.com/auth/cloud-platform",
  7566. // "https://www.googleapis.com/auth/dialogflow"
  7567. // ]
  7568. // }
  7569. }
  7570. // Pages invokes f for each page of results.
  7571. // A non-nil error returned from f will halt the iteration.
  7572. // The provided context supersedes any context provided to the Context method.
  7573. func (c *ProjectsAgentEntityTypesListCall) Pages(ctx context.Context, f func(*GoogleCloudDialogflowV2beta1ListEntityTypesResponse) error) error {
  7574. c.ctx_ = ctx
  7575. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  7576. for {
  7577. x, err := c.Do()
  7578. if err != nil {
  7579. return err
  7580. }
  7581. if err := f(x); err != nil {
  7582. return err
  7583. }
  7584. if x.NextPageToken == "" {
  7585. return nil
  7586. }
  7587. c.PageToken(x.NextPageToken)
  7588. }
  7589. }
  7590. // method id "dialogflow.projects.agent.entityTypes.patch":
  7591. type ProjectsAgentEntityTypesPatchCall struct {
  7592. s *Service
  7593. nameid string
  7594. googleclouddialogflowv2beta1entitytype *GoogleCloudDialogflowV2beta1EntityType
  7595. urlParams_ gensupport.URLParams
  7596. ctx_ context.Context
  7597. header_ http.Header
  7598. }
  7599. // Patch: Updates the specified entity type.
  7600. func (r *ProjectsAgentEntityTypesService) Patch(nameid string, googleclouddialogflowv2beta1entitytype *GoogleCloudDialogflowV2beta1EntityType) *ProjectsAgentEntityTypesPatchCall {
  7601. c := &ProjectsAgentEntityTypesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7602. c.nameid = nameid
  7603. c.googleclouddialogflowv2beta1entitytype = googleclouddialogflowv2beta1entitytype
  7604. return c
  7605. }
  7606. // LanguageCode sets the optional parameter "languageCode": The language
  7607. // of entity synonyms defined in `entity_type`. If not
  7608. // specified, the agent's default language is used.
  7609. // [More than a
  7610. // dozen
  7611. // languages](https://dialogflow.com/docs/reference/language) are
  7612. // supported.
  7613. // Note: languages must be enabled in the agent, before they can be
  7614. // used.
  7615. func (c *ProjectsAgentEntityTypesPatchCall) LanguageCode(languageCode string) *ProjectsAgentEntityTypesPatchCall {
  7616. c.urlParams_.Set("languageCode", languageCode)
  7617. return c
  7618. }
  7619. // UpdateMask sets the optional parameter "updateMask": The mask to
  7620. // control which fields get updated.
  7621. func (c *ProjectsAgentEntityTypesPatchCall) UpdateMask(updateMask string) *ProjectsAgentEntityTypesPatchCall {
  7622. c.urlParams_.Set("updateMask", updateMask)
  7623. return c
  7624. }
  7625. // Fields allows partial responses to be retrieved. See
  7626. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7627. // for more information.
  7628. func (c *ProjectsAgentEntityTypesPatchCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesPatchCall {
  7629. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7630. return c
  7631. }
  7632. // Context sets the context to be used in this call's Do method. Any
  7633. // pending HTTP request will be aborted if the provided context is
  7634. // canceled.
  7635. func (c *ProjectsAgentEntityTypesPatchCall) Context(ctx context.Context) *ProjectsAgentEntityTypesPatchCall {
  7636. c.ctx_ = ctx
  7637. return c
  7638. }
  7639. // Header returns an http.Header that can be modified by the caller to
  7640. // add HTTP headers to the request.
  7641. func (c *ProjectsAgentEntityTypesPatchCall) Header() http.Header {
  7642. if c.header_ == nil {
  7643. c.header_ = make(http.Header)
  7644. }
  7645. return c.header_
  7646. }
  7647. func (c *ProjectsAgentEntityTypesPatchCall) doRequest(alt string) (*http.Response, error) {
  7648. reqHeaders := make(http.Header)
  7649. for k, v := range c.header_ {
  7650. reqHeaders[k] = v
  7651. }
  7652. reqHeaders.Set("User-Agent", c.s.userAgent())
  7653. var body io.Reader = nil
  7654. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1entitytype)
  7655. if err != nil {
  7656. return nil, err
  7657. }
  7658. reqHeaders.Set("Content-Type", "application/json")
  7659. c.urlParams_.Set("alt", alt)
  7660. c.urlParams_.Set("prettyPrint", "false")
  7661. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  7662. urls += "?" + c.urlParams_.Encode()
  7663. req, err := http.NewRequest("PATCH", urls, body)
  7664. if err != nil {
  7665. return nil, err
  7666. }
  7667. req.Header = reqHeaders
  7668. googleapi.Expand(req.URL, map[string]string{
  7669. "name": c.nameid,
  7670. })
  7671. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7672. }
  7673. // Do executes the "dialogflow.projects.agent.entityTypes.patch" call.
  7674. // Exactly one of *GoogleCloudDialogflowV2beta1EntityType or error will
  7675. // be non-nil. Any non-2xx status code is an error. Response headers are
  7676. // in either
  7677. // *GoogleCloudDialogflowV2beta1EntityType.ServerResponse.Header or (if
  7678. // a response was returned at all) in error.(*googleapi.Error).Header.
  7679. // Use googleapi.IsNotModified to check whether the returned error was
  7680. // because http.StatusNotModified was returned.
  7681. func (c *ProjectsAgentEntityTypesPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1EntityType, error) {
  7682. gensupport.SetOptions(c.urlParams_, opts...)
  7683. res, err := c.doRequest("json")
  7684. if res != nil && res.StatusCode == http.StatusNotModified {
  7685. if res.Body != nil {
  7686. res.Body.Close()
  7687. }
  7688. return nil, &googleapi.Error{
  7689. Code: res.StatusCode,
  7690. Header: res.Header,
  7691. }
  7692. }
  7693. if err != nil {
  7694. return nil, err
  7695. }
  7696. defer googleapi.CloseBody(res)
  7697. if err := googleapi.CheckResponse(res); err != nil {
  7698. return nil, err
  7699. }
  7700. ret := &GoogleCloudDialogflowV2beta1EntityType{
  7701. ServerResponse: googleapi.ServerResponse{
  7702. Header: res.Header,
  7703. HTTPStatusCode: res.StatusCode,
  7704. },
  7705. }
  7706. target := &ret
  7707. if err := gensupport.DecodeResponse(target, res); err != nil {
  7708. return nil, err
  7709. }
  7710. return ret, nil
  7711. // {
  7712. // "description": "Updates the specified entity type.",
  7713. // "flatPath": "v2beta1/projects/{projectsId}/agent/entityTypes/{entityTypesId}",
  7714. // "httpMethod": "PATCH",
  7715. // "id": "dialogflow.projects.agent.entityTypes.patch",
  7716. // "parameterOrder": [
  7717. // "name"
  7718. // ],
  7719. // "parameters": {
  7720. // "languageCode": {
  7721. // "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.",
  7722. // "location": "query",
  7723. // "type": "string"
  7724. // },
  7725. // "name": {
  7726. // "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`.",
  7727. // "location": "path",
  7728. // "pattern": "^projects/[^/]+/agent/entityTypes/[^/]+$",
  7729. // "required": true,
  7730. // "type": "string"
  7731. // },
  7732. // "updateMask": {
  7733. // "description": "Optional. The mask to control which fields get updated.",
  7734. // "format": "google-fieldmask",
  7735. // "location": "query",
  7736. // "type": "string"
  7737. // }
  7738. // },
  7739. // "path": "v2beta1/{+name}",
  7740. // "request": {
  7741. // "$ref": "GoogleCloudDialogflowV2beta1EntityType"
  7742. // },
  7743. // "response": {
  7744. // "$ref": "GoogleCloudDialogflowV2beta1EntityType"
  7745. // },
  7746. // "scopes": [
  7747. // "https://www.googleapis.com/auth/cloud-platform",
  7748. // "https://www.googleapis.com/auth/dialogflow"
  7749. // ]
  7750. // }
  7751. }
  7752. // method id "dialogflow.projects.agent.entityTypes.entities.batchCreate":
  7753. type ProjectsAgentEntityTypesEntitiesBatchCreateCall struct {
  7754. s *Service
  7755. parent string
  7756. googleclouddialogflowv2beta1batchcreateentitiesrequest *GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest
  7757. urlParams_ gensupport.URLParams
  7758. ctx_ context.Context
  7759. header_ http.Header
  7760. }
  7761. // BatchCreate: Creates multiple new entities in the specified entity
  7762. // type.
  7763. //
  7764. // Operation <response: google.protobuf.Empty>
  7765. func (r *ProjectsAgentEntityTypesEntitiesService) BatchCreate(parent string, googleclouddialogflowv2beta1batchcreateentitiesrequest *GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest) *ProjectsAgentEntityTypesEntitiesBatchCreateCall {
  7766. c := &ProjectsAgentEntityTypesEntitiesBatchCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7767. c.parent = parent
  7768. c.googleclouddialogflowv2beta1batchcreateentitiesrequest = googleclouddialogflowv2beta1batchcreateentitiesrequest
  7769. return c
  7770. }
  7771. // Fields allows partial responses to be retrieved. See
  7772. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7773. // for more information.
  7774. func (c *ProjectsAgentEntityTypesEntitiesBatchCreateCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesEntitiesBatchCreateCall {
  7775. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7776. return c
  7777. }
  7778. // Context sets the context to be used in this call's Do method. Any
  7779. // pending HTTP request will be aborted if the provided context is
  7780. // canceled.
  7781. func (c *ProjectsAgentEntityTypesEntitiesBatchCreateCall) Context(ctx context.Context) *ProjectsAgentEntityTypesEntitiesBatchCreateCall {
  7782. c.ctx_ = ctx
  7783. return c
  7784. }
  7785. // Header returns an http.Header that can be modified by the caller to
  7786. // add HTTP headers to the request.
  7787. func (c *ProjectsAgentEntityTypesEntitiesBatchCreateCall) Header() http.Header {
  7788. if c.header_ == nil {
  7789. c.header_ = make(http.Header)
  7790. }
  7791. return c.header_
  7792. }
  7793. func (c *ProjectsAgentEntityTypesEntitiesBatchCreateCall) doRequest(alt string) (*http.Response, error) {
  7794. reqHeaders := make(http.Header)
  7795. for k, v := range c.header_ {
  7796. reqHeaders[k] = v
  7797. }
  7798. reqHeaders.Set("User-Agent", c.s.userAgent())
  7799. var body io.Reader = nil
  7800. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1batchcreateentitiesrequest)
  7801. if err != nil {
  7802. return nil, err
  7803. }
  7804. reqHeaders.Set("Content-Type", "application/json")
  7805. c.urlParams_.Set("alt", alt)
  7806. c.urlParams_.Set("prettyPrint", "false")
  7807. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/entities:batchCreate")
  7808. urls += "?" + c.urlParams_.Encode()
  7809. req, err := http.NewRequest("POST", urls, body)
  7810. if err != nil {
  7811. return nil, err
  7812. }
  7813. req.Header = reqHeaders
  7814. googleapi.Expand(req.URL, map[string]string{
  7815. "parent": c.parent,
  7816. })
  7817. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7818. }
  7819. // Do executes the "dialogflow.projects.agent.entityTypes.entities.batchCreate" call.
  7820. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  7821. // Any non-2xx status code is an error. Response headers are in either
  7822. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  7823. // was returned at all) in error.(*googleapi.Error).Header. Use
  7824. // googleapi.IsNotModified to check whether the returned error was
  7825. // because http.StatusNotModified was returned.
  7826. func (c *ProjectsAgentEntityTypesEntitiesBatchCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  7827. gensupport.SetOptions(c.urlParams_, opts...)
  7828. res, err := c.doRequest("json")
  7829. if res != nil && res.StatusCode == http.StatusNotModified {
  7830. if res.Body != nil {
  7831. res.Body.Close()
  7832. }
  7833. return nil, &googleapi.Error{
  7834. Code: res.StatusCode,
  7835. Header: res.Header,
  7836. }
  7837. }
  7838. if err != nil {
  7839. return nil, err
  7840. }
  7841. defer googleapi.CloseBody(res)
  7842. if err := googleapi.CheckResponse(res); err != nil {
  7843. return nil, err
  7844. }
  7845. ret := &GoogleLongrunningOperation{
  7846. ServerResponse: googleapi.ServerResponse{
  7847. Header: res.Header,
  7848. HTTPStatusCode: res.StatusCode,
  7849. },
  7850. }
  7851. target := &ret
  7852. if err := gensupport.DecodeResponse(target, res); err != nil {
  7853. return nil, err
  7854. }
  7855. return ret, nil
  7856. // {
  7857. // "description": "Creates multiple new entities in the specified entity type.\n\nOperation \u003cresponse: google.protobuf.Empty\u003e",
  7858. // "flatPath": "v2beta1/projects/{projectsId}/agent/entityTypes/{entityTypesId}/entities:batchCreate",
  7859. // "httpMethod": "POST",
  7860. // "id": "dialogflow.projects.agent.entityTypes.entities.batchCreate",
  7861. // "parameterOrder": [
  7862. // "parent"
  7863. // ],
  7864. // "parameters": {
  7865. // "parent": {
  7866. // "description": "Required. The name of the entity type to create entities in. Format:\n`projects/\u003cProject ID\u003e/agent/entityTypes/\u003cEntity Type ID\u003e`.",
  7867. // "location": "path",
  7868. // "pattern": "^projects/[^/]+/agent/entityTypes/[^/]+$",
  7869. // "required": true,
  7870. // "type": "string"
  7871. // }
  7872. // },
  7873. // "path": "v2beta1/{+parent}/entities:batchCreate",
  7874. // "request": {
  7875. // "$ref": "GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest"
  7876. // },
  7877. // "response": {
  7878. // "$ref": "GoogleLongrunningOperation"
  7879. // },
  7880. // "scopes": [
  7881. // "https://www.googleapis.com/auth/cloud-platform",
  7882. // "https://www.googleapis.com/auth/dialogflow"
  7883. // ]
  7884. // }
  7885. }
  7886. // method id "dialogflow.projects.agent.entityTypes.entities.batchDelete":
  7887. type ProjectsAgentEntityTypesEntitiesBatchDeleteCall struct {
  7888. s *Service
  7889. parent string
  7890. googleclouddialogflowv2beta1batchdeleteentitiesrequest *GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest
  7891. urlParams_ gensupport.URLParams
  7892. ctx_ context.Context
  7893. header_ http.Header
  7894. }
  7895. // BatchDelete: Deletes entities in the specified entity
  7896. // type.
  7897. //
  7898. // Operation <response: google.protobuf.Empty>
  7899. func (r *ProjectsAgentEntityTypesEntitiesService) BatchDelete(parent string, googleclouddialogflowv2beta1batchdeleteentitiesrequest *GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest) *ProjectsAgentEntityTypesEntitiesBatchDeleteCall {
  7900. c := &ProjectsAgentEntityTypesEntitiesBatchDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7901. c.parent = parent
  7902. c.googleclouddialogflowv2beta1batchdeleteentitiesrequest = googleclouddialogflowv2beta1batchdeleteentitiesrequest
  7903. return c
  7904. }
  7905. // Fields allows partial responses to be retrieved. See
  7906. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7907. // for more information.
  7908. func (c *ProjectsAgentEntityTypesEntitiesBatchDeleteCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesEntitiesBatchDeleteCall {
  7909. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7910. return c
  7911. }
  7912. // Context sets the context to be used in this call's Do method. Any
  7913. // pending HTTP request will be aborted if the provided context is
  7914. // canceled.
  7915. func (c *ProjectsAgentEntityTypesEntitiesBatchDeleteCall) Context(ctx context.Context) *ProjectsAgentEntityTypesEntitiesBatchDeleteCall {
  7916. c.ctx_ = ctx
  7917. return c
  7918. }
  7919. // Header returns an http.Header that can be modified by the caller to
  7920. // add HTTP headers to the request.
  7921. func (c *ProjectsAgentEntityTypesEntitiesBatchDeleteCall) Header() http.Header {
  7922. if c.header_ == nil {
  7923. c.header_ = make(http.Header)
  7924. }
  7925. return c.header_
  7926. }
  7927. func (c *ProjectsAgentEntityTypesEntitiesBatchDeleteCall) doRequest(alt string) (*http.Response, error) {
  7928. reqHeaders := make(http.Header)
  7929. for k, v := range c.header_ {
  7930. reqHeaders[k] = v
  7931. }
  7932. reqHeaders.Set("User-Agent", c.s.userAgent())
  7933. var body io.Reader = nil
  7934. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1batchdeleteentitiesrequest)
  7935. if err != nil {
  7936. return nil, err
  7937. }
  7938. reqHeaders.Set("Content-Type", "application/json")
  7939. c.urlParams_.Set("alt", alt)
  7940. c.urlParams_.Set("prettyPrint", "false")
  7941. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/entities:batchDelete")
  7942. urls += "?" + c.urlParams_.Encode()
  7943. req, err := http.NewRequest("POST", urls, body)
  7944. if err != nil {
  7945. return nil, err
  7946. }
  7947. req.Header = reqHeaders
  7948. googleapi.Expand(req.URL, map[string]string{
  7949. "parent": c.parent,
  7950. })
  7951. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7952. }
  7953. // Do executes the "dialogflow.projects.agent.entityTypes.entities.batchDelete" call.
  7954. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  7955. // Any non-2xx status code is an error. Response headers are in either
  7956. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  7957. // was returned at all) in error.(*googleapi.Error).Header. Use
  7958. // googleapi.IsNotModified to check whether the returned error was
  7959. // because http.StatusNotModified was returned.
  7960. func (c *ProjectsAgentEntityTypesEntitiesBatchDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  7961. gensupport.SetOptions(c.urlParams_, opts...)
  7962. res, err := c.doRequest("json")
  7963. if res != nil && res.StatusCode == http.StatusNotModified {
  7964. if res.Body != nil {
  7965. res.Body.Close()
  7966. }
  7967. return nil, &googleapi.Error{
  7968. Code: res.StatusCode,
  7969. Header: res.Header,
  7970. }
  7971. }
  7972. if err != nil {
  7973. return nil, err
  7974. }
  7975. defer googleapi.CloseBody(res)
  7976. if err := googleapi.CheckResponse(res); err != nil {
  7977. return nil, err
  7978. }
  7979. ret := &GoogleLongrunningOperation{
  7980. ServerResponse: googleapi.ServerResponse{
  7981. Header: res.Header,
  7982. HTTPStatusCode: res.StatusCode,
  7983. },
  7984. }
  7985. target := &ret
  7986. if err := gensupport.DecodeResponse(target, res); err != nil {
  7987. return nil, err
  7988. }
  7989. return ret, nil
  7990. // {
  7991. // "description": "Deletes entities in the specified entity type.\n\nOperation \u003cresponse: google.protobuf.Empty\u003e",
  7992. // "flatPath": "v2beta1/projects/{projectsId}/agent/entityTypes/{entityTypesId}/entities:batchDelete",
  7993. // "httpMethod": "POST",
  7994. // "id": "dialogflow.projects.agent.entityTypes.entities.batchDelete",
  7995. // "parameterOrder": [
  7996. // "parent"
  7997. // ],
  7998. // "parameters": {
  7999. // "parent": {
  8000. // "description": "Required. The name of the entity type to delete entries for. Format:\n`projects/\u003cProject ID\u003e/agent/entityTypes/\u003cEntity Type ID\u003e`.",
  8001. // "location": "path",
  8002. // "pattern": "^projects/[^/]+/agent/entityTypes/[^/]+$",
  8003. // "required": true,
  8004. // "type": "string"
  8005. // }
  8006. // },
  8007. // "path": "v2beta1/{+parent}/entities:batchDelete",
  8008. // "request": {
  8009. // "$ref": "GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest"
  8010. // },
  8011. // "response": {
  8012. // "$ref": "GoogleLongrunningOperation"
  8013. // },
  8014. // "scopes": [
  8015. // "https://www.googleapis.com/auth/cloud-platform",
  8016. // "https://www.googleapis.com/auth/dialogflow"
  8017. // ]
  8018. // }
  8019. }
  8020. // method id "dialogflow.projects.agent.entityTypes.entities.batchUpdate":
  8021. type ProjectsAgentEntityTypesEntitiesBatchUpdateCall struct {
  8022. s *Service
  8023. parent string
  8024. googleclouddialogflowv2beta1batchupdateentitiesrequest *GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest
  8025. urlParams_ gensupport.URLParams
  8026. ctx_ context.Context
  8027. header_ http.Header
  8028. }
  8029. // BatchUpdate: Updates or creates multiple entities in the specified
  8030. // entity type. This
  8031. // method does not affect entities in the entity type that aren't
  8032. // explicitly
  8033. // specified in the request.
  8034. //
  8035. // Operation <response: google.protobuf.Empty>
  8036. func (r *ProjectsAgentEntityTypesEntitiesService) BatchUpdate(parent string, googleclouddialogflowv2beta1batchupdateentitiesrequest *GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest) *ProjectsAgentEntityTypesEntitiesBatchUpdateCall {
  8037. c := &ProjectsAgentEntityTypesEntitiesBatchUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8038. c.parent = parent
  8039. c.googleclouddialogflowv2beta1batchupdateentitiesrequest = googleclouddialogflowv2beta1batchupdateentitiesrequest
  8040. return c
  8041. }
  8042. // Fields allows partial responses to be retrieved. See
  8043. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8044. // for more information.
  8045. func (c *ProjectsAgentEntityTypesEntitiesBatchUpdateCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesEntitiesBatchUpdateCall {
  8046. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8047. return c
  8048. }
  8049. // Context sets the context to be used in this call's Do method. Any
  8050. // pending HTTP request will be aborted if the provided context is
  8051. // canceled.
  8052. func (c *ProjectsAgentEntityTypesEntitiesBatchUpdateCall) Context(ctx context.Context) *ProjectsAgentEntityTypesEntitiesBatchUpdateCall {
  8053. c.ctx_ = ctx
  8054. return c
  8055. }
  8056. // Header returns an http.Header that can be modified by the caller to
  8057. // add HTTP headers to the request.
  8058. func (c *ProjectsAgentEntityTypesEntitiesBatchUpdateCall) Header() http.Header {
  8059. if c.header_ == nil {
  8060. c.header_ = make(http.Header)
  8061. }
  8062. return c.header_
  8063. }
  8064. func (c *ProjectsAgentEntityTypesEntitiesBatchUpdateCall) doRequest(alt string) (*http.Response, error) {
  8065. reqHeaders := make(http.Header)
  8066. for k, v := range c.header_ {
  8067. reqHeaders[k] = v
  8068. }
  8069. reqHeaders.Set("User-Agent", c.s.userAgent())
  8070. var body io.Reader = nil
  8071. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1batchupdateentitiesrequest)
  8072. if err != nil {
  8073. return nil, err
  8074. }
  8075. reqHeaders.Set("Content-Type", "application/json")
  8076. c.urlParams_.Set("alt", alt)
  8077. c.urlParams_.Set("prettyPrint", "false")
  8078. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/entities:batchUpdate")
  8079. urls += "?" + c.urlParams_.Encode()
  8080. req, err := http.NewRequest("POST", urls, body)
  8081. if err != nil {
  8082. return nil, err
  8083. }
  8084. req.Header = reqHeaders
  8085. googleapi.Expand(req.URL, map[string]string{
  8086. "parent": c.parent,
  8087. })
  8088. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8089. }
  8090. // Do executes the "dialogflow.projects.agent.entityTypes.entities.batchUpdate" call.
  8091. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  8092. // Any non-2xx status code is an error. Response headers are in either
  8093. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  8094. // was returned at all) in error.(*googleapi.Error).Header. Use
  8095. // googleapi.IsNotModified to check whether the returned error was
  8096. // because http.StatusNotModified was returned.
  8097. func (c *ProjectsAgentEntityTypesEntitiesBatchUpdateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  8098. gensupport.SetOptions(c.urlParams_, opts...)
  8099. res, err := c.doRequest("json")
  8100. if res != nil && res.StatusCode == http.StatusNotModified {
  8101. if res.Body != nil {
  8102. res.Body.Close()
  8103. }
  8104. return nil, &googleapi.Error{
  8105. Code: res.StatusCode,
  8106. Header: res.Header,
  8107. }
  8108. }
  8109. if err != nil {
  8110. return nil, err
  8111. }
  8112. defer googleapi.CloseBody(res)
  8113. if err := googleapi.CheckResponse(res); err != nil {
  8114. return nil, err
  8115. }
  8116. ret := &GoogleLongrunningOperation{
  8117. ServerResponse: googleapi.ServerResponse{
  8118. Header: res.Header,
  8119. HTTPStatusCode: res.StatusCode,
  8120. },
  8121. }
  8122. target := &ret
  8123. if err := gensupport.DecodeResponse(target, res); err != nil {
  8124. return nil, err
  8125. }
  8126. return ret, nil
  8127. // {
  8128. // "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",
  8129. // "flatPath": "v2beta1/projects/{projectsId}/agent/entityTypes/{entityTypesId}/entities:batchUpdate",
  8130. // "httpMethod": "POST",
  8131. // "id": "dialogflow.projects.agent.entityTypes.entities.batchUpdate",
  8132. // "parameterOrder": [
  8133. // "parent"
  8134. // ],
  8135. // "parameters": {
  8136. // "parent": {
  8137. // "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`.",
  8138. // "location": "path",
  8139. // "pattern": "^projects/[^/]+/agent/entityTypes/[^/]+$",
  8140. // "required": true,
  8141. // "type": "string"
  8142. // }
  8143. // },
  8144. // "path": "v2beta1/{+parent}/entities:batchUpdate",
  8145. // "request": {
  8146. // "$ref": "GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest"
  8147. // },
  8148. // "response": {
  8149. // "$ref": "GoogleLongrunningOperation"
  8150. // },
  8151. // "scopes": [
  8152. // "https://www.googleapis.com/auth/cloud-platform",
  8153. // "https://www.googleapis.com/auth/dialogflow"
  8154. // ]
  8155. // }
  8156. }
  8157. // method id "dialogflow.projects.agent.environments.users.sessions.deleteContexts":
  8158. type ProjectsAgentEnvironmentsUsersSessionsDeleteContextsCall struct {
  8159. s *Service
  8160. parent string
  8161. urlParams_ gensupport.URLParams
  8162. ctx_ context.Context
  8163. header_ http.Header
  8164. }
  8165. // DeleteContexts: Deletes all active contexts in the specified session.
  8166. func (r *ProjectsAgentEnvironmentsUsersSessionsService) DeleteContexts(parent string) *ProjectsAgentEnvironmentsUsersSessionsDeleteContextsCall {
  8167. c := &ProjectsAgentEnvironmentsUsersSessionsDeleteContextsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8168. c.parent = parent
  8169. return c
  8170. }
  8171. // Fields allows partial responses to be retrieved. See
  8172. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8173. // for more information.
  8174. func (c *ProjectsAgentEnvironmentsUsersSessionsDeleteContextsCall) Fields(s ...googleapi.Field) *ProjectsAgentEnvironmentsUsersSessionsDeleteContextsCall {
  8175. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8176. return c
  8177. }
  8178. // Context sets the context to be used in this call's Do method. Any
  8179. // pending HTTP request will be aborted if the provided context is
  8180. // canceled.
  8181. func (c *ProjectsAgentEnvironmentsUsersSessionsDeleteContextsCall) Context(ctx context.Context) *ProjectsAgentEnvironmentsUsersSessionsDeleteContextsCall {
  8182. c.ctx_ = ctx
  8183. return c
  8184. }
  8185. // Header returns an http.Header that can be modified by the caller to
  8186. // add HTTP headers to the request.
  8187. func (c *ProjectsAgentEnvironmentsUsersSessionsDeleteContextsCall) Header() http.Header {
  8188. if c.header_ == nil {
  8189. c.header_ = make(http.Header)
  8190. }
  8191. return c.header_
  8192. }
  8193. func (c *ProjectsAgentEnvironmentsUsersSessionsDeleteContextsCall) doRequest(alt string) (*http.Response, error) {
  8194. reqHeaders := make(http.Header)
  8195. for k, v := range c.header_ {
  8196. reqHeaders[k] = v
  8197. }
  8198. reqHeaders.Set("User-Agent", c.s.userAgent())
  8199. var body io.Reader = nil
  8200. c.urlParams_.Set("alt", alt)
  8201. c.urlParams_.Set("prettyPrint", "false")
  8202. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/contexts")
  8203. urls += "?" + c.urlParams_.Encode()
  8204. req, err := http.NewRequest("DELETE", urls, body)
  8205. if err != nil {
  8206. return nil, err
  8207. }
  8208. req.Header = reqHeaders
  8209. googleapi.Expand(req.URL, map[string]string{
  8210. "parent": c.parent,
  8211. })
  8212. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8213. }
  8214. // Do executes the "dialogflow.projects.agent.environments.users.sessions.deleteContexts" call.
  8215. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  8216. // non-2xx status code is an error. Response headers are in either
  8217. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  8218. // returned at all) in error.(*googleapi.Error).Header. Use
  8219. // googleapi.IsNotModified to check whether the returned error was
  8220. // because http.StatusNotModified was returned.
  8221. func (c *ProjectsAgentEnvironmentsUsersSessionsDeleteContextsCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  8222. gensupport.SetOptions(c.urlParams_, opts...)
  8223. res, err := c.doRequest("json")
  8224. if res != nil && res.StatusCode == http.StatusNotModified {
  8225. if res.Body != nil {
  8226. res.Body.Close()
  8227. }
  8228. return nil, &googleapi.Error{
  8229. Code: res.StatusCode,
  8230. Header: res.Header,
  8231. }
  8232. }
  8233. if err != nil {
  8234. return nil, err
  8235. }
  8236. defer googleapi.CloseBody(res)
  8237. if err := googleapi.CheckResponse(res); err != nil {
  8238. return nil, err
  8239. }
  8240. ret := &GoogleProtobufEmpty{
  8241. ServerResponse: googleapi.ServerResponse{
  8242. Header: res.Header,
  8243. HTTPStatusCode: res.StatusCode,
  8244. },
  8245. }
  8246. target := &ret
  8247. if err := gensupport.DecodeResponse(target, res); err != nil {
  8248. return nil, err
  8249. }
  8250. return ret, nil
  8251. // {
  8252. // "description": "Deletes all active contexts in the specified session.",
  8253. // "flatPath": "v2beta1/projects/{projectsId}/agent/environments/{environmentsId}/users/{usersId}/sessions/{sessionsId}/contexts",
  8254. // "httpMethod": "DELETE",
  8255. // "id": "dialogflow.projects.agent.environments.users.sessions.deleteContexts",
  8256. // "parameterOrder": [
  8257. // "parent"
  8258. // ],
  8259. // "parameters": {
  8260. // "parent": {
  8261. // "description": "Required. The name of the session to delete all contexts from. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e` or `projects/\u003cProject\nID\u003e/agent/environments/\u003cEnvironment ID\u003e/users/\u003cUser ID\u003e/sessions/\u003cSession\nID\u003e`. If `Environment ID` is not specified we assume default 'draft'\nenvironment. If `User ID` is not specified, we assume default '-' user.",
  8262. // "location": "path",
  8263. // "pattern": "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+$",
  8264. // "required": true,
  8265. // "type": "string"
  8266. // }
  8267. // },
  8268. // "path": "v2beta1/{+parent}/contexts",
  8269. // "response": {
  8270. // "$ref": "GoogleProtobufEmpty"
  8271. // },
  8272. // "scopes": [
  8273. // "https://www.googleapis.com/auth/cloud-platform",
  8274. // "https://www.googleapis.com/auth/dialogflow"
  8275. // ]
  8276. // }
  8277. }
  8278. // method id "dialogflow.projects.agent.environments.users.sessions.detectIntent":
  8279. type ProjectsAgentEnvironmentsUsersSessionsDetectIntentCall struct {
  8280. s *Service
  8281. sessionid string
  8282. googleclouddialogflowv2beta1detectintentrequest *GoogleCloudDialogflowV2beta1DetectIntentRequest
  8283. urlParams_ gensupport.URLParams
  8284. ctx_ context.Context
  8285. header_ http.Header
  8286. }
  8287. // DetectIntent: Processes a natural language query and returns
  8288. // structured, actionable data
  8289. // as a result. This method is not idempotent, because it may cause
  8290. // contexts
  8291. // and session entity types to be updated, which in turn might
  8292. // affect
  8293. // results of future queries.
  8294. func (r *ProjectsAgentEnvironmentsUsersSessionsService) DetectIntent(sessionid string, googleclouddialogflowv2beta1detectintentrequest *GoogleCloudDialogflowV2beta1DetectIntentRequest) *ProjectsAgentEnvironmentsUsersSessionsDetectIntentCall {
  8295. c := &ProjectsAgentEnvironmentsUsersSessionsDetectIntentCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8296. c.sessionid = sessionid
  8297. c.googleclouddialogflowv2beta1detectintentrequest = googleclouddialogflowv2beta1detectintentrequest
  8298. return c
  8299. }
  8300. // Fields allows partial responses to be retrieved. See
  8301. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8302. // for more information.
  8303. func (c *ProjectsAgentEnvironmentsUsersSessionsDetectIntentCall) Fields(s ...googleapi.Field) *ProjectsAgentEnvironmentsUsersSessionsDetectIntentCall {
  8304. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8305. return c
  8306. }
  8307. // Context sets the context to be used in this call's Do method. Any
  8308. // pending HTTP request will be aborted if the provided context is
  8309. // canceled.
  8310. func (c *ProjectsAgentEnvironmentsUsersSessionsDetectIntentCall) Context(ctx context.Context) *ProjectsAgentEnvironmentsUsersSessionsDetectIntentCall {
  8311. c.ctx_ = ctx
  8312. return c
  8313. }
  8314. // Header returns an http.Header that can be modified by the caller to
  8315. // add HTTP headers to the request.
  8316. func (c *ProjectsAgentEnvironmentsUsersSessionsDetectIntentCall) Header() http.Header {
  8317. if c.header_ == nil {
  8318. c.header_ = make(http.Header)
  8319. }
  8320. return c.header_
  8321. }
  8322. func (c *ProjectsAgentEnvironmentsUsersSessionsDetectIntentCall) doRequest(alt string) (*http.Response, error) {
  8323. reqHeaders := make(http.Header)
  8324. for k, v := range c.header_ {
  8325. reqHeaders[k] = v
  8326. }
  8327. reqHeaders.Set("User-Agent", c.s.userAgent())
  8328. var body io.Reader = nil
  8329. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1detectintentrequest)
  8330. if err != nil {
  8331. return nil, err
  8332. }
  8333. reqHeaders.Set("Content-Type", "application/json")
  8334. c.urlParams_.Set("alt", alt)
  8335. c.urlParams_.Set("prettyPrint", "false")
  8336. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+session}:detectIntent")
  8337. urls += "?" + c.urlParams_.Encode()
  8338. req, err := http.NewRequest("POST", urls, body)
  8339. if err != nil {
  8340. return nil, err
  8341. }
  8342. req.Header = reqHeaders
  8343. googleapi.Expand(req.URL, map[string]string{
  8344. "session": c.sessionid,
  8345. })
  8346. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8347. }
  8348. // Do executes the "dialogflow.projects.agent.environments.users.sessions.detectIntent" call.
  8349. // Exactly one of *GoogleCloudDialogflowV2beta1DetectIntentResponse or
  8350. // error will be non-nil. Any non-2xx status code is an error. Response
  8351. // headers are in either
  8352. // *GoogleCloudDialogflowV2beta1DetectIntentResponse.ServerResponse.Heade
  8353. // r or (if a response was returned at all) in
  8354. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8355. // whether the returned error was because http.StatusNotModified was
  8356. // returned.
  8357. func (c *ProjectsAgentEnvironmentsUsersSessionsDetectIntentCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1DetectIntentResponse, error) {
  8358. gensupport.SetOptions(c.urlParams_, opts...)
  8359. res, err := c.doRequest("json")
  8360. if res != nil && res.StatusCode == http.StatusNotModified {
  8361. if res.Body != nil {
  8362. res.Body.Close()
  8363. }
  8364. return nil, &googleapi.Error{
  8365. Code: res.StatusCode,
  8366. Header: res.Header,
  8367. }
  8368. }
  8369. if err != nil {
  8370. return nil, err
  8371. }
  8372. defer googleapi.CloseBody(res)
  8373. if err := googleapi.CheckResponse(res); err != nil {
  8374. return nil, err
  8375. }
  8376. ret := &GoogleCloudDialogflowV2beta1DetectIntentResponse{
  8377. ServerResponse: googleapi.ServerResponse{
  8378. Header: res.Header,
  8379. HTTPStatusCode: res.StatusCode,
  8380. },
  8381. }
  8382. target := &ret
  8383. if err := gensupport.DecodeResponse(target, res); err != nil {
  8384. return nil, err
  8385. }
  8386. return ret, nil
  8387. // {
  8388. // "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.",
  8389. // "flatPath": "v2beta1/projects/{projectsId}/agent/environments/{environmentsId}/users/{usersId}/sessions/{sessionsId}:detectIntent",
  8390. // "httpMethod": "POST",
  8391. // "id": "dialogflow.projects.agent.environments.users.sessions.detectIntent",
  8392. // "parameterOrder": [
  8393. // "session"
  8394. // ],
  8395. // "parameters": {
  8396. // "session": {
  8397. // "description": "Required. The name of the session this query is sent to. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e`, or\n`projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment ID\u003e/users/\u003cUser\nID\u003e/sessions/\u003cSession ID\u003e`. If `Environment ID` is not specified, we assume\ndefault 'draft' environment. If `User ID` is not specified, we are using\n\"-\". It’s up to the API caller to choose an appropriate `Session ID` and\n`User Id`. They can be a random numbers or some type of user and session\nidentifiers (preferably hashed). The length of the `Session ID` and\n`User ID` must not exceed 36 characters.",
  8398. // "location": "path",
  8399. // "pattern": "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+$",
  8400. // "required": true,
  8401. // "type": "string"
  8402. // }
  8403. // },
  8404. // "path": "v2beta1/{+session}:detectIntent",
  8405. // "request": {
  8406. // "$ref": "GoogleCloudDialogflowV2beta1DetectIntentRequest"
  8407. // },
  8408. // "response": {
  8409. // "$ref": "GoogleCloudDialogflowV2beta1DetectIntentResponse"
  8410. // },
  8411. // "scopes": [
  8412. // "https://www.googleapis.com/auth/cloud-platform",
  8413. // "https://www.googleapis.com/auth/dialogflow"
  8414. // ]
  8415. // }
  8416. }
  8417. // method id "dialogflow.projects.agent.environments.users.sessions.contexts.create":
  8418. type ProjectsAgentEnvironmentsUsersSessionsContextsCreateCall struct {
  8419. s *Service
  8420. parent string
  8421. googleclouddialogflowv2beta1context *GoogleCloudDialogflowV2beta1Context
  8422. urlParams_ gensupport.URLParams
  8423. ctx_ context.Context
  8424. header_ http.Header
  8425. }
  8426. // Create: Creates a context.
  8427. //
  8428. // If the specified context already exists, overrides the context.
  8429. func (r *ProjectsAgentEnvironmentsUsersSessionsContextsService) Create(parent string, googleclouddialogflowv2beta1context *GoogleCloudDialogflowV2beta1Context) *ProjectsAgentEnvironmentsUsersSessionsContextsCreateCall {
  8430. c := &ProjectsAgentEnvironmentsUsersSessionsContextsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8431. c.parent = parent
  8432. c.googleclouddialogflowv2beta1context = googleclouddialogflowv2beta1context
  8433. return c
  8434. }
  8435. // Fields allows partial responses to be retrieved. See
  8436. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8437. // for more information.
  8438. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsCreateCall) Fields(s ...googleapi.Field) *ProjectsAgentEnvironmentsUsersSessionsContextsCreateCall {
  8439. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8440. return c
  8441. }
  8442. // Context sets the context to be used in this call's Do method. Any
  8443. // pending HTTP request will be aborted if the provided context is
  8444. // canceled.
  8445. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsCreateCall) Context(ctx context.Context) *ProjectsAgentEnvironmentsUsersSessionsContextsCreateCall {
  8446. c.ctx_ = ctx
  8447. return c
  8448. }
  8449. // Header returns an http.Header that can be modified by the caller to
  8450. // add HTTP headers to the request.
  8451. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsCreateCall) Header() http.Header {
  8452. if c.header_ == nil {
  8453. c.header_ = make(http.Header)
  8454. }
  8455. return c.header_
  8456. }
  8457. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsCreateCall) doRequest(alt string) (*http.Response, error) {
  8458. reqHeaders := make(http.Header)
  8459. for k, v := range c.header_ {
  8460. reqHeaders[k] = v
  8461. }
  8462. reqHeaders.Set("User-Agent", c.s.userAgent())
  8463. var body io.Reader = nil
  8464. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1context)
  8465. if err != nil {
  8466. return nil, err
  8467. }
  8468. reqHeaders.Set("Content-Type", "application/json")
  8469. c.urlParams_.Set("alt", alt)
  8470. c.urlParams_.Set("prettyPrint", "false")
  8471. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/contexts")
  8472. urls += "?" + c.urlParams_.Encode()
  8473. req, err := http.NewRequest("POST", urls, body)
  8474. if err != nil {
  8475. return nil, err
  8476. }
  8477. req.Header = reqHeaders
  8478. googleapi.Expand(req.URL, map[string]string{
  8479. "parent": c.parent,
  8480. })
  8481. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8482. }
  8483. // Do executes the "dialogflow.projects.agent.environments.users.sessions.contexts.create" call.
  8484. // Exactly one of *GoogleCloudDialogflowV2beta1Context or error will be
  8485. // non-nil. Any non-2xx status code is an error. Response headers are in
  8486. // either *GoogleCloudDialogflowV2beta1Context.ServerResponse.Header or
  8487. // (if a response was returned at all) in
  8488. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8489. // whether the returned error was because http.StatusNotModified was
  8490. // returned.
  8491. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1Context, error) {
  8492. gensupport.SetOptions(c.urlParams_, opts...)
  8493. res, err := c.doRequest("json")
  8494. if res != nil && res.StatusCode == http.StatusNotModified {
  8495. if res.Body != nil {
  8496. res.Body.Close()
  8497. }
  8498. return nil, &googleapi.Error{
  8499. Code: res.StatusCode,
  8500. Header: res.Header,
  8501. }
  8502. }
  8503. if err != nil {
  8504. return nil, err
  8505. }
  8506. defer googleapi.CloseBody(res)
  8507. if err := googleapi.CheckResponse(res); err != nil {
  8508. return nil, err
  8509. }
  8510. ret := &GoogleCloudDialogflowV2beta1Context{
  8511. ServerResponse: googleapi.ServerResponse{
  8512. Header: res.Header,
  8513. HTTPStatusCode: res.StatusCode,
  8514. },
  8515. }
  8516. target := &ret
  8517. if err := gensupport.DecodeResponse(target, res); err != nil {
  8518. return nil, err
  8519. }
  8520. return ret, nil
  8521. // {
  8522. // "description": "Creates a context.\n\nIf the specified context already exists, overrides the context.",
  8523. // "flatPath": "v2beta1/projects/{projectsId}/agent/environments/{environmentsId}/users/{usersId}/sessions/{sessionsId}/contexts",
  8524. // "httpMethod": "POST",
  8525. // "id": "dialogflow.projects.agent.environments.users.sessions.contexts.create",
  8526. // "parameterOrder": [
  8527. // "parent"
  8528. // ],
  8529. // "parameters": {
  8530. // "parent": {
  8531. // "description": "Required. The session to create a context for.\nFormat: `projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e` or\n`projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment ID\u003e/users/\u003cUser\nID\u003e/sessions/\u003cSession ID\u003e`. If `Environment ID` is not specified, we assume\ndefault 'draft' environment. If `User ID` is not specified, we assume\ndefault '-' user.",
  8532. // "location": "path",
  8533. // "pattern": "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+$",
  8534. // "required": true,
  8535. // "type": "string"
  8536. // }
  8537. // },
  8538. // "path": "v2beta1/{+parent}/contexts",
  8539. // "request": {
  8540. // "$ref": "GoogleCloudDialogflowV2beta1Context"
  8541. // },
  8542. // "response": {
  8543. // "$ref": "GoogleCloudDialogflowV2beta1Context"
  8544. // },
  8545. // "scopes": [
  8546. // "https://www.googleapis.com/auth/cloud-platform",
  8547. // "https://www.googleapis.com/auth/dialogflow"
  8548. // ]
  8549. // }
  8550. }
  8551. // method id "dialogflow.projects.agent.environments.users.sessions.contexts.delete":
  8552. type ProjectsAgentEnvironmentsUsersSessionsContextsDeleteCall struct {
  8553. s *Service
  8554. name string
  8555. urlParams_ gensupport.URLParams
  8556. ctx_ context.Context
  8557. header_ http.Header
  8558. }
  8559. // Delete: Deletes the specified context.
  8560. func (r *ProjectsAgentEnvironmentsUsersSessionsContextsService) Delete(name string) *ProjectsAgentEnvironmentsUsersSessionsContextsDeleteCall {
  8561. c := &ProjectsAgentEnvironmentsUsersSessionsContextsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8562. c.name = name
  8563. return c
  8564. }
  8565. // Fields allows partial responses to be retrieved. See
  8566. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8567. // for more information.
  8568. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsDeleteCall) Fields(s ...googleapi.Field) *ProjectsAgentEnvironmentsUsersSessionsContextsDeleteCall {
  8569. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8570. return c
  8571. }
  8572. // Context sets the context to be used in this call's Do method. Any
  8573. // pending HTTP request will be aborted if the provided context is
  8574. // canceled.
  8575. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsDeleteCall) Context(ctx context.Context) *ProjectsAgentEnvironmentsUsersSessionsContextsDeleteCall {
  8576. c.ctx_ = ctx
  8577. return c
  8578. }
  8579. // Header returns an http.Header that can be modified by the caller to
  8580. // add HTTP headers to the request.
  8581. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsDeleteCall) Header() http.Header {
  8582. if c.header_ == nil {
  8583. c.header_ = make(http.Header)
  8584. }
  8585. return c.header_
  8586. }
  8587. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsDeleteCall) doRequest(alt string) (*http.Response, error) {
  8588. reqHeaders := make(http.Header)
  8589. for k, v := range c.header_ {
  8590. reqHeaders[k] = v
  8591. }
  8592. reqHeaders.Set("User-Agent", c.s.userAgent())
  8593. var body io.Reader = nil
  8594. c.urlParams_.Set("alt", alt)
  8595. c.urlParams_.Set("prettyPrint", "false")
  8596. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  8597. urls += "?" + c.urlParams_.Encode()
  8598. req, err := http.NewRequest("DELETE", urls, body)
  8599. if err != nil {
  8600. return nil, err
  8601. }
  8602. req.Header = reqHeaders
  8603. googleapi.Expand(req.URL, map[string]string{
  8604. "name": c.name,
  8605. })
  8606. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8607. }
  8608. // Do executes the "dialogflow.projects.agent.environments.users.sessions.contexts.delete" call.
  8609. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  8610. // non-2xx status code is an error. Response headers are in either
  8611. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  8612. // returned at all) in error.(*googleapi.Error).Header. Use
  8613. // googleapi.IsNotModified to check whether the returned error was
  8614. // because http.StatusNotModified was returned.
  8615. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  8616. gensupport.SetOptions(c.urlParams_, opts...)
  8617. res, err := c.doRequest("json")
  8618. if res != nil && res.StatusCode == http.StatusNotModified {
  8619. if res.Body != nil {
  8620. res.Body.Close()
  8621. }
  8622. return nil, &googleapi.Error{
  8623. Code: res.StatusCode,
  8624. Header: res.Header,
  8625. }
  8626. }
  8627. if err != nil {
  8628. return nil, err
  8629. }
  8630. defer googleapi.CloseBody(res)
  8631. if err := googleapi.CheckResponse(res); err != nil {
  8632. return nil, err
  8633. }
  8634. ret := &GoogleProtobufEmpty{
  8635. ServerResponse: googleapi.ServerResponse{
  8636. Header: res.Header,
  8637. HTTPStatusCode: res.StatusCode,
  8638. },
  8639. }
  8640. target := &ret
  8641. if err := gensupport.DecodeResponse(target, res); err != nil {
  8642. return nil, err
  8643. }
  8644. return ret, nil
  8645. // {
  8646. // "description": "Deletes the specified context.",
  8647. // "flatPath": "v2beta1/projects/{projectsId}/agent/environments/{environmentsId}/users/{usersId}/sessions/{sessionsId}/contexts/{contextsId}",
  8648. // "httpMethod": "DELETE",
  8649. // "id": "dialogflow.projects.agent.environments.users.sessions.contexts.delete",
  8650. // "parameterOrder": [
  8651. // "name"
  8652. // ],
  8653. // "parameters": {
  8654. // "name": {
  8655. // "description": "Required. The name of the context to delete. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e/contexts/\u003cContext ID\u003e`\nor `projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment ID\u003e/users/\u003cUser\nID\u003e/sessions/\u003cSession ID\u003e/contexts/\u003cContext ID\u003e`. If `Environment ID` is\nnot specified, we assume default 'draft' environment. If `User ID` is not\nspecified, we assume default '-' user.",
  8656. // "location": "path",
  8657. // "pattern": "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/contexts/[^/]+$",
  8658. // "required": true,
  8659. // "type": "string"
  8660. // }
  8661. // },
  8662. // "path": "v2beta1/{+name}",
  8663. // "response": {
  8664. // "$ref": "GoogleProtobufEmpty"
  8665. // },
  8666. // "scopes": [
  8667. // "https://www.googleapis.com/auth/cloud-platform",
  8668. // "https://www.googleapis.com/auth/dialogflow"
  8669. // ]
  8670. // }
  8671. }
  8672. // method id "dialogflow.projects.agent.environments.users.sessions.contexts.get":
  8673. type ProjectsAgentEnvironmentsUsersSessionsContextsGetCall struct {
  8674. s *Service
  8675. name string
  8676. urlParams_ gensupport.URLParams
  8677. ifNoneMatch_ string
  8678. ctx_ context.Context
  8679. header_ http.Header
  8680. }
  8681. // Get: Retrieves the specified context.
  8682. func (r *ProjectsAgentEnvironmentsUsersSessionsContextsService) Get(name string) *ProjectsAgentEnvironmentsUsersSessionsContextsGetCall {
  8683. c := &ProjectsAgentEnvironmentsUsersSessionsContextsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8684. c.name = name
  8685. return c
  8686. }
  8687. // Fields allows partial responses to be retrieved. See
  8688. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8689. // for more information.
  8690. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsGetCall) Fields(s ...googleapi.Field) *ProjectsAgentEnvironmentsUsersSessionsContextsGetCall {
  8691. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8692. return c
  8693. }
  8694. // IfNoneMatch sets the optional parameter which makes the operation
  8695. // fail if the object's ETag matches the given value. This is useful for
  8696. // getting updates only after the object has changed since the last
  8697. // request. Use googleapi.IsNotModified to check whether the response
  8698. // error from Do is the result of In-None-Match.
  8699. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsGetCall) IfNoneMatch(entityTag string) *ProjectsAgentEnvironmentsUsersSessionsContextsGetCall {
  8700. c.ifNoneMatch_ = entityTag
  8701. return c
  8702. }
  8703. // Context sets the context to be used in this call's Do method. Any
  8704. // pending HTTP request will be aborted if the provided context is
  8705. // canceled.
  8706. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsGetCall) Context(ctx context.Context) *ProjectsAgentEnvironmentsUsersSessionsContextsGetCall {
  8707. c.ctx_ = ctx
  8708. return c
  8709. }
  8710. // Header returns an http.Header that can be modified by the caller to
  8711. // add HTTP headers to the request.
  8712. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsGetCall) Header() http.Header {
  8713. if c.header_ == nil {
  8714. c.header_ = make(http.Header)
  8715. }
  8716. return c.header_
  8717. }
  8718. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsGetCall) doRequest(alt string) (*http.Response, error) {
  8719. reqHeaders := make(http.Header)
  8720. for k, v := range c.header_ {
  8721. reqHeaders[k] = v
  8722. }
  8723. reqHeaders.Set("User-Agent", c.s.userAgent())
  8724. if c.ifNoneMatch_ != "" {
  8725. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8726. }
  8727. var body io.Reader = nil
  8728. c.urlParams_.Set("alt", alt)
  8729. c.urlParams_.Set("prettyPrint", "false")
  8730. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  8731. urls += "?" + c.urlParams_.Encode()
  8732. req, err := http.NewRequest("GET", urls, body)
  8733. if err != nil {
  8734. return nil, err
  8735. }
  8736. req.Header = reqHeaders
  8737. googleapi.Expand(req.URL, map[string]string{
  8738. "name": c.name,
  8739. })
  8740. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8741. }
  8742. // Do executes the "dialogflow.projects.agent.environments.users.sessions.contexts.get" call.
  8743. // Exactly one of *GoogleCloudDialogflowV2beta1Context or error will be
  8744. // non-nil. Any non-2xx status code is an error. Response headers are in
  8745. // either *GoogleCloudDialogflowV2beta1Context.ServerResponse.Header or
  8746. // (if a response was returned at all) in
  8747. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8748. // whether the returned error was because http.StatusNotModified was
  8749. // returned.
  8750. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1Context, error) {
  8751. gensupport.SetOptions(c.urlParams_, opts...)
  8752. res, err := c.doRequest("json")
  8753. if res != nil && res.StatusCode == http.StatusNotModified {
  8754. if res.Body != nil {
  8755. res.Body.Close()
  8756. }
  8757. return nil, &googleapi.Error{
  8758. Code: res.StatusCode,
  8759. Header: res.Header,
  8760. }
  8761. }
  8762. if err != nil {
  8763. return nil, err
  8764. }
  8765. defer googleapi.CloseBody(res)
  8766. if err := googleapi.CheckResponse(res); err != nil {
  8767. return nil, err
  8768. }
  8769. ret := &GoogleCloudDialogflowV2beta1Context{
  8770. ServerResponse: googleapi.ServerResponse{
  8771. Header: res.Header,
  8772. HTTPStatusCode: res.StatusCode,
  8773. },
  8774. }
  8775. target := &ret
  8776. if err := gensupport.DecodeResponse(target, res); err != nil {
  8777. return nil, err
  8778. }
  8779. return ret, nil
  8780. // {
  8781. // "description": "Retrieves the specified context.",
  8782. // "flatPath": "v2beta1/projects/{projectsId}/agent/environments/{environmentsId}/users/{usersId}/sessions/{sessionsId}/contexts/{contextsId}",
  8783. // "httpMethod": "GET",
  8784. // "id": "dialogflow.projects.agent.environments.users.sessions.contexts.get",
  8785. // "parameterOrder": [
  8786. // "name"
  8787. // ],
  8788. // "parameters": {
  8789. // "name": {
  8790. // "description": "Required. The name of the context. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e/contexts/\u003cContext ID\u003e`\nor `projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment ID\u003e/users/\u003cUser\nID\u003e/sessions/\u003cSession ID\u003e/contexts/\u003cContext ID\u003e`. If `Environment ID` is\nnot specified, we assume default 'draft' environment. If `User ID` is not\nspecified, we assume default '-' user.",
  8791. // "location": "path",
  8792. // "pattern": "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/contexts/[^/]+$",
  8793. // "required": true,
  8794. // "type": "string"
  8795. // }
  8796. // },
  8797. // "path": "v2beta1/{+name}",
  8798. // "response": {
  8799. // "$ref": "GoogleCloudDialogflowV2beta1Context"
  8800. // },
  8801. // "scopes": [
  8802. // "https://www.googleapis.com/auth/cloud-platform",
  8803. // "https://www.googleapis.com/auth/dialogflow"
  8804. // ]
  8805. // }
  8806. }
  8807. // method id "dialogflow.projects.agent.environments.users.sessions.contexts.list":
  8808. type ProjectsAgentEnvironmentsUsersSessionsContextsListCall struct {
  8809. s *Service
  8810. parent string
  8811. urlParams_ gensupport.URLParams
  8812. ifNoneMatch_ string
  8813. ctx_ context.Context
  8814. header_ http.Header
  8815. }
  8816. // List: Returns the list of all contexts in the specified session.
  8817. func (r *ProjectsAgentEnvironmentsUsersSessionsContextsService) List(parent string) *ProjectsAgentEnvironmentsUsersSessionsContextsListCall {
  8818. c := &ProjectsAgentEnvironmentsUsersSessionsContextsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8819. c.parent = parent
  8820. return c
  8821. }
  8822. // PageSize sets the optional parameter "pageSize": The maximum number
  8823. // of items to return in a single page. By
  8824. // default 100 and at most 1000.
  8825. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsListCall) PageSize(pageSize int64) *ProjectsAgentEnvironmentsUsersSessionsContextsListCall {
  8826. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  8827. return c
  8828. }
  8829. // PageToken sets the optional parameter "pageToken": The
  8830. // next_page_token value returned from a previous list request.
  8831. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsListCall) PageToken(pageToken string) *ProjectsAgentEnvironmentsUsersSessionsContextsListCall {
  8832. c.urlParams_.Set("pageToken", pageToken)
  8833. return c
  8834. }
  8835. // Fields allows partial responses to be retrieved. See
  8836. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8837. // for more information.
  8838. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsListCall) Fields(s ...googleapi.Field) *ProjectsAgentEnvironmentsUsersSessionsContextsListCall {
  8839. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8840. return c
  8841. }
  8842. // IfNoneMatch sets the optional parameter which makes the operation
  8843. // fail if the object's ETag matches the given value. This is useful for
  8844. // getting updates only after the object has changed since the last
  8845. // request. Use googleapi.IsNotModified to check whether the response
  8846. // error from Do is the result of In-None-Match.
  8847. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsListCall) IfNoneMatch(entityTag string) *ProjectsAgentEnvironmentsUsersSessionsContextsListCall {
  8848. c.ifNoneMatch_ = entityTag
  8849. return c
  8850. }
  8851. // Context sets the context to be used in this call's Do method. Any
  8852. // pending HTTP request will be aborted if the provided context is
  8853. // canceled.
  8854. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsListCall) Context(ctx context.Context) *ProjectsAgentEnvironmentsUsersSessionsContextsListCall {
  8855. c.ctx_ = ctx
  8856. return c
  8857. }
  8858. // Header returns an http.Header that can be modified by the caller to
  8859. // add HTTP headers to the request.
  8860. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsListCall) Header() http.Header {
  8861. if c.header_ == nil {
  8862. c.header_ = make(http.Header)
  8863. }
  8864. return c.header_
  8865. }
  8866. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsListCall) doRequest(alt string) (*http.Response, error) {
  8867. reqHeaders := make(http.Header)
  8868. for k, v := range c.header_ {
  8869. reqHeaders[k] = v
  8870. }
  8871. reqHeaders.Set("User-Agent", c.s.userAgent())
  8872. if c.ifNoneMatch_ != "" {
  8873. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8874. }
  8875. var body io.Reader = nil
  8876. c.urlParams_.Set("alt", alt)
  8877. c.urlParams_.Set("prettyPrint", "false")
  8878. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/contexts")
  8879. urls += "?" + c.urlParams_.Encode()
  8880. req, err := http.NewRequest("GET", urls, body)
  8881. if err != nil {
  8882. return nil, err
  8883. }
  8884. req.Header = reqHeaders
  8885. googleapi.Expand(req.URL, map[string]string{
  8886. "parent": c.parent,
  8887. })
  8888. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8889. }
  8890. // Do executes the "dialogflow.projects.agent.environments.users.sessions.contexts.list" call.
  8891. // Exactly one of *GoogleCloudDialogflowV2beta1ListContextsResponse or
  8892. // error will be non-nil. Any non-2xx status code is an error. Response
  8893. // headers are in either
  8894. // *GoogleCloudDialogflowV2beta1ListContextsResponse.ServerResponse.Heade
  8895. // r or (if a response was returned at all) in
  8896. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8897. // whether the returned error was because http.StatusNotModified was
  8898. // returned.
  8899. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1ListContextsResponse, error) {
  8900. gensupport.SetOptions(c.urlParams_, opts...)
  8901. res, err := c.doRequest("json")
  8902. if res != nil && res.StatusCode == http.StatusNotModified {
  8903. if res.Body != nil {
  8904. res.Body.Close()
  8905. }
  8906. return nil, &googleapi.Error{
  8907. Code: res.StatusCode,
  8908. Header: res.Header,
  8909. }
  8910. }
  8911. if err != nil {
  8912. return nil, err
  8913. }
  8914. defer googleapi.CloseBody(res)
  8915. if err := googleapi.CheckResponse(res); err != nil {
  8916. return nil, err
  8917. }
  8918. ret := &GoogleCloudDialogflowV2beta1ListContextsResponse{
  8919. ServerResponse: googleapi.ServerResponse{
  8920. Header: res.Header,
  8921. HTTPStatusCode: res.StatusCode,
  8922. },
  8923. }
  8924. target := &ret
  8925. if err := gensupport.DecodeResponse(target, res); err != nil {
  8926. return nil, err
  8927. }
  8928. return ret, nil
  8929. // {
  8930. // "description": "Returns the list of all contexts in the specified session.",
  8931. // "flatPath": "v2beta1/projects/{projectsId}/agent/environments/{environmentsId}/users/{usersId}/sessions/{sessionsId}/contexts",
  8932. // "httpMethod": "GET",
  8933. // "id": "dialogflow.projects.agent.environments.users.sessions.contexts.list",
  8934. // "parameterOrder": [
  8935. // "parent"
  8936. // ],
  8937. // "parameters": {
  8938. // "pageSize": {
  8939. // "description": "Optional. The maximum number of items to return in a single page. By\ndefault 100 and at most 1000.",
  8940. // "format": "int32",
  8941. // "location": "query",
  8942. // "type": "integer"
  8943. // },
  8944. // "pageToken": {
  8945. // "description": "Optional. The next_page_token value returned from a previous list request.",
  8946. // "location": "query",
  8947. // "type": "string"
  8948. // },
  8949. // "parent": {
  8950. // "description": "Required. The session to list all contexts from.\nFormat: `projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e` or\n`projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment ID\u003e/users/\u003cUser\nID\u003e/sessions/\u003cSession ID\u003e`. If `Environment ID` is not specified, we assume\ndefault 'draft' environment. If `User ID` is not specified, we assume\ndefault '-' user.",
  8951. // "location": "path",
  8952. // "pattern": "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+$",
  8953. // "required": true,
  8954. // "type": "string"
  8955. // }
  8956. // },
  8957. // "path": "v2beta1/{+parent}/contexts",
  8958. // "response": {
  8959. // "$ref": "GoogleCloudDialogflowV2beta1ListContextsResponse"
  8960. // },
  8961. // "scopes": [
  8962. // "https://www.googleapis.com/auth/cloud-platform",
  8963. // "https://www.googleapis.com/auth/dialogflow"
  8964. // ]
  8965. // }
  8966. }
  8967. // Pages invokes f for each page of results.
  8968. // A non-nil error returned from f will halt the iteration.
  8969. // The provided context supersedes any context provided to the Context method.
  8970. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsListCall) Pages(ctx context.Context, f func(*GoogleCloudDialogflowV2beta1ListContextsResponse) error) error {
  8971. c.ctx_ = ctx
  8972. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  8973. for {
  8974. x, err := c.Do()
  8975. if err != nil {
  8976. return err
  8977. }
  8978. if err := f(x); err != nil {
  8979. return err
  8980. }
  8981. if x.NextPageToken == "" {
  8982. return nil
  8983. }
  8984. c.PageToken(x.NextPageToken)
  8985. }
  8986. }
  8987. // method id "dialogflow.projects.agent.environments.users.sessions.contexts.patch":
  8988. type ProjectsAgentEnvironmentsUsersSessionsContextsPatchCall struct {
  8989. s *Service
  8990. nameid string
  8991. googleclouddialogflowv2beta1context *GoogleCloudDialogflowV2beta1Context
  8992. urlParams_ gensupport.URLParams
  8993. ctx_ context.Context
  8994. header_ http.Header
  8995. }
  8996. // Patch: Updates the specified context.
  8997. func (r *ProjectsAgentEnvironmentsUsersSessionsContextsService) Patch(nameid string, googleclouddialogflowv2beta1context *GoogleCloudDialogflowV2beta1Context) *ProjectsAgentEnvironmentsUsersSessionsContextsPatchCall {
  8998. c := &ProjectsAgentEnvironmentsUsersSessionsContextsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8999. c.nameid = nameid
  9000. c.googleclouddialogflowv2beta1context = googleclouddialogflowv2beta1context
  9001. return c
  9002. }
  9003. // UpdateMask sets the optional parameter "updateMask": The mask to
  9004. // control which fields get updated.
  9005. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsPatchCall) UpdateMask(updateMask string) *ProjectsAgentEnvironmentsUsersSessionsContextsPatchCall {
  9006. c.urlParams_.Set("updateMask", updateMask)
  9007. return c
  9008. }
  9009. // Fields allows partial responses to be retrieved. See
  9010. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9011. // for more information.
  9012. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsPatchCall) Fields(s ...googleapi.Field) *ProjectsAgentEnvironmentsUsersSessionsContextsPatchCall {
  9013. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9014. return c
  9015. }
  9016. // Context sets the context to be used in this call's Do method. Any
  9017. // pending HTTP request will be aborted if the provided context is
  9018. // canceled.
  9019. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsPatchCall) Context(ctx context.Context) *ProjectsAgentEnvironmentsUsersSessionsContextsPatchCall {
  9020. c.ctx_ = ctx
  9021. return c
  9022. }
  9023. // Header returns an http.Header that can be modified by the caller to
  9024. // add HTTP headers to the request.
  9025. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsPatchCall) Header() http.Header {
  9026. if c.header_ == nil {
  9027. c.header_ = make(http.Header)
  9028. }
  9029. return c.header_
  9030. }
  9031. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsPatchCall) doRequest(alt string) (*http.Response, error) {
  9032. reqHeaders := make(http.Header)
  9033. for k, v := range c.header_ {
  9034. reqHeaders[k] = v
  9035. }
  9036. reqHeaders.Set("User-Agent", c.s.userAgent())
  9037. var body io.Reader = nil
  9038. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1context)
  9039. if err != nil {
  9040. return nil, err
  9041. }
  9042. reqHeaders.Set("Content-Type", "application/json")
  9043. c.urlParams_.Set("alt", alt)
  9044. c.urlParams_.Set("prettyPrint", "false")
  9045. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  9046. urls += "?" + c.urlParams_.Encode()
  9047. req, err := http.NewRequest("PATCH", urls, body)
  9048. if err != nil {
  9049. return nil, err
  9050. }
  9051. req.Header = reqHeaders
  9052. googleapi.Expand(req.URL, map[string]string{
  9053. "name": c.nameid,
  9054. })
  9055. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9056. }
  9057. // Do executes the "dialogflow.projects.agent.environments.users.sessions.contexts.patch" call.
  9058. // Exactly one of *GoogleCloudDialogflowV2beta1Context or error will be
  9059. // non-nil. Any non-2xx status code is an error. Response headers are in
  9060. // either *GoogleCloudDialogflowV2beta1Context.ServerResponse.Header or
  9061. // (if a response was returned at all) in
  9062. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9063. // whether the returned error was because http.StatusNotModified was
  9064. // returned.
  9065. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1Context, error) {
  9066. gensupport.SetOptions(c.urlParams_, opts...)
  9067. res, err := c.doRequest("json")
  9068. if res != nil && res.StatusCode == http.StatusNotModified {
  9069. if res.Body != nil {
  9070. res.Body.Close()
  9071. }
  9072. return nil, &googleapi.Error{
  9073. Code: res.StatusCode,
  9074. Header: res.Header,
  9075. }
  9076. }
  9077. if err != nil {
  9078. return nil, err
  9079. }
  9080. defer googleapi.CloseBody(res)
  9081. if err := googleapi.CheckResponse(res); err != nil {
  9082. return nil, err
  9083. }
  9084. ret := &GoogleCloudDialogflowV2beta1Context{
  9085. ServerResponse: googleapi.ServerResponse{
  9086. Header: res.Header,
  9087. HTTPStatusCode: res.StatusCode,
  9088. },
  9089. }
  9090. target := &ret
  9091. if err := gensupport.DecodeResponse(target, res); err != nil {
  9092. return nil, err
  9093. }
  9094. return ret, nil
  9095. // {
  9096. // "description": "Updates the specified context.",
  9097. // "flatPath": "v2beta1/projects/{projectsId}/agent/environments/{environmentsId}/users/{usersId}/sessions/{sessionsId}/contexts/{contextsId}",
  9098. // "httpMethod": "PATCH",
  9099. // "id": "dialogflow.projects.agent.environments.users.sessions.contexts.patch",
  9100. // "parameterOrder": [
  9101. // "name"
  9102. // ],
  9103. // "parameters": {
  9104. // "name": {
  9105. // "description": "Required. The unique identifier of the context. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e/contexts/\u003cContext ID\u003e`,\nor `projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment ID\u003e/users/\u003cUser\nID\u003e/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.\n\nIf `Environment ID` is not specified, we assume default 'draft'\nenvironment. If `User ID` is not specified, we assume default '-' user.",
  9106. // "location": "path",
  9107. // "pattern": "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/contexts/[^/]+$",
  9108. // "required": true,
  9109. // "type": "string"
  9110. // },
  9111. // "updateMask": {
  9112. // "description": "Optional. The mask to control which fields get updated.",
  9113. // "format": "google-fieldmask",
  9114. // "location": "query",
  9115. // "type": "string"
  9116. // }
  9117. // },
  9118. // "path": "v2beta1/{+name}",
  9119. // "request": {
  9120. // "$ref": "GoogleCloudDialogflowV2beta1Context"
  9121. // },
  9122. // "response": {
  9123. // "$ref": "GoogleCloudDialogflowV2beta1Context"
  9124. // },
  9125. // "scopes": [
  9126. // "https://www.googleapis.com/auth/cloud-platform",
  9127. // "https://www.googleapis.com/auth/dialogflow"
  9128. // ]
  9129. // }
  9130. }
  9131. // method id "dialogflow.projects.agent.environments.users.sessions.entityTypes.create":
  9132. type ProjectsAgentEnvironmentsUsersSessionsEntityTypesCreateCall struct {
  9133. s *Service
  9134. parent string
  9135. googleclouddialogflowv2beta1sessionentitytype *GoogleCloudDialogflowV2beta1SessionEntityType
  9136. urlParams_ gensupport.URLParams
  9137. ctx_ context.Context
  9138. header_ http.Header
  9139. }
  9140. // Create: Creates a session entity type.
  9141. //
  9142. // If the specified session entity type already exists, overrides
  9143. // the
  9144. // session entity type.
  9145. func (r *ProjectsAgentEnvironmentsUsersSessionsEntityTypesService) Create(parent string, googleclouddialogflowv2beta1sessionentitytype *GoogleCloudDialogflowV2beta1SessionEntityType) *ProjectsAgentEnvironmentsUsersSessionsEntityTypesCreateCall {
  9146. c := &ProjectsAgentEnvironmentsUsersSessionsEntityTypesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9147. c.parent = parent
  9148. c.googleclouddialogflowv2beta1sessionentitytype = googleclouddialogflowv2beta1sessionentitytype
  9149. return c
  9150. }
  9151. // Fields allows partial responses to be retrieved. See
  9152. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9153. // for more information.
  9154. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesCreateCall) Fields(s ...googleapi.Field) *ProjectsAgentEnvironmentsUsersSessionsEntityTypesCreateCall {
  9155. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9156. return c
  9157. }
  9158. // Context sets the context to be used in this call's Do method. Any
  9159. // pending HTTP request will be aborted if the provided context is
  9160. // canceled.
  9161. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesCreateCall) Context(ctx context.Context) *ProjectsAgentEnvironmentsUsersSessionsEntityTypesCreateCall {
  9162. c.ctx_ = ctx
  9163. return c
  9164. }
  9165. // Header returns an http.Header that can be modified by the caller to
  9166. // add HTTP headers to the request.
  9167. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesCreateCall) Header() http.Header {
  9168. if c.header_ == nil {
  9169. c.header_ = make(http.Header)
  9170. }
  9171. return c.header_
  9172. }
  9173. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesCreateCall) doRequest(alt string) (*http.Response, error) {
  9174. reqHeaders := make(http.Header)
  9175. for k, v := range c.header_ {
  9176. reqHeaders[k] = v
  9177. }
  9178. reqHeaders.Set("User-Agent", c.s.userAgent())
  9179. var body io.Reader = nil
  9180. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1sessionentitytype)
  9181. if err != nil {
  9182. return nil, err
  9183. }
  9184. reqHeaders.Set("Content-Type", "application/json")
  9185. c.urlParams_.Set("alt", alt)
  9186. c.urlParams_.Set("prettyPrint", "false")
  9187. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/entityTypes")
  9188. urls += "?" + c.urlParams_.Encode()
  9189. req, err := http.NewRequest("POST", urls, body)
  9190. if err != nil {
  9191. return nil, err
  9192. }
  9193. req.Header = reqHeaders
  9194. googleapi.Expand(req.URL, map[string]string{
  9195. "parent": c.parent,
  9196. })
  9197. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9198. }
  9199. // Do executes the "dialogflow.projects.agent.environments.users.sessions.entityTypes.create" call.
  9200. // Exactly one of *GoogleCloudDialogflowV2beta1SessionEntityType or
  9201. // error will be non-nil. Any non-2xx status code is an error. Response
  9202. // headers are in either
  9203. // *GoogleCloudDialogflowV2beta1SessionEntityType.ServerResponse.Header
  9204. // or (if a response was returned at all) in
  9205. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9206. // whether the returned error was because http.StatusNotModified was
  9207. // returned.
  9208. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1SessionEntityType, error) {
  9209. gensupport.SetOptions(c.urlParams_, opts...)
  9210. res, err := c.doRequest("json")
  9211. if res != nil && res.StatusCode == http.StatusNotModified {
  9212. if res.Body != nil {
  9213. res.Body.Close()
  9214. }
  9215. return nil, &googleapi.Error{
  9216. Code: res.StatusCode,
  9217. Header: res.Header,
  9218. }
  9219. }
  9220. if err != nil {
  9221. return nil, err
  9222. }
  9223. defer googleapi.CloseBody(res)
  9224. if err := googleapi.CheckResponse(res); err != nil {
  9225. return nil, err
  9226. }
  9227. ret := &GoogleCloudDialogflowV2beta1SessionEntityType{
  9228. ServerResponse: googleapi.ServerResponse{
  9229. Header: res.Header,
  9230. HTTPStatusCode: res.StatusCode,
  9231. },
  9232. }
  9233. target := &ret
  9234. if err := gensupport.DecodeResponse(target, res); err != nil {
  9235. return nil, err
  9236. }
  9237. return ret, nil
  9238. // {
  9239. // "description": "Creates a session entity type.\n\nIf the specified session entity type already exists, overrides the\nsession entity type.",
  9240. // "flatPath": "v2beta1/projects/{projectsId}/agent/environments/{environmentsId}/users/{usersId}/sessions/{sessionsId}/entityTypes",
  9241. // "httpMethod": "POST",
  9242. // "id": "dialogflow.projects.agent.environments.users.sessions.entityTypes.create",
  9243. // "parameterOrder": [
  9244. // "parent"
  9245. // ],
  9246. // "parameters": {
  9247. // "parent": {
  9248. // "description": "Required. The session to create a session entity type for.\nFormat: `projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e` or\n`projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment ID\u003e/users/\u003cUser ID\u003e/\nsessions/\u003cSession ID\u003e`. If `Environment ID` is not specified, we assume\ndefault 'draft' environment. If `User ID` is not specified, we assume\ndefault '-' user.",
  9249. // "location": "path",
  9250. // "pattern": "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+$",
  9251. // "required": true,
  9252. // "type": "string"
  9253. // }
  9254. // },
  9255. // "path": "v2beta1/{+parent}/entityTypes",
  9256. // "request": {
  9257. // "$ref": "GoogleCloudDialogflowV2beta1SessionEntityType"
  9258. // },
  9259. // "response": {
  9260. // "$ref": "GoogleCloudDialogflowV2beta1SessionEntityType"
  9261. // },
  9262. // "scopes": [
  9263. // "https://www.googleapis.com/auth/cloud-platform",
  9264. // "https://www.googleapis.com/auth/dialogflow"
  9265. // ]
  9266. // }
  9267. }
  9268. // method id "dialogflow.projects.agent.environments.users.sessions.entityTypes.delete":
  9269. type ProjectsAgentEnvironmentsUsersSessionsEntityTypesDeleteCall struct {
  9270. s *Service
  9271. name string
  9272. urlParams_ gensupport.URLParams
  9273. ctx_ context.Context
  9274. header_ http.Header
  9275. }
  9276. // Delete: Deletes the specified session entity type.
  9277. func (r *ProjectsAgentEnvironmentsUsersSessionsEntityTypesService) Delete(name string) *ProjectsAgentEnvironmentsUsersSessionsEntityTypesDeleteCall {
  9278. c := &ProjectsAgentEnvironmentsUsersSessionsEntityTypesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9279. c.name = name
  9280. return c
  9281. }
  9282. // Fields allows partial responses to be retrieved. See
  9283. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9284. // for more information.
  9285. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesDeleteCall) Fields(s ...googleapi.Field) *ProjectsAgentEnvironmentsUsersSessionsEntityTypesDeleteCall {
  9286. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9287. return c
  9288. }
  9289. // Context sets the context to be used in this call's Do method. Any
  9290. // pending HTTP request will be aborted if the provided context is
  9291. // canceled.
  9292. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesDeleteCall) Context(ctx context.Context) *ProjectsAgentEnvironmentsUsersSessionsEntityTypesDeleteCall {
  9293. c.ctx_ = ctx
  9294. return c
  9295. }
  9296. // Header returns an http.Header that can be modified by the caller to
  9297. // add HTTP headers to the request.
  9298. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesDeleteCall) Header() http.Header {
  9299. if c.header_ == nil {
  9300. c.header_ = make(http.Header)
  9301. }
  9302. return c.header_
  9303. }
  9304. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesDeleteCall) doRequest(alt string) (*http.Response, error) {
  9305. reqHeaders := make(http.Header)
  9306. for k, v := range c.header_ {
  9307. reqHeaders[k] = v
  9308. }
  9309. reqHeaders.Set("User-Agent", c.s.userAgent())
  9310. var body io.Reader = nil
  9311. c.urlParams_.Set("alt", alt)
  9312. c.urlParams_.Set("prettyPrint", "false")
  9313. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  9314. urls += "?" + c.urlParams_.Encode()
  9315. req, err := http.NewRequest("DELETE", urls, body)
  9316. if err != nil {
  9317. return nil, err
  9318. }
  9319. req.Header = reqHeaders
  9320. googleapi.Expand(req.URL, map[string]string{
  9321. "name": c.name,
  9322. })
  9323. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9324. }
  9325. // Do executes the "dialogflow.projects.agent.environments.users.sessions.entityTypes.delete" call.
  9326. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  9327. // non-2xx status code is an error. Response headers are in either
  9328. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  9329. // returned at all) in error.(*googleapi.Error).Header. Use
  9330. // googleapi.IsNotModified to check whether the returned error was
  9331. // because http.StatusNotModified was returned.
  9332. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  9333. gensupport.SetOptions(c.urlParams_, opts...)
  9334. res, err := c.doRequest("json")
  9335. if res != nil && res.StatusCode == http.StatusNotModified {
  9336. if res.Body != nil {
  9337. res.Body.Close()
  9338. }
  9339. return nil, &googleapi.Error{
  9340. Code: res.StatusCode,
  9341. Header: res.Header,
  9342. }
  9343. }
  9344. if err != nil {
  9345. return nil, err
  9346. }
  9347. defer googleapi.CloseBody(res)
  9348. if err := googleapi.CheckResponse(res); err != nil {
  9349. return nil, err
  9350. }
  9351. ret := &GoogleProtobufEmpty{
  9352. ServerResponse: googleapi.ServerResponse{
  9353. Header: res.Header,
  9354. HTTPStatusCode: res.StatusCode,
  9355. },
  9356. }
  9357. target := &ret
  9358. if err := gensupport.DecodeResponse(target, res); err != nil {
  9359. return nil, err
  9360. }
  9361. return ret, nil
  9362. // {
  9363. // "description": "Deletes the specified session entity type.",
  9364. // "flatPath": "v2beta1/projects/{projectsId}/agent/environments/{environmentsId}/users/{usersId}/sessions/{sessionsId}/entityTypes/{entityTypesId}",
  9365. // "httpMethod": "DELETE",
  9366. // "id": "dialogflow.projects.agent.environments.users.sessions.entityTypes.delete",
  9367. // "parameterOrder": [
  9368. // "name"
  9369. // ],
  9370. // "parameters": {
  9371. // "name": {
  9372. // "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` or `projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment\nID\u003e/users/\u003cUser ID\u003e/sessions/\u003cSession ID\u003e/entityTypes/\u003cEntity Type Display\nName\u003e`. If `Environment ID` is not specified, we assume default 'draft'\nenvironment. If `User ID` is not specified, we assume default '-' user.",
  9373. // "location": "path",
  9374. // "pattern": "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/entityTypes/[^/]+$",
  9375. // "required": true,
  9376. // "type": "string"
  9377. // }
  9378. // },
  9379. // "path": "v2beta1/{+name}",
  9380. // "response": {
  9381. // "$ref": "GoogleProtobufEmpty"
  9382. // },
  9383. // "scopes": [
  9384. // "https://www.googleapis.com/auth/cloud-platform",
  9385. // "https://www.googleapis.com/auth/dialogflow"
  9386. // ]
  9387. // }
  9388. }
  9389. // method id "dialogflow.projects.agent.environments.users.sessions.entityTypes.get":
  9390. type ProjectsAgentEnvironmentsUsersSessionsEntityTypesGetCall struct {
  9391. s *Service
  9392. name string
  9393. urlParams_ gensupport.URLParams
  9394. ifNoneMatch_ string
  9395. ctx_ context.Context
  9396. header_ http.Header
  9397. }
  9398. // Get: Retrieves the specified session entity type.
  9399. func (r *ProjectsAgentEnvironmentsUsersSessionsEntityTypesService) Get(name string) *ProjectsAgentEnvironmentsUsersSessionsEntityTypesGetCall {
  9400. c := &ProjectsAgentEnvironmentsUsersSessionsEntityTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9401. c.name = name
  9402. return c
  9403. }
  9404. // Fields allows partial responses to be retrieved. See
  9405. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9406. // for more information.
  9407. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesGetCall) Fields(s ...googleapi.Field) *ProjectsAgentEnvironmentsUsersSessionsEntityTypesGetCall {
  9408. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9409. return c
  9410. }
  9411. // IfNoneMatch sets the optional parameter which makes the operation
  9412. // fail if the object's ETag matches the given value. This is useful for
  9413. // getting updates only after the object has changed since the last
  9414. // request. Use googleapi.IsNotModified to check whether the response
  9415. // error from Do is the result of In-None-Match.
  9416. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesGetCall) IfNoneMatch(entityTag string) *ProjectsAgentEnvironmentsUsersSessionsEntityTypesGetCall {
  9417. c.ifNoneMatch_ = entityTag
  9418. return c
  9419. }
  9420. // Context sets the context to be used in this call's Do method. Any
  9421. // pending HTTP request will be aborted if the provided context is
  9422. // canceled.
  9423. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesGetCall) Context(ctx context.Context) *ProjectsAgentEnvironmentsUsersSessionsEntityTypesGetCall {
  9424. c.ctx_ = ctx
  9425. return c
  9426. }
  9427. // Header returns an http.Header that can be modified by the caller to
  9428. // add HTTP headers to the request.
  9429. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesGetCall) Header() http.Header {
  9430. if c.header_ == nil {
  9431. c.header_ = make(http.Header)
  9432. }
  9433. return c.header_
  9434. }
  9435. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesGetCall) doRequest(alt string) (*http.Response, error) {
  9436. reqHeaders := make(http.Header)
  9437. for k, v := range c.header_ {
  9438. reqHeaders[k] = v
  9439. }
  9440. reqHeaders.Set("User-Agent", c.s.userAgent())
  9441. if c.ifNoneMatch_ != "" {
  9442. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9443. }
  9444. var body io.Reader = nil
  9445. c.urlParams_.Set("alt", alt)
  9446. c.urlParams_.Set("prettyPrint", "false")
  9447. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  9448. urls += "?" + c.urlParams_.Encode()
  9449. req, err := http.NewRequest("GET", urls, body)
  9450. if err != nil {
  9451. return nil, err
  9452. }
  9453. req.Header = reqHeaders
  9454. googleapi.Expand(req.URL, map[string]string{
  9455. "name": c.name,
  9456. })
  9457. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9458. }
  9459. // Do executes the "dialogflow.projects.agent.environments.users.sessions.entityTypes.get" call.
  9460. // Exactly one of *GoogleCloudDialogflowV2beta1SessionEntityType or
  9461. // error will be non-nil. Any non-2xx status code is an error. Response
  9462. // headers are in either
  9463. // *GoogleCloudDialogflowV2beta1SessionEntityType.ServerResponse.Header
  9464. // or (if a response was returned at all) in
  9465. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9466. // whether the returned error was because http.StatusNotModified was
  9467. // returned.
  9468. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1SessionEntityType, error) {
  9469. gensupport.SetOptions(c.urlParams_, opts...)
  9470. res, err := c.doRequest("json")
  9471. if res != nil && res.StatusCode == http.StatusNotModified {
  9472. if res.Body != nil {
  9473. res.Body.Close()
  9474. }
  9475. return nil, &googleapi.Error{
  9476. Code: res.StatusCode,
  9477. Header: res.Header,
  9478. }
  9479. }
  9480. if err != nil {
  9481. return nil, err
  9482. }
  9483. defer googleapi.CloseBody(res)
  9484. if err := googleapi.CheckResponse(res); err != nil {
  9485. return nil, err
  9486. }
  9487. ret := &GoogleCloudDialogflowV2beta1SessionEntityType{
  9488. ServerResponse: googleapi.ServerResponse{
  9489. Header: res.Header,
  9490. HTTPStatusCode: res.StatusCode,
  9491. },
  9492. }
  9493. target := &ret
  9494. if err := gensupport.DecodeResponse(target, res); err != nil {
  9495. return nil, err
  9496. }
  9497. return ret, nil
  9498. // {
  9499. // "description": "Retrieves the specified session entity type.",
  9500. // "flatPath": "v2beta1/projects/{projectsId}/agent/environments/{environmentsId}/users/{usersId}/sessions/{sessionsId}/entityTypes/{entityTypesId}",
  9501. // "httpMethod": "GET",
  9502. // "id": "dialogflow.projects.agent.environments.users.sessions.entityTypes.get",
  9503. // "parameterOrder": [
  9504. // "name"
  9505. // ],
  9506. // "parameters": {
  9507. // "name": {
  9508. // "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` or `projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment\nID\u003e/users/\u003cUser ID\u003e/sessions/\u003cSession ID\u003e/entityTypes/\u003cEntity Type Display\nName\u003e`. If `Environment ID` is not specified, we assume default 'draft'\nenvironment. If `User ID` is not specified, we assume default '-' user.",
  9509. // "location": "path",
  9510. // "pattern": "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/entityTypes/[^/]+$",
  9511. // "required": true,
  9512. // "type": "string"
  9513. // }
  9514. // },
  9515. // "path": "v2beta1/{+name}",
  9516. // "response": {
  9517. // "$ref": "GoogleCloudDialogflowV2beta1SessionEntityType"
  9518. // },
  9519. // "scopes": [
  9520. // "https://www.googleapis.com/auth/cloud-platform",
  9521. // "https://www.googleapis.com/auth/dialogflow"
  9522. // ]
  9523. // }
  9524. }
  9525. // method id "dialogflow.projects.agent.environments.users.sessions.entityTypes.list":
  9526. type ProjectsAgentEnvironmentsUsersSessionsEntityTypesListCall struct {
  9527. s *Service
  9528. parent string
  9529. urlParams_ gensupport.URLParams
  9530. ifNoneMatch_ string
  9531. ctx_ context.Context
  9532. header_ http.Header
  9533. }
  9534. // List: Returns the list of all session entity types in the specified
  9535. // session.
  9536. func (r *ProjectsAgentEnvironmentsUsersSessionsEntityTypesService) List(parent string) *ProjectsAgentEnvironmentsUsersSessionsEntityTypesListCall {
  9537. c := &ProjectsAgentEnvironmentsUsersSessionsEntityTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9538. c.parent = parent
  9539. return c
  9540. }
  9541. // PageSize sets the optional parameter "pageSize": The maximum number
  9542. // of items to return in a single page. By
  9543. // default 100 and at most 1000.
  9544. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesListCall) PageSize(pageSize int64) *ProjectsAgentEnvironmentsUsersSessionsEntityTypesListCall {
  9545. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  9546. return c
  9547. }
  9548. // PageToken sets the optional parameter "pageToken": The
  9549. // next_page_token value returned from a previous list request.
  9550. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesListCall) PageToken(pageToken string) *ProjectsAgentEnvironmentsUsersSessionsEntityTypesListCall {
  9551. c.urlParams_.Set("pageToken", pageToken)
  9552. return c
  9553. }
  9554. // Fields allows partial responses to be retrieved. See
  9555. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9556. // for more information.
  9557. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesListCall) Fields(s ...googleapi.Field) *ProjectsAgentEnvironmentsUsersSessionsEntityTypesListCall {
  9558. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9559. return c
  9560. }
  9561. // IfNoneMatch sets the optional parameter which makes the operation
  9562. // fail if the object's ETag matches the given value. This is useful for
  9563. // getting updates only after the object has changed since the last
  9564. // request. Use googleapi.IsNotModified to check whether the response
  9565. // error from Do is the result of In-None-Match.
  9566. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesListCall) IfNoneMatch(entityTag string) *ProjectsAgentEnvironmentsUsersSessionsEntityTypesListCall {
  9567. c.ifNoneMatch_ = entityTag
  9568. return c
  9569. }
  9570. // Context sets the context to be used in this call's Do method. Any
  9571. // pending HTTP request will be aborted if the provided context is
  9572. // canceled.
  9573. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesListCall) Context(ctx context.Context) *ProjectsAgentEnvironmentsUsersSessionsEntityTypesListCall {
  9574. c.ctx_ = ctx
  9575. return c
  9576. }
  9577. // Header returns an http.Header that can be modified by the caller to
  9578. // add HTTP headers to the request.
  9579. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesListCall) Header() http.Header {
  9580. if c.header_ == nil {
  9581. c.header_ = make(http.Header)
  9582. }
  9583. return c.header_
  9584. }
  9585. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesListCall) doRequest(alt string) (*http.Response, error) {
  9586. reqHeaders := make(http.Header)
  9587. for k, v := range c.header_ {
  9588. reqHeaders[k] = v
  9589. }
  9590. reqHeaders.Set("User-Agent", c.s.userAgent())
  9591. if c.ifNoneMatch_ != "" {
  9592. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9593. }
  9594. var body io.Reader = nil
  9595. c.urlParams_.Set("alt", alt)
  9596. c.urlParams_.Set("prettyPrint", "false")
  9597. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/entityTypes")
  9598. urls += "?" + c.urlParams_.Encode()
  9599. req, err := http.NewRequest("GET", urls, body)
  9600. if err != nil {
  9601. return nil, err
  9602. }
  9603. req.Header = reqHeaders
  9604. googleapi.Expand(req.URL, map[string]string{
  9605. "parent": c.parent,
  9606. })
  9607. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9608. }
  9609. // Do executes the "dialogflow.projects.agent.environments.users.sessions.entityTypes.list" call.
  9610. // Exactly one of
  9611. // *GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse or error
  9612. // will be non-nil. Any non-2xx status code is an error. Response
  9613. // headers are in either
  9614. // *GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse.ServerResp
  9615. // onse.Header or (if a response was returned at all) in
  9616. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9617. // whether the returned error was because http.StatusNotModified was
  9618. // returned.
  9619. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse, error) {
  9620. gensupport.SetOptions(c.urlParams_, opts...)
  9621. res, err := c.doRequest("json")
  9622. if res != nil && res.StatusCode == http.StatusNotModified {
  9623. if res.Body != nil {
  9624. res.Body.Close()
  9625. }
  9626. return nil, &googleapi.Error{
  9627. Code: res.StatusCode,
  9628. Header: res.Header,
  9629. }
  9630. }
  9631. if err != nil {
  9632. return nil, err
  9633. }
  9634. defer googleapi.CloseBody(res)
  9635. if err := googleapi.CheckResponse(res); err != nil {
  9636. return nil, err
  9637. }
  9638. ret := &GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse{
  9639. ServerResponse: googleapi.ServerResponse{
  9640. Header: res.Header,
  9641. HTTPStatusCode: res.StatusCode,
  9642. },
  9643. }
  9644. target := &ret
  9645. if err := gensupport.DecodeResponse(target, res); err != nil {
  9646. return nil, err
  9647. }
  9648. return ret, nil
  9649. // {
  9650. // "description": "Returns the list of all session entity types in the specified session.",
  9651. // "flatPath": "v2beta1/projects/{projectsId}/agent/environments/{environmentsId}/users/{usersId}/sessions/{sessionsId}/entityTypes",
  9652. // "httpMethod": "GET",
  9653. // "id": "dialogflow.projects.agent.environments.users.sessions.entityTypes.list",
  9654. // "parameterOrder": [
  9655. // "parent"
  9656. // ],
  9657. // "parameters": {
  9658. // "pageSize": {
  9659. // "description": "Optional. The maximum number of items to return in a single page. By\ndefault 100 and at most 1000.",
  9660. // "format": "int32",
  9661. // "location": "query",
  9662. // "type": "integer"
  9663. // },
  9664. // "pageToken": {
  9665. // "description": "Optional. The next_page_token value returned from a previous list request.",
  9666. // "location": "query",
  9667. // "type": "string"
  9668. // },
  9669. // "parent": {
  9670. // "description": "Required. The session to list all session entity types from.\nFormat: `projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e` or\n`projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment ID\u003e/users/\u003cUser ID\u003e/\nsessions/\u003cSession ID\u003e`.\nIf `Environment ID` is not specified, we assume default 'draft'\nenvironment. If `User ID` is not specified, we assume default '-' user.",
  9671. // "location": "path",
  9672. // "pattern": "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+$",
  9673. // "required": true,
  9674. // "type": "string"
  9675. // }
  9676. // },
  9677. // "path": "v2beta1/{+parent}/entityTypes",
  9678. // "response": {
  9679. // "$ref": "GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse"
  9680. // },
  9681. // "scopes": [
  9682. // "https://www.googleapis.com/auth/cloud-platform",
  9683. // "https://www.googleapis.com/auth/dialogflow"
  9684. // ]
  9685. // }
  9686. }
  9687. // Pages invokes f for each page of results.
  9688. // A non-nil error returned from f will halt the iteration.
  9689. // The provided context supersedes any context provided to the Context method.
  9690. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesListCall) Pages(ctx context.Context, f func(*GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse) error) error {
  9691. c.ctx_ = ctx
  9692. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  9693. for {
  9694. x, err := c.Do()
  9695. if err != nil {
  9696. return err
  9697. }
  9698. if err := f(x); err != nil {
  9699. return err
  9700. }
  9701. if x.NextPageToken == "" {
  9702. return nil
  9703. }
  9704. c.PageToken(x.NextPageToken)
  9705. }
  9706. }
  9707. // method id "dialogflow.projects.agent.environments.users.sessions.entityTypes.patch":
  9708. type ProjectsAgentEnvironmentsUsersSessionsEntityTypesPatchCall struct {
  9709. s *Service
  9710. nameid string
  9711. googleclouddialogflowv2beta1sessionentitytype *GoogleCloudDialogflowV2beta1SessionEntityType
  9712. urlParams_ gensupport.URLParams
  9713. ctx_ context.Context
  9714. header_ http.Header
  9715. }
  9716. // Patch: Updates the specified session entity type.
  9717. func (r *ProjectsAgentEnvironmentsUsersSessionsEntityTypesService) Patch(nameid string, googleclouddialogflowv2beta1sessionentitytype *GoogleCloudDialogflowV2beta1SessionEntityType) *ProjectsAgentEnvironmentsUsersSessionsEntityTypesPatchCall {
  9718. c := &ProjectsAgentEnvironmentsUsersSessionsEntityTypesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9719. c.nameid = nameid
  9720. c.googleclouddialogflowv2beta1sessionentitytype = googleclouddialogflowv2beta1sessionentitytype
  9721. return c
  9722. }
  9723. // UpdateMask sets the optional parameter "updateMask": The mask to
  9724. // control which fields get updated.
  9725. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesPatchCall) UpdateMask(updateMask string) *ProjectsAgentEnvironmentsUsersSessionsEntityTypesPatchCall {
  9726. c.urlParams_.Set("updateMask", updateMask)
  9727. return c
  9728. }
  9729. // Fields allows partial responses to be retrieved. See
  9730. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9731. // for more information.
  9732. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesPatchCall) Fields(s ...googleapi.Field) *ProjectsAgentEnvironmentsUsersSessionsEntityTypesPatchCall {
  9733. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9734. return c
  9735. }
  9736. // Context sets the context to be used in this call's Do method. Any
  9737. // pending HTTP request will be aborted if the provided context is
  9738. // canceled.
  9739. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesPatchCall) Context(ctx context.Context) *ProjectsAgentEnvironmentsUsersSessionsEntityTypesPatchCall {
  9740. c.ctx_ = ctx
  9741. return c
  9742. }
  9743. // Header returns an http.Header that can be modified by the caller to
  9744. // add HTTP headers to the request.
  9745. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesPatchCall) Header() http.Header {
  9746. if c.header_ == nil {
  9747. c.header_ = make(http.Header)
  9748. }
  9749. return c.header_
  9750. }
  9751. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesPatchCall) doRequest(alt string) (*http.Response, error) {
  9752. reqHeaders := make(http.Header)
  9753. for k, v := range c.header_ {
  9754. reqHeaders[k] = v
  9755. }
  9756. reqHeaders.Set("User-Agent", c.s.userAgent())
  9757. var body io.Reader = nil
  9758. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1sessionentitytype)
  9759. if err != nil {
  9760. return nil, err
  9761. }
  9762. reqHeaders.Set("Content-Type", "application/json")
  9763. c.urlParams_.Set("alt", alt)
  9764. c.urlParams_.Set("prettyPrint", "false")
  9765. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  9766. urls += "?" + c.urlParams_.Encode()
  9767. req, err := http.NewRequest("PATCH", urls, body)
  9768. if err != nil {
  9769. return nil, err
  9770. }
  9771. req.Header = reqHeaders
  9772. googleapi.Expand(req.URL, map[string]string{
  9773. "name": c.nameid,
  9774. })
  9775. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9776. }
  9777. // Do executes the "dialogflow.projects.agent.environments.users.sessions.entityTypes.patch" call.
  9778. // Exactly one of *GoogleCloudDialogflowV2beta1SessionEntityType or
  9779. // error will be non-nil. Any non-2xx status code is an error. Response
  9780. // headers are in either
  9781. // *GoogleCloudDialogflowV2beta1SessionEntityType.ServerResponse.Header
  9782. // or (if a response was returned at all) in
  9783. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9784. // whether the returned error was because http.StatusNotModified was
  9785. // returned.
  9786. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1SessionEntityType, error) {
  9787. gensupport.SetOptions(c.urlParams_, opts...)
  9788. res, err := c.doRequest("json")
  9789. if res != nil && res.StatusCode == http.StatusNotModified {
  9790. if res.Body != nil {
  9791. res.Body.Close()
  9792. }
  9793. return nil, &googleapi.Error{
  9794. Code: res.StatusCode,
  9795. Header: res.Header,
  9796. }
  9797. }
  9798. if err != nil {
  9799. return nil, err
  9800. }
  9801. defer googleapi.CloseBody(res)
  9802. if err := googleapi.CheckResponse(res); err != nil {
  9803. return nil, err
  9804. }
  9805. ret := &GoogleCloudDialogflowV2beta1SessionEntityType{
  9806. ServerResponse: googleapi.ServerResponse{
  9807. Header: res.Header,
  9808. HTTPStatusCode: res.StatusCode,
  9809. },
  9810. }
  9811. target := &ret
  9812. if err := gensupport.DecodeResponse(target, res); err != nil {
  9813. return nil, err
  9814. }
  9815. return ret, nil
  9816. // {
  9817. // "description": "Updates the specified session entity type.",
  9818. // "flatPath": "v2beta1/projects/{projectsId}/agent/environments/{environmentsId}/users/{usersId}/sessions/{sessionsId}/entityTypes/{entityTypesId}",
  9819. // "httpMethod": "PATCH",
  9820. // "id": "dialogflow.projects.agent.environments.users.sessions.entityTypes.patch",
  9821. // "parameterOrder": [
  9822. // "name"
  9823. // ],
  9824. // "parameters": {
  9825. // "name": {
  9826. // "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`, or\n`projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment ID\u003e/users/\u003cUser\nID\u003e/sessions/\u003cSession ID\u003e/entityTypes/\u003cEntity Type Display Name\u003e`.\nIf `Environment ID` is not specified, we assume default 'draft'\nenvironment. If `User ID` is not specified, we assume default '-' user.\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.",
  9827. // "location": "path",
  9828. // "pattern": "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/entityTypes/[^/]+$",
  9829. // "required": true,
  9830. // "type": "string"
  9831. // },
  9832. // "updateMask": {
  9833. // "description": "Optional. The mask to control which fields get updated.",
  9834. // "format": "google-fieldmask",
  9835. // "location": "query",
  9836. // "type": "string"
  9837. // }
  9838. // },
  9839. // "path": "v2beta1/{+name}",
  9840. // "request": {
  9841. // "$ref": "GoogleCloudDialogflowV2beta1SessionEntityType"
  9842. // },
  9843. // "response": {
  9844. // "$ref": "GoogleCloudDialogflowV2beta1SessionEntityType"
  9845. // },
  9846. // "scopes": [
  9847. // "https://www.googleapis.com/auth/cloud-platform",
  9848. // "https://www.googleapis.com/auth/dialogflow"
  9849. // ]
  9850. // }
  9851. }
  9852. // method id "dialogflow.projects.agent.intents.batchDelete":
  9853. type ProjectsAgentIntentsBatchDeleteCall struct {
  9854. s *Service
  9855. parent string
  9856. googleclouddialogflowv2beta1batchdeleteintentsrequest *GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest
  9857. urlParams_ gensupport.URLParams
  9858. ctx_ context.Context
  9859. header_ http.Header
  9860. }
  9861. // BatchDelete: Deletes intents in the specified agent.
  9862. //
  9863. // Operation <response: google.protobuf.Empty>
  9864. func (r *ProjectsAgentIntentsService) BatchDelete(parent string, googleclouddialogflowv2beta1batchdeleteintentsrequest *GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest) *ProjectsAgentIntentsBatchDeleteCall {
  9865. c := &ProjectsAgentIntentsBatchDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9866. c.parent = parent
  9867. c.googleclouddialogflowv2beta1batchdeleteintentsrequest = googleclouddialogflowv2beta1batchdeleteintentsrequest
  9868. return c
  9869. }
  9870. // Fields allows partial responses to be retrieved. See
  9871. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9872. // for more information.
  9873. func (c *ProjectsAgentIntentsBatchDeleteCall) Fields(s ...googleapi.Field) *ProjectsAgentIntentsBatchDeleteCall {
  9874. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9875. return c
  9876. }
  9877. // Context sets the context to be used in this call's Do method. Any
  9878. // pending HTTP request will be aborted if the provided context is
  9879. // canceled.
  9880. func (c *ProjectsAgentIntentsBatchDeleteCall) Context(ctx context.Context) *ProjectsAgentIntentsBatchDeleteCall {
  9881. c.ctx_ = ctx
  9882. return c
  9883. }
  9884. // Header returns an http.Header that can be modified by the caller to
  9885. // add HTTP headers to the request.
  9886. func (c *ProjectsAgentIntentsBatchDeleteCall) Header() http.Header {
  9887. if c.header_ == nil {
  9888. c.header_ = make(http.Header)
  9889. }
  9890. return c.header_
  9891. }
  9892. func (c *ProjectsAgentIntentsBatchDeleteCall) doRequest(alt string) (*http.Response, error) {
  9893. reqHeaders := make(http.Header)
  9894. for k, v := range c.header_ {
  9895. reqHeaders[k] = v
  9896. }
  9897. reqHeaders.Set("User-Agent", c.s.userAgent())
  9898. var body io.Reader = nil
  9899. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1batchdeleteintentsrequest)
  9900. if err != nil {
  9901. return nil, err
  9902. }
  9903. reqHeaders.Set("Content-Type", "application/json")
  9904. c.urlParams_.Set("alt", alt)
  9905. c.urlParams_.Set("prettyPrint", "false")
  9906. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/intents:batchDelete")
  9907. urls += "?" + c.urlParams_.Encode()
  9908. req, err := http.NewRequest("POST", urls, body)
  9909. if err != nil {
  9910. return nil, err
  9911. }
  9912. req.Header = reqHeaders
  9913. googleapi.Expand(req.URL, map[string]string{
  9914. "parent": c.parent,
  9915. })
  9916. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9917. }
  9918. // Do executes the "dialogflow.projects.agent.intents.batchDelete" call.
  9919. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  9920. // Any non-2xx status code is an error. Response headers are in either
  9921. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  9922. // was returned at all) in error.(*googleapi.Error).Header. Use
  9923. // googleapi.IsNotModified to check whether the returned error was
  9924. // because http.StatusNotModified was returned.
  9925. func (c *ProjectsAgentIntentsBatchDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  9926. gensupport.SetOptions(c.urlParams_, opts...)
  9927. res, err := c.doRequest("json")
  9928. if res != nil && res.StatusCode == http.StatusNotModified {
  9929. if res.Body != nil {
  9930. res.Body.Close()
  9931. }
  9932. return nil, &googleapi.Error{
  9933. Code: res.StatusCode,
  9934. Header: res.Header,
  9935. }
  9936. }
  9937. if err != nil {
  9938. return nil, err
  9939. }
  9940. defer googleapi.CloseBody(res)
  9941. if err := googleapi.CheckResponse(res); err != nil {
  9942. return nil, err
  9943. }
  9944. ret := &GoogleLongrunningOperation{
  9945. ServerResponse: googleapi.ServerResponse{
  9946. Header: res.Header,
  9947. HTTPStatusCode: res.StatusCode,
  9948. },
  9949. }
  9950. target := &ret
  9951. if err := gensupport.DecodeResponse(target, res); err != nil {
  9952. return nil, err
  9953. }
  9954. return ret, nil
  9955. // {
  9956. // "description": "Deletes intents in the specified agent.\n\nOperation \u003cresponse: google.protobuf.Empty\u003e",
  9957. // "flatPath": "v2beta1/projects/{projectsId}/agent/intents:batchDelete",
  9958. // "httpMethod": "POST",
  9959. // "id": "dialogflow.projects.agent.intents.batchDelete",
  9960. // "parameterOrder": [
  9961. // "parent"
  9962. // ],
  9963. // "parameters": {
  9964. // "parent": {
  9965. // "description": "Required. The name of the agent to delete all entities types for. Format:\n`projects/\u003cProject ID\u003e/agent`.",
  9966. // "location": "path",
  9967. // "pattern": "^projects/[^/]+/agent$",
  9968. // "required": true,
  9969. // "type": "string"
  9970. // }
  9971. // },
  9972. // "path": "v2beta1/{+parent}/intents:batchDelete",
  9973. // "request": {
  9974. // "$ref": "GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest"
  9975. // },
  9976. // "response": {
  9977. // "$ref": "GoogleLongrunningOperation"
  9978. // },
  9979. // "scopes": [
  9980. // "https://www.googleapis.com/auth/cloud-platform",
  9981. // "https://www.googleapis.com/auth/dialogflow"
  9982. // ]
  9983. // }
  9984. }
  9985. // method id "dialogflow.projects.agent.intents.batchUpdate":
  9986. type ProjectsAgentIntentsBatchUpdateCall struct {
  9987. s *Service
  9988. parent string
  9989. googleclouddialogflowv2beta1batchupdateintentsrequest *GoogleCloudDialogflowV2beta1BatchUpdateIntentsRequest
  9990. urlParams_ gensupport.URLParams
  9991. ctx_ context.Context
  9992. header_ http.Header
  9993. }
  9994. // BatchUpdate: Updates/Creates multiple intents in the specified
  9995. // agent.
  9996. //
  9997. // Operation <response: BatchUpdateIntentsResponse>
  9998. func (r *ProjectsAgentIntentsService) BatchUpdate(parent string, googleclouddialogflowv2beta1batchupdateintentsrequest *GoogleCloudDialogflowV2beta1BatchUpdateIntentsRequest) *ProjectsAgentIntentsBatchUpdateCall {
  9999. c := &ProjectsAgentIntentsBatchUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10000. c.parent = parent
  10001. c.googleclouddialogflowv2beta1batchupdateintentsrequest = googleclouddialogflowv2beta1batchupdateintentsrequest
  10002. return c
  10003. }
  10004. // Fields allows partial responses to be retrieved. See
  10005. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10006. // for more information.
  10007. func (c *ProjectsAgentIntentsBatchUpdateCall) Fields(s ...googleapi.Field) *ProjectsAgentIntentsBatchUpdateCall {
  10008. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10009. return c
  10010. }
  10011. // Context sets the context to be used in this call's Do method. Any
  10012. // pending HTTP request will be aborted if the provided context is
  10013. // canceled.
  10014. func (c *ProjectsAgentIntentsBatchUpdateCall) Context(ctx context.Context) *ProjectsAgentIntentsBatchUpdateCall {
  10015. c.ctx_ = ctx
  10016. return c
  10017. }
  10018. // Header returns an http.Header that can be modified by the caller to
  10019. // add HTTP headers to the request.
  10020. func (c *ProjectsAgentIntentsBatchUpdateCall) Header() http.Header {
  10021. if c.header_ == nil {
  10022. c.header_ = make(http.Header)
  10023. }
  10024. return c.header_
  10025. }
  10026. func (c *ProjectsAgentIntentsBatchUpdateCall) doRequest(alt string) (*http.Response, error) {
  10027. reqHeaders := make(http.Header)
  10028. for k, v := range c.header_ {
  10029. reqHeaders[k] = v
  10030. }
  10031. reqHeaders.Set("User-Agent", c.s.userAgent())
  10032. var body io.Reader = nil
  10033. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1batchupdateintentsrequest)
  10034. if err != nil {
  10035. return nil, err
  10036. }
  10037. reqHeaders.Set("Content-Type", "application/json")
  10038. c.urlParams_.Set("alt", alt)
  10039. c.urlParams_.Set("prettyPrint", "false")
  10040. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/intents:batchUpdate")
  10041. urls += "?" + c.urlParams_.Encode()
  10042. req, err := http.NewRequest("POST", urls, body)
  10043. if err != nil {
  10044. return nil, err
  10045. }
  10046. req.Header = reqHeaders
  10047. googleapi.Expand(req.URL, map[string]string{
  10048. "parent": c.parent,
  10049. })
  10050. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10051. }
  10052. // Do executes the "dialogflow.projects.agent.intents.batchUpdate" call.
  10053. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  10054. // Any non-2xx status code is an error. Response headers are in either
  10055. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  10056. // was returned at all) in error.(*googleapi.Error).Header. Use
  10057. // googleapi.IsNotModified to check whether the returned error was
  10058. // because http.StatusNotModified was returned.
  10059. func (c *ProjectsAgentIntentsBatchUpdateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  10060. gensupport.SetOptions(c.urlParams_, opts...)
  10061. res, err := c.doRequest("json")
  10062. if res != nil && res.StatusCode == http.StatusNotModified {
  10063. if res.Body != nil {
  10064. res.Body.Close()
  10065. }
  10066. return nil, &googleapi.Error{
  10067. Code: res.StatusCode,
  10068. Header: res.Header,
  10069. }
  10070. }
  10071. if err != nil {
  10072. return nil, err
  10073. }
  10074. defer googleapi.CloseBody(res)
  10075. if err := googleapi.CheckResponse(res); err != nil {
  10076. return nil, err
  10077. }
  10078. ret := &GoogleLongrunningOperation{
  10079. ServerResponse: googleapi.ServerResponse{
  10080. Header: res.Header,
  10081. HTTPStatusCode: res.StatusCode,
  10082. },
  10083. }
  10084. target := &ret
  10085. if err := gensupport.DecodeResponse(target, res); err != nil {
  10086. return nil, err
  10087. }
  10088. return ret, nil
  10089. // {
  10090. // "description": "Updates/Creates multiple intents in the specified agent.\n\nOperation \u003cresponse: BatchUpdateIntentsResponse\u003e",
  10091. // "flatPath": "v2beta1/projects/{projectsId}/agent/intents:batchUpdate",
  10092. // "httpMethod": "POST",
  10093. // "id": "dialogflow.projects.agent.intents.batchUpdate",
  10094. // "parameterOrder": [
  10095. // "parent"
  10096. // ],
  10097. // "parameters": {
  10098. // "parent": {
  10099. // "description": "Required. The name of the agent to update or create intents in.\nFormat: `projects/\u003cProject ID\u003e/agent`.",
  10100. // "location": "path",
  10101. // "pattern": "^projects/[^/]+/agent$",
  10102. // "required": true,
  10103. // "type": "string"
  10104. // }
  10105. // },
  10106. // "path": "v2beta1/{+parent}/intents:batchUpdate",
  10107. // "request": {
  10108. // "$ref": "GoogleCloudDialogflowV2beta1BatchUpdateIntentsRequest"
  10109. // },
  10110. // "response": {
  10111. // "$ref": "GoogleLongrunningOperation"
  10112. // },
  10113. // "scopes": [
  10114. // "https://www.googleapis.com/auth/cloud-platform",
  10115. // "https://www.googleapis.com/auth/dialogflow"
  10116. // ]
  10117. // }
  10118. }
  10119. // method id "dialogflow.projects.agent.intents.create":
  10120. type ProjectsAgentIntentsCreateCall struct {
  10121. s *Service
  10122. parent string
  10123. googleclouddialogflowv2beta1intent *GoogleCloudDialogflowV2beta1Intent
  10124. urlParams_ gensupport.URLParams
  10125. ctx_ context.Context
  10126. header_ http.Header
  10127. }
  10128. // Create: Creates an intent in the specified agent.
  10129. func (r *ProjectsAgentIntentsService) Create(parent string, googleclouddialogflowv2beta1intent *GoogleCloudDialogflowV2beta1Intent) *ProjectsAgentIntentsCreateCall {
  10130. c := &ProjectsAgentIntentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10131. c.parent = parent
  10132. c.googleclouddialogflowv2beta1intent = googleclouddialogflowv2beta1intent
  10133. return c
  10134. }
  10135. // IntentView sets the optional parameter "intentView": The resource
  10136. // view to apply to the returned intent.
  10137. //
  10138. // Possible values:
  10139. // "INTENT_VIEW_UNSPECIFIED"
  10140. // "INTENT_VIEW_FULL"
  10141. func (c *ProjectsAgentIntentsCreateCall) IntentView(intentView string) *ProjectsAgentIntentsCreateCall {
  10142. c.urlParams_.Set("intentView", intentView)
  10143. return c
  10144. }
  10145. // LanguageCode sets the optional parameter "languageCode": The language
  10146. // of training phrases, parameters and rich messages
  10147. // defined in `intent`. If not specified, the agent's default language
  10148. // is
  10149. // used. [More than a
  10150. // dozen
  10151. // languages](https://dialogflow.com/docs/reference/language) are
  10152. // supported.
  10153. // Note: languages must be enabled in the agent, before they can be
  10154. // used.
  10155. func (c *ProjectsAgentIntentsCreateCall) LanguageCode(languageCode string) *ProjectsAgentIntentsCreateCall {
  10156. c.urlParams_.Set("languageCode", languageCode)
  10157. return c
  10158. }
  10159. // Fields allows partial responses to be retrieved. See
  10160. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10161. // for more information.
  10162. func (c *ProjectsAgentIntentsCreateCall) Fields(s ...googleapi.Field) *ProjectsAgentIntentsCreateCall {
  10163. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10164. return c
  10165. }
  10166. // Context sets the context to be used in this call's Do method. Any
  10167. // pending HTTP request will be aborted if the provided context is
  10168. // canceled.
  10169. func (c *ProjectsAgentIntentsCreateCall) Context(ctx context.Context) *ProjectsAgentIntentsCreateCall {
  10170. c.ctx_ = ctx
  10171. return c
  10172. }
  10173. // Header returns an http.Header that can be modified by the caller to
  10174. // add HTTP headers to the request.
  10175. func (c *ProjectsAgentIntentsCreateCall) Header() http.Header {
  10176. if c.header_ == nil {
  10177. c.header_ = make(http.Header)
  10178. }
  10179. return c.header_
  10180. }
  10181. func (c *ProjectsAgentIntentsCreateCall) doRequest(alt string) (*http.Response, error) {
  10182. reqHeaders := make(http.Header)
  10183. for k, v := range c.header_ {
  10184. reqHeaders[k] = v
  10185. }
  10186. reqHeaders.Set("User-Agent", c.s.userAgent())
  10187. var body io.Reader = nil
  10188. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1intent)
  10189. if err != nil {
  10190. return nil, err
  10191. }
  10192. reqHeaders.Set("Content-Type", "application/json")
  10193. c.urlParams_.Set("alt", alt)
  10194. c.urlParams_.Set("prettyPrint", "false")
  10195. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/intents")
  10196. urls += "?" + c.urlParams_.Encode()
  10197. req, err := http.NewRequest("POST", urls, body)
  10198. if err != nil {
  10199. return nil, err
  10200. }
  10201. req.Header = reqHeaders
  10202. googleapi.Expand(req.URL, map[string]string{
  10203. "parent": c.parent,
  10204. })
  10205. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10206. }
  10207. // Do executes the "dialogflow.projects.agent.intents.create" call.
  10208. // Exactly one of *GoogleCloudDialogflowV2beta1Intent or error will be
  10209. // non-nil. Any non-2xx status code is an error. Response headers are in
  10210. // either *GoogleCloudDialogflowV2beta1Intent.ServerResponse.Header or
  10211. // (if a response was returned at all) in
  10212. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  10213. // whether the returned error was because http.StatusNotModified was
  10214. // returned.
  10215. func (c *ProjectsAgentIntentsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1Intent, error) {
  10216. gensupport.SetOptions(c.urlParams_, opts...)
  10217. res, err := c.doRequest("json")
  10218. if res != nil && res.StatusCode == http.StatusNotModified {
  10219. if res.Body != nil {
  10220. res.Body.Close()
  10221. }
  10222. return nil, &googleapi.Error{
  10223. Code: res.StatusCode,
  10224. Header: res.Header,
  10225. }
  10226. }
  10227. if err != nil {
  10228. return nil, err
  10229. }
  10230. defer googleapi.CloseBody(res)
  10231. if err := googleapi.CheckResponse(res); err != nil {
  10232. return nil, err
  10233. }
  10234. ret := &GoogleCloudDialogflowV2beta1Intent{
  10235. ServerResponse: googleapi.ServerResponse{
  10236. Header: res.Header,
  10237. HTTPStatusCode: res.StatusCode,
  10238. },
  10239. }
  10240. target := &ret
  10241. if err := gensupport.DecodeResponse(target, res); err != nil {
  10242. return nil, err
  10243. }
  10244. return ret, nil
  10245. // {
  10246. // "description": "Creates an intent in the specified agent.",
  10247. // "flatPath": "v2beta1/projects/{projectsId}/agent/intents",
  10248. // "httpMethod": "POST",
  10249. // "id": "dialogflow.projects.agent.intents.create",
  10250. // "parameterOrder": [
  10251. // "parent"
  10252. // ],
  10253. // "parameters": {
  10254. // "intentView": {
  10255. // "description": "Optional. The resource view to apply to the returned intent.",
  10256. // "enum": [
  10257. // "INTENT_VIEW_UNSPECIFIED",
  10258. // "INTENT_VIEW_FULL"
  10259. // ],
  10260. // "location": "query",
  10261. // "type": "string"
  10262. // },
  10263. // "languageCode": {
  10264. // "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.",
  10265. // "location": "query",
  10266. // "type": "string"
  10267. // },
  10268. // "parent": {
  10269. // "description": "Required. The agent to create a intent for.\nFormat: `projects/\u003cProject ID\u003e/agent`.",
  10270. // "location": "path",
  10271. // "pattern": "^projects/[^/]+/agent$",
  10272. // "required": true,
  10273. // "type": "string"
  10274. // }
  10275. // },
  10276. // "path": "v2beta1/{+parent}/intents",
  10277. // "request": {
  10278. // "$ref": "GoogleCloudDialogflowV2beta1Intent"
  10279. // },
  10280. // "response": {
  10281. // "$ref": "GoogleCloudDialogflowV2beta1Intent"
  10282. // },
  10283. // "scopes": [
  10284. // "https://www.googleapis.com/auth/cloud-platform",
  10285. // "https://www.googleapis.com/auth/dialogflow"
  10286. // ]
  10287. // }
  10288. }
  10289. // method id "dialogflow.projects.agent.intents.delete":
  10290. type ProjectsAgentIntentsDeleteCall struct {
  10291. s *Service
  10292. name string
  10293. urlParams_ gensupport.URLParams
  10294. ctx_ context.Context
  10295. header_ http.Header
  10296. }
  10297. // Delete: Deletes the specified intent and its direct or indirect
  10298. // followup intents.
  10299. func (r *ProjectsAgentIntentsService) Delete(name string) *ProjectsAgentIntentsDeleteCall {
  10300. c := &ProjectsAgentIntentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10301. c.name = name
  10302. return c
  10303. }
  10304. // Fields allows partial responses to be retrieved. See
  10305. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10306. // for more information.
  10307. func (c *ProjectsAgentIntentsDeleteCall) Fields(s ...googleapi.Field) *ProjectsAgentIntentsDeleteCall {
  10308. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10309. return c
  10310. }
  10311. // Context sets the context to be used in this call's Do method. Any
  10312. // pending HTTP request will be aborted if the provided context is
  10313. // canceled.
  10314. func (c *ProjectsAgentIntentsDeleteCall) Context(ctx context.Context) *ProjectsAgentIntentsDeleteCall {
  10315. c.ctx_ = ctx
  10316. return c
  10317. }
  10318. // Header returns an http.Header that can be modified by the caller to
  10319. // add HTTP headers to the request.
  10320. func (c *ProjectsAgentIntentsDeleteCall) Header() http.Header {
  10321. if c.header_ == nil {
  10322. c.header_ = make(http.Header)
  10323. }
  10324. return c.header_
  10325. }
  10326. func (c *ProjectsAgentIntentsDeleteCall) doRequest(alt string) (*http.Response, error) {
  10327. reqHeaders := make(http.Header)
  10328. for k, v := range c.header_ {
  10329. reqHeaders[k] = v
  10330. }
  10331. reqHeaders.Set("User-Agent", c.s.userAgent())
  10332. var body io.Reader = nil
  10333. c.urlParams_.Set("alt", alt)
  10334. c.urlParams_.Set("prettyPrint", "false")
  10335. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  10336. urls += "?" + c.urlParams_.Encode()
  10337. req, err := http.NewRequest("DELETE", urls, body)
  10338. if err != nil {
  10339. return nil, err
  10340. }
  10341. req.Header = reqHeaders
  10342. googleapi.Expand(req.URL, map[string]string{
  10343. "name": c.name,
  10344. })
  10345. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10346. }
  10347. // Do executes the "dialogflow.projects.agent.intents.delete" call.
  10348. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  10349. // non-2xx status code is an error. Response headers are in either
  10350. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  10351. // returned at all) in error.(*googleapi.Error).Header. Use
  10352. // googleapi.IsNotModified to check whether the returned error was
  10353. // because http.StatusNotModified was returned.
  10354. func (c *ProjectsAgentIntentsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  10355. gensupport.SetOptions(c.urlParams_, opts...)
  10356. res, err := c.doRequest("json")
  10357. if res != nil && res.StatusCode == http.StatusNotModified {
  10358. if res.Body != nil {
  10359. res.Body.Close()
  10360. }
  10361. return nil, &googleapi.Error{
  10362. Code: res.StatusCode,
  10363. Header: res.Header,
  10364. }
  10365. }
  10366. if err != nil {
  10367. return nil, err
  10368. }
  10369. defer googleapi.CloseBody(res)
  10370. if err := googleapi.CheckResponse(res); err != nil {
  10371. return nil, err
  10372. }
  10373. ret := &GoogleProtobufEmpty{
  10374. ServerResponse: googleapi.ServerResponse{
  10375. Header: res.Header,
  10376. HTTPStatusCode: res.StatusCode,
  10377. },
  10378. }
  10379. target := &ret
  10380. if err := gensupport.DecodeResponse(target, res); err != nil {
  10381. return nil, err
  10382. }
  10383. return ret, nil
  10384. // {
  10385. // "description": "Deletes the specified intent and its direct or indirect followup intents.",
  10386. // "flatPath": "v2beta1/projects/{projectsId}/agent/intents/{intentsId}",
  10387. // "httpMethod": "DELETE",
  10388. // "id": "dialogflow.projects.agent.intents.delete",
  10389. // "parameterOrder": [
  10390. // "name"
  10391. // ],
  10392. // "parameters": {
  10393. // "name": {
  10394. // "description": "Required. The name of the intent to delete. If this intent has direct or\nindirect followup intents, we also delete them.\n\nFormat: `projects/\u003cProject ID\u003e/agent/intents/\u003cIntent ID\u003e`.",
  10395. // "location": "path",
  10396. // "pattern": "^projects/[^/]+/agent/intents/[^/]+$",
  10397. // "required": true,
  10398. // "type": "string"
  10399. // }
  10400. // },
  10401. // "path": "v2beta1/{+name}",
  10402. // "response": {
  10403. // "$ref": "GoogleProtobufEmpty"
  10404. // },
  10405. // "scopes": [
  10406. // "https://www.googleapis.com/auth/cloud-platform",
  10407. // "https://www.googleapis.com/auth/dialogflow"
  10408. // ]
  10409. // }
  10410. }
  10411. // method id "dialogflow.projects.agent.intents.get":
  10412. type ProjectsAgentIntentsGetCall struct {
  10413. s *Service
  10414. name string
  10415. urlParams_ gensupport.URLParams
  10416. ifNoneMatch_ string
  10417. ctx_ context.Context
  10418. header_ http.Header
  10419. }
  10420. // Get: Retrieves the specified intent.
  10421. func (r *ProjectsAgentIntentsService) Get(name string) *ProjectsAgentIntentsGetCall {
  10422. c := &ProjectsAgentIntentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10423. c.name = name
  10424. return c
  10425. }
  10426. // IntentView sets the optional parameter "intentView": The resource
  10427. // view to apply to the returned intent.
  10428. //
  10429. // Possible values:
  10430. // "INTENT_VIEW_UNSPECIFIED"
  10431. // "INTENT_VIEW_FULL"
  10432. func (c *ProjectsAgentIntentsGetCall) IntentView(intentView string) *ProjectsAgentIntentsGetCall {
  10433. c.urlParams_.Set("intentView", intentView)
  10434. return c
  10435. }
  10436. // LanguageCode sets the optional parameter "languageCode": The language
  10437. // to retrieve training phrases, parameters and rich
  10438. // messages for. If not specified, the agent's default language is
  10439. // used.
  10440. // [More than a
  10441. // dozen
  10442. // languages](https://dialogflow.com/docs/reference/language) are
  10443. // supported.
  10444. // Note: languages must be enabled in the agent, before they can be
  10445. // used.
  10446. func (c *ProjectsAgentIntentsGetCall) LanguageCode(languageCode string) *ProjectsAgentIntentsGetCall {
  10447. c.urlParams_.Set("languageCode", languageCode)
  10448. return c
  10449. }
  10450. // Fields allows partial responses to be retrieved. See
  10451. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10452. // for more information.
  10453. func (c *ProjectsAgentIntentsGetCall) Fields(s ...googleapi.Field) *ProjectsAgentIntentsGetCall {
  10454. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10455. return c
  10456. }
  10457. // IfNoneMatch sets the optional parameter which makes the operation
  10458. // fail if the object's ETag matches the given value. This is useful for
  10459. // getting updates only after the object has changed since the last
  10460. // request. Use googleapi.IsNotModified to check whether the response
  10461. // error from Do is the result of In-None-Match.
  10462. func (c *ProjectsAgentIntentsGetCall) IfNoneMatch(entityTag string) *ProjectsAgentIntentsGetCall {
  10463. c.ifNoneMatch_ = entityTag
  10464. return c
  10465. }
  10466. // Context sets the context to be used in this call's Do method. Any
  10467. // pending HTTP request will be aborted if the provided context is
  10468. // canceled.
  10469. func (c *ProjectsAgentIntentsGetCall) Context(ctx context.Context) *ProjectsAgentIntentsGetCall {
  10470. c.ctx_ = ctx
  10471. return c
  10472. }
  10473. // Header returns an http.Header that can be modified by the caller to
  10474. // add HTTP headers to the request.
  10475. func (c *ProjectsAgentIntentsGetCall) Header() http.Header {
  10476. if c.header_ == nil {
  10477. c.header_ = make(http.Header)
  10478. }
  10479. return c.header_
  10480. }
  10481. func (c *ProjectsAgentIntentsGetCall) doRequest(alt string) (*http.Response, error) {
  10482. reqHeaders := make(http.Header)
  10483. for k, v := range c.header_ {
  10484. reqHeaders[k] = v
  10485. }
  10486. reqHeaders.Set("User-Agent", c.s.userAgent())
  10487. if c.ifNoneMatch_ != "" {
  10488. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10489. }
  10490. var body io.Reader = nil
  10491. c.urlParams_.Set("alt", alt)
  10492. c.urlParams_.Set("prettyPrint", "false")
  10493. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  10494. urls += "?" + c.urlParams_.Encode()
  10495. req, err := http.NewRequest("GET", urls, body)
  10496. if err != nil {
  10497. return nil, err
  10498. }
  10499. req.Header = reqHeaders
  10500. googleapi.Expand(req.URL, map[string]string{
  10501. "name": c.name,
  10502. })
  10503. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10504. }
  10505. // Do executes the "dialogflow.projects.agent.intents.get" call.
  10506. // Exactly one of *GoogleCloudDialogflowV2beta1Intent or error will be
  10507. // non-nil. Any non-2xx status code is an error. Response headers are in
  10508. // either *GoogleCloudDialogflowV2beta1Intent.ServerResponse.Header or
  10509. // (if a response was returned at all) in
  10510. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  10511. // whether the returned error was because http.StatusNotModified was
  10512. // returned.
  10513. func (c *ProjectsAgentIntentsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1Intent, error) {
  10514. gensupport.SetOptions(c.urlParams_, opts...)
  10515. res, err := c.doRequest("json")
  10516. if res != nil && res.StatusCode == http.StatusNotModified {
  10517. if res.Body != nil {
  10518. res.Body.Close()
  10519. }
  10520. return nil, &googleapi.Error{
  10521. Code: res.StatusCode,
  10522. Header: res.Header,
  10523. }
  10524. }
  10525. if err != nil {
  10526. return nil, err
  10527. }
  10528. defer googleapi.CloseBody(res)
  10529. if err := googleapi.CheckResponse(res); err != nil {
  10530. return nil, err
  10531. }
  10532. ret := &GoogleCloudDialogflowV2beta1Intent{
  10533. ServerResponse: googleapi.ServerResponse{
  10534. Header: res.Header,
  10535. HTTPStatusCode: res.StatusCode,
  10536. },
  10537. }
  10538. target := &ret
  10539. if err := gensupport.DecodeResponse(target, res); err != nil {
  10540. return nil, err
  10541. }
  10542. return ret, nil
  10543. // {
  10544. // "description": "Retrieves the specified intent.",
  10545. // "flatPath": "v2beta1/projects/{projectsId}/agent/intents/{intentsId}",
  10546. // "httpMethod": "GET",
  10547. // "id": "dialogflow.projects.agent.intents.get",
  10548. // "parameterOrder": [
  10549. // "name"
  10550. // ],
  10551. // "parameters": {
  10552. // "intentView": {
  10553. // "description": "Optional. The resource view to apply to the returned intent.",
  10554. // "enum": [
  10555. // "INTENT_VIEW_UNSPECIFIED",
  10556. // "INTENT_VIEW_FULL"
  10557. // ],
  10558. // "location": "query",
  10559. // "type": "string"
  10560. // },
  10561. // "languageCode": {
  10562. // "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.",
  10563. // "location": "query",
  10564. // "type": "string"
  10565. // },
  10566. // "name": {
  10567. // "description": "Required. The name of the intent.\nFormat: `projects/\u003cProject ID\u003e/agent/intents/\u003cIntent ID\u003e`.",
  10568. // "location": "path",
  10569. // "pattern": "^projects/[^/]+/agent/intents/[^/]+$",
  10570. // "required": true,
  10571. // "type": "string"
  10572. // }
  10573. // },
  10574. // "path": "v2beta1/{+name}",
  10575. // "response": {
  10576. // "$ref": "GoogleCloudDialogflowV2beta1Intent"
  10577. // },
  10578. // "scopes": [
  10579. // "https://www.googleapis.com/auth/cloud-platform",
  10580. // "https://www.googleapis.com/auth/dialogflow"
  10581. // ]
  10582. // }
  10583. }
  10584. // method id "dialogflow.projects.agent.intents.list":
  10585. type ProjectsAgentIntentsListCall struct {
  10586. s *Service
  10587. parent string
  10588. urlParams_ gensupport.URLParams
  10589. ifNoneMatch_ string
  10590. ctx_ context.Context
  10591. header_ http.Header
  10592. }
  10593. // List: Returns the list of all intents in the specified agent.
  10594. func (r *ProjectsAgentIntentsService) List(parent string) *ProjectsAgentIntentsListCall {
  10595. c := &ProjectsAgentIntentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10596. c.parent = parent
  10597. return c
  10598. }
  10599. // IntentView sets the optional parameter "intentView": The resource
  10600. // view to apply to the returned intent.
  10601. //
  10602. // Possible values:
  10603. // "INTENT_VIEW_UNSPECIFIED"
  10604. // "INTENT_VIEW_FULL"
  10605. func (c *ProjectsAgentIntentsListCall) IntentView(intentView string) *ProjectsAgentIntentsListCall {
  10606. c.urlParams_.Set("intentView", intentView)
  10607. return c
  10608. }
  10609. // LanguageCode sets the optional parameter "languageCode": The language
  10610. // to list training phrases, parameters and rich
  10611. // messages for. If not specified, the agent's default language is
  10612. // used.
  10613. // [More than a
  10614. // dozen
  10615. // languages](https://dialogflow.com/docs/reference/language) are
  10616. // supported.
  10617. // Note: languages must be enabled in the agent before they can be used.
  10618. func (c *ProjectsAgentIntentsListCall) LanguageCode(languageCode string) *ProjectsAgentIntentsListCall {
  10619. c.urlParams_.Set("languageCode", languageCode)
  10620. return c
  10621. }
  10622. // PageSize sets the optional parameter "pageSize": The maximum number
  10623. // of items to return in a single page. By
  10624. // default 100 and at most 1000.
  10625. func (c *ProjectsAgentIntentsListCall) PageSize(pageSize int64) *ProjectsAgentIntentsListCall {
  10626. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  10627. return c
  10628. }
  10629. // PageToken sets the optional parameter "pageToken": The
  10630. // next_page_token value returned from a previous list request.
  10631. func (c *ProjectsAgentIntentsListCall) PageToken(pageToken string) *ProjectsAgentIntentsListCall {
  10632. c.urlParams_.Set("pageToken", pageToken)
  10633. return c
  10634. }
  10635. // Fields allows partial responses to be retrieved. See
  10636. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10637. // for more information.
  10638. func (c *ProjectsAgentIntentsListCall) Fields(s ...googleapi.Field) *ProjectsAgentIntentsListCall {
  10639. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10640. return c
  10641. }
  10642. // IfNoneMatch sets the optional parameter which makes the operation
  10643. // fail if the object's ETag matches the given value. This is useful for
  10644. // getting updates only after the object has changed since the last
  10645. // request. Use googleapi.IsNotModified to check whether the response
  10646. // error from Do is the result of In-None-Match.
  10647. func (c *ProjectsAgentIntentsListCall) IfNoneMatch(entityTag string) *ProjectsAgentIntentsListCall {
  10648. c.ifNoneMatch_ = entityTag
  10649. return c
  10650. }
  10651. // Context sets the context to be used in this call's Do method. Any
  10652. // pending HTTP request will be aborted if the provided context is
  10653. // canceled.
  10654. func (c *ProjectsAgentIntentsListCall) Context(ctx context.Context) *ProjectsAgentIntentsListCall {
  10655. c.ctx_ = ctx
  10656. return c
  10657. }
  10658. // Header returns an http.Header that can be modified by the caller to
  10659. // add HTTP headers to the request.
  10660. func (c *ProjectsAgentIntentsListCall) Header() http.Header {
  10661. if c.header_ == nil {
  10662. c.header_ = make(http.Header)
  10663. }
  10664. return c.header_
  10665. }
  10666. func (c *ProjectsAgentIntentsListCall) doRequest(alt string) (*http.Response, error) {
  10667. reqHeaders := make(http.Header)
  10668. for k, v := range c.header_ {
  10669. reqHeaders[k] = v
  10670. }
  10671. reqHeaders.Set("User-Agent", c.s.userAgent())
  10672. if c.ifNoneMatch_ != "" {
  10673. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10674. }
  10675. var body io.Reader = nil
  10676. c.urlParams_.Set("alt", alt)
  10677. c.urlParams_.Set("prettyPrint", "false")
  10678. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/intents")
  10679. urls += "?" + c.urlParams_.Encode()
  10680. req, err := http.NewRequest("GET", urls, body)
  10681. if err != nil {
  10682. return nil, err
  10683. }
  10684. req.Header = reqHeaders
  10685. googleapi.Expand(req.URL, map[string]string{
  10686. "parent": c.parent,
  10687. })
  10688. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10689. }
  10690. // Do executes the "dialogflow.projects.agent.intents.list" call.
  10691. // Exactly one of *GoogleCloudDialogflowV2beta1ListIntentsResponse or
  10692. // error will be non-nil. Any non-2xx status code is an error. Response
  10693. // headers are in either
  10694. // *GoogleCloudDialogflowV2beta1ListIntentsResponse.ServerResponse.Header
  10695. // or (if a response was returned at all) in
  10696. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  10697. // whether the returned error was because http.StatusNotModified was
  10698. // returned.
  10699. func (c *ProjectsAgentIntentsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1ListIntentsResponse, error) {
  10700. gensupport.SetOptions(c.urlParams_, opts...)
  10701. res, err := c.doRequest("json")
  10702. if res != nil && res.StatusCode == http.StatusNotModified {
  10703. if res.Body != nil {
  10704. res.Body.Close()
  10705. }
  10706. return nil, &googleapi.Error{
  10707. Code: res.StatusCode,
  10708. Header: res.Header,
  10709. }
  10710. }
  10711. if err != nil {
  10712. return nil, err
  10713. }
  10714. defer googleapi.CloseBody(res)
  10715. if err := googleapi.CheckResponse(res); err != nil {
  10716. return nil, err
  10717. }
  10718. ret := &GoogleCloudDialogflowV2beta1ListIntentsResponse{
  10719. ServerResponse: googleapi.ServerResponse{
  10720. Header: res.Header,
  10721. HTTPStatusCode: res.StatusCode,
  10722. },
  10723. }
  10724. target := &ret
  10725. if err := gensupport.DecodeResponse(target, res); err != nil {
  10726. return nil, err
  10727. }
  10728. return ret, nil
  10729. // {
  10730. // "description": "Returns the list of all intents in the specified agent.",
  10731. // "flatPath": "v2beta1/projects/{projectsId}/agent/intents",
  10732. // "httpMethod": "GET",
  10733. // "id": "dialogflow.projects.agent.intents.list",
  10734. // "parameterOrder": [
  10735. // "parent"
  10736. // ],
  10737. // "parameters": {
  10738. // "intentView": {
  10739. // "description": "Optional. The resource view to apply to the returned intent.",
  10740. // "enum": [
  10741. // "INTENT_VIEW_UNSPECIFIED",
  10742. // "INTENT_VIEW_FULL"
  10743. // ],
  10744. // "location": "query",
  10745. // "type": "string"
  10746. // },
  10747. // "languageCode": {
  10748. // "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.",
  10749. // "location": "query",
  10750. // "type": "string"
  10751. // },
  10752. // "pageSize": {
  10753. // "description": "Optional. The maximum number of items to return in a single page. By\ndefault 100 and at most 1000.",
  10754. // "format": "int32",
  10755. // "location": "query",
  10756. // "type": "integer"
  10757. // },
  10758. // "pageToken": {
  10759. // "description": "Optional. The next_page_token value returned from a previous list request.",
  10760. // "location": "query",
  10761. // "type": "string"
  10762. // },
  10763. // "parent": {
  10764. // "description": "Required. The agent to list all intents from.\nFormat: `projects/\u003cProject ID\u003e/agent`.",
  10765. // "location": "path",
  10766. // "pattern": "^projects/[^/]+/agent$",
  10767. // "required": true,
  10768. // "type": "string"
  10769. // }
  10770. // },
  10771. // "path": "v2beta1/{+parent}/intents",
  10772. // "response": {
  10773. // "$ref": "GoogleCloudDialogflowV2beta1ListIntentsResponse"
  10774. // },
  10775. // "scopes": [
  10776. // "https://www.googleapis.com/auth/cloud-platform",
  10777. // "https://www.googleapis.com/auth/dialogflow"
  10778. // ]
  10779. // }
  10780. }
  10781. // Pages invokes f for each page of results.
  10782. // A non-nil error returned from f will halt the iteration.
  10783. // The provided context supersedes any context provided to the Context method.
  10784. func (c *ProjectsAgentIntentsListCall) Pages(ctx context.Context, f func(*GoogleCloudDialogflowV2beta1ListIntentsResponse) error) error {
  10785. c.ctx_ = ctx
  10786. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  10787. for {
  10788. x, err := c.Do()
  10789. if err != nil {
  10790. return err
  10791. }
  10792. if err := f(x); err != nil {
  10793. return err
  10794. }
  10795. if x.NextPageToken == "" {
  10796. return nil
  10797. }
  10798. c.PageToken(x.NextPageToken)
  10799. }
  10800. }
  10801. // method id "dialogflow.projects.agent.intents.patch":
  10802. type ProjectsAgentIntentsPatchCall struct {
  10803. s *Service
  10804. nameid string
  10805. googleclouddialogflowv2beta1intent *GoogleCloudDialogflowV2beta1Intent
  10806. urlParams_ gensupport.URLParams
  10807. ctx_ context.Context
  10808. header_ http.Header
  10809. }
  10810. // Patch: Updates the specified intent.
  10811. func (r *ProjectsAgentIntentsService) Patch(nameid string, googleclouddialogflowv2beta1intent *GoogleCloudDialogflowV2beta1Intent) *ProjectsAgentIntentsPatchCall {
  10812. c := &ProjectsAgentIntentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10813. c.nameid = nameid
  10814. c.googleclouddialogflowv2beta1intent = googleclouddialogflowv2beta1intent
  10815. return c
  10816. }
  10817. // IntentView sets the optional parameter "intentView": The resource
  10818. // view to apply to the returned intent.
  10819. //
  10820. // Possible values:
  10821. // "INTENT_VIEW_UNSPECIFIED"
  10822. // "INTENT_VIEW_FULL"
  10823. func (c *ProjectsAgentIntentsPatchCall) IntentView(intentView string) *ProjectsAgentIntentsPatchCall {
  10824. c.urlParams_.Set("intentView", intentView)
  10825. return c
  10826. }
  10827. // LanguageCode sets the optional parameter "languageCode": The language
  10828. // of training phrases, parameters and rich messages
  10829. // defined in `intent`. If not specified, the agent's default language
  10830. // is
  10831. // used. [More than a
  10832. // dozen
  10833. // languages](https://dialogflow.com/docs/reference/language) are
  10834. // supported.
  10835. // Note: languages must be enabled in the agent, before they can be
  10836. // used.
  10837. func (c *ProjectsAgentIntentsPatchCall) LanguageCode(languageCode string) *ProjectsAgentIntentsPatchCall {
  10838. c.urlParams_.Set("languageCode", languageCode)
  10839. return c
  10840. }
  10841. // UpdateMask sets the optional parameter "updateMask": The mask to
  10842. // control which fields get updated.
  10843. func (c *ProjectsAgentIntentsPatchCall) UpdateMask(updateMask string) *ProjectsAgentIntentsPatchCall {
  10844. c.urlParams_.Set("updateMask", updateMask)
  10845. return c
  10846. }
  10847. // Fields allows partial responses to be retrieved. See
  10848. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10849. // for more information.
  10850. func (c *ProjectsAgentIntentsPatchCall) Fields(s ...googleapi.Field) *ProjectsAgentIntentsPatchCall {
  10851. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10852. return c
  10853. }
  10854. // Context sets the context to be used in this call's Do method. Any
  10855. // pending HTTP request will be aborted if the provided context is
  10856. // canceled.
  10857. func (c *ProjectsAgentIntentsPatchCall) Context(ctx context.Context) *ProjectsAgentIntentsPatchCall {
  10858. c.ctx_ = ctx
  10859. return c
  10860. }
  10861. // Header returns an http.Header that can be modified by the caller to
  10862. // add HTTP headers to the request.
  10863. func (c *ProjectsAgentIntentsPatchCall) Header() http.Header {
  10864. if c.header_ == nil {
  10865. c.header_ = make(http.Header)
  10866. }
  10867. return c.header_
  10868. }
  10869. func (c *ProjectsAgentIntentsPatchCall) doRequest(alt string) (*http.Response, error) {
  10870. reqHeaders := make(http.Header)
  10871. for k, v := range c.header_ {
  10872. reqHeaders[k] = v
  10873. }
  10874. reqHeaders.Set("User-Agent", c.s.userAgent())
  10875. var body io.Reader = nil
  10876. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1intent)
  10877. if err != nil {
  10878. return nil, err
  10879. }
  10880. reqHeaders.Set("Content-Type", "application/json")
  10881. c.urlParams_.Set("alt", alt)
  10882. c.urlParams_.Set("prettyPrint", "false")
  10883. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  10884. urls += "?" + c.urlParams_.Encode()
  10885. req, err := http.NewRequest("PATCH", urls, body)
  10886. if err != nil {
  10887. return nil, err
  10888. }
  10889. req.Header = reqHeaders
  10890. googleapi.Expand(req.URL, map[string]string{
  10891. "name": c.nameid,
  10892. })
  10893. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10894. }
  10895. // Do executes the "dialogflow.projects.agent.intents.patch" call.
  10896. // Exactly one of *GoogleCloudDialogflowV2beta1Intent or error will be
  10897. // non-nil. Any non-2xx status code is an error. Response headers are in
  10898. // either *GoogleCloudDialogflowV2beta1Intent.ServerResponse.Header or
  10899. // (if a response was returned at all) in
  10900. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  10901. // whether the returned error was because http.StatusNotModified was
  10902. // returned.
  10903. func (c *ProjectsAgentIntentsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1Intent, error) {
  10904. gensupport.SetOptions(c.urlParams_, opts...)
  10905. res, err := c.doRequest("json")
  10906. if res != nil && res.StatusCode == http.StatusNotModified {
  10907. if res.Body != nil {
  10908. res.Body.Close()
  10909. }
  10910. return nil, &googleapi.Error{
  10911. Code: res.StatusCode,
  10912. Header: res.Header,
  10913. }
  10914. }
  10915. if err != nil {
  10916. return nil, err
  10917. }
  10918. defer googleapi.CloseBody(res)
  10919. if err := googleapi.CheckResponse(res); err != nil {
  10920. return nil, err
  10921. }
  10922. ret := &GoogleCloudDialogflowV2beta1Intent{
  10923. ServerResponse: googleapi.ServerResponse{
  10924. Header: res.Header,
  10925. HTTPStatusCode: res.StatusCode,
  10926. },
  10927. }
  10928. target := &ret
  10929. if err := gensupport.DecodeResponse(target, res); err != nil {
  10930. return nil, err
  10931. }
  10932. return ret, nil
  10933. // {
  10934. // "description": "Updates the specified intent.",
  10935. // "flatPath": "v2beta1/projects/{projectsId}/agent/intents/{intentsId}",
  10936. // "httpMethod": "PATCH",
  10937. // "id": "dialogflow.projects.agent.intents.patch",
  10938. // "parameterOrder": [
  10939. // "name"
  10940. // ],
  10941. // "parameters": {
  10942. // "intentView": {
  10943. // "description": "Optional. The resource view to apply to the returned intent.",
  10944. // "enum": [
  10945. // "INTENT_VIEW_UNSPECIFIED",
  10946. // "INTENT_VIEW_FULL"
  10947. // ],
  10948. // "location": "query",
  10949. // "type": "string"
  10950. // },
  10951. // "languageCode": {
  10952. // "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.",
  10953. // "location": "query",
  10954. // "type": "string"
  10955. // },
  10956. // "name": {
  10957. // "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`.",
  10958. // "location": "path",
  10959. // "pattern": "^projects/[^/]+/agent/intents/[^/]+$",
  10960. // "required": true,
  10961. // "type": "string"
  10962. // },
  10963. // "updateMask": {
  10964. // "description": "Optional. The mask to control which fields get updated.",
  10965. // "format": "google-fieldmask",
  10966. // "location": "query",
  10967. // "type": "string"
  10968. // }
  10969. // },
  10970. // "path": "v2beta1/{+name}",
  10971. // "request": {
  10972. // "$ref": "GoogleCloudDialogflowV2beta1Intent"
  10973. // },
  10974. // "response": {
  10975. // "$ref": "GoogleCloudDialogflowV2beta1Intent"
  10976. // },
  10977. // "scopes": [
  10978. // "https://www.googleapis.com/auth/cloud-platform",
  10979. // "https://www.googleapis.com/auth/dialogflow"
  10980. // ]
  10981. // }
  10982. }
  10983. // method id "dialogflow.projects.agent.knowledgeBases.create":
  10984. type ProjectsAgentKnowledgeBasesCreateCall struct {
  10985. s *Service
  10986. parent string
  10987. googleclouddialogflowv2beta1knowledgebase *GoogleCloudDialogflowV2beta1KnowledgeBase
  10988. urlParams_ gensupport.URLParams
  10989. ctx_ context.Context
  10990. header_ http.Header
  10991. }
  10992. // Create: Creates a knowledge base.
  10993. func (r *ProjectsAgentKnowledgeBasesService) Create(parent string, googleclouddialogflowv2beta1knowledgebase *GoogleCloudDialogflowV2beta1KnowledgeBase) *ProjectsAgentKnowledgeBasesCreateCall {
  10994. c := &ProjectsAgentKnowledgeBasesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10995. c.parent = parent
  10996. c.googleclouddialogflowv2beta1knowledgebase = googleclouddialogflowv2beta1knowledgebase
  10997. return c
  10998. }
  10999. // Fields allows partial responses to be retrieved. See
  11000. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11001. // for more information.
  11002. func (c *ProjectsAgentKnowledgeBasesCreateCall) Fields(s ...googleapi.Field) *ProjectsAgentKnowledgeBasesCreateCall {
  11003. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11004. return c
  11005. }
  11006. // Context sets the context to be used in this call's Do method. Any
  11007. // pending HTTP request will be aborted if the provided context is
  11008. // canceled.
  11009. func (c *ProjectsAgentKnowledgeBasesCreateCall) Context(ctx context.Context) *ProjectsAgentKnowledgeBasesCreateCall {
  11010. c.ctx_ = ctx
  11011. return c
  11012. }
  11013. // Header returns an http.Header that can be modified by the caller to
  11014. // add HTTP headers to the request.
  11015. func (c *ProjectsAgentKnowledgeBasesCreateCall) Header() http.Header {
  11016. if c.header_ == nil {
  11017. c.header_ = make(http.Header)
  11018. }
  11019. return c.header_
  11020. }
  11021. func (c *ProjectsAgentKnowledgeBasesCreateCall) doRequest(alt string) (*http.Response, error) {
  11022. reqHeaders := make(http.Header)
  11023. for k, v := range c.header_ {
  11024. reqHeaders[k] = v
  11025. }
  11026. reqHeaders.Set("User-Agent", c.s.userAgent())
  11027. var body io.Reader = nil
  11028. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1knowledgebase)
  11029. if err != nil {
  11030. return nil, err
  11031. }
  11032. reqHeaders.Set("Content-Type", "application/json")
  11033. c.urlParams_.Set("alt", alt)
  11034. c.urlParams_.Set("prettyPrint", "false")
  11035. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/knowledgeBases")
  11036. urls += "?" + c.urlParams_.Encode()
  11037. req, err := http.NewRequest("POST", urls, body)
  11038. if err != nil {
  11039. return nil, err
  11040. }
  11041. req.Header = reqHeaders
  11042. googleapi.Expand(req.URL, map[string]string{
  11043. "parent": c.parent,
  11044. })
  11045. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11046. }
  11047. // Do executes the "dialogflow.projects.agent.knowledgeBases.create" call.
  11048. // Exactly one of *GoogleCloudDialogflowV2beta1KnowledgeBase or error
  11049. // will be non-nil. Any non-2xx status code is an error. Response
  11050. // headers are in either
  11051. // *GoogleCloudDialogflowV2beta1KnowledgeBase.ServerResponse.Header or
  11052. // (if a response was returned at all) in
  11053. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  11054. // whether the returned error was because http.StatusNotModified was
  11055. // returned.
  11056. func (c *ProjectsAgentKnowledgeBasesCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1KnowledgeBase, error) {
  11057. gensupport.SetOptions(c.urlParams_, opts...)
  11058. res, err := c.doRequest("json")
  11059. if res != nil && res.StatusCode == http.StatusNotModified {
  11060. if res.Body != nil {
  11061. res.Body.Close()
  11062. }
  11063. return nil, &googleapi.Error{
  11064. Code: res.StatusCode,
  11065. Header: res.Header,
  11066. }
  11067. }
  11068. if err != nil {
  11069. return nil, err
  11070. }
  11071. defer googleapi.CloseBody(res)
  11072. if err := googleapi.CheckResponse(res); err != nil {
  11073. return nil, err
  11074. }
  11075. ret := &GoogleCloudDialogflowV2beta1KnowledgeBase{
  11076. ServerResponse: googleapi.ServerResponse{
  11077. Header: res.Header,
  11078. HTTPStatusCode: res.StatusCode,
  11079. },
  11080. }
  11081. target := &ret
  11082. if err := gensupport.DecodeResponse(target, res); err != nil {
  11083. return nil, err
  11084. }
  11085. return ret, nil
  11086. // {
  11087. // "description": "Creates a knowledge base.",
  11088. // "flatPath": "v2beta1/projects/{projectsId}/agent/knowledgeBases",
  11089. // "httpMethod": "POST",
  11090. // "id": "dialogflow.projects.agent.knowledgeBases.create",
  11091. // "parameterOrder": [
  11092. // "parent"
  11093. // ],
  11094. // "parameters": {
  11095. // "parent": {
  11096. // "description": "Required. The project to create a knowledge base for.\nFormat: `projects/\u003cProject ID\u003e`.",
  11097. // "location": "path",
  11098. // "pattern": "^projects/[^/]+/agent$",
  11099. // "required": true,
  11100. // "type": "string"
  11101. // }
  11102. // },
  11103. // "path": "v2beta1/{+parent}/knowledgeBases",
  11104. // "request": {
  11105. // "$ref": "GoogleCloudDialogflowV2beta1KnowledgeBase"
  11106. // },
  11107. // "response": {
  11108. // "$ref": "GoogleCloudDialogflowV2beta1KnowledgeBase"
  11109. // },
  11110. // "scopes": [
  11111. // "https://www.googleapis.com/auth/cloud-platform",
  11112. // "https://www.googleapis.com/auth/dialogflow"
  11113. // ]
  11114. // }
  11115. }
  11116. // method id "dialogflow.projects.agent.knowledgeBases.delete":
  11117. type ProjectsAgentKnowledgeBasesDeleteCall struct {
  11118. s *Service
  11119. name string
  11120. urlParams_ gensupport.URLParams
  11121. ctx_ context.Context
  11122. header_ http.Header
  11123. }
  11124. // Delete: Deletes the specified knowledge base.
  11125. func (r *ProjectsAgentKnowledgeBasesService) Delete(name string) *ProjectsAgentKnowledgeBasesDeleteCall {
  11126. c := &ProjectsAgentKnowledgeBasesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11127. c.name = name
  11128. return c
  11129. }
  11130. // Force sets the optional parameter "force": Force deletes the
  11131. // knowledge base. When set to true, any documents
  11132. // in the knowledge base are also deleted.
  11133. func (c *ProjectsAgentKnowledgeBasesDeleteCall) Force(force bool) *ProjectsAgentKnowledgeBasesDeleteCall {
  11134. c.urlParams_.Set("force", fmt.Sprint(force))
  11135. return c
  11136. }
  11137. // Fields allows partial responses to be retrieved. See
  11138. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11139. // for more information.
  11140. func (c *ProjectsAgentKnowledgeBasesDeleteCall) Fields(s ...googleapi.Field) *ProjectsAgentKnowledgeBasesDeleteCall {
  11141. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11142. return c
  11143. }
  11144. // Context sets the context to be used in this call's Do method. Any
  11145. // pending HTTP request will be aborted if the provided context is
  11146. // canceled.
  11147. func (c *ProjectsAgentKnowledgeBasesDeleteCall) Context(ctx context.Context) *ProjectsAgentKnowledgeBasesDeleteCall {
  11148. c.ctx_ = ctx
  11149. return c
  11150. }
  11151. // Header returns an http.Header that can be modified by the caller to
  11152. // add HTTP headers to the request.
  11153. func (c *ProjectsAgentKnowledgeBasesDeleteCall) Header() http.Header {
  11154. if c.header_ == nil {
  11155. c.header_ = make(http.Header)
  11156. }
  11157. return c.header_
  11158. }
  11159. func (c *ProjectsAgentKnowledgeBasesDeleteCall) doRequest(alt string) (*http.Response, error) {
  11160. reqHeaders := make(http.Header)
  11161. for k, v := range c.header_ {
  11162. reqHeaders[k] = v
  11163. }
  11164. reqHeaders.Set("User-Agent", c.s.userAgent())
  11165. var body io.Reader = nil
  11166. c.urlParams_.Set("alt", alt)
  11167. c.urlParams_.Set("prettyPrint", "false")
  11168. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  11169. urls += "?" + c.urlParams_.Encode()
  11170. req, err := http.NewRequest("DELETE", urls, body)
  11171. if err != nil {
  11172. return nil, err
  11173. }
  11174. req.Header = reqHeaders
  11175. googleapi.Expand(req.URL, map[string]string{
  11176. "name": c.name,
  11177. })
  11178. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11179. }
  11180. // Do executes the "dialogflow.projects.agent.knowledgeBases.delete" call.
  11181. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  11182. // non-2xx status code is an error. Response headers are in either
  11183. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  11184. // returned at all) in error.(*googleapi.Error).Header. Use
  11185. // googleapi.IsNotModified to check whether the returned error was
  11186. // because http.StatusNotModified was returned.
  11187. func (c *ProjectsAgentKnowledgeBasesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  11188. gensupport.SetOptions(c.urlParams_, opts...)
  11189. res, err := c.doRequest("json")
  11190. if res != nil && res.StatusCode == http.StatusNotModified {
  11191. if res.Body != nil {
  11192. res.Body.Close()
  11193. }
  11194. return nil, &googleapi.Error{
  11195. Code: res.StatusCode,
  11196. Header: res.Header,
  11197. }
  11198. }
  11199. if err != nil {
  11200. return nil, err
  11201. }
  11202. defer googleapi.CloseBody(res)
  11203. if err := googleapi.CheckResponse(res); err != nil {
  11204. return nil, err
  11205. }
  11206. ret := &GoogleProtobufEmpty{
  11207. ServerResponse: googleapi.ServerResponse{
  11208. Header: res.Header,
  11209. HTTPStatusCode: res.StatusCode,
  11210. },
  11211. }
  11212. target := &ret
  11213. if err := gensupport.DecodeResponse(target, res); err != nil {
  11214. return nil, err
  11215. }
  11216. return ret, nil
  11217. // {
  11218. // "description": "Deletes the specified knowledge base.",
  11219. // "flatPath": "v2beta1/projects/{projectsId}/agent/knowledgeBases/{knowledgeBasesId}",
  11220. // "httpMethod": "DELETE",
  11221. // "id": "dialogflow.projects.agent.knowledgeBases.delete",
  11222. // "parameterOrder": [
  11223. // "name"
  11224. // ],
  11225. // "parameters": {
  11226. // "force": {
  11227. // "description": "Optional. Force deletes the knowledge base. When set to true, any documents\nin the knowledge base are also deleted.",
  11228. // "location": "query",
  11229. // "type": "boolean"
  11230. // },
  11231. // "name": {
  11232. // "description": "Required. The name of the knowledge base to delete.\nFormat: `projects/\u003cProject ID\u003e/knowledgeBases/\u003cKnowledge Base ID\u003e`.",
  11233. // "location": "path",
  11234. // "pattern": "^projects/[^/]+/agent/knowledgeBases/[^/]+$",
  11235. // "required": true,
  11236. // "type": "string"
  11237. // }
  11238. // },
  11239. // "path": "v2beta1/{+name}",
  11240. // "response": {
  11241. // "$ref": "GoogleProtobufEmpty"
  11242. // },
  11243. // "scopes": [
  11244. // "https://www.googleapis.com/auth/cloud-platform",
  11245. // "https://www.googleapis.com/auth/dialogflow"
  11246. // ]
  11247. // }
  11248. }
  11249. // method id "dialogflow.projects.agent.knowledgeBases.get":
  11250. type ProjectsAgentKnowledgeBasesGetCall struct {
  11251. s *Service
  11252. name string
  11253. urlParams_ gensupport.URLParams
  11254. ifNoneMatch_ string
  11255. ctx_ context.Context
  11256. header_ http.Header
  11257. }
  11258. // Get: Retrieves the specified knowledge base.
  11259. func (r *ProjectsAgentKnowledgeBasesService) Get(name string) *ProjectsAgentKnowledgeBasesGetCall {
  11260. c := &ProjectsAgentKnowledgeBasesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11261. c.name = name
  11262. return c
  11263. }
  11264. // Fields allows partial responses to be retrieved. See
  11265. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11266. // for more information.
  11267. func (c *ProjectsAgentKnowledgeBasesGetCall) Fields(s ...googleapi.Field) *ProjectsAgentKnowledgeBasesGetCall {
  11268. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11269. return c
  11270. }
  11271. // IfNoneMatch sets the optional parameter which makes the operation
  11272. // fail if the object's ETag matches the given value. This is useful for
  11273. // getting updates only after the object has changed since the last
  11274. // request. Use googleapi.IsNotModified to check whether the response
  11275. // error from Do is the result of In-None-Match.
  11276. func (c *ProjectsAgentKnowledgeBasesGetCall) IfNoneMatch(entityTag string) *ProjectsAgentKnowledgeBasesGetCall {
  11277. c.ifNoneMatch_ = entityTag
  11278. return c
  11279. }
  11280. // Context sets the context to be used in this call's Do method. Any
  11281. // pending HTTP request will be aborted if the provided context is
  11282. // canceled.
  11283. func (c *ProjectsAgentKnowledgeBasesGetCall) Context(ctx context.Context) *ProjectsAgentKnowledgeBasesGetCall {
  11284. c.ctx_ = ctx
  11285. return c
  11286. }
  11287. // Header returns an http.Header that can be modified by the caller to
  11288. // add HTTP headers to the request.
  11289. func (c *ProjectsAgentKnowledgeBasesGetCall) Header() http.Header {
  11290. if c.header_ == nil {
  11291. c.header_ = make(http.Header)
  11292. }
  11293. return c.header_
  11294. }
  11295. func (c *ProjectsAgentKnowledgeBasesGetCall) doRequest(alt string) (*http.Response, error) {
  11296. reqHeaders := make(http.Header)
  11297. for k, v := range c.header_ {
  11298. reqHeaders[k] = v
  11299. }
  11300. reqHeaders.Set("User-Agent", c.s.userAgent())
  11301. if c.ifNoneMatch_ != "" {
  11302. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11303. }
  11304. var body io.Reader = nil
  11305. c.urlParams_.Set("alt", alt)
  11306. c.urlParams_.Set("prettyPrint", "false")
  11307. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  11308. urls += "?" + c.urlParams_.Encode()
  11309. req, err := http.NewRequest("GET", urls, body)
  11310. if err != nil {
  11311. return nil, err
  11312. }
  11313. req.Header = reqHeaders
  11314. googleapi.Expand(req.URL, map[string]string{
  11315. "name": c.name,
  11316. })
  11317. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11318. }
  11319. // Do executes the "dialogflow.projects.agent.knowledgeBases.get" call.
  11320. // Exactly one of *GoogleCloudDialogflowV2beta1KnowledgeBase or error
  11321. // will be non-nil. Any non-2xx status code is an error. Response
  11322. // headers are in either
  11323. // *GoogleCloudDialogflowV2beta1KnowledgeBase.ServerResponse.Header or
  11324. // (if a response was returned at all) in
  11325. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  11326. // whether the returned error was because http.StatusNotModified was
  11327. // returned.
  11328. func (c *ProjectsAgentKnowledgeBasesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1KnowledgeBase, error) {
  11329. gensupport.SetOptions(c.urlParams_, opts...)
  11330. res, err := c.doRequest("json")
  11331. if res != nil && res.StatusCode == http.StatusNotModified {
  11332. if res.Body != nil {
  11333. res.Body.Close()
  11334. }
  11335. return nil, &googleapi.Error{
  11336. Code: res.StatusCode,
  11337. Header: res.Header,
  11338. }
  11339. }
  11340. if err != nil {
  11341. return nil, err
  11342. }
  11343. defer googleapi.CloseBody(res)
  11344. if err := googleapi.CheckResponse(res); err != nil {
  11345. return nil, err
  11346. }
  11347. ret := &GoogleCloudDialogflowV2beta1KnowledgeBase{
  11348. ServerResponse: googleapi.ServerResponse{
  11349. Header: res.Header,
  11350. HTTPStatusCode: res.StatusCode,
  11351. },
  11352. }
  11353. target := &ret
  11354. if err := gensupport.DecodeResponse(target, res); err != nil {
  11355. return nil, err
  11356. }
  11357. return ret, nil
  11358. // {
  11359. // "description": "Retrieves the specified knowledge base.",
  11360. // "flatPath": "v2beta1/projects/{projectsId}/agent/knowledgeBases/{knowledgeBasesId}",
  11361. // "httpMethod": "GET",
  11362. // "id": "dialogflow.projects.agent.knowledgeBases.get",
  11363. // "parameterOrder": [
  11364. // "name"
  11365. // ],
  11366. // "parameters": {
  11367. // "name": {
  11368. // "description": "Required. The name of the knowledge base to retrieve.\nFormat `projects/\u003cProject ID\u003e/knowledgeBases/\u003cKnowledge Base ID\u003e`.",
  11369. // "location": "path",
  11370. // "pattern": "^projects/[^/]+/agent/knowledgeBases/[^/]+$",
  11371. // "required": true,
  11372. // "type": "string"
  11373. // }
  11374. // },
  11375. // "path": "v2beta1/{+name}",
  11376. // "response": {
  11377. // "$ref": "GoogleCloudDialogflowV2beta1KnowledgeBase"
  11378. // },
  11379. // "scopes": [
  11380. // "https://www.googleapis.com/auth/cloud-platform",
  11381. // "https://www.googleapis.com/auth/dialogflow"
  11382. // ]
  11383. // }
  11384. }
  11385. // method id "dialogflow.projects.agent.knowledgeBases.list":
  11386. type ProjectsAgentKnowledgeBasesListCall struct {
  11387. s *Service
  11388. parent string
  11389. urlParams_ gensupport.URLParams
  11390. ifNoneMatch_ string
  11391. ctx_ context.Context
  11392. header_ http.Header
  11393. }
  11394. // List: Returns the list of all knowledge bases of the specified agent.
  11395. func (r *ProjectsAgentKnowledgeBasesService) List(parent string) *ProjectsAgentKnowledgeBasesListCall {
  11396. c := &ProjectsAgentKnowledgeBasesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11397. c.parent = parent
  11398. return c
  11399. }
  11400. // PageSize sets the optional parameter "pageSize": The maximum number
  11401. // of items to return in a single page. By
  11402. // default 10 and at most 100.
  11403. func (c *ProjectsAgentKnowledgeBasesListCall) PageSize(pageSize int64) *ProjectsAgentKnowledgeBasesListCall {
  11404. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  11405. return c
  11406. }
  11407. // PageToken sets the optional parameter "pageToken": The
  11408. // next_page_token value returned from a previous list request.
  11409. func (c *ProjectsAgentKnowledgeBasesListCall) PageToken(pageToken string) *ProjectsAgentKnowledgeBasesListCall {
  11410. c.urlParams_.Set("pageToken", pageToken)
  11411. return c
  11412. }
  11413. // Fields allows partial responses to be retrieved. See
  11414. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11415. // for more information.
  11416. func (c *ProjectsAgentKnowledgeBasesListCall) Fields(s ...googleapi.Field) *ProjectsAgentKnowledgeBasesListCall {
  11417. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11418. return c
  11419. }
  11420. // IfNoneMatch sets the optional parameter which makes the operation
  11421. // fail if the object's ETag matches the given value. This is useful for
  11422. // getting updates only after the object has changed since the last
  11423. // request. Use googleapi.IsNotModified to check whether the response
  11424. // error from Do is the result of In-None-Match.
  11425. func (c *ProjectsAgentKnowledgeBasesListCall) IfNoneMatch(entityTag string) *ProjectsAgentKnowledgeBasesListCall {
  11426. c.ifNoneMatch_ = entityTag
  11427. return c
  11428. }
  11429. // Context sets the context to be used in this call's Do method. Any
  11430. // pending HTTP request will be aborted if the provided context is
  11431. // canceled.
  11432. func (c *ProjectsAgentKnowledgeBasesListCall) Context(ctx context.Context) *ProjectsAgentKnowledgeBasesListCall {
  11433. c.ctx_ = ctx
  11434. return c
  11435. }
  11436. // Header returns an http.Header that can be modified by the caller to
  11437. // add HTTP headers to the request.
  11438. func (c *ProjectsAgentKnowledgeBasesListCall) Header() http.Header {
  11439. if c.header_ == nil {
  11440. c.header_ = make(http.Header)
  11441. }
  11442. return c.header_
  11443. }
  11444. func (c *ProjectsAgentKnowledgeBasesListCall) doRequest(alt string) (*http.Response, error) {
  11445. reqHeaders := make(http.Header)
  11446. for k, v := range c.header_ {
  11447. reqHeaders[k] = v
  11448. }
  11449. reqHeaders.Set("User-Agent", c.s.userAgent())
  11450. if c.ifNoneMatch_ != "" {
  11451. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11452. }
  11453. var body io.Reader = nil
  11454. c.urlParams_.Set("alt", alt)
  11455. c.urlParams_.Set("prettyPrint", "false")
  11456. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/knowledgeBases")
  11457. urls += "?" + c.urlParams_.Encode()
  11458. req, err := http.NewRequest("GET", urls, body)
  11459. if err != nil {
  11460. return nil, err
  11461. }
  11462. req.Header = reqHeaders
  11463. googleapi.Expand(req.URL, map[string]string{
  11464. "parent": c.parent,
  11465. })
  11466. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11467. }
  11468. // Do executes the "dialogflow.projects.agent.knowledgeBases.list" call.
  11469. // Exactly one of
  11470. // *GoogleCloudDialogflowV2beta1ListKnowledgeBasesResponse or error will
  11471. // be non-nil. Any non-2xx status code is an error. Response headers are
  11472. // in either
  11473. // *GoogleCloudDialogflowV2beta1ListKnowledgeBasesResponse.ServerResponse
  11474. // .Header or (if a response was returned at all) in
  11475. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  11476. // whether the returned error was because http.StatusNotModified was
  11477. // returned.
  11478. func (c *ProjectsAgentKnowledgeBasesListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1ListKnowledgeBasesResponse, error) {
  11479. gensupport.SetOptions(c.urlParams_, opts...)
  11480. res, err := c.doRequest("json")
  11481. if res != nil && res.StatusCode == http.StatusNotModified {
  11482. if res.Body != nil {
  11483. res.Body.Close()
  11484. }
  11485. return nil, &googleapi.Error{
  11486. Code: res.StatusCode,
  11487. Header: res.Header,
  11488. }
  11489. }
  11490. if err != nil {
  11491. return nil, err
  11492. }
  11493. defer googleapi.CloseBody(res)
  11494. if err := googleapi.CheckResponse(res); err != nil {
  11495. return nil, err
  11496. }
  11497. ret := &GoogleCloudDialogflowV2beta1ListKnowledgeBasesResponse{
  11498. ServerResponse: googleapi.ServerResponse{
  11499. Header: res.Header,
  11500. HTTPStatusCode: res.StatusCode,
  11501. },
  11502. }
  11503. target := &ret
  11504. if err := gensupport.DecodeResponse(target, res); err != nil {
  11505. return nil, err
  11506. }
  11507. return ret, nil
  11508. // {
  11509. // "description": "Returns the list of all knowledge bases of the specified agent.",
  11510. // "flatPath": "v2beta1/projects/{projectsId}/agent/knowledgeBases",
  11511. // "httpMethod": "GET",
  11512. // "id": "dialogflow.projects.agent.knowledgeBases.list",
  11513. // "parameterOrder": [
  11514. // "parent"
  11515. // ],
  11516. // "parameters": {
  11517. // "pageSize": {
  11518. // "description": "Optional. The maximum number of items to return in a single page. By\ndefault 10 and at most 100.",
  11519. // "format": "int32",
  11520. // "location": "query",
  11521. // "type": "integer"
  11522. // },
  11523. // "pageToken": {
  11524. // "description": "Optional. The next_page_token value returned from a previous list request.",
  11525. // "location": "query",
  11526. // "type": "string"
  11527. // },
  11528. // "parent": {
  11529. // "description": "Required. The project to list of knowledge bases for.\nFormat: `projects/\u003cProject ID\u003e`.",
  11530. // "location": "path",
  11531. // "pattern": "^projects/[^/]+/agent$",
  11532. // "required": true,
  11533. // "type": "string"
  11534. // }
  11535. // },
  11536. // "path": "v2beta1/{+parent}/knowledgeBases",
  11537. // "response": {
  11538. // "$ref": "GoogleCloudDialogflowV2beta1ListKnowledgeBasesResponse"
  11539. // },
  11540. // "scopes": [
  11541. // "https://www.googleapis.com/auth/cloud-platform",
  11542. // "https://www.googleapis.com/auth/dialogflow"
  11543. // ]
  11544. // }
  11545. }
  11546. // Pages invokes f for each page of results.
  11547. // A non-nil error returned from f will halt the iteration.
  11548. // The provided context supersedes any context provided to the Context method.
  11549. func (c *ProjectsAgentKnowledgeBasesListCall) Pages(ctx context.Context, f func(*GoogleCloudDialogflowV2beta1ListKnowledgeBasesResponse) error) error {
  11550. c.ctx_ = ctx
  11551. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  11552. for {
  11553. x, err := c.Do()
  11554. if err != nil {
  11555. return err
  11556. }
  11557. if err := f(x); err != nil {
  11558. return err
  11559. }
  11560. if x.NextPageToken == "" {
  11561. return nil
  11562. }
  11563. c.PageToken(x.NextPageToken)
  11564. }
  11565. }
  11566. // method id "dialogflow.projects.agent.knowledgeBases.patch":
  11567. type ProjectsAgentKnowledgeBasesPatchCall struct {
  11568. s *Service
  11569. name string
  11570. googleclouddialogflowv2beta1knowledgebase *GoogleCloudDialogflowV2beta1KnowledgeBase
  11571. urlParams_ gensupport.URLParams
  11572. ctx_ context.Context
  11573. header_ http.Header
  11574. }
  11575. // Patch: Updates the specified knowledge base.
  11576. func (r *ProjectsAgentKnowledgeBasesService) Patch(name string, googleclouddialogflowv2beta1knowledgebase *GoogleCloudDialogflowV2beta1KnowledgeBase) *ProjectsAgentKnowledgeBasesPatchCall {
  11577. c := &ProjectsAgentKnowledgeBasesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11578. c.name = name
  11579. c.googleclouddialogflowv2beta1knowledgebase = googleclouddialogflowv2beta1knowledgebase
  11580. return c
  11581. }
  11582. // UpdateMask sets the optional parameter "updateMask": Not specified
  11583. // means `update all`.
  11584. // Currently, only `display_name` can be updated, an InvalidArgument
  11585. // will be
  11586. // returned for attempting to update other fields.
  11587. func (c *ProjectsAgentKnowledgeBasesPatchCall) UpdateMask(updateMask string) *ProjectsAgentKnowledgeBasesPatchCall {
  11588. c.urlParams_.Set("updateMask", updateMask)
  11589. return c
  11590. }
  11591. // Fields allows partial responses to be retrieved. See
  11592. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11593. // for more information.
  11594. func (c *ProjectsAgentKnowledgeBasesPatchCall) Fields(s ...googleapi.Field) *ProjectsAgentKnowledgeBasesPatchCall {
  11595. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11596. return c
  11597. }
  11598. // Context sets the context to be used in this call's Do method. Any
  11599. // pending HTTP request will be aborted if the provided context is
  11600. // canceled.
  11601. func (c *ProjectsAgentKnowledgeBasesPatchCall) Context(ctx context.Context) *ProjectsAgentKnowledgeBasesPatchCall {
  11602. c.ctx_ = ctx
  11603. return c
  11604. }
  11605. // Header returns an http.Header that can be modified by the caller to
  11606. // add HTTP headers to the request.
  11607. func (c *ProjectsAgentKnowledgeBasesPatchCall) Header() http.Header {
  11608. if c.header_ == nil {
  11609. c.header_ = make(http.Header)
  11610. }
  11611. return c.header_
  11612. }
  11613. func (c *ProjectsAgentKnowledgeBasesPatchCall) doRequest(alt string) (*http.Response, error) {
  11614. reqHeaders := make(http.Header)
  11615. for k, v := range c.header_ {
  11616. reqHeaders[k] = v
  11617. }
  11618. reqHeaders.Set("User-Agent", c.s.userAgent())
  11619. var body io.Reader = nil
  11620. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1knowledgebase)
  11621. if err != nil {
  11622. return nil, err
  11623. }
  11624. reqHeaders.Set("Content-Type", "application/json")
  11625. c.urlParams_.Set("alt", alt)
  11626. c.urlParams_.Set("prettyPrint", "false")
  11627. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  11628. urls += "?" + c.urlParams_.Encode()
  11629. req, err := http.NewRequest("PATCH", urls, body)
  11630. if err != nil {
  11631. return nil, err
  11632. }
  11633. req.Header = reqHeaders
  11634. googleapi.Expand(req.URL, map[string]string{
  11635. "name": c.name,
  11636. })
  11637. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11638. }
  11639. // Do executes the "dialogflow.projects.agent.knowledgeBases.patch" call.
  11640. // Exactly one of *GoogleCloudDialogflowV2beta1KnowledgeBase or error
  11641. // will be non-nil. Any non-2xx status code is an error. Response
  11642. // headers are in either
  11643. // *GoogleCloudDialogflowV2beta1KnowledgeBase.ServerResponse.Header or
  11644. // (if a response was returned at all) in
  11645. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  11646. // whether the returned error was because http.StatusNotModified was
  11647. // returned.
  11648. func (c *ProjectsAgentKnowledgeBasesPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1KnowledgeBase, error) {
  11649. gensupport.SetOptions(c.urlParams_, opts...)
  11650. res, err := c.doRequest("json")
  11651. if res != nil && res.StatusCode == http.StatusNotModified {
  11652. if res.Body != nil {
  11653. res.Body.Close()
  11654. }
  11655. return nil, &googleapi.Error{
  11656. Code: res.StatusCode,
  11657. Header: res.Header,
  11658. }
  11659. }
  11660. if err != nil {
  11661. return nil, err
  11662. }
  11663. defer googleapi.CloseBody(res)
  11664. if err := googleapi.CheckResponse(res); err != nil {
  11665. return nil, err
  11666. }
  11667. ret := &GoogleCloudDialogflowV2beta1KnowledgeBase{
  11668. ServerResponse: googleapi.ServerResponse{
  11669. Header: res.Header,
  11670. HTTPStatusCode: res.StatusCode,
  11671. },
  11672. }
  11673. target := &ret
  11674. if err := gensupport.DecodeResponse(target, res); err != nil {
  11675. return nil, err
  11676. }
  11677. return ret, nil
  11678. // {
  11679. // "description": "Updates the specified knowledge base.",
  11680. // "flatPath": "v2beta1/projects/{projectsId}/agent/knowledgeBases/{knowledgeBasesId}",
  11681. // "httpMethod": "PATCH",
  11682. // "id": "dialogflow.projects.agent.knowledgeBases.patch",
  11683. // "parameterOrder": [
  11684. // "name"
  11685. // ],
  11686. // "parameters": {
  11687. // "name": {
  11688. // "description": "The knowledge base resource name.\nThe name must be empty when creating a knowledge base.\nFormat: `projects/\u003cProject ID\u003e/knowledgeBases/\u003cKnowledge Base ID\u003e`.",
  11689. // "location": "path",
  11690. // "pattern": "^projects/[^/]+/agent/knowledgeBases/[^/]+$",
  11691. // "required": true,
  11692. // "type": "string"
  11693. // },
  11694. // "updateMask": {
  11695. // "description": "Optional. Not specified means `update all`.\nCurrently, only `display_name` can be updated, an InvalidArgument will be\nreturned for attempting to update other fields.",
  11696. // "format": "google-fieldmask",
  11697. // "location": "query",
  11698. // "type": "string"
  11699. // }
  11700. // },
  11701. // "path": "v2beta1/{+name}",
  11702. // "request": {
  11703. // "$ref": "GoogleCloudDialogflowV2beta1KnowledgeBase"
  11704. // },
  11705. // "response": {
  11706. // "$ref": "GoogleCloudDialogflowV2beta1KnowledgeBase"
  11707. // },
  11708. // "scopes": [
  11709. // "https://www.googleapis.com/auth/cloud-platform",
  11710. // "https://www.googleapis.com/auth/dialogflow"
  11711. // ]
  11712. // }
  11713. }
  11714. // method id "dialogflow.projects.agent.knowledgeBases.documents.create":
  11715. type ProjectsAgentKnowledgeBasesDocumentsCreateCall struct {
  11716. s *Service
  11717. parent string
  11718. googleclouddialogflowv2beta1document *GoogleCloudDialogflowV2beta1Document
  11719. urlParams_ gensupport.URLParams
  11720. ctx_ context.Context
  11721. header_ http.Header
  11722. }
  11723. // Create: Creates a new document.
  11724. //
  11725. // Operation <response: Document,
  11726. // metadata: KnowledgeOperationMetadata>
  11727. func (r *ProjectsAgentKnowledgeBasesDocumentsService) Create(parent string, googleclouddialogflowv2beta1document *GoogleCloudDialogflowV2beta1Document) *ProjectsAgentKnowledgeBasesDocumentsCreateCall {
  11728. c := &ProjectsAgentKnowledgeBasesDocumentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11729. c.parent = parent
  11730. c.googleclouddialogflowv2beta1document = googleclouddialogflowv2beta1document
  11731. return c
  11732. }
  11733. // Fields allows partial responses to be retrieved. See
  11734. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11735. // for more information.
  11736. func (c *ProjectsAgentKnowledgeBasesDocumentsCreateCall) Fields(s ...googleapi.Field) *ProjectsAgentKnowledgeBasesDocumentsCreateCall {
  11737. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11738. return c
  11739. }
  11740. // Context sets the context to be used in this call's Do method. Any
  11741. // pending HTTP request will be aborted if the provided context is
  11742. // canceled.
  11743. func (c *ProjectsAgentKnowledgeBasesDocumentsCreateCall) Context(ctx context.Context) *ProjectsAgentKnowledgeBasesDocumentsCreateCall {
  11744. c.ctx_ = ctx
  11745. return c
  11746. }
  11747. // Header returns an http.Header that can be modified by the caller to
  11748. // add HTTP headers to the request.
  11749. func (c *ProjectsAgentKnowledgeBasesDocumentsCreateCall) Header() http.Header {
  11750. if c.header_ == nil {
  11751. c.header_ = make(http.Header)
  11752. }
  11753. return c.header_
  11754. }
  11755. func (c *ProjectsAgentKnowledgeBasesDocumentsCreateCall) doRequest(alt string) (*http.Response, error) {
  11756. reqHeaders := make(http.Header)
  11757. for k, v := range c.header_ {
  11758. reqHeaders[k] = v
  11759. }
  11760. reqHeaders.Set("User-Agent", c.s.userAgent())
  11761. var body io.Reader = nil
  11762. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1document)
  11763. if err != nil {
  11764. return nil, err
  11765. }
  11766. reqHeaders.Set("Content-Type", "application/json")
  11767. c.urlParams_.Set("alt", alt)
  11768. c.urlParams_.Set("prettyPrint", "false")
  11769. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/documents")
  11770. urls += "?" + c.urlParams_.Encode()
  11771. req, err := http.NewRequest("POST", urls, body)
  11772. if err != nil {
  11773. return nil, err
  11774. }
  11775. req.Header = reqHeaders
  11776. googleapi.Expand(req.URL, map[string]string{
  11777. "parent": c.parent,
  11778. })
  11779. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11780. }
  11781. // Do executes the "dialogflow.projects.agent.knowledgeBases.documents.create" call.
  11782. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  11783. // Any non-2xx status code is an error. Response headers are in either
  11784. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  11785. // was returned at all) in error.(*googleapi.Error).Header. Use
  11786. // googleapi.IsNotModified to check whether the returned error was
  11787. // because http.StatusNotModified was returned.
  11788. func (c *ProjectsAgentKnowledgeBasesDocumentsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  11789. gensupport.SetOptions(c.urlParams_, opts...)
  11790. res, err := c.doRequest("json")
  11791. if res != nil && res.StatusCode == http.StatusNotModified {
  11792. if res.Body != nil {
  11793. res.Body.Close()
  11794. }
  11795. return nil, &googleapi.Error{
  11796. Code: res.StatusCode,
  11797. Header: res.Header,
  11798. }
  11799. }
  11800. if err != nil {
  11801. return nil, err
  11802. }
  11803. defer googleapi.CloseBody(res)
  11804. if err := googleapi.CheckResponse(res); err != nil {
  11805. return nil, err
  11806. }
  11807. ret := &GoogleLongrunningOperation{
  11808. ServerResponse: googleapi.ServerResponse{
  11809. Header: res.Header,
  11810. HTTPStatusCode: res.StatusCode,
  11811. },
  11812. }
  11813. target := &ret
  11814. if err := gensupport.DecodeResponse(target, res); err != nil {
  11815. return nil, err
  11816. }
  11817. return ret, nil
  11818. // {
  11819. // "description": "Creates a new document.\n\nOperation \u003cresponse: Document,\n metadata: KnowledgeOperationMetadata\u003e",
  11820. // "flatPath": "v2beta1/projects/{projectsId}/agent/knowledgeBases/{knowledgeBasesId}/documents",
  11821. // "httpMethod": "POST",
  11822. // "id": "dialogflow.projects.agent.knowledgeBases.documents.create",
  11823. // "parameterOrder": [
  11824. // "parent"
  11825. // ],
  11826. // "parameters": {
  11827. // "parent": {
  11828. // "description": "Required. The knoweldge base to create a document for.\nFormat: `projects/\u003cProject ID\u003e/knowledgeBases/\u003cKnowledge Base ID\u003e`.",
  11829. // "location": "path",
  11830. // "pattern": "^projects/[^/]+/agent/knowledgeBases/[^/]+$",
  11831. // "required": true,
  11832. // "type": "string"
  11833. // }
  11834. // },
  11835. // "path": "v2beta1/{+parent}/documents",
  11836. // "request": {
  11837. // "$ref": "GoogleCloudDialogflowV2beta1Document"
  11838. // },
  11839. // "response": {
  11840. // "$ref": "GoogleLongrunningOperation"
  11841. // },
  11842. // "scopes": [
  11843. // "https://www.googleapis.com/auth/cloud-platform",
  11844. // "https://www.googleapis.com/auth/dialogflow"
  11845. // ]
  11846. // }
  11847. }
  11848. // method id "dialogflow.projects.agent.knowledgeBases.documents.delete":
  11849. type ProjectsAgentKnowledgeBasesDocumentsDeleteCall struct {
  11850. s *Service
  11851. name string
  11852. urlParams_ gensupport.URLParams
  11853. ctx_ context.Context
  11854. header_ http.Header
  11855. }
  11856. // Delete: Deletes the specified document.
  11857. //
  11858. // Operation <response: google.protobuf.Empty,
  11859. // metadata: KnowledgeOperationMetadata>
  11860. func (r *ProjectsAgentKnowledgeBasesDocumentsService) Delete(name string) *ProjectsAgentKnowledgeBasesDocumentsDeleteCall {
  11861. c := &ProjectsAgentKnowledgeBasesDocumentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11862. c.name = name
  11863. return c
  11864. }
  11865. // Fields allows partial responses to be retrieved. See
  11866. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11867. // for more information.
  11868. func (c *ProjectsAgentKnowledgeBasesDocumentsDeleteCall) Fields(s ...googleapi.Field) *ProjectsAgentKnowledgeBasesDocumentsDeleteCall {
  11869. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11870. return c
  11871. }
  11872. // Context sets the context to be used in this call's Do method. Any
  11873. // pending HTTP request will be aborted if the provided context is
  11874. // canceled.
  11875. func (c *ProjectsAgentKnowledgeBasesDocumentsDeleteCall) Context(ctx context.Context) *ProjectsAgentKnowledgeBasesDocumentsDeleteCall {
  11876. c.ctx_ = ctx
  11877. return c
  11878. }
  11879. // Header returns an http.Header that can be modified by the caller to
  11880. // add HTTP headers to the request.
  11881. func (c *ProjectsAgentKnowledgeBasesDocumentsDeleteCall) Header() http.Header {
  11882. if c.header_ == nil {
  11883. c.header_ = make(http.Header)
  11884. }
  11885. return c.header_
  11886. }
  11887. func (c *ProjectsAgentKnowledgeBasesDocumentsDeleteCall) doRequest(alt string) (*http.Response, error) {
  11888. reqHeaders := make(http.Header)
  11889. for k, v := range c.header_ {
  11890. reqHeaders[k] = v
  11891. }
  11892. reqHeaders.Set("User-Agent", c.s.userAgent())
  11893. var body io.Reader = nil
  11894. c.urlParams_.Set("alt", alt)
  11895. c.urlParams_.Set("prettyPrint", "false")
  11896. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  11897. urls += "?" + c.urlParams_.Encode()
  11898. req, err := http.NewRequest("DELETE", urls, body)
  11899. if err != nil {
  11900. return nil, err
  11901. }
  11902. req.Header = reqHeaders
  11903. googleapi.Expand(req.URL, map[string]string{
  11904. "name": c.name,
  11905. })
  11906. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11907. }
  11908. // Do executes the "dialogflow.projects.agent.knowledgeBases.documents.delete" call.
  11909. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  11910. // Any non-2xx status code is an error. Response headers are in either
  11911. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  11912. // was returned at all) in error.(*googleapi.Error).Header. Use
  11913. // googleapi.IsNotModified to check whether the returned error was
  11914. // because http.StatusNotModified was returned.
  11915. func (c *ProjectsAgentKnowledgeBasesDocumentsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  11916. gensupport.SetOptions(c.urlParams_, opts...)
  11917. res, err := c.doRequest("json")
  11918. if res != nil && res.StatusCode == http.StatusNotModified {
  11919. if res.Body != nil {
  11920. res.Body.Close()
  11921. }
  11922. return nil, &googleapi.Error{
  11923. Code: res.StatusCode,
  11924. Header: res.Header,
  11925. }
  11926. }
  11927. if err != nil {
  11928. return nil, err
  11929. }
  11930. defer googleapi.CloseBody(res)
  11931. if err := googleapi.CheckResponse(res); err != nil {
  11932. return nil, err
  11933. }
  11934. ret := &GoogleLongrunningOperation{
  11935. ServerResponse: googleapi.ServerResponse{
  11936. Header: res.Header,
  11937. HTTPStatusCode: res.StatusCode,
  11938. },
  11939. }
  11940. target := &ret
  11941. if err := gensupport.DecodeResponse(target, res); err != nil {
  11942. return nil, err
  11943. }
  11944. return ret, nil
  11945. // {
  11946. // "description": "Deletes the specified document.\n\nOperation \u003cresponse: google.protobuf.Empty,\n metadata: KnowledgeOperationMetadata\u003e",
  11947. // "flatPath": "v2beta1/projects/{projectsId}/agent/knowledgeBases/{knowledgeBasesId}/documents/{documentsId}",
  11948. // "httpMethod": "DELETE",
  11949. // "id": "dialogflow.projects.agent.knowledgeBases.documents.delete",
  11950. // "parameterOrder": [
  11951. // "name"
  11952. // ],
  11953. // "parameters": {
  11954. // "name": {
  11955. // "description": "The name of the document to delete.\nFormat: `projects/\u003cProject ID\u003e/knowledgeBases/\u003cKnowledge Base\nID\u003e/documents/\u003cDocument ID\u003e`.",
  11956. // "location": "path",
  11957. // "pattern": "^projects/[^/]+/agent/knowledgeBases/[^/]+/documents/[^/]+$",
  11958. // "required": true,
  11959. // "type": "string"
  11960. // }
  11961. // },
  11962. // "path": "v2beta1/{+name}",
  11963. // "response": {
  11964. // "$ref": "GoogleLongrunningOperation"
  11965. // },
  11966. // "scopes": [
  11967. // "https://www.googleapis.com/auth/cloud-platform",
  11968. // "https://www.googleapis.com/auth/dialogflow"
  11969. // ]
  11970. // }
  11971. }
  11972. // method id "dialogflow.projects.agent.knowledgeBases.documents.get":
  11973. type ProjectsAgentKnowledgeBasesDocumentsGetCall struct {
  11974. s *Service
  11975. name string
  11976. urlParams_ gensupport.URLParams
  11977. ifNoneMatch_ string
  11978. ctx_ context.Context
  11979. header_ http.Header
  11980. }
  11981. // Get: Retrieves the specified document.
  11982. func (r *ProjectsAgentKnowledgeBasesDocumentsService) Get(name string) *ProjectsAgentKnowledgeBasesDocumentsGetCall {
  11983. c := &ProjectsAgentKnowledgeBasesDocumentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11984. c.name = name
  11985. return c
  11986. }
  11987. // Fields allows partial responses to be retrieved. See
  11988. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11989. // for more information.
  11990. func (c *ProjectsAgentKnowledgeBasesDocumentsGetCall) Fields(s ...googleapi.Field) *ProjectsAgentKnowledgeBasesDocumentsGetCall {
  11991. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11992. return c
  11993. }
  11994. // IfNoneMatch sets the optional parameter which makes the operation
  11995. // fail if the object's ETag matches the given value. This is useful for
  11996. // getting updates only after the object has changed since the last
  11997. // request. Use googleapi.IsNotModified to check whether the response
  11998. // error from Do is the result of In-None-Match.
  11999. func (c *ProjectsAgentKnowledgeBasesDocumentsGetCall) IfNoneMatch(entityTag string) *ProjectsAgentKnowledgeBasesDocumentsGetCall {
  12000. c.ifNoneMatch_ = entityTag
  12001. return c
  12002. }
  12003. // Context sets the context to be used in this call's Do method. Any
  12004. // pending HTTP request will be aborted if the provided context is
  12005. // canceled.
  12006. func (c *ProjectsAgentKnowledgeBasesDocumentsGetCall) Context(ctx context.Context) *ProjectsAgentKnowledgeBasesDocumentsGetCall {
  12007. c.ctx_ = ctx
  12008. return c
  12009. }
  12010. // Header returns an http.Header that can be modified by the caller to
  12011. // add HTTP headers to the request.
  12012. func (c *ProjectsAgentKnowledgeBasesDocumentsGetCall) Header() http.Header {
  12013. if c.header_ == nil {
  12014. c.header_ = make(http.Header)
  12015. }
  12016. return c.header_
  12017. }
  12018. func (c *ProjectsAgentKnowledgeBasesDocumentsGetCall) doRequest(alt string) (*http.Response, error) {
  12019. reqHeaders := make(http.Header)
  12020. for k, v := range c.header_ {
  12021. reqHeaders[k] = v
  12022. }
  12023. reqHeaders.Set("User-Agent", c.s.userAgent())
  12024. if c.ifNoneMatch_ != "" {
  12025. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12026. }
  12027. var body io.Reader = nil
  12028. c.urlParams_.Set("alt", alt)
  12029. c.urlParams_.Set("prettyPrint", "false")
  12030. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  12031. urls += "?" + c.urlParams_.Encode()
  12032. req, err := http.NewRequest("GET", urls, body)
  12033. if err != nil {
  12034. return nil, err
  12035. }
  12036. req.Header = reqHeaders
  12037. googleapi.Expand(req.URL, map[string]string{
  12038. "name": c.name,
  12039. })
  12040. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12041. }
  12042. // Do executes the "dialogflow.projects.agent.knowledgeBases.documents.get" call.
  12043. // Exactly one of *GoogleCloudDialogflowV2beta1Document or error will be
  12044. // non-nil. Any non-2xx status code is an error. Response headers are in
  12045. // either *GoogleCloudDialogflowV2beta1Document.ServerResponse.Header or
  12046. // (if a response was returned at all) in
  12047. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  12048. // whether the returned error was because http.StatusNotModified was
  12049. // returned.
  12050. func (c *ProjectsAgentKnowledgeBasesDocumentsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1Document, error) {
  12051. gensupport.SetOptions(c.urlParams_, opts...)
  12052. res, err := c.doRequest("json")
  12053. if res != nil && res.StatusCode == http.StatusNotModified {
  12054. if res.Body != nil {
  12055. res.Body.Close()
  12056. }
  12057. return nil, &googleapi.Error{
  12058. Code: res.StatusCode,
  12059. Header: res.Header,
  12060. }
  12061. }
  12062. if err != nil {
  12063. return nil, err
  12064. }
  12065. defer googleapi.CloseBody(res)
  12066. if err := googleapi.CheckResponse(res); err != nil {
  12067. return nil, err
  12068. }
  12069. ret := &GoogleCloudDialogflowV2beta1Document{
  12070. ServerResponse: googleapi.ServerResponse{
  12071. Header: res.Header,
  12072. HTTPStatusCode: res.StatusCode,
  12073. },
  12074. }
  12075. target := &ret
  12076. if err := gensupport.DecodeResponse(target, res); err != nil {
  12077. return nil, err
  12078. }
  12079. return ret, nil
  12080. // {
  12081. // "description": "Retrieves the specified document.",
  12082. // "flatPath": "v2beta1/projects/{projectsId}/agent/knowledgeBases/{knowledgeBasesId}/documents/{documentsId}",
  12083. // "httpMethod": "GET",
  12084. // "id": "dialogflow.projects.agent.knowledgeBases.documents.get",
  12085. // "parameterOrder": [
  12086. // "name"
  12087. // ],
  12088. // "parameters": {
  12089. // "name": {
  12090. // "description": "Required. The name of the document to retrieve.\nFormat `projects/\u003cProject ID\u003e/knowledgeBases/\u003cKnowledge Base\nID\u003e/documents/\u003cDocument ID\u003e`.",
  12091. // "location": "path",
  12092. // "pattern": "^projects/[^/]+/agent/knowledgeBases/[^/]+/documents/[^/]+$",
  12093. // "required": true,
  12094. // "type": "string"
  12095. // }
  12096. // },
  12097. // "path": "v2beta1/{+name}",
  12098. // "response": {
  12099. // "$ref": "GoogleCloudDialogflowV2beta1Document"
  12100. // },
  12101. // "scopes": [
  12102. // "https://www.googleapis.com/auth/cloud-platform",
  12103. // "https://www.googleapis.com/auth/dialogflow"
  12104. // ]
  12105. // }
  12106. }
  12107. // method id "dialogflow.projects.agent.knowledgeBases.documents.list":
  12108. type ProjectsAgentKnowledgeBasesDocumentsListCall struct {
  12109. s *Service
  12110. parent string
  12111. urlParams_ gensupport.URLParams
  12112. ifNoneMatch_ string
  12113. ctx_ context.Context
  12114. header_ http.Header
  12115. }
  12116. // List: Returns the list of all documents of the knowledge base.
  12117. func (r *ProjectsAgentKnowledgeBasesDocumentsService) List(parent string) *ProjectsAgentKnowledgeBasesDocumentsListCall {
  12118. c := &ProjectsAgentKnowledgeBasesDocumentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12119. c.parent = parent
  12120. return c
  12121. }
  12122. // PageSize sets the optional parameter "pageSize": The maximum number
  12123. // of items to return in a single page. By
  12124. // default 10 and at most 100.
  12125. func (c *ProjectsAgentKnowledgeBasesDocumentsListCall) PageSize(pageSize int64) *ProjectsAgentKnowledgeBasesDocumentsListCall {
  12126. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  12127. return c
  12128. }
  12129. // PageToken sets the optional parameter "pageToken": The
  12130. // next_page_token value returned from a previous list request.
  12131. func (c *ProjectsAgentKnowledgeBasesDocumentsListCall) PageToken(pageToken string) *ProjectsAgentKnowledgeBasesDocumentsListCall {
  12132. c.urlParams_.Set("pageToken", pageToken)
  12133. return c
  12134. }
  12135. // Fields allows partial responses to be retrieved. See
  12136. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12137. // for more information.
  12138. func (c *ProjectsAgentKnowledgeBasesDocumentsListCall) Fields(s ...googleapi.Field) *ProjectsAgentKnowledgeBasesDocumentsListCall {
  12139. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12140. return c
  12141. }
  12142. // IfNoneMatch sets the optional parameter which makes the operation
  12143. // fail if the object's ETag matches the given value. This is useful for
  12144. // getting updates only after the object has changed since the last
  12145. // request. Use googleapi.IsNotModified to check whether the response
  12146. // error from Do is the result of In-None-Match.
  12147. func (c *ProjectsAgentKnowledgeBasesDocumentsListCall) IfNoneMatch(entityTag string) *ProjectsAgentKnowledgeBasesDocumentsListCall {
  12148. c.ifNoneMatch_ = entityTag
  12149. return c
  12150. }
  12151. // Context sets the context to be used in this call's Do method. Any
  12152. // pending HTTP request will be aborted if the provided context is
  12153. // canceled.
  12154. func (c *ProjectsAgentKnowledgeBasesDocumentsListCall) Context(ctx context.Context) *ProjectsAgentKnowledgeBasesDocumentsListCall {
  12155. c.ctx_ = ctx
  12156. return c
  12157. }
  12158. // Header returns an http.Header that can be modified by the caller to
  12159. // add HTTP headers to the request.
  12160. func (c *ProjectsAgentKnowledgeBasesDocumentsListCall) Header() http.Header {
  12161. if c.header_ == nil {
  12162. c.header_ = make(http.Header)
  12163. }
  12164. return c.header_
  12165. }
  12166. func (c *ProjectsAgentKnowledgeBasesDocumentsListCall) doRequest(alt string) (*http.Response, error) {
  12167. reqHeaders := make(http.Header)
  12168. for k, v := range c.header_ {
  12169. reqHeaders[k] = v
  12170. }
  12171. reqHeaders.Set("User-Agent", c.s.userAgent())
  12172. if c.ifNoneMatch_ != "" {
  12173. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12174. }
  12175. var body io.Reader = nil
  12176. c.urlParams_.Set("alt", alt)
  12177. c.urlParams_.Set("prettyPrint", "false")
  12178. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/documents")
  12179. urls += "?" + c.urlParams_.Encode()
  12180. req, err := http.NewRequest("GET", urls, body)
  12181. if err != nil {
  12182. return nil, err
  12183. }
  12184. req.Header = reqHeaders
  12185. googleapi.Expand(req.URL, map[string]string{
  12186. "parent": c.parent,
  12187. })
  12188. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12189. }
  12190. // Do executes the "dialogflow.projects.agent.knowledgeBases.documents.list" call.
  12191. // Exactly one of *GoogleCloudDialogflowV2beta1ListDocumentsResponse or
  12192. // error will be non-nil. Any non-2xx status code is an error. Response
  12193. // headers are in either
  12194. // *GoogleCloudDialogflowV2beta1ListDocumentsResponse.ServerResponse.Head
  12195. // er or (if a response was returned at all) in
  12196. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  12197. // whether the returned error was because http.StatusNotModified was
  12198. // returned.
  12199. func (c *ProjectsAgentKnowledgeBasesDocumentsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1ListDocumentsResponse, error) {
  12200. gensupport.SetOptions(c.urlParams_, opts...)
  12201. res, err := c.doRequest("json")
  12202. if res != nil && res.StatusCode == http.StatusNotModified {
  12203. if res.Body != nil {
  12204. res.Body.Close()
  12205. }
  12206. return nil, &googleapi.Error{
  12207. Code: res.StatusCode,
  12208. Header: res.Header,
  12209. }
  12210. }
  12211. if err != nil {
  12212. return nil, err
  12213. }
  12214. defer googleapi.CloseBody(res)
  12215. if err := googleapi.CheckResponse(res); err != nil {
  12216. return nil, err
  12217. }
  12218. ret := &GoogleCloudDialogflowV2beta1ListDocumentsResponse{
  12219. ServerResponse: googleapi.ServerResponse{
  12220. Header: res.Header,
  12221. HTTPStatusCode: res.StatusCode,
  12222. },
  12223. }
  12224. target := &ret
  12225. if err := gensupport.DecodeResponse(target, res); err != nil {
  12226. return nil, err
  12227. }
  12228. return ret, nil
  12229. // {
  12230. // "description": "Returns the list of all documents of the knowledge base.",
  12231. // "flatPath": "v2beta1/projects/{projectsId}/agent/knowledgeBases/{knowledgeBasesId}/documents",
  12232. // "httpMethod": "GET",
  12233. // "id": "dialogflow.projects.agent.knowledgeBases.documents.list",
  12234. // "parameterOrder": [
  12235. // "parent"
  12236. // ],
  12237. // "parameters": {
  12238. // "pageSize": {
  12239. // "description": "Optional. The maximum number of items to return in a single page. By\ndefault 10 and at most 100.",
  12240. // "format": "int32",
  12241. // "location": "query",
  12242. // "type": "integer"
  12243. // },
  12244. // "pageToken": {
  12245. // "description": "Optional. The next_page_token value returned from a previous list request.",
  12246. // "location": "query",
  12247. // "type": "string"
  12248. // },
  12249. // "parent": {
  12250. // "description": "Required. The knowledge base to list all documents for.\nFormat: `projects/\u003cProject ID\u003e/knowledgeBases/\u003cKnowledge Base ID\u003e`.",
  12251. // "location": "path",
  12252. // "pattern": "^projects/[^/]+/agent/knowledgeBases/[^/]+$",
  12253. // "required": true,
  12254. // "type": "string"
  12255. // }
  12256. // },
  12257. // "path": "v2beta1/{+parent}/documents",
  12258. // "response": {
  12259. // "$ref": "GoogleCloudDialogflowV2beta1ListDocumentsResponse"
  12260. // },
  12261. // "scopes": [
  12262. // "https://www.googleapis.com/auth/cloud-platform",
  12263. // "https://www.googleapis.com/auth/dialogflow"
  12264. // ]
  12265. // }
  12266. }
  12267. // Pages invokes f for each page of results.
  12268. // A non-nil error returned from f will halt the iteration.
  12269. // The provided context supersedes any context provided to the Context method.
  12270. func (c *ProjectsAgentKnowledgeBasesDocumentsListCall) Pages(ctx context.Context, f func(*GoogleCloudDialogflowV2beta1ListDocumentsResponse) error) error {
  12271. c.ctx_ = ctx
  12272. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  12273. for {
  12274. x, err := c.Do()
  12275. if err != nil {
  12276. return err
  12277. }
  12278. if err := f(x); err != nil {
  12279. return err
  12280. }
  12281. if x.NextPageToken == "" {
  12282. return nil
  12283. }
  12284. c.PageToken(x.NextPageToken)
  12285. }
  12286. }
  12287. // method id "dialogflow.projects.agent.knowledgeBases.documents.patch":
  12288. type ProjectsAgentKnowledgeBasesDocumentsPatchCall struct {
  12289. s *Service
  12290. name string
  12291. googleclouddialogflowv2beta1document *GoogleCloudDialogflowV2beta1Document
  12292. urlParams_ gensupport.URLParams
  12293. ctx_ context.Context
  12294. header_ http.Header
  12295. }
  12296. // Patch: Updates the specified document.
  12297. // Operation <response: Document,
  12298. // metadata: KnowledgeOperationMetadata>
  12299. func (r *ProjectsAgentKnowledgeBasesDocumentsService) Patch(name string, googleclouddialogflowv2beta1document *GoogleCloudDialogflowV2beta1Document) *ProjectsAgentKnowledgeBasesDocumentsPatchCall {
  12300. c := &ProjectsAgentKnowledgeBasesDocumentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12301. c.name = name
  12302. c.googleclouddialogflowv2beta1document = googleclouddialogflowv2beta1document
  12303. return c
  12304. }
  12305. // UpdateMask sets the optional parameter "updateMask": Not specified
  12306. // means `update all`.
  12307. // Currently, only `display_name` can be updated, an InvalidArgument
  12308. // will be
  12309. // returned for attempting to update other fields.
  12310. func (c *ProjectsAgentKnowledgeBasesDocumentsPatchCall) UpdateMask(updateMask string) *ProjectsAgentKnowledgeBasesDocumentsPatchCall {
  12311. c.urlParams_.Set("updateMask", updateMask)
  12312. return c
  12313. }
  12314. // Fields allows partial responses to be retrieved. See
  12315. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12316. // for more information.
  12317. func (c *ProjectsAgentKnowledgeBasesDocumentsPatchCall) Fields(s ...googleapi.Field) *ProjectsAgentKnowledgeBasesDocumentsPatchCall {
  12318. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12319. return c
  12320. }
  12321. // Context sets the context to be used in this call's Do method. Any
  12322. // pending HTTP request will be aborted if the provided context is
  12323. // canceled.
  12324. func (c *ProjectsAgentKnowledgeBasesDocumentsPatchCall) Context(ctx context.Context) *ProjectsAgentKnowledgeBasesDocumentsPatchCall {
  12325. c.ctx_ = ctx
  12326. return c
  12327. }
  12328. // Header returns an http.Header that can be modified by the caller to
  12329. // add HTTP headers to the request.
  12330. func (c *ProjectsAgentKnowledgeBasesDocumentsPatchCall) Header() http.Header {
  12331. if c.header_ == nil {
  12332. c.header_ = make(http.Header)
  12333. }
  12334. return c.header_
  12335. }
  12336. func (c *ProjectsAgentKnowledgeBasesDocumentsPatchCall) doRequest(alt string) (*http.Response, error) {
  12337. reqHeaders := make(http.Header)
  12338. for k, v := range c.header_ {
  12339. reqHeaders[k] = v
  12340. }
  12341. reqHeaders.Set("User-Agent", c.s.userAgent())
  12342. var body io.Reader = nil
  12343. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1document)
  12344. if err != nil {
  12345. return nil, err
  12346. }
  12347. reqHeaders.Set("Content-Type", "application/json")
  12348. c.urlParams_.Set("alt", alt)
  12349. c.urlParams_.Set("prettyPrint", "false")
  12350. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  12351. urls += "?" + c.urlParams_.Encode()
  12352. req, err := http.NewRequest("PATCH", urls, body)
  12353. if err != nil {
  12354. return nil, err
  12355. }
  12356. req.Header = reqHeaders
  12357. googleapi.Expand(req.URL, map[string]string{
  12358. "name": c.name,
  12359. })
  12360. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12361. }
  12362. // Do executes the "dialogflow.projects.agent.knowledgeBases.documents.patch" call.
  12363. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  12364. // Any non-2xx status code is an error. Response headers are in either
  12365. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  12366. // was returned at all) in error.(*googleapi.Error).Header. Use
  12367. // googleapi.IsNotModified to check whether the returned error was
  12368. // because http.StatusNotModified was returned.
  12369. func (c *ProjectsAgentKnowledgeBasesDocumentsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  12370. gensupport.SetOptions(c.urlParams_, opts...)
  12371. res, err := c.doRequest("json")
  12372. if res != nil && res.StatusCode == http.StatusNotModified {
  12373. if res.Body != nil {
  12374. res.Body.Close()
  12375. }
  12376. return nil, &googleapi.Error{
  12377. Code: res.StatusCode,
  12378. Header: res.Header,
  12379. }
  12380. }
  12381. if err != nil {
  12382. return nil, err
  12383. }
  12384. defer googleapi.CloseBody(res)
  12385. if err := googleapi.CheckResponse(res); err != nil {
  12386. return nil, err
  12387. }
  12388. ret := &GoogleLongrunningOperation{
  12389. ServerResponse: googleapi.ServerResponse{
  12390. Header: res.Header,
  12391. HTTPStatusCode: res.StatusCode,
  12392. },
  12393. }
  12394. target := &ret
  12395. if err := gensupport.DecodeResponse(target, res); err != nil {
  12396. return nil, err
  12397. }
  12398. return ret, nil
  12399. // {
  12400. // "description": "Updates the specified document.\nOperation \u003cresponse: Document,\n metadata: KnowledgeOperationMetadata\u003e",
  12401. // "flatPath": "v2beta1/projects/{projectsId}/agent/knowledgeBases/{knowledgeBasesId}/documents/{documentsId}",
  12402. // "httpMethod": "PATCH",
  12403. // "id": "dialogflow.projects.agent.knowledgeBases.documents.patch",
  12404. // "parameterOrder": [
  12405. // "name"
  12406. // ],
  12407. // "parameters": {
  12408. // "name": {
  12409. // "description": "The document resource name.\nThe name must be empty when creating a document.\nFormat: `projects/\u003cProject ID\u003e/knowledgeBases/\u003cKnowledge Base\nID\u003e/documents/\u003cDocument ID\u003e`.",
  12410. // "location": "path",
  12411. // "pattern": "^projects/[^/]+/agent/knowledgeBases/[^/]+/documents/[^/]+$",
  12412. // "required": true,
  12413. // "type": "string"
  12414. // },
  12415. // "updateMask": {
  12416. // "description": "Optional. Not specified means `update all`.\nCurrently, only `display_name` can be updated, an InvalidArgument will be\nreturned for attempting to update other fields.",
  12417. // "format": "google-fieldmask",
  12418. // "location": "query",
  12419. // "type": "string"
  12420. // }
  12421. // },
  12422. // "path": "v2beta1/{+name}",
  12423. // "request": {
  12424. // "$ref": "GoogleCloudDialogflowV2beta1Document"
  12425. // },
  12426. // "response": {
  12427. // "$ref": "GoogleLongrunningOperation"
  12428. // },
  12429. // "scopes": [
  12430. // "https://www.googleapis.com/auth/cloud-platform",
  12431. // "https://www.googleapis.com/auth/dialogflow"
  12432. // ]
  12433. // }
  12434. }
  12435. // method id "dialogflow.projects.agent.knowledgeBases.documents.reload":
  12436. type ProjectsAgentKnowledgeBasesDocumentsReloadCall struct {
  12437. s *Service
  12438. name string
  12439. googleclouddialogflowv2beta1reloaddocumentrequest *GoogleCloudDialogflowV2beta1ReloadDocumentRequest
  12440. urlParams_ gensupport.URLParams
  12441. ctx_ context.Context
  12442. header_ http.Header
  12443. }
  12444. // Reload: Reloads the specified document from its specified source,
  12445. // content_uri or
  12446. // content. The previously loaded content of the document will be
  12447. // deleted.
  12448. // Note: Even when the content of the document has not changed, there
  12449. // still
  12450. // may be side effects because of internal implementation
  12451. // changes.
  12452. // Operation <response: Document,
  12453. // metadata: KnowledgeOperationMetadata>
  12454. func (r *ProjectsAgentKnowledgeBasesDocumentsService) Reload(name string, googleclouddialogflowv2beta1reloaddocumentrequest *GoogleCloudDialogflowV2beta1ReloadDocumentRequest) *ProjectsAgentKnowledgeBasesDocumentsReloadCall {
  12455. c := &ProjectsAgentKnowledgeBasesDocumentsReloadCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12456. c.name = name
  12457. c.googleclouddialogflowv2beta1reloaddocumentrequest = googleclouddialogflowv2beta1reloaddocumentrequest
  12458. return c
  12459. }
  12460. // Fields allows partial responses to be retrieved. See
  12461. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12462. // for more information.
  12463. func (c *ProjectsAgentKnowledgeBasesDocumentsReloadCall) Fields(s ...googleapi.Field) *ProjectsAgentKnowledgeBasesDocumentsReloadCall {
  12464. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12465. return c
  12466. }
  12467. // Context sets the context to be used in this call's Do method. Any
  12468. // pending HTTP request will be aborted if the provided context is
  12469. // canceled.
  12470. func (c *ProjectsAgentKnowledgeBasesDocumentsReloadCall) Context(ctx context.Context) *ProjectsAgentKnowledgeBasesDocumentsReloadCall {
  12471. c.ctx_ = ctx
  12472. return c
  12473. }
  12474. // Header returns an http.Header that can be modified by the caller to
  12475. // add HTTP headers to the request.
  12476. func (c *ProjectsAgentKnowledgeBasesDocumentsReloadCall) Header() http.Header {
  12477. if c.header_ == nil {
  12478. c.header_ = make(http.Header)
  12479. }
  12480. return c.header_
  12481. }
  12482. func (c *ProjectsAgentKnowledgeBasesDocumentsReloadCall) doRequest(alt string) (*http.Response, error) {
  12483. reqHeaders := make(http.Header)
  12484. for k, v := range c.header_ {
  12485. reqHeaders[k] = v
  12486. }
  12487. reqHeaders.Set("User-Agent", c.s.userAgent())
  12488. var body io.Reader = nil
  12489. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1reloaddocumentrequest)
  12490. if err != nil {
  12491. return nil, err
  12492. }
  12493. reqHeaders.Set("Content-Type", "application/json")
  12494. c.urlParams_.Set("alt", alt)
  12495. c.urlParams_.Set("prettyPrint", "false")
  12496. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}:reload")
  12497. urls += "?" + c.urlParams_.Encode()
  12498. req, err := http.NewRequest("POST", urls, body)
  12499. if err != nil {
  12500. return nil, err
  12501. }
  12502. req.Header = reqHeaders
  12503. googleapi.Expand(req.URL, map[string]string{
  12504. "name": c.name,
  12505. })
  12506. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12507. }
  12508. // Do executes the "dialogflow.projects.agent.knowledgeBases.documents.reload" call.
  12509. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  12510. // Any non-2xx status code is an error. Response headers are in either
  12511. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  12512. // was returned at all) in error.(*googleapi.Error).Header. Use
  12513. // googleapi.IsNotModified to check whether the returned error was
  12514. // because http.StatusNotModified was returned.
  12515. func (c *ProjectsAgentKnowledgeBasesDocumentsReloadCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  12516. gensupport.SetOptions(c.urlParams_, opts...)
  12517. res, err := c.doRequest("json")
  12518. if res != nil && res.StatusCode == http.StatusNotModified {
  12519. if res.Body != nil {
  12520. res.Body.Close()
  12521. }
  12522. return nil, &googleapi.Error{
  12523. Code: res.StatusCode,
  12524. Header: res.Header,
  12525. }
  12526. }
  12527. if err != nil {
  12528. return nil, err
  12529. }
  12530. defer googleapi.CloseBody(res)
  12531. if err := googleapi.CheckResponse(res); err != nil {
  12532. return nil, err
  12533. }
  12534. ret := &GoogleLongrunningOperation{
  12535. ServerResponse: googleapi.ServerResponse{
  12536. Header: res.Header,
  12537. HTTPStatusCode: res.StatusCode,
  12538. },
  12539. }
  12540. target := &ret
  12541. if err := gensupport.DecodeResponse(target, res); err != nil {
  12542. return nil, err
  12543. }
  12544. return ret, nil
  12545. // {
  12546. // "description": "Reloads the specified document from its specified source, content_uri or\ncontent. The previously loaded content of the document will be deleted.\nNote: Even when the content of the document has not changed, there still\nmay be side effects because of internal implementation changes.\nOperation \u003cresponse: Document,\n metadata: KnowledgeOperationMetadata\u003e",
  12547. // "flatPath": "v2beta1/projects/{projectsId}/agent/knowledgeBases/{knowledgeBasesId}/documents/{documentsId}:reload",
  12548. // "httpMethod": "POST",
  12549. // "id": "dialogflow.projects.agent.knowledgeBases.documents.reload",
  12550. // "parameterOrder": [
  12551. // "name"
  12552. // ],
  12553. // "parameters": {
  12554. // "name": {
  12555. // "description": "The name of the document to reload.\nFormat: `projects/\u003cProject ID\u003e/knowledgeBases/\u003cKnowledge Base\nID\u003e/documents/\u003cDocument ID\u003e`",
  12556. // "location": "path",
  12557. // "pattern": "^projects/[^/]+/agent/knowledgeBases/[^/]+/documents/[^/]+$",
  12558. // "required": true,
  12559. // "type": "string"
  12560. // }
  12561. // },
  12562. // "path": "v2beta1/{+name}:reload",
  12563. // "request": {
  12564. // "$ref": "GoogleCloudDialogflowV2beta1ReloadDocumentRequest"
  12565. // },
  12566. // "response": {
  12567. // "$ref": "GoogleLongrunningOperation"
  12568. // },
  12569. // "scopes": [
  12570. // "https://www.googleapis.com/auth/cloud-platform",
  12571. // "https://www.googleapis.com/auth/dialogflow"
  12572. // ]
  12573. // }
  12574. }
  12575. // method id "dialogflow.projects.agent.sessions.deleteContexts":
  12576. type ProjectsAgentSessionsDeleteContextsCall struct {
  12577. s *Service
  12578. parent string
  12579. urlParams_ gensupport.URLParams
  12580. ctx_ context.Context
  12581. header_ http.Header
  12582. }
  12583. // DeleteContexts: Deletes all active contexts in the specified session.
  12584. func (r *ProjectsAgentSessionsService) DeleteContexts(parent string) *ProjectsAgentSessionsDeleteContextsCall {
  12585. c := &ProjectsAgentSessionsDeleteContextsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12586. c.parent = parent
  12587. return c
  12588. }
  12589. // Fields allows partial responses to be retrieved. See
  12590. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12591. // for more information.
  12592. func (c *ProjectsAgentSessionsDeleteContextsCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsDeleteContextsCall {
  12593. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12594. return c
  12595. }
  12596. // Context sets the context to be used in this call's Do method. Any
  12597. // pending HTTP request will be aborted if the provided context is
  12598. // canceled.
  12599. func (c *ProjectsAgentSessionsDeleteContextsCall) Context(ctx context.Context) *ProjectsAgentSessionsDeleteContextsCall {
  12600. c.ctx_ = ctx
  12601. return c
  12602. }
  12603. // Header returns an http.Header that can be modified by the caller to
  12604. // add HTTP headers to the request.
  12605. func (c *ProjectsAgentSessionsDeleteContextsCall) Header() http.Header {
  12606. if c.header_ == nil {
  12607. c.header_ = make(http.Header)
  12608. }
  12609. return c.header_
  12610. }
  12611. func (c *ProjectsAgentSessionsDeleteContextsCall) doRequest(alt string) (*http.Response, error) {
  12612. reqHeaders := make(http.Header)
  12613. for k, v := range c.header_ {
  12614. reqHeaders[k] = v
  12615. }
  12616. reqHeaders.Set("User-Agent", c.s.userAgent())
  12617. var body io.Reader = nil
  12618. c.urlParams_.Set("alt", alt)
  12619. c.urlParams_.Set("prettyPrint", "false")
  12620. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/contexts")
  12621. urls += "?" + c.urlParams_.Encode()
  12622. req, err := http.NewRequest("DELETE", urls, body)
  12623. if err != nil {
  12624. return nil, err
  12625. }
  12626. req.Header = reqHeaders
  12627. googleapi.Expand(req.URL, map[string]string{
  12628. "parent": c.parent,
  12629. })
  12630. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12631. }
  12632. // Do executes the "dialogflow.projects.agent.sessions.deleteContexts" call.
  12633. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  12634. // non-2xx status code is an error. Response headers are in either
  12635. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  12636. // returned at all) in error.(*googleapi.Error).Header. Use
  12637. // googleapi.IsNotModified to check whether the returned error was
  12638. // because http.StatusNotModified was returned.
  12639. func (c *ProjectsAgentSessionsDeleteContextsCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  12640. gensupport.SetOptions(c.urlParams_, opts...)
  12641. res, err := c.doRequest("json")
  12642. if res != nil && res.StatusCode == http.StatusNotModified {
  12643. if res.Body != nil {
  12644. res.Body.Close()
  12645. }
  12646. return nil, &googleapi.Error{
  12647. Code: res.StatusCode,
  12648. Header: res.Header,
  12649. }
  12650. }
  12651. if err != nil {
  12652. return nil, err
  12653. }
  12654. defer googleapi.CloseBody(res)
  12655. if err := googleapi.CheckResponse(res); err != nil {
  12656. return nil, err
  12657. }
  12658. ret := &GoogleProtobufEmpty{
  12659. ServerResponse: googleapi.ServerResponse{
  12660. Header: res.Header,
  12661. HTTPStatusCode: res.StatusCode,
  12662. },
  12663. }
  12664. target := &ret
  12665. if err := gensupport.DecodeResponse(target, res); err != nil {
  12666. return nil, err
  12667. }
  12668. return ret, nil
  12669. // {
  12670. // "description": "Deletes all active contexts in the specified session.",
  12671. // "flatPath": "v2beta1/projects/{projectsId}/agent/sessions/{sessionsId}/contexts",
  12672. // "httpMethod": "DELETE",
  12673. // "id": "dialogflow.projects.agent.sessions.deleteContexts",
  12674. // "parameterOrder": [
  12675. // "parent"
  12676. // ],
  12677. // "parameters": {
  12678. // "parent": {
  12679. // "description": "Required. The name of the session to delete all contexts from. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e` or `projects/\u003cProject\nID\u003e/agent/environments/\u003cEnvironment ID\u003e/users/\u003cUser ID\u003e/sessions/\u003cSession\nID\u003e`. If `Environment ID` is not specified we assume default 'draft'\nenvironment. If `User ID` is not specified, we assume default '-' user.",
  12680. // "location": "path",
  12681. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+$",
  12682. // "required": true,
  12683. // "type": "string"
  12684. // }
  12685. // },
  12686. // "path": "v2beta1/{+parent}/contexts",
  12687. // "response": {
  12688. // "$ref": "GoogleProtobufEmpty"
  12689. // },
  12690. // "scopes": [
  12691. // "https://www.googleapis.com/auth/cloud-platform",
  12692. // "https://www.googleapis.com/auth/dialogflow"
  12693. // ]
  12694. // }
  12695. }
  12696. // method id "dialogflow.projects.agent.sessions.detectIntent":
  12697. type ProjectsAgentSessionsDetectIntentCall struct {
  12698. s *Service
  12699. sessionid string
  12700. googleclouddialogflowv2beta1detectintentrequest *GoogleCloudDialogflowV2beta1DetectIntentRequest
  12701. urlParams_ gensupport.URLParams
  12702. ctx_ context.Context
  12703. header_ http.Header
  12704. }
  12705. // DetectIntent: Processes a natural language query and returns
  12706. // structured, actionable data
  12707. // as a result. This method is not idempotent, because it may cause
  12708. // contexts
  12709. // and session entity types to be updated, which in turn might
  12710. // affect
  12711. // results of future queries.
  12712. func (r *ProjectsAgentSessionsService) DetectIntent(sessionid string, googleclouddialogflowv2beta1detectintentrequest *GoogleCloudDialogflowV2beta1DetectIntentRequest) *ProjectsAgentSessionsDetectIntentCall {
  12713. c := &ProjectsAgentSessionsDetectIntentCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12714. c.sessionid = sessionid
  12715. c.googleclouddialogflowv2beta1detectintentrequest = googleclouddialogflowv2beta1detectintentrequest
  12716. return c
  12717. }
  12718. // Fields allows partial responses to be retrieved. See
  12719. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12720. // for more information.
  12721. func (c *ProjectsAgentSessionsDetectIntentCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsDetectIntentCall {
  12722. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12723. return c
  12724. }
  12725. // Context sets the context to be used in this call's Do method. Any
  12726. // pending HTTP request will be aborted if the provided context is
  12727. // canceled.
  12728. func (c *ProjectsAgentSessionsDetectIntentCall) Context(ctx context.Context) *ProjectsAgentSessionsDetectIntentCall {
  12729. c.ctx_ = ctx
  12730. return c
  12731. }
  12732. // Header returns an http.Header that can be modified by the caller to
  12733. // add HTTP headers to the request.
  12734. func (c *ProjectsAgentSessionsDetectIntentCall) Header() http.Header {
  12735. if c.header_ == nil {
  12736. c.header_ = make(http.Header)
  12737. }
  12738. return c.header_
  12739. }
  12740. func (c *ProjectsAgentSessionsDetectIntentCall) doRequest(alt string) (*http.Response, error) {
  12741. reqHeaders := make(http.Header)
  12742. for k, v := range c.header_ {
  12743. reqHeaders[k] = v
  12744. }
  12745. reqHeaders.Set("User-Agent", c.s.userAgent())
  12746. var body io.Reader = nil
  12747. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1detectintentrequest)
  12748. if err != nil {
  12749. return nil, err
  12750. }
  12751. reqHeaders.Set("Content-Type", "application/json")
  12752. c.urlParams_.Set("alt", alt)
  12753. c.urlParams_.Set("prettyPrint", "false")
  12754. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+session}:detectIntent")
  12755. urls += "?" + c.urlParams_.Encode()
  12756. req, err := http.NewRequest("POST", urls, body)
  12757. if err != nil {
  12758. return nil, err
  12759. }
  12760. req.Header = reqHeaders
  12761. googleapi.Expand(req.URL, map[string]string{
  12762. "session": c.sessionid,
  12763. })
  12764. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12765. }
  12766. // Do executes the "dialogflow.projects.agent.sessions.detectIntent" call.
  12767. // Exactly one of *GoogleCloudDialogflowV2beta1DetectIntentResponse or
  12768. // error will be non-nil. Any non-2xx status code is an error. Response
  12769. // headers are in either
  12770. // *GoogleCloudDialogflowV2beta1DetectIntentResponse.ServerResponse.Heade
  12771. // r or (if a response was returned at all) in
  12772. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  12773. // whether the returned error was because http.StatusNotModified was
  12774. // returned.
  12775. func (c *ProjectsAgentSessionsDetectIntentCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1DetectIntentResponse, error) {
  12776. gensupport.SetOptions(c.urlParams_, opts...)
  12777. res, err := c.doRequest("json")
  12778. if res != nil && res.StatusCode == http.StatusNotModified {
  12779. if res.Body != nil {
  12780. res.Body.Close()
  12781. }
  12782. return nil, &googleapi.Error{
  12783. Code: res.StatusCode,
  12784. Header: res.Header,
  12785. }
  12786. }
  12787. if err != nil {
  12788. return nil, err
  12789. }
  12790. defer googleapi.CloseBody(res)
  12791. if err := googleapi.CheckResponse(res); err != nil {
  12792. return nil, err
  12793. }
  12794. ret := &GoogleCloudDialogflowV2beta1DetectIntentResponse{
  12795. ServerResponse: googleapi.ServerResponse{
  12796. Header: res.Header,
  12797. HTTPStatusCode: res.StatusCode,
  12798. },
  12799. }
  12800. target := &ret
  12801. if err := gensupport.DecodeResponse(target, res); err != nil {
  12802. return nil, err
  12803. }
  12804. return ret, nil
  12805. // {
  12806. // "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.",
  12807. // "flatPath": "v2beta1/projects/{projectsId}/agent/sessions/{sessionsId}:detectIntent",
  12808. // "httpMethod": "POST",
  12809. // "id": "dialogflow.projects.agent.sessions.detectIntent",
  12810. // "parameterOrder": [
  12811. // "session"
  12812. // ],
  12813. // "parameters": {
  12814. // "session": {
  12815. // "description": "Required. The name of the session this query is sent to. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e`, or\n`projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment ID\u003e/users/\u003cUser\nID\u003e/sessions/\u003cSession ID\u003e`. If `Environment ID` is not specified, we assume\ndefault 'draft' environment. If `User ID` is not specified, we are using\n\"-\". It’s up to the API caller to choose an appropriate `Session ID` and\n`User Id`. They can be a random numbers or some type of user and session\nidentifiers (preferably hashed). The length of the `Session ID` and\n`User ID` must not exceed 36 characters.",
  12816. // "location": "path",
  12817. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+$",
  12818. // "required": true,
  12819. // "type": "string"
  12820. // }
  12821. // },
  12822. // "path": "v2beta1/{+session}:detectIntent",
  12823. // "request": {
  12824. // "$ref": "GoogleCloudDialogflowV2beta1DetectIntentRequest"
  12825. // },
  12826. // "response": {
  12827. // "$ref": "GoogleCloudDialogflowV2beta1DetectIntentResponse"
  12828. // },
  12829. // "scopes": [
  12830. // "https://www.googleapis.com/auth/cloud-platform",
  12831. // "https://www.googleapis.com/auth/dialogflow"
  12832. // ]
  12833. // }
  12834. }
  12835. // method id "dialogflow.projects.agent.sessions.contexts.create":
  12836. type ProjectsAgentSessionsContextsCreateCall struct {
  12837. s *Service
  12838. parent string
  12839. googleclouddialogflowv2beta1context *GoogleCloudDialogflowV2beta1Context
  12840. urlParams_ gensupport.URLParams
  12841. ctx_ context.Context
  12842. header_ http.Header
  12843. }
  12844. // Create: Creates a context.
  12845. //
  12846. // If the specified context already exists, overrides the context.
  12847. func (r *ProjectsAgentSessionsContextsService) Create(parent string, googleclouddialogflowv2beta1context *GoogleCloudDialogflowV2beta1Context) *ProjectsAgentSessionsContextsCreateCall {
  12848. c := &ProjectsAgentSessionsContextsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12849. c.parent = parent
  12850. c.googleclouddialogflowv2beta1context = googleclouddialogflowv2beta1context
  12851. return c
  12852. }
  12853. // Fields allows partial responses to be retrieved. See
  12854. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12855. // for more information.
  12856. func (c *ProjectsAgentSessionsContextsCreateCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsContextsCreateCall {
  12857. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12858. return c
  12859. }
  12860. // Context sets the context to be used in this call's Do method. Any
  12861. // pending HTTP request will be aborted if the provided context is
  12862. // canceled.
  12863. func (c *ProjectsAgentSessionsContextsCreateCall) Context(ctx context.Context) *ProjectsAgentSessionsContextsCreateCall {
  12864. c.ctx_ = ctx
  12865. return c
  12866. }
  12867. // Header returns an http.Header that can be modified by the caller to
  12868. // add HTTP headers to the request.
  12869. func (c *ProjectsAgentSessionsContextsCreateCall) Header() http.Header {
  12870. if c.header_ == nil {
  12871. c.header_ = make(http.Header)
  12872. }
  12873. return c.header_
  12874. }
  12875. func (c *ProjectsAgentSessionsContextsCreateCall) doRequest(alt string) (*http.Response, error) {
  12876. reqHeaders := make(http.Header)
  12877. for k, v := range c.header_ {
  12878. reqHeaders[k] = v
  12879. }
  12880. reqHeaders.Set("User-Agent", c.s.userAgent())
  12881. var body io.Reader = nil
  12882. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1context)
  12883. if err != nil {
  12884. return nil, err
  12885. }
  12886. reqHeaders.Set("Content-Type", "application/json")
  12887. c.urlParams_.Set("alt", alt)
  12888. c.urlParams_.Set("prettyPrint", "false")
  12889. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/contexts")
  12890. urls += "?" + c.urlParams_.Encode()
  12891. req, err := http.NewRequest("POST", urls, body)
  12892. if err != nil {
  12893. return nil, err
  12894. }
  12895. req.Header = reqHeaders
  12896. googleapi.Expand(req.URL, map[string]string{
  12897. "parent": c.parent,
  12898. })
  12899. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12900. }
  12901. // Do executes the "dialogflow.projects.agent.sessions.contexts.create" call.
  12902. // Exactly one of *GoogleCloudDialogflowV2beta1Context or error will be
  12903. // non-nil. Any non-2xx status code is an error. Response headers are in
  12904. // either *GoogleCloudDialogflowV2beta1Context.ServerResponse.Header or
  12905. // (if a response was returned at all) in
  12906. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  12907. // whether the returned error was because http.StatusNotModified was
  12908. // returned.
  12909. func (c *ProjectsAgentSessionsContextsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1Context, error) {
  12910. gensupport.SetOptions(c.urlParams_, opts...)
  12911. res, err := c.doRequest("json")
  12912. if res != nil && res.StatusCode == http.StatusNotModified {
  12913. if res.Body != nil {
  12914. res.Body.Close()
  12915. }
  12916. return nil, &googleapi.Error{
  12917. Code: res.StatusCode,
  12918. Header: res.Header,
  12919. }
  12920. }
  12921. if err != nil {
  12922. return nil, err
  12923. }
  12924. defer googleapi.CloseBody(res)
  12925. if err := googleapi.CheckResponse(res); err != nil {
  12926. return nil, err
  12927. }
  12928. ret := &GoogleCloudDialogflowV2beta1Context{
  12929. ServerResponse: googleapi.ServerResponse{
  12930. Header: res.Header,
  12931. HTTPStatusCode: res.StatusCode,
  12932. },
  12933. }
  12934. target := &ret
  12935. if err := gensupport.DecodeResponse(target, res); err != nil {
  12936. return nil, err
  12937. }
  12938. return ret, nil
  12939. // {
  12940. // "description": "Creates a context.\n\nIf the specified context already exists, overrides the context.",
  12941. // "flatPath": "v2beta1/projects/{projectsId}/agent/sessions/{sessionsId}/contexts",
  12942. // "httpMethod": "POST",
  12943. // "id": "dialogflow.projects.agent.sessions.contexts.create",
  12944. // "parameterOrder": [
  12945. // "parent"
  12946. // ],
  12947. // "parameters": {
  12948. // "parent": {
  12949. // "description": "Required. The session to create a context for.\nFormat: `projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e` or\n`projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment ID\u003e/users/\u003cUser\nID\u003e/sessions/\u003cSession ID\u003e`. If `Environment ID` is not specified, we assume\ndefault 'draft' environment. If `User ID` is not specified, we assume\ndefault '-' user.",
  12950. // "location": "path",
  12951. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+$",
  12952. // "required": true,
  12953. // "type": "string"
  12954. // }
  12955. // },
  12956. // "path": "v2beta1/{+parent}/contexts",
  12957. // "request": {
  12958. // "$ref": "GoogleCloudDialogflowV2beta1Context"
  12959. // },
  12960. // "response": {
  12961. // "$ref": "GoogleCloudDialogflowV2beta1Context"
  12962. // },
  12963. // "scopes": [
  12964. // "https://www.googleapis.com/auth/cloud-platform",
  12965. // "https://www.googleapis.com/auth/dialogflow"
  12966. // ]
  12967. // }
  12968. }
  12969. // method id "dialogflow.projects.agent.sessions.contexts.delete":
  12970. type ProjectsAgentSessionsContextsDeleteCall struct {
  12971. s *Service
  12972. name string
  12973. urlParams_ gensupport.URLParams
  12974. ctx_ context.Context
  12975. header_ http.Header
  12976. }
  12977. // Delete: Deletes the specified context.
  12978. func (r *ProjectsAgentSessionsContextsService) Delete(name string) *ProjectsAgentSessionsContextsDeleteCall {
  12979. c := &ProjectsAgentSessionsContextsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12980. c.name = name
  12981. return c
  12982. }
  12983. // Fields allows partial responses to be retrieved. See
  12984. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12985. // for more information.
  12986. func (c *ProjectsAgentSessionsContextsDeleteCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsContextsDeleteCall {
  12987. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12988. return c
  12989. }
  12990. // Context sets the context to be used in this call's Do method. Any
  12991. // pending HTTP request will be aborted if the provided context is
  12992. // canceled.
  12993. func (c *ProjectsAgentSessionsContextsDeleteCall) Context(ctx context.Context) *ProjectsAgentSessionsContextsDeleteCall {
  12994. c.ctx_ = ctx
  12995. return c
  12996. }
  12997. // Header returns an http.Header that can be modified by the caller to
  12998. // add HTTP headers to the request.
  12999. func (c *ProjectsAgentSessionsContextsDeleteCall) Header() http.Header {
  13000. if c.header_ == nil {
  13001. c.header_ = make(http.Header)
  13002. }
  13003. return c.header_
  13004. }
  13005. func (c *ProjectsAgentSessionsContextsDeleteCall) doRequest(alt string) (*http.Response, error) {
  13006. reqHeaders := make(http.Header)
  13007. for k, v := range c.header_ {
  13008. reqHeaders[k] = v
  13009. }
  13010. reqHeaders.Set("User-Agent", c.s.userAgent())
  13011. var body io.Reader = nil
  13012. c.urlParams_.Set("alt", alt)
  13013. c.urlParams_.Set("prettyPrint", "false")
  13014. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  13015. urls += "?" + c.urlParams_.Encode()
  13016. req, err := http.NewRequest("DELETE", urls, body)
  13017. if err != nil {
  13018. return nil, err
  13019. }
  13020. req.Header = reqHeaders
  13021. googleapi.Expand(req.URL, map[string]string{
  13022. "name": c.name,
  13023. })
  13024. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13025. }
  13026. // Do executes the "dialogflow.projects.agent.sessions.contexts.delete" call.
  13027. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  13028. // non-2xx status code is an error. Response headers are in either
  13029. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  13030. // returned at all) in error.(*googleapi.Error).Header. Use
  13031. // googleapi.IsNotModified to check whether the returned error was
  13032. // because http.StatusNotModified was returned.
  13033. func (c *ProjectsAgentSessionsContextsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  13034. gensupport.SetOptions(c.urlParams_, opts...)
  13035. res, err := c.doRequest("json")
  13036. if res != nil && res.StatusCode == http.StatusNotModified {
  13037. if res.Body != nil {
  13038. res.Body.Close()
  13039. }
  13040. return nil, &googleapi.Error{
  13041. Code: res.StatusCode,
  13042. Header: res.Header,
  13043. }
  13044. }
  13045. if err != nil {
  13046. return nil, err
  13047. }
  13048. defer googleapi.CloseBody(res)
  13049. if err := googleapi.CheckResponse(res); err != nil {
  13050. return nil, err
  13051. }
  13052. ret := &GoogleProtobufEmpty{
  13053. ServerResponse: googleapi.ServerResponse{
  13054. Header: res.Header,
  13055. HTTPStatusCode: res.StatusCode,
  13056. },
  13057. }
  13058. target := &ret
  13059. if err := gensupport.DecodeResponse(target, res); err != nil {
  13060. return nil, err
  13061. }
  13062. return ret, nil
  13063. // {
  13064. // "description": "Deletes the specified context.",
  13065. // "flatPath": "v2beta1/projects/{projectsId}/agent/sessions/{sessionsId}/contexts/{contextsId}",
  13066. // "httpMethod": "DELETE",
  13067. // "id": "dialogflow.projects.agent.sessions.contexts.delete",
  13068. // "parameterOrder": [
  13069. // "name"
  13070. // ],
  13071. // "parameters": {
  13072. // "name": {
  13073. // "description": "Required. The name of the context to delete. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e/contexts/\u003cContext ID\u003e`\nor `projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment ID\u003e/users/\u003cUser\nID\u003e/sessions/\u003cSession ID\u003e/contexts/\u003cContext ID\u003e`. If `Environment ID` is\nnot specified, we assume default 'draft' environment. If `User ID` is not\nspecified, we assume default '-' user.",
  13074. // "location": "path",
  13075. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+/contexts/[^/]+$",
  13076. // "required": true,
  13077. // "type": "string"
  13078. // }
  13079. // },
  13080. // "path": "v2beta1/{+name}",
  13081. // "response": {
  13082. // "$ref": "GoogleProtobufEmpty"
  13083. // },
  13084. // "scopes": [
  13085. // "https://www.googleapis.com/auth/cloud-platform",
  13086. // "https://www.googleapis.com/auth/dialogflow"
  13087. // ]
  13088. // }
  13089. }
  13090. // method id "dialogflow.projects.agent.sessions.contexts.get":
  13091. type ProjectsAgentSessionsContextsGetCall struct {
  13092. s *Service
  13093. name string
  13094. urlParams_ gensupport.URLParams
  13095. ifNoneMatch_ string
  13096. ctx_ context.Context
  13097. header_ http.Header
  13098. }
  13099. // Get: Retrieves the specified context.
  13100. func (r *ProjectsAgentSessionsContextsService) Get(name string) *ProjectsAgentSessionsContextsGetCall {
  13101. c := &ProjectsAgentSessionsContextsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13102. c.name = name
  13103. return c
  13104. }
  13105. // Fields allows partial responses to be retrieved. See
  13106. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13107. // for more information.
  13108. func (c *ProjectsAgentSessionsContextsGetCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsContextsGetCall {
  13109. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13110. return c
  13111. }
  13112. // IfNoneMatch sets the optional parameter which makes the operation
  13113. // fail if the object's ETag matches the given value. This is useful for
  13114. // getting updates only after the object has changed since the last
  13115. // request. Use googleapi.IsNotModified to check whether the response
  13116. // error from Do is the result of In-None-Match.
  13117. func (c *ProjectsAgentSessionsContextsGetCall) IfNoneMatch(entityTag string) *ProjectsAgentSessionsContextsGetCall {
  13118. c.ifNoneMatch_ = entityTag
  13119. return c
  13120. }
  13121. // Context sets the context to be used in this call's Do method. Any
  13122. // pending HTTP request will be aborted if the provided context is
  13123. // canceled.
  13124. func (c *ProjectsAgentSessionsContextsGetCall) Context(ctx context.Context) *ProjectsAgentSessionsContextsGetCall {
  13125. c.ctx_ = ctx
  13126. return c
  13127. }
  13128. // Header returns an http.Header that can be modified by the caller to
  13129. // add HTTP headers to the request.
  13130. func (c *ProjectsAgentSessionsContextsGetCall) Header() http.Header {
  13131. if c.header_ == nil {
  13132. c.header_ = make(http.Header)
  13133. }
  13134. return c.header_
  13135. }
  13136. func (c *ProjectsAgentSessionsContextsGetCall) doRequest(alt string) (*http.Response, error) {
  13137. reqHeaders := make(http.Header)
  13138. for k, v := range c.header_ {
  13139. reqHeaders[k] = v
  13140. }
  13141. reqHeaders.Set("User-Agent", c.s.userAgent())
  13142. if c.ifNoneMatch_ != "" {
  13143. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13144. }
  13145. var body io.Reader = nil
  13146. c.urlParams_.Set("alt", alt)
  13147. c.urlParams_.Set("prettyPrint", "false")
  13148. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  13149. urls += "?" + c.urlParams_.Encode()
  13150. req, err := http.NewRequest("GET", urls, body)
  13151. if err != nil {
  13152. return nil, err
  13153. }
  13154. req.Header = reqHeaders
  13155. googleapi.Expand(req.URL, map[string]string{
  13156. "name": c.name,
  13157. })
  13158. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13159. }
  13160. // Do executes the "dialogflow.projects.agent.sessions.contexts.get" call.
  13161. // Exactly one of *GoogleCloudDialogflowV2beta1Context or error will be
  13162. // non-nil. Any non-2xx status code is an error. Response headers are in
  13163. // either *GoogleCloudDialogflowV2beta1Context.ServerResponse.Header or
  13164. // (if a response was returned at all) in
  13165. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  13166. // whether the returned error was because http.StatusNotModified was
  13167. // returned.
  13168. func (c *ProjectsAgentSessionsContextsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1Context, error) {
  13169. gensupport.SetOptions(c.urlParams_, opts...)
  13170. res, err := c.doRequest("json")
  13171. if res != nil && res.StatusCode == http.StatusNotModified {
  13172. if res.Body != nil {
  13173. res.Body.Close()
  13174. }
  13175. return nil, &googleapi.Error{
  13176. Code: res.StatusCode,
  13177. Header: res.Header,
  13178. }
  13179. }
  13180. if err != nil {
  13181. return nil, err
  13182. }
  13183. defer googleapi.CloseBody(res)
  13184. if err := googleapi.CheckResponse(res); err != nil {
  13185. return nil, err
  13186. }
  13187. ret := &GoogleCloudDialogflowV2beta1Context{
  13188. ServerResponse: googleapi.ServerResponse{
  13189. Header: res.Header,
  13190. HTTPStatusCode: res.StatusCode,
  13191. },
  13192. }
  13193. target := &ret
  13194. if err := gensupport.DecodeResponse(target, res); err != nil {
  13195. return nil, err
  13196. }
  13197. return ret, nil
  13198. // {
  13199. // "description": "Retrieves the specified context.",
  13200. // "flatPath": "v2beta1/projects/{projectsId}/agent/sessions/{sessionsId}/contexts/{contextsId}",
  13201. // "httpMethod": "GET",
  13202. // "id": "dialogflow.projects.agent.sessions.contexts.get",
  13203. // "parameterOrder": [
  13204. // "name"
  13205. // ],
  13206. // "parameters": {
  13207. // "name": {
  13208. // "description": "Required. The name of the context. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e/contexts/\u003cContext ID\u003e`\nor `projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment ID\u003e/users/\u003cUser\nID\u003e/sessions/\u003cSession ID\u003e/contexts/\u003cContext ID\u003e`. If `Environment ID` is\nnot specified, we assume default 'draft' environment. If `User ID` is not\nspecified, we assume default '-' user.",
  13209. // "location": "path",
  13210. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+/contexts/[^/]+$",
  13211. // "required": true,
  13212. // "type": "string"
  13213. // }
  13214. // },
  13215. // "path": "v2beta1/{+name}",
  13216. // "response": {
  13217. // "$ref": "GoogleCloudDialogflowV2beta1Context"
  13218. // },
  13219. // "scopes": [
  13220. // "https://www.googleapis.com/auth/cloud-platform",
  13221. // "https://www.googleapis.com/auth/dialogflow"
  13222. // ]
  13223. // }
  13224. }
  13225. // method id "dialogflow.projects.agent.sessions.contexts.list":
  13226. type ProjectsAgentSessionsContextsListCall struct {
  13227. s *Service
  13228. parent string
  13229. urlParams_ gensupport.URLParams
  13230. ifNoneMatch_ string
  13231. ctx_ context.Context
  13232. header_ http.Header
  13233. }
  13234. // List: Returns the list of all contexts in the specified session.
  13235. func (r *ProjectsAgentSessionsContextsService) List(parent string) *ProjectsAgentSessionsContextsListCall {
  13236. c := &ProjectsAgentSessionsContextsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13237. c.parent = parent
  13238. return c
  13239. }
  13240. // PageSize sets the optional parameter "pageSize": The maximum number
  13241. // of items to return in a single page. By
  13242. // default 100 and at most 1000.
  13243. func (c *ProjectsAgentSessionsContextsListCall) PageSize(pageSize int64) *ProjectsAgentSessionsContextsListCall {
  13244. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  13245. return c
  13246. }
  13247. // PageToken sets the optional parameter "pageToken": The
  13248. // next_page_token value returned from a previous list request.
  13249. func (c *ProjectsAgentSessionsContextsListCall) PageToken(pageToken string) *ProjectsAgentSessionsContextsListCall {
  13250. c.urlParams_.Set("pageToken", pageToken)
  13251. return c
  13252. }
  13253. // Fields allows partial responses to be retrieved. See
  13254. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13255. // for more information.
  13256. func (c *ProjectsAgentSessionsContextsListCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsContextsListCall {
  13257. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13258. return c
  13259. }
  13260. // IfNoneMatch sets the optional parameter which makes the operation
  13261. // fail if the object's ETag matches the given value. This is useful for
  13262. // getting updates only after the object has changed since the last
  13263. // request. Use googleapi.IsNotModified to check whether the response
  13264. // error from Do is the result of In-None-Match.
  13265. func (c *ProjectsAgentSessionsContextsListCall) IfNoneMatch(entityTag string) *ProjectsAgentSessionsContextsListCall {
  13266. c.ifNoneMatch_ = entityTag
  13267. return c
  13268. }
  13269. // Context sets the context to be used in this call's Do method. Any
  13270. // pending HTTP request will be aborted if the provided context is
  13271. // canceled.
  13272. func (c *ProjectsAgentSessionsContextsListCall) Context(ctx context.Context) *ProjectsAgentSessionsContextsListCall {
  13273. c.ctx_ = ctx
  13274. return c
  13275. }
  13276. // Header returns an http.Header that can be modified by the caller to
  13277. // add HTTP headers to the request.
  13278. func (c *ProjectsAgentSessionsContextsListCall) Header() http.Header {
  13279. if c.header_ == nil {
  13280. c.header_ = make(http.Header)
  13281. }
  13282. return c.header_
  13283. }
  13284. func (c *ProjectsAgentSessionsContextsListCall) doRequest(alt string) (*http.Response, error) {
  13285. reqHeaders := make(http.Header)
  13286. for k, v := range c.header_ {
  13287. reqHeaders[k] = v
  13288. }
  13289. reqHeaders.Set("User-Agent", c.s.userAgent())
  13290. if c.ifNoneMatch_ != "" {
  13291. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13292. }
  13293. var body io.Reader = nil
  13294. c.urlParams_.Set("alt", alt)
  13295. c.urlParams_.Set("prettyPrint", "false")
  13296. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/contexts")
  13297. urls += "?" + c.urlParams_.Encode()
  13298. req, err := http.NewRequest("GET", urls, body)
  13299. if err != nil {
  13300. return nil, err
  13301. }
  13302. req.Header = reqHeaders
  13303. googleapi.Expand(req.URL, map[string]string{
  13304. "parent": c.parent,
  13305. })
  13306. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13307. }
  13308. // Do executes the "dialogflow.projects.agent.sessions.contexts.list" call.
  13309. // Exactly one of *GoogleCloudDialogflowV2beta1ListContextsResponse or
  13310. // error will be non-nil. Any non-2xx status code is an error. Response
  13311. // headers are in either
  13312. // *GoogleCloudDialogflowV2beta1ListContextsResponse.ServerResponse.Heade
  13313. // r or (if a response was returned at all) in
  13314. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  13315. // whether the returned error was because http.StatusNotModified was
  13316. // returned.
  13317. func (c *ProjectsAgentSessionsContextsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1ListContextsResponse, error) {
  13318. gensupport.SetOptions(c.urlParams_, opts...)
  13319. res, err := c.doRequest("json")
  13320. if res != nil && res.StatusCode == http.StatusNotModified {
  13321. if res.Body != nil {
  13322. res.Body.Close()
  13323. }
  13324. return nil, &googleapi.Error{
  13325. Code: res.StatusCode,
  13326. Header: res.Header,
  13327. }
  13328. }
  13329. if err != nil {
  13330. return nil, err
  13331. }
  13332. defer googleapi.CloseBody(res)
  13333. if err := googleapi.CheckResponse(res); err != nil {
  13334. return nil, err
  13335. }
  13336. ret := &GoogleCloudDialogflowV2beta1ListContextsResponse{
  13337. ServerResponse: googleapi.ServerResponse{
  13338. Header: res.Header,
  13339. HTTPStatusCode: res.StatusCode,
  13340. },
  13341. }
  13342. target := &ret
  13343. if err := gensupport.DecodeResponse(target, res); err != nil {
  13344. return nil, err
  13345. }
  13346. return ret, nil
  13347. // {
  13348. // "description": "Returns the list of all contexts in the specified session.",
  13349. // "flatPath": "v2beta1/projects/{projectsId}/agent/sessions/{sessionsId}/contexts",
  13350. // "httpMethod": "GET",
  13351. // "id": "dialogflow.projects.agent.sessions.contexts.list",
  13352. // "parameterOrder": [
  13353. // "parent"
  13354. // ],
  13355. // "parameters": {
  13356. // "pageSize": {
  13357. // "description": "Optional. The maximum number of items to return in a single page. By\ndefault 100 and at most 1000.",
  13358. // "format": "int32",
  13359. // "location": "query",
  13360. // "type": "integer"
  13361. // },
  13362. // "pageToken": {
  13363. // "description": "Optional. The next_page_token value returned from a previous list request.",
  13364. // "location": "query",
  13365. // "type": "string"
  13366. // },
  13367. // "parent": {
  13368. // "description": "Required. The session to list all contexts from.\nFormat: `projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e` or\n`projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment ID\u003e/users/\u003cUser\nID\u003e/sessions/\u003cSession ID\u003e`. If `Environment ID` is not specified, we assume\ndefault 'draft' environment. If `User ID` is not specified, we assume\ndefault '-' user.",
  13369. // "location": "path",
  13370. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+$",
  13371. // "required": true,
  13372. // "type": "string"
  13373. // }
  13374. // },
  13375. // "path": "v2beta1/{+parent}/contexts",
  13376. // "response": {
  13377. // "$ref": "GoogleCloudDialogflowV2beta1ListContextsResponse"
  13378. // },
  13379. // "scopes": [
  13380. // "https://www.googleapis.com/auth/cloud-platform",
  13381. // "https://www.googleapis.com/auth/dialogflow"
  13382. // ]
  13383. // }
  13384. }
  13385. // Pages invokes f for each page of results.
  13386. // A non-nil error returned from f will halt the iteration.
  13387. // The provided context supersedes any context provided to the Context method.
  13388. func (c *ProjectsAgentSessionsContextsListCall) Pages(ctx context.Context, f func(*GoogleCloudDialogflowV2beta1ListContextsResponse) error) error {
  13389. c.ctx_ = ctx
  13390. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  13391. for {
  13392. x, err := c.Do()
  13393. if err != nil {
  13394. return err
  13395. }
  13396. if err := f(x); err != nil {
  13397. return err
  13398. }
  13399. if x.NextPageToken == "" {
  13400. return nil
  13401. }
  13402. c.PageToken(x.NextPageToken)
  13403. }
  13404. }
  13405. // method id "dialogflow.projects.agent.sessions.contexts.patch":
  13406. type ProjectsAgentSessionsContextsPatchCall struct {
  13407. s *Service
  13408. nameid string
  13409. googleclouddialogflowv2beta1context *GoogleCloudDialogflowV2beta1Context
  13410. urlParams_ gensupport.URLParams
  13411. ctx_ context.Context
  13412. header_ http.Header
  13413. }
  13414. // Patch: Updates the specified context.
  13415. func (r *ProjectsAgentSessionsContextsService) Patch(nameid string, googleclouddialogflowv2beta1context *GoogleCloudDialogflowV2beta1Context) *ProjectsAgentSessionsContextsPatchCall {
  13416. c := &ProjectsAgentSessionsContextsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13417. c.nameid = nameid
  13418. c.googleclouddialogflowv2beta1context = googleclouddialogflowv2beta1context
  13419. return c
  13420. }
  13421. // UpdateMask sets the optional parameter "updateMask": The mask to
  13422. // control which fields get updated.
  13423. func (c *ProjectsAgentSessionsContextsPatchCall) UpdateMask(updateMask string) *ProjectsAgentSessionsContextsPatchCall {
  13424. c.urlParams_.Set("updateMask", updateMask)
  13425. return c
  13426. }
  13427. // Fields allows partial responses to be retrieved. See
  13428. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13429. // for more information.
  13430. func (c *ProjectsAgentSessionsContextsPatchCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsContextsPatchCall {
  13431. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13432. return c
  13433. }
  13434. // Context sets the context to be used in this call's Do method. Any
  13435. // pending HTTP request will be aborted if the provided context is
  13436. // canceled.
  13437. func (c *ProjectsAgentSessionsContextsPatchCall) Context(ctx context.Context) *ProjectsAgentSessionsContextsPatchCall {
  13438. c.ctx_ = ctx
  13439. return c
  13440. }
  13441. // Header returns an http.Header that can be modified by the caller to
  13442. // add HTTP headers to the request.
  13443. func (c *ProjectsAgentSessionsContextsPatchCall) Header() http.Header {
  13444. if c.header_ == nil {
  13445. c.header_ = make(http.Header)
  13446. }
  13447. return c.header_
  13448. }
  13449. func (c *ProjectsAgentSessionsContextsPatchCall) doRequest(alt string) (*http.Response, error) {
  13450. reqHeaders := make(http.Header)
  13451. for k, v := range c.header_ {
  13452. reqHeaders[k] = v
  13453. }
  13454. reqHeaders.Set("User-Agent", c.s.userAgent())
  13455. var body io.Reader = nil
  13456. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1context)
  13457. if err != nil {
  13458. return nil, err
  13459. }
  13460. reqHeaders.Set("Content-Type", "application/json")
  13461. c.urlParams_.Set("alt", alt)
  13462. c.urlParams_.Set("prettyPrint", "false")
  13463. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  13464. urls += "?" + c.urlParams_.Encode()
  13465. req, err := http.NewRequest("PATCH", urls, body)
  13466. if err != nil {
  13467. return nil, err
  13468. }
  13469. req.Header = reqHeaders
  13470. googleapi.Expand(req.URL, map[string]string{
  13471. "name": c.nameid,
  13472. })
  13473. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13474. }
  13475. // Do executes the "dialogflow.projects.agent.sessions.contexts.patch" call.
  13476. // Exactly one of *GoogleCloudDialogflowV2beta1Context or error will be
  13477. // non-nil. Any non-2xx status code is an error. Response headers are in
  13478. // either *GoogleCloudDialogflowV2beta1Context.ServerResponse.Header or
  13479. // (if a response was returned at all) in
  13480. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  13481. // whether the returned error was because http.StatusNotModified was
  13482. // returned.
  13483. func (c *ProjectsAgentSessionsContextsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1Context, error) {
  13484. gensupport.SetOptions(c.urlParams_, opts...)
  13485. res, err := c.doRequest("json")
  13486. if res != nil && res.StatusCode == http.StatusNotModified {
  13487. if res.Body != nil {
  13488. res.Body.Close()
  13489. }
  13490. return nil, &googleapi.Error{
  13491. Code: res.StatusCode,
  13492. Header: res.Header,
  13493. }
  13494. }
  13495. if err != nil {
  13496. return nil, err
  13497. }
  13498. defer googleapi.CloseBody(res)
  13499. if err := googleapi.CheckResponse(res); err != nil {
  13500. return nil, err
  13501. }
  13502. ret := &GoogleCloudDialogflowV2beta1Context{
  13503. ServerResponse: googleapi.ServerResponse{
  13504. Header: res.Header,
  13505. HTTPStatusCode: res.StatusCode,
  13506. },
  13507. }
  13508. target := &ret
  13509. if err := gensupport.DecodeResponse(target, res); err != nil {
  13510. return nil, err
  13511. }
  13512. return ret, nil
  13513. // {
  13514. // "description": "Updates the specified context.",
  13515. // "flatPath": "v2beta1/projects/{projectsId}/agent/sessions/{sessionsId}/contexts/{contextsId}",
  13516. // "httpMethod": "PATCH",
  13517. // "id": "dialogflow.projects.agent.sessions.contexts.patch",
  13518. // "parameterOrder": [
  13519. // "name"
  13520. // ],
  13521. // "parameters": {
  13522. // "name": {
  13523. // "description": "Required. The unique identifier of the context. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e/contexts/\u003cContext ID\u003e`,\nor `projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment ID\u003e/users/\u003cUser\nID\u003e/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.\n\nIf `Environment ID` is not specified, we assume default 'draft'\nenvironment. If `User ID` is not specified, we assume default '-' user.",
  13524. // "location": "path",
  13525. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+/contexts/[^/]+$",
  13526. // "required": true,
  13527. // "type": "string"
  13528. // },
  13529. // "updateMask": {
  13530. // "description": "Optional. The mask to control which fields get updated.",
  13531. // "format": "google-fieldmask",
  13532. // "location": "query",
  13533. // "type": "string"
  13534. // }
  13535. // },
  13536. // "path": "v2beta1/{+name}",
  13537. // "request": {
  13538. // "$ref": "GoogleCloudDialogflowV2beta1Context"
  13539. // },
  13540. // "response": {
  13541. // "$ref": "GoogleCloudDialogflowV2beta1Context"
  13542. // },
  13543. // "scopes": [
  13544. // "https://www.googleapis.com/auth/cloud-platform",
  13545. // "https://www.googleapis.com/auth/dialogflow"
  13546. // ]
  13547. // }
  13548. }
  13549. // method id "dialogflow.projects.agent.sessions.entityTypes.create":
  13550. type ProjectsAgentSessionsEntityTypesCreateCall struct {
  13551. s *Service
  13552. parent string
  13553. googleclouddialogflowv2beta1sessionentitytype *GoogleCloudDialogflowV2beta1SessionEntityType
  13554. urlParams_ gensupport.URLParams
  13555. ctx_ context.Context
  13556. header_ http.Header
  13557. }
  13558. // Create: Creates a session entity type.
  13559. //
  13560. // If the specified session entity type already exists, overrides
  13561. // the
  13562. // session entity type.
  13563. func (r *ProjectsAgentSessionsEntityTypesService) Create(parent string, googleclouddialogflowv2beta1sessionentitytype *GoogleCloudDialogflowV2beta1SessionEntityType) *ProjectsAgentSessionsEntityTypesCreateCall {
  13564. c := &ProjectsAgentSessionsEntityTypesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13565. c.parent = parent
  13566. c.googleclouddialogflowv2beta1sessionentitytype = googleclouddialogflowv2beta1sessionentitytype
  13567. return c
  13568. }
  13569. // Fields allows partial responses to be retrieved. See
  13570. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13571. // for more information.
  13572. func (c *ProjectsAgentSessionsEntityTypesCreateCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsEntityTypesCreateCall {
  13573. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13574. return c
  13575. }
  13576. // Context sets the context to be used in this call's Do method. Any
  13577. // pending HTTP request will be aborted if the provided context is
  13578. // canceled.
  13579. func (c *ProjectsAgentSessionsEntityTypesCreateCall) Context(ctx context.Context) *ProjectsAgentSessionsEntityTypesCreateCall {
  13580. c.ctx_ = ctx
  13581. return c
  13582. }
  13583. // Header returns an http.Header that can be modified by the caller to
  13584. // add HTTP headers to the request.
  13585. func (c *ProjectsAgentSessionsEntityTypesCreateCall) Header() http.Header {
  13586. if c.header_ == nil {
  13587. c.header_ = make(http.Header)
  13588. }
  13589. return c.header_
  13590. }
  13591. func (c *ProjectsAgentSessionsEntityTypesCreateCall) doRequest(alt string) (*http.Response, error) {
  13592. reqHeaders := make(http.Header)
  13593. for k, v := range c.header_ {
  13594. reqHeaders[k] = v
  13595. }
  13596. reqHeaders.Set("User-Agent", c.s.userAgent())
  13597. var body io.Reader = nil
  13598. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1sessionentitytype)
  13599. if err != nil {
  13600. return nil, err
  13601. }
  13602. reqHeaders.Set("Content-Type", "application/json")
  13603. c.urlParams_.Set("alt", alt)
  13604. c.urlParams_.Set("prettyPrint", "false")
  13605. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/entityTypes")
  13606. urls += "?" + c.urlParams_.Encode()
  13607. req, err := http.NewRequest("POST", urls, body)
  13608. if err != nil {
  13609. return nil, err
  13610. }
  13611. req.Header = reqHeaders
  13612. googleapi.Expand(req.URL, map[string]string{
  13613. "parent": c.parent,
  13614. })
  13615. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13616. }
  13617. // Do executes the "dialogflow.projects.agent.sessions.entityTypes.create" call.
  13618. // Exactly one of *GoogleCloudDialogflowV2beta1SessionEntityType or
  13619. // error will be non-nil. Any non-2xx status code is an error. Response
  13620. // headers are in either
  13621. // *GoogleCloudDialogflowV2beta1SessionEntityType.ServerResponse.Header
  13622. // or (if a response was returned at all) in
  13623. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  13624. // whether the returned error was because http.StatusNotModified was
  13625. // returned.
  13626. func (c *ProjectsAgentSessionsEntityTypesCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1SessionEntityType, error) {
  13627. gensupport.SetOptions(c.urlParams_, opts...)
  13628. res, err := c.doRequest("json")
  13629. if res != nil && res.StatusCode == http.StatusNotModified {
  13630. if res.Body != nil {
  13631. res.Body.Close()
  13632. }
  13633. return nil, &googleapi.Error{
  13634. Code: res.StatusCode,
  13635. Header: res.Header,
  13636. }
  13637. }
  13638. if err != nil {
  13639. return nil, err
  13640. }
  13641. defer googleapi.CloseBody(res)
  13642. if err := googleapi.CheckResponse(res); err != nil {
  13643. return nil, err
  13644. }
  13645. ret := &GoogleCloudDialogflowV2beta1SessionEntityType{
  13646. ServerResponse: googleapi.ServerResponse{
  13647. Header: res.Header,
  13648. HTTPStatusCode: res.StatusCode,
  13649. },
  13650. }
  13651. target := &ret
  13652. if err := gensupport.DecodeResponse(target, res); err != nil {
  13653. return nil, err
  13654. }
  13655. return ret, nil
  13656. // {
  13657. // "description": "Creates a session entity type.\n\nIf the specified session entity type already exists, overrides the\nsession entity type.",
  13658. // "flatPath": "v2beta1/projects/{projectsId}/agent/sessions/{sessionsId}/entityTypes",
  13659. // "httpMethod": "POST",
  13660. // "id": "dialogflow.projects.agent.sessions.entityTypes.create",
  13661. // "parameterOrder": [
  13662. // "parent"
  13663. // ],
  13664. // "parameters": {
  13665. // "parent": {
  13666. // "description": "Required. The session to create a session entity type for.\nFormat: `projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e` or\n`projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment ID\u003e/users/\u003cUser ID\u003e/\nsessions/\u003cSession ID\u003e`. If `Environment ID` is not specified, we assume\ndefault 'draft' environment. If `User ID` is not specified, we assume\ndefault '-' user.",
  13667. // "location": "path",
  13668. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+$",
  13669. // "required": true,
  13670. // "type": "string"
  13671. // }
  13672. // },
  13673. // "path": "v2beta1/{+parent}/entityTypes",
  13674. // "request": {
  13675. // "$ref": "GoogleCloudDialogflowV2beta1SessionEntityType"
  13676. // },
  13677. // "response": {
  13678. // "$ref": "GoogleCloudDialogflowV2beta1SessionEntityType"
  13679. // },
  13680. // "scopes": [
  13681. // "https://www.googleapis.com/auth/cloud-platform",
  13682. // "https://www.googleapis.com/auth/dialogflow"
  13683. // ]
  13684. // }
  13685. }
  13686. // method id "dialogflow.projects.agent.sessions.entityTypes.delete":
  13687. type ProjectsAgentSessionsEntityTypesDeleteCall struct {
  13688. s *Service
  13689. name string
  13690. urlParams_ gensupport.URLParams
  13691. ctx_ context.Context
  13692. header_ http.Header
  13693. }
  13694. // Delete: Deletes the specified session entity type.
  13695. func (r *ProjectsAgentSessionsEntityTypesService) Delete(name string) *ProjectsAgentSessionsEntityTypesDeleteCall {
  13696. c := &ProjectsAgentSessionsEntityTypesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13697. c.name = name
  13698. return c
  13699. }
  13700. // Fields allows partial responses to be retrieved. See
  13701. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13702. // for more information.
  13703. func (c *ProjectsAgentSessionsEntityTypesDeleteCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsEntityTypesDeleteCall {
  13704. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13705. return c
  13706. }
  13707. // Context sets the context to be used in this call's Do method. Any
  13708. // pending HTTP request will be aborted if the provided context is
  13709. // canceled.
  13710. func (c *ProjectsAgentSessionsEntityTypesDeleteCall) Context(ctx context.Context) *ProjectsAgentSessionsEntityTypesDeleteCall {
  13711. c.ctx_ = ctx
  13712. return c
  13713. }
  13714. // Header returns an http.Header that can be modified by the caller to
  13715. // add HTTP headers to the request.
  13716. func (c *ProjectsAgentSessionsEntityTypesDeleteCall) Header() http.Header {
  13717. if c.header_ == nil {
  13718. c.header_ = make(http.Header)
  13719. }
  13720. return c.header_
  13721. }
  13722. func (c *ProjectsAgentSessionsEntityTypesDeleteCall) doRequest(alt string) (*http.Response, error) {
  13723. reqHeaders := make(http.Header)
  13724. for k, v := range c.header_ {
  13725. reqHeaders[k] = v
  13726. }
  13727. reqHeaders.Set("User-Agent", c.s.userAgent())
  13728. var body io.Reader = nil
  13729. c.urlParams_.Set("alt", alt)
  13730. c.urlParams_.Set("prettyPrint", "false")
  13731. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  13732. urls += "?" + c.urlParams_.Encode()
  13733. req, err := http.NewRequest("DELETE", urls, body)
  13734. if err != nil {
  13735. return nil, err
  13736. }
  13737. req.Header = reqHeaders
  13738. googleapi.Expand(req.URL, map[string]string{
  13739. "name": c.name,
  13740. })
  13741. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13742. }
  13743. // Do executes the "dialogflow.projects.agent.sessions.entityTypes.delete" call.
  13744. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  13745. // non-2xx status code is an error. Response headers are in either
  13746. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  13747. // returned at all) in error.(*googleapi.Error).Header. Use
  13748. // googleapi.IsNotModified to check whether the returned error was
  13749. // because http.StatusNotModified was returned.
  13750. func (c *ProjectsAgentSessionsEntityTypesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  13751. gensupport.SetOptions(c.urlParams_, opts...)
  13752. res, err := c.doRequest("json")
  13753. if res != nil && res.StatusCode == http.StatusNotModified {
  13754. if res.Body != nil {
  13755. res.Body.Close()
  13756. }
  13757. return nil, &googleapi.Error{
  13758. Code: res.StatusCode,
  13759. Header: res.Header,
  13760. }
  13761. }
  13762. if err != nil {
  13763. return nil, err
  13764. }
  13765. defer googleapi.CloseBody(res)
  13766. if err := googleapi.CheckResponse(res); err != nil {
  13767. return nil, err
  13768. }
  13769. ret := &GoogleProtobufEmpty{
  13770. ServerResponse: googleapi.ServerResponse{
  13771. Header: res.Header,
  13772. HTTPStatusCode: res.StatusCode,
  13773. },
  13774. }
  13775. target := &ret
  13776. if err := gensupport.DecodeResponse(target, res); err != nil {
  13777. return nil, err
  13778. }
  13779. return ret, nil
  13780. // {
  13781. // "description": "Deletes the specified session entity type.",
  13782. // "flatPath": "v2beta1/projects/{projectsId}/agent/sessions/{sessionsId}/entityTypes/{entityTypesId}",
  13783. // "httpMethod": "DELETE",
  13784. // "id": "dialogflow.projects.agent.sessions.entityTypes.delete",
  13785. // "parameterOrder": [
  13786. // "name"
  13787. // ],
  13788. // "parameters": {
  13789. // "name": {
  13790. // "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` or `projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment\nID\u003e/users/\u003cUser ID\u003e/sessions/\u003cSession ID\u003e/entityTypes/\u003cEntity Type Display\nName\u003e`. If `Environment ID` is not specified, we assume default 'draft'\nenvironment. If `User ID` is not specified, we assume default '-' user.",
  13791. // "location": "path",
  13792. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+/entityTypes/[^/]+$",
  13793. // "required": true,
  13794. // "type": "string"
  13795. // }
  13796. // },
  13797. // "path": "v2beta1/{+name}",
  13798. // "response": {
  13799. // "$ref": "GoogleProtobufEmpty"
  13800. // },
  13801. // "scopes": [
  13802. // "https://www.googleapis.com/auth/cloud-platform",
  13803. // "https://www.googleapis.com/auth/dialogflow"
  13804. // ]
  13805. // }
  13806. }
  13807. // method id "dialogflow.projects.agent.sessions.entityTypes.get":
  13808. type ProjectsAgentSessionsEntityTypesGetCall struct {
  13809. s *Service
  13810. name string
  13811. urlParams_ gensupport.URLParams
  13812. ifNoneMatch_ string
  13813. ctx_ context.Context
  13814. header_ http.Header
  13815. }
  13816. // Get: Retrieves the specified session entity type.
  13817. func (r *ProjectsAgentSessionsEntityTypesService) Get(name string) *ProjectsAgentSessionsEntityTypesGetCall {
  13818. c := &ProjectsAgentSessionsEntityTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13819. c.name = name
  13820. return c
  13821. }
  13822. // Fields allows partial responses to be retrieved. See
  13823. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13824. // for more information.
  13825. func (c *ProjectsAgentSessionsEntityTypesGetCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsEntityTypesGetCall {
  13826. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13827. return c
  13828. }
  13829. // IfNoneMatch sets the optional parameter which makes the operation
  13830. // fail if the object's ETag matches the given value. This is useful for
  13831. // getting updates only after the object has changed since the last
  13832. // request. Use googleapi.IsNotModified to check whether the response
  13833. // error from Do is the result of In-None-Match.
  13834. func (c *ProjectsAgentSessionsEntityTypesGetCall) IfNoneMatch(entityTag string) *ProjectsAgentSessionsEntityTypesGetCall {
  13835. c.ifNoneMatch_ = entityTag
  13836. return c
  13837. }
  13838. // Context sets the context to be used in this call's Do method. Any
  13839. // pending HTTP request will be aborted if the provided context is
  13840. // canceled.
  13841. func (c *ProjectsAgentSessionsEntityTypesGetCall) Context(ctx context.Context) *ProjectsAgentSessionsEntityTypesGetCall {
  13842. c.ctx_ = ctx
  13843. return c
  13844. }
  13845. // Header returns an http.Header that can be modified by the caller to
  13846. // add HTTP headers to the request.
  13847. func (c *ProjectsAgentSessionsEntityTypesGetCall) Header() http.Header {
  13848. if c.header_ == nil {
  13849. c.header_ = make(http.Header)
  13850. }
  13851. return c.header_
  13852. }
  13853. func (c *ProjectsAgentSessionsEntityTypesGetCall) doRequest(alt string) (*http.Response, error) {
  13854. reqHeaders := make(http.Header)
  13855. for k, v := range c.header_ {
  13856. reqHeaders[k] = v
  13857. }
  13858. reqHeaders.Set("User-Agent", c.s.userAgent())
  13859. if c.ifNoneMatch_ != "" {
  13860. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13861. }
  13862. var body io.Reader = nil
  13863. c.urlParams_.Set("alt", alt)
  13864. c.urlParams_.Set("prettyPrint", "false")
  13865. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  13866. urls += "?" + c.urlParams_.Encode()
  13867. req, err := http.NewRequest("GET", urls, body)
  13868. if err != nil {
  13869. return nil, err
  13870. }
  13871. req.Header = reqHeaders
  13872. googleapi.Expand(req.URL, map[string]string{
  13873. "name": c.name,
  13874. })
  13875. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13876. }
  13877. // Do executes the "dialogflow.projects.agent.sessions.entityTypes.get" call.
  13878. // Exactly one of *GoogleCloudDialogflowV2beta1SessionEntityType or
  13879. // error will be non-nil. Any non-2xx status code is an error. Response
  13880. // headers are in either
  13881. // *GoogleCloudDialogflowV2beta1SessionEntityType.ServerResponse.Header
  13882. // or (if a response was returned at all) in
  13883. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  13884. // whether the returned error was because http.StatusNotModified was
  13885. // returned.
  13886. func (c *ProjectsAgentSessionsEntityTypesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1SessionEntityType, error) {
  13887. gensupport.SetOptions(c.urlParams_, opts...)
  13888. res, err := c.doRequest("json")
  13889. if res != nil && res.StatusCode == http.StatusNotModified {
  13890. if res.Body != nil {
  13891. res.Body.Close()
  13892. }
  13893. return nil, &googleapi.Error{
  13894. Code: res.StatusCode,
  13895. Header: res.Header,
  13896. }
  13897. }
  13898. if err != nil {
  13899. return nil, err
  13900. }
  13901. defer googleapi.CloseBody(res)
  13902. if err := googleapi.CheckResponse(res); err != nil {
  13903. return nil, err
  13904. }
  13905. ret := &GoogleCloudDialogflowV2beta1SessionEntityType{
  13906. ServerResponse: googleapi.ServerResponse{
  13907. Header: res.Header,
  13908. HTTPStatusCode: res.StatusCode,
  13909. },
  13910. }
  13911. target := &ret
  13912. if err := gensupport.DecodeResponse(target, res); err != nil {
  13913. return nil, err
  13914. }
  13915. return ret, nil
  13916. // {
  13917. // "description": "Retrieves the specified session entity type.",
  13918. // "flatPath": "v2beta1/projects/{projectsId}/agent/sessions/{sessionsId}/entityTypes/{entityTypesId}",
  13919. // "httpMethod": "GET",
  13920. // "id": "dialogflow.projects.agent.sessions.entityTypes.get",
  13921. // "parameterOrder": [
  13922. // "name"
  13923. // ],
  13924. // "parameters": {
  13925. // "name": {
  13926. // "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` or `projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment\nID\u003e/users/\u003cUser ID\u003e/sessions/\u003cSession ID\u003e/entityTypes/\u003cEntity Type Display\nName\u003e`. If `Environment ID` is not specified, we assume default 'draft'\nenvironment. If `User ID` is not specified, we assume default '-' user.",
  13927. // "location": "path",
  13928. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+/entityTypes/[^/]+$",
  13929. // "required": true,
  13930. // "type": "string"
  13931. // }
  13932. // },
  13933. // "path": "v2beta1/{+name}",
  13934. // "response": {
  13935. // "$ref": "GoogleCloudDialogflowV2beta1SessionEntityType"
  13936. // },
  13937. // "scopes": [
  13938. // "https://www.googleapis.com/auth/cloud-platform",
  13939. // "https://www.googleapis.com/auth/dialogflow"
  13940. // ]
  13941. // }
  13942. }
  13943. // method id "dialogflow.projects.agent.sessions.entityTypes.list":
  13944. type ProjectsAgentSessionsEntityTypesListCall struct {
  13945. s *Service
  13946. parent string
  13947. urlParams_ gensupport.URLParams
  13948. ifNoneMatch_ string
  13949. ctx_ context.Context
  13950. header_ http.Header
  13951. }
  13952. // List: Returns the list of all session entity types in the specified
  13953. // session.
  13954. func (r *ProjectsAgentSessionsEntityTypesService) List(parent string) *ProjectsAgentSessionsEntityTypesListCall {
  13955. c := &ProjectsAgentSessionsEntityTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13956. c.parent = parent
  13957. return c
  13958. }
  13959. // PageSize sets the optional parameter "pageSize": The maximum number
  13960. // of items to return in a single page. By
  13961. // default 100 and at most 1000.
  13962. func (c *ProjectsAgentSessionsEntityTypesListCall) PageSize(pageSize int64) *ProjectsAgentSessionsEntityTypesListCall {
  13963. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  13964. return c
  13965. }
  13966. // PageToken sets the optional parameter "pageToken": The
  13967. // next_page_token value returned from a previous list request.
  13968. func (c *ProjectsAgentSessionsEntityTypesListCall) PageToken(pageToken string) *ProjectsAgentSessionsEntityTypesListCall {
  13969. c.urlParams_.Set("pageToken", pageToken)
  13970. return c
  13971. }
  13972. // Fields allows partial responses to be retrieved. See
  13973. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13974. // for more information.
  13975. func (c *ProjectsAgentSessionsEntityTypesListCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsEntityTypesListCall {
  13976. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13977. return c
  13978. }
  13979. // IfNoneMatch sets the optional parameter which makes the operation
  13980. // fail if the object's ETag matches the given value. This is useful for
  13981. // getting updates only after the object has changed since the last
  13982. // request. Use googleapi.IsNotModified to check whether the response
  13983. // error from Do is the result of In-None-Match.
  13984. func (c *ProjectsAgentSessionsEntityTypesListCall) IfNoneMatch(entityTag string) *ProjectsAgentSessionsEntityTypesListCall {
  13985. c.ifNoneMatch_ = entityTag
  13986. return c
  13987. }
  13988. // Context sets the context to be used in this call's Do method. Any
  13989. // pending HTTP request will be aborted if the provided context is
  13990. // canceled.
  13991. func (c *ProjectsAgentSessionsEntityTypesListCall) Context(ctx context.Context) *ProjectsAgentSessionsEntityTypesListCall {
  13992. c.ctx_ = ctx
  13993. return c
  13994. }
  13995. // Header returns an http.Header that can be modified by the caller to
  13996. // add HTTP headers to the request.
  13997. func (c *ProjectsAgentSessionsEntityTypesListCall) Header() http.Header {
  13998. if c.header_ == nil {
  13999. c.header_ = make(http.Header)
  14000. }
  14001. return c.header_
  14002. }
  14003. func (c *ProjectsAgentSessionsEntityTypesListCall) doRequest(alt string) (*http.Response, error) {
  14004. reqHeaders := make(http.Header)
  14005. for k, v := range c.header_ {
  14006. reqHeaders[k] = v
  14007. }
  14008. reqHeaders.Set("User-Agent", c.s.userAgent())
  14009. if c.ifNoneMatch_ != "" {
  14010. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14011. }
  14012. var body io.Reader = nil
  14013. c.urlParams_.Set("alt", alt)
  14014. c.urlParams_.Set("prettyPrint", "false")
  14015. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/entityTypes")
  14016. urls += "?" + c.urlParams_.Encode()
  14017. req, err := http.NewRequest("GET", urls, body)
  14018. if err != nil {
  14019. return nil, err
  14020. }
  14021. req.Header = reqHeaders
  14022. googleapi.Expand(req.URL, map[string]string{
  14023. "parent": c.parent,
  14024. })
  14025. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14026. }
  14027. // Do executes the "dialogflow.projects.agent.sessions.entityTypes.list" call.
  14028. // Exactly one of
  14029. // *GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse or error
  14030. // will be non-nil. Any non-2xx status code is an error. Response
  14031. // headers are in either
  14032. // *GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse.ServerResp
  14033. // onse.Header or (if a response was returned at all) in
  14034. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  14035. // whether the returned error was because http.StatusNotModified was
  14036. // returned.
  14037. func (c *ProjectsAgentSessionsEntityTypesListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse, error) {
  14038. gensupport.SetOptions(c.urlParams_, opts...)
  14039. res, err := c.doRequest("json")
  14040. if res != nil && res.StatusCode == http.StatusNotModified {
  14041. if res.Body != nil {
  14042. res.Body.Close()
  14043. }
  14044. return nil, &googleapi.Error{
  14045. Code: res.StatusCode,
  14046. Header: res.Header,
  14047. }
  14048. }
  14049. if err != nil {
  14050. return nil, err
  14051. }
  14052. defer googleapi.CloseBody(res)
  14053. if err := googleapi.CheckResponse(res); err != nil {
  14054. return nil, err
  14055. }
  14056. ret := &GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse{
  14057. ServerResponse: googleapi.ServerResponse{
  14058. Header: res.Header,
  14059. HTTPStatusCode: res.StatusCode,
  14060. },
  14061. }
  14062. target := &ret
  14063. if err := gensupport.DecodeResponse(target, res); err != nil {
  14064. return nil, err
  14065. }
  14066. return ret, nil
  14067. // {
  14068. // "description": "Returns the list of all session entity types in the specified session.",
  14069. // "flatPath": "v2beta1/projects/{projectsId}/agent/sessions/{sessionsId}/entityTypes",
  14070. // "httpMethod": "GET",
  14071. // "id": "dialogflow.projects.agent.sessions.entityTypes.list",
  14072. // "parameterOrder": [
  14073. // "parent"
  14074. // ],
  14075. // "parameters": {
  14076. // "pageSize": {
  14077. // "description": "Optional. The maximum number of items to return in a single page. By\ndefault 100 and at most 1000.",
  14078. // "format": "int32",
  14079. // "location": "query",
  14080. // "type": "integer"
  14081. // },
  14082. // "pageToken": {
  14083. // "description": "Optional. The next_page_token value returned from a previous list request.",
  14084. // "location": "query",
  14085. // "type": "string"
  14086. // },
  14087. // "parent": {
  14088. // "description": "Required. The session to list all session entity types from.\nFormat: `projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e` or\n`projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment ID\u003e/users/\u003cUser ID\u003e/\nsessions/\u003cSession ID\u003e`.\nIf `Environment ID` is not specified, we assume default 'draft'\nenvironment. If `User ID` is not specified, we assume default '-' user.",
  14089. // "location": "path",
  14090. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+$",
  14091. // "required": true,
  14092. // "type": "string"
  14093. // }
  14094. // },
  14095. // "path": "v2beta1/{+parent}/entityTypes",
  14096. // "response": {
  14097. // "$ref": "GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse"
  14098. // },
  14099. // "scopes": [
  14100. // "https://www.googleapis.com/auth/cloud-platform",
  14101. // "https://www.googleapis.com/auth/dialogflow"
  14102. // ]
  14103. // }
  14104. }
  14105. // Pages invokes f for each page of results.
  14106. // A non-nil error returned from f will halt the iteration.
  14107. // The provided context supersedes any context provided to the Context method.
  14108. func (c *ProjectsAgentSessionsEntityTypesListCall) Pages(ctx context.Context, f func(*GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse) error) error {
  14109. c.ctx_ = ctx
  14110. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  14111. for {
  14112. x, err := c.Do()
  14113. if err != nil {
  14114. return err
  14115. }
  14116. if err := f(x); err != nil {
  14117. return err
  14118. }
  14119. if x.NextPageToken == "" {
  14120. return nil
  14121. }
  14122. c.PageToken(x.NextPageToken)
  14123. }
  14124. }
  14125. // method id "dialogflow.projects.agent.sessions.entityTypes.patch":
  14126. type ProjectsAgentSessionsEntityTypesPatchCall struct {
  14127. s *Service
  14128. nameid string
  14129. googleclouddialogflowv2beta1sessionentitytype *GoogleCloudDialogflowV2beta1SessionEntityType
  14130. urlParams_ gensupport.URLParams
  14131. ctx_ context.Context
  14132. header_ http.Header
  14133. }
  14134. // Patch: Updates the specified session entity type.
  14135. func (r *ProjectsAgentSessionsEntityTypesService) Patch(nameid string, googleclouddialogflowv2beta1sessionentitytype *GoogleCloudDialogflowV2beta1SessionEntityType) *ProjectsAgentSessionsEntityTypesPatchCall {
  14136. c := &ProjectsAgentSessionsEntityTypesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14137. c.nameid = nameid
  14138. c.googleclouddialogflowv2beta1sessionentitytype = googleclouddialogflowv2beta1sessionentitytype
  14139. return c
  14140. }
  14141. // UpdateMask sets the optional parameter "updateMask": The mask to
  14142. // control which fields get updated.
  14143. func (c *ProjectsAgentSessionsEntityTypesPatchCall) UpdateMask(updateMask string) *ProjectsAgentSessionsEntityTypesPatchCall {
  14144. c.urlParams_.Set("updateMask", updateMask)
  14145. return c
  14146. }
  14147. // Fields allows partial responses to be retrieved. See
  14148. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14149. // for more information.
  14150. func (c *ProjectsAgentSessionsEntityTypesPatchCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsEntityTypesPatchCall {
  14151. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14152. return c
  14153. }
  14154. // Context sets the context to be used in this call's Do method. Any
  14155. // pending HTTP request will be aborted if the provided context is
  14156. // canceled.
  14157. func (c *ProjectsAgentSessionsEntityTypesPatchCall) Context(ctx context.Context) *ProjectsAgentSessionsEntityTypesPatchCall {
  14158. c.ctx_ = ctx
  14159. return c
  14160. }
  14161. // Header returns an http.Header that can be modified by the caller to
  14162. // add HTTP headers to the request.
  14163. func (c *ProjectsAgentSessionsEntityTypesPatchCall) Header() http.Header {
  14164. if c.header_ == nil {
  14165. c.header_ = make(http.Header)
  14166. }
  14167. return c.header_
  14168. }
  14169. func (c *ProjectsAgentSessionsEntityTypesPatchCall) doRequest(alt string) (*http.Response, error) {
  14170. reqHeaders := make(http.Header)
  14171. for k, v := range c.header_ {
  14172. reqHeaders[k] = v
  14173. }
  14174. reqHeaders.Set("User-Agent", c.s.userAgent())
  14175. var body io.Reader = nil
  14176. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1sessionentitytype)
  14177. if err != nil {
  14178. return nil, err
  14179. }
  14180. reqHeaders.Set("Content-Type", "application/json")
  14181. c.urlParams_.Set("alt", alt)
  14182. c.urlParams_.Set("prettyPrint", "false")
  14183. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  14184. urls += "?" + c.urlParams_.Encode()
  14185. req, err := http.NewRequest("PATCH", urls, body)
  14186. if err != nil {
  14187. return nil, err
  14188. }
  14189. req.Header = reqHeaders
  14190. googleapi.Expand(req.URL, map[string]string{
  14191. "name": c.nameid,
  14192. })
  14193. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14194. }
  14195. // Do executes the "dialogflow.projects.agent.sessions.entityTypes.patch" call.
  14196. // Exactly one of *GoogleCloudDialogflowV2beta1SessionEntityType or
  14197. // error will be non-nil. Any non-2xx status code is an error. Response
  14198. // headers are in either
  14199. // *GoogleCloudDialogflowV2beta1SessionEntityType.ServerResponse.Header
  14200. // or (if a response was returned at all) in
  14201. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  14202. // whether the returned error was because http.StatusNotModified was
  14203. // returned.
  14204. func (c *ProjectsAgentSessionsEntityTypesPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1SessionEntityType, error) {
  14205. gensupport.SetOptions(c.urlParams_, opts...)
  14206. res, err := c.doRequest("json")
  14207. if res != nil && res.StatusCode == http.StatusNotModified {
  14208. if res.Body != nil {
  14209. res.Body.Close()
  14210. }
  14211. return nil, &googleapi.Error{
  14212. Code: res.StatusCode,
  14213. Header: res.Header,
  14214. }
  14215. }
  14216. if err != nil {
  14217. return nil, err
  14218. }
  14219. defer googleapi.CloseBody(res)
  14220. if err := googleapi.CheckResponse(res); err != nil {
  14221. return nil, err
  14222. }
  14223. ret := &GoogleCloudDialogflowV2beta1SessionEntityType{
  14224. ServerResponse: googleapi.ServerResponse{
  14225. Header: res.Header,
  14226. HTTPStatusCode: res.StatusCode,
  14227. },
  14228. }
  14229. target := &ret
  14230. if err := gensupport.DecodeResponse(target, res); err != nil {
  14231. return nil, err
  14232. }
  14233. return ret, nil
  14234. // {
  14235. // "description": "Updates the specified session entity type.",
  14236. // "flatPath": "v2beta1/projects/{projectsId}/agent/sessions/{sessionsId}/entityTypes/{entityTypesId}",
  14237. // "httpMethod": "PATCH",
  14238. // "id": "dialogflow.projects.agent.sessions.entityTypes.patch",
  14239. // "parameterOrder": [
  14240. // "name"
  14241. // ],
  14242. // "parameters": {
  14243. // "name": {
  14244. // "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`, or\n`projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment ID\u003e/users/\u003cUser\nID\u003e/sessions/\u003cSession ID\u003e/entityTypes/\u003cEntity Type Display Name\u003e`.\nIf `Environment ID` is not specified, we assume default 'draft'\nenvironment. If `User ID` is not specified, we assume default '-' user.\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.",
  14245. // "location": "path",
  14246. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+/entityTypes/[^/]+$",
  14247. // "required": true,
  14248. // "type": "string"
  14249. // },
  14250. // "updateMask": {
  14251. // "description": "Optional. The mask to control which fields get updated.",
  14252. // "format": "google-fieldmask",
  14253. // "location": "query",
  14254. // "type": "string"
  14255. // }
  14256. // },
  14257. // "path": "v2beta1/{+name}",
  14258. // "request": {
  14259. // "$ref": "GoogleCloudDialogflowV2beta1SessionEntityType"
  14260. // },
  14261. // "response": {
  14262. // "$ref": "GoogleCloudDialogflowV2beta1SessionEntityType"
  14263. // },
  14264. // "scopes": [
  14265. // "https://www.googleapis.com/auth/cloud-platform",
  14266. // "https://www.googleapis.com/auth/dialogflow"
  14267. // ]
  14268. // }
  14269. }
  14270. // method id "dialogflow.projects.knowledgeBases.create":
  14271. type ProjectsKnowledgeBasesCreateCall struct {
  14272. s *Service
  14273. parent string
  14274. googleclouddialogflowv2beta1knowledgebase *GoogleCloudDialogflowV2beta1KnowledgeBase
  14275. urlParams_ gensupport.URLParams
  14276. ctx_ context.Context
  14277. header_ http.Header
  14278. }
  14279. // Create: Creates a knowledge base.
  14280. func (r *ProjectsKnowledgeBasesService) Create(parent string, googleclouddialogflowv2beta1knowledgebase *GoogleCloudDialogflowV2beta1KnowledgeBase) *ProjectsKnowledgeBasesCreateCall {
  14281. c := &ProjectsKnowledgeBasesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14282. c.parent = parent
  14283. c.googleclouddialogflowv2beta1knowledgebase = googleclouddialogflowv2beta1knowledgebase
  14284. return c
  14285. }
  14286. // Fields allows partial responses to be retrieved. See
  14287. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14288. // for more information.
  14289. func (c *ProjectsKnowledgeBasesCreateCall) Fields(s ...googleapi.Field) *ProjectsKnowledgeBasesCreateCall {
  14290. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14291. return c
  14292. }
  14293. // Context sets the context to be used in this call's Do method. Any
  14294. // pending HTTP request will be aborted if the provided context is
  14295. // canceled.
  14296. func (c *ProjectsKnowledgeBasesCreateCall) Context(ctx context.Context) *ProjectsKnowledgeBasesCreateCall {
  14297. c.ctx_ = ctx
  14298. return c
  14299. }
  14300. // Header returns an http.Header that can be modified by the caller to
  14301. // add HTTP headers to the request.
  14302. func (c *ProjectsKnowledgeBasesCreateCall) Header() http.Header {
  14303. if c.header_ == nil {
  14304. c.header_ = make(http.Header)
  14305. }
  14306. return c.header_
  14307. }
  14308. func (c *ProjectsKnowledgeBasesCreateCall) doRequest(alt string) (*http.Response, error) {
  14309. reqHeaders := make(http.Header)
  14310. for k, v := range c.header_ {
  14311. reqHeaders[k] = v
  14312. }
  14313. reqHeaders.Set("User-Agent", c.s.userAgent())
  14314. var body io.Reader = nil
  14315. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1knowledgebase)
  14316. if err != nil {
  14317. return nil, err
  14318. }
  14319. reqHeaders.Set("Content-Type", "application/json")
  14320. c.urlParams_.Set("alt", alt)
  14321. c.urlParams_.Set("prettyPrint", "false")
  14322. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/knowledgeBases")
  14323. urls += "?" + c.urlParams_.Encode()
  14324. req, err := http.NewRequest("POST", urls, body)
  14325. if err != nil {
  14326. return nil, err
  14327. }
  14328. req.Header = reqHeaders
  14329. googleapi.Expand(req.URL, map[string]string{
  14330. "parent": c.parent,
  14331. })
  14332. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14333. }
  14334. // Do executes the "dialogflow.projects.knowledgeBases.create" call.
  14335. // Exactly one of *GoogleCloudDialogflowV2beta1KnowledgeBase or error
  14336. // will be non-nil. Any non-2xx status code is an error. Response
  14337. // headers are in either
  14338. // *GoogleCloudDialogflowV2beta1KnowledgeBase.ServerResponse.Header or
  14339. // (if a response was returned at all) in
  14340. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  14341. // whether the returned error was because http.StatusNotModified was
  14342. // returned.
  14343. func (c *ProjectsKnowledgeBasesCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1KnowledgeBase, error) {
  14344. gensupport.SetOptions(c.urlParams_, opts...)
  14345. res, err := c.doRequest("json")
  14346. if res != nil && res.StatusCode == http.StatusNotModified {
  14347. if res.Body != nil {
  14348. res.Body.Close()
  14349. }
  14350. return nil, &googleapi.Error{
  14351. Code: res.StatusCode,
  14352. Header: res.Header,
  14353. }
  14354. }
  14355. if err != nil {
  14356. return nil, err
  14357. }
  14358. defer googleapi.CloseBody(res)
  14359. if err := googleapi.CheckResponse(res); err != nil {
  14360. return nil, err
  14361. }
  14362. ret := &GoogleCloudDialogflowV2beta1KnowledgeBase{
  14363. ServerResponse: googleapi.ServerResponse{
  14364. Header: res.Header,
  14365. HTTPStatusCode: res.StatusCode,
  14366. },
  14367. }
  14368. target := &ret
  14369. if err := gensupport.DecodeResponse(target, res); err != nil {
  14370. return nil, err
  14371. }
  14372. return ret, nil
  14373. // {
  14374. // "description": "Creates a knowledge base.",
  14375. // "flatPath": "v2beta1/projects/{projectsId}/knowledgeBases",
  14376. // "httpMethod": "POST",
  14377. // "id": "dialogflow.projects.knowledgeBases.create",
  14378. // "parameterOrder": [
  14379. // "parent"
  14380. // ],
  14381. // "parameters": {
  14382. // "parent": {
  14383. // "description": "Required. The project to create a knowledge base for.\nFormat: `projects/\u003cProject ID\u003e`.",
  14384. // "location": "path",
  14385. // "pattern": "^projects/[^/]+$",
  14386. // "required": true,
  14387. // "type": "string"
  14388. // }
  14389. // },
  14390. // "path": "v2beta1/{+parent}/knowledgeBases",
  14391. // "request": {
  14392. // "$ref": "GoogleCloudDialogflowV2beta1KnowledgeBase"
  14393. // },
  14394. // "response": {
  14395. // "$ref": "GoogleCloudDialogflowV2beta1KnowledgeBase"
  14396. // },
  14397. // "scopes": [
  14398. // "https://www.googleapis.com/auth/cloud-platform",
  14399. // "https://www.googleapis.com/auth/dialogflow"
  14400. // ]
  14401. // }
  14402. }
  14403. // method id "dialogflow.projects.knowledgeBases.delete":
  14404. type ProjectsKnowledgeBasesDeleteCall struct {
  14405. s *Service
  14406. name string
  14407. urlParams_ gensupport.URLParams
  14408. ctx_ context.Context
  14409. header_ http.Header
  14410. }
  14411. // Delete: Deletes the specified knowledge base.
  14412. func (r *ProjectsKnowledgeBasesService) Delete(name string) *ProjectsKnowledgeBasesDeleteCall {
  14413. c := &ProjectsKnowledgeBasesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14414. c.name = name
  14415. return c
  14416. }
  14417. // Force sets the optional parameter "force": Force deletes the
  14418. // knowledge base. When set to true, any documents
  14419. // in the knowledge base are also deleted.
  14420. func (c *ProjectsKnowledgeBasesDeleteCall) Force(force bool) *ProjectsKnowledgeBasesDeleteCall {
  14421. c.urlParams_.Set("force", fmt.Sprint(force))
  14422. return c
  14423. }
  14424. // Fields allows partial responses to be retrieved. See
  14425. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14426. // for more information.
  14427. func (c *ProjectsKnowledgeBasesDeleteCall) Fields(s ...googleapi.Field) *ProjectsKnowledgeBasesDeleteCall {
  14428. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14429. return c
  14430. }
  14431. // Context sets the context to be used in this call's Do method. Any
  14432. // pending HTTP request will be aborted if the provided context is
  14433. // canceled.
  14434. func (c *ProjectsKnowledgeBasesDeleteCall) Context(ctx context.Context) *ProjectsKnowledgeBasesDeleteCall {
  14435. c.ctx_ = ctx
  14436. return c
  14437. }
  14438. // Header returns an http.Header that can be modified by the caller to
  14439. // add HTTP headers to the request.
  14440. func (c *ProjectsKnowledgeBasesDeleteCall) Header() http.Header {
  14441. if c.header_ == nil {
  14442. c.header_ = make(http.Header)
  14443. }
  14444. return c.header_
  14445. }
  14446. func (c *ProjectsKnowledgeBasesDeleteCall) doRequest(alt string) (*http.Response, error) {
  14447. reqHeaders := make(http.Header)
  14448. for k, v := range c.header_ {
  14449. reqHeaders[k] = v
  14450. }
  14451. reqHeaders.Set("User-Agent", c.s.userAgent())
  14452. var body io.Reader = nil
  14453. c.urlParams_.Set("alt", alt)
  14454. c.urlParams_.Set("prettyPrint", "false")
  14455. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  14456. urls += "?" + c.urlParams_.Encode()
  14457. req, err := http.NewRequest("DELETE", urls, body)
  14458. if err != nil {
  14459. return nil, err
  14460. }
  14461. req.Header = reqHeaders
  14462. googleapi.Expand(req.URL, map[string]string{
  14463. "name": c.name,
  14464. })
  14465. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14466. }
  14467. // Do executes the "dialogflow.projects.knowledgeBases.delete" call.
  14468. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  14469. // non-2xx status code is an error. Response headers are in either
  14470. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  14471. // returned at all) in error.(*googleapi.Error).Header. Use
  14472. // googleapi.IsNotModified to check whether the returned error was
  14473. // because http.StatusNotModified was returned.
  14474. func (c *ProjectsKnowledgeBasesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  14475. gensupport.SetOptions(c.urlParams_, opts...)
  14476. res, err := c.doRequest("json")
  14477. if res != nil && res.StatusCode == http.StatusNotModified {
  14478. if res.Body != nil {
  14479. res.Body.Close()
  14480. }
  14481. return nil, &googleapi.Error{
  14482. Code: res.StatusCode,
  14483. Header: res.Header,
  14484. }
  14485. }
  14486. if err != nil {
  14487. return nil, err
  14488. }
  14489. defer googleapi.CloseBody(res)
  14490. if err := googleapi.CheckResponse(res); err != nil {
  14491. return nil, err
  14492. }
  14493. ret := &GoogleProtobufEmpty{
  14494. ServerResponse: googleapi.ServerResponse{
  14495. Header: res.Header,
  14496. HTTPStatusCode: res.StatusCode,
  14497. },
  14498. }
  14499. target := &ret
  14500. if err := gensupport.DecodeResponse(target, res); err != nil {
  14501. return nil, err
  14502. }
  14503. return ret, nil
  14504. // {
  14505. // "description": "Deletes the specified knowledge base.",
  14506. // "flatPath": "v2beta1/projects/{projectsId}/knowledgeBases/{knowledgeBasesId}",
  14507. // "httpMethod": "DELETE",
  14508. // "id": "dialogflow.projects.knowledgeBases.delete",
  14509. // "parameterOrder": [
  14510. // "name"
  14511. // ],
  14512. // "parameters": {
  14513. // "force": {
  14514. // "description": "Optional. Force deletes the knowledge base. When set to true, any documents\nin the knowledge base are also deleted.",
  14515. // "location": "query",
  14516. // "type": "boolean"
  14517. // },
  14518. // "name": {
  14519. // "description": "Required. The name of the knowledge base to delete.\nFormat: `projects/\u003cProject ID\u003e/knowledgeBases/\u003cKnowledge Base ID\u003e`.",
  14520. // "location": "path",
  14521. // "pattern": "^projects/[^/]+/knowledgeBases/[^/]+$",
  14522. // "required": true,
  14523. // "type": "string"
  14524. // }
  14525. // },
  14526. // "path": "v2beta1/{+name}",
  14527. // "response": {
  14528. // "$ref": "GoogleProtobufEmpty"
  14529. // },
  14530. // "scopes": [
  14531. // "https://www.googleapis.com/auth/cloud-platform",
  14532. // "https://www.googleapis.com/auth/dialogflow"
  14533. // ]
  14534. // }
  14535. }
  14536. // method id "dialogflow.projects.knowledgeBases.get":
  14537. type ProjectsKnowledgeBasesGetCall struct {
  14538. s *Service
  14539. name string
  14540. urlParams_ gensupport.URLParams
  14541. ifNoneMatch_ string
  14542. ctx_ context.Context
  14543. header_ http.Header
  14544. }
  14545. // Get: Retrieves the specified knowledge base.
  14546. func (r *ProjectsKnowledgeBasesService) Get(name string) *ProjectsKnowledgeBasesGetCall {
  14547. c := &ProjectsKnowledgeBasesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14548. c.name = name
  14549. return c
  14550. }
  14551. // Fields allows partial responses to be retrieved. See
  14552. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14553. // for more information.
  14554. func (c *ProjectsKnowledgeBasesGetCall) Fields(s ...googleapi.Field) *ProjectsKnowledgeBasesGetCall {
  14555. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14556. return c
  14557. }
  14558. // IfNoneMatch sets the optional parameter which makes the operation
  14559. // fail if the object's ETag matches the given value. This is useful for
  14560. // getting updates only after the object has changed since the last
  14561. // request. Use googleapi.IsNotModified to check whether the response
  14562. // error from Do is the result of In-None-Match.
  14563. func (c *ProjectsKnowledgeBasesGetCall) IfNoneMatch(entityTag string) *ProjectsKnowledgeBasesGetCall {
  14564. c.ifNoneMatch_ = entityTag
  14565. return c
  14566. }
  14567. // Context sets the context to be used in this call's Do method. Any
  14568. // pending HTTP request will be aborted if the provided context is
  14569. // canceled.
  14570. func (c *ProjectsKnowledgeBasesGetCall) Context(ctx context.Context) *ProjectsKnowledgeBasesGetCall {
  14571. c.ctx_ = ctx
  14572. return c
  14573. }
  14574. // Header returns an http.Header that can be modified by the caller to
  14575. // add HTTP headers to the request.
  14576. func (c *ProjectsKnowledgeBasesGetCall) Header() http.Header {
  14577. if c.header_ == nil {
  14578. c.header_ = make(http.Header)
  14579. }
  14580. return c.header_
  14581. }
  14582. func (c *ProjectsKnowledgeBasesGetCall) doRequest(alt string) (*http.Response, error) {
  14583. reqHeaders := make(http.Header)
  14584. for k, v := range c.header_ {
  14585. reqHeaders[k] = v
  14586. }
  14587. reqHeaders.Set("User-Agent", c.s.userAgent())
  14588. if c.ifNoneMatch_ != "" {
  14589. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14590. }
  14591. var body io.Reader = nil
  14592. c.urlParams_.Set("alt", alt)
  14593. c.urlParams_.Set("prettyPrint", "false")
  14594. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  14595. urls += "?" + c.urlParams_.Encode()
  14596. req, err := http.NewRequest("GET", urls, body)
  14597. if err != nil {
  14598. return nil, err
  14599. }
  14600. req.Header = reqHeaders
  14601. googleapi.Expand(req.URL, map[string]string{
  14602. "name": c.name,
  14603. })
  14604. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14605. }
  14606. // Do executes the "dialogflow.projects.knowledgeBases.get" call.
  14607. // Exactly one of *GoogleCloudDialogflowV2beta1KnowledgeBase or error
  14608. // will be non-nil. Any non-2xx status code is an error. Response
  14609. // headers are in either
  14610. // *GoogleCloudDialogflowV2beta1KnowledgeBase.ServerResponse.Header or
  14611. // (if a response was returned at all) in
  14612. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  14613. // whether the returned error was because http.StatusNotModified was
  14614. // returned.
  14615. func (c *ProjectsKnowledgeBasesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1KnowledgeBase, error) {
  14616. gensupport.SetOptions(c.urlParams_, opts...)
  14617. res, err := c.doRequest("json")
  14618. if res != nil && res.StatusCode == http.StatusNotModified {
  14619. if res.Body != nil {
  14620. res.Body.Close()
  14621. }
  14622. return nil, &googleapi.Error{
  14623. Code: res.StatusCode,
  14624. Header: res.Header,
  14625. }
  14626. }
  14627. if err != nil {
  14628. return nil, err
  14629. }
  14630. defer googleapi.CloseBody(res)
  14631. if err := googleapi.CheckResponse(res); err != nil {
  14632. return nil, err
  14633. }
  14634. ret := &GoogleCloudDialogflowV2beta1KnowledgeBase{
  14635. ServerResponse: googleapi.ServerResponse{
  14636. Header: res.Header,
  14637. HTTPStatusCode: res.StatusCode,
  14638. },
  14639. }
  14640. target := &ret
  14641. if err := gensupport.DecodeResponse(target, res); err != nil {
  14642. return nil, err
  14643. }
  14644. return ret, nil
  14645. // {
  14646. // "description": "Retrieves the specified knowledge base.",
  14647. // "flatPath": "v2beta1/projects/{projectsId}/knowledgeBases/{knowledgeBasesId}",
  14648. // "httpMethod": "GET",
  14649. // "id": "dialogflow.projects.knowledgeBases.get",
  14650. // "parameterOrder": [
  14651. // "name"
  14652. // ],
  14653. // "parameters": {
  14654. // "name": {
  14655. // "description": "Required. The name of the knowledge base to retrieve.\nFormat `projects/\u003cProject ID\u003e/knowledgeBases/\u003cKnowledge Base ID\u003e`.",
  14656. // "location": "path",
  14657. // "pattern": "^projects/[^/]+/knowledgeBases/[^/]+$",
  14658. // "required": true,
  14659. // "type": "string"
  14660. // }
  14661. // },
  14662. // "path": "v2beta1/{+name}",
  14663. // "response": {
  14664. // "$ref": "GoogleCloudDialogflowV2beta1KnowledgeBase"
  14665. // },
  14666. // "scopes": [
  14667. // "https://www.googleapis.com/auth/cloud-platform",
  14668. // "https://www.googleapis.com/auth/dialogflow"
  14669. // ]
  14670. // }
  14671. }
  14672. // method id "dialogflow.projects.knowledgeBases.list":
  14673. type ProjectsKnowledgeBasesListCall struct {
  14674. s *Service
  14675. parent string
  14676. urlParams_ gensupport.URLParams
  14677. ifNoneMatch_ string
  14678. ctx_ context.Context
  14679. header_ http.Header
  14680. }
  14681. // List: Returns the list of all knowledge bases of the specified agent.
  14682. func (r *ProjectsKnowledgeBasesService) List(parent string) *ProjectsKnowledgeBasesListCall {
  14683. c := &ProjectsKnowledgeBasesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14684. c.parent = parent
  14685. return c
  14686. }
  14687. // PageSize sets the optional parameter "pageSize": The maximum number
  14688. // of items to return in a single page. By
  14689. // default 10 and at most 100.
  14690. func (c *ProjectsKnowledgeBasesListCall) PageSize(pageSize int64) *ProjectsKnowledgeBasesListCall {
  14691. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  14692. return c
  14693. }
  14694. // PageToken sets the optional parameter "pageToken": The
  14695. // next_page_token value returned from a previous list request.
  14696. func (c *ProjectsKnowledgeBasesListCall) PageToken(pageToken string) *ProjectsKnowledgeBasesListCall {
  14697. c.urlParams_.Set("pageToken", pageToken)
  14698. return c
  14699. }
  14700. // Fields allows partial responses to be retrieved. See
  14701. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14702. // for more information.
  14703. func (c *ProjectsKnowledgeBasesListCall) Fields(s ...googleapi.Field) *ProjectsKnowledgeBasesListCall {
  14704. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14705. return c
  14706. }
  14707. // IfNoneMatch sets the optional parameter which makes the operation
  14708. // fail if the object's ETag matches the given value. This is useful for
  14709. // getting updates only after the object has changed since the last
  14710. // request. Use googleapi.IsNotModified to check whether the response
  14711. // error from Do is the result of In-None-Match.
  14712. func (c *ProjectsKnowledgeBasesListCall) IfNoneMatch(entityTag string) *ProjectsKnowledgeBasesListCall {
  14713. c.ifNoneMatch_ = entityTag
  14714. return c
  14715. }
  14716. // Context sets the context to be used in this call's Do method. Any
  14717. // pending HTTP request will be aborted if the provided context is
  14718. // canceled.
  14719. func (c *ProjectsKnowledgeBasesListCall) Context(ctx context.Context) *ProjectsKnowledgeBasesListCall {
  14720. c.ctx_ = ctx
  14721. return c
  14722. }
  14723. // Header returns an http.Header that can be modified by the caller to
  14724. // add HTTP headers to the request.
  14725. func (c *ProjectsKnowledgeBasesListCall) Header() http.Header {
  14726. if c.header_ == nil {
  14727. c.header_ = make(http.Header)
  14728. }
  14729. return c.header_
  14730. }
  14731. func (c *ProjectsKnowledgeBasesListCall) doRequest(alt string) (*http.Response, error) {
  14732. reqHeaders := make(http.Header)
  14733. for k, v := range c.header_ {
  14734. reqHeaders[k] = v
  14735. }
  14736. reqHeaders.Set("User-Agent", c.s.userAgent())
  14737. if c.ifNoneMatch_ != "" {
  14738. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14739. }
  14740. var body io.Reader = nil
  14741. c.urlParams_.Set("alt", alt)
  14742. c.urlParams_.Set("prettyPrint", "false")
  14743. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/knowledgeBases")
  14744. urls += "?" + c.urlParams_.Encode()
  14745. req, err := http.NewRequest("GET", urls, body)
  14746. if err != nil {
  14747. return nil, err
  14748. }
  14749. req.Header = reqHeaders
  14750. googleapi.Expand(req.URL, map[string]string{
  14751. "parent": c.parent,
  14752. })
  14753. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14754. }
  14755. // Do executes the "dialogflow.projects.knowledgeBases.list" call.
  14756. // Exactly one of
  14757. // *GoogleCloudDialogflowV2beta1ListKnowledgeBasesResponse or error will
  14758. // be non-nil. Any non-2xx status code is an error. Response headers are
  14759. // in either
  14760. // *GoogleCloudDialogflowV2beta1ListKnowledgeBasesResponse.ServerResponse
  14761. // .Header or (if a response was returned at all) in
  14762. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  14763. // whether the returned error was because http.StatusNotModified was
  14764. // returned.
  14765. func (c *ProjectsKnowledgeBasesListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1ListKnowledgeBasesResponse, error) {
  14766. gensupport.SetOptions(c.urlParams_, opts...)
  14767. res, err := c.doRequest("json")
  14768. if res != nil && res.StatusCode == http.StatusNotModified {
  14769. if res.Body != nil {
  14770. res.Body.Close()
  14771. }
  14772. return nil, &googleapi.Error{
  14773. Code: res.StatusCode,
  14774. Header: res.Header,
  14775. }
  14776. }
  14777. if err != nil {
  14778. return nil, err
  14779. }
  14780. defer googleapi.CloseBody(res)
  14781. if err := googleapi.CheckResponse(res); err != nil {
  14782. return nil, err
  14783. }
  14784. ret := &GoogleCloudDialogflowV2beta1ListKnowledgeBasesResponse{
  14785. ServerResponse: googleapi.ServerResponse{
  14786. Header: res.Header,
  14787. HTTPStatusCode: res.StatusCode,
  14788. },
  14789. }
  14790. target := &ret
  14791. if err := gensupport.DecodeResponse(target, res); err != nil {
  14792. return nil, err
  14793. }
  14794. return ret, nil
  14795. // {
  14796. // "description": "Returns the list of all knowledge bases of the specified agent.",
  14797. // "flatPath": "v2beta1/projects/{projectsId}/knowledgeBases",
  14798. // "httpMethod": "GET",
  14799. // "id": "dialogflow.projects.knowledgeBases.list",
  14800. // "parameterOrder": [
  14801. // "parent"
  14802. // ],
  14803. // "parameters": {
  14804. // "pageSize": {
  14805. // "description": "Optional. The maximum number of items to return in a single page. By\ndefault 10 and at most 100.",
  14806. // "format": "int32",
  14807. // "location": "query",
  14808. // "type": "integer"
  14809. // },
  14810. // "pageToken": {
  14811. // "description": "Optional. The next_page_token value returned from a previous list request.",
  14812. // "location": "query",
  14813. // "type": "string"
  14814. // },
  14815. // "parent": {
  14816. // "description": "Required. The project to list of knowledge bases for.\nFormat: `projects/\u003cProject ID\u003e`.",
  14817. // "location": "path",
  14818. // "pattern": "^projects/[^/]+$",
  14819. // "required": true,
  14820. // "type": "string"
  14821. // }
  14822. // },
  14823. // "path": "v2beta1/{+parent}/knowledgeBases",
  14824. // "response": {
  14825. // "$ref": "GoogleCloudDialogflowV2beta1ListKnowledgeBasesResponse"
  14826. // },
  14827. // "scopes": [
  14828. // "https://www.googleapis.com/auth/cloud-platform",
  14829. // "https://www.googleapis.com/auth/dialogflow"
  14830. // ]
  14831. // }
  14832. }
  14833. // Pages invokes f for each page of results.
  14834. // A non-nil error returned from f will halt the iteration.
  14835. // The provided context supersedes any context provided to the Context method.
  14836. func (c *ProjectsKnowledgeBasesListCall) Pages(ctx context.Context, f func(*GoogleCloudDialogflowV2beta1ListKnowledgeBasesResponse) error) error {
  14837. c.ctx_ = ctx
  14838. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  14839. for {
  14840. x, err := c.Do()
  14841. if err != nil {
  14842. return err
  14843. }
  14844. if err := f(x); err != nil {
  14845. return err
  14846. }
  14847. if x.NextPageToken == "" {
  14848. return nil
  14849. }
  14850. c.PageToken(x.NextPageToken)
  14851. }
  14852. }
  14853. // method id "dialogflow.projects.knowledgeBases.patch":
  14854. type ProjectsKnowledgeBasesPatchCall struct {
  14855. s *Service
  14856. name string
  14857. googleclouddialogflowv2beta1knowledgebase *GoogleCloudDialogflowV2beta1KnowledgeBase
  14858. urlParams_ gensupport.URLParams
  14859. ctx_ context.Context
  14860. header_ http.Header
  14861. }
  14862. // Patch: Updates the specified knowledge base.
  14863. func (r *ProjectsKnowledgeBasesService) Patch(name string, googleclouddialogflowv2beta1knowledgebase *GoogleCloudDialogflowV2beta1KnowledgeBase) *ProjectsKnowledgeBasesPatchCall {
  14864. c := &ProjectsKnowledgeBasesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14865. c.name = name
  14866. c.googleclouddialogflowv2beta1knowledgebase = googleclouddialogflowv2beta1knowledgebase
  14867. return c
  14868. }
  14869. // UpdateMask sets the optional parameter "updateMask": Not specified
  14870. // means `update all`.
  14871. // Currently, only `display_name` can be updated, an InvalidArgument
  14872. // will be
  14873. // returned for attempting to update other fields.
  14874. func (c *ProjectsKnowledgeBasesPatchCall) UpdateMask(updateMask string) *ProjectsKnowledgeBasesPatchCall {
  14875. c.urlParams_.Set("updateMask", updateMask)
  14876. return c
  14877. }
  14878. // Fields allows partial responses to be retrieved. See
  14879. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14880. // for more information.
  14881. func (c *ProjectsKnowledgeBasesPatchCall) Fields(s ...googleapi.Field) *ProjectsKnowledgeBasesPatchCall {
  14882. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14883. return c
  14884. }
  14885. // Context sets the context to be used in this call's Do method. Any
  14886. // pending HTTP request will be aborted if the provided context is
  14887. // canceled.
  14888. func (c *ProjectsKnowledgeBasesPatchCall) Context(ctx context.Context) *ProjectsKnowledgeBasesPatchCall {
  14889. c.ctx_ = ctx
  14890. return c
  14891. }
  14892. // Header returns an http.Header that can be modified by the caller to
  14893. // add HTTP headers to the request.
  14894. func (c *ProjectsKnowledgeBasesPatchCall) Header() http.Header {
  14895. if c.header_ == nil {
  14896. c.header_ = make(http.Header)
  14897. }
  14898. return c.header_
  14899. }
  14900. func (c *ProjectsKnowledgeBasesPatchCall) doRequest(alt string) (*http.Response, error) {
  14901. reqHeaders := make(http.Header)
  14902. for k, v := range c.header_ {
  14903. reqHeaders[k] = v
  14904. }
  14905. reqHeaders.Set("User-Agent", c.s.userAgent())
  14906. var body io.Reader = nil
  14907. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1knowledgebase)
  14908. if err != nil {
  14909. return nil, err
  14910. }
  14911. reqHeaders.Set("Content-Type", "application/json")
  14912. c.urlParams_.Set("alt", alt)
  14913. c.urlParams_.Set("prettyPrint", "false")
  14914. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  14915. urls += "?" + c.urlParams_.Encode()
  14916. req, err := http.NewRequest("PATCH", urls, body)
  14917. if err != nil {
  14918. return nil, err
  14919. }
  14920. req.Header = reqHeaders
  14921. googleapi.Expand(req.URL, map[string]string{
  14922. "name": c.name,
  14923. })
  14924. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14925. }
  14926. // Do executes the "dialogflow.projects.knowledgeBases.patch" call.
  14927. // Exactly one of *GoogleCloudDialogflowV2beta1KnowledgeBase or error
  14928. // will be non-nil. Any non-2xx status code is an error. Response
  14929. // headers are in either
  14930. // *GoogleCloudDialogflowV2beta1KnowledgeBase.ServerResponse.Header or
  14931. // (if a response was returned at all) in
  14932. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  14933. // whether the returned error was because http.StatusNotModified was
  14934. // returned.
  14935. func (c *ProjectsKnowledgeBasesPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1KnowledgeBase, error) {
  14936. gensupport.SetOptions(c.urlParams_, opts...)
  14937. res, err := c.doRequest("json")
  14938. if res != nil && res.StatusCode == http.StatusNotModified {
  14939. if res.Body != nil {
  14940. res.Body.Close()
  14941. }
  14942. return nil, &googleapi.Error{
  14943. Code: res.StatusCode,
  14944. Header: res.Header,
  14945. }
  14946. }
  14947. if err != nil {
  14948. return nil, err
  14949. }
  14950. defer googleapi.CloseBody(res)
  14951. if err := googleapi.CheckResponse(res); err != nil {
  14952. return nil, err
  14953. }
  14954. ret := &GoogleCloudDialogflowV2beta1KnowledgeBase{
  14955. ServerResponse: googleapi.ServerResponse{
  14956. Header: res.Header,
  14957. HTTPStatusCode: res.StatusCode,
  14958. },
  14959. }
  14960. target := &ret
  14961. if err := gensupport.DecodeResponse(target, res); err != nil {
  14962. return nil, err
  14963. }
  14964. return ret, nil
  14965. // {
  14966. // "description": "Updates the specified knowledge base.",
  14967. // "flatPath": "v2beta1/projects/{projectsId}/knowledgeBases/{knowledgeBasesId}",
  14968. // "httpMethod": "PATCH",
  14969. // "id": "dialogflow.projects.knowledgeBases.patch",
  14970. // "parameterOrder": [
  14971. // "name"
  14972. // ],
  14973. // "parameters": {
  14974. // "name": {
  14975. // "description": "The knowledge base resource name.\nThe name must be empty when creating a knowledge base.\nFormat: `projects/\u003cProject ID\u003e/knowledgeBases/\u003cKnowledge Base ID\u003e`.",
  14976. // "location": "path",
  14977. // "pattern": "^projects/[^/]+/knowledgeBases/[^/]+$",
  14978. // "required": true,
  14979. // "type": "string"
  14980. // },
  14981. // "updateMask": {
  14982. // "description": "Optional. Not specified means `update all`.\nCurrently, only `display_name` can be updated, an InvalidArgument will be\nreturned for attempting to update other fields.",
  14983. // "format": "google-fieldmask",
  14984. // "location": "query",
  14985. // "type": "string"
  14986. // }
  14987. // },
  14988. // "path": "v2beta1/{+name}",
  14989. // "request": {
  14990. // "$ref": "GoogleCloudDialogflowV2beta1KnowledgeBase"
  14991. // },
  14992. // "response": {
  14993. // "$ref": "GoogleCloudDialogflowV2beta1KnowledgeBase"
  14994. // },
  14995. // "scopes": [
  14996. // "https://www.googleapis.com/auth/cloud-platform",
  14997. // "https://www.googleapis.com/auth/dialogflow"
  14998. // ]
  14999. // }
  15000. }
  15001. // method id "dialogflow.projects.knowledgeBases.documents.create":
  15002. type ProjectsKnowledgeBasesDocumentsCreateCall struct {
  15003. s *Service
  15004. parent string
  15005. googleclouddialogflowv2beta1document *GoogleCloudDialogflowV2beta1Document
  15006. urlParams_ gensupport.URLParams
  15007. ctx_ context.Context
  15008. header_ http.Header
  15009. }
  15010. // Create: Creates a new document.
  15011. //
  15012. // Operation <response: Document,
  15013. // metadata: KnowledgeOperationMetadata>
  15014. func (r *ProjectsKnowledgeBasesDocumentsService) Create(parent string, googleclouddialogflowv2beta1document *GoogleCloudDialogflowV2beta1Document) *ProjectsKnowledgeBasesDocumentsCreateCall {
  15015. c := &ProjectsKnowledgeBasesDocumentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15016. c.parent = parent
  15017. c.googleclouddialogflowv2beta1document = googleclouddialogflowv2beta1document
  15018. return c
  15019. }
  15020. // Fields allows partial responses to be retrieved. See
  15021. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15022. // for more information.
  15023. func (c *ProjectsKnowledgeBasesDocumentsCreateCall) Fields(s ...googleapi.Field) *ProjectsKnowledgeBasesDocumentsCreateCall {
  15024. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15025. return c
  15026. }
  15027. // Context sets the context to be used in this call's Do method. Any
  15028. // pending HTTP request will be aborted if the provided context is
  15029. // canceled.
  15030. func (c *ProjectsKnowledgeBasesDocumentsCreateCall) Context(ctx context.Context) *ProjectsKnowledgeBasesDocumentsCreateCall {
  15031. c.ctx_ = ctx
  15032. return c
  15033. }
  15034. // Header returns an http.Header that can be modified by the caller to
  15035. // add HTTP headers to the request.
  15036. func (c *ProjectsKnowledgeBasesDocumentsCreateCall) Header() http.Header {
  15037. if c.header_ == nil {
  15038. c.header_ = make(http.Header)
  15039. }
  15040. return c.header_
  15041. }
  15042. func (c *ProjectsKnowledgeBasesDocumentsCreateCall) doRequest(alt string) (*http.Response, error) {
  15043. reqHeaders := make(http.Header)
  15044. for k, v := range c.header_ {
  15045. reqHeaders[k] = v
  15046. }
  15047. reqHeaders.Set("User-Agent", c.s.userAgent())
  15048. var body io.Reader = nil
  15049. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1document)
  15050. if err != nil {
  15051. return nil, err
  15052. }
  15053. reqHeaders.Set("Content-Type", "application/json")
  15054. c.urlParams_.Set("alt", alt)
  15055. c.urlParams_.Set("prettyPrint", "false")
  15056. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/documents")
  15057. urls += "?" + c.urlParams_.Encode()
  15058. req, err := http.NewRequest("POST", urls, body)
  15059. if err != nil {
  15060. return nil, err
  15061. }
  15062. req.Header = reqHeaders
  15063. googleapi.Expand(req.URL, map[string]string{
  15064. "parent": c.parent,
  15065. })
  15066. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15067. }
  15068. // Do executes the "dialogflow.projects.knowledgeBases.documents.create" call.
  15069. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  15070. // Any non-2xx status code is an error. Response headers are in either
  15071. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  15072. // was returned at all) in error.(*googleapi.Error).Header. Use
  15073. // googleapi.IsNotModified to check whether the returned error was
  15074. // because http.StatusNotModified was returned.
  15075. func (c *ProjectsKnowledgeBasesDocumentsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  15076. gensupport.SetOptions(c.urlParams_, opts...)
  15077. res, err := c.doRequest("json")
  15078. if res != nil && res.StatusCode == http.StatusNotModified {
  15079. if res.Body != nil {
  15080. res.Body.Close()
  15081. }
  15082. return nil, &googleapi.Error{
  15083. Code: res.StatusCode,
  15084. Header: res.Header,
  15085. }
  15086. }
  15087. if err != nil {
  15088. return nil, err
  15089. }
  15090. defer googleapi.CloseBody(res)
  15091. if err := googleapi.CheckResponse(res); err != nil {
  15092. return nil, err
  15093. }
  15094. ret := &GoogleLongrunningOperation{
  15095. ServerResponse: googleapi.ServerResponse{
  15096. Header: res.Header,
  15097. HTTPStatusCode: res.StatusCode,
  15098. },
  15099. }
  15100. target := &ret
  15101. if err := gensupport.DecodeResponse(target, res); err != nil {
  15102. return nil, err
  15103. }
  15104. return ret, nil
  15105. // {
  15106. // "description": "Creates a new document.\n\nOperation \u003cresponse: Document,\n metadata: KnowledgeOperationMetadata\u003e",
  15107. // "flatPath": "v2beta1/projects/{projectsId}/knowledgeBases/{knowledgeBasesId}/documents",
  15108. // "httpMethod": "POST",
  15109. // "id": "dialogflow.projects.knowledgeBases.documents.create",
  15110. // "parameterOrder": [
  15111. // "parent"
  15112. // ],
  15113. // "parameters": {
  15114. // "parent": {
  15115. // "description": "Required. The knoweldge base to create a document for.\nFormat: `projects/\u003cProject ID\u003e/knowledgeBases/\u003cKnowledge Base ID\u003e`.",
  15116. // "location": "path",
  15117. // "pattern": "^projects/[^/]+/knowledgeBases/[^/]+$",
  15118. // "required": true,
  15119. // "type": "string"
  15120. // }
  15121. // },
  15122. // "path": "v2beta1/{+parent}/documents",
  15123. // "request": {
  15124. // "$ref": "GoogleCloudDialogflowV2beta1Document"
  15125. // },
  15126. // "response": {
  15127. // "$ref": "GoogleLongrunningOperation"
  15128. // },
  15129. // "scopes": [
  15130. // "https://www.googleapis.com/auth/cloud-platform",
  15131. // "https://www.googleapis.com/auth/dialogflow"
  15132. // ]
  15133. // }
  15134. }
  15135. // method id "dialogflow.projects.knowledgeBases.documents.delete":
  15136. type ProjectsKnowledgeBasesDocumentsDeleteCall struct {
  15137. s *Service
  15138. name string
  15139. urlParams_ gensupport.URLParams
  15140. ctx_ context.Context
  15141. header_ http.Header
  15142. }
  15143. // Delete: Deletes the specified document.
  15144. //
  15145. // Operation <response: google.protobuf.Empty,
  15146. // metadata: KnowledgeOperationMetadata>
  15147. func (r *ProjectsKnowledgeBasesDocumentsService) Delete(name string) *ProjectsKnowledgeBasesDocumentsDeleteCall {
  15148. c := &ProjectsKnowledgeBasesDocumentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15149. c.name = name
  15150. return c
  15151. }
  15152. // Fields allows partial responses to be retrieved. See
  15153. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15154. // for more information.
  15155. func (c *ProjectsKnowledgeBasesDocumentsDeleteCall) Fields(s ...googleapi.Field) *ProjectsKnowledgeBasesDocumentsDeleteCall {
  15156. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15157. return c
  15158. }
  15159. // Context sets the context to be used in this call's Do method. Any
  15160. // pending HTTP request will be aborted if the provided context is
  15161. // canceled.
  15162. func (c *ProjectsKnowledgeBasesDocumentsDeleteCall) Context(ctx context.Context) *ProjectsKnowledgeBasesDocumentsDeleteCall {
  15163. c.ctx_ = ctx
  15164. return c
  15165. }
  15166. // Header returns an http.Header that can be modified by the caller to
  15167. // add HTTP headers to the request.
  15168. func (c *ProjectsKnowledgeBasesDocumentsDeleteCall) Header() http.Header {
  15169. if c.header_ == nil {
  15170. c.header_ = make(http.Header)
  15171. }
  15172. return c.header_
  15173. }
  15174. func (c *ProjectsKnowledgeBasesDocumentsDeleteCall) doRequest(alt string) (*http.Response, error) {
  15175. reqHeaders := make(http.Header)
  15176. for k, v := range c.header_ {
  15177. reqHeaders[k] = v
  15178. }
  15179. reqHeaders.Set("User-Agent", c.s.userAgent())
  15180. var body io.Reader = nil
  15181. c.urlParams_.Set("alt", alt)
  15182. c.urlParams_.Set("prettyPrint", "false")
  15183. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  15184. urls += "?" + c.urlParams_.Encode()
  15185. req, err := http.NewRequest("DELETE", urls, body)
  15186. if err != nil {
  15187. return nil, err
  15188. }
  15189. req.Header = reqHeaders
  15190. googleapi.Expand(req.URL, map[string]string{
  15191. "name": c.name,
  15192. })
  15193. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15194. }
  15195. // Do executes the "dialogflow.projects.knowledgeBases.documents.delete" call.
  15196. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  15197. // Any non-2xx status code is an error. Response headers are in either
  15198. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  15199. // was returned at all) in error.(*googleapi.Error).Header. Use
  15200. // googleapi.IsNotModified to check whether the returned error was
  15201. // because http.StatusNotModified was returned.
  15202. func (c *ProjectsKnowledgeBasesDocumentsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  15203. gensupport.SetOptions(c.urlParams_, opts...)
  15204. res, err := c.doRequest("json")
  15205. if res != nil && res.StatusCode == http.StatusNotModified {
  15206. if res.Body != nil {
  15207. res.Body.Close()
  15208. }
  15209. return nil, &googleapi.Error{
  15210. Code: res.StatusCode,
  15211. Header: res.Header,
  15212. }
  15213. }
  15214. if err != nil {
  15215. return nil, err
  15216. }
  15217. defer googleapi.CloseBody(res)
  15218. if err := googleapi.CheckResponse(res); err != nil {
  15219. return nil, err
  15220. }
  15221. ret := &GoogleLongrunningOperation{
  15222. ServerResponse: googleapi.ServerResponse{
  15223. Header: res.Header,
  15224. HTTPStatusCode: res.StatusCode,
  15225. },
  15226. }
  15227. target := &ret
  15228. if err := gensupport.DecodeResponse(target, res); err != nil {
  15229. return nil, err
  15230. }
  15231. return ret, nil
  15232. // {
  15233. // "description": "Deletes the specified document.\n\nOperation \u003cresponse: google.protobuf.Empty,\n metadata: KnowledgeOperationMetadata\u003e",
  15234. // "flatPath": "v2beta1/projects/{projectsId}/knowledgeBases/{knowledgeBasesId}/documents/{documentsId}",
  15235. // "httpMethod": "DELETE",
  15236. // "id": "dialogflow.projects.knowledgeBases.documents.delete",
  15237. // "parameterOrder": [
  15238. // "name"
  15239. // ],
  15240. // "parameters": {
  15241. // "name": {
  15242. // "description": "The name of the document to delete.\nFormat: `projects/\u003cProject ID\u003e/knowledgeBases/\u003cKnowledge Base\nID\u003e/documents/\u003cDocument ID\u003e`.",
  15243. // "location": "path",
  15244. // "pattern": "^projects/[^/]+/knowledgeBases/[^/]+/documents/[^/]+$",
  15245. // "required": true,
  15246. // "type": "string"
  15247. // }
  15248. // },
  15249. // "path": "v2beta1/{+name}",
  15250. // "response": {
  15251. // "$ref": "GoogleLongrunningOperation"
  15252. // },
  15253. // "scopes": [
  15254. // "https://www.googleapis.com/auth/cloud-platform",
  15255. // "https://www.googleapis.com/auth/dialogflow"
  15256. // ]
  15257. // }
  15258. }
  15259. // method id "dialogflow.projects.knowledgeBases.documents.get":
  15260. type ProjectsKnowledgeBasesDocumentsGetCall struct {
  15261. s *Service
  15262. name string
  15263. urlParams_ gensupport.URLParams
  15264. ifNoneMatch_ string
  15265. ctx_ context.Context
  15266. header_ http.Header
  15267. }
  15268. // Get: Retrieves the specified document.
  15269. func (r *ProjectsKnowledgeBasesDocumentsService) Get(name string) *ProjectsKnowledgeBasesDocumentsGetCall {
  15270. c := &ProjectsKnowledgeBasesDocumentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15271. c.name = name
  15272. return c
  15273. }
  15274. // Fields allows partial responses to be retrieved. See
  15275. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15276. // for more information.
  15277. func (c *ProjectsKnowledgeBasesDocumentsGetCall) Fields(s ...googleapi.Field) *ProjectsKnowledgeBasesDocumentsGetCall {
  15278. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15279. return c
  15280. }
  15281. // IfNoneMatch sets the optional parameter which makes the operation
  15282. // fail if the object's ETag matches the given value. This is useful for
  15283. // getting updates only after the object has changed since the last
  15284. // request. Use googleapi.IsNotModified to check whether the response
  15285. // error from Do is the result of In-None-Match.
  15286. func (c *ProjectsKnowledgeBasesDocumentsGetCall) IfNoneMatch(entityTag string) *ProjectsKnowledgeBasesDocumentsGetCall {
  15287. c.ifNoneMatch_ = entityTag
  15288. return c
  15289. }
  15290. // Context sets the context to be used in this call's Do method. Any
  15291. // pending HTTP request will be aborted if the provided context is
  15292. // canceled.
  15293. func (c *ProjectsKnowledgeBasesDocumentsGetCall) Context(ctx context.Context) *ProjectsKnowledgeBasesDocumentsGetCall {
  15294. c.ctx_ = ctx
  15295. return c
  15296. }
  15297. // Header returns an http.Header that can be modified by the caller to
  15298. // add HTTP headers to the request.
  15299. func (c *ProjectsKnowledgeBasesDocumentsGetCall) Header() http.Header {
  15300. if c.header_ == nil {
  15301. c.header_ = make(http.Header)
  15302. }
  15303. return c.header_
  15304. }
  15305. func (c *ProjectsKnowledgeBasesDocumentsGetCall) doRequest(alt string) (*http.Response, error) {
  15306. reqHeaders := make(http.Header)
  15307. for k, v := range c.header_ {
  15308. reqHeaders[k] = v
  15309. }
  15310. reqHeaders.Set("User-Agent", c.s.userAgent())
  15311. if c.ifNoneMatch_ != "" {
  15312. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  15313. }
  15314. var body io.Reader = nil
  15315. c.urlParams_.Set("alt", alt)
  15316. c.urlParams_.Set("prettyPrint", "false")
  15317. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  15318. urls += "?" + c.urlParams_.Encode()
  15319. req, err := http.NewRequest("GET", urls, body)
  15320. if err != nil {
  15321. return nil, err
  15322. }
  15323. req.Header = reqHeaders
  15324. googleapi.Expand(req.URL, map[string]string{
  15325. "name": c.name,
  15326. })
  15327. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15328. }
  15329. // Do executes the "dialogflow.projects.knowledgeBases.documents.get" call.
  15330. // Exactly one of *GoogleCloudDialogflowV2beta1Document or error will be
  15331. // non-nil. Any non-2xx status code is an error. Response headers are in
  15332. // either *GoogleCloudDialogflowV2beta1Document.ServerResponse.Header or
  15333. // (if a response was returned at all) in
  15334. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  15335. // whether the returned error was because http.StatusNotModified was
  15336. // returned.
  15337. func (c *ProjectsKnowledgeBasesDocumentsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1Document, error) {
  15338. gensupport.SetOptions(c.urlParams_, opts...)
  15339. res, err := c.doRequest("json")
  15340. if res != nil && res.StatusCode == http.StatusNotModified {
  15341. if res.Body != nil {
  15342. res.Body.Close()
  15343. }
  15344. return nil, &googleapi.Error{
  15345. Code: res.StatusCode,
  15346. Header: res.Header,
  15347. }
  15348. }
  15349. if err != nil {
  15350. return nil, err
  15351. }
  15352. defer googleapi.CloseBody(res)
  15353. if err := googleapi.CheckResponse(res); err != nil {
  15354. return nil, err
  15355. }
  15356. ret := &GoogleCloudDialogflowV2beta1Document{
  15357. ServerResponse: googleapi.ServerResponse{
  15358. Header: res.Header,
  15359. HTTPStatusCode: res.StatusCode,
  15360. },
  15361. }
  15362. target := &ret
  15363. if err := gensupport.DecodeResponse(target, res); err != nil {
  15364. return nil, err
  15365. }
  15366. return ret, nil
  15367. // {
  15368. // "description": "Retrieves the specified document.",
  15369. // "flatPath": "v2beta1/projects/{projectsId}/knowledgeBases/{knowledgeBasesId}/documents/{documentsId}",
  15370. // "httpMethod": "GET",
  15371. // "id": "dialogflow.projects.knowledgeBases.documents.get",
  15372. // "parameterOrder": [
  15373. // "name"
  15374. // ],
  15375. // "parameters": {
  15376. // "name": {
  15377. // "description": "Required. The name of the document to retrieve.\nFormat `projects/\u003cProject ID\u003e/knowledgeBases/\u003cKnowledge Base\nID\u003e/documents/\u003cDocument ID\u003e`.",
  15378. // "location": "path",
  15379. // "pattern": "^projects/[^/]+/knowledgeBases/[^/]+/documents/[^/]+$",
  15380. // "required": true,
  15381. // "type": "string"
  15382. // }
  15383. // },
  15384. // "path": "v2beta1/{+name}",
  15385. // "response": {
  15386. // "$ref": "GoogleCloudDialogflowV2beta1Document"
  15387. // },
  15388. // "scopes": [
  15389. // "https://www.googleapis.com/auth/cloud-platform",
  15390. // "https://www.googleapis.com/auth/dialogflow"
  15391. // ]
  15392. // }
  15393. }
  15394. // method id "dialogflow.projects.knowledgeBases.documents.list":
  15395. type ProjectsKnowledgeBasesDocumentsListCall struct {
  15396. s *Service
  15397. parent string
  15398. urlParams_ gensupport.URLParams
  15399. ifNoneMatch_ string
  15400. ctx_ context.Context
  15401. header_ http.Header
  15402. }
  15403. // List: Returns the list of all documents of the knowledge base.
  15404. func (r *ProjectsKnowledgeBasesDocumentsService) List(parent string) *ProjectsKnowledgeBasesDocumentsListCall {
  15405. c := &ProjectsKnowledgeBasesDocumentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15406. c.parent = parent
  15407. return c
  15408. }
  15409. // PageSize sets the optional parameter "pageSize": The maximum number
  15410. // of items to return in a single page. By
  15411. // default 10 and at most 100.
  15412. func (c *ProjectsKnowledgeBasesDocumentsListCall) PageSize(pageSize int64) *ProjectsKnowledgeBasesDocumentsListCall {
  15413. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  15414. return c
  15415. }
  15416. // PageToken sets the optional parameter "pageToken": The
  15417. // next_page_token value returned from a previous list request.
  15418. func (c *ProjectsKnowledgeBasesDocumentsListCall) PageToken(pageToken string) *ProjectsKnowledgeBasesDocumentsListCall {
  15419. c.urlParams_.Set("pageToken", pageToken)
  15420. return c
  15421. }
  15422. // Fields allows partial responses to be retrieved. See
  15423. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15424. // for more information.
  15425. func (c *ProjectsKnowledgeBasesDocumentsListCall) Fields(s ...googleapi.Field) *ProjectsKnowledgeBasesDocumentsListCall {
  15426. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15427. return c
  15428. }
  15429. // IfNoneMatch sets the optional parameter which makes the operation
  15430. // fail if the object's ETag matches the given value. This is useful for
  15431. // getting updates only after the object has changed since the last
  15432. // request. Use googleapi.IsNotModified to check whether the response
  15433. // error from Do is the result of In-None-Match.
  15434. func (c *ProjectsKnowledgeBasesDocumentsListCall) IfNoneMatch(entityTag string) *ProjectsKnowledgeBasesDocumentsListCall {
  15435. c.ifNoneMatch_ = entityTag
  15436. return c
  15437. }
  15438. // Context sets the context to be used in this call's Do method. Any
  15439. // pending HTTP request will be aborted if the provided context is
  15440. // canceled.
  15441. func (c *ProjectsKnowledgeBasesDocumentsListCall) Context(ctx context.Context) *ProjectsKnowledgeBasesDocumentsListCall {
  15442. c.ctx_ = ctx
  15443. return c
  15444. }
  15445. // Header returns an http.Header that can be modified by the caller to
  15446. // add HTTP headers to the request.
  15447. func (c *ProjectsKnowledgeBasesDocumentsListCall) Header() http.Header {
  15448. if c.header_ == nil {
  15449. c.header_ = make(http.Header)
  15450. }
  15451. return c.header_
  15452. }
  15453. func (c *ProjectsKnowledgeBasesDocumentsListCall) doRequest(alt string) (*http.Response, error) {
  15454. reqHeaders := make(http.Header)
  15455. for k, v := range c.header_ {
  15456. reqHeaders[k] = v
  15457. }
  15458. reqHeaders.Set("User-Agent", c.s.userAgent())
  15459. if c.ifNoneMatch_ != "" {
  15460. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  15461. }
  15462. var body io.Reader = nil
  15463. c.urlParams_.Set("alt", alt)
  15464. c.urlParams_.Set("prettyPrint", "false")
  15465. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/documents")
  15466. urls += "?" + c.urlParams_.Encode()
  15467. req, err := http.NewRequest("GET", urls, body)
  15468. if err != nil {
  15469. return nil, err
  15470. }
  15471. req.Header = reqHeaders
  15472. googleapi.Expand(req.URL, map[string]string{
  15473. "parent": c.parent,
  15474. })
  15475. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15476. }
  15477. // Do executes the "dialogflow.projects.knowledgeBases.documents.list" call.
  15478. // Exactly one of *GoogleCloudDialogflowV2beta1ListDocumentsResponse or
  15479. // error will be non-nil. Any non-2xx status code is an error. Response
  15480. // headers are in either
  15481. // *GoogleCloudDialogflowV2beta1ListDocumentsResponse.ServerResponse.Head
  15482. // er or (if a response was returned at all) in
  15483. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  15484. // whether the returned error was because http.StatusNotModified was
  15485. // returned.
  15486. func (c *ProjectsKnowledgeBasesDocumentsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1ListDocumentsResponse, error) {
  15487. gensupport.SetOptions(c.urlParams_, opts...)
  15488. res, err := c.doRequest("json")
  15489. if res != nil && res.StatusCode == http.StatusNotModified {
  15490. if res.Body != nil {
  15491. res.Body.Close()
  15492. }
  15493. return nil, &googleapi.Error{
  15494. Code: res.StatusCode,
  15495. Header: res.Header,
  15496. }
  15497. }
  15498. if err != nil {
  15499. return nil, err
  15500. }
  15501. defer googleapi.CloseBody(res)
  15502. if err := googleapi.CheckResponse(res); err != nil {
  15503. return nil, err
  15504. }
  15505. ret := &GoogleCloudDialogflowV2beta1ListDocumentsResponse{
  15506. ServerResponse: googleapi.ServerResponse{
  15507. Header: res.Header,
  15508. HTTPStatusCode: res.StatusCode,
  15509. },
  15510. }
  15511. target := &ret
  15512. if err := gensupport.DecodeResponse(target, res); err != nil {
  15513. return nil, err
  15514. }
  15515. return ret, nil
  15516. // {
  15517. // "description": "Returns the list of all documents of the knowledge base.",
  15518. // "flatPath": "v2beta1/projects/{projectsId}/knowledgeBases/{knowledgeBasesId}/documents",
  15519. // "httpMethod": "GET",
  15520. // "id": "dialogflow.projects.knowledgeBases.documents.list",
  15521. // "parameterOrder": [
  15522. // "parent"
  15523. // ],
  15524. // "parameters": {
  15525. // "pageSize": {
  15526. // "description": "Optional. The maximum number of items to return in a single page. By\ndefault 10 and at most 100.",
  15527. // "format": "int32",
  15528. // "location": "query",
  15529. // "type": "integer"
  15530. // },
  15531. // "pageToken": {
  15532. // "description": "Optional. The next_page_token value returned from a previous list request.",
  15533. // "location": "query",
  15534. // "type": "string"
  15535. // },
  15536. // "parent": {
  15537. // "description": "Required. The knowledge base to list all documents for.\nFormat: `projects/\u003cProject ID\u003e/knowledgeBases/\u003cKnowledge Base ID\u003e`.",
  15538. // "location": "path",
  15539. // "pattern": "^projects/[^/]+/knowledgeBases/[^/]+$",
  15540. // "required": true,
  15541. // "type": "string"
  15542. // }
  15543. // },
  15544. // "path": "v2beta1/{+parent}/documents",
  15545. // "response": {
  15546. // "$ref": "GoogleCloudDialogflowV2beta1ListDocumentsResponse"
  15547. // },
  15548. // "scopes": [
  15549. // "https://www.googleapis.com/auth/cloud-platform",
  15550. // "https://www.googleapis.com/auth/dialogflow"
  15551. // ]
  15552. // }
  15553. }
  15554. // Pages invokes f for each page of results.
  15555. // A non-nil error returned from f will halt the iteration.
  15556. // The provided context supersedes any context provided to the Context method.
  15557. func (c *ProjectsKnowledgeBasesDocumentsListCall) Pages(ctx context.Context, f func(*GoogleCloudDialogflowV2beta1ListDocumentsResponse) error) error {
  15558. c.ctx_ = ctx
  15559. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  15560. for {
  15561. x, err := c.Do()
  15562. if err != nil {
  15563. return err
  15564. }
  15565. if err := f(x); err != nil {
  15566. return err
  15567. }
  15568. if x.NextPageToken == "" {
  15569. return nil
  15570. }
  15571. c.PageToken(x.NextPageToken)
  15572. }
  15573. }
  15574. // method id "dialogflow.projects.knowledgeBases.documents.patch":
  15575. type ProjectsKnowledgeBasesDocumentsPatchCall struct {
  15576. s *Service
  15577. name string
  15578. googleclouddialogflowv2beta1document *GoogleCloudDialogflowV2beta1Document
  15579. urlParams_ gensupport.URLParams
  15580. ctx_ context.Context
  15581. header_ http.Header
  15582. }
  15583. // Patch: Updates the specified document.
  15584. // Operation <response: Document,
  15585. // metadata: KnowledgeOperationMetadata>
  15586. func (r *ProjectsKnowledgeBasesDocumentsService) Patch(name string, googleclouddialogflowv2beta1document *GoogleCloudDialogflowV2beta1Document) *ProjectsKnowledgeBasesDocumentsPatchCall {
  15587. c := &ProjectsKnowledgeBasesDocumentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15588. c.name = name
  15589. c.googleclouddialogflowv2beta1document = googleclouddialogflowv2beta1document
  15590. return c
  15591. }
  15592. // UpdateMask sets the optional parameter "updateMask": Not specified
  15593. // means `update all`.
  15594. // Currently, only `display_name` can be updated, an InvalidArgument
  15595. // will be
  15596. // returned for attempting to update other fields.
  15597. func (c *ProjectsKnowledgeBasesDocumentsPatchCall) UpdateMask(updateMask string) *ProjectsKnowledgeBasesDocumentsPatchCall {
  15598. c.urlParams_.Set("updateMask", updateMask)
  15599. return c
  15600. }
  15601. // Fields allows partial responses to be retrieved. See
  15602. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15603. // for more information.
  15604. func (c *ProjectsKnowledgeBasesDocumentsPatchCall) Fields(s ...googleapi.Field) *ProjectsKnowledgeBasesDocumentsPatchCall {
  15605. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15606. return c
  15607. }
  15608. // Context sets the context to be used in this call's Do method. Any
  15609. // pending HTTP request will be aborted if the provided context is
  15610. // canceled.
  15611. func (c *ProjectsKnowledgeBasesDocumentsPatchCall) Context(ctx context.Context) *ProjectsKnowledgeBasesDocumentsPatchCall {
  15612. c.ctx_ = ctx
  15613. return c
  15614. }
  15615. // Header returns an http.Header that can be modified by the caller to
  15616. // add HTTP headers to the request.
  15617. func (c *ProjectsKnowledgeBasesDocumentsPatchCall) Header() http.Header {
  15618. if c.header_ == nil {
  15619. c.header_ = make(http.Header)
  15620. }
  15621. return c.header_
  15622. }
  15623. func (c *ProjectsKnowledgeBasesDocumentsPatchCall) doRequest(alt string) (*http.Response, error) {
  15624. reqHeaders := make(http.Header)
  15625. for k, v := range c.header_ {
  15626. reqHeaders[k] = v
  15627. }
  15628. reqHeaders.Set("User-Agent", c.s.userAgent())
  15629. var body io.Reader = nil
  15630. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1document)
  15631. if err != nil {
  15632. return nil, err
  15633. }
  15634. reqHeaders.Set("Content-Type", "application/json")
  15635. c.urlParams_.Set("alt", alt)
  15636. c.urlParams_.Set("prettyPrint", "false")
  15637. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  15638. urls += "?" + c.urlParams_.Encode()
  15639. req, err := http.NewRequest("PATCH", urls, body)
  15640. if err != nil {
  15641. return nil, err
  15642. }
  15643. req.Header = reqHeaders
  15644. googleapi.Expand(req.URL, map[string]string{
  15645. "name": c.name,
  15646. })
  15647. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15648. }
  15649. // Do executes the "dialogflow.projects.knowledgeBases.documents.patch" call.
  15650. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  15651. // Any non-2xx status code is an error. Response headers are in either
  15652. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  15653. // was returned at all) in error.(*googleapi.Error).Header. Use
  15654. // googleapi.IsNotModified to check whether the returned error was
  15655. // because http.StatusNotModified was returned.
  15656. func (c *ProjectsKnowledgeBasesDocumentsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  15657. gensupport.SetOptions(c.urlParams_, opts...)
  15658. res, err := c.doRequest("json")
  15659. if res != nil && res.StatusCode == http.StatusNotModified {
  15660. if res.Body != nil {
  15661. res.Body.Close()
  15662. }
  15663. return nil, &googleapi.Error{
  15664. Code: res.StatusCode,
  15665. Header: res.Header,
  15666. }
  15667. }
  15668. if err != nil {
  15669. return nil, err
  15670. }
  15671. defer googleapi.CloseBody(res)
  15672. if err := googleapi.CheckResponse(res); err != nil {
  15673. return nil, err
  15674. }
  15675. ret := &GoogleLongrunningOperation{
  15676. ServerResponse: googleapi.ServerResponse{
  15677. Header: res.Header,
  15678. HTTPStatusCode: res.StatusCode,
  15679. },
  15680. }
  15681. target := &ret
  15682. if err := gensupport.DecodeResponse(target, res); err != nil {
  15683. return nil, err
  15684. }
  15685. return ret, nil
  15686. // {
  15687. // "description": "Updates the specified document.\nOperation \u003cresponse: Document,\n metadata: KnowledgeOperationMetadata\u003e",
  15688. // "flatPath": "v2beta1/projects/{projectsId}/knowledgeBases/{knowledgeBasesId}/documents/{documentsId}",
  15689. // "httpMethod": "PATCH",
  15690. // "id": "dialogflow.projects.knowledgeBases.documents.patch",
  15691. // "parameterOrder": [
  15692. // "name"
  15693. // ],
  15694. // "parameters": {
  15695. // "name": {
  15696. // "description": "The document resource name.\nThe name must be empty when creating a document.\nFormat: `projects/\u003cProject ID\u003e/knowledgeBases/\u003cKnowledge Base\nID\u003e/documents/\u003cDocument ID\u003e`.",
  15697. // "location": "path",
  15698. // "pattern": "^projects/[^/]+/knowledgeBases/[^/]+/documents/[^/]+$",
  15699. // "required": true,
  15700. // "type": "string"
  15701. // },
  15702. // "updateMask": {
  15703. // "description": "Optional. Not specified means `update all`.\nCurrently, only `display_name` can be updated, an InvalidArgument will be\nreturned for attempting to update other fields.",
  15704. // "format": "google-fieldmask",
  15705. // "location": "query",
  15706. // "type": "string"
  15707. // }
  15708. // },
  15709. // "path": "v2beta1/{+name}",
  15710. // "request": {
  15711. // "$ref": "GoogleCloudDialogflowV2beta1Document"
  15712. // },
  15713. // "response": {
  15714. // "$ref": "GoogleLongrunningOperation"
  15715. // },
  15716. // "scopes": [
  15717. // "https://www.googleapis.com/auth/cloud-platform",
  15718. // "https://www.googleapis.com/auth/dialogflow"
  15719. // ]
  15720. // }
  15721. }
  15722. // method id "dialogflow.projects.knowledgeBases.documents.reload":
  15723. type ProjectsKnowledgeBasesDocumentsReloadCall struct {
  15724. s *Service
  15725. name string
  15726. googleclouddialogflowv2beta1reloaddocumentrequest *GoogleCloudDialogflowV2beta1ReloadDocumentRequest
  15727. urlParams_ gensupport.URLParams
  15728. ctx_ context.Context
  15729. header_ http.Header
  15730. }
  15731. // Reload: Reloads the specified document from its specified source,
  15732. // content_uri or
  15733. // content. The previously loaded content of the document will be
  15734. // deleted.
  15735. // Note: Even when the content of the document has not changed, there
  15736. // still
  15737. // may be side effects because of internal implementation
  15738. // changes.
  15739. // Operation <response: Document,
  15740. // metadata: KnowledgeOperationMetadata>
  15741. func (r *ProjectsKnowledgeBasesDocumentsService) Reload(name string, googleclouddialogflowv2beta1reloaddocumentrequest *GoogleCloudDialogflowV2beta1ReloadDocumentRequest) *ProjectsKnowledgeBasesDocumentsReloadCall {
  15742. c := &ProjectsKnowledgeBasesDocumentsReloadCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15743. c.name = name
  15744. c.googleclouddialogflowv2beta1reloaddocumentrequest = googleclouddialogflowv2beta1reloaddocumentrequest
  15745. return c
  15746. }
  15747. // Fields allows partial responses to be retrieved. See
  15748. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15749. // for more information.
  15750. func (c *ProjectsKnowledgeBasesDocumentsReloadCall) Fields(s ...googleapi.Field) *ProjectsKnowledgeBasesDocumentsReloadCall {
  15751. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15752. return c
  15753. }
  15754. // Context sets the context to be used in this call's Do method. Any
  15755. // pending HTTP request will be aborted if the provided context is
  15756. // canceled.
  15757. func (c *ProjectsKnowledgeBasesDocumentsReloadCall) Context(ctx context.Context) *ProjectsKnowledgeBasesDocumentsReloadCall {
  15758. c.ctx_ = ctx
  15759. return c
  15760. }
  15761. // Header returns an http.Header that can be modified by the caller to
  15762. // add HTTP headers to the request.
  15763. func (c *ProjectsKnowledgeBasesDocumentsReloadCall) Header() http.Header {
  15764. if c.header_ == nil {
  15765. c.header_ = make(http.Header)
  15766. }
  15767. return c.header_
  15768. }
  15769. func (c *ProjectsKnowledgeBasesDocumentsReloadCall) doRequest(alt string) (*http.Response, error) {
  15770. reqHeaders := make(http.Header)
  15771. for k, v := range c.header_ {
  15772. reqHeaders[k] = v
  15773. }
  15774. reqHeaders.Set("User-Agent", c.s.userAgent())
  15775. var body io.Reader = nil
  15776. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1reloaddocumentrequest)
  15777. if err != nil {
  15778. return nil, err
  15779. }
  15780. reqHeaders.Set("Content-Type", "application/json")
  15781. c.urlParams_.Set("alt", alt)
  15782. c.urlParams_.Set("prettyPrint", "false")
  15783. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}:reload")
  15784. urls += "?" + c.urlParams_.Encode()
  15785. req, err := http.NewRequest("POST", urls, body)
  15786. if err != nil {
  15787. return nil, err
  15788. }
  15789. req.Header = reqHeaders
  15790. googleapi.Expand(req.URL, map[string]string{
  15791. "name": c.name,
  15792. })
  15793. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15794. }
  15795. // Do executes the "dialogflow.projects.knowledgeBases.documents.reload" call.
  15796. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  15797. // Any non-2xx status code is an error. Response headers are in either
  15798. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  15799. // was returned at all) in error.(*googleapi.Error).Header. Use
  15800. // googleapi.IsNotModified to check whether the returned error was
  15801. // because http.StatusNotModified was returned.
  15802. func (c *ProjectsKnowledgeBasesDocumentsReloadCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  15803. gensupport.SetOptions(c.urlParams_, opts...)
  15804. res, err := c.doRequest("json")
  15805. if res != nil && res.StatusCode == http.StatusNotModified {
  15806. if res.Body != nil {
  15807. res.Body.Close()
  15808. }
  15809. return nil, &googleapi.Error{
  15810. Code: res.StatusCode,
  15811. Header: res.Header,
  15812. }
  15813. }
  15814. if err != nil {
  15815. return nil, err
  15816. }
  15817. defer googleapi.CloseBody(res)
  15818. if err := googleapi.CheckResponse(res); err != nil {
  15819. return nil, err
  15820. }
  15821. ret := &GoogleLongrunningOperation{
  15822. ServerResponse: googleapi.ServerResponse{
  15823. Header: res.Header,
  15824. HTTPStatusCode: res.StatusCode,
  15825. },
  15826. }
  15827. target := &ret
  15828. if err := gensupport.DecodeResponse(target, res); err != nil {
  15829. return nil, err
  15830. }
  15831. return ret, nil
  15832. // {
  15833. // "description": "Reloads the specified document from its specified source, content_uri or\ncontent. The previously loaded content of the document will be deleted.\nNote: Even when the content of the document has not changed, there still\nmay be side effects because of internal implementation changes.\nOperation \u003cresponse: Document,\n metadata: KnowledgeOperationMetadata\u003e",
  15834. // "flatPath": "v2beta1/projects/{projectsId}/knowledgeBases/{knowledgeBasesId}/documents/{documentsId}:reload",
  15835. // "httpMethod": "POST",
  15836. // "id": "dialogflow.projects.knowledgeBases.documents.reload",
  15837. // "parameterOrder": [
  15838. // "name"
  15839. // ],
  15840. // "parameters": {
  15841. // "name": {
  15842. // "description": "The name of the document to reload.\nFormat: `projects/\u003cProject ID\u003e/knowledgeBases/\u003cKnowledge Base\nID\u003e/documents/\u003cDocument ID\u003e`",
  15843. // "location": "path",
  15844. // "pattern": "^projects/[^/]+/knowledgeBases/[^/]+/documents/[^/]+$",
  15845. // "required": true,
  15846. // "type": "string"
  15847. // }
  15848. // },
  15849. // "path": "v2beta1/{+name}:reload",
  15850. // "request": {
  15851. // "$ref": "GoogleCloudDialogflowV2beta1ReloadDocumentRequest"
  15852. // },
  15853. // "response": {
  15854. // "$ref": "GoogleLongrunningOperation"
  15855. // },
  15856. // "scopes": [
  15857. // "https://www.googleapis.com/auth/cloud-platform",
  15858. // "https://www.googleapis.com/auth/dialogflow"
  15859. // ]
  15860. // }
  15861. }
  15862. // method id "dialogflow.projects.operations.get":
  15863. type ProjectsOperationsGetCall struct {
  15864. s *Service
  15865. name string
  15866. urlParams_ gensupport.URLParams
  15867. ifNoneMatch_ string
  15868. ctx_ context.Context
  15869. header_ http.Header
  15870. }
  15871. // Get: Gets the latest state of a long-running operation. Clients can
  15872. // use this
  15873. // method to poll the operation result at intervals as recommended by
  15874. // the API
  15875. // service.
  15876. func (r *ProjectsOperationsService) Get(name string) *ProjectsOperationsGetCall {
  15877. c := &ProjectsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15878. c.name = name
  15879. return c
  15880. }
  15881. // Fields allows partial responses to be retrieved. See
  15882. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15883. // for more information.
  15884. func (c *ProjectsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsOperationsGetCall {
  15885. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15886. return c
  15887. }
  15888. // IfNoneMatch sets the optional parameter which makes the operation
  15889. // fail if the object's ETag matches the given value. This is useful for
  15890. // getting updates only after the object has changed since the last
  15891. // request. Use googleapi.IsNotModified to check whether the response
  15892. // error from Do is the result of In-None-Match.
  15893. func (c *ProjectsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsOperationsGetCall {
  15894. c.ifNoneMatch_ = entityTag
  15895. return c
  15896. }
  15897. // Context sets the context to be used in this call's Do method. Any
  15898. // pending HTTP request will be aborted if the provided context is
  15899. // canceled.
  15900. func (c *ProjectsOperationsGetCall) Context(ctx context.Context) *ProjectsOperationsGetCall {
  15901. c.ctx_ = ctx
  15902. return c
  15903. }
  15904. // Header returns an http.Header that can be modified by the caller to
  15905. // add HTTP headers to the request.
  15906. func (c *ProjectsOperationsGetCall) Header() http.Header {
  15907. if c.header_ == nil {
  15908. c.header_ = make(http.Header)
  15909. }
  15910. return c.header_
  15911. }
  15912. func (c *ProjectsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  15913. reqHeaders := make(http.Header)
  15914. for k, v := range c.header_ {
  15915. reqHeaders[k] = v
  15916. }
  15917. reqHeaders.Set("User-Agent", c.s.userAgent())
  15918. if c.ifNoneMatch_ != "" {
  15919. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  15920. }
  15921. var body io.Reader = nil
  15922. c.urlParams_.Set("alt", alt)
  15923. c.urlParams_.Set("prettyPrint", "false")
  15924. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  15925. urls += "?" + c.urlParams_.Encode()
  15926. req, err := http.NewRequest("GET", urls, body)
  15927. if err != nil {
  15928. return nil, err
  15929. }
  15930. req.Header = reqHeaders
  15931. googleapi.Expand(req.URL, map[string]string{
  15932. "name": c.name,
  15933. })
  15934. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15935. }
  15936. // Do executes the "dialogflow.projects.operations.get" call.
  15937. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  15938. // Any non-2xx status code is an error. Response headers are in either
  15939. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  15940. // was returned at all) in error.(*googleapi.Error).Header. Use
  15941. // googleapi.IsNotModified to check whether the returned error was
  15942. // because http.StatusNotModified was returned.
  15943. func (c *ProjectsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  15944. gensupport.SetOptions(c.urlParams_, opts...)
  15945. res, err := c.doRequest("json")
  15946. if res != nil && res.StatusCode == http.StatusNotModified {
  15947. if res.Body != nil {
  15948. res.Body.Close()
  15949. }
  15950. return nil, &googleapi.Error{
  15951. Code: res.StatusCode,
  15952. Header: res.Header,
  15953. }
  15954. }
  15955. if err != nil {
  15956. return nil, err
  15957. }
  15958. defer googleapi.CloseBody(res)
  15959. if err := googleapi.CheckResponse(res); err != nil {
  15960. return nil, err
  15961. }
  15962. ret := &GoogleLongrunningOperation{
  15963. ServerResponse: googleapi.ServerResponse{
  15964. Header: res.Header,
  15965. HTTPStatusCode: res.StatusCode,
  15966. },
  15967. }
  15968. target := &ret
  15969. if err := gensupport.DecodeResponse(target, res); err != nil {
  15970. return nil, err
  15971. }
  15972. return ret, nil
  15973. // {
  15974. // "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.",
  15975. // "flatPath": "v2beta1/projects/{projectsId}/operations/{operationsId}",
  15976. // "httpMethod": "GET",
  15977. // "id": "dialogflow.projects.operations.get",
  15978. // "parameterOrder": [
  15979. // "name"
  15980. // ],
  15981. // "parameters": {
  15982. // "name": {
  15983. // "description": "The name of the operation resource.",
  15984. // "location": "path",
  15985. // "pattern": "^projects/[^/]+/operations/[^/]+$",
  15986. // "required": true,
  15987. // "type": "string"
  15988. // }
  15989. // },
  15990. // "path": "v2beta1/{+name}",
  15991. // "response": {
  15992. // "$ref": "GoogleLongrunningOperation"
  15993. // },
  15994. // "scopes": [
  15995. // "https://www.googleapis.com/auth/cloud-platform",
  15996. // "https://www.googleapis.com/auth/dialogflow"
  15997. // ]
  15998. // }
  15999. }