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.
 
 
 

10855 lines
413 KiB

  1. // Package dialogflow provides access to the Dialogflow API.
  2. //
  3. // See https://cloud.google.com/dialogflow-enterprise/
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/dialogflow/v2"
  8. // ...
  9. // dialogflowService, err := dialogflow.New(oauthHttpClient)
  10. package dialogflow // import "google.golang.org/api/dialogflow/v2"
  11. import (
  12. "bytes"
  13. "encoding/json"
  14. "errors"
  15. "fmt"
  16. context "golang.org/x/net/context"
  17. ctxhttp "golang.org/x/net/context/ctxhttp"
  18. gensupport "google.golang.org/api/gensupport"
  19. googleapi "google.golang.org/api/googleapi"
  20. "io"
  21. "net/http"
  22. "net/url"
  23. "strconv"
  24. "strings"
  25. )
  26. // Always reference these packages, just in case the auto-generated code
  27. // below doesn't.
  28. var _ = bytes.NewBuffer
  29. var _ = strconv.Itoa
  30. var _ = fmt.Sprintf
  31. var _ = json.NewDecoder
  32. var _ = io.Copy
  33. var _ = url.Parse
  34. var _ = gensupport.MarshalJSON
  35. var _ = googleapi.Version
  36. var _ = errors.New
  37. var _ = strings.Replace
  38. var _ = context.Canceled
  39. var _ = ctxhttp.Do
  40. const apiId = "dialogflow:v2"
  41. const apiName = "dialogflow"
  42. const apiVersion = "v2"
  43. const basePath = "https://dialogflow.googleapis.com/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // View and manage your data across Google Cloud Platform services
  47. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  48. )
  49. func New(client *http.Client) (*Service, error) {
  50. if client == nil {
  51. return nil, errors.New("client is nil")
  52. }
  53. s := &Service{client: client, BasePath: basePath}
  54. s.Projects = NewProjectsService(s)
  55. return s, nil
  56. }
  57. type Service struct {
  58. client *http.Client
  59. BasePath string // API endpoint base URL
  60. UserAgent string // optional additional User-Agent fragment
  61. Projects *ProjectsService
  62. }
  63. func (s *Service) userAgent() string {
  64. if s.UserAgent == "" {
  65. return googleapi.UserAgent
  66. }
  67. return googleapi.UserAgent + " " + s.UserAgent
  68. }
  69. func NewProjectsService(s *Service) *ProjectsService {
  70. rs := &ProjectsService{s: s}
  71. rs.Agent = NewProjectsAgentService(s)
  72. rs.Operations = NewProjectsOperationsService(s)
  73. return rs
  74. }
  75. type ProjectsService struct {
  76. s *Service
  77. Agent *ProjectsAgentService
  78. Operations *ProjectsOperationsService
  79. }
  80. func NewProjectsAgentService(s *Service) *ProjectsAgentService {
  81. rs := &ProjectsAgentService{s: s}
  82. rs.EntityTypes = NewProjectsAgentEntityTypesService(s)
  83. rs.Intents = NewProjectsAgentIntentsService(s)
  84. rs.Sessions = NewProjectsAgentSessionsService(s)
  85. return rs
  86. }
  87. type ProjectsAgentService struct {
  88. s *Service
  89. EntityTypes *ProjectsAgentEntityTypesService
  90. Intents *ProjectsAgentIntentsService
  91. Sessions *ProjectsAgentSessionsService
  92. }
  93. func NewProjectsAgentEntityTypesService(s *Service) *ProjectsAgentEntityTypesService {
  94. rs := &ProjectsAgentEntityTypesService{s: s}
  95. rs.Entities = NewProjectsAgentEntityTypesEntitiesService(s)
  96. return rs
  97. }
  98. type ProjectsAgentEntityTypesService struct {
  99. s *Service
  100. Entities *ProjectsAgentEntityTypesEntitiesService
  101. }
  102. func NewProjectsAgentEntityTypesEntitiesService(s *Service) *ProjectsAgentEntityTypesEntitiesService {
  103. rs := &ProjectsAgentEntityTypesEntitiesService{s: s}
  104. return rs
  105. }
  106. type ProjectsAgentEntityTypesEntitiesService struct {
  107. s *Service
  108. }
  109. func NewProjectsAgentIntentsService(s *Service) *ProjectsAgentIntentsService {
  110. rs := &ProjectsAgentIntentsService{s: s}
  111. return rs
  112. }
  113. type ProjectsAgentIntentsService struct {
  114. s *Service
  115. }
  116. func NewProjectsAgentSessionsService(s *Service) *ProjectsAgentSessionsService {
  117. rs := &ProjectsAgentSessionsService{s: s}
  118. rs.Contexts = NewProjectsAgentSessionsContextsService(s)
  119. rs.EntityTypes = NewProjectsAgentSessionsEntityTypesService(s)
  120. return rs
  121. }
  122. type ProjectsAgentSessionsService struct {
  123. s *Service
  124. Contexts *ProjectsAgentSessionsContextsService
  125. EntityTypes *ProjectsAgentSessionsEntityTypesService
  126. }
  127. func NewProjectsAgentSessionsContextsService(s *Service) *ProjectsAgentSessionsContextsService {
  128. rs := &ProjectsAgentSessionsContextsService{s: s}
  129. return rs
  130. }
  131. type ProjectsAgentSessionsContextsService struct {
  132. s *Service
  133. }
  134. func NewProjectsAgentSessionsEntityTypesService(s *Service) *ProjectsAgentSessionsEntityTypesService {
  135. rs := &ProjectsAgentSessionsEntityTypesService{s: s}
  136. return rs
  137. }
  138. type ProjectsAgentSessionsEntityTypesService struct {
  139. s *Service
  140. }
  141. func NewProjectsOperationsService(s *Service) *ProjectsOperationsService {
  142. rs := &ProjectsOperationsService{s: s}
  143. return rs
  144. }
  145. type ProjectsOperationsService struct {
  146. s *Service
  147. }
  148. // GoogleCloudDialogflowV2Agent: Represents a conversational agent.
  149. type GoogleCloudDialogflowV2Agent struct {
  150. // AvatarUri: Optional. The URI of the agent's avatar.
  151. // Avatars are used throughout the Dialogflow console and in the
  152. // self-hosted
  153. // [Web Demo](https://dialogflow.com/docs/integrations/web-demo)
  154. // integration.
  155. AvatarUri string `json:"avatarUri,omitempty"`
  156. // ClassificationThreshold: Optional. To filter out false positive
  157. // results and still get variety in
  158. // matched natural language inputs for your agent, you can tune the
  159. // machine
  160. // learning classification threshold. If the returned score value is
  161. // less than
  162. // the threshold value, then a fallback intent is be triggered or, if
  163. // there
  164. // are no fallback intents defined, no intent will be triggered. The
  165. // score
  166. // values range from 0.0 (completely uncertain) to 1.0 (completely
  167. // certain).
  168. // If set to 0.0, the default of 0.3 is used.
  169. ClassificationThreshold float64 `json:"classificationThreshold,omitempty"`
  170. // DefaultLanguageCode: Required. The default language of the agent as a
  171. // language tag. See
  172. // [Language Support](https://dialogflow.com/docs/reference/language)
  173. // for a
  174. // list of the currently supported language codes.
  175. // This field cannot be set by the `Update` method.
  176. DefaultLanguageCode string `json:"defaultLanguageCode,omitempty"`
  177. // Description: Optional. The description of this agent.
  178. // The maximum length is 500 characters. If exceeded, the request is
  179. // rejected.
  180. Description string `json:"description,omitempty"`
  181. // DisplayName: Required. The name of this agent.
  182. DisplayName string `json:"displayName,omitempty"`
  183. // EnableLogging: Optional. Determines whether this agent should log
  184. // conversation queries.
  185. EnableLogging bool `json:"enableLogging,omitempty"`
  186. // MatchMode: Optional. Determines how intents are detected from user
  187. // queries.
  188. //
  189. // Possible values:
  190. // "MATCH_MODE_UNSPECIFIED" - Not specified.
  191. // "MATCH_MODE_HYBRID" - Best for agents with a small number of
  192. // examples in intents and/or wide
  193. // use of templates syntax and composite entities.
  194. // "MATCH_MODE_ML_ONLY" - Can be used for agents with a large number
  195. // of examples in intents,
  196. // especially the ones using @sys.any or very large developer entities.
  197. MatchMode string `json:"matchMode,omitempty"`
  198. // Parent: Required. The project of this agent.
  199. // Format: `projects/<Project ID>`.
  200. Parent string `json:"parent,omitempty"`
  201. // SupportedLanguageCodes: Optional. The list of all languages supported
  202. // by this agent (except for the
  203. // `default_language_code`).
  204. SupportedLanguageCodes []string `json:"supportedLanguageCodes,omitempty"`
  205. // TimeZone: Required. The time zone of this agent from the
  206. // [time zone database](https://www.iana.org/time-zones),
  207. // e.g.,
  208. // America/New_York, Europe/Paris.
  209. TimeZone string `json:"timeZone,omitempty"`
  210. // ServerResponse contains the HTTP response code and headers from the
  211. // server.
  212. googleapi.ServerResponse `json:"-"`
  213. // ForceSendFields is a list of field names (e.g. "AvatarUri") to
  214. // unconditionally include in API requests. By default, fields with
  215. // empty values are omitted from API requests. However, any non-pointer,
  216. // non-interface field appearing in ForceSendFields will be sent to the
  217. // server regardless of whether the field is empty or not. This may be
  218. // used to include empty fields in Patch requests.
  219. ForceSendFields []string `json:"-"`
  220. // NullFields is a list of field names (e.g. "AvatarUri") to include in
  221. // API requests with the JSON null value. By default, fields with empty
  222. // values are omitted from API requests. However, any field with an
  223. // empty value appearing in NullFields will be sent to the server as
  224. // null. It is an error if a field in this list has a non-empty value.
  225. // This may be used to include null fields in Patch requests.
  226. NullFields []string `json:"-"`
  227. }
  228. func (s *GoogleCloudDialogflowV2Agent) MarshalJSON() ([]byte, error) {
  229. type NoMethod GoogleCloudDialogflowV2Agent
  230. raw := NoMethod(*s)
  231. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  232. }
  233. func (s *GoogleCloudDialogflowV2Agent) UnmarshalJSON(data []byte) error {
  234. type NoMethod GoogleCloudDialogflowV2Agent
  235. var s1 struct {
  236. ClassificationThreshold gensupport.JSONFloat64 `json:"classificationThreshold"`
  237. *NoMethod
  238. }
  239. s1.NoMethod = (*NoMethod)(s)
  240. if err := json.Unmarshal(data, &s1); err != nil {
  241. return err
  242. }
  243. s.ClassificationThreshold = float64(s1.ClassificationThreshold)
  244. return nil
  245. }
  246. // GoogleCloudDialogflowV2BatchCreateEntitiesRequest: The request
  247. // message for EntityTypes.BatchCreateEntities.
  248. type GoogleCloudDialogflowV2BatchCreateEntitiesRequest struct {
  249. // Entities: Required. The collection of entities to create.
  250. Entities []*GoogleCloudDialogflowV2EntityTypeEntity `json:"entities,omitempty"`
  251. // LanguageCode: Optional. The language of entity synonyms defined in
  252. // `entities`. If not
  253. // specified, the agent's default language is used.
  254. // [More than a
  255. // dozen
  256. // languages](https://dialogflow.com/docs/reference/language) are
  257. // supported.
  258. // Note: languages must be enabled in the agent, before they can be
  259. // used.
  260. LanguageCode string `json:"languageCode,omitempty"`
  261. // ForceSendFields is a list of field names (e.g. "Entities") to
  262. // unconditionally include in API requests. By default, fields with
  263. // empty values are omitted from API requests. However, any non-pointer,
  264. // non-interface field appearing in ForceSendFields will be sent to the
  265. // server regardless of whether the field is empty or not. This may be
  266. // used to include empty fields in Patch requests.
  267. ForceSendFields []string `json:"-"`
  268. // NullFields is a list of field names (e.g. "Entities") to include in
  269. // API requests with the JSON null value. By default, fields with empty
  270. // values are omitted from API requests. However, any field with an
  271. // empty value appearing in NullFields will be sent to the server as
  272. // null. It is an error if a field in this list has a non-empty value.
  273. // This may be used to include null fields in Patch requests.
  274. NullFields []string `json:"-"`
  275. }
  276. func (s *GoogleCloudDialogflowV2BatchCreateEntitiesRequest) MarshalJSON() ([]byte, error) {
  277. type NoMethod GoogleCloudDialogflowV2BatchCreateEntitiesRequest
  278. raw := NoMethod(*s)
  279. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  280. }
  281. // GoogleCloudDialogflowV2BatchDeleteEntitiesRequest: The request
  282. // message for EntityTypes.BatchDeleteEntities.
  283. type GoogleCloudDialogflowV2BatchDeleteEntitiesRequest struct {
  284. // EntityValues: Required. The canonical `values` of the entities to
  285. // delete. Note that
  286. // these are not fully-qualified names, i.e. they don't start
  287. // with
  288. // `projects/<Project ID>`.
  289. EntityValues []string `json:"entityValues,omitempty"`
  290. // LanguageCode: Optional. The language of entity synonyms defined in
  291. // `entities`. If not
  292. // specified, the agent's default language is used.
  293. // [More than a
  294. // dozen
  295. // languages](https://dialogflow.com/docs/reference/language) are
  296. // supported.
  297. // Note: languages must be enabled in the agent, before they can be
  298. // used.
  299. LanguageCode string `json:"languageCode,omitempty"`
  300. // ForceSendFields is a list of field names (e.g. "EntityValues") to
  301. // unconditionally include in API requests. By default, fields with
  302. // empty values are omitted from API requests. However, any non-pointer,
  303. // non-interface field appearing in ForceSendFields will be sent to the
  304. // server regardless of whether the field is empty or not. This may be
  305. // used to include empty fields in Patch requests.
  306. ForceSendFields []string `json:"-"`
  307. // NullFields is a list of field names (e.g. "EntityValues") to include
  308. // in API requests with the JSON null value. By default, fields with
  309. // empty values are omitted from API requests. However, any field with
  310. // an empty value appearing in NullFields will be sent to the server as
  311. // null. It is an error if a field in this list has a non-empty value.
  312. // This may be used to include null fields in Patch requests.
  313. NullFields []string `json:"-"`
  314. }
  315. func (s *GoogleCloudDialogflowV2BatchDeleteEntitiesRequest) MarshalJSON() ([]byte, error) {
  316. type NoMethod GoogleCloudDialogflowV2BatchDeleteEntitiesRequest
  317. raw := NoMethod(*s)
  318. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  319. }
  320. // GoogleCloudDialogflowV2BatchDeleteEntityTypesRequest: The request
  321. // message for EntityTypes.BatchDeleteEntityTypes.
  322. type GoogleCloudDialogflowV2BatchDeleteEntityTypesRequest struct {
  323. // EntityTypeNames: Required. The names entity types to delete. All
  324. // names must point to the
  325. // same agent as `parent`.
  326. EntityTypeNames []string `json:"entityTypeNames,omitempty"`
  327. // ForceSendFields is a list of field names (e.g. "EntityTypeNames") to
  328. // unconditionally include in API requests. By default, fields with
  329. // empty values are omitted from API requests. However, any non-pointer,
  330. // non-interface field appearing in ForceSendFields will be sent to the
  331. // server regardless of whether the field is empty or not. This may be
  332. // used to include empty fields in Patch requests.
  333. ForceSendFields []string `json:"-"`
  334. // NullFields is a list of field names (e.g. "EntityTypeNames") to
  335. // include in API requests with the JSON null value. By default, fields
  336. // with empty values are omitted from API requests. However, any field
  337. // with an empty value appearing in NullFields will be sent to the
  338. // server as null. It is an error if a field in this list has a
  339. // non-empty value. This may be used to include null fields in Patch
  340. // requests.
  341. NullFields []string `json:"-"`
  342. }
  343. func (s *GoogleCloudDialogflowV2BatchDeleteEntityTypesRequest) MarshalJSON() ([]byte, error) {
  344. type NoMethod GoogleCloudDialogflowV2BatchDeleteEntityTypesRequest
  345. raw := NoMethod(*s)
  346. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  347. }
  348. // GoogleCloudDialogflowV2BatchDeleteIntentsRequest: The request message
  349. // for Intents.BatchDeleteIntents.
  350. type GoogleCloudDialogflowV2BatchDeleteIntentsRequest struct {
  351. // Intents: Required. The collection of intents to delete. Only intent
  352. // `name` must be
  353. // filled in.
  354. Intents []*GoogleCloudDialogflowV2Intent `json:"intents,omitempty"`
  355. // ForceSendFields is a list of field names (e.g. "Intents") to
  356. // unconditionally include in API requests. By default, fields with
  357. // empty values are omitted from API requests. However, any non-pointer,
  358. // non-interface field appearing in ForceSendFields will be sent to the
  359. // server regardless of whether the field is empty or not. This may be
  360. // used to include empty fields in Patch requests.
  361. ForceSendFields []string `json:"-"`
  362. // NullFields is a list of field names (e.g. "Intents") to include in
  363. // API requests with the JSON null value. By default, fields with empty
  364. // values are omitted from API requests. However, any field with an
  365. // empty value appearing in NullFields will be sent to the server as
  366. // null. It is an error if a field in this list has a non-empty value.
  367. // This may be used to include null fields in Patch requests.
  368. NullFields []string `json:"-"`
  369. }
  370. func (s *GoogleCloudDialogflowV2BatchDeleteIntentsRequest) MarshalJSON() ([]byte, error) {
  371. type NoMethod GoogleCloudDialogflowV2BatchDeleteIntentsRequest
  372. raw := NoMethod(*s)
  373. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  374. }
  375. // GoogleCloudDialogflowV2BatchUpdateEntitiesRequest: The response
  376. // message for EntityTypes.BatchCreateEntities.
  377. type GoogleCloudDialogflowV2BatchUpdateEntitiesRequest struct {
  378. // Entities: Required. The collection of new entities to replace the
  379. // existing entities.
  380. Entities []*GoogleCloudDialogflowV2EntityTypeEntity `json:"entities,omitempty"`
  381. // LanguageCode: Optional. The language of entity synonyms defined in
  382. // `entities`. If not
  383. // specified, the agent's default language is used.
  384. // [More than a
  385. // dozen
  386. // languages](https://dialogflow.com/docs/reference/language) are
  387. // supported.
  388. // Note: languages must be enabled in the agent, before they can be
  389. // used.
  390. LanguageCode string `json:"languageCode,omitempty"`
  391. // UpdateMask: Optional. The mask to control which fields get updated.
  392. UpdateMask string `json:"updateMask,omitempty"`
  393. // ForceSendFields is a list of field names (e.g. "Entities") to
  394. // unconditionally include in API requests. By default, fields with
  395. // empty values are omitted from API requests. However, any non-pointer,
  396. // non-interface field appearing in ForceSendFields will be sent to the
  397. // server regardless of whether the field is empty or not. This may be
  398. // used to include empty fields in Patch requests.
  399. ForceSendFields []string `json:"-"`
  400. // NullFields is a list of field names (e.g. "Entities") to include in
  401. // API requests with the JSON null value. By default, fields with empty
  402. // values are omitted from API requests. However, any field with an
  403. // empty value appearing in NullFields will be sent to the server as
  404. // null. It is an error if a field in this list has a non-empty value.
  405. // This may be used to include null fields in Patch requests.
  406. NullFields []string `json:"-"`
  407. }
  408. func (s *GoogleCloudDialogflowV2BatchUpdateEntitiesRequest) MarshalJSON() ([]byte, error) {
  409. type NoMethod GoogleCloudDialogflowV2BatchUpdateEntitiesRequest
  410. raw := NoMethod(*s)
  411. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  412. }
  413. // GoogleCloudDialogflowV2BatchUpdateEntityTypesRequest: The request
  414. // message for EntityTypes.BatchUpdateEntityTypes.
  415. type GoogleCloudDialogflowV2BatchUpdateEntityTypesRequest struct {
  416. // EntityTypeBatchInline: The collection of entity type to update or
  417. // create.
  418. EntityTypeBatchInline *GoogleCloudDialogflowV2EntityTypeBatch `json:"entityTypeBatchInline,omitempty"`
  419. // EntityTypeBatchUri: The URI to a Google Cloud Storage file containing
  420. // entity types to update
  421. // or create. The file format can either be a serialized proto
  422. // (of
  423. // EntityBatch type) or a JSON object. Note: The URI must start
  424. // with
  425. // "gs://".
  426. EntityTypeBatchUri string `json:"entityTypeBatchUri,omitempty"`
  427. // LanguageCode: Optional. The language of entity synonyms defined in
  428. // `entity_types`. If not
  429. // specified, the agent's default language is used.
  430. // [More than a
  431. // dozen
  432. // languages](https://dialogflow.com/docs/reference/language) are
  433. // supported.
  434. // Note: languages must be enabled in the agent, before they can be
  435. // used.
  436. LanguageCode string `json:"languageCode,omitempty"`
  437. // UpdateMask: Optional. The mask to control which fields get updated.
  438. UpdateMask string `json:"updateMask,omitempty"`
  439. // ForceSendFields is a list of field names (e.g.
  440. // "EntityTypeBatchInline") to unconditionally include in API requests.
  441. // By default, fields with empty values are omitted from API requests.
  442. // However, any non-pointer, non-interface field appearing in
  443. // ForceSendFields will be sent to the server regardless of whether the
  444. // field is empty or not. This may be used to include empty fields in
  445. // Patch requests.
  446. ForceSendFields []string `json:"-"`
  447. // NullFields is a list of field names (e.g. "EntityTypeBatchInline") to
  448. // include in API requests with the JSON null value. By default, fields
  449. // with empty values are omitted from API requests. However, any field
  450. // with an empty value appearing in NullFields will be sent to the
  451. // server as null. It is an error if a field in this list has a
  452. // non-empty value. This may be used to include null fields in Patch
  453. // requests.
  454. NullFields []string `json:"-"`
  455. }
  456. func (s *GoogleCloudDialogflowV2BatchUpdateEntityTypesRequest) MarshalJSON() ([]byte, error) {
  457. type NoMethod GoogleCloudDialogflowV2BatchUpdateEntityTypesRequest
  458. raw := NoMethod(*s)
  459. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  460. }
  461. // GoogleCloudDialogflowV2BatchUpdateEntityTypesResponse: The response
  462. // message for EntityTypes.BatchUpdateEntityTypes.
  463. type GoogleCloudDialogflowV2BatchUpdateEntityTypesResponse struct {
  464. // EntityTypes: The collection of updated or created entity types.
  465. EntityTypes []*GoogleCloudDialogflowV2EntityType `json:"entityTypes,omitempty"`
  466. // ForceSendFields is a list of field names (e.g. "EntityTypes") to
  467. // unconditionally include in API requests. By default, fields with
  468. // empty values are omitted from API requests. However, any non-pointer,
  469. // non-interface field appearing in ForceSendFields will be sent to the
  470. // server regardless of whether the field is empty or not. This may be
  471. // used to include empty fields in Patch requests.
  472. ForceSendFields []string `json:"-"`
  473. // NullFields is a list of field names (e.g. "EntityTypes") to include
  474. // in API requests with the JSON null value. By default, fields with
  475. // empty values are omitted from API requests. However, any field with
  476. // an empty value appearing in NullFields will be sent to the server as
  477. // null. It is an error if a field in this list has a non-empty value.
  478. // This may be used to include null fields in Patch requests.
  479. NullFields []string `json:"-"`
  480. }
  481. func (s *GoogleCloudDialogflowV2BatchUpdateEntityTypesResponse) MarshalJSON() ([]byte, error) {
  482. type NoMethod GoogleCloudDialogflowV2BatchUpdateEntityTypesResponse
  483. raw := NoMethod(*s)
  484. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  485. }
  486. // GoogleCloudDialogflowV2BatchUpdateIntentsRequest: The request message
  487. // for Intents.BatchUpdateIntents.
  488. type GoogleCloudDialogflowV2BatchUpdateIntentsRequest struct {
  489. // IntentBatchInline: The collection of intents to update or create.
  490. IntentBatchInline *GoogleCloudDialogflowV2IntentBatch `json:"intentBatchInline,omitempty"`
  491. // IntentBatchUri: The URI to a Google Cloud Storage file containing
  492. // intents to update or
  493. // create. The file format can either be a serialized proto (of
  494. // IntentBatch
  495. // type) or JSON object. Note: The URI must start with "gs://".
  496. IntentBatchUri string `json:"intentBatchUri,omitempty"`
  497. // IntentView: Optional. The resource view to apply to the returned
  498. // intent.
  499. //
  500. // Possible values:
  501. // "INTENT_VIEW_UNSPECIFIED" - Training phrases field is not populated
  502. // in the response.
  503. // "INTENT_VIEW_FULL" - All fields are populated.
  504. IntentView string `json:"intentView,omitempty"`
  505. // LanguageCode: Optional. The language of training phrases, parameters
  506. // and rich messages
  507. // defined in `intents`. If not specified, the agent's default language
  508. // is
  509. // used. [More than a
  510. // dozen
  511. // languages](https://dialogflow.com/docs/reference/language) are
  512. // supported.
  513. // Note: languages must be enabled in the agent, before they can be
  514. // used.
  515. LanguageCode string `json:"languageCode,omitempty"`
  516. // UpdateMask: Optional. The mask to control which fields get updated.
  517. UpdateMask string `json:"updateMask,omitempty"`
  518. // ForceSendFields is a list of field names (e.g. "IntentBatchInline")
  519. // to unconditionally include in API requests. By default, fields with
  520. // empty values are omitted from API requests. However, any non-pointer,
  521. // non-interface field appearing in ForceSendFields will be sent to the
  522. // server regardless of whether the field is empty or not. This may be
  523. // used to include empty fields in Patch requests.
  524. ForceSendFields []string `json:"-"`
  525. // NullFields is a list of field names (e.g. "IntentBatchInline") to
  526. // include in API requests with the JSON null value. By default, fields
  527. // with empty values are omitted from API requests. However, any field
  528. // with an empty value appearing in NullFields will be sent to the
  529. // server as null. It is an error if a field in this list has a
  530. // non-empty value. This may be used to include null fields in Patch
  531. // requests.
  532. NullFields []string `json:"-"`
  533. }
  534. func (s *GoogleCloudDialogflowV2BatchUpdateIntentsRequest) MarshalJSON() ([]byte, error) {
  535. type NoMethod GoogleCloudDialogflowV2BatchUpdateIntentsRequest
  536. raw := NoMethod(*s)
  537. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  538. }
  539. // GoogleCloudDialogflowV2BatchUpdateIntentsResponse: The response
  540. // message for Intents.BatchUpdateIntents.
  541. type GoogleCloudDialogflowV2BatchUpdateIntentsResponse struct {
  542. // Intents: The collection of updated or created intents.
  543. Intents []*GoogleCloudDialogflowV2Intent `json:"intents,omitempty"`
  544. // ForceSendFields is a list of field names (e.g. "Intents") to
  545. // unconditionally include in API requests. By default, fields with
  546. // empty values are omitted from API requests. However, any non-pointer,
  547. // non-interface field appearing in ForceSendFields will be sent to the
  548. // server regardless of whether the field is empty or not. This may be
  549. // used to include empty fields in Patch requests.
  550. ForceSendFields []string `json:"-"`
  551. // NullFields is a list of field names (e.g. "Intents") to include in
  552. // API requests with the JSON null value. By default, fields with empty
  553. // values are omitted from API requests. However, any field with an
  554. // empty value appearing in NullFields will be sent to the server as
  555. // null. It is an error if a field in this list has a non-empty value.
  556. // This may be used to include null fields in Patch requests.
  557. NullFields []string `json:"-"`
  558. }
  559. func (s *GoogleCloudDialogflowV2BatchUpdateIntentsResponse) MarshalJSON() ([]byte, error) {
  560. type NoMethod GoogleCloudDialogflowV2BatchUpdateIntentsResponse
  561. raw := NoMethod(*s)
  562. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  563. }
  564. // GoogleCloudDialogflowV2Context: Represents a context.
  565. type GoogleCloudDialogflowV2Context struct {
  566. // LifespanCount: Optional. The number of conversational query requests
  567. // after which the
  568. // context expires. If set to `0` (the default) the context
  569. // expires
  570. // immediately. Contexts expire automatically after 10 minutes even if
  571. // there
  572. // are no matching queries.
  573. LifespanCount int64 `json:"lifespanCount,omitempty"`
  574. // Name: Required. The unique identifier of the context.
  575. // Format:
  576. // `projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context
  577. // ID>`.
  578. Name string `json:"name,omitempty"`
  579. // Parameters: Optional. The collection of parameters associated with
  580. // this context.
  581. // Refer to [this
  582. // doc](https://dialogflow.com/docs/actions-and-parameters) for
  583. // syntax.
  584. Parameters googleapi.RawMessage `json:"parameters,omitempty"`
  585. // ServerResponse contains the HTTP response code and headers from the
  586. // server.
  587. googleapi.ServerResponse `json:"-"`
  588. // ForceSendFields is a list of field names (e.g. "LifespanCount") to
  589. // unconditionally include in API requests. By default, fields with
  590. // empty values are omitted from API requests. However, any non-pointer,
  591. // non-interface field appearing in ForceSendFields will be sent to the
  592. // server regardless of whether the field is empty or not. This may be
  593. // used to include empty fields in Patch requests.
  594. ForceSendFields []string `json:"-"`
  595. // NullFields is a list of field names (e.g. "LifespanCount") to include
  596. // in API requests with the JSON null value. By default, fields with
  597. // empty values are omitted from API requests. However, any field with
  598. // an empty value appearing in NullFields will be sent to the server as
  599. // null. It is an error if a field in this list has a non-empty value.
  600. // This may be used to include null fields in Patch requests.
  601. NullFields []string `json:"-"`
  602. }
  603. func (s *GoogleCloudDialogflowV2Context) MarshalJSON() ([]byte, error) {
  604. type NoMethod GoogleCloudDialogflowV2Context
  605. raw := NoMethod(*s)
  606. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  607. }
  608. // GoogleCloudDialogflowV2DetectIntentRequest: The request to detect
  609. // user's intent.
  610. type GoogleCloudDialogflowV2DetectIntentRequest struct {
  611. // InputAudio: Optional. The natural language speech audio to be
  612. // processed. This field
  613. // should be populated iff `query_input` is set to an input audio
  614. // config.
  615. // A single request can contain up to 1 minute of speech audio data.
  616. InputAudio string `json:"inputAudio,omitempty"`
  617. // QueryInput: Required. The input specification. It can be set to:
  618. //
  619. // 1. an audio config
  620. // which instructs the speech recognizer how to process the speech
  621. // audio,
  622. //
  623. // 2. a conversational query in the form of text, or
  624. //
  625. // 3. an event that specifies which intent to trigger.
  626. QueryInput *GoogleCloudDialogflowV2QueryInput `json:"queryInput,omitempty"`
  627. // QueryParams: Optional. The parameters of this query.
  628. QueryParams *GoogleCloudDialogflowV2QueryParameters `json:"queryParams,omitempty"`
  629. // ForceSendFields is a list of field names (e.g. "InputAudio") to
  630. // unconditionally include in API requests. By default, fields with
  631. // empty values are omitted from API requests. However, any non-pointer,
  632. // non-interface field appearing in ForceSendFields will be sent to the
  633. // server regardless of whether the field is empty or not. This may be
  634. // used to include empty fields in Patch requests.
  635. ForceSendFields []string `json:"-"`
  636. // NullFields is a list of field names (e.g. "InputAudio") to include in
  637. // API requests with the JSON null value. By default, fields with empty
  638. // values are omitted from API requests. However, any field with an
  639. // empty value appearing in NullFields will be sent to the server as
  640. // null. It is an error if a field in this list has a non-empty value.
  641. // This may be used to include null fields in Patch requests.
  642. NullFields []string `json:"-"`
  643. }
  644. func (s *GoogleCloudDialogflowV2DetectIntentRequest) MarshalJSON() ([]byte, error) {
  645. type NoMethod GoogleCloudDialogflowV2DetectIntentRequest
  646. raw := NoMethod(*s)
  647. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  648. }
  649. // GoogleCloudDialogflowV2DetectIntentResponse: The message returned
  650. // from the DetectIntent method.
  651. type GoogleCloudDialogflowV2DetectIntentResponse struct {
  652. // QueryResult: The results of the conversational query or event
  653. // processing.
  654. QueryResult *GoogleCloudDialogflowV2QueryResult `json:"queryResult,omitempty"`
  655. // ResponseId: The unique identifier of the response. It can be used
  656. // to
  657. // locate a response in the training example set or for reporting
  658. // issues.
  659. ResponseId string `json:"responseId,omitempty"`
  660. // WebhookStatus: Specifies the status of the webhook request.
  661. // `webhook_status`
  662. // is never populated in webhook requests.
  663. WebhookStatus *GoogleRpcStatus `json:"webhookStatus,omitempty"`
  664. // ServerResponse contains the HTTP response code and headers from the
  665. // server.
  666. googleapi.ServerResponse `json:"-"`
  667. // ForceSendFields is a list of field names (e.g. "QueryResult") to
  668. // unconditionally include in API requests. By default, fields with
  669. // empty values are omitted from API requests. However, any non-pointer,
  670. // non-interface field appearing in ForceSendFields will be sent to the
  671. // server regardless of whether the field is empty or not. This may be
  672. // used to include empty fields in Patch requests.
  673. ForceSendFields []string `json:"-"`
  674. // NullFields is a list of field names (e.g. "QueryResult") to include
  675. // in API requests with the JSON null value. By default, fields with
  676. // empty values are omitted from API requests. However, any field with
  677. // an empty value appearing in NullFields will be sent to the server as
  678. // null. It is an error if a field in this list has a non-empty value.
  679. // This may be used to include null fields in Patch requests.
  680. NullFields []string `json:"-"`
  681. }
  682. func (s *GoogleCloudDialogflowV2DetectIntentResponse) MarshalJSON() ([]byte, error) {
  683. type NoMethod GoogleCloudDialogflowV2DetectIntentResponse
  684. raw := NoMethod(*s)
  685. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  686. }
  687. // GoogleCloudDialogflowV2EntityType: Represents an entity type.
  688. // Entity types serve as a tool for extracting parameter values from
  689. // natural
  690. // language queries.
  691. type GoogleCloudDialogflowV2EntityType struct {
  692. // AutoExpansionMode: Optional. Indicates whether the entity type can be
  693. // automatically
  694. // expanded.
  695. //
  696. // Possible values:
  697. // "AUTO_EXPANSION_MODE_UNSPECIFIED" - Auto expansion disabled for the
  698. // entity.
  699. // "AUTO_EXPANSION_MODE_DEFAULT" - Allows an agent to recognize values
  700. // that have not been explicitly
  701. // listed in the entity.
  702. AutoExpansionMode string `json:"autoExpansionMode,omitempty"`
  703. // DisplayName: Required. The name of the entity.
  704. DisplayName string `json:"displayName,omitempty"`
  705. // Entities: Optional. The collection of entities associated with the
  706. // entity type.
  707. Entities []*GoogleCloudDialogflowV2EntityTypeEntity `json:"entities,omitempty"`
  708. // Kind: Required. Indicates the kind of entity type.
  709. //
  710. // Possible values:
  711. // "KIND_UNSPECIFIED" - Not specified. This value should be never
  712. // used.
  713. // "KIND_MAP" - Map entity types allow mapping of a group of synonyms
  714. // to a canonical
  715. // value.
  716. // "KIND_LIST" - List entity types contain a set of entries that do
  717. // not map to canonical
  718. // values. However, list entity types can contain references to other
  719. // entity
  720. // types (with or without aliases).
  721. Kind string `json:"kind,omitempty"`
  722. // Name: Required for all methods except `create` (`create` populates
  723. // the name
  724. // automatically.
  725. // The unique identifier of the entity type. Format:
  726. // `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.
  727. Name string `json:"name,omitempty"`
  728. // ServerResponse contains the HTTP response code and headers from the
  729. // server.
  730. googleapi.ServerResponse `json:"-"`
  731. // ForceSendFields is a list of field names (e.g. "AutoExpansionMode")
  732. // to unconditionally include in API requests. By default, fields with
  733. // empty values are omitted from API requests. However, any non-pointer,
  734. // non-interface field appearing in ForceSendFields will be sent to the
  735. // server regardless of whether the field is empty or not. This may be
  736. // used to include empty fields in Patch requests.
  737. ForceSendFields []string `json:"-"`
  738. // NullFields is a list of field names (e.g. "AutoExpansionMode") to
  739. // include in API requests with the JSON null value. By default, fields
  740. // with empty values are omitted from API requests. However, any field
  741. // with an empty value appearing in NullFields will be sent to the
  742. // server as null. It is an error if a field in this list has a
  743. // non-empty value. This may be used to include null fields in Patch
  744. // requests.
  745. NullFields []string `json:"-"`
  746. }
  747. func (s *GoogleCloudDialogflowV2EntityType) MarshalJSON() ([]byte, error) {
  748. type NoMethod GoogleCloudDialogflowV2EntityType
  749. raw := NoMethod(*s)
  750. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  751. }
  752. // GoogleCloudDialogflowV2EntityTypeBatch: This message is a wrapper
  753. // around a collection of entity types.
  754. type GoogleCloudDialogflowV2EntityTypeBatch struct {
  755. // EntityTypes: A collection of entity types.
  756. EntityTypes []*GoogleCloudDialogflowV2EntityType `json:"entityTypes,omitempty"`
  757. // ForceSendFields is a list of field names (e.g. "EntityTypes") to
  758. // unconditionally include in API requests. By default, fields with
  759. // empty values are omitted from API requests. However, any non-pointer,
  760. // non-interface field appearing in ForceSendFields will be sent to the
  761. // server regardless of whether the field is empty or not. This may be
  762. // used to include empty fields in Patch requests.
  763. ForceSendFields []string `json:"-"`
  764. // NullFields is a list of field names (e.g. "EntityTypes") to include
  765. // in API requests with the JSON null value. By default, fields with
  766. // empty values are omitted from API requests. However, any field with
  767. // an empty value appearing in NullFields will be sent to the server as
  768. // null. It is an error if a field in this list has a non-empty value.
  769. // This may be used to include null fields in Patch requests.
  770. NullFields []string `json:"-"`
  771. }
  772. func (s *GoogleCloudDialogflowV2EntityTypeBatch) MarshalJSON() ([]byte, error) {
  773. type NoMethod GoogleCloudDialogflowV2EntityTypeBatch
  774. raw := NoMethod(*s)
  775. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  776. }
  777. // GoogleCloudDialogflowV2EntityTypeEntity: Optional. Represents an
  778. // entity.
  779. type GoogleCloudDialogflowV2EntityTypeEntity struct {
  780. // Synonyms: Required. A collection of synonyms. For `KIND_LIST` entity
  781. // types this
  782. // must contain exactly one synonym equal to `value`.
  783. Synonyms []string `json:"synonyms,omitempty"`
  784. // Value: Required.
  785. // For `KIND_MAP` entity types:
  786. // A canonical name to be used in place of synonyms.
  787. // For `KIND_LIST` entity types:
  788. // A string that can contain references to other entity types (with
  789. // or
  790. // without aliases).
  791. Value string `json:"value,omitempty"`
  792. // ForceSendFields is a list of field names (e.g. "Synonyms") to
  793. // unconditionally include in API requests. By default, fields with
  794. // empty values are omitted from API requests. However, any non-pointer,
  795. // non-interface field appearing in ForceSendFields will be sent to the
  796. // server regardless of whether the field is empty or not. This may be
  797. // used to include empty fields in Patch requests.
  798. ForceSendFields []string `json:"-"`
  799. // NullFields is a list of field names (e.g. "Synonyms") to include in
  800. // API requests with the JSON null value. By default, fields with empty
  801. // values are omitted from API requests. However, any field with an
  802. // empty value appearing in NullFields will be sent to the server as
  803. // null. It is an error if a field in this list has a non-empty value.
  804. // This may be used to include null fields in Patch requests.
  805. NullFields []string `json:"-"`
  806. }
  807. func (s *GoogleCloudDialogflowV2EntityTypeEntity) MarshalJSON() ([]byte, error) {
  808. type NoMethod GoogleCloudDialogflowV2EntityTypeEntity
  809. raw := NoMethod(*s)
  810. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  811. }
  812. // GoogleCloudDialogflowV2EventInput: Events allow for matching intents
  813. // by event name instead of the natural
  814. // language input. For instance, input `<event: { name:
  815. // “welcome_event”,
  816. // parameters: { name: “Sam” } }>` can trigger a personalized
  817. // welcome response.
  818. // The parameter `name` may be used by the agent in the
  819. // response:
  820. // `“Hello #welcome_event.name! What can I do for you today?”`.
  821. type GoogleCloudDialogflowV2EventInput struct {
  822. // LanguageCode: Required. The language of this query. See
  823. // [Language
  824. // Support](https://dialogflow.com/docs/languages) for a list of
  825. // the
  826. // currently supported language codes. Note that queries in the same
  827. // session
  828. // do not necessarily need to specify the same language.
  829. LanguageCode string `json:"languageCode,omitempty"`
  830. // Name: Required. The unique identifier of the event.
  831. Name string `json:"name,omitempty"`
  832. // Parameters: Optional. The collection of parameters associated with
  833. // the event.
  834. Parameters googleapi.RawMessage `json:"parameters,omitempty"`
  835. // ForceSendFields is a list of field names (e.g. "LanguageCode") to
  836. // unconditionally include in API requests. By default, fields with
  837. // empty values are omitted from API requests. However, any non-pointer,
  838. // non-interface field appearing in ForceSendFields will be sent to the
  839. // server regardless of whether the field is empty or not. This may be
  840. // used to include empty fields in Patch requests.
  841. ForceSendFields []string `json:"-"`
  842. // NullFields is a list of field names (e.g. "LanguageCode") to include
  843. // in API requests with the JSON null value. By default, fields with
  844. // empty values are omitted from API requests. However, any field with
  845. // an empty value appearing in NullFields will be sent to the server as
  846. // null. It is an error if a field in this list has a non-empty value.
  847. // This may be used to include null fields in Patch requests.
  848. NullFields []string `json:"-"`
  849. }
  850. func (s *GoogleCloudDialogflowV2EventInput) MarshalJSON() ([]byte, error) {
  851. type NoMethod GoogleCloudDialogflowV2EventInput
  852. raw := NoMethod(*s)
  853. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  854. }
  855. // GoogleCloudDialogflowV2ExportAgentRequest: The request message for
  856. // Agents.ExportAgent.
  857. type GoogleCloudDialogflowV2ExportAgentRequest struct {
  858. // AgentUri: Optional. The
  859. // [Google Cloud Storage](https://cloud.google.com/storage/docs/)
  860. // URI to export the agent to.
  861. // The format of this URI must be `gs://<bucket-name>/<object-name>`.
  862. // If left unspecified, the serialized agent is returned inline.
  863. AgentUri string `json:"agentUri,omitempty"`
  864. // ForceSendFields is a list of field names (e.g. "AgentUri") to
  865. // unconditionally include in API requests. By default, fields with
  866. // empty values are omitted from API requests. However, any non-pointer,
  867. // non-interface field appearing in ForceSendFields will be sent to the
  868. // server regardless of whether the field is empty or not. This may be
  869. // used to include empty fields in Patch requests.
  870. ForceSendFields []string `json:"-"`
  871. // NullFields is a list of field names (e.g. "AgentUri") to include in
  872. // API requests with the JSON null value. By default, fields with empty
  873. // values are omitted from API requests. However, any field with an
  874. // empty value appearing in NullFields will be sent to the server as
  875. // null. It is an error if a field in this list has a non-empty value.
  876. // This may be used to include null fields in Patch requests.
  877. NullFields []string `json:"-"`
  878. }
  879. func (s *GoogleCloudDialogflowV2ExportAgentRequest) MarshalJSON() ([]byte, error) {
  880. type NoMethod GoogleCloudDialogflowV2ExportAgentRequest
  881. raw := NoMethod(*s)
  882. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  883. }
  884. // GoogleCloudDialogflowV2ExportAgentResponse: The response message for
  885. // Agents.ExportAgent.
  886. type GoogleCloudDialogflowV2ExportAgentResponse struct {
  887. // AgentContent: The exported agent.
  888. //
  889. // Example for how to export an agent to a zip file via a command
  890. // line:
  891. //
  892. // curl \
  893. //
  894. // 'https://dialogflow.googleapis.com/v2/projects/<project_name>/agent:ex
  895. // port'\
  896. // -X POST \
  897. // -H 'Authorization: Bearer '$(gcloud auth print-access-token) \
  898. // -H 'Accept: application/json' \
  899. // -H 'Content-Type: application/json' \
  900. // --compressed \
  901. // --data-binary '{}' \
  902. // | grep agentContent | sed -e 's/.*"agentContent": "\([^"]*\)".*/\1/'
  903. // \
  904. // | base64 --decode > <agent zip file>
  905. AgentContent string `json:"agentContent,omitempty"`
  906. // AgentUri: The URI to a file containing the exported agent. This field
  907. // is populated
  908. // only if `agent_uri` is specified in `ExportAgentRequest`.
  909. AgentUri string `json:"agentUri,omitempty"`
  910. // ForceSendFields is a list of field names (e.g. "AgentContent") to
  911. // unconditionally include in API requests. By default, fields with
  912. // empty values are omitted from API requests. However, any non-pointer,
  913. // non-interface field appearing in ForceSendFields will be sent to the
  914. // server regardless of whether the field is empty or not. This may be
  915. // used to include empty fields in Patch requests.
  916. ForceSendFields []string `json:"-"`
  917. // NullFields is a list of field names (e.g. "AgentContent") to include
  918. // in API requests with the JSON null value. By default, fields with
  919. // empty values are omitted from API requests. However, any field with
  920. // an empty value appearing in NullFields will be sent to the server as
  921. // null. It is an error if a field in this list has a non-empty value.
  922. // This may be used to include null fields in Patch requests.
  923. NullFields []string `json:"-"`
  924. }
  925. func (s *GoogleCloudDialogflowV2ExportAgentResponse) MarshalJSON() ([]byte, error) {
  926. type NoMethod GoogleCloudDialogflowV2ExportAgentResponse
  927. raw := NoMethod(*s)
  928. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  929. }
  930. // GoogleCloudDialogflowV2ImportAgentRequest: The request message for
  931. // Agents.ImportAgent.
  932. type GoogleCloudDialogflowV2ImportAgentRequest struct {
  933. // AgentContent: The agent to import.
  934. //
  935. // Example for how to import an agent via the command line:
  936. //
  937. // curl \
  938. //
  939. // 'https://dialogflow.googleapis.com/v2/projects/<project_name>/agent:im
  940. // port\
  941. // -X POST \
  942. // -H 'Authorization: Bearer '$(gcloud auth print-access-token) \
  943. // -H 'Accept: application/json' \
  944. // -H 'Content-Type: application/json' \
  945. // --compressed \
  946. // --data-binary "{
  947. // 'agentContent': '$(cat <agent zip file> | base64 -w 0)'
  948. // }"
  949. AgentContent string `json:"agentContent,omitempty"`
  950. // AgentUri: The URI to a Google Cloud Storage file containing the agent
  951. // to import.
  952. // Note: The URI must start with "gs://".
  953. AgentUri string `json:"agentUri,omitempty"`
  954. // ForceSendFields is a list of field names (e.g. "AgentContent") to
  955. // unconditionally include in API requests. By default, fields with
  956. // empty values are omitted from API requests. However, any non-pointer,
  957. // non-interface field appearing in ForceSendFields will be sent to the
  958. // server regardless of whether the field is empty or not. This may be
  959. // used to include empty fields in Patch requests.
  960. ForceSendFields []string `json:"-"`
  961. // NullFields is a list of field names (e.g. "AgentContent") to include
  962. // in API requests with the JSON null value. By default, fields with
  963. // empty values are omitted from API requests. However, any field with
  964. // an empty value appearing in NullFields will be sent to the server as
  965. // null. It is an error if a field in this list has a non-empty value.
  966. // This may be used to include null fields in Patch requests.
  967. NullFields []string `json:"-"`
  968. }
  969. func (s *GoogleCloudDialogflowV2ImportAgentRequest) MarshalJSON() ([]byte, error) {
  970. type NoMethod GoogleCloudDialogflowV2ImportAgentRequest
  971. raw := NoMethod(*s)
  972. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  973. }
  974. // GoogleCloudDialogflowV2InputAudioConfig: Instructs the speech
  975. // recognizer how to process the audio content.
  976. type GoogleCloudDialogflowV2InputAudioConfig struct {
  977. // AudioEncoding: Required. Audio encoding of the audio content to
  978. // process.
  979. //
  980. // Possible values:
  981. // "AUDIO_ENCODING_UNSPECIFIED" - Not specified.
  982. // "AUDIO_ENCODING_LINEAR_16" - Uncompressed 16-bit signed
  983. // little-endian samples (Linear PCM).
  984. // "AUDIO_ENCODING_FLAC" -
  985. // [`FLAC`](https://xiph.org/flac/documentation.html) (Free Lossless
  986. // Audio
  987. // Codec) is the recommended encoding because it is lossless
  988. // (therefore
  989. // recognition is not compromised) and requires only about half
  990. // the
  991. // bandwidth of `LINEAR16`. `FLAC` stream encoding supports 16-bit
  992. // and
  993. // 24-bit samples, however, not all fields in `STREAMINFO` are
  994. // supported.
  995. // "AUDIO_ENCODING_MULAW" - 8-bit samples that compand 14-bit audio
  996. // samples using G.711 PCMU/mu-law.
  997. // "AUDIO_ENCODING_AMR" - Adaptive Multi-Rate Narrowband codec.
  998. // `sample_rate_hertz` must be 8000.
  999. // "AUDIO_ENCODING_AMR_WB" - Adaptive Multi-Rate Wideband codec.
  1000. // `sample_rate_hertz` must be 16000.
  1001. // "AUDIO_ENCODING_OGG_OPUS" - Opus encoded audio frames in Ogg
  1002. // container
  1003. // ([OggOpus](https://wiki.xiph.org/OggOpus)).
  1004. // `sample_rate_her
  1005. // tz` must be 16000.
  1006. // "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE" - Although the use of lossy
  1007. // encodings is not recommended, if a very low
  1008. // bitrate encoding is required, `OGG_OPUS` is highly preferred
  1009. // over
  1010. // Speex encoding. The [Speex](https://speex.org/) encoding supported
  1011. // by
  1012. // Dialogflow API has a header byte in each block, as in MIME
  1013. // type
  1014. // `audio/x-speex-with-header-byte`.
  1015. // It is a variant of the RTP Speex encoding defined in
  1016. // [RFC 5574](https://tools.ietf.org/html/rfc5574).
  1017. // The stream is a sequence of blocks, one block per RTP packet. Each
  1018. // block
  1019. // starts with a byte containing the length of the block, in bytes,
  1020. // followed
  1021. // by one or more frames of Speex data, padded to an integral number
  1022. // of
  1023. // bytes (octets) as specified in RFC 5574. In other words, each RTP
  1024. // header
  1025. // is replaced with a single byte containing the block length. Only
  1026. // Speex
  1027. // wideband is supported. `sample_rate_hertz` must be 16000.
  1028. AudioEncoding string `json:"audioEncoding,omitempty"`
  1029. // LanguageCode: Required. The language of the supplied audio.
  1030. // Dialogflow does not do
  1031. // translations. See
  1032. // [Language
  1033. // Support](https://dialogflow.com/docs/languages) for a list of
  1034. // the
  1035. // currently supported language codes. Note that queries in the same
  1036. // session
  1037. // do not necessarily need to specify the same language.
  1038. LanguageCode string `json:"languageCode,omitempty"`
  1039. // PhraseHints: Optional. The collection of phrase hints which are used
  1040. // to boost accuracy
  1041. // of speech recognition.
  1042. // Refer to
  1043. // [Cloud Speech
  1044. // API
  1045. // documentation](https://cloud.google.com/speech-to-text/docs/basics
  1046. // #phrase-hints)
  1047. // for more details.
  1048. PhraseHints []string `json:"phraseHints,omitempty"`
  1049. // SampleRateHertz: Required. Sample rate (in Hertz) of the audio
  1050. // content sent in the query.
  1051. // Refer to
  1052. // [Cloud Speech
  1053. // API
  1054. // documentation](https://cloud.google.com/speech-to-text/docs/basics
  1055. // ) for
  1056. // more details.
  1057. SampleRateHertz int64 `json:"sampleRateHertz,omitempty"`
  1058. // ForceSendFields is a list of field names (e.g. "AudioEncoding") to
  1059. // unconditionally include in API requests. By default, fields with
  1060. // empty values are omitted from API requests. However, any non-pointer,
  1061. // non-interface field appearing in ForceSendFields will be sent to the
  1062. // server regardless of whether the field is empty or not. This may be
  1063. // used to include empty fields in Patch requests.
  1064. ForceSendFields []string `json:"-"`
  1065. // NullFields is a list of field names (e.g. "AudioEncoding") to include
  1066. // in API requests with the JSON null value. By default, fields with
  1067. // empty values are omitted from API requests. However, any field with
  1068. // an empty value appearing in NullFields will be sent to the server as
  1069. // null. It is an error if a field in this list has a non-empty value.
  1070. // This may be used to include null fields in Patch requests.
  1071. NullFields []string `json:"-"`
  1072. }
  1073. func (s *GoogleCloudDialogflowV2InputAudioConfig) MarshalJSON() ([]byte, error) {
  1074. type NoMethod GoogleCloudDialogflowV2InputAudioConfig
  1075. raw := NoMethod(*s)
  1076. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1077. }
  1078. // GoogleCloudDialogflowV2Intent: Represents an intent.
  1079. // Intents convert a number of user expressions or patterns into an
  1080. // action. An
  1081. // action is an extraction of a user command or sentence semantics.
  1082. // Next available field number: 22.
  1083. type GoogleCloudDialogflowV2Intent struct {
  1084. // Action: Optional. The name of the action associated with the intent.
  1085. Action string `json:"action,omitempty"`
  1086. // DefaultResponsePlatforms: Optional. The list of platforms for which
  1087. // the first response will be
  1088. // taken from among the messages assigned to the DEFAULT_PLATFORM.
  1089. //
  1090. // Possible values:
  1091. // "PLATFORM_UNSPECIFIED" - Not specified.
  1092. // "FACEBOOK" - Facebook.
  1093. // "SLACK" - Slack.
  1094. // "TELEGRAM" - Telegram.
  1095. // "KIK" - Kik.
  1096. // "SKYPE" - Skype.
  1097. // "LINE" - Line.
  1098. // "VIBER" - Viber.
  1099. // "ACTIONS_ON_GOOGLE" - Actions on Google.
  1100. // When using Actions on Google, you can choose one of the
  1101. // specific
  1102. // Intent.Message types that mention support for Actions on Google,
  1103. // or you can use the advanced Intent.Message.payload field.
  1104. // The payload field provides access to AoG features not available in
  1105. // the
  1106. // specific message types.
  1107. // If using the Intent.Message.payload field, it should have a
  1108. // structure
  1109. // similar to the JSON message shown here. For more information,
  1110. // see
  1111. // [Actions on Google
  1112. // Webhook
  1113. // Format](https://developers.google.com/actions/dialogflow/webho
  1114. // ok)
  1115. // <pre>{
  1116. // "expectUserResponse": true,
  1117. // "isSsml": false,
  1118. // "noInputPrompts": [],
  1119. // "richResponse": {
  1120. // "items": [
  1121. // {
  1122. // "simpleResponse": {
  1123. // "displayText": "hi",
  1124. // "textToSpeech": "hello"
  1125. // }
  1126. // }
  1127. // ],
  1128. // "suggestions": [
  1129. // {
  1130. // "title": "Say this"
  1131. // },
  1132. // {
  1133. // "title": "or this"
  1134. // }
  1135. // ]
  1136. // },
  1137. // "systemIntent": {
  1138. // "data": {
  1139. // "@type":
  1140. // "type.googleapis.com/google.actions.v2.OptionValueSpec",
  1141. // "listSelect": {
  1142. // "items": [
  1143. // {
  1144. // "optionInfo": {
  1145. // "key": "key1",
  1146. // "synonyms": [
  1147. // "key one"
  1148. // ]
  1149. // },
  1150. // "title": "must not be empty, but unique"
  1151. // },
  1152. // {
  1153. // "optionInfo": {
  1154. // "key": "key2",
  1155. // "synonyms": [
  1156. // "key two"
  1157. // ]
  1158. // },
  1159. // "title": "must not be empty, but unique"
  1160. // }
  1161. // ]
  1162. // }
  1163. // },
  1164. // "intent": "actions.intent.OPTION"
  1165. // }
  1166. // }</pre>
  1167. DefaultResponsePlatforms []string `json:"defaultResponsePlatforms,omitempty"`
  1168. // DisplayName: Required. The name of this intent.
  1169. DisplayName string `json:"displayName,omitempty"`
  1170. // Events: Optional. The collection of event names that trigger the
  1171. // intent.
  1172. // If the collection of input contexts is not empty, all of the contexts
  1173. // must
  1174. // be present in the active user session for an event to trigger this
  1175. // intent.
  1176. Events []string `json:"events,omitempty"`
  1177. // FollowupIntentInfo: Optional. Collection of information about all
  1178. // followup intents that have
  1179. // name of this intent as a root_name.
  1180. FollowupIntentInfo []*GoogleCloudDialogflowV2IntentFollowupIntentInfo `json:"followupIntentInfo,omitempty"`
  1181. // InputContextNames: Optional. The list of context names required for
  1182. // this intent to be
  1183. // triggered.
  1184. // Format: `projects/<Project ID>/agent/sessions/-/contexts/<Context
  1185. // ID>`.
  1186. InputContextNames []string `json:"inputContextNames,omitempty"`
  1187. // IsFallback: Optional. Indicates whether this is a fallback intent.
  1188. IsFallback bool `json:"isFallback,omitempty"`
  1189. // Messages: Optional. The collection of rich messages corresponding to
  1190. // the
  1191. // `Response` field in the Dialogflow console.
  1192. Messages []*GoogleCloudDialogflowV2IntentMessage `json:"messages,omitempty"`
  1193. // MlDisabled: Optional. Indicates whether Machine Learning is disabled
  1194. // for the intent.
  1195. // Note: If `ml_diabled` setting is set to true, then this intent is
  1196. // not
  1197. // taken into account during inference in `ML ONLY` match mode.
  1198. // Also,
  1199. // auto-markup in the UI is turned off.
  1200. MlDisabled bool `json:"mlDisabled,omitempty"`
  1201. // Name: Required for all methods except `create` (`create` populates
  1202. // the name
  1203. // automatically.
  1204. // The unique identifier of this intent.
  1205. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  1206. Name string `json:"name,omitempty"`
  1207. // OutputContexts: Optional. The collection of contexts that are
  1208. // activated when the intent
  1209. // is matched. Context messages in this collection should not set
  1210. // the
  1211. // parameters field. Setting the `lifespan_count` to 0 will reset the
  1212. // context
  1213. // when the intent is matched.
  1214. // Format: `projects/<Project ID>/agent/sessions/-/contexts/<Context
  1215. // ID>`.
  1216. OutputContexts []*GoogleCloudDialogflowV2Context `json:"outputContexts,omitempty"`
  1217. // Parameters: Optional. The collection of parameters associated with
  1218. // the intent.
  1219. Parameters []*GoogleCloudDialogflowV2IntentParameter `json:"parameters,omitempty"`
  1220. // ParentFollowupIntentName: The unique identifier of the parent intent
  1221. // in the chain of followup
  1222. // intents.
  1223. // It identifies the parent followup intent.
  1224. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  1225. ParentFollowupIntentName string `json:"parentFollowupIntentName,omitempty"`
  1226. // Priority: Optional. The priority of this intent. Higher numbers
  1227. // represent higher
  1228. // priorities. Zero or negative numbers mean that the intent is
  1229. // disabled.
  1230. Priority int64 `json:"priority,omitempty"`
  1231. // ResetContexts: Optional. Indicates whether to delete all contexts in
  1232. // the current
  1233. // session when this intent is matched.
  1234. ResetContexts bool `json:"resetContexts,omitempty"`
  1235. // RootFollowupIntentName: The unique identifier of the root intent in
  1236. // the chain of followup intents.
  1237. // It identifies the correct followup intents chain for this
  1238. // intent.
  1239. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  1240. RootFollowupIntentName string `json:"rootFollowupIntentName,omitempty"`
  1241. // TrainingPhrases: Optional. The collection of examples/templates that
  1242. // the agent is
  1243. // trained on.
  1244. TrainingPhrases []*GoogleCloudDialogflowV2IntentTrainingPhrase `json:"trainingPhrases,omitempty"`
  1245. // WebhookState: Required. Indicates whether webhooks are enabled for
  1246. // the intent.
  1247. //
  1248. // Possible values:
  1249. // "WEBHOOK_STATE_UNSPECIFIED" - Webhook is disabled in the agent and
  1250. // in the intent.
  1251. // "WEBHOOK_STATE_ENABLED" - Webhook is enabled in the agent and in
  1252. // the intent.
  1253. // "WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING" - Webhook is enabled in
  1254. // the agent and in the intent. Also, each slot
  1255. // filling prompt is forwarded to the webhook.
  1256. WebhookState string `json:"webhookState,omitempty"`
  1257. // ServerResponse contains the HTTP response code and headers from the
  1258. // server.
  1259. googleapi.ServerResponse `json:"-"`
  1260. // ForceSendFields is a list of field names (e.g. "Action") 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. "Action") to include in API
  1268. // requests with the JSON null value. By default, fields with empty
  1269. // values are omitted from API requests. However, any field with an
  1270. // 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 *GoogleCloudDialogflowV2Intent) MarshalJSON() ([]byte, error) {
  1276. type NoMethod GoogleCloudDialogflowV2Intent
  1277. raw := NoMethod(*s)
  1278. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1279. }
  1280. // GoogleCloudDialogflowV2IntentBatch: This message is a wrapper around
  1281. // a collection of intents.
  1282. type GoogleCloudDialogflowV2IntentBatch struct {
  1283. // Intents: A collection of intents.
  1284. Intents []*GoogleCloudDialogflowV2Intent `json:"intents,omitempty"`
  1285. // ForceSendFields is a list of field names (e.g. "Intents") to
  1286. // unconditionally include in API requests. By default, fields with
  1287. // empty values are omitted from API requests. However, any non-pointer,
  1288. // non-interface field appearing in ForceSendFields will be sent to the
  1289. // server regardless of whether the field is empty or not. This may be
  1290. // used to include empty fields in Patch requests.
  1291. ForceSendFields []string `json:"-"`
  1292. // NullFields is a list of field names (e.g. "Intents") to include in
  1293. // API requests with the JSON null value. By default, fields with empty
  1294. // values are omitted from API requests. However, any field with an
  1295. // empty value appearing in NullFields will be sent to the server as
  1296. // null. It is an error if a field in this list has a non-empty value.
  1297. // This may be used to include null fields in Patch requests.
  1298. NullFields []string `json:"-"`
  1299. }
  1300. func (s *GoogleCloudDialogflowV2IntentBatch) MarshalJSON() ([]byte, error) {
  1301. type NoMethod GoogleCloudDialogflowV2IntentBatch
  1302. raw := NoMethod(*s)
  1303. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1304. }
  1305. // GoogleCloudDialogflowV2IntentFollowupIntentInfo: Represents a single
  1306. // followup intent in the chain.
  1307. type GoogleCloudDialogflowV2IntentFollowupIntentInfo struct {
  1308. // FollowupIntentName: The unique identifier of the followup
  1309. // intent.
  1310. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  1311. FollowupIntentName string `json:"followupIntentName,omitempty"`
  1312. // ParentFollowupIntentName: The unique identifier of the followup
  1313. // intent parent.
  1314. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  1315. ParentFollowupIntentName string `json:"parentFollowupIntentName,omitempty"`
  1316. // ForceSendFields is a list of field names (e.g. "FollowupIntentName")
  1317. // to unconditionally include in API requests. By default, fields with
  1318. // empty values are omitted from API requests. However, any non-pointer,
  1319. // non-interface field appearing in ForceSendFields will be sent to the
  1320. // server regardless of whether the field is empty or not. This may be
  1321. // used to include empty fields in Patch requests.
  1322. ForceSendFields []string `json:"-"`
  1323. // NullFields is a list of field names (e.g. "FollowupIntentName") to
  1324. // include in API requests with the JSON null value. By default, fields
  1325. // with empty values are omitted from API requests. However, any field
  1326. // with an empty value appearing in NullFields will be sent to the
  1327. // server as null. It is an error if a field in this list has a
  1328. // non-empty value. This may be used to include null fields in Patch
  1329. // requests.
  1330. NullFields []string `json:"-"`
  1331. }
  1332. func (s *GoogleCloudDialogflowV2IntentFollowupIntentInfo) MarshalJSON() ([]byte, error) {
  1333. type NoMethod GoogleCloudDialogflowV2IntentFollowupIntentInfo
  1334. raw := NoMethod(*s)
  1335. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1336. }
  1337. // GoogleCloudDialogflowV2IntentMessage: Corresponds to the `Response`
  1338. // field in the Dialogflow console.
  1339. type GoogleCloudDialogflowV2IntentMessage struct {
  1340. // BasicCard: The basic card response for Actions on Google.
  1341. BasicCard *GoogleCloudDialogflowV2IntentMessageBasicCard `json:"basicCard,omitempty"`
  1342. // Card: The card response.
  1343. Card *GoogleCloudDialogflowV2IntentMessageCard `json:"card,omitempty"`
  1344. // CarouselSelect: The carousel card response for Actions on Google.
  1345. CarouselSelect *GoogleCloudDialogflowV2IntentMessageCarouselSelect `json:"carouselSelect,omitempty"`
  1346. // Image: The image response.
  1347. Image *GoogleCloudDialogflowV2IntentMessageImage `json:"image,omitempty"`
  1348. // LinkOutSuggestion: The link out suggestion chip for Actions on
  1349. // Google.
  1350. LinkOutSuggestion *GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion `json:"linkOutSuggestion,omitempty"`
  1351. // ListSelect: The list card response for Actions on Google.
  1352. ListSelect *GoogleCloudDialogflowV2IntentMessageListSelect `json:"listSelect,omitempty"`
  1353. // Payload: Returns a response containing a custom, platform-specific
  1354. // payload.
  1355. // See the Intent.Message.Platform type for a description of
  1356. // the
  1357. // structure that may be required for your platform.
  1358. Payload googleapi.RawMessage `json:"payload,omitempty"`
  1359. // Platform: Optional. The platform that this message is intended for.
  1360. //
  1361. // Possible values:
  1362. // "PLATFORM_UNSPECIFIED" - Not specified.
  1363. // "FACEBOOK" - Facebook.
  1364. // "SLACK" - Slack.
  1365. // "TELEGRAM" - Telegram.
  1366. // "KIK" - Kik.
  1367. // "SKYPE" - Skype.
  1368. // "LINE" - Line.
  1369. // "VIBER" - Viber.
  1370. // "ACTIONS_ON_GOOGLE" - Actions on Google.
  1371. // When using Actions on Google, you can choose one of the
  1372. // specific
  1373. // Intent.Message types that mention support for Actions on Google,
  1374. // or you can use the advanced Intent.Message.payload field.
  1375. // The payload field provides access to AoG features not available in
  1376. // the
  1377. // specific message types.
  1378. // If using the Intent.Message.payload field, it should have a
  1379. // structure
  1380. // similar to the JSON message shown here. For more information,
  1381. // see
  1382. // [Actions on Google
  1383. // Webhook
  1384. // Format](https://developers.google.com/actions/dialogflow/webho
  1385. // ok)
  1386. // <pre>{
  1387. // "expectUserResponse": true,
  1388. // "isSsml": false,
  1389. // "noInputPrompts": [],
  1390. // "richResponse": {
  1391. // "items": [
  1392. // {
  1393. // "simpleResponse": {
  1394. // "displayText": "hi",
  1395. // "textToSpeech": "hello"
  1396. // }
  1397. // }
  1398. // ],
  1399. // "suggestions": [
  1400. // {
  1401. // "title": "Say this"
  1402. // },
  1403. // {
  1404. // "title": "or this"
  1405. // }
  1406. // ]
  1407. // },
  1408. // "systemIntent": {
  1409. // "data": {
  1410. // "@type":
  1411. // "type.googleapis.com/google.actions.v2.OptionValueSpec",
  1412. // "listSelect": {
  1413. // "items": [
  1414. // {
  1415. // "optionInfo": {
  1416. // "key": "key1",
  1417. // "synonyms": [
  1418. // "key one"
  1419. // ]
  1420. // },
  1421. // "title": "must not be empty, but unique"
  1422. // },
  1423. // {
  1424. // "optionInfo": {
  1425. // "key": "key2",
  1426. // "synonyms": [
  1427. // "key two"
  1428. // ]
  1429. // },
  1430. // "title": "must not be empty, but unique"
  1431. // }
  1432. // ]
  1433. // }
  1434. // },
  1435. // "intent": "actions.intent.OPTION"
  1436. // }
  1437. // }</pre>
  1438. Platform string `json:"platform,omitempty"`
  1439. // QuickReplies: The quick replies response.
  1440. QuickReplies *GoogleCloudDialogflowV2IntentMessageQuickReplies `json:"quickReplies,omitempty"`
  1441. // SimpleResponses: The voice and text-only responses for Actions on
  1442. // Google.
  1443. SimpleResponses *GoogleCloudDialogflowV2IntentMessageSimpleResponses `json:"simpleResponses,omitempty"`
  1444. // Suggestions: The suggestion chips for Actions on Google.
  1445. Suggestions *GoogleCloudDialogflowV2IntentMessageSuggestions `json:"suggestions,omitempty"`
  1446. // Text: The text response.
  1447. Text *GoogleCloudDialogflowV2IntentMessageText `json:"text,omitempty"`
  1448. // ForceSendFields is a list of field names (e.g. "BasicCard") to
  1449. // unconditionally include in API requests. By default, fields with
  1450. // empty values are omitted from API requests. However, any non-pointer,
  1451. // non-interface field appearing in ForceSendFields will be sent to the
  1452. // server regardless of whether the field is empty or not. This may be
  1453. // used to include empty fields in Patch requests.
  1454. ForceSendFields []string `json:"-"`
  1455. // NullFields is a list of field names (e.g. "BasicCard") to include in
  1456. // API requests with the JSON null value. By default, fields with empty
  1457. // values are omitted from API requests. However, any field with an
  1458. // empty value appearing in NullFields will be sent to the server as
  1459. // null. It is an error if a field in this list has a non-empty value.
  1460. // This may be used to include null fields in Patch requests.
  1461. NullFields []string `json:"-"`
  1462. }
  1463. func (s *GoogleCloudDialogflowV2IntentMessage) MarshalJSON() ([]byte, error) {
  1464. type NoMethod GoogleCloudDialogflowV2IntentMessage
  1465. raw := NoMethod(*s)
  1466. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1467. }
  1468. // GoogleCloudDialogflowV2IntentMessageBasicCard: The basic card
  1469. // message. Useful for displaying information.
  1470. type GoogleCloudDialogflowV2IntentMessageBasicCard struct {
  1471. // Buttons: Optional. The collection of card buttons.
  1472. Buttons []*GoogleCloudDialogflowV2IntentMessageBasicCardButton `json:"buttons,omitempty"`
  1473. // FormattedText: Required, unless image is present. The body text of
  1474. // the card.
  1475. FormattedText string `json:"formattedText,omitempty"`
  1476. // Image: Optional. The image for the card.
  1477. Image *GoogleCloudDialogflowV2IntentMessageImage `json:"image,omitempty"`
  1478. // Subtitle: Optional. The subtitle of the card.
  1479. Subtitle string `json:"subtitle,omitempty"`
  1480. // Title: Optional. The title of the card.
  1481. Title string `json:"title,omitempty"`
  1482. // ForceSendFields is a list of field names (e.g. "Buttons") to
  1483. // unconditionally include in API requests. By default, fields with
  1484. // empty values are omitted from API requests. However, any non-pointer,
  1485. // non-interface field appearing in ForceSendFields will be sent to the
  1486. // server regardless of whether the field is empty or not. This may be
  1487. // used to include empty fields in Patch requests.
  1488. ForceSendFields []string `json:"-"`
  1489. // NullFields is a list of field names (e.g. "Buttons") to include in
  1490. // API requests with the JSON null value. By default, fields with empty
  1491. // values are omitted from API requests. However, any field with an
  1492. // empty value appearing in NullFields will be sent to the server as
  1493. // null. It is an error if a field in this list has a non-empty value.
  1494. // This may be used to include null fields in Patch requests.
  1495. NullFields []string `json:"-"`
  1496. }
  1497. func (s *GoogleCloudDialogflowV2IntentMessageBasicCard) MarshalJSON() ([]byte, error) {
  1498. type NoMethod GoogleCloudDialogflowV2IntentMessageBasicCard
  1499. raw := NoMethod(*s)
  1500. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1501. }
  1502. // GoogleCloudDialogflowV2IntentMessageBasicCardButton: The button
  1503. // object that appears at the bottom of a card.
  1504. type GoogleCloudDialogflowV2IntentMessageBasicCardButton struct {
  1505. // OpenUriAction: Required. Action to take when a user taps on the
  1506. // button.
  1507. OpenUriAction *GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction `json:"openUriAction,omitempty"`
  1508. // Title: Required. The title of the button.
  1509. Title string `json:"title,omitempty"`
  1510. // ForceSendFields is a list of field names (e.g. "OpenUriAction") to
  1511. // unconditionally include in API requests. By default, fields with
  1512. // empty values are omitted from API requests. However, any non-pointer,
  1513. // non-interface field appearing in ForceSendFields will be sent to the
  1514. // server regardless of whether the field is empty or not. This may be
  1515. // used to include empty fields in Patch requests.
  1516. ForceSendFields []string `json:"-"`
  1517. // NullFields is a list of field names (e.g. "OpenUriAction") to include
  1518. // in API requests with the JSON null value. By default, fields with
  1519. // empty values are omitted from API requests. However, any field with
  1520. // an empty value appearing in NullFields will be sent to the server as
  1521. // null. It is an error if a field in this list has a non-empty value.
  1522. // This may be used to include null fields in Patch requests.
  1523. NullFields []string `json:"-"`
  1524. }
  1525. func (s *GoogleCloudDialogflowV2IntentMessageBasicCardButton) MarshalJSON() ([]byte, error) {
  1526. type NoMethod GoogleCloudDialogflowV2IntentMessageBasicCardButton
  1527. raw := NoMethod(*s)
  1528. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1529. }
  1530. // GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction:
  1531. // Opens the given URI.
  1532. type GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction struct {
  1533. // Uri: Required. The HTTP or HTTPS scheme URI.
  1534. Uri string `json:"uri,omitempty"`
  1535. // ForceSendFields is a list of field names (e.g. "Uri") to
  1536. // unconditionally include in API requests. By default, fields with
  1537. // empty values are omitted from API requests. However, any non-pointer,
  1538. // non-interface field appearing in ForceSendFields will be sent to the
  1539. // server regardless of whether the field is empty or not. This may be
  1540. // used to include empty fields in Patch requests.
  1541. ForceSendFields []string `json:"-"`
  1542. // NullFields is a list of field names (e.g. "Uri") to include in API
  1543. // requests with the JSON null value. By default, fields with empty
  1544. // values are omitted from API requests. However, any field with an
  1545. // empty value appearing in NullFields will be sent to the server as
  1546. // null. It is an error if a field in this list has a non-empty value.
  1547. // This may be used to include null fields in Patch requests.
  1548. NullFields []string `json:"-"`
  1549. }
  1550. func (s *GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction) MarshalJSON() ([]byte, error) {
  1551. type NoMethod GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction
  1552. raw := NoMethod(*s)
  1553. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1554. }
  1555. // GoogleCloudDialogflowV2IntentMessageCard: The card response message.
  1556. type GoogleCloudDialogflowV2IntentMessageCard struct {
  1557. // Buttons: Optional. The collection of card buttons.
  1558. Buttons []*GoogleCloudDialogflowV2IntentMessageCardButton `json:"buttons,omitempty"`
  1559. // ImageUri: Optional. The public URI to an image file for the card.
  1560. ImageUri string `json:"imageUri,omitempty"`
  1561. // Subtitle: Optional. The subtitle of the card.
  1562. Subtitle string `json:"subtitle,omitempty"`
  1563. // Title: Optional. The title of the card.
  1564. Title string `json:"title,omitempty"`
  1565. // ForceSendFields is a list of field names (e.g. "Buttons") to
  1566. // unconditionally include in API requests. By default, fields with
  1567. // empty values are omitted from API requests. However, any non-pointer,
  1568. // non-interface field appearing in ForceSendFields will be sent to the
  1569. // server regardless of whether the field is empty or not. This may be
  1570. // used to include empty fields in Patch requests.
  1571. ForceSendFields []string `json:"-"`
  1572. // NullFields is a list of field names (e.g. "Buttons") to include in
  1573. // API requests with the JSON null value. By default, fields with empty
  1574. // values are omitted from API requests. However, any field with an
  1575. // empty value appearing in NullFields will be sent to the server as
  1576. // null. It is an error if a field in this list has a non-empty value.
  1577. // This may be used to include null fields in Patch requests.
  1578. NullFields []string `json:"-"`
  1579. }
  1580. func (s *GoogleCloudDialogflowV2IntentMessageCard) MarshalJSON() ([]byte, error) {
  1581. type NoMethod GoogleCloudDialogflowV2IntentMessageCard
  1582. raw := NoMethod(*s)
  1583. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1584. }
  1585. // GoogleCloudDialogflowV2IntentMessageCardButton: Optional. Contains
  1586. // information about a button.
  1587. type GoogleCloudDialogflowV2IntentMessageCardButton struct {
  1588. // Postback: Optional. The text to send back to the Dialogflow API or a
  1589. // URI to
  1590. // open.
  1591. Postback string `json:"postback,omitempty"`
  1592. // Text: Optional. The text to show on the button.
  1593. Text string `json:"text,omitempty"`
  1594. // ForceSendFields is a list of field names (e.g. "Postback") to
  1595. // unconditionally include in API requests. By default, fields with
  1596. // empty values are omitted from API requests. However, any non-pointer,
  1597. // non-interface field appearing in ForceSendFields will be sent to the
  1598. // server regardless of whether the field is empty or not. This may be
  1599. // used to include empty fields in Patch requests.
  1600. ForceSendFields []string `json:"-"`
  1601. // NullFields is a list of field names (e.g. "Postback") to include in
  1602. // API requests with the JSON null value. By default, fields with empty
  1603. // values are omitted from API requests. However, any field with an
  1604. // empty value appearing in NullFields will be sent to the server as
  1605. // null. It is an error if a field in this list has a non-empty value.
  1606. // This may be used to include null fields in Patch requests.
  1607. NullFields []string `json:"-"`
  1608. }
  1609. func (s *GoogleCloudDialogflowV2IntentMessageCardButton) MarshalJSON() ([]byte, error) {
  1610. type NoMethod GoogleCloudDialogflowV2IntentMessageCardButton
  1611. raw := NoMethod(*s)
  1612. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1613. }
  1614. // GoogleCloudDialogflowV2IntentMessageCarouselSelect: The card for
  1615. // presenting a carousel of options to select from.
  1616. type GoogleCloudDialogflowV2IntentMessageCarouselSelect struct {
  1617. // Items: Required. Carousel items.
  1618. Items []*GoogleCloudDialogflowV2IntentMessageCarouselSelectItem `json:"items,omitempty"`
  1619. // ForceSendFields is a list of field names (e.g. "Items") to
  1620. // unconditionally include in API requests. By default, fields with
  1621. // empty values are omitted from API requests. However, any non-pointer,
  1622. // non-interface field appearing in ForceSendFields will be sent to the
  1623. // server regardless of whether the field is empty or not. This may be
  1624. // used to include empty fields in Patch requests.
  1625. ForceSendFields []string `json:"-"`
  1626. // NullFields is a list of field names (e.g. "Items") to include in API
  1627. // requests with the JSON null value. By default, fields with empty
  1628. // values are omitted from API requests. However, any field with an
  1629. // empty value appearing in NullFields will be sent to the server as
  1630. // null. It is an error if a field in this list has a non-empty value.
  1631. // This may be used to include null fields in Patch requests.
  1632. NullFields []string `json:"-"`
  1633. }
  1634. func (s *GoogleCloudDialogflowV2IntentMessageCarouselSelect) MarshalJSON() ([]byte, error) {
  1635. type NoMethod GoogleCloudDialogflowV2IntentMessageCarouselSelect
  1636. raw := NoMethod(*s)
  1637. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1638. }
  1639. // GoogleCloudDialogflowV2IntentMessageCarouselSelectItem: An item in
  1640. // the carousel.
  1641. type GoogleCloudDialogflowV2IntentMessageCarouselSelectItem struct {
  1642. // Description: Optional. The body text of the card.
  1643. Description string `json:"description,omitempty"`
  1644. // Image: Optional. The image to display.
  1645. Image *GoogleCloudDialogflowV2IntentMessageImage `json:"image,omitempty"`
  1646. // Info: Required. Additional info about the option item.
  1647. Info *GoogleCloudDialogflowV2IntentMessageSelectItemInfo `json:"info,omitempty"`
  1648. // Title: Required. Title of the carousel item.
  1649. Title string `json:"title,omitempty"`
  1650. // ForceSendFields is a list of field names (e.g. "Description") to
  1651. // unconditionally include in API requests. By default, fields with
  1652. // empty values are omitted from API requests. However, any non-pointer,
  1653. // non-interface field appearing in ForceSendFields will be sent to the
  1654. // server regardless of whether the field is empty or not. This may be
  1655. // used to include empty fields in Patch requests.
  1656. ForceSendFields []string `json:"-"`
  1657. // NullFields is a list of field names (e.g. "Description") to include
  1658. // in API requests with the JSON null value. By default, fields with
  1659. // empty values are omitted from API requests. However, any field with
  1660. // an empty value appearing in NullFields will be sent to the server as
  1661. // null. It is an error if a field in this list has a non-empty value.
  1662. // This may be used to include null fields in Patch requests.
  1663. NullFields []string `json:"-"`
  1664. }
  1665. func (s *GoogleCloudDialogflowV2IntentMessageCarouselSelectItem) MarshalJSON() ([]byte, error) {
  1666. type NoMethod GoogleCloudDialogflowV2IntentMessageCarouselSelectItem
  1667. raw := NoMethod(*s)
  1668. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1669. }
  1670. // GoogleCloudDialogflowV2IntentMessageImage: The image response
  1671. // message.
  1672. type GoogleCloudDialogflowV2IntentMessageImage struct {
  1673. // AccessibilityText: Optional. A text description of the image to be
  1674. // used for accessibility,
  1675. // e.g., screen readers.
  1676. AccessibilityText string `json:"accessibilityText,omitempty"`
  1677. // ImageUri: Optional. The public URI to an image file.
  1678. ImageUri string `json:"imageUri,omitempty"`
  1679. // ForceSendFields is a list of field names (e.g. "AccessibilityText")
  1680. // to unconditionally include in API requests. By default, fields with
  1681. // empty values are omitted from API requests. However, any non-pointer,
  1682. // non-interface field appearing in ForceSendFields will be sent to the
  1683. // server regardless of whether the field is empty or not. This may be
  1684. // used to include empty fields in Patch requests.
  1685. ForceSendFields []string `json:"-"`
  1686. // NullFields is a list of field names (e.g. "AccessibilityText") to
  1687. // include in API requests with the JSON null value. By default, fields
  1688. // with empty values are omitted from API requests. However, any field
  1689. // with an empty value appearing in NullFields will be sent to the
  1690. // server as null. It is an error if a field in this list has a
  1691. // non-empty value. This may be used to include null fields in Patch
  1692. // requests.
  1693. NullFields []string `json:"-"`
  1694. }
  1695. func (s *GoogleCloudDialogflowV2IntentMessageImage) MarshalJSON() ([]byte, error) {
  1696. type NoMethod GoogleCloudDialogflowV2IntentMessageImage
  1697. raw := NoMethod(*s)
  1698. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1699. }
  1700. // GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion: The suggestion
  1701. // chip message that allows the user to jump out to the app
  1702. // or website associated with this agent.
  1703. type GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion struct {
  1704. // DestinationName: Required. The name of the app or site this chip is
  1705. // linking to.
  1706. DestinationName string `json:"destinationName,omitempty"`
  1707. // Uri: Required. The URI of the app or site to open when the user taps
  1708. // the
  1709. // suggestion chip.
  1710. Uri string `json:"uri,omitempty"`
  1711. // ForceSendFields is a list of field names (e.g. "DestinationName") to
  1712. // unconditionally include in API requests. By default, fields with
  1713. // empty values are omitted from API requests. However, any non-pointer,
  1714. // non-interface field appearing in ForceSendFields will be sent to the
  1715. // server regardless of whether the field is empty or not. This may be
  1716. // used to include empty fields in Patch requests.
  1717. ForceSendFields []string `json:"-"`
  1718. // NullFields is a list of field names (e.g. "DestinationName") to
  1719. // include in API requests with the JSON null value. By default, fields
  1720. // with empty values are omitted from API requests. However, any field
  1721. // with an empty value appearing in NullFields will be sent to the
  1722. // server as null. It is an error if a field in this list has a
  1723. // non-empty value. This may be used to include null fields in Patch
  1724. // requests.
  1725. NullFields []string `json:"-"`
  1726. }
  1727. func (s *GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion) MarshalJSON() ([]byte, error) {
  1728. type NoMethod GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion
  1729. raw := NoMethod(*s)
  1730. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1731. }
  1732. // GoogleCloudDialogflowV2IntentMessageListSelect: The card for
  1733. // presenting a list of options to select from.
  1734. type GoogleCloudDialogflowV2IntentMessageListSelect struct {
  1735. // Items: Required. List items.
  1736. Items []*GoogleCloudDialogflowV2IntentMessageListSelectItem `json:"items,omitempty"`
  1737. // Title: Optional. The overall title of the list.
  1738. Title string `json:"title,omitempty"`
  1739. // ForceSendFields is a list of field names (e.g. "Items") to
  1740. // unconditionally include in API requests. By default, fields with
  1741. // empty values are omitted from API requests. However, any non-pointer,
  1742. // non-interface field appearing in ForceSendFields will be sent to the
  1743. // server regardless of whether the field is empty or not. This may be
  1744. // used to include empty fields in Patch requests.
  1745. ForceSendFields []string `json:"-"`
  1746. // NullFields is a list of field names (e.g. "Items") to include in API
  1747. // requests with the JSON null value. By default, fields with empty
  1748. // values are omitted from API requests. However, any field with an
  1749. // empty value appearing in NullFields will be sent to the server as
  1750. // null. It is an error if a field in this list has a non-empty value.
  1751. // This may be used to include null fields in Patch requests.
  1752. NullFields []string `json:"-"`
  1753. }
  1754. func (s *GoogleCloudDialogflowV2IntentMessageListSelect) MarshalJSON() ([]byte, error) {
  1755. type NoMethod GoogleCloudDialogflowV2IntentMessageListSelect
  1756. raw := NoMethod(*s)
  1757. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1758. }
  1759. // GoogleCloudDialogflowV2IntentMessageListSelectItem: An item in the
  1760. // list.
  1761. type GoogleCloudDialogflowV2IntentMessageListSelectItem struct {
  1762. // Description: Optional. The main text describing the item.
  1763. Description string `json:"description,omitempty"`
  1764. // Image: Optional. The image to display.
  1765. Image *GoogleCloudDialogflowV2IntentMessageImage `json:"image,omitempty"`
  1766. // Info: Required. Additional information about this option.
  1767. Info *GoogleCloudDialogflowV2IntentMessageSelectItemInfo `json:"info,omitempty"`
  1768. // Title: Required. The title of the list item.
  1769. Title string `json:"title,omitempty"`
  1770. // ForceSendFields is a list of field names (e.g. "Description") to
  1771. // unconditionally include in API requests. By default, fields with
  1772. // empty values are omitted from API requests. However, any non-pointer,
  1773. // non-interface field appearing in ForceSendFields will be sent to the
  1774. // server regardless of whether the field is empty or not. This may be
  1775. // used to include empty fields in Patch requests.
  1776. ForceSendFields []string `json:"-"`
  1777. // NullFields is a list of field names (e.g. "Description") to include
  1778. // in API requests with the JSON null value. By default, fields with
  1779. // empty values are omitted from API requests. However, any field with
  1780. // an empty value appearing in NullFields will be sent to the server as
  1781. // null. It is an error if a field in this list has a non-empty value.
  1782. // This may be used to include null fields in Patch requests.
  1783. NullFields []string `json:"-"`
  1784. }
  1785. func (s *GoogleCloudDialogflowV2IntentMessageListSelectItem) MarshalJSON() ([]byte, error) {
  1786. type NoMethod GoogleCloudDialogflowV2IntentMessageListSelectItem
  1787. raw := NoMethod(*s)
  1788. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1789. }
  1790. // GoogleCloudDialogflowV2IntentMessageQuickReplies: The quick replies
  1791. // response message.
  1792. type GoogleCloudDialogflowV2IntentMessageQuickReplies struct {
  1793. // QuickReplies: Optional. The collection of quick replies.
  1794. QuickReplies []string `json:"quickReplies,omitempty"`
  1795. // Title: Optional. The title of the collection of quick replies.
  1796. Title string `json:"title,omitempty"`
  1797. // ForceSendFields is a list of field names (e.g. "QuickReplies") to
  1798. // unconditionally include in API requests. By default, fields with
  1799. // empty values are omitted from API requests. However, any non-pointer,
  1800. // non-interface field appearing in ForceSendFields will be sent to the
  1801. // server regardless of whether the field is empty or not. This may be
  1802. // used to include empty fields in Patch requests.
  1803. ForceSendFields []string `json:"-"`
  1804. // NullFields is a list of field names (e.g. "QuickReplies") to include
  1805. // in API requests with the JSON null value. By default, fields with
  1806. // empty values are omitted from API requests. However, any field with
  1807. // an empty value appearing in NullFields will be sent to the server as
  1808. // null. It is an error if a field in this list has a non-empty value.
  1809. // This may be used to include null fields in Patch requests.
  1810. NullFields []string `json:"-"`
  1811. }
  1812. func (s *GoogleCloudDialogflowV2IntentMessageQuickReplies) MarshalJSON() ([]byte, error) {
  1813. type NoMethod GoogleCloudDialogflowV2IntentMessageQuickReplies
  1814. raw := NoMethod(*s)
  1815. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1816. }
  1817. // GoogleCloudDialogflowV2IntentMessageSelectItemInfo: Additional info
  1818. // about the select item for when it is triggered in a
  1819. // dialog.
  1820. type GoogleCloudDialogflowV2IntentMessageSelectItemInfo struct {
  1821. // Key: Required. A unique key that will be sent back to the agent if
  1822. // this
  1823. // response is given.
  1824. Key string `json:"key,omitempty"`
  1825. // Synonyms: Optional. A list of synonyms that can also be used to
  1826. // trigger this
  1827. // item in dialog.
  1828. Synonyms []string `json:"synonyms,omitempty"`
  1829. // ForceSendFields is a list of field names (e.g. "Key") to
  1830. // unconditionally include in API requests. By default, fields with
  1831. // empty values are omitted from API requests. However, any non-pointer,
  1832. // non-interface field appearing in ForceSendFields will be sent to the
  1833. // server regardless of whether the field is empty or not. This may be
  1834. // used to include empty fields in Patch requests.
  1835. ForceSendFields []string `json:"-"`
  1836. // NullFields is a list of field names (e.g. "Key") to include in API
  1837. // requests with the JSON null value. By default, fields with empty
  1838. // values are omitted from API requests. However, any field with an
  1839. // empty value appearing in NullFields will be sent to the server as
  1840. // null. It is an error if a field in this list has a non-empty value.
  1841. // This may be used to include null fields in Patch requests.
  1842. NullFields []string `json:"-"`
  1843. }
  1844. func (s *GoogleCloudDialogflowV2IntentMessageSelectItemInfo) MarshalJSON() ([]byte, error) {
  1845. type NoMethod GoogleCloudDialogflowV2IntentMessageSelectItemInfo
  1846. raw := NoMethod(*s)
  1847. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1848. }
  1849. // GoogleCloudDialogflowV2IntentMessageSimpleResponse: The simple
  1850. // response message containing speech or text.
  1851. type GoogleCloudDialogflowV2IntentMessageSimpleResponse struct {
  1852. // DisplayText: Optional. The text to display.
  1853. DisplayText string `json:"displayText,omitempty"`
  1854. // Ssml: One of text_to_speech or ssml must be provided. Structured
  1855. // spoken
  1856. // response to the user in the SSML format. Mutually exclusive
  1857. // with
  1858. // text_to_speech.
  1859. Ssml string `json:"ssml,omitempty"`
  1860. // TextToSpeech: One of text_to_speech or ssml must be provided. The
  1861. // plain text of the
  1862. // speech output. Mutually exclusive with ssml.
  1863. TextToSpeech string `json:"textToSpeech,omitempty"`
  1864. // ForceSendFields is a list of field names (e.g. "DisplayText") to
  1865. // unconditionally include in API requests. By default, fields with
  1866. // empty values are omitted from API requests. However, any non-pointer,
  1867. // non-interface field appearing in ForceSendFields will be sent to the
  1868. // server regardless of whether the field is empty or not. This may be
  1869. // used to include empty fields in Patch requests.
  1870. ForceSendFields []string `json:"-"`
  1871. // NullFields is a list of field names (e.g. "DisplayText") to include
  1872. // in API requests with the JSON null value. By default, fields with
  1873. // empty values are omitted from API requests. However, any field with
  1874. // an empty value appearing in NullFields will be sent to the server as
  1875. // null. It is an error if a field in this list has a non-empty value.
  1876. // This may be used to include null fields in Patch requests.
  1877. NullFields []string `json:"-"`
  1878. }
  1879. func (s *GoogleCloudDialogflowV2IntentMessageSimpleResponse) MarshalJSON() ([]byte, error) {
  1880. type NoMethod GoogleCloudDialogflowV2IntentMessageSimpleResponse
  1881. raw := NoMethod(*s)
  1882. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1883. }
  1884. // GoogleCloudDialogflowV2IntentMessageSimpleResponses: The collection
  1885. // of simple response candidates.
  1886. // This message in `QueryResult.fulfillment_messages`
  1887. // and
  1888. // `WebhookResponse.fulfillment_messages` should contain only
  1889. // one
  1890. // `SimpleResponse`.
  1891. type GoogleCloudDialogflowV2IntentMessageSimpleResponses struct {
  1892. // SimpleResponses: Required. The list of simple responses.
  1893. SimpleResponses []*GoogleCloudDialogflowV2IntentMessageSimpleResponse `json:"simpleResponses,omitempty"`
  1894. // ForceSendFields is a list of field names (e.g. "SimpleResponses") to
  1895. // unconditionally include in API requests. By default, fields with
  1896. // empty values are omitted from API requests. However, any non-pointer,
  1897. // non-interface field appearing in ForceSendFields will be sent to the
  1898. // server regardless of whether the field is empty or not. This may be
  1899. // used to include empty fields in Patch requests.
  1900. ForceSendFields []string `json:"-"`
  1901. // NullFields is a list of field names (e.g. "SimpleResponses") to
  1902. // include in API requests with the JSON null value. By default, fields
  1903. // with empty values are omitted from API requests. However, any field
  1904. // with an empty value appearing in NullFields will be sent to the
  1905. // server as null. It is an error if a field in this list has a
  1906. // non-empty value. This may be used to include null fields in Patch
  1907. // requests.
  1908. NullFields []string `json:"-"`
  1909. }
  1910. func (s *GoogleCloudDialogflowV2IntentMessageSimpleResponses) MarshalJSON() ([]byte, error) {
  1911. type NoMethod GoogleCloudDialogflowV2IntentMessageSimpleResponses
  1912. raw := NoMethod(*s)
  1913. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1914. }
  1915. // GoogleCloudDialogflowV2IntentMessageSuggestion: The suggestion chip
  1916. // message that the user can tap to quickly post a reply
  1917. // to the conversation.
  1918. type GoogleCloudDialogflowV2IntentMessageSuggestion struct {
  1919. // Title: Required. The text shown the in the suggestion chip.
  1920. Title string `json:"title,omitempty"`
  1921. // ForceSendFields is a list of field names (e.g. "Title") to
  1922. // unconditionally include in API requests. By default, fields with
  1923. // empty values are omitted from API requests. However, any non-pointer,
  1924. // non-interface field appearing in ForceSendFields will be sent to the
  1925. // server regardless of whether the field is empty or not. This may be
  1926. // used to include empty fields in Patch requests.
  1927. ForceSendFields []string `json:"-"`
  1928. // NullFields is a list of field names (e.g. "Title") to include in API
  1929. // requests with the JSON null value. By default, fields with empty
  1930. // values are omitted from API requests. However, any field with an
  1931. // empty value appearing in NullFields will be sent to the server as
  1932. // null. It is an error if a field in this list has a non-empty value.
  1933. // This may be used to include null fields in Patch requests.
  1934. NullFields []string `json:"-"`
  1935. }
  1936. func (s *GoogleCloudDialogflowV2IntentMessageSuggestion) MarshalJSON() ([]byte, error) {
  1937. type NoMethod GoogleCloudDialogflowV2IntentMessageSuggestion
  1938. raw := NoMethod(*s)
  1939. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1940. }
  1941. // GoogleCloudDialogflowV2IntentMessageSuggestions: The collection of
  1942. // suggestions.
  1943. type GoogleCloudDialogflowV2IntentMessageSuggestions struct {
  1944. // Suggestions: Required. The list of suggested replies.
  1945. Suggestions []*GoogleCloudDialogflowV2IntentMessageSuggestion `json:"suggestions,omitempty"`
  1946. // ForceSendFields is a list of field names (e.g. "Suggestions") to
  1947. // unconditionally include in API requests. By default, fields with
  1948. // empty values are omitted from API requests. However, any non-pointer,
  1949. // non-interface field appearing in ForceSendFields will be sent to the
  1950. // server regardless of whether the field is empty or not. This may be
  1951. // used to include empty fields in Patch requests.
  1952. ForceSendFields []string `json:"-"`
  1953. // NullFields is a list of field names (e.g. "Suggestions") to include
  1954. // in API requests with the JSON null value. By default, fields with
  1955. // empty values are omitted from API requests. However, any field with
  1956. // an empty value appearing in NullFields will be sent to the server as
  1957. // null. It is an error if a field in this list has a non-empty value.
  1958. // This may be used to include null fields in Patch requests.
  1959. NullFields []string `json:"-"`
  1960. }
  1961. func (s *GoogleCloudDialogflowV2IntentMessageSuggestions) MarshalJSON() ([]byte, error) {
  1962. type NoMethod GoogleCloudDialogflowV2IntentMessageSuggestions
  1963. raw := NoMethod(*s)
  1964. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1965. }
  1966. // GoogleCloudDialogflowV2IntentMessageText: The text response message.
  1967. type GoogleCloudDialogflowV2IntentMessageText struct {
  1968. // Text: Optional. The collection of the agent's responses.
  1969. Text []string `json:"text,omitempty"`
  1970. // ForceSendFields is a list of field names (e.g. "Text") to
  1971. // unconditionally include in API requests. By default, fields with
  1972. // empty values are omitted from API requests. However, any non-pointer,
  1973. // non-interface field appearing in ForceSendFields will be sent to the
  1974. // server regardless of whether the field is empty or not. This may be
  1975. // used to include empty fields in Patch requests.
  1976. ForceSendFields []string `json:"-"`
  1977. // NullFields is a list of field names (e.g. "Text") to include in API
  1978. // requests with the JSON null value. By default, fields with empty
  1979. // values are omitted from API requests. However, any field with an
  1980. // empty value appearing in NullFields will be sent to the server as
  1981. // null. It is an error if a field in this list has a non-empty value.
  1982. // This may be used to include null fields in Patch requests.
  1983. NullFields []string `json:"-"`
  1984. }
  1985. func (s *GoogleCloudDialogflowV2IntentMessageText) MarshalJSON() ([]byte, error) {
  1986. type NoMethod GoogleCloudDialogflowV2IntentMessageText
  1987. raw := NoMethod(*s)
  1988. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1989. }
  1990. // GoogleCloudDialogflowV2IntentParameter: Represents intent parameters.
  1991. type GoogleCloudDialogflowV2IntentParameter struct {
  1992. // DefaultValue: Optional. The default value to use when the `value`
  1993. // yields an empty
  1994. // result.
  1995. // Default values can be extracted from contexts by using the
  1996. // following
  1997. // syntax: `#context_name.parameter_name`.
  1998. DefaultValue string `json:"defaultValue,omitempty"`
  1999. // DisplayName: Required. The name of the parameter.
  2000. DisplayName string `json:"displayName,omitempty"`
  2001. // EntityTypeDisplayName: Optional. The name of the entity type,
  2002. // prefixed with `@`, that
  2003. // describes values of the parameter. If the parameter is
  2004. // required, this must be provided.
  2005. EntityTypeDisplayName string `json:"entityTypeDisplayName,omitempty"`
  2006. // IsList: Optional. Indicates whether the parameter represents a list
  2007. // of values.
  2008. IsList bool `json:"isList,omitempty"`
  2009. // Mandatory: Optional. Indicates whether the parameter is required.
  2010. // That is,
  2011. // whether the intent cannot be completed without collecting the
  2012. // parameter
  2013. // value.
  2014. Mandatory bool `json:"mandatory,omitempty"`
  2015. // Name: The unique identifier of this parameter.
  2016. Name string `json:"name,omitempty"`
  2017. // Prompts: Optional. The collection of prompts that the agent can
  2018. // present to the
  2019. // user in order to collect value for the parameter.
  2020. Prompts []string `json:"prompts,omitempty"`
  2021. // Value: Optional. The definition of the parameter value. It can be:
  2022. // - a constant string,
  2023. // - a parameter value defined as `$parameter_name`,
  2024. // - an original parameter value defined as
  2025. // `$parameter_name.original`,
  2026. // - a parameter value from some context defined as
  2027. // `#context_name.parameter_name`.
  2028. Value string `json:"value,omitempty"`
  2029. // ForceSendFields is a list of field names (e.g. "DefaultValue") to
  2030. // unconditionally include in API requests. By default, fields with
  2031. // empty values are omitted from API requests. However, any non-pointer,
  2032. // non-interface field appearing in ForceSendFields will be sent to the
  2033. // server regardless of whether the field is empty or not. This may be
  2034. // used to include empty fields in Patch requests.
  2035. ForceSendFields []string `json:"-"`
  2036. // NullFields is a list of field names (e.g. "DefaultValue") to include
  2037. // in API requests with the JSON null value. By default, fields with
  2038. // empty values are omitted from API requests. However, any field with
  2039. // an empty value appearing in NullFields will be sent to the server as
  2040. // null. It is an error if a field in this list has a non-empty value.
  2041. // This may be used to include null fields in Patch requests.
  2042. NullFields []string `json:"-"`
  2043. }
  2044. func (s *GoogleCloudDialogflowV2IntentParameter) MarshalJSON() ([]byte, error) {
  2045. type NoMethod GoogleCloudDialogflowV2IntentParameter
  2046. raw := NoMethod(*s)
  2047. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2048. }
  2049. // GoogleCloudDialogflowV2IntentTrainingPhrase: Represents an example or
  2050. // template that the agent is trained on.
  2051. type GoogleCloudDialogflowV2IntentTrainingPhrase struct {
  2052. // Name: Required. The unique identifier of this training phrase.
  2053. Name string `json:"name,omitempty"`
  2054. // Parts: Required. The collection of training phrase parts (can be
  2055. // annotated).
  2056. // Fields: `entity_type`, `alias` and `user_defined` should be
  2057. // populated
  2058. // only for the annotated parts of the training phrase.
  2059. Parts []*GoogleCloudDialogflowV2IntentTrainingPhrasePart `json:"parts,omitempty"`
  2060. // TimesAddedCount: Optional. Indicates how many times this example or
  2061. // template was added to
  2062. // the intent. Each time a developer adds an existing sample by editing
  2063. // an
  2064. // intent or training, this counter is increased.
  2065. TimesAddedCount int64 `json:"timesAddedCount,omitempty"`
  2066. // Type: Required. The type of the training phrase.
  2067. //
  2068. // Possible values:
  2069. // "TYPE_UNSPECIFIED" - Not specified. This value should never be
  2070. // used.
  2071. // "EXAMPLE" - Examples do not contain @-prefixed entity type names,
  2072. // but example parts
  2073. // can be annotated with entity types.
  2074. // "TEMPLATE" - Templates are not annotated with entity types, but
  2075. // they can contain
  2076. // @-prefixed entity type names as substrings.
  2077. Type string `json:"type,omitempty"`
  2078. // ForceSendFields is a list of field names (e.g. "Name") to
  2079. // unconditionally include in API requests. By default, fields with
  2080. // empty values are omitted from API requests. However, any non-pointer,
  2081. // non-interface field appearing in ForceSendFields will be sent to the
  2082. // server regardless of whether the field is empty or not. This may be
  2083. // used to include empty fields in Patch requests.
  2084. ForceSendFields []string `json:"-"`
  2085. // NullFields is a list of field names (e.g. "Name") to include in API
  2086. // requests with the JSON null value. By default, fields with empty
  2087. // values are omitted from API requests. However, any field with an
  2088. // empty value appearing in NullFields will be sent to the server as
  2089. // null. It is an error if a field in this list has a non-empty value.
  2090. // This may be used to include null fields in Patch requests.
  2091. NullFields []string `json:"-"`
  2092. }
  2093. func (s *GoogleCloudDialogflowV2IntentTrainingPhrase) MarshalJSON() ([]byte, error) {
  2094. type NoMethod GoogleCloudDialogflowV2IntentTrainingPhrase
  2095. raw := NoMethod(*s)
  2096. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2097. }
  2098. // GoogleCloudDialogflowV2IntentTrainingPhrasePart: Represents a part of
  2099. // a training phrase.
  2100. type GoogleCloudDialogflowV2IntentTrainingPhrasePart struct {
  2101. // Alias: Optional. The parameter name for the value extracted from
  2102. // the
  2103. // annotated part of the example.
  2104. Alias string `json:"alias,omitempty"`
  2105. // EntityType: Optional. The entity type name prefixed with `@`. This
  2106. // field is
  2107. // required for the annotated part of the text and applies only
  2108. // to
  2109. // examples.
  2110. EntityType string `json:"entityType,omitempty"`
  2111. // Text: Required. The text corresponding to the example or template,
  2112. // if there are no annotations. For
  2113. // annotated examples, it is the text for one of the example's parts.
  2114. Text string `json:"text,omitempty"`
  2115. // UserDefined: Optional. Indicates whether the text was manually
  2116. // annotated by the
  2117. // developer.
  2118. UserDefined bool `json:"userDefined,omitempty"`
  2119. // ForceSendFields is a list of field names (e.g. "Alias") to
  2120. // unconditionally include in API requests. By default, fields with
  2121. // empty values are omitted from API requests. However, any non-pointer,
  2122. // non-interface field appearing in ForceSendFields will be sent to the
  2123. // server regardless of whether the field is empty or not. This may be
  2124. // used to include empty fields in Patch requests.
  2125. ForceSendFields []string `json:"-"`
  2126. // NullFields is a list of field names (e.g. "Alias") to include in API
  2127. // requests with the JSON null value. By default, fields with empty
  2128. // values are omitted from API requests. However, any field with an
  2129. // empty value appearing in NullFields will be sent to the server as
  2130. // null. It is an error if a field in this list has a non-empty value.
  2131. // This may be used to include null fields in Patch requests.
  2132. NullFields []string `json:"-"`
  2133. }
  2134. func (s *GoogleCloudDialogflowV2IntentTrainingPhrasePart) MarshalJSON() ([]byte, error) {
  2135. type NoMethod GoogleCloudDialogflowV2IntentTrainingPhrasePart
  2136. raw := NoMethod(*s)
  2137. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2138. }
  2139. // GoogleCloudDialogflowV2ListContextsResponse: The response message for
  2140. // Contexts.ListContexts.
  2141. type GoogleCloudDialogflowV2ListContextsResponse struct {
  2142. // Contexts: The list of contexts. There will be a maximum number of
  2143. // items
  2144. // returned based on the page_size field in the request.
  2145. Contexts []*GoogleCloudDialogflowV2Context `json:"contexts,omitempty"`
  2146. // NextPageToken: Token to retrieve the next page of results, or empty
  2147. // if there are no
  2148. // more results in the list.
  2149. NextPageToken string `json:"nextPageToken,omitempty"`
  2150. // ServerResponse contains the HTTP response code and headers from the
  2151. // server.
  2152. googleapi.ServerResponse `json:"-"`
  2153. // ForceSendFields is a list of field names (e.g. "Contexts") to
  2154. // unconditionally include in API requests. By default, fields with
  2155. // empty values are omitted from API requests. However, any non-pointer,
  2156. // non-interface field appearing in ForceSendFields will be sent to the
  2157. // server regardless of whether the field is empty or not. This may be
  2158. // used to include empty fields in Patch requests.
  2159. ForceSendFields []string `json:"-"`
  2160. // NullFields is a list of field names (e.g. "Contexts") to include in
  2161. // API requests with the JSON null value. By default, fields with empty
  2162. // values are omitted from API requests. However, any field with an
  2163. // empty value appearing in NullFields will be sent to the server as
  2164. // null. It is an error if a field in this list has a non-empty value.
  2165. // This may be used to include null fields in Patch requests.
  2166. NullFields []string `json:"-"`
  2167. }
  2168. func (s *GoogleCloudDialogflowV2ListContextsResponse) MarshalJSON() ([]byte, error) {
  2169. type NoMethod GoogleCloudDialogflowV2ListContextsResponse
  2170. raw := NoMethod(*s)
  2171. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2172. }
  2173. // GoogleCloudDialogflowV2ListEntityTypesResponse: The response message
  2174. // for EntityTypes.ListEntityTypes.
  2175. type GoogleCloudDialogflowV2ListEntityTypesResponse struct {
  2176. // EntityTypes: The list of agent entity types. There will be a maximum
  2177. // number of items
  2178. // returned based on the page_size field in the request.
  2179. EntityTypes []*GoogleCloudDialogflowV2EntityType `json:"entityTypes,omitempty"`
  2180. // NextPageToken: Token to retrieve the next page of results, or empty
  2181. // if there are no
  2182. // more results in the list.
  2183. NextPageToken string `json:"nextPageToken,omitempty"`
  2184. // ServerResponse contains the HTTP response code and headers from the
  2185. // server.
  2186. googleapi.ServerResponse `json:"-"`
  2187. // ForceSendFields is a list of field names (e.g. "EntityTypes") to
  2188. // unconditionally include in API requests. By default, fields with
  2189. // empty values are omitted from API requests. However, any non-pointer,
  2190. // non-interface field appearing in ForceSendFields will be sent to the
  2191. // server regardless of whether the field is empty or not. This may be
  2192. // used to include empty fields in Patch requests.
  2193. ForceSendFields []string `json:"-"`
  2194. // NullFields is a list of field names (e.g. "EntityTypes") to include
  2195. // in API requests with the JSON null value. By default, fields with
  2196. // empty values are omitted from API requests. However, any field with
  2197. // an empty value appearing in NullFields will be sent to the server as
  2198. // null. It is an error if a field in this list has a non-empty value.
  2199. // This may be used to include null fields in Patch requests.
  2200. NullFields []string `json:"-"`
  2201. }
  2202. func (s *GoogleCloudDialogflowV2ListEntityTypesResponse) MarshalJSON() ([]byte, error) {
  2203. type NoMethod GoogleCloudDialogflowV2ListEntityTypesResponse
  2204. raw := NoMethod(*s)
  2205. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2206. }
  2207. // GoogleCloudDialogflowV2ListIntentsResponse: The response message for
  2208. // Intents.ListIntents.
  2209. type GoogleCloudDialogflowV2ListIntentsResponse struct {
  2210. // Intents: The list of agent intents. There will be a maximum number of
  2211. // items
  2212. // returned based on the page_size field in the request.
  2213. Intents []*GoogleCloudDialogflowV2Intent `json:"intents,omitempty"`
  2214. // NextPageToken: Token to retrieve the next page of results, or empty
  2215. // if there are no
  2216. // more results in the list.
  2217. NextPageToken string `json:"nextPageToken,omitempty"`
  2218. // ServerResponse contains the HTTP response code and headers from the
  2219. // server.
  2220. googleapi.ServerResponse `json:"-"`
  2221. // ForceSendFields is a list of field names (e.g. "Intents") to
  2222. // unconditionally include in API requests. By default, fields with
  2223. // empty values are omitted from API requests. However, any non-pointer,
  2224. // non-interface field appearing in ForceSendFields will be sent to the
  2225. // server regardless of whether the field is empty or not. This may be
  2226. // used to include empty fields in Patch requests.
  2227. ForceSendFields []string `json:"-"`
  2228. // NullFields is a list of field names (e.g. "Intents") to include in
  2229. // API requests with the JSON null value. By default, fields with empty
  2230. // values are omitted from API requests. However, any field with an
  2231. // empty value appearing in NullFields will be sent to the server as
  2232. // null. It is an error if a field in this list has a non-empty value.
  2233. // This may be used to include null fields in Patch requests.
  2234. NullFields []string `json:"-"`
  2235. }
  2236. func (s *GoogleCloudDialogflowV2ListIntentsResponse) MarshalJSON() ([]byte, error) {
  2237. type NoMethod GoogleCloudDialogflowV2ListIntentsResponse
  2238. raw := NoMethod(*s)
  2239. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2240. }
  2241. // GoogleCloudDialogflowV2ListSessionEntityTypesResponse: The response
  2242. // message for SessionEntityTypes.ListSessionEntityTypes.
  2243. type GoogleCloudDialogflowV2ListSessionEntityTypesResponse struct {
  2244. // NextPageToken: Token to retrieve the next page of results, or empty
  2245. // if there are no
  2246. // more results in the list.
  2247. NextPageToken string `json:"nextPageToken,omitempty"`
  2248. // SessionEntityTypes: The list of session entity types. There will be a
  2249. // maximum number of items
  2250. // returned based on the page_size field in the request.
  2251. SessionEntityTypes []*GoogleCloudDialogflowV2SessionEntityType `json:"sessionEntityTypes,omitempty"`
  2252. // ServerResponse contains the HTTP response code and headers from the
  2253. // server.
  2254. googleapi.ServerResponse `json:"-"`
  2255. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  2256. // unconditionally include in API requests. By default, fields with
  2257. // empty values are omitted from API requests. However, any non-pointer,
  2258. // non-interface field appearing in ForceSendFields will be sent to the
  2259. // server regardless of whether the field is empty or not. This may be
  2260. // used to include empty fields in Patch requests.
  2261. ForceSendFields []string `json:"-"`
  2262. // NullFields is a list of field names (e.g. "NextPageToken") to include
  2263. // in API requests with the JSON null value. By default, fields with
  2264. // empty values are omitted from API requests. However, any field with
  2265. // an empty value appearing in NullFields will be sent to the server as
  2266. // null. It is an error if a field in this list has a non-empty value.
  2267. // This may be used to include null fields in Patch requests.
  2268. NullFields []string `json:"-"`
  2269. }
  2270. func (s *GoogleCloudDialogflowV2ListSessionEntityTypesResponse) MarshalJSON() ([]byte, error) {
  2271. type NoMethod GoogleCloudDialogflowV2ListSessionEntityTypesResponse
  2272. raw := NoMethod(*s)
  2273. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2274. }
  2275. // GoogleCloudDialogflowV2OriginalDetectIntentRequest: Represents the
  2276. // contents of the original request that was passed to
  2277. // the `[Streaming]DetectIntent` call.
  2278. type GoogleCloudDialogflowV2OriginalDetectIntentRequest struct {
  2279. // Payload: Optional. This field is set to the value of
  2280. // `QueryParameters.payload` field
  2281. // passed in the request.
  2282. Payload googleapi.RawMessage `json:"payload,omitempty"`
  2283. // Source: The source of this request, e.g., `google`, `facebook`,
  2284. // `slack`. It is set
  2285. // by Dialogflow-owned servers.
  2286. Source string `json:"source,omitempty"`
  2287. // ForceSendFields is a list of field names (e.g. "Payload") to
  2288. // unconditionally include in API requests. By default, fields with
  2289. // empty values are omitted from API requests. However, any non-pointer,
  2290. // non-interface field appearing in ForceSendFields will be sent to the
  2291. // server regardless of whether the field is empty or not. This may be
  2292. // used to include empty fields in Patch requests.
  2293. ForceSendFields []string `json:"-"`
  2294. // NullFields is a list of field names (e.g. "Payload") to include in
  2295. // API requests with the JSON null value. By default, fields with empty
  2296. // values are omitted from API requests. However, any field with an
  2297. // empty value appearing in NullFields will be sent to the server as
  2298. // null. It is an error if a field in this list has a non-empty value.
  2299. // This may be used to include null fields in Patch requests.
  2300. NullFields []string `json:"-"`
  2301. }
  2302. func (s *GoogleCloudDialogflowV2OriginalDetectIntentRequest) MarshalJSON() ([]byte, error) {
  2303. type NoMethod GoogleCloudDialogflowV2OriginalDetectIntentRequest
  2304. raw := NoMethod(*s)
  2305. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2306. }
  2307. // GoogleCloudDialogflowV2QueryInput: Represents the query input. It can
  2308. // contain either:
  2309. //
  2310. // 1. An audio config which
  2311. // instructs the speech recognizer how to process the speech
  2312. // audio.
  2313. //
  2314. // 2. A conversational query in the form of text,.
  2315. //
  2316. // 3. An event that specifies which intent to trigger.
  2317. type GoogleCloudDialogflowV2QueryInput struct {
  2318. // AudioConfig: Instructs the speech recognizer how to process the
  2319. // speech audio.
  2320. AudioConfig *GoogleCloudDialogflowV2InputAudioConfig `json:"audioConfig,omitempty"`
  2321. // Event: The event to be processed.
  2322. Event *GoogleCloudDialogflowV2EventInput `json:"event,omitempty"`
  2323. // Text: The natural language text to be processed.
  2324. Text *GoogleCloudDialogflowV2TextInput `json:"text,omitempty"`
  2325. // ForceSendFields is a list of field names (e.g. "AudioConfig") to
  2326. // unconditionally include in API requests. By default, fields with
  2327. // empty values are omitted from API requests. However, any non-pointer,
  2328. // non-interface field appearing in ForceSendFields will be sent to the
  2329. // server regardless of whether the field is empty or not. This may be
  2330. // used to include empty fields in Patch requests.
  2331. ForceSendFields []string `json:"-"`
  2332. // NullFields is a list of field names (e.g. "AudioConfig") to include
  2333. // in API requests with the JSON null value. By default, fields with
  2334. // empty values are omitted from API requests. However, any field with
  2335. // an empty value appearing in NullFields will be sent to the server as
  2336. // null. It is an error if a field in this list has a non-empty value.
  2337. // This may be used to include null fields in Patch requests.
  2338. NullFields []string `json:"-"`
  2339. }
  2340. func (s *GoogleCloudDialogflowV2QueryInput) MarshalJSON() ([]byte, error) {
  2341. type NoMethod GoogleCloudDialogflowV2QueryInput
  2342. raw := NoMethod(*s)
  2343. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2344. }
  2345. // GoogleCloudDialogflowV2QueryParameters: Represents the parameters of
  2346. // the conversational query.
  2347. type GoogleCloudDialogflowV2QueryParameters struct {
  2348. // Contexts: Optional. The collection of contexts to be activated before
  2349. // this query is
  2350. // executed.
  2351. Contexts []*GoogleCloudDialogflowV2Context `json:"contexts,omitempty"`
  2352. // GeoLocation: Optional. The geo location of this conversational query.
  2353. GeoLocation *GoogleTypeLatLng `json:"geoLocation,omitempty"`
  2354. // Payload: Optional. This field can be used to pass custom data into
  2355. // the webhook
  2356. // associated with the agent. Arbitrary JSON objects are supported.
  2357. Payload googleapi.RawMessage `json:"payload,omitempty"`
  2358. // ResetContexts: Optional. Specifies whether to delete all contexts in
  2359. // the current session
  2360. // before the new ones are activated.
  2361. ResetContexts bool `json:"resetContexts,omitempty"`
  2362. // SessionEntityTypes: Optional. The collection of session entity types
  2363. // to replace or extend
  2364. // developer entities with for this query only. The entity synonyms
  2365. // apply
  2366. // to all languages.
  2367. SessionEntityTypes []*GoogleCloudDialogflowV2SessionEntityType `json:"sessionEntityTypes,omitempty"`
  2368. // TimeZone: Optional. The time zone of this conversational query from
  2369. // the
  2370. // [time zone database](https://www.iana.org/time-zones),
  2371. // e.g.,
  2372. // America/New_York, Europe/Paris. If not provided, the time zone
  2373. // specified in
  2374. // agent settings is used.
  2375. TimeZone string `json:"timeZone,omitempty"`
  2376. // ForceSendFields is a list of field names (e.g. "Contexts") to
  2377. // unconditionally include in API requests. By default, fields with
  2378. // empty values are omitted from API requests. However, any non-pointer,
  2379. // non-interface field appearing in ForceSendFields will be sent to the
  2380. // server regardless of whether the field is empty or not. This may be
  2381. // used to include empty fields in Patch requests.
  2382. ForceSendFields []string `json:"-"`
  2383. // NullFields is a list of field names (e.g. "Contexts") to include in
  2384. // API requests with the JSON null value. By default, fields with empty
  2385. // values are omitted from API requests. However, any field with an
  2386. // empty value appearing in NullFields will be sent to the server as
  2387. // null. It is an error if a field in this list has a non-empty value.
  2388. // This may be used to include null fields in Patch requests.
  2389. NullFields []string `json:"-"`
  2390. }
  2391. func (s *GoogleCloudDialogflowV2QueryParameters) MarshalJSON() ([]byte, error) {
  2392. type NoMethod GoogleCloudDialogflowV2QueryParameters
  2393. raw := NoMethod(*s)
  2394. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2395. }
  2396. // GoogleCloudDialogflowV2QueryResult: Represents the result of
  2397. // conversational query or event processing.
  2398. type GoogleCloudDialogflowV2QueryResult struct {
  2399. // Action: The action name from the matched intent.
  2400. Action string `json:"action,omitempty"`
  2401. // AllRequiredParamsPresent: This field is set to:
  2402. // - `false` if the matched intent has required parameters and not all
  2403. // of
  2404. // the required parameter values have been collected.
  2405. // - `true` if all required parameter values have been collected, or if
  2406. // the
  2407. // matched intent doesn't contain any required parameters.
  2408. AllRequiredParamsPresent bool `json:"allRequiredParamsPresent,omitempty"`
  2409. // DiagnosticInfo: The free-form diagnostic info. For example, this
  2410. // field
  2411. // could contain webhook call latency.
  2412. DiagnosticInfo googleapi.RawMessage `json:"diagnosticInfo,omitempty"`
  2413. // FulfillmentMessages: The collection of rich messages to present to
  2414. // the user.
  2415. FulfillmentMessages []*GoogleCloudDialogflowV2IntentMessage `json:"fulfillmentMessages,omitempty"`
  2416. // FulfillmentText: The text to be pronounced to the user or shown on
  2417. // the screen.
  2418. FulfillmentText string `json:"fulfillmentText,omitempty"`
  2419. // Intent: The intent that matched the conversational query. Some,
  2420. // not
  2421. // all fields are filled in this message, including but not limited
  2422. // to:
  2423. // `name`, `display_name` and `webhook_state`.
  2424. Intent *GoogleCloudDialogflowV2Intent `json:"intent,omitempty"`
  2425. // IntentDetectionConfidence: The intent detection confidence. Values
  2426. // range from 0.0
  2427. // (completely uncertain) to 1.0 (completely certain).
  2428. IntentDetectionConfidence float64 `json:"intentDetectionConfidence,omitempty"`
  2429. // LanguageCode: The language that was triggered during intent
  2430. // detection.
  2431. // See [Language
  2432. // Support](https://dialogflow.com/docs/reference/language)
  2433. // for a list of the currently supported language codes.
  2434. LanguageCode string `json:"languageCode,omitempty"`
  2435. // OutputContexts: The collection of output contexts. If
  2436. // applicable,
  2437. // `output_contexts.parameters` contains entries with name
  2438. // `<parameter name>.original` containing the original parameter
  2439. // values
  2440. // before the query.
  2441. OutputContexts []*GoogleCloudDialogflowV2Context `json:"outputContexts,omitempty"`
  2442. // Parameters: The collection of extracted parameters.
  2443. Parameters googleapi.RawMessage `json:"parameters,omitempty"`
  2444. // QueryText: The original conversational query text:
  2445. // - If natural language text was provided as input, `query_text`
  2446. // contains
  2447. // a copy of the input.
  2448. // - If natural language speech audio was provided as input,
  2449. // `query_text`
  2450. // contains the speech recognition result. If speech recognizer
  2451. // produced
  2452. // multiple alternatives, a particular one is picked.
  2453. // - If an event was provided as input, `query_text` is not set.
  2454. QueryText string `json:"queryText,omitempty"`
  2455. // SpeechRecognitionConfidence: The Speech recognition confidence
  2456. // between 0.0 and 1.0. A higher number
  2457. // indicates an estimated greater likelihood that the recognized words
  2458. // are
  2459. // correct. The default of 0.0 is a sentinel value indicating that
  2460. // confidence
  2461. // was not set.
  2462. //
  2463. // This field is not guaranteed to be accurate or set. In particular
  2464. // this
  2465. // field isn't set for StreamingDetectIntent since the streaming
  2466. // endpoint has
  2467. // separate confidence estimates per portion of the audio
  2468. // in
  2469. // StreamingRecognitionResult.
  2470. SpeechRecognitionConfidence float64 `json:"speechRecognitionConfidence,omitempty"`
  2471. // WebhookPayload: If the query was fulfilled by a webhook call, this
  2472. // field is set to the
  2473. // value of the `payload` field returned in the webhook response.
  2474. WebhookPayload googleapi.RawMessage `json:"webhookPayload,omitempty"`
  2475. // WebhookSource: If the query was fulfilled by a webhook call, this
  2476. // field is set to the
  2477. // value of the `source` field returned in the webhook response.
  2478. WebhookSource string `json:"webhookSource,omitempty"`
  2479. // ForceSendFields is a list of field names (e.g. "Action") to
  2480. // unconditionally include in API requests. By default, fields with
  2481. // empty values are omitted from API requests. However, any non-pointer,
  2482. // non-interface field appearing in ForceSendFields will be sent to the
  2483. // server regardless of whether the field is empty or not. This may be
  2484. // used to include empty fields in Patch requests.
  2485. ForceSendFields []string `json:"-"`
  2486. // NullFields is a list of field names (e.g. "Action") to include in API
  2487. // requests with the JSON null value. By default, fields with empty
  2488. // values are omitted from API requests. However, any field with an
  2489. // empty value appearing in NullFields will be sent to the server as
  2490. // null. It is an error if a field in this list has a non-empty value.
  2491. // This may be used to include null fields in Patch requests.
  2492. NullFields []string `json:"-"`
  2493. }
  2494. func (s *GoogleCloudDialogflowV2QueryResult) MarshalJSON() ([]byte, error) {
  2495. type NoMethod GoogleCloudDialogflowV2QueryResult
  2496. raw := NoMethod(*s)
  2497. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2498. }
  2499. func (s *GoogleCloudDialogflowV2QueryResult) UnmarshalJSON(data []byte) error {
  2500. type NoMethod GoogleCloudDialogflowV2QueryResult
  2501. var s1 struct {
  2502. IntentDetectionConfidence gensupport.JSONFloat64 `json:"intentDetectionConfidence"`
  2503. SpeechRecognitionConfidence gensupport.JSONFloat64 `json:"speechRecognitionConfidence"`
  2504. *NoMethod
  2505. }
  2506. s1.NoMethod = (*NoMethod)(s)
  2507. if err := json.Unmarshal(data, &s1); err != nil {
  2508. return err
  2509. }
  2510. s.IntentDetectionConfidence = float64(s1.IntentDetectionConfidence)
  2511. s.SpeechRecognitionConfidence = float64(s1.SpeechRecognitionConfidence)
  2512. return nil
  2513. }
  2514. // GoogleCloudDialogflowV2RestoreAgentRequest: The request message for
  2515. // Agents.RestoreAgent.
  2516. type GoogleCloudDialogflowV2RestoreAgentRequest struct {
  2517. // AgentContent: The agent to restore.
  2518. //
  2519. // Example for how to restore an agent via the command line:
  2520. //
  2521. // curl \
  2522. //
  2523. // 'https://dialogflow.googleapis.com/v2/projects/<project_name>/agent:re
  2524. // store\
  2525. // -X POST \
  2526. // -H 'Authorization: Bearer '$(gcloud auth print-access-token) \
  2527. // -H 'Accept: application/json' \
  2528. // -H 'Content-Type: application/json' \
  2529. // --compressed \
  2530. // --data-binary "{
  2531. // 'agentContent': '$(cat <agent zip file> | base64 -w 0)'
  2532. // }" \
  2533. AgentContent string `json:"agentContent,omitempty"`
  2534. // AgentUri: The URI to a Google Cloud Storage file containing the agent
  2535. // to restore.
  2536. // Note: The URI must start with "gs://".
  2537. AgentUri string `json:"agentUri,omitempty"`
  2538. // ForceSendFields is a list of field names (e.g. "AgentContent") to
  2539. // unconditionally include in API requests. By default, fields with
  2540. // empty values are omitted from API requests. However, any non-pointer,
  2541. // non-interface field appearing in ForceSendFields will be sent to the
  2542. // server regardless of whether the field is empty or not. This may be
  2543. // used to include empty fields in Patch requests.
  2544. ForceSendFields []string `json:"-"`
  2545. // NullFields is a list of field names (e.g. "AgentContent") to include
  2546. // in API requests with the JSON null value. By default, fields with
  2547. // empty values are omitted from API requests. However, any field with
  2548. // an empty value appearing in NullFields will be sent to the server as
  2549. // null. It is an error if a field in this list has a non-empty value.
  2550. // This may be used to include null fields in Patch requests.
  2551. NullFields []string `json:"-"`
  2552. }
  2553. func (s *GoogleCloudDialogflowV2RestoreAgentRequest) MarshalJSON() ([]byte, error) {
  2554. type NoMethod GoogleCloudDialogflowV2RestoreAgentRequest
  2555. raw := NoMethod(*s)
  2556. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2557. }
  2558. // GoogleCloudDialogflowV2SearchAgentsResponse: The response message for
  2559. // Agents.SearchAgents.
  2560. type GoogleCloudDialogflowV2SearchAgentsResponse struct {
  2561. // Agents: The list of agents. There will be a maximum number of items
  2562. // returned based
  2563. // on the page_size field in the request.
  2564. Agents []*GoogleCloudDialogflowV2Agent `json:"agents,omitempty"`
  2565. // NextPageToken: Token to retrieve the next page of results, or empty
  2566. // if there are no
  2567. // more results in the list.
  2568. NextPageToken string `json:"nextPageToken,omitempty"`
  2569. // ServerResponse contains the HTTP response code and headers from the
  2570. // server.
  2571. googleapi.ServerResponse `json:"-"`
  2572. // ForceSendFields is a list of field names (e.g. "Agents") to
  2573. // unconditionally include in API requests. By default, fields with
  2574. // empty values are omitted from API requests. However, any non-pointer,
  2575. // non-interface field appearing in ForceSendFields will be sent to the
  2576. // server regardless of whether the field is empty or not. This may be
  2577. // used to include empty fields in Patch requests.
  2578. ForceSendFields []string `json:"-"`
  2579. // NullFields is a list of field names (e.g. "Agents") to include in API
  2580. // requests with the JSON null value. By default, fields with empty
  2581. // values are omitted from API requests. However, any field with an
  2582. // empty value appearing in NullFields will be sent to the server as
  2583. // null. It is an error if a field in this list has a non-empty value.
  2584. // This may be used to include null fields in Patch requests.
  2585. NullFields []string `json:"-"`
  2586. }
  2587. func (s *GoogleCloudDialogflowV2SearchAgentsResponse) MarshalJSON() ([]byte, error) {
  2588. type NoMethod GoogleCloudDialogflowV2SearchAgentsResponse
  2589. raw := NoMethod(*s)
  2590. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2591. }
  2592. // GoogleCloudDialogflowV2SessionEntityType: Represents a session entity
  2593. // type.
  2594. //
  2595. // Extends or replaces a developer entity type at the user session level
  2596. // (we
  2597. // refer to the entity types defined at the agent level as "developer
  2598. // entity
  2599. // types").
  2600. //
  2601. // Note: session entity types apply to all queries, regardless of the
  2602. // language.
  2603. type GoogleCloudDialogflowV2SessionEntityType struct {
  2604. // Entities: Required. The collection of entities associated with this
  2605. // session entity
  2606. // type.
  2607. Entities []*GoogleCloudDialogflowV2EntityTypeEntity `json:"entities,omitempty"`
  2608. // EntityOverrideMode: Required. Indicates whether the additional data
  2609. // should override or
  2610. // supplement the developer entity type definition.
  2611. //
  2612. // Possible values:
  2613. // "ENTITY_OVERRIDE_MODE_UNSPECIFIED" - Not specified. This value
  2614. // should be never used.
  2615. // "ENTITY_OVERRIDE_MODE_OVERRIDE" - The collection of session
  2616. // entities overrides the collection of entities
  2617. // in the corresponding developer entity type.
  2618. // "ENTITY_OVERRIDE_MODE_SUPPLEMENT" - The collection of session
  2619. // entities extends the collection of entities in
  2620. // the corresponding developer entity type.
  2621. // Calls to `ListSessionEntityTypes`,
  2622. // `GetSessionEntityType`,
  2623. // `CreateSessionEntityType` and `UpdateSessionEntityType` return the
  2624. // full
  2625. // collection of entities from the developer entity type in the
  2626. // agent's
  2627. // default language and the session entity type.
  2628. EntityOverrideMode string `json:"entityOverrideMode,omitempty"`
  2629. // Name: Required. The unique identifier of this session entity type.
  2630. // Format:
  2631. // `projects/<Project ID>/agent/sessions/<Session
  2632. // ID>/entityTypes/<Entity Type
  2633. // Display Name>`.
  2634. Name string `json:"name,omitempty"`
  2635. // ServerResponse contains the HTTP response code and headers from the
  2636. // server.
  2637. googleapi.ServerResponse `json:"-"`
  2638. // ForceSendFields is a list of field names (e.g. "Entities") to
  2639. // unconditionally include in API requests. By default, fields with
  2640. // empty values are omitted from API requests. However, any non-pointer,
  2641. // non-interface field appearing in ForceSendFields will be sent to the
  2642. // server regardless of whether the field is empty or not. This may be
  2643. // used to include empty fields in Patch requests.
  2644. ForceSendFields []string `json:"-"`
  2645. // NullFields is a list of field names (e.g. "Entities") to include in
  2646. // API requests with the JSON null value. By default, fields with empty
  2647. // values are omitted from API requests. However, any field with an
  2648. // empty value appearing in NullFields will be sent to the server as
  2649. // null. It is an error if a field in this list has a non-empty value.
  2650. // This may be used to include null fields in Patch requests.
  2651. NullFields []string `json:"-"`
  2652. }
  2653. func (s *GoogleCloudDialogflowV2SessionEntityType) MarshalJSON() ([]byte, error) {
  2654. type NoMethod GoogleCloudDialogflowV2SessionEntityType
  2655. raw := NoMethod(*s)
  2656. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2657. }
  2658. // GoogleCloudDialogflowV2TextInput: Represents the natural language
  2659. // text to be processed.
  2660. type GoogleCloudDialogflowV2TextInput struct {
  2661. // LanguageCode: Required. The language of this conversational query.
  2662. // See [Language
  2663. // Support](https://dialogflow.com/docs/languages) for a list of
  2664. // the
  2665. // currently supported language codes. Note that queries in the same
  2666. // session
  2667. // do not necessarily need to specify the same language.
  2668. LanguageCode string `json:"languageCode,omitempty"`
  2669. // Text: Required. The UTF-8 encoded natural language text to be
  2670. // processed.
  2671. // Text length must not exceed 256 bytes.
  2672. Text string `json:"text,omitempty"`
  2673. // ForceSendFields is a list of field names (e.g. "LanguageCode") to
  2674. // unconditionally include in API requests. By default, fields with
  2675. // empty values are omitted from API requests. However, any non-pointer,
  2676. // non-interface field appearing in ForceSendFields will be sent to the
  2677. // server regardless of whether the field is empty or not. This may be
  2678. // used to include empty fields in Patch requests.
  2679. ForceSendFields []string `json:"-"`
  2680. // NullFields is a list of field names (e.g. "LanguageCode") to include
  2681. // in API requests with the JSON null value. By default, fields with
  2682. // empty values are omitted from API requests. However, any field with
  2683. // an empty value appearing in NullFields will be sent to the server as
  2684. // null. It is an error if a field in this list has a non-empty value.
  2685. // This may be used to include null fields in Patch requests.
  2686. NullFields []string `json:"-"`
  2687. }
  2688. func (s *GoogleCloudDialogflowV2TextInput) MarshalJSON() ([]byte, error) {
  2689. type NoMethod GoogleCloudDialogflowV2TextInput
  2690. raw := NoMethod(*s)
  2691. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2692. }
  2693. // GoogleCloudDialogflowV2TrainAgentRequest: The request message for
  2694. // Agents.TrainAgent.
  2695. type GoogleCloudDialogflowV2TrainAgentRequest struct {
  2696. }
  2697. // GoogleCloudDialogflowV2WebhookRequest: The request message for a
  2698. // webhook call.
  2699. type GoogleCloudDialogflowV2WebhookRequest struct {
  2700. // OriginalDetectIntentRequest: Optional. The contents of the original
  2701. // request that was passed to
  2702. // `[Streaming]DetectIntent` call.
  2703. OriginalDetectIntentRequest *GoogleCloudDialogflowV2OriginalDetectIntentRequest `json:"originalDetectIntentRequest,omitempty"`
  2704. // QueryResult: The result of the conversational query or event
  2705. // processing. Contains the
  2706. // same value as `[Streaming]DetectIntentResponse.query_result`.
  2707. QueryResult *GoogleCloudDialogflowV2QueryResult `json:"queryResult,omitempty"`
  2708. // ResponseId: The unique identifier of the response. Contains the same
  2709. // value as
  2710. // `[Streaming]DetectIntentResponse.response_id`.
  2711. ResponseId string `json:"responseId,omitempty"`
  2712. // Session: The unique identifier of detectIntent request session.
  2713. // Can be used to identify end-user inside webhook
  2714. // implementation.
  2715. // Format: `projects/<Project ID>/agent/sessions/<Session ID>`.
  2716. Session string `json:"session,omitempty"`
  2717. // ForceSendFields is a list of field names (e.g.
  2718. // "OriginalDetectIntentRequest") to unconditionally include in API
  2719. // requests. By default, fields with empty values are omitted from API
  2720. // requests. However, any non-pointer, non-interface field appearing in
  2721. // ForceSendFields will be sent to the server regardless of whether the
  2722. // field is empty or not. This may be used to include empty fields in
  2723. // Patch requests.
  2724. ForceSendFields []string `json:"-"`
  2725. // NullFields is a list of field names (e.g.
  2726. // "OriginalDetectIntentRequest") to include in API requests with the
  2727. // JSON null value. By default, fields with empty values are omitted
  2728. // from API requests. However, any field with an empty value appearing
  2729. // in NullFields will be sent to the server as null. It is an error if a
  2730. // field in this list has a non-empty value. This may be used to include
  2731. // null fields in Patch requests.
  2732. NullFields []string `json:"-"`
  2733. }
  2734. func (s *GoogleCloudDialogflowV2WebhookRequest) MarshalJSON() ([]byte, error) {
  2735. type NoMethod GoogleCloudDialogflowV2WebhookRequest
  2736. raw := NoMethod(*s)
  2737. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2738. }
  2739. // GoogleCloudDialogflowV2WebhookResponse: The response message for a
  2740. // webhook call.
  2741. type GoogleCloudDialogflowV2WebhookResponse struct {
  2742. // FollowupEventInput: Optional. Makes the platform immediately invoke
  2743. // another `DetectIntent` call
  2744. // internally with the specified event as input.
  2745. FollowupEventInput *GoogleCloudDialogflowV2EventInput `json:"followupEventInput,omitempty"`
  2746. // FulfillmentMessages: Optional. The collection of rich messages to
  2747. // present to the user. This
  2748. // value is passed directly to `QueryResult.fulfillment_messages`.
  2749. FulfillmentMessages []*GoogleCloudDialogflowV2IntentMessage `json:"fulfillmentMessages,omitempty"`
  2750. // FulfillmentText: Optional. The text to be shown on the screen. This
  2751. // value is passed directly
  2752. // to `QueryResult.fulfillment_text`.
  2753. FulfillmentText string `json:"fulfillmentText,omitempty"`
  2754. // OutputContexts: Optional. The collection of output contexts. This
  2755. // value is passed directly
  2756. // to `QueryResult.output_contexts`.
  2757. OutputContexts []*GoogleCloudDialogflowV2Context `json:"outputContexts,omitempty"`
  2758. // Payload: Optional. This value is passed directly to
  2759. // `QueryResult.webhook_payload`.
  2760. // See the related `fulfillment_messages[i].payload field`, which may be
  2761. // used
  2762. // as an alternative to this field.
  2763. //
  2764. // This field can be used for Actions on Google responses.
  2765. // It should have a structure similar to the JSON message shown here.
  2766. // For more
  2767. // information, see
  2768. // [Actions on Google
  2769. // Webhook
  2770. // Format](https://developers.google.com/actions/dialogflow/webho
  2771. // ok)
  2772. // <pre>{
  2773. // "google": {
  2774. // "expectUserResponse": true,
  2775. // "richResponse": {
  2776. // "items": [
  2777. // {
  2778. // "simpleResponse": {
  2779. // "textToSpeech": "this is a simple response"
  2780. // }
  2781. // }
  2782. // ]
  2783. // }
  2784. // }
  2785. // }</pre>
  2786. Payload googleapi.RawMessage `json:"payload,omitempty"`
  2787. // Source: Optional. This value is passed directly to
  2788. // `QueryResult.webhook_source`.
  2789. Source string `json:"source,omitempty"`
  2790. // ForceSendFields is a list of field names (e.g. "FollowupEventInput")
  2791. // to unconditionally include in API requests. By default, fields with
  2792. // empty values are omitted from API requests. However, any non-pointer,
  2793. // non-interface field appearing in ForceSendFields will be sent to the
  2794. // server regardless of whether the field is empty or not. This may be
  2795. // used to include empty fields in Patch requests.
  2796. ForceSendFields []string `json:"-"`
  2797. // NullFields is a list of field names (e.g. "FollowupEventInput") to
  2798. // include in API requests with the JSON null value. By default, fields
  2799. // with empty values are omitted from API requests. However, any field
  2800. // with an empty value appearing in NullFields will be sent to the
  2801. // server as null. It is an error if a field in this list has a
  2802. // non-empty value. This may be used to include null fields in Patch
  2803. // requests.
  2804. NullFields []string `json:"-"`
  2805. }
  2806. func (s *GoogleCloudDialogflowV2WebhookResponse) MarshalJSON() ([]byte, error) {
  2807. type NoMethod GoogleCloudDialogflowV2WebhookResponse
  2808. raw := NoMethod(*s)
  2809. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2810. }
  2811. // GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesResponse: The
  2812. // response message for EntityTypes.BatchUpdateEntityTypes.
  2813. type GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesResponse struct {
  2814. // EntityTypes: The collection of updated or created entity types.
  2815. EntityTypes []*GoogleCloudDialogflowV2beta1EntityType `json:"entityTypes,omitempty"`
  2816. // ForceSendFields is a list of field names (e.g. "EntityTypes") to
  2817. // unconditionally include in API requests. By default, fields with
  2818. // empty values are omitted from API requests. However, any non-pointer,
  2819. // non-interface field appearing in ForceSendFields will be sent to the
  2820. // server regardless of whether the field is empty or not. This may be
  2821. // used to include empty fields in Patch requests.
  2822. ForceSendFields []string `json:"-"`
  2823. // NullFields is a list of field names (e.g. "EntityTypes") to include
  2824. // in API requests with the JSON null value. By default, fields with
  2825. // empty values are omitted from API requests. However, any field with
  2826. // an empty value appearing in NullFields will be sent to the server as
  2827. // null. It is an error if a field in this list has a non-empty value.
  2828. // This may be used to include null fields in Patch requests.
  2829. NullFields []string `json:"-"`
  2830. }
  2831. func (s *GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesResponse) MarshalJSON() ([]byte, error) {
  2832. type NoMethod GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesResponse
  2833. raw := NoMethod(*s)
  2834. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2835. }
  2836. // GoogleCloudDialogflowV2beta1BatchUpdateIntentsResponse: The response
  2837. // message for Intents.BatchUpdateIntents.
  2838. type GoogleCloudDialogflowV2beta1BatchUpdateIntentsResponse struct {
  2839. // Intents: The collection of updated or created intents.
  2840. Intents []*GoogleCloudDialogflowV2beta1Intent `json:"intents,omitempty"`
  2841. // ForceSendFields is a list of field names (e.g. "Intents") to
  2842. // unconditionally include in API requests. By default, fields with
  2843. // empty values are omitted from API requests. However, any non-pointer,
  2844. // non-interface field appearing in ForceSendFields will be sent to the
  2845. // server regardless of whether the field is empty or not. This may be
  2846. // used to include empty fields in Patch requests.
  2847. ForceSendFields []string `json:"-"`
  2848. // NullFields is a list of field names (e.g. "Intents") to include in
  2849. // API requests with the JSON null value. By default, fields with empty
  2850. // values are omitted from API requests. However, any field with an
  2851. // empty value appearing in NullFields will be sent to the server as
  2852. // null. It is an error if a field in this list has a non-empty value.
  2853. // This may be used to include null fields in Patch requests.
  2854. NullFields []string `json:"-"`
  2855. }
  2856. func (s *GoogleCloudDialogflowV2beta1BatchUpdateIntentsResponse) MarshalJSON() ([]byte, error) {
  2857. type NoMethod GoogleCloudDialogflowV2beta1BatchUpdateIntentsResponse
  2858. raw := NoMethod(*s)
  2859. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2860. }
  2861. // GoogleCloudDialogflowV2beta1Context: Represents a context.
  2862. type GoogleCloudDialogflowV2beta1Context struct {
  2863. // LifespanCount: Optional. The number of conversational query requests
  2864. // after which the
  2865. // context expires. If set to `0` (the default) the context
  2866. // expires
  2867. // immediately. Contexts expire automatically after 10 minutes even if
  2868. // there
  2869. // are no matching queries.
  2870. LifespanCount int64 `json:"lifespanCount,omitempty"`
  2871. // Name: Required. The unique identifier of the context.
  2872. // Format:
  2873. // `projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context
  2874. // ID>`,
  2875. // or
  2876. // `projects/<Project ID>/agent/environments/<Environment
  2877. // ID>/users/<User
  2878. // ID>/sessions/<Session ID>/contexts/<Context ID>`. Note: Environments
  2879. // and
  2880. // users are under construction and will be available soon. The Context
  2881. // ID is
  2882. // always converted to lowercase. If <Environment ID> is not specified,
  2883. // we
  2884. // assume default 'draft' environment. If <User ID> is not specified,
  2885. // we
  2886. // assume default '-' user.
  2887. Name string `json:"name,omitempty"`
  2888. // Parameters: Optional. The collection of parameters associated with
  2889. // this context.
  2890. // Refer to [this
  2891. // doc](https://dialogflow.com/docs/actions-and-parameters) for
  2892. // syntax.
  2893. Parameters googleapi.RawMessage `json:"parameters,omitempty"`
  2894. // ForceSendFields is a list of field names (e.g. "LifespanCount") to
  2895. // unconditionally include in API requests. By default, fields with
  2896. // empty values are omitted from API requests. However, any non-pointer,
  2897. // non-interface field appearing in ForceSendFields will be sent to the
  2898. // server regardless of whether the field is empty or not. This may be
  2899. // used to include empty fields in Patch requests.
  2900. ForceSendFields []string `json:"-"`
  2901. // NullFields is a list of field names (e.g. "LifespanCount") to include
  2902. // in API requests with the JSON null value. By default, fields with
  2903. // empty values are omitted from API requests. However, any field with
  2904. // an empty value appearing in NullFields will be sent to the server as
  2905. // null. It is an error if a field in this list has a non-empty value.
  2906. // This may be used to include null fields in Patch requests.
  2907. NullFields []string `json:"-"`
  2908. }
  2909. func (s *GoogleCloudDialogflowV2beta1Context) MarshalJSON() ([]byte, error) {
  2910. type NoMethod GoogleCloudDialogflowV2beta1Context
  2911. raw := NoMethod(*s)
  2912. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2913. }
  2914. // GoogleCloudDialogflowV2beta1EntityType: Represents an entity
  2915. // type.
  2916. // Entity types serve as a tool for extracting parameter values from
  2917. // natural
  2918. // language queries.
  2919. type GoogleCloudDialogflowV2beta1EntityType struct {
  2920. // AutoExpansionMode: Optional. Indicates whether the entity type can be
  2921. // automatically
  2922. // expanded.
  2923. //
  2924. // Possible values:
  2925. // "AUTO_EXPANSION_MODE_UNSPECIFIED" - Auto expansion disabled for the
  2926. // entity.
  2927. // "AUTO_EXPANSION_MODE_DEFAULT" - Allows an agent to recognize values
  2928. // that have not been explicitly
  2929. // listed in the entity.
  2930. AutoExpansionMode string `json:"autoExpansionMode,omitempty"`
  2931. // DisplayName: Required. The name of the entity.
  2932. DisplayName string `json:"displayName,omitempty"`
  2933. // Entities: Optional. The collection of entities associated with the
  2934. // entity type.
  2935. Entities []*GoogleCloudDialogflowV2beta1EntityTypeEntity `json:"entities,omitempty"`
  2936. // Kind: Required. Indicates the kind of entity type.
  2937. //
  2938. // Possible values:
  2939. // "KIND_UNSPECIFIED" - Not specified. This value should be never
  2940. // used.
  2941. // "KIND_MAP" - Map entity types allow mapping of a group of synonyms
  2942. // to a canonical
  2943. // value.
  2944. // "KIND_LIST" - List entity types contain a set of entries that do
  2945. // not map to canonical
  2946. // values. However, list entity types can contain references to other
  2947. // entity
  2948. // types (with or without aliases).
  2949. Kind string `json:"kind,omitempty"`
  2950. // Name: Required for all methods except `create` (`create` populates
  2951. // the name
  2952. // automatically.
  2953. // The unique identifier of the entity type. Format:
  2954. // `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.
  2955. Name string `json:"name,omitempty"`
  2956. // ForceSendFields is a list of field names (e.g. "AutoExpansionMode")
  2957. // to unconditionally include in API requests. By default, fields with
  2958. // empty values are omitted from API requests. However, any non-pointer,
  2959. // non-interface field appearing in ForceSendFields will be sent to the
  2960. // server regardless of whether the field is empty or not. This may be
  2961. // used to include empty fields in Patch requests.
  2962. ForceSendFields []string `json:"-"`
  2963. // NullFields is a list of field names (e.g. "AutoExpansionMode") to
  2964. // include in API requests with the JSON null value. By default, fields
  2965. // with empty values are omitted from API requests. However, any field
  2966. // with an empty value appearing in NullFields will be sent to the
  2967. // server as null. It is an error if a field in this list has a
  2968. // non-empty value. This may be used to include null fields in Patch
  2969. // requests.
  2970. NullFields []string `json:"-"`
  2971. }
  2972. func (s *GoogleCloudDialogflowV2beta1EntityType) MarshalJSON() ([]byte, error) {
  2973. type NoMethod GoogleCloudDialogflowV2beta1EntityType
  2974. raw := NoMethod(*s)
  2975. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2976. }
  2977. // GoogleCloudDialogflowV2beta1EntityTypeEntity: Optional. Represents an
  2978. // entity.
  2979. type GoogleCloudDialogflowV2beta1EntityTypeEntity struct {
  2980. // Synonyms: Required. A collection of synonyms. For `KIND_LIST` entity
  2981. // types this
  2982. // must contain exactly one synonym equal to `value`.
  2983. Synonyms []string `json:"synonyms,omitempty"`
  2984. // Value: Required.
  2985. // For `KIND_MAP` entity types:
  2986. // A canonical name to be used in place of synonyms.
  2987. // For `KIND_LIST` entity types:
  2988. // A string that can contain references to other entity types (with
  2989. // or
  2990. // without aliases).
  2991. Value string `json:"value,omitempty"`
  2992. // ForceSendFields is a list of field names (e.g. "Synonyms") to
  2993. // unconditionally include in API requests. By default, fields with
  2994. // empty values are omitted from API requests. However, any non-pointer,
  2995. // non-interface field appearing in ForceSendFields will be sent to the
  2996. // server regardless of whether the field is empty or not. This may be
  2997. // used to include empty fields in Patch requests.
  2998. ForceSendFields []string `json:"-"`
  2999. // NullFields is a list of field names (e.g. "Synonyms") to include in
  3000. // API requests with the JSON null value. By default, fields with empty
  3001. // values are omitted from API requests. However, any field with an
  3002. // empty value appearing in NullFields will be sent to the server as
  3003. // null. It is an error if a field in this list has a non-empty value.
  3004. // This may be used to include null fields in Patch requests.
  3005. NullFields []string `json:"-"`
  3006. }
  3007. func (s *GoogleCloudDialogflowV2beta1EntityTypeEntity) MarshalJSON() ([]byte, error) {
  3008. type NoMethod GoogleCloudDialogflowV2beta1EntityTypeEntity
  3009. raw := NoMethod(*s)
  3010. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3011. }
  3012. // GoogleCloudDialogflowV2beta1EventInput: Events allow for matching
  3013. // intents by event name instead of the natural
  3014. // language input. For instance, input `<event: { name:
  3015. // “welcome_event”,
  3016. // parameters: { name: “Sam” } }>` can trigger a personalized
  3017. // welcome response.
  3018. // The parameter `name` may be used by the agent in the
  3019. // response:
  3020. // `“Hello #welcome_event.name! What can I do for you today?”`.
  3021. type GoogleCloudDialogflowV2beta1EventInput struct {
  3022. // LanguageCode: Required. The language of this query. See
  3023. // [Language
  3024. // Support](https://dialogflow.com/docs/languages) for a list of
  3025. // the
  3026. // currently supported language codes. Note that queries in the same
  3027. // session
  3028. // do not necessarily need to specify the same language.
  3029. LanguageCode string `json:"languageCode,omitempty"`
  3030. // Name: Required. The unique identifier of the event.
  3031. Name string `json:"name,omitempty"`
  3032. // Parameters: Optional. The collection of parameters associated with
  3033. // the event.
  3034. Parameters googleapi.RawMessage `json:"parameters,omitempty"`
  3035. // ForceSendFields is a list of field names (e.g. "LanguageCode") to
  3036. // unconditionally include in API requests. By default, fields with
  3037. // empty values are omitted from API requests. However, any non-pointer,
  3038. // non-interface field appearing in ForceSendFields will be sent to the
  3039. // server regardless of whether the field is empty or not. This may be
  3040. // used to include empty fields in Patch requests.
  3041. ForceSendFields []string `json:"-"`
  3042. // NullFields is a list of field names (e.g. "LanguageCode") to include
  3043. // in API requests with the JSON null value. By default, fields with
  3044. // empty values are omitted from API requests. However, any field with
  3045. // an empty value appearing in NullFields will be sent to the server as
  3046. // null. It is an error if a field in this list has a non-empty value.
  3047. // This may be used to include null fields in Patch requests.
  3048. NullFields []string `json:"-"`
  3049. }
  3050. func (s *GoogleCloudDialogflowV2beta1EventInput) MarshalJSON() ([]byte, error) {
  3051. type NoMethod GoogleCloudDialogflowV2beta1EventInput
  3052. raw := NoMethod(*s)
  3053. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3054. }
  3055. // GoogleCloudDialogflowV2beta1ExportAgentResponse: The response message
  3056. // for Agents.ExportAgent.
  3057. type GoogleCloudDialogflowV2beta1ExportAgentResponse struct {
  3058. // AgentContent: The exported agent.
  3059. //
  3060. // Example for how to export an agent to a zip file via a command
  3061. // line:
  3062. //
  3063. // curl \
  3064. //
  3065. // 'https://dialogflow.googleapis.com/v2beta1/projects/<project_name>/age
  3066. // nt:export'\
  3067. // -X POST \
  3068. // -H 'Authorization: Bearer '$(gcloud auth print-access-token) \
  3069. // -H 'Accept: application/json' \
  3070. // -H 'Content-Type: application/json' \
  3071. // --compressed \
  3072. // --data-binary '{}' \
  3073. // | grep agentContent | sed -e 's/.*"agentContent": "\([^"]*\)".*/\1/'
  3074. // \
  3075. // | base64 --decode > <agent zip file>
  3076. AgentContent string `json:"agentContent,omitempty"`
  3077. // AgentUri: The URI to a file containing the exported agent. This field
  3078. // is populated
  3079. // only if `agent_uri` is specified in `ExportAgentRequest`.
  3080. AgentUri string `json:"agentUri,omitempty"`
  3081. // ForceSendFields is a list of field names (e.g. "AgentContent") to
  3082. // unconditionally include in API requests. By default, fields with
  3083. // empty values are omitted from API requests. However, any non-pointer,
  3084. // non-interface field appearing in ForceSendFields will be sent to the
  3085. // server regardless of whether the field is empty or not. This may be
  3086. // used to include empty fields in Patch requests.
  3087. ForceSendFields []string `json:"-"`
  3088. // NullFields is a list of field names (e.g. "AgentContent") to include
  3089. // in API requests with the JSON null value. By default, fields with
  3090. // empty values are omitted from API requests. However, any field with
  3091. // an empty value appearing in NullFields will be sent to the server as
  3092. // null. It is an error if a field in this list has a non-empty value.
  3093. // This may be used to include null fields in Patch requests.
  3094. NullFields []string `json:"-"`
  3095. }
  3096. func (s *GoogleCloudDialogflowV2beta1ExportAgentResponse) MarshalJSON() ([]byte, error) {
  3097. type NoMethod GoogleCloudDialogflowV2beta1ExportAgentResponse
  3098. raw := NoMethod(*s)
  3099. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3100. }
  3101. // GoogleCloudDialogflowV2beta1Intent: Represents an intent.
  3102. // Intents convert a number of user expressions or patterns into an
  3103. // action. An
  3104. // action is an extraction of a user command or sentence semantics.
  3105. // Next available field number: 22.
  3106. type GoogleCloudDialogflowV2beta1Intent struct {
  3107. // Action: Optional. The name of the action associated with the intent.
  3108. Action string `json:"action,omitempty"`
  3109. // DefaultResponsePlatforms: Optional. The list of platforms for which
  3110. // the first response will be
  3111. // taken from among the messages assigned to the DEFAULT_PLATFORM.
  3112. //
  3113. // Possible values:
  3114. // "PLATFORM_UNSPECIFIED" - Not specified.
  3115. // "FACEBOOK" - Facebook.
  3116. // "SLACK" - Slack.
  3117. // "TELEGRAM" - Telegram.
  3118. // "KIK" - Kik.
  3119. // "SKYPE" - Skype.
  3120. // "LINE" - Line.
  3121. // "VIBER" - Viber.
  3122. // "ACTIONS_ON_GOOGLE" - Actions on Google.
  3123. // When using Actions on Google, you can choose one of the
  3124. // specific
  3125. // Intent.Message types that mention support for Actions on Google,
  3126. // or you can use the advanced Intent.Message.payload field.
  3127. // The payload field provides access to AoG features not available in
  3128. // the
  3129. // specific message types.
  3130. // If using the Intent.Message.payload field, it should have a
  3131. // structure
  3132. // similar to the JSON message shown here. For more information,
  3133. // see
  3134. // [Actions on Google
  3135. // Webhook
  3136. // Format](https://developers.google.com/actions/dialogflow/webho
  3137. // ok)
  3138. // <pre>{
  3139. // "expectUserResponse": true,
  3140. // "isSsml": false,
  3141. // "noInputPrompts": [],
  3142. // "richResponse": {
  3143. // "items": [
  3144. // {
  3145. // "simpleResponse": {
  3146. // "displayText": "hi",
  3147. // "textToSpeech": "hello"
  3148. // }
  3149. // }
  3150. // ],
  3151. // "suggestions": [
  3152. // {
  3153. // "title": "Say this"
  3154. // },
  3155. // {
  3156. // "title": "or this"
  3157. // }
  3158. // ]
  3159. // },
  3160. // "systemIntent": {
  3161. // "data": {
  3162. // "@type":
  3163. // "type.googleapis.com/google.actions.v2.OptionValueSpec",
  3164. // "listSelect": {
  3165. // "items": [
  3166. // {
  3167. // "optionInfo": {
  3168. // "key": "key1",
  3169. // "synonyms": [
  3170. // "key one"
  3171. // ]
  3172. // },
  3173. // "title": "must not be empty, but unique"
  3174. // },
  3175. // {
  3176. // "optionInfo": {
  3177. // "key": "key2",
  3178. // "synonyms": [
  3179. // "key two"
  3180. // ]
  3181. // },
  3182. // "title": "must not be empty, but unique"
  3183. // }
  3184. // ]
  3185. // }
  3186. // },
  3187. // "intent": "actions.intent.OPTION"
  3188. // }
  3189. // }</pre>
  3190. DefaultResponsePlatforms []string `json:"defaultResponsePlatforms,omitempty"`
  3191. // DisplayName: Required. The name of this intent.
  3192. DisplayName string `json:"displayName,omitempty"`
  3193. // Events: Optional. The collection of event names that trigger the
  3194. // intent.
  3195. // If the collection of input contexts is not empty, all of the contexts
  3196. // must
  3197. // be present in the active user session for an event to trigger this
  3198. // intent.
  3199. Events []string `json:"events,omitempty"`
  3200. // FollowupIntentInfo: Optional. Collection of information about all
  3201. // followup intents that have
  3202. // name of this intent as a root_name.
  3203. FollowupIntentInfo []*GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo `json:"followupIntentInfo,omitempty"`
  3204. // InputContextNames: Optional. The list of context names required for
  3205. // this intent to be
  3206. // triggered.
  3207. // Format: `projects/<Project ID>/agent/sessions/-/contexts/<Context
  3208. // ID>`.
  3209. InputContextNames []string `json:"inputContextNames,omitempty"`
  3210. // IsFallback: Optional. Indicates whether this is a fallback intent.
  3211. IsFallback bool `json:"isFallback,omitempty"`
  3212. // Messages: Optional. The collection of rich messages corresponding to
  3213. // the
  3214. // `Response` field in the Dialogflow console.
  3215. Messages []*GoogleCloudDialogflowV2beta1IntentMessage `json:"messages,omitempty"`
  3216. // MlDisabled: Optional. Indicates whether Machine Learning is disabled
  3217. // for the intent.
  3218. // Note: If `ml_disabled` setting is set to true, then this intent is
  3219. // not
  3220. // taken into account during inference in `ML ONLY` match mode.
  3221. // Also,
  3222. // auto-markup in the UI is turned off.
  3223. MlDisabled bool `json:"mlDisabled,omitempty"`
  3224. // MlEnabled: Optional. Indicates whether Machine Learning is enabled
  3225. // for the intent.
  3226. // Note: If `ml_enabled` setting is set to false, then this intent is
  3227. // not
  3228. // taken into account during inference in `ML ONLY` match mode.
  3229. // Also,
  3230. // auto-markup in the UI is turned off.
  3231. // DEPRECATED! Please use `ml_disabled` field instead.
  3232. // NOTE: If both `ml_enabled` and `ml_disabled` are either not set or
  3233. // false,
  3234. // then the default value is determined as follows:
  3235. // - Before April 15th, 2018 the default is:
  3236. // ml_enabled = false / ml_disabled = true.
  3237. // - After April 15th, 2018 the default is:
  3238. // ml_enabled = true / ml_disabled = false.
  3239. MlEnabled bool `json:"mlEnabled,omitempty"`
  3240. // Name: Required for all methods except `create` (`create` populates
  3241. // the name
  3242. // automatically.
  3243. // The unique identifier of this intent.
  3244. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  3245. Name string `json:"name,omitempty"`
  3246. // OutputContexts: Optional. The collection of contexts that are
  3247. // activated when the intent
  3248. // is matched. Context messages in this collection should not set
  3249. // the
  3250. // parameters field. Setting the `lifespan_count` to 0 will reset the
  3251. // context
  3252. // when the intent is matched.
  3253. // Format: `projects/<Project ID>/agent/sessions/-/contexts/<Context
  3254. // ID>`.
  3255. OutputContexts []*GoogleCloudDialogflowV2beta1Context `json:"outputContexts,omitempty"`
  3256. // Parameters: Optional. The collection of parameters associated with
  3257. // the intent.
  3258. Parameters []*GoogleCloudDialogflowV2beta1IntentParameter `json:"parameters,omitempty"`
  3259. // ParentFollowupIntentName: The unique identifier of the parent intent
  3260. // in the chain of followup
  3261. // intents.
  3262. // It identifies the parent followup intent.
  3263. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  3264. ParentFollowupIntentName string `json:"parentFollowupIntentName,omitempty"`
  3265. // Priority: Optional. The priority of this intent. Higher numbers
  3266. // represent higher
  3267. // priorities. Zero or negative numbers mean that the intent is
  3268. // disabled.
  3269. Priority int64 `json:"priority,omitempty"`
  3270. // ResetContexts: Optional. Indicates whether to delete all contexts in
  3271. // the current
  3272. // session when this intent is matched.
  3273. ResetContexts bool `json:"resetContexts,omitempty"`
  3274. // RootFollowupIntentName: The unique identifier of the root intent in
  3275. // the chain of followup intents.
  3276. // It identifies the correct followup intents chain for this
  3277. // intent.
  3278. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  3279. RootFollowupIntentName string `json:"rootFollowupIntentName,omitempty"`
  3280. // TrainingPhrases: Optional. The collection of examples/templates that
  3281. // the agent is
  3282. // trained on.
  3283. TrainingPhrases []*GoogleCloudDialogflowV2beta1IntentTrainingPhrase `json:"trainingPhrases,omitempty"`
  3284. // WebhookState: Required. Indicates whether webhooks are enabled for
  3285. // the intent.
  3286. //
  3287. // Possible values:
  3288. // "WEBHOOK_STATE_UNSPECIFIED" - Webhook is disabled in the agent and
  3289. // in the intent.
  3290. // "WEBHOOK_STATE_ENABLED" - Webhook is enabled in the agent and in
  3291. // the intent.
  3292. // "WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING" - Webhook is enabled in
  3293. // the agent and in the intent. Also, each slot
  3294. // filling prompt is forwarded to the webhook.
  3295. WebhookState string `json:"webhookState,omitempty"`
  3296. // ForceSendFields is a list of field names (e.g. "Action") to
  3297. // unconditionally include in API requests. By default, fields with
  3298. // empty values are omitted from API requests. However, any non-pointer,
  3299. // non-interface field appearing in ForceSendFields will be sent to the
  3300. // server regardless of whether the field is empty or not. This may be
  3301. // used to include empty fields in Patch requests.
  3302. ForceSendFields []string `json:"-"`
  3303. // NullFields is a list of field names (e.g. "Action") to include in API
  3304. // requests with the JSON null value. By default, fields with empty
  3305. // values are omitted from API requests. However, any field with an
  3306. // empty value appearing in NullFields will be sent to the server as
  3307. // null. It is an error if a field in this list has a non-empty value.
  3308. // This may be used to include null fields in Patch requests.
  3309. NullFields []string `json:"-"`
  3310. }
  3311. func (s *GoogleCloudDialogflowV2beta1Intent) MarshalJSON() ([]byte, error) {
  3312. type NoMethod GoogleCloudDialogflowV2beta1Intent
  3313. raw := NoMethod(*s)
  3314. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3315. }
  3316. // GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo: Represents a
  3317. // single followup intent in the chain.
  3318. type GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo struct {
  3319. // FollowupIntentName: The unique identifier of the followup
  3320. // intent.
  3321. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  3322. FollowupIntentName string `json:"followupIntentName,omitempty"`
  3323. // ParentFollowupIntentName: The unique identifier of the followup
  3324. // intent parent.
  3325. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  3326. ParentFollowupIntentName string `json:"parentFollowupIntentName,omitempty"`
  3327. // ForceSendFields is a list of field names (e.g. "FollowupIntentName")
  3328. // to unconditionally include in API requests. By default, fields with
  3329. // empty values are omitted from API requests. However, any non-pointer,
  3330. // non-interface field appearing in ForceSendFields will be sent to the
  3331. // server regardless of whether the field is empty or not. This may be
  3332. // used to include empty fields in Patch requests.
  3333. ForceSendFields []string `json:"-"`
  3334. // NullFields is a list of field names (e.g. "FollowupIntentName") to
  3335. // include in API requests with the JSON null value. By default, fields
  3336. // with empty values are omitted from API requests. However, any field
  3337. // with an empty value appearing in NullFields will be sent to the
  3338. // server as null. It is an error if a field in this list has a
  3339. // non-empty value. This may be used to include null fields in Patch
  3340. // requests.
  3341. NullFields []string `json:"-"`
  3342. }
  3343. func (s *GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo) MarshalJSON() ([]byte, error) {
  3344. type NoMethod GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo
  3345. raw := NoMethod(*s)
  3346. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3347. }
  3348. // GoogleCloudDialogflowV2beta1IntentMessage: Corresponds to the
  3349. // `Response` field in the Dialogflow console.
  3350. type GoogleCloudDialogflowV2beta1IntentMessage struct {
  3351. // BasicCard: Displays a basic card for Actions on Google.
  3352. BasicCard *GoogleCloudDialogflowV2beta1IntentMessageBasicCard `json:"basicCard,omitempty"`
  3353. // Card: Displays a card.
  3354. Card *GoogleCloudDialogflowV2beta1IntentMessageCard `json:"card,omitempty"`
  3355. // CarouselSelect: Displays a carousel card for Actions on Google.
  3356. CarouselSelect *GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect `json:"carouselSelect,omitempty"`
  3357. // Image: Displays an image.
  3358. Image *GoogleCloudDialogflowV2beta1IntentMessageImage `json:"image,omitempty"`
  3359. // LinkOutSuggestion: Displays a link out suggestion chip for Actions on
  3360. // Google.
  3361. LinkOutSuggestion *GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion `json:"linkOutSuggestion,omitempty"`
  3362. // ListSelect: Displays a list card for Actions on Google.
  3363. ListSelect *GoogleCloudDialogflowV2beta1IntentMessageListSelect `json:"listSelect,omitempty"`
  3364. // Payload: Returns a response containing a custom, platform-specific
  3365. // payload.
  3366. // See the Intent.Message.Platform type for a description of
  3367. // the
  3368. // structure that may be required for your platform.
  3369. Payload googleapi.RawMessage `json:"payload,omitempty"`
  3370. // Platform: Optional. The platform that this message is intended for.
  3371. //
  3372. // Possible values:
  3373. // "PLATFORM_UNSPECIFIED" - Not specified.
  3374. // "FACEBOOK" - Facebook.
  3375. // "SLACK" - Slack.
  3376. // "TELEGRAM" - Telegram.
  3377. // "KIK" - Kik.
  3378. // "SKYPE" - Skype.
  3379. // "LINE" - Line.
  3380. // "VIBER" - Viber.
  3381. // "ACTIONS_ON_GOOGLE" - Actions on Google.
  3382. // When using Actions on Google, you can choose one of the
  3383. // specific
  3384. // Intent.Message types that mention support for Actions on Google,
  3385. // or you can use the advanced Intent.Message.payload field.
  3386. // The payload field provides access to AoG features not available in
  3387. // the
  3388. // specific message types.
  3389. // If using the Intent.Message.payload field, it should have a
  3390. // structure
  3391. // similar to the JSON message shown here. For more information,
  3392. // see
  3393. // [Actions on Google
  3394. // Webhook
  3395. // Format](https://developers.google.com/actions/dialogflow/webho
  3396. // ok)
  3397. // <pre>{
  3398. // "expectUserResponse": true,
  3399. // "isSsml": false,
  3400. // "noInputPrompts": [],
  3401. // "richResponse": {
  3402. // "items": [
  3403. // {
  3404. // "simpleResponse": {
  3405. // "displayText": "hi",
  3406. // "textToSpeech": "hello"
  3407. // }
  3408. // }
  3409. // ],
  3410. // "suggestions": [
  3411. // {
  3412. // "title": "Say this"
  3413. // },
  3414. // {
  3415. // "title": "or this"
  3416. // }
  3417. // ]
  3418. // },
  3419. // "systemIntent": {
  3420. // "data": {
  3421. // "@type":
  3422. // "type.googleapis.com/google.actions.v2.OptionValueSpec",
  3423. // "listSelect": {
  3424. // "items": [
  3425. // {
  3426. // "optionInfo": {
  3427. // "key": "key1",
  3428. // "synonyms": [
  3429. // "key one"
  3430. // ]
  3431. // },
  3432. // "title": "must not be empty, but unique"
  3433. // },
  3434. // {
  3435. // "optionInfo": {
  3436. // "key": "key2",
  3437. // "synonyms": [
  3438. // "key two"
  3439. // ]
  3440. // },
  3441. // "title": "must not be empty, but unique"
  3442. // }
  3443. // ]
  3444. // }
  3445. // },
  3446. // "intent": "actions.intent.OPTION"
  3447. // }
  3448. // }</pre>
  3449. Platform string `json:"platform,omitempty"`
  3450. // QuickReplies: Displays quick replies.
  3451. QuickReplies *GoogleCloudDialogflowV2beta1IntentMessageQuickReplies `json:"quickReplies,omitempty"`
  3452. // SimpleResponses: Returns a voice or text-only response for Actions on
  3453. // Google.
  3454. SimpleResponses *GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses `json:"simpleResponses,omitempty"`
  3455. // Suggestions: Displays suggestion chips for Actions on Google.
  3456. Suggestions *GoogleCloudDialogflowV2beta1IntentMessageSuggestions `json:"suggestions,omitempty"`
  3457. // Text: Returns a text response.
  3458. Text *GoogleCloudDialogflowV2beta1IntentMessageText `json:"text,omitempty"`
  3459. // ForceSendFields is a list of field names (e.g. "BasicCard") to
  3460. // unconditionally include in API requests. By default, fields with
  3461. // empty values are omitted from API requests. However, any non-pointer,
  3462. // non-interface field appearing in ForceSendFields will be sent to the
  3463. // server regardless of whether the field is empty or not. This may be
  3464. // used to include empty fields in Patch requests.
  3465. ForceSendFields []string `json:"-"`
  3466. // NullFields is a list of field names (e.g. "BasicCard") to include in
  3467. // API requests with the JSON null value. By default, fields with empty
  3468. // values are omitted from API requests. However, any field with an
  3469. // empty value appearing in NullFields will be sent to the server as
  3470. // null. It is an error if a field in this list has a non-empty value.
  3471. // This may be used to include null fields in Patch requests.
  3472. NullFields []string `json:"-"`
  3473. }
  3474. func (s *GoogleCloudDialogflowV2beta1IntentMessage) MarshalJSON() ([]byte, error) {
  3475. type NoMethod GoogleCloudDialogflowV2beta1IntentMessage
  3476. raw := NoMethod(*s)
  3477. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3478. }
  3479. // GoogleCloudDialogflowV2beta1IntentMessageBasicCard: The basic card
  3480. // message. Useful for displaying information.
  3481. type GoogleCloudDialogflowV2beta1IntentMessageBasicCard struct {
  3482. // Buttons: Optional. The collection of card buttons.
  3483. Buttons []*GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton `json:"buttons,omitempty"`
  3484. // FormattedText: Required, unless image is present. The body text of
  3485. // the card.
  3486. FormattedText string `json:"formattedText,omitempty"`
  3487. // Image: Optional. The image for the card.
  3488. Image *GoogleCloudDialogflowV2beta1IntentMessageImage `json:"image,omitempty"`
  3489. // Subtitle: Optional. The subtitle of the card.
  3490. Subtitle string `json:"subtitle,omitempty"`
  3491. // Title: Optional. The title of the card.
  3492. Title string `json:"title,omitempty"`
  3493. // ForceSendFields is a list of field names (e.g. "Buttons") to
  3494. // unconditionally include in API requests. By default, fields with
  3495. // empty values are omitted from API requests. However, any non-pointer,
  3496. // non-interface field appearing in ForceSendFields will be sent to the
  3497. // server regardless of whether the field is empty or not. This may be
  3498. // used to include empty fields in Patch requests.
  3499. ForceSendFields []string `json:"-"`
  3500. // NullFields is a list of field names (e.g. "Buttons") to include in
  3501. // API requests with the JSON null value. By default, fields with empty
  3502. // values are omitted from API requests. However, any field with an
  3503. // empty value appearing in NullFields will be sent to the server as
  3504. // null. It is an error if a field in this list has a non-empty value.
  3505. // This may be used to include null fields in Patch requests.
  3506. NullFields []string `json:"-"`
  3507. }
  3508. func (s *GoogleCloudDialogflowV2beta1IntentMessageBasicCard) MarshalJSON() ([]byte, error) {
  3509. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageBasicCard
  3510. raw := NoMethod(*s)
  3511. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3512. }
  3513. // GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton: The button
  3514. // object that appears at the bottom of a card.
  3515. type GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton struct {
  3516. // OpenUriAction: Required. Action to take when a user taps on the
  3517. // button.
  3518. OpenUriAction *GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction `json:"openUriAction,omitempty"`
  3519. // Title: Required. The title of the button.
  3520. Title string `json:"title,omitempty"`
  3521. // ForceSendFields is a list of field names (e.g. "OpenUriAction") to
  3522. // unconditionally include in API requests. By default, fields with
  3523. // empty values are omitted from API requests. However, any non-pointer,
  3524. // non-interface field appearing in ForceSendFields will be sent to the
  3525. // server regardless of whether the field is empty or not. This may be
  3526. // used to include empty fields in Patch requests.
  3527. ForceSendFields []string `json:"-"`
  3528. // NullFields is a list of field names (e.g. "OpenUriAction") to include
  3529. // in API requests with the JSON null value. By default, fields with
  3530. // empty values are omitted from API requests. However, any field with
  3531. // an empty value appearing in NullFields will be sent to the server as
  3532. // null. It is an error if a field in this list has a non-empty value.
  3533. // This may be used to include null fields in Patch requests.
  3534. NullFields []string `json:"-"`
  3535. }
  3536. func (s *GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton) MarshalJSON() ([]byte, error) {
  3537. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton
  3538. raw := NoMethod(*s)
  3539. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3540. }
  3541. // GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction:
  3542. // Opens the given URI.
  3543. type GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction struct {
  3544. // Uri: Required. The HTTP or HTTPS scheme URI.
  3545. Uri string `json:"uri,omitempty"`
  3546. // ForceSendFields is a list of field names (e.g. "Uri") to
  3547. // unconditionally include in API requests. By default, fields with
  3548. // empty values are omitted from API requests. However, any non-pointer,
  3549. // non-interface field appearing in ForceSendFields will be sent to the
  3550. // server regardless of whether the field is empty or not. This may be
  3551. // used to include empty fields in Patch requests.
  3552. ForceSendFields []string `json:"-"`
  3553. // NullFields is a list of field names (e.g. "Uri") to include in API
  3554. // requests with the JSON null value. By default, fields with empty
  3555. // values are omitted from API requests. However, any field with an
  3556. // empty value appearing in NullFields will be sent to the server as
  3557. // null. It is an error if a field in this list has a non-empty value.
  3558. // This may be used to include null fields in Patch requests.
  3559. NullFields []string `json:"-"`
  3560. }
  3561. func (s *GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction) MarshalJSON() ([]byte, error) {
  3562. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction
  3563. raw := NoMethod(*s)
  3564. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3565. }
  3566. // GoogleCloudDialogflowV2beta1IntentMessageCard: The card response
  3567. // message.
  3568. type GoogleCloudDialogflowV2beta1IntentMessageCard struct {
  3569. // Buttons: Optional. The collection of card buttons.
  3570. Buttons []*GoogleCloudDialogflowV2beta1IntentMessageCardButton `json:"buttons,omitempty"`
  3571. // ImageUri: Optional. The public URI to an image file for the card.
  3572. ImageUri string `json:"imageUri,omitempty"`
  3573. // Subtitle: Optional. The subtitle of the card.
  3574. Subtitle string `json:"subtitle,omitempty"`
  3575. // Title: Optional. The title of the card.
  3576. Title string `json:"title,omitempty"`
  3577. // ForceSendFields is a list of field names (e.g. "Buttons") to
  3578. // unconditionally include in API requests. By default, fields with
  3579. // empty values are omitted from API requests. However, any non-pointer,
  3580. // non-interface field appearing in ForceSendFields will be sent to the
  3581. // server regardless of whether the field is empty or not. This may be
  3582. // used to include empty fields in Patch requests.
  3583. ForceSendFields []string `json:"-"`
  3584. // NullFields is a list of field names (e.g. "Buttons") to include in
  3585. // API requests with the JSON null value. By default, fields with empty
  3586. // values are omitted from API requests. However, any field with an
  3587. // empty value appearing in NullFields will be sent to the server as
  3588. // null. It is an error if a field in this list has a non-empty value.
  3589. // This may be used to include null fields in Patch requests.
  3590. NullFields []string `json:"-"`
  3591. }
  3592. func (s *GoogleCloudDialogflowV2beta1IntentMessageCard) MarshalJSON() ([]byte, error) {
  3593. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageCard
  3594. raw := NoMethod(*s)
  3595. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3596. }
  3597. // GoogleCloudDialogflowV2beta1IntentMessageCardButton: Optional.
  3598. // Contains information about a button.
  3599. type GoogleCloudDialogflowV2beta1IntentMessageCardButton struct {
  3600. // Postback: Optional. The text to send back to the Dialogflow API or a
  3601. // URI to
  3602. // open.
  3603. Postback string `json:"postback,omitempty"`
  3604. // Text: Optional. The text to show on the button.
  3605. Text string `json:"text,omitempty"`
  3606. // ForceSendFields is a list of field names (e.g. "Postback") to
  3607. // unconditionally include in API requests. By default, fields with
  3608. // empty values are omitted from API requests. However, any non-pointer,
  3609. // non-interface field appearing in ForceSendFields will be sent to the
  3610. // server regardless of whether the field is empty or not. This may be
  3611. // used to include empty fields in Patch requests.
  3612. ForceSendFields []string `json:"-"`
  3613. // NullFields is a list of field names (e.g. "Postback") to include in
  3614. // API requests with the JSON null value. By default, fields with empty
  3615. // values are omitted from API requests. However, any field with an
  3616. // empty value appearing in NullFields will be sent to the server as
  3617. // null. It is an error if a field in this list has a non-empty value.
  3618. // This may be used to include null fields in Patch requests.
  3619. NullFields []string `json:"-"`
  3620. }
  3621. func (s *GoogleCloudDialogflowV2beta1IntentMessageCardButton) MarshalJSON() ([]byte, error) {
  3622. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageCardButton
  3623. raw := NoMethod(*s)
  3624. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3625. }
  3626. // GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect: The card for
  3627. // presenting a carousel of options to select from.
  3628. type GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect struct {
  3629. // Items: Required. Carousel items.
  3630. Items []*GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem `json:"items,omitempty"`
  3631. // ForceSendFields is a list of field names (e.g. "Items") to
  3632. // unconditionally include in API requests. By default, fields with
  3633. // empty values are omitted from API requests. However, any non-pointer,
  3634. // non-interface field appearing in ForceSendFields will be sent to the
  3635. // server regardless of whether the field is empty or not. This may be
  3636. // used to include empty fields in Patch requests.
  3637. ForceSendFields []string `json:"-"`
  3638. // NullFields is a list of field names (e.g. "Items") to include in API
  3639. // requests with the JSON null value. By default, fields with empty
  3640. // values are omitted from API requests. However, any field with an
  3641. // empty value appearing in NullFields will be sent to the server as
  3642. // null. It is an error if a field in this list has a non-empty value.
  3643. // This may be used to include null fields in Patch requests.
  3644. NullFields []string `json:"-"`
  3645. }
  3646. func (s *GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect) MarshalJSON() ([]byte, error) {
  3647. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect
  3648. raw := NoMethod(*s)
  3649. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3650. }
  3651. // GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem: An item
  3652. // in the carousel.
  3653. type GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem struct {
  3654. // Description: Optional. The body text of the card.
  3655. Description string `json:"description,omitempty"`
  3656. // Image: Optional. The image to display.
  3657. Image *GoogleCloudDialogflowV2beta1IntentMessageImage `json:"image,omitempty"`
  3658. // Info: Required. Additional info about the option item.
  3659. Info *GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo `json:"info,omitempty"`
  3660. // Title: Required. Title of the carousel item.
  3661. Title string `json:"title,omitempty"`
  3662. // ForceSendFields is a list of field names (e.g. "Description") to
  3663. // unconditionally include in API requests. By default, fields with
  3664. // empty values are omitted from API requests. However, any non-pointer,
  3665. // non-interface field appearing in ForceSendFields will be sent to the
  3666. // server regardless of whether the field is empty or not. This may be
  3667. // used to include empty fields in Patch requests.
  3668. ForceSendFields []string `json:"-"`
  3669. // NullFields is a list of field names (e.g. "Description") to include
  3670. // in API requests with the JSON null value. By default, fields with
  3671. // empty values are omitted from API requests. However, any field with
  3672. // an empty value appearing in NullFields will be sent to the server as
  3673. // null. It is an error if a field in this list has a non-empty value.
  3674. // This may be used to include null fields in Patch requests.
  3675. NullFields []string `json:"-"`
  3676. }
  3677. func (s *GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem) MarshalJSON() ([]byte, error) {
  3678. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem
  3679. raw := NoMethod(*s)
  3680. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3681. }
  3682. // GoogleCloudDialogflowV2beta1IntentMessageImage: The image response
  3683. // message.
  3684. type GoogleCloudDialogflowV2beta1IntentMessageImage struct {
  3685. // AccessibilityText: A text description of the image to be used for
  3686. // accessibility,
  3687. // e.g., screen readers. Required if image_uri is set for
  3688. // CarouselSelect.
  3689. AccessibilityText string `json:"accessibilityText,omitempty"`
  3690. // ImageUri: Optional. The public URI to an image file.
  3691. ImageUri string `json:"imageUri,omitempty"`
  3692. // ForceSendFields is a list of field names (e.g. "AccessibilityText")
  3693. // to unconditionally include in API requests. By default, fields with
  3694. // empty values are omitted from API requests. However, any non-pointer,
  3695. // non-interface field appearing in ForceSendFields will be sent to the
  3696. // server regardless of whether the field is empty or not. This may be
  3697. // used to include empty fields in Patch requests.
  3698. ForceSendFields []string `json:"-"`
  3699. // NullFields is a list of field names (e.g. "AccessibilityText") to
  3700. // include in API requests with the JSON null value. By default, fields
  3701. // with empty values are omitted from API requests. However, any field
  3702. // with an empty value appearing in NullFields will be sent to the
  3703. // server as null. It is an error if a field in this list has a
  3704. // non-empty value. This may be used to include null fields in Patch
  3705. // requests.
  3706. NullFields []string `json:"-"`
  3707. }
  3708. func (s *GoogleCloudDialogflowV2beta1IntentMessageImage) MarshalJSON() ([]byte, error) {
  3709. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageImage
  3710. raw := NoMethod(*s)
  3711. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3712. }
  3713. // GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion: The
  3714. // suggestion chip message that allows the user to jump out to the
  3715. // app
  3716. // or website associated with this agent.
  3717. type GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion struct {
  3718. // DestinationName: Required. The name of the app or site this chip is
  3719. // linking to.
  3720. DestinationName string `json:"destinationName,omitempty"`
  3721. // Uri: Required. The URI of the app or site to open when the user taps
  3722. // the
  3723. // suggestion chip.
  3724. Uri string `json:"uri,omitempty"`
  3725. // ForceSendFields is a list of field names (e.g. "DestinationName") to
  3726. // unconditionally include in API requests. By default, fields with
  3727. // empty values are omitted from API requests. However, any non-pointer,
  3728. // non-interface field appearing in ForceSendFields will be sent to the
  3729. // server regardless of whether the field is empty or not. This may be
  3730. // used to include empty fields in Patch requests.
  3731. ForceSendFields []string `json:"-"`
  3732. // NullFields is a list of field names (e.g. "DestinationName") to
  3733. // include in API requests with the JSON null value. By default, fields
  3734. // with empty values are omitted from API requests. However, any field
  3735. // with an empty value appearing in NullFields will be sent to the
  3736. // server as null. It is an error if a field in this list has a
  3737. // non-empty value. This may be used to include null fields in Patch
  3738. // requests.
  3739. NullFields []string `json:"-"`
  3740. }
  3741. func (s *GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion) MarshalJSON() ([]byte, error) {
  3742. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion
  3743. raw := NoMethod(*s)
  3744. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3745. }
  3746. // GoogleCloudDialogflowV2beta1IntentMessageListSelect: The card for
  3747. // presenting a list of options to select from.
  3748. type GoogleCloudDialogflowV2beta1IntentMessageListSelect struct {
  3749. // Items: Required. List items.
  3750. Items []*GoogleCloudDialogflowV2beta1IntentMessageListSelectItem `json:"items,omitempty"`
  3751. // Title: Optional. The overall title of the list.
  3752. Title string `json:"title,omitempty"`
  3753. // ForceSendFields is a list of field names (e.g. "Items") to
  3754. // unconditionally include in API requests. By default, fields with
  3755. // empty values are omitted from API requests. However, any non-pointer,
  3756. // non-interface field appearing in ForceSendFields will be sent to the
  3757. // server regardless of whether the field is empty or not. This may be
  3758. // used to include empty fields in Patch requests.
  3759. ForceSendFields []string `json:"-"`
  3760. // NullFields is a list of field names (e.g. "Items") to include in API
  3761. // requests with the JSON null value. By default, fields with empty
  3762. // values are omitted from API requests. However, any field with an
  3763. // empty value appearing in NullFields will be sent to the server as
  3764. // null. It is an error if a field in this list has a non-empty value.
  3765. // This may be used to include null fields in Patch requests.
  3766. NullFields []string `json:"-"`
  3767. }
  3768. func (s *GoogleCloudDialogflowV2beta1IntentMessageListSelect) MarshalJSON() ([]byte, error) {
  3769. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageListSelect
  3770. raw := NoMethod(*s)
  3771. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3772. }
  3773. // GoogleCloudDialogflowV2beta1IntentMessageListSelectItem: An item in
  3774. // the list.
  3775. type GoogleCloudDialogflowV2beta1IntentMessageListSelectItem struct {
  3776. // Description: Optional. The main text describing the item.
  3777. Description string `json:"description,omitempty"`
  3778. // Image: Optional. The image to display.
  3779. Image *GoogleCloudDialogflowV2beta1IntentMessageImage `json:"image,omitempty"`
  3780. // Info: Required. Additional information about this option.
  3781. Info *GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo `json:"info,omitempty"`
  3782. // Title: Required. The title of the list item.
  3783. Title string `json:"title,omitempty"`
  3784. // ForceSendFields is a list of field names (e.g. "Description") to
  3785. // unconditionally include in API requests. By default, fields with
  3786. // empty values are omitted from API requests. However, any non-pointer,
  3787. // non-interface field appearing in ForceSendFields will be sent to the
  3788. // server regardless of whether the field is empty or not. This may be
  3789. // used to include empty fields in Patch requests.
  3790. ForceSendFields []string `json:"-"`
  3791. // NullFields is a list of field names (e.g. "Description") to include
  3792. // in API requests with the JSON null value. By default, fields with
  3793. // empty values are omitted from API requests. However, any field with
  3794. // an empty value appearing in NullFields will be sent to the server as
  3795. // null. It is an error if a field in this list has a non-empty value.
  3796. // This may be used to include null fields in Patch requests.
  3797. NullFields []string `json:"-"`
  3798. }
  3799. func (s *GoogleCloudDialogflowV2beta1IntentMessageListSelectItem) MarshalJSON() ([]byte, error) {
  3800. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageListSelectItem
  3801. raw := NoMethod(*s)
  3802. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3803. }
  3804. // GoogleCloudDialogflowV2beta1IntentMessageQuickReplies: The quick
  3805. // replies response message.
  3806. type GoogleCloudDialogflowV2beta1IntentMessageQuickReplies struct {
  3807. // QuickReplies: Optional. The collection of quick replies.
  3808. QuickReplies []string `json:"quickReplies,omitempty"`
  3809. // Title: Optional. The title of the collection of quick replies.
  3810. Title string `json:"title,omitempty"`
  3811. // ForceSendFields is a list of field names (e.g. "QuickReplies") to
  3812. // unconditionally include in API requests. By default, fields with
  3813. // empty values are omitted from API requests. However, any non-pointer,
  3814. // non-interface field appearing in ForceSendFields will be sent to the
  3815. // server regardless of whether the field is empty or not. This may be
  3816. // used to include empty fields in Patch requests.
  3817. ForceSendFields []string `json:"-"`
  3818. // NullFields is a list of field names (e.g. "QuickReplies") to include
  3819. // in API requests with the JSON null value. By default, fields with
  3820. // empty values are omitted from API requests. However, any field with
  3821. // an empty value appearing in NullFields will be sent to the server as
  3822. // null. It is an error if a field in this list has a non-empty value.
  3823. // This may be used to include null fields in Patch requests.
  3824. NullFields []string `json:"-"`
  3825. }
  3826. func (s *GoogleCloudDialogflowV2beta1IntentMessageQuickReplies) MarshalJSON() ([]byte, error) {
  3827. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageQuickReplies
  3828. raw := NoMethod(*s)
  3829. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3830. }
  3831. // GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo: Additional
  3832. // info about the select item for when it is triggered in a
  3833. // dialog.
  3834. type GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo struct {
  3835. // Key: Required. A unique key that will be sent back to the agent if
  3836. // this
  3837. // response is given.
  3838. Key string `json:"key,omitempty"`
  3839. // Synonyms: Optional. A list of synonyms that can also be used to
  3840. // trigger this
  3841. // item in dialog.
  3842. Synonyms []string `json:"synonyms,omitempty"`
  3843. // ForceSendFields is a list of field names (e.g. "Key") to
  3844. // unconditionally include in API requests. By default, fields with
  3845. // empty values are omitted from API requests. However, any non-pointer,
  3846. // non-interface field appearing in ForceSendFields will be sent to the
  3847. // server regardless of whether the field is empty or not. This may be
  3848. // used to include empty fields in Patch requests.
  3849. ForceSendFields []string `json:"-"`
  3850. // NullFields is a list of field names (e.g. "Key") to include in API
  3851. // requests with the JSON null value. By default, fields with empty
  3852. // values are omitted from API requests. However, any field with an
  3853. // empty value appearing in NullFields will be sent to the server as
  3854. // null. It is an error if a field in this list has a non-empty value.
  3855. // This may be used to include null fields in Patch requests.
  3856. NullFields []string `json:"-"`
  3857. }
  3858. func (s *GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo) MarshalJSON() ([]byte, error) {
  3859. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo
  3860. raw := NoMethod(*s)
  3861. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3862. }
  3863. // GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse: The simple
  3864. // response message containing speech or text.
  3865. type GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse struct {
  3866. // DisplayText: Optional. The text to display.
  3867. DisplayText string `json:"displayText,omitempty"`
  3868. // Ssml: One of text_to_speech or ssml must be provided. Structured
  3869. // spoken
  3870. // response to the user in the SSML format. Mutually exclusive
  3871. // with
  3872. // text_to_speech.
  3873. Ssml string `json:"ssml,omitempty"`
  3874. // TextToSpeech: One of text_to_speech or ssml must be provided. The
  3875. // plain text of the
  3876. // speech output. Mutually exclusive with ssml.
  3877. TextToSpeech string `json:"textToSpeech,omitempty"`
  3878. // ForceSendFields is a list of field names (e.g. "DisplayText") to
  3879. // unconditionally include in API requests. By default, fields with
  3880. // empty values are omitted from API requests. However, any non-pointer,
  3881. // non-interface field appearing in ForceSendFields will be sent to the
  3882. // server regardless of whether the field is empty or not. This may be
  3883. // used to include empty fields in Patch requests.
  3884. ForceSendFields []string `json:"-"`
  3885. // NullFields is a list of field names (e.g. "DisplayText") to include
  3886. // in API requests with the JSON null value. By default, fields with
  3887. // empty values are omitted from API requests. However, any field with
  3888. // an empty value appearing in NullFields will be sent to the server as
  3889. // null. It is an error if a field in this list has a non-empty value.
  3890. // This may be used to include null fields in Patch requests.
  3891. NullFields []string `json:"-"`
  3892. }
  3893. func (s *GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse) MarshalJSON() ([]byte, error) {
  3894. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse
  3895. raw := NoMethod(*s)
  3896. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3897. }
  3898. // GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses: The
  3899. // collection of simple response candidates.
  3900. // This message in `QueryResult.fulfillment_messages`
  3901. // and
  3902. // `WebhookResponse.fulfillment_messages` should contain only
  3903. // one
  3904. // `SimpleResponse`.
  3905. type GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses struct {
  3906. // SimpleResponses: Required. The list of simple responses.
  3907. SimpleResponses []*GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse `json:"simpleResponses,omitempty"`
  3908. // ForceSendFields is a list of field names (e.g. "SimpleResponses") to
  3909. // unconditionally include in API requests. By default, fields with
  3910. // empty values are omitted from API requests. However, any non-pointer,
  3911. // non-interface field appearing in ForceSendFields will be sent to the
  3912. // server regardless of whether the field is empty or not. This may be
  3913. // used to include empty fields in Patch requests.
  3914. ForceSendFields []string `json:"-"`
  3915. // NullFields is a list of field names (e.g. "SimpleResponses") to
  3916. // include in API requests with the JSON null value. By default, fields
  3917. // with empty values are omitted from API requests. However, any field
  3918. // with an empty value appearing in NullFields will be sent to the
  3919. // server as null. It is an error if a field in this list has a
  3920. // non-empty value. This may be used to include null fields in Patch
  3921. // requests.
  3922. NullFields []string `json:"-"`
  3923. }
  3924. func (s *GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses) MarshalJSON() ([]byte, error) {
  3925. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses
  3926. raw := NoMethod(*s)
  3927. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3928. }
  3929. // GoogleCloudDialogflowV2beta1IntentMessageSuggestion: The suggestion
  3930. // chip message that the user can tap to quickly post a reply
  3931. // to the conversation.
  3932. type GoogleCloudDialogflowV2beta1IntentMessageSuggestion struct {
  3933. // Title: Required. The text shown the in the suggestion chip.
  3934. Title string `json:"title,omitempty"`
  3935. // ForceSendFields is a list of field names (e.g. "Title") to
  3936. // unconditionally include in API requests. By default, fields with
  3937. // empty values are omitted from API requests. However, any non-pointer,
  3938. // non-interface field appearing in ForceSendFields will be sent to the
  3939. // server regardless of whether the field is empty or not. This may be
  3940. // used to include empty fields in Patch requests.
  3941. ForceSendFields []string `json:"-"`
  3942. // NullFields is a list of field names (e.g. "Title") to include in API
  3943. // requests with the JSON null value. By default, fields with empty
  3944. // values are omitted from API requests. However, any field with an
  3945. // empty value appearing in NullFields will be sent to the server as
  3946. // null. It is an error if a field in this list has a non-empty value.
  3947. // This may be used to include null fields in Patch requests.
  3948. NullFields []string `json:"-"`
  3949. }
  3950. func (s *GoogleCloudDialogflowV2beta1IntentMessageSuggestion) MarshalJSON() ([]byte, error) {
  3951. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageSuggestion
  3952. raw := NoMethod(*s)
  3953. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3954. }
  3955. // GoogleCloudDialogflowV2beta1IntentMessageSuggestions: The collection
  3956. // of suggestions.
  3957. type GoogleCloudDialogflowV2beta1IntentMessageSuggestions struct {
  3958. // Suggestions: Required. The list of suggested replies.
  3959. Suggestions []*GoogleCloudDialogflowV2beta1IntentMessageSuggestion `json:"suggestions,omitempty"`
  3960. // ForceSendFields is a list of field names (e.g. "Suggestions") to
  3961. // unconditionally include in API requests. By default, fields with
  3962. // empty values are omitted from API requests. However, any non-pointer,
  3963. // non-interface field appearing in ForceSendFields will be sent to the
  3964. // server regardless of whether the field is empty or not. This may be
  3965. // used to include empty fields in Patch requests.
  3966. ForceSendFields []string `json:"-"`
  3967. // NullFields is a list of field names (e.g. "Suggestions") to include
  3968. // in API requests with the JSON null value. By default, fields with
  3969. // empty values are omitted from API requests. However, any field with
  3970. // an empty value appearing in NullFields will be sent to the server as
  3971. // null. It is an error if a field in this list has a non-empty value.
  3972. // This may be used to include null fields in Patch requests.
  3973. NullFields []string `json:"-"`
  3974. }
  3975. func (s *GoogleCloudDialogflowV2beta1IntentMessageSuggestions) MarshalJSON() ([]byte, error) {
  3976. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageSuggestions
  3977. raw := NoMethod(*s)
  3978. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3979. }
  3980. // GoogleCloudDialogflowV2beta1IntentMessageText: The text response
  3981. // message.
  3982. type GoogleCloudDialogflowV2beta1IntentMessageText struct {
  3983. // Text: Optional. The collection of the agent's responses.
  3984. Text []string `json:"text,omitempty"`
  3985. // ForceSendFields is a list of field names (e.g. "Text") to
  3986. // unconditionally include in API requests. By default, fields with
  3987. // empty values are omitted from API requests. However, any non-pointer,
  3988. // non-interface field appearing in ForceSendFields will be sent to the
  3989. // server regardless of whether the field is empty or not. This may be
  3990. // used to include empty fields in Patch requests.
  3991. ForceSendFields []string `json:"-"`
  3992. // NullFields is a list of field names (e.g. "Text") to include in API
  3993. // requests with the JSON null value. By default, fields with empty
  3994. // values are omitted from API requests. However, any field with an
  3995. // empty value appearing in NullFields will be sent to the server as
  3996. // null. It is an error if a field in this list has a non-empty value.
  3997. // This may be used to include null fields in Patch requests.
  3998. NullFields []string `json:"-"`
  3999. }
  4000. func (s *GoogleCloudDialogflowV2beta1IntentMessageText) MarshalJSON() ([]byte, error) {
  4001. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageText
  4002. raw := NoMethod(*s)
  4003. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4004. }
  4005. // GoogleCloudDialogflowV2beta1IntentParameter: Represents intent
  4006. // parameters.
  4007. type GoogleCloudDialogflowV2beta1IntentParameter struct {
  4008. // DefaultValue: Optional. The default value to use when the `value`
  4009. // yields an empty
  4010. // result.
  4011. // Default values can be extracted from contexts by using the
  4012. // following
  4013. // syntax: `#context_name.parameter_name`.
  4014. DefaultValue string `json:"defaultValue,omitempty"`
  4015. // DisplayName: Required. The name of the parameter.
  4016. DisplayName string `json:"displayName,omitempty"`
  4017. // EntityTypeDisplayName: Optional. The name of the entity type,
  4018. // prefixed with `@`, that
  4019. // describes values of the parameter. If the parameter is
  4020. // required, this must be provided.
  4021. EntityTypeDisplayName string `json:"entityTypeDisplayName,omitempty"`
  4022. // IsList: Optional. Indicates whether the parameter represents a list
  4023. // of values.
  4024. IsList bool `json:"isList,omitempty"`
  4025. // Mandatory: Optional. Indicates whether the parameter is required.
  4026. // That is,
  4027. // whether the intent cannot be completed without collecting the
  4028. // parameter
  4029. // value.
  4030. Mandatory bool `json:"mandatory,omitempty"`
  4031. // Name: The unique identifier of this parameter.
  4032. Name string `json:"name,omitempty"`
  4033. // Prompts: Optional. The collection of prompts that the agent can
  4034. // present to the
  4035. // user in order to collect value for the parameter.
  4036. Prompts []string `json:"prompts,omitempty"`
  4037. // Value: Optional. The definition of the parameter value. It can be:
  4038. // - a constant string,
  4039. // - a parameter value defined as `$parameter_name`,
  4040. // - an original parameter value defined as
  4041. // `$parameter_name.original`,
  4042. // - a parameter value from some context defined as
  4043. // `#context_name.parameter_name`.
  4044. Value string `json:"value,omitempty"`
  4045. // ForceSendFields is a list of field names (e.g. "DefaultValue") to
  4046. // unconditionally include in API requests. By default, fields with
  4047. // empty values are omitted from API requests. However, any non-pointer,
  4048. // non-interface field appearing in ForceSendFields will be sent to the
  4049. // server regardless of whether the field is empty or not. This may be
  4050. // used to include empty fields in Patch requests.
  4051. ForceSendFields []string `json:"-"`
  4052. // NullFields is a list of field names (e.g. "DefaultValue") to include
  4053. // in API requests with the JSON null value. By default, fields with
  4054. // empty values are omitted from API requests. However, any field with
  4055. // an empty value appearing in NullFields will be sent to the server as
  4056. // null. It is an error if a field in this list has a non-empty value.
  4057. // This may be used to include null fields in Patch requests.
  4058. NullFields []string `json:"-"`
  4059. }
  4060. func (s *GoogleCloudDialogflowV2beta1IntentParameter) MarshalJSON() ([]byte, error) {
  4061. type NoMethod GoogleCloudDialogflowV2beta1IntentParameter
  4062. raw := NoMethod(*s)
  4063. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4064. }
  4065. // GoogleCloudDialogflowV2beta1IntentTrainingPhrase: Represents an
  4066. // example or template that the agent is trained on.
  4067. type GoogleCloudDialogflowV2beta1IntentTrainingPhrase struct {
  4068. // Name: Required. The unique identifier of this training phrase.
  4069. Name string `json:"name,omitempty"`
  4070. // Parts: Required. The collection of training phrase parts (can be
  4071. // annotated).
  4072. // Fields: `entity_type`, `alias` and `user_defined` should be
  4073. // populated
  4074. // only for the annotated parts of the training phrase.
  4075. Parts []*GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart `json:"parts,omitempty"`
  4076. // TimesAddedCount: Optional. Indicates how many times this example or
  4077. // template was added to
  4078. // the intent. Each time a developer adds an existing sample by editing
  4079. // an
  4080. // intent or training, this counter is increased.
  4081. TimesAddedCount int64 `json:"timesAddedCount,omitempty"`
  4082. // Type: Required. The type of the training phrase.
  4083. //
  4084. // Possible values:
  4085. // "TYPE_UNSPECIFIED" - Not specified. This value should never be
  4086. // used.
  4087. // "EXAMPLE" - Examples do not contain @-prefixed entity type names,
  4088. // but example parts
  4089. // can be annotated with entity types.
  4090. // "TEMPLATE" - Templates are not annotated with entity types, but
  4091. // they can contain
  4092. // @-prefixed entity type names as substrings.
  4093. Type string `json:"type,omitempty"`
  4094. // ForceSendFields is a list of field names (e.g. "Name") to
  4095. // unconditionally include in API requests. By default, fields with
  4096. // empty values are omitted from API requests. However, any non-pointer,
  4097. // non-interface field appearing in ForceSendFields will be sent to the
  4098. // server regardless of whether the field is empty or not. This may be
  4099. // used to include empty fields in Patch requests.
  4100. ForceSendFields []string `json:"-"`
  4101. // NullFields is a list of field names (e.g. "Name") to include in API
  4102. // requests with the JSON null value. By default, fields with empty
  4103. // values are omitted from API requests. However, any field with an
  4104. // empty value appearing in NullFields will be sent to the server as
  4105. // null. It is an error if a field in this list has a non-empty value.
  4106. // This may be used to include null fields in Patch requests.
  4107. NullFields []string `json:"-"`
  4108. }
  4109. func (s *GoogleCloudDialogflowV2beta1IntentTrainingPhrase) MarshalJSON() ([]byte, error) {
  4110. type NoMethod GoogleCloudDialogflowV2beta1IntentTrainingPhrase
  4111. raw := NoMethod(*s)
  4112. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4113. }
  4114. // GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart: Represents a
  4115. // part of a training phrase.
  4116. type GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart struct {
  4117. // Alias: Optional. The parameter name for the value extracted from
  4118. // the
  4119. // annotated part of the example.
  4120. Alias string `json:"alias,omitempty"`
  4121. // EntityType: Optional. The entity type name prefixed with `@`. This
  4122. // field is
  4123. // required for the annotated part of the text and applies only
  4124. // to
  4125. // examples.
  4126. EntityType string `json:"entityType,omitempty"`
  4127. // Text: Required. The text corresponding to the example or template,
  4128. // if there are no annotations. For
  4129. // annotated examples, it is the text for one of the example's parts.
  4130. Text string `json:"text,omitempty"`
  4131. // UserDefined: Optional. Indicates whether the text was manually
  4132. // annotated by the
  4133. // developer.
  4134. UserDefined bool `json:"userDefined,omitempty"`
  4135. // ForceSendFields is a list of field names (e.g. "Alias") to
  4136. // unconditionally include in API requests. By default, fields with
  4137. // empty values are omitted from API requests. However, any non-pointer,
  4138. // non-interface field appearing in ForceSendFields will be sent to the
  4139. // server regardless of whether the field is empty or not. This may be
  4140. // used to include empty fields in Patch requests.
  4141. ForceSendFields []string `json:"-"`
  4142. // NullFields is a list of field names (e.g. "Alias") to include in API
  4143. // requests with the JSON null value. By default, fields with empty
  4144. // values are omitted from API requests. However, any field with an
  4145. // empty value appearing in NullFields will be sent to the server as
  4146. // null. It is an error if a field in this list has a non-empty value.
  4147. // This may be used to include null fields in Patch requests.
  4148. NullFields []string `json:"-"`
  4149. }
  4150. func (s *GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart) MarshalJSON() ([]byte, error) {
  4151. type NoMethod GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart
  4152. raw := NoMethod(*s)
  4153. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4154. }
  4155. // GoogleCloudDialogflowV2beta1KnowledgeOperationMetadata: Metadata in
  4156. // google::longrunning::Operation for Knowledge operations.
  4157. type GoogleCloudDialogflowV2beta1KnowledgeOperationMetadata struct {
  4158. // State: Required. The current state of this operation.
  4159. //
  4160. // Possible values:
  4161. // "STATE_UNSPECIFIED" - State unspecified.
  4162. // "PENDING" - The operation has been created.
  4163. // "RUNNING" - The operation is currently running.
  4164. // "DONE" - The operation is done, either cancelled or completed.
  4165. State string `json:"state,omitempty"`
  4166. // ForceSendFields is a list of field names (e.g. "State") to
  4167. // unconditionally include in API requests. By default, fields with
  4168. // empty values are omitted from API requests. However, any non-pointer,
  4169. // non-interface field appearing in ForceSendFields will be sent to the
  4170. // server regardless of whether the field is empty or not. This may be
  4171. // used to include empty fields in Patch requests.
  4172. ForceSendFields []string `json:"-"`
  4173. // NullFields is a list of field names (e.g. "State") to include in API
  4174. // requests with the JSON null value. By default, fields with empty
  4175. // values are omitted from API requests. However, any field with an
  4176. // empty value appearing in NullFields will be sent to the server as
  4177. // null. It is an error if a field in this list has a non-empty value.
  4178. // This may be used to include null fields in Patch requests.
  4179. NullFields []string `json:"-"`
  4180. }
  4181. func (s *GoogleCloudDialogflowV2beta1KnowledgeOperationMetadata) MarshalJSON() ([]byte, error) {
  4182. type NoMethod GoogleCloudDialogflowV2beta1KnowledgeOperationMetadata
  4183. raw := NoMethod(*s)
  4184. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4185. }
  4186. // GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest: Represents
  4187. // the contents of the original request that was passed to
  4188. // the `[Streaming]DetectIntent` call.
  4189. type GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest struct {
  4190. // Payload: Optional. This field is set to the value of
  4191. // `QueryParameters.payload` field
  4192. // passed in the request.
  4193. Payload googleapi.RawMessage `json:"payload,omitempty"`
  4194. // Source: The source of this request, e.g., `google`, `facebook`,
  4195. // `slack`. It is set
  4196. // by Dialogflow-owned servers.
  4197. Source string `json:"source,omitempty"`
  4198. // ForceSendFields is a list of field names (e.g. "Payload") to
  4199. // unconditionally include in API requests. By default, fields with
  4200. // empty values are omitted from API requests. However, any non-pointer,
  4201. // non-interface field appearing in ForceSendFields will be sent to the
  4202. // server regardless of whether the field is empty or not. This may be
  4203. // used to include empty fields in Patch requests.
  4204. ForceSendFields []string `json:"-"`
  4205. // NullFields is a list of field names (e.g. "Payload") to include in
  4206. // API requests with the JSON null value. By default, fields with empty
  4207. // values are omitted from API requests. However, any field with an
  4208. // empty value appearing in NullFields will be sent to the server as
  4209. // null. It is an error if a field in this list has a non-empty value.
  4210. // This may be used to include null fields in Patch requests.
  4211. NullFields []string `json:"-"`
  4212. }
  4213. func (s *GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest) MarshalJSON() ([]byte, error) {
  4214. type NoMethod GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest
  4215. raw := NoMethod(*s)
  4216. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4217. }
  4218. // GoogleCloudDialogflowV2beta1QueryResult: Represents the result of
  4219. // conversational query or event processing.
  4220. type GoogleCloudDialogflowV2beta1QueryResult struct {
  4221. // Action: The action name from the matched intent.
  4222. Action string `json:"action,omitempty"`
  4223. // AllRequiredParamsPresent: This field is set to:
  4224. // - `false` if the matched intent has required parameters and not all
  4225. // of
  4226. // the required parameter values have been collected.
  4227. // - `true` if all required parameter values have been collected, or if
  4228. // the
  4229. // matched intent doesn't contain any required parameters.
  4230. AllRequiredParamsPresent bool `json:"allRequiredParamsPresent,omitempty"`
  4231. // DiagnosticInfo: The free-form diagnostic info. For example, this
  4232. // field
  4233. // could contain webhook call latency.
  4234. DiagnosticInfo googleapi.RawMessage `json:"diagnosticInfo,omitempty"`
  4235. // FulfillmentMessages: The collection of rich messages to present to
  4236. // the user.
  4237. FulfillmentMessages []*GoogleCloudDialogflowV2beta1IntentMessage `json:"fulfillmentMessages,omitempty"`
  4238. // FulfillmentText: The text to be pronounced to the user or shown on
  4239. // the screen.
  4240. FulfillmentText string `json:"fulfillmentText,omitempty"`
  4241. // Intent: The intent that matched the conversational query. Some,
  4242. // not
  4243. // all fields are filled in this message, including but not limited
  4244. // to:
  4245. // `name`, `display_name` and `webhook_state`.
  4246. Intent *GoogleCloudDialogflowV2beta1Intent `json:"intent,omitempty"`
  4247. // IntentDetectionConfidence: The intent detection confidence. Values
  4248. // range from 0.0
  4249. // (completely uncertain) to 1.0 (completely certain).
  4250. IntentDetectionConfidence float64 `json:"intentDetectionConfidence,omitempty"`
  4251. // LanguageCode: The language that was triggered during intent
  4252. // detection.
  4253. // See [Language
  4254. // Support](https://dialogflow.com/docs/reference/language)
  4255. // for a list of the currently supported language codes.
  4256. LanguageCode string `json:"languageCode,omitempty"`
  4257. // OutputContexts: The collection of output contexts. If
  4258. // applicable,
  4259. // `output_contexts.parameters` contains entries with name
  4260. // `<parameter name>.original` containing the original parameter
  4261. // values
  4262. // before the query.
  4263. OutputContexts []*GoogleCloudDialogflowV2beta1Context `json:"outputContexts,omitempty"`
  4264. // Parameters: The collection of extracted parameters.
  4265. Parameters googleapi.RawMessage `json:"parameters,omitempty"`
  4266. // QueryText: The original conversational query text:
  4267. // - If natural language text was provided as input, `query_text`
  4268. // contains
  4269. // a copy of the input.
  4270. // - If natural language speech audio was provided as input,
  4271. // `query_text`
  4272. // contains the speech recognition result. If speech recognizer
  4273. // produced
  4274. // multiple alternatives, a particular one is picked.
  4275. // - If an event was provided as input, `query_text` is not set.
  4276. QueryText string `json:"queryText,omitempty"`
  4277. // SpeechRecognitionConfidence: The Speech recognition confidence
  4278. // between 0.0 and 1.0. A higher number
  4279. // indicates an estimated greater likelihood that the recognized words
  4280. // are
  4281. // correct. The default of 0.0 is a sentinel value indicating that
  4282. // confidence
  4283. // was not set.
  4284. //
  4285. // This field is not guaranteed to be accurate or set. In particular
  4286. // this
  4287. // field isn't set for StreamingDetectIntent since the streaming
  4288. // endpoint has
  4289. // separate confidence estimates per portion of the audio
  4290. // in
  4291. // StreamingRecognitionResult.
  4292. SpeechRecognitionConfidence float64 `json:"speechRecognitionConfidence,omitempty"`
  4293. // WebhookPayload: If the query was fulfilled by a webhook call, this
  4294. // field is set to the
  4295. // value of the `payload` field returned in the webhook response.
  4296. WebhookPayload googleapi.RawMessage `json:"webhookPayload,omitempty"`
  4297. // WebhookSource: If the query was fulfilled by a webhook call, this
  4298. // field is set to the
  4299. // value of the `source` field returned in the webhook response.
  4300. WebhookSource string `json:"webhookSource,omitempty"`
  4301. // ForceSendFields is a list of field names (e.g. "Action") to
  4302. // unconditionally include in API requests. By default, fields with
  4303. // empty values are omitted from API requests. However, any non-pointer,
  4304. // non-interface field appearing in ForceSendFields will be sent to the
  4305. // server regardless of whether the field is empty or not. This may be
  4306. // used to include empty fields in Patch requests.
  4307. ForceSendFields []string `json:"-"`
  4308. // NullFields is a list of field names (e.g. "Action") to include in API
  4309. // requests with the JSON null value. By default, fields with empty
  4310. // values are omitted from API requests. However, any field with an
  4311. // empty value appearing in NullFields will be sent to the server as
  4312. // null. It is an error if a field in this list has a non-empty value.
  4313. // This may be used to include null fields in Patch requests.
  4314. NullFields []string `json:"-"`
  4315. }
  4316. func (s *GoogleCloudDialogflowV2beta1QueryResult) MarshalJSON() ([]byte, error) {
  4317. type NoMethod GoogleCloudDialogflowV2beta1QueryResult
  4318. raw := NoMethod(*s)
  4319. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4320. }
  4321. func (s *GoogleCloudDialogflowV2beta1QueryResult) UnmarshalJSON(data []byte) error {
  4322. type NoMethod GoogleCloudDialogflowV2beta1QueryResult
  4323. var s1 struct {
  4324. IntentDetectionConfidence gensupport.JSONFloat64 `json:"intentDetectionConfidence"`
  4325. SpeechRecognitionConfidence gensupport.JSONFloat64 `json:"speechRecognitionConfidence"`
  4326. *NoMethod
  4327. }
  4328. s1.NoMethod = (*NoMethod)(s)
  4329. if err := json.Unmarshal(data, &s1); err != nil {
  4330. return err
  4331. }
  4332. s.IntentDetectionConfidence = float64(s1.IntentDetectionConfidence)
  4333. s.SpeechRecognitionConfidence = float64(s1.SpeechRecognitionConfidence)
  4334. return nil
  4335. }
  4336. // GoogleCloudDialogflowV2beta1WebhookRequest: The request message for a
  4337. // webhook call.
  4338. type GoogleCloudDialogflowV2beta1WebhookRequest struct {
  4339. // OriginalDetectIntentRequest: Optional. The contents of the original
  4340. // request that was passed to
  4341. // `[Streaming]DetectIntent` call.
  4342. OriginalDetectIntentRequest *GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest `json:"originalDetectIntentRequest,omitempty"`
  4343. // QueryResult: The result of the conversational query or event
  4344. // processing. Contains the
  4345. // same value as `[Streaming]DetectIntentResponse.query_result`.
  4346. QueryResult *GoogleCloudDialogflowV2beta1QueryResult `json:"queryResult,omitempty"`
  4347. // ResponseId: The unique identifier of the response. Contains the same
  4348. // value as
  4349. // `[Streaming]DetectIntentResponse.response_id`.
  4350. ResponseId string `json:"responseId,omitempty"`
  4351. // Session: The unique identifier of detectIntent request session.
  4352. // Can be used to identify end-user inside webhook
  4353. // implementation.
  4354. // Format: `projects/<Project ID>/agent/sessions/<Session ID>`.
  4355. Session string `json:"session,omitempty"`
  4356. // ForceSendFields is a list of field names (e.g.
  4357. // "OriginalDetectIntentRequest") to unconditionally include in API
  4358. // requests. By default, fields with empty values are omitted from API
  4359. // requests. However, any non-pointer, non-interface field appearing in
  4360. // ForceSendFields will be sent to the server regardless of whether the
  4361. // field is empty or not. This may be used to include empty fields in
  4362. // Patch requests.
  4363. ForceSendFields []string `json:"-"`
  4364. // NullFields is a list of field names (e.g.
  4365. // "OriginalDetectIntentRequest") to include in API requests with the
  4366. // JSON null value. By default, fields with empty values are omitted
  4367. // from API requests. However, any field with an empty value appearing
  4368. // in NullFields will be sent to the server as null. It is an error if a
  4369. // field in this list has a non-empty value. This may be used to include
  4370. // null fields in Patch requests.
  4371. NullFields []string `json:"-"`
  4372. }
  4373. func (s *GoogleCloudDialogflowV2beta1WebhookRequest) MarshalJSON() ([]byte, error) {
  4374. type NoMethod GoogleCloudDialogflowV2beta1WebhookRequest
  4375. raw := NoMethod(*s)
  4376. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4377. }
  4378. // GoogleCloudDialogflowV2beta1WebhookResponse: The response message for
  4379. // a webhook call.
  4380. type GoogleCloudDialogflowV2beta1WebhookResponse struct {
  4381. // FollowupEventInput: Optional. Makes the platform immediately invoke
  4382. // another `DetectIntent` call
  4383. // internally with the specified event as input.
  4384. FollowupEventInput *GoogleCloudDialogflowV2beta1EventInput `json:"followupEventInput,omitempty"`
  4385. // FulfillmentMessages: Optional. The collection of rich messages to
  4386. // present to the user. This
  4387. // value is passed directly to `QueryResult.fulfillment_messages`.
  4388. FulfillmentMessages []*GoogleCloudDialogflowV2beta1IntentMessage `json:"fulfillmentMessages,omitempty"`
  4389. // FulfillmentText: Optional. The text to be shown on the screen. This
  4390. // value is passed directly
  4391. // to `QueryResult.fulfillment_text`.
  4392. FulfillmentText string `json:"fulfillmentText,omitempty"`
  4393. // OutputContexts: Optional. The collection of output contexts. This
  4394. // value is passed directly
  4395. // to `QueryResult.output_contexts`.
  4396. OutputContexts []*GoogleCloudDialogflowV2beta1Context `json:"outputContexts,omitempty"`
  4397. // Payload: Optional. This value is passed directly to
  4398. // `QueryResult.webhook_payload`.
  4399. // See the related `fulfillment_messages[i].payload field`, which may be
  4400. // used
  4401. // as an alternative to this field.
  4402. //
  4403. // This field can be used for Actions on Google responses.
  4404. // It should have a structure similar to the JSON message shown here.
  4405. // For more
  4406. // information, see
  4407. // [Actions on Google
  4408. // Webhook
  4409. // Format](https://developers.google.com/actions/dialogflow/webho
  4410. // ok)
  4411. // <pre>{
  4412. // "google": {
  4413. // "expectUserResponse": true,
  4414. // "richResponse": {
  4415. // "items": [
  4416. // {
  4417. // "simpleResponse": {
  4418. // "textToSpeech": "this is a simple response"
  4419. // }
  4420. // }
  4421. // ]
  4422. // }
  4423. // }
  4424. // }</pre>
  4425. Payload googleapi.RawMessage `json:"payload,omitempty"`
  4426. // Source: Optional. This value is passed directly to
  4427. // `QueryResult.webhook_source`.
  4428. Source string `json:"source,omitempty"`
  4429. // ForceSendFields is a list of field names (e.g. "FollowupEventInput")
  4430. // to 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. "FollowupEventInput") to
  4437. // include in API requests with the JSON null value. By default, fields
  4438. // with empty values are omitted from API requests. However, any field
  4439. // with an empty value appearing in NullFields will be sent to the
  4440. // server as null. It is an error if a field in this list has a
  4441. // non-empty value. This may be used to include null fields in Patch
  4442. // requests.
  4443. NullFields []string `json:"-"`
  4444. }
  4445. func (s *GoogleCloudDialogflowV2beta1WebhookResponse) MarshalJSON() ([]byte, error) {
  4446. type NoMethod GoogleCloudDialogflowV2beta1WebhookResponse
  4447. raw := NoMethod(*s)
  4448. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4449. }
  4450. // GoogleLongrunningOperation: This resource represents a long-running
  4451. // operation that is the result of a
  4452. // network API call.
  4453. type GoogleLongrunningOperation struct {
  4454. // Done: If the value is `false`, it means the operation is still in
  4455. // progress.
  4456. // If `true`, the operation is completed, and either `error` or
  4457. // `response` is
  4458. // available.
  4459. Done bool `json:"done,omitempty"`
  4460. // Error: The error result of the operation in case of failure or
  4461. // cancellation.
  4462. Error *GoogleRpcStatus `json:"error,omitempty"`
  4463. // Metadata: Service-specific metadata associated with the operation.
  4464. // It typically
  4465. // contains progress information and common metadata such as create
  4466. // time.
  4467. // Some services might not provide such metadata. Any method that
  4468. // returns a
  4469. // long-running operation should document the metadata type, if any.
  4470. Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  4471. // Name: The server-assigned name, which is only unique within the same
  4472. // service that
  4473. // originally returns it. If you use the default HTTP mapping,
  4474. // the
  4475. // `name` should have the format of `operations/some/unique/name`.
  4476. Name string `json:"name,omitempty"`
  4477. // Response: The normal response of the operation in case of success.
  4478. // If the original
  4479. // method returns no data on success, such as `Delete`, the response
  4480. // is
  4481. // `google.protobuf.Empty`. If the original method is
  4482. // standard
  4483. // `Get`/`Create`/`Update`, the response should be the resource. For
  4484. // other
  4485. // methods, the response should have the type `XxxResponse`, where
  4486. // `Xxx`
  4487. // is the original method name. For example, if the original method
  4488. // name
  4489. // is `TakeSnapshot()`, the inferred response type
  4490. // is
  4491. // `TakeSnapshotResponse`.
  4492. Response googleapi.RawMessage `json:"response,omitempty"`
  4493. // ServerResponse contains the HTTP response code and headers from the
  4494. // server.
  4495. googleapi.ServerResponse `json:"-"`
  4496. // ForceSendFields is a list of field names (e.g. "Done") to
  4497. // unconditionally include in API requests. By default, fields with
  4498. // empty values are omitted from API requests. However, any non-pointer,
  4499. // non-interface field appearing in ForceSendFields will be sent to the
  4500. // server regardless of whether the field is empty or not. This may be
  4501. // used to include empty fields in Patch requests.
  4502. ForceSendFields []string `json:"-"`
  4503. // NullFields is a list of field names (e.g. "Done") to include in API
  4504. // requests with the JSON null value. By default, fields with empty
  4505. // values are omitted from API requests. However, any field with an
  4506. // empty value appearing in NullFields will be sent to the server as
  4507. // null. It is an error if a field in this list has a non-empty value.
  4508. // This may be used to include null fields in Patch requests.
  4509. NullFields []string `json:"-"`
  4510. }
  4511. func (s *GoogleLongrunningOperation) MarshalJSON() ([]byte, error) {
  4512. type NoMethod GoogleLongrunningOperation
  4513. raw := NoMethod(*s)
  4514. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4515. }
  4516. // GoogleProtobufEmpty: A generic empty message that you can re-use to
  4517. // avoid defining duplicated
  4518. // empty messages in your APIs. A typical example is to use it as the
  4519. // request
  4520. // or the response type of an API method. For instance:
  4521. //
  4522. // service Foo {
  4523. // rpc Bar(google.protobuf.Empty) returns
  4524. // (google.protobuf.Empty);
  4525. // }
  4526. //
  4527. // The JSON representation for `Empty` is empty JSON object `{}`.
  4528. type GoogleProtobufEmpty struct {
  4529. // ServerResponse contains the HTTP response code and headers from the
  4530. // server.
  4531. googleapi.ServerResponse `json:"-"`
  4532. }
  4533. // GoogleRpcStatus: The `Status` type defines a logical error model that
  4534. // is suitable for different
  4535. // programming environments, including REST APIs and RPC APIs. It is
  4536. // used by
  4537. // [gRPC](https://github.com/grpc). The error model is designed to
  4538. // be:
  4539. //
  4540. // - Simple to use and understand for most users
  4541. // - Flexible enough to meet unexpected needs
  4542. //
  4543. // # Overview
  4544. //
  4545. // The `Status` message contains three pieces of data: error code, error
  4546. // message,
  4547. // and error details. The error code should be an enum value
  4548. // of
  4549. // google.rpc.Code, but it may accept additional error codes if needed.
  4550. // The
  4551. // error message should be a developer-facing English message that
  4552. // helps
  4553. // developers *understand* and *resolve* the error. If a localized
  4554. // user-facing
  4555. // error message is needed, put the localized message in the error
  4556. // details or
  4557. // localize it in the client. The optional error details may contain
  4558. // arbitrary
  4559. // information about the error. There is a predefined set of error
  4560. // detail types
  4561. // in the package `google.rpc` that can be used for common error
  4562. // conditions.
  4563. //
  4564. // # Language mapping
  4565. //
  4566. // The `Status` message is the logical representation of the error
  4567. // model, but it
  4568. // is not necessarily the actual wire format. When the `Status` message
  4569. // is
  4570. // exposed in different client libraries and different wire protocols,
  4571. // it can be
  4572. // mapped differently. For example, it will likely be mapped to some
  4573. // exceptions
  4574. // in Java, but more likely mapped to some error codes in C.
  4575. //
  4576. // # Other uses
  4577. //
  4578. // The error model and the `Status` message can be used in a variety
  4579. // of
  4580. // environments, either with or without APIs, to provide a
  4581. // consistent developer experience across different
  4582. // environments.
  4583. //
  4584. // Example uses of this error model include:
  4585. //
  4586. // - Partial errors. If a service needs to return partial errors to the
  4587. // client,
  4588. // it may embed the `Status` in the normal response to indicate the
  4589. // partial
  4590. // errors.
  4591. //
  4592. // - Workflow errors. A typical workflow has multiple steps. Each step
  4593. // may
  4594. // have a `Status` message for error reporting.
  4595. //
  4596. // - Batch operations. If a client uses batch request and batch
  4597. // response, the
  4598. // `Status` message should be used directly inside batch response,
  4599. // one for
  4600. // each error sub-response.
  4601. //
  4602. // - Asynchronous operations. If an API call embeds asynchronous
  4603. // operation
  4604. // results in its response, the status of those operations should
  4605. // be
  4606. // represented directly using the `Status` message.
  4607. //
  4608. // - Logging. If some API errors are stored in logs, the message
  4609. // `Status` could
  4610. // be used directly after any stripping needed for security/privacy
  4611. // reasons.
  4612. type GoogleRpcStatus struct {
  4613. // Code: The status code, which should be an enum value of
  4614. // google.rpc.Code.
  4615. Code int64 `json:"code,omitempty"`
  4616. // Details: A list of messages that carry the error details. There is a
  4617. // common set of
  4618. // message types for APIs to use.
  4619. Details []googleapi.RawMessage `json:"details,omitempty"`
  4620. // Message: A developer-facing error message, which should be in
  4621. // English. Any
  4622. // user-facing error message should be localized and sent in
  4623. // the
  4624. // google.rpc.Status.details field, or localized by the client.
  4625. Message string `json:"message,omitempty"`
  4626. // ForceSendFields is a list of field names (e.g. "Code") 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. "Code") to include in API
  4634. // requests with the JSON null value. By default, fields with empty
  4635. // values are omitted from API requests. However, any field with an
  4636. // empty value appearing in NullFields will be sent to the server as
  4637. // null. It is an error if a field in this list has a non-empty value.
  4638. // This may be used to include null fields in Patch requests.
  4639. NullFields []string `json:"-"`
  4640. }
  4641. func (s *GoogleRpcStatus) MarshalJSON() ([]byte, error) {
  4642. type NoMethod GoogleRpcStatus
  4643. raw := NoMethod(*s)
  4644. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4645. }
  4646. // GoogleTypeLatLng: An object representing a latitude/longitude pair.
  4647. // This is expressed as a pair
  4648. // of doubles representing degrees latitude and degrees longitude.
  4649. // Unless
  4650. // specified otherwise, this must conform to the
  4651. // <a
  4652. // href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
  4653. // st
  4654. // andard</a>. Values must be within normalized ranges.
  4655. type GoogleTypeLatLng struct {
  4656. // Latitude: The latitude in degrees. It must be in the range [-90.0,
  4657. // +90.0].
  4658. Latitude float64 `json:"latitude,omitempty"`
  4659. // Longitude: The longitude in degrees. It must be in the range [-180.0,
  4660. // +180.0].
  4661. Longitude float64 `json:"longitude,omitempty"`
  4662. // ForceSendFields is a list of field names (e.g. "Latitude") to
  4663. // unconditionally include in API requests. By default, fields with
  4664. // empty values are omitted from API requests. However, any non-pointer,
  4665. // non-interface field appearing in ForceSendFields will be sent to the
  4666. // server regardless of whether the field is empty or not. This may be
  4667. // used to include empty fields in Patch requests.
  4668. ForceSendFields []string `json:"-"`
  4669. // NullFields is a list of field names (e.g. "Latitude") to include in
  4670. // API requests with the JSON null value. By default, fields with empty
  4671. // values are omitted from API requests. However, any field with an
  4672. // empty value appearing in NullFields will be sent to the server as
  4673. // null. It is an error if a field in this list has a non-empty value.
  4674. // This may be used to include null fields in Patch requests.
  4675. NullFields []string `json:"-"`
  4676. }
  4677. func (s *GoogleTypeLatLng) MarshalJSON() ([]byte, error) {
  4678. type NoMethod GoogleTypeLatLng
  4679. raw := NoMethod(*s)
  4680. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4681. }
  4682. func (s *GoogleTypeLatLng) UnmarshalJSON(data []byte) error {
  4683. type NoMethod GoogleTypeLatLng
  4684. var s1 struct {
  4685. Latitude gensupport.JSONFloat64 `json:"latitude"`
  4686. Longitude gensupport.JSONFloat64 `json:"longitude"`
  4687. *NoMethod
  4688. }
  4689. s1.NoMethod = (*NoMethod)(s)
  4690. if err := json.Unmarshal(data, &s1); err != nil {
  4691. return err
  4692. }
  4693. s.Latitude = float64(s1.Latitude)
  4694. s.Longitude = float64(s1.Longitude)
  4695. return nil
  4696. }
  4697. // method id "dialogflow.projects.getAgent":
  4698. type ProjectsGetAgentCall struct {
  4699. s *Service
  4700. parent string
  4701. urlParams_ gensupport.URLParams
  4702. ifNoneMatch_ string
  4703. ctx_ context.Context
  4704. header_ http.Header
  4705. }
  4706. // GetAgent: Retrieves the specified agent.
  4707. func (r *ProjectsService) GetAgent(parent string) *ProjectsGetAgentCall {
  4708. c := &ProjectsGetAgentCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4709. c.parent = parent
  4710. return c
  4711. }
  4712. // Fields allows partial responses to be retrieved. See
  4713. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4714. // for more information.
  4715. func (c *ProjectsGetAgentCall) Fields(s ...googleapi.Field) *ProjectsGetAgentCall {
  4716. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4717. return c
  4718. }
  4719. // IfNoneMatch sets the optional parameter which makes the operation
  4720. // fail if the object's ETag matches the given value. This is useful for
  4721. // getting updates only after the object has changed since the last
  4722. // request. Use googleapi.IsNotModified to check whether the response
  4723. // error from Do is the result of In-None-Match.
  4724. func (c *ProjectsGetAgentCall) IfNoneMatch(entityTag string) *ProjectsGetAgentCall {
  4725. c.ifNoneMatch_ = entityTag
  4726. return c
  4727. }
  4728. // Context sets the context to be used in this call's Do method. Any
  4729. // pending HTTP request will be aborted if the provided context is
  4730. // canceled.
  4731. func (c *ProjectsGetAgentCall) Context(ctx context.Context) *ProjectsGetAgentCall {
  4732. c.ctx_ = ctx
  4733. return c
  4734. }
  4735. // Header returns an http.Header that can be modified by the caller to
  4736. // add HTTP headers to the request.
  4737. func (c *ProjectsGetAgentCall) Header() http.Header {
  4738. if c.header_ == nil {
  4739. c.header_ = make(http.Header)
  4740. }
  4741. return c.header_
  4742. }
  4743. func (c *ProjectsGetAgentCall) doRequest(alt string) (*http.Response, error) {
  4744. reqHeaders := make(http.Header)
  4745. for k, v := range c.header_ {
  4746. reqHeaders[k] = v
  4747. }
  4748. reqHeaders.Set("User-Agent", c.s.userAgent())
  4749. if c.ifNoneMatch_ != "" {
  4750. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4751. }
  4752. var body io.Reader = nil
  4753. c.urlParams_.Set("alt", alt)
  4754. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/agent")
  4755. urls += "?" + c.urlParams_.Encode()
  4756. req, _ := http.NewRequest("GET", urls, body)
  4757. req.Header = reqHeaders
  4758. googleapi.Expand(req.URL, map[string]string{
  4759. "parent": c.parent,
  4760. })
  4761. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4762. }
  4763. // Do executes the "dialogflow.projects.getAgent" call.
  4764. // Exactly one of *GoogleCloudDialogflowV2Agent or error will be
  4765. // non-nil. Any non-2xx status code is an error. Response headers are in
  4766. // either *GoogleCloudDialogflowV2Agent.ServerResponse.Header or (if a
  4767. // response was returned at all) in error.(*googleapi.Error).Header. Use
  4768. // googleapi.IsNotModified to check whether the returned error was
  4769. // because http.StatusNotModified was returned.
  4770. func (c *ProjectsGetAgentCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2Agent, error) {
  4771. gensupport.SetOptions(c.urlParams_, opts...)
  4772. res, err := c.doRequest("json")
  4773. if res != nil && res.StatusCode == http.StatusNotModified {
  4774. if res.Body != nil {
  4775. res.Body.Close()
  4776. }
  4777. return nil, &googleapi.Error{
  4778. Code: res.StatusCode,
  4779. Header: res.Header,
  4780. }
  4781. }
  4782. if err != nil {
  4783. return nil, err
  4784. }
  4785. defer googleapi.CloseBody(res)
  4786. if err := googleapi.CheckResponse(res); err != nil {
  4787. return nil, err
  4788. }
  4789. ret := &GoogleCloudDialogflowV2Agent{
  4790. ServerResponse: googleapi.ServerResponse{
  4791. Header: res.Header,
  4792. HTTPStatusCode: res.StatusCode,
  4793. },
  4794. }
  4795. target := &ret
  4796. if err := gensupport.DecodeResponse(target, res); err != nil {
  4797. return nil, err
  4798. }
  4799. return ret, nil
  4800. // {
  4801. // "description": "Retrieves the specified agent.",
  4802. // "flatPath": "v2/projects/{projectsId}/agent",
  4803. // "httpMethod": "GET",
  4804. // "id": "dialogflow.projects.getAgent",
  4805. // "parameterOrder": [
  4806. // "parent"
  4807. // ],
  4808. // "parameters": {
  4809. // "parent": {
  4810. // "description": "Required. The project that the agent to fetch is associated with.\nFormat: `projects/\u003cProject ID\u003e`.",
  4811. // "location": "path",
  4812. // "pattern": "^projects/[^/]+$",
  4813. // "required": true,
  4814. // "type": "string"
  4815. // }
  4816. // },
  4817. // "path": "v2/{+parent}/agent",
  4818. // "response": {
  4819. // "$ref": "GoogleCloudDialogflowV2Agent"
  4820. // },
  4821. // "scopes": [
  4822. // "https://www.googleapis.com/auth/cloud-platform"
  4823. // ]
  4824. // }
  4825. }
  4826. // method id "dialogflow.projects.agent.export":
  4827. type ProjectsAgentExportCall struct {
  4828. s *Service
  4829. parent string
  4830. googleclouddialogflowv2exportagentrequest *GoogleCloudDialogflowV2ExportAgentRequest
  4831. urlParams_ gensupport.URLParams
  4832. ctx_ context.Context
  4833. header_ http.Header
  4834. }
  4835. // Export: Exports the specified agent to a ZIP file.
  4836. //
  4837. // Operation <response: ExportAgentResponse,
  4838. // metadata: google.protobuf.Struct>
  4839. func (r *ProjectsAgentService) Export(parent string, googleclouddialogflowv2exportagentrequest *GoogleCloudDialogflowV2ExportAgentRequest) *ProjectsAgentExportCall {
  4840. c := &ProjectsAgentExportCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4841. c.parent = parent
  4842. c.googleclouddialogflowv2exportagentrequest = googleclouddialogflowv2exportagentrequest
  4843. return c
  4844. }
  4845. // Fields allows partial responses to be retrieved. See
  4846. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4847. // for more information.
  4848. func (c *ProjectsAgentExportCall) Fields(s ...googleapi.Field) *ProjectsAgentExportCall {
  4849. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4850. return c
  4851. }
  4852. // Context sets the context to be used in this call's Do method. Any
  4853. // pending HTTP request will be aborted if the provided context is
  4854. // canceled.
  4855. func (c *ProjectsAgentExportCall) Context(ctx context.Context) *ProjectsAgentExportCall {
  4856. c.ctx_ = ctx
  4857. return c
  4858. }
  4859. // Header returns an http.Header that can be modified by the caller to
  4860. // add HTTP headers to the request.
  4861. func (c *ProjectsAgentExportCall) Header() http.Header {
  4862. if c.header_ == nil {
  4863. c.header_ = make(http.Header)
  4864. }
  4865. return c.header_
  4866. }
  4867. func (c *ProjectsAgentExportCall) doRequest(alt string) (*http.Response, error) {
  4868. reqHeaders := make(http.Header)
  4869. for k, v := range c.header_ {
  4870. reqHeaders[k] = v
  4871. }
  4872. reqHeaders.Set("User-Agent", c.s.userAgent())
  4873. var body io.Reader = nil
  4874. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2exportagentrequest)
  4875. if err != nil {
  4876. return nil, err
  4877. }
  4878. reqHeaders.Set("Content-Type", "application/json")
  4879. c.urlParams_.Set("alt", alt)
  4880. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/agent:export")
  4881. urls += "?" + c.urlParams_.Encode()
  4882. req, _ := http.NewRequest("POST", urls, body)
  4883. req.Header = reqHeaders
  4884. googleapi.Expand(req.URL, map[string]string{
  4885. "parent": c.parent,
  4886. })
  4887. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4888. }
  4889. // Do executes the "dialogflow.projects.agent.export" call.
  4890. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  4891. // Any non-2xx status code is an error. Response headers are in either
  4892. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  4893. // was returned at all) in error.(*googleapi.Error).Header. Use
  4894. // googleapi.IsNotModified to check whether the returned error was
  4895. // because http.StatusNotModified was returned.
  4896. func (c *ProjectsAgentExportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  4897. gensupport.SetOptions(c.urlParams_, opts...)
  4898. res, err := c.doRequest("json")
  4899. if res != nil && res.StatusCode == http.StatusNotModified {
  4900. if res.Body != nil {
  4901. res.Body.Close()
  4902. }
  4903. return nil, &googleapi.Error{
  4904. Code: res.StatusCode,
  4905. Header: res.Header,
  4906. }
  4907. }
  4908. if err != nil {
  4909. return nil, err
  4910. }
  4911. defer googleapi.CloseBody(res)
  4912. if err := googleapi.CheckResponse(res); err != nil {
  4913. return nil, err
  4914. }
  4915. ret := &GoogleLongrunningOperation{
  4916. ServerResponse: googleapi.ServerResponse{
  4917. Header: res.Header,
  4918. HTTPStatusCode: res.StatusCode,
  4919. },
  4920. }
  4921. target := &ret
  4922. if err := gensupport.DecodeResponse(target, res); err != nil {
  4923. return nil, err
  4924. }
  4925. return ret, nil
  4926. // {
  4927. // "description": "Exports the specified agent to a ZIP file.\n\nOperation \u003cresponse: ExportAgentResponse,\n metadata: google.protobuf.Struct\u003e",
  4928. // "flatPath": "v2/projects/{projectsId}/agent:export",
  4929. // "httpMethod": "POST",
  4930. // "id": "dialogflow.projects.agent.export",
  4931. // "parameterOrder": [
  4932. // "parent"
  4933. // ],
  4934. // "parameters": {
  4935. // "parent": {
  4936. // "description": "Required. The project that the agent to export is associated with.\nFormat: `projects/\u003cProject ID\u003e`.",
  4937. // "location": "path",
  4938. // "pattern": "^projects/[^/]+$",
  4939. // "required": true,
  4940. // "type": "string"
  4941. // }
  4942. // },
  4943. // "path": "v2/{+parent}/agent:export",
  4944. // "request": {
  4945. // "$ref": "GoogleCloudDialogflowV2ExportAgentRequest"
  4946. // },
  4947. // "response": {
  4948. // "$ref": "GoogleLongrunningOperation"
  4949. // },
  4950. // "scopes": [
  4951. // "https://www.googleapis.com/auth/cloud-platform"
  4952. // ]
  4953. // }
  4954. }
  4955. // method id "dialogflow.projects.agent.import":
  4956. type ProjectsAgentImportCall struct {
  4957. s *Service
  4958. parent string
  4959. googleclouddialogflowv2importagentrequest *GoogleCloudDialogflowV2ImportAgentRequest
  4960. urlParams_ gensupport.URLParams
  4961. ctx_ context.Context
  4962. header_ http.Header
  4963. }
  4964. // Import: Imports the specified agent from a ZIP file.
  4965. //
  4966. // Uploads new intents and entity types without deleting the existing
  4967. // ones.
  4968. // Intents and entity types with the same name are replaced with the
  4969. // new
  4970. // versions from ImportAgentRequest.
  4971. //
  4972. // Operation <response: google.protobuf.Empty,
  4973. // metadata: google.protobuf.Struct>
  4974. func (r *ProjectsAgentService) Import(parent string, googleclouddialogflowv2importagentrequest *GoogleCloudDialogflowV2ImportAgentRequest) *ProjectsAgentImportCall {
  4975. c := &ProjectsAgentImportCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4976. c.parent = parent
  4977. c.googleclouddialogflowv2importagentrequest = googleclouddialogflowv2importagentrequest
  4978. return c
  4979. }
  4980. // Fields allows partial responses to be retrieved. See
  4981. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4982. // for more information.
  4983. func (c *ProjectsAgentImportCall) Fields(s ...googleapi.Field) *ProjectsAgentImportCall {
  4984. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4985. return c
  4986. }
  4987. // Context sets the context to be used in this call's Do method. Any
  4988. // pending HTTP request will be aborted if the provided context is
  4989. // canceled.
  4990. func (c *ProjectsAgentImportCall) Context(ctx context.Context) *ProjectsAgentImportCall {
  4991. c.ctx_ = ctx
  4992. return c
  4993. }
  4994. // Header returns an http.Header that can be modified by the caller to
  4995. // add HTTP headers to the request.
  4996. func (c *ProjectsAgentImportCall) Header() http.Header {
  4997. if c.header_ == nil {
  4998. c.header_ = make(http.Header)
  4999. }
  5000. return c.header_
  5001. }
  5002. func (c *ProjectsAgentImportCall) doRequest(alt string) (*http.Response, error) {
  5003. reqHeaders := make(http.Header)
  5004. for k, v := range c.header_ {
  5005. reqHeaders[k] = v
  5006. }
  5007. reqHeaders.Set("User-Agent", c.s.userAgent())
  5008. var body io.Reader = nil
  5009. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2importagentrequest)
  5010. if err != nil {
  5011. return nil, err
  5012. }
  5013. reqHeaders.Set("Content-Type", "application/json")
  5014. c.urlParams_.Set("alt", alt)
  5015. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/agent:import")
  5016. urls += "?" + c.urlParams_.Encode()
  5017. req, _ := http.NewRequest("POST", urls, body)
  5018. req.Header = reqHeaders
  5019. googleapi.Expand(req.URL, map[string]string{
  5020. "parent": c.parent,
  5021. })
  5022. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5023. }
  5024. // Do executes the "dialogflow.projects.agent.import" call.
  5025. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  5026. // Any non-2xx status code is an error. Response headers are in either
  5027. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  5028. // was returned at all) in error.(*googleapi.Error).Header. Use
  5029. // googleapi.IsNotModified to check whether the returned error was
  5030. // because http.StatusNotModified was returned.
  5031. func (c *ProjectsAgentImportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  5032. gensupport.SetOptions(c.urlParams_, opts...)
  5033. res, err := c.doRequest("json")
  5034. if res != nil && res.StatusCode == http.StatusNotModified {
  5035. if res.Body != nil {
  5036. res.Body.Close()
  5037. }
  5038. return nil, &googleapi.Error{
  5039. Code: res.StatusCode,
  5040. Header: res.Header,
  5041. }
  5042. }
  5043. if err != nil {
  5044. return nil, err
  5045. }
  5046. defer googleapi.CloseBody(res)
  5047. if err := googleapi.CheckResponse(res); err != nil {
  5048. return nil, err
  5049. }
  5050. ret := &GoogleLongrunningOperation{
  5051. ServerResponse: googleapi.ServerResponse{
  5052. Header: res.Header,
  5053. HTTPStatusCode: res.StatusCode,
  5054. },
  5055. }
  5056. target := &ret
  5057. if err := gensupport.DecodeResponse(target, res); err != nil {
  5058. return nil, err
  5059. }
  5060. return ret, nil
  5061. // {
  5062. // "description": "Imports the specified agent from a ZIP file.\n\nUploads new intents and entity types without deleting the existing ones.\nIntents and entity types with the same name are replaced with the new\nversions from ImportAgentRequest.\n\nOperation \u003cresponse: google.protobuf.Empty,\n metadata: google.protobuf.Struct\u003e",
  5063. // "flatPath": "v2/projects/{projectsId}/agent:import",
  5064. // "httpMethod": "POST",
  5065. // "id": "dialogflow.projects.agent.import",
  5066. // "parameterOrder": [
  5067. // "parent"
  5068. // ],
  5069. // "parameters": {
  5070. // "parent": {
  5071. // "description": "Required. The project that the agent to import is associated with.\nFormat: `projects/\u003cProject ID\u003e`.",
  5072. // "location": "path",
  5073. // "pattern": "^projects/[^/]+$",
  5074. // "required": true,
  5075. // "type": "string"
  5076. // }
  5077. // },
  5078. // "path": "v2/{+parent}/agent:import",
  5079. // "request": {
  5080. // "$ref": "GoogleCloudDialogflowV2ImportAgentRequest"
  5081. // },
  5082. // "response": {
  5083. // "$ref": "GoogleLongrunningOperation"
  5084. // },
  5085. // "scopes": [
  5086. // "https://www.googleapis.com/auth/cloud-platform"
  5087. // ]
  5088. // }
  5089. }
  5090. // method id "dialogflow.projects.agent.restore":
  5091. type ProjectsAgentRestoreCall struct {
  5092. s *Service
  5093. parent string
  5094. googleclouddialogflowv2restoreagentrequest *GoogleCloudDialogflowV2RestoreAgentRequest
  5095. urlParams_ gensupport.URLParams
  5096. ctx_ context.Context
  5097. header_ http.Header
  5098. }
  5099. // Restore: Restores the specified agent from a ZIP file.
  5100. //
  5101. // Replaces the current agent version with a new one. All the intents
  5102. // and
  5103. // entity types in the older version are deleted.
  5104. //
  5105. // Operation <response: google.protobuf.Empty,
  5106. // metadata: google.protobuf.Struct>
  5107. func (r *ProjectsAgentService) Restore(parent string, googleclouddialogflowv2restoreagentrequest *GoogleCloudDialogflowV2RestoreAgentRequest) *ProjectsAgentRestoreCall {
  5108. c := &ProjectsAgentRestoreCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5109. c.parent = parent
  5110. c.googleclouddialogflowv2restoreagentrequest = googleclouddialogflowv2restoreagentrequest
  5111. return c
  5112. }
  5113. // Fields allows partial responses to be retrieved. See
  5114. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5115. // for more information.
  5116. func (c *ProjectsAgentRestoreCall) Fields(s ...googleapi.Field) *ProjectsAgentRestoreCall {
  5117. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5118. return c
  5119. }
  5120. // Context sets the context to be used in this call's Do method. Any
  5121. // pending HTTP request will be aborted if the provided context is
  5122. // canceled.
  5123. func (c *ProjectsAgentRestoreCall) Context(ctx context.Context) *ProjectsAgentRestoreCall {
  5124. c.ctx_ = ctx
  5125. return c
  5126. }
  5127. // Header returns an http.Header that can be modified by the caller to
  5128. // add HTTP headers to the request.
  5129. func (c *ProjectsAgentRestoreCall) Header() http.Header {
  5130. if c.header_ == nil {
  5131. c.header_ = make(http.Header)
  5132. }
  5133. return c.header_
  5134. }
  5135. func (c *ProjectsAgentRestoreCall) doRequest(alt string) (*http.Response, error) {
  5136. reqHeaders := make(http.Header)
  5137. for k, v := range c.header_ {
  5138. reqHeaders[k] = v
  5139. }
  5140. reqHeaders.Set("User-Agent", c.s.userAgent())
  5141. var body io.Reader = nil
  5142. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2restoreagentrequest)
  5143. if err != nil {
  5144. return nil, err
  5145. }
  5146. reqHeaders.Set("Content-Type", "application/json")
  5147. c.urlParams_.Set("alt", alt)
  5148. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/agent:restore")
  5149. urls += "?" + c.urlParams_.Encode()
  5150. req, _ := http.NewRequest("POST", urls, body)
  5151. req.Header = reqHeaders
  5152. googleapi.Expand(req.URL, map[string]string{
  5153. "parent": c.parent,
  5154. })
  5155. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5156. }
  5157. // Do executes the "dialogflow.projects.agent.restore" call.
  5158. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  5159. // Any non-2xx status code is an error. Response headers are in either
  5160. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  5161. // was returned at all) in error.(*googleapi.Error).Header. Use
  5162. // googleapi.IsNotModified to check whether the returned error was
  5163. // because http.StatusNotModified was returned.
  5164. func (c *ProjectsAgentRestoreCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  5165. gensupport.SetOptions(c.urlParams_, opts...)
  5166. res, err := c.doRequest("json")
  5167. if res != nil && res.StatusCode == http.StatusNotModified {
  5168. if res.Body != nil {
  5169. res.Body.Close()
  5170. }
  5171. return nil, &googleapi.Error{
  5172. Code: res.StatusCode,
  5173. Header: res.Header,
  5174. }
  5175. }
  5176. if err != nil {
  5177. return nil, err
  5178. }
  5179. defer googleapi.CloseBody(res)
  5180. if err := googleapi.CheckResponse(res); err != nil {
  5181. return nil, err
  5182. }
  5183. ret := &GoogleLongrunningOperation{
  5184. ServerResponse: googleapi.ServerResponse{
  5185. Header: res.Header,
  5186. HTTPStatusCode: res.StatusCode,
  5187. },
  5188. }
  5189. target := &ret
  5190. if err := gensupport.DecodeResponse(target, res); err != nil {
  5191. return nil, err
  5192. }
  5193. return ret, nil
  5194. // {
  5195. // "description": "Restores the specified agent from a ZIP file.\n\nReplaces the current agent version with a new one. All the intents and\nentity types in the older version are deleted.\n\nOperation \u003cresponse: google.protobuf.Empty,\n metadata: google.protobuf.Struct\u003e",
  5196. // "flatPath": "v2/projects/{projectsId}/agent:restore",
  5197. // "httpMethod": "POST",
  5198. // "id": "dialogflow.projects.agent.restore",
  5199. // "parameterOrder": [
  5200. // "parent"
  5201. // ],
  5202. // "parameters": {
  5203. // "parent": {
  5204. // "description": "Required. The project that the agent to restore is associated with.\nFormat: `projects/\u003cProject ID\u003e`.",
  5205. // "location": "path",
  5206. // "pattern": "^projects/[^/]+$",
  5207. // "required": true,
  5208. // "type": "string"
  5209. // }
  5210. // },
  5211. // "path": "v2/{+parent}/agent:restore",
  5212. // "request": {
  5213. // "$ref": "GoogleCloudDialogflowV2RestoreAgentRequest"
  5214. // },
  5215. // "response": {
  5216. // "$ref": "GoogleLongrunningOperation"
  5217. // },
  5218. // "scopes": [
  5219. // "https://www.googleapis.com/auth/cloud-platform"
  5220. // ]
  5221. // }
  5222. }
  5223. // method id "dialogflow.projects.agent.search":
  5224. type ProjectsAgentSearchCall struct {
  5225. s *Service
  5226. parent string
  5227. urlParams_ gensupport.URLParams
  5228. ifNoneMatch_ string
  5229. ctx_ context.Context
  5230. header_ http.Header
  5231. }
  5232. // Search: Returns the list of agents.
  5233. //
  5234. // Since there is at most one conversational agent per project, this
  5235. // method is
  5236. // useful primarily for listing all agents across projects the caller
  5237. // has
  5238. // access to. One can achieve that with a wildcard project collection id
  5239. // "-".
  5240. // Refer to
  5241. // [List
  5242. // Sub-Collections](https://cloud.google.com/apis/design/design_pat
  5243. // terns#list_sub-collections).
  5244. func (r *ProjectsAgentService) Search(parent string) *ProjectsAgentSearchCall {
  5245. c := &ProjectsAgentSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5246. c.parent = parent
  5247. return c
  5248. }
  5249. // PageSize sets the optional parameter "pageSize": The maximum number
  5250. // of items to return in a single page. By
  5251. // default 100 and at most 1000.
  5252. func (c *ProjectsAgentSearchCall) PageSize(pageSize int64) *ProjectsAgentSearchCall {
  5253. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  5254. return c
  5255. }
  5256. // PageToken sets the optional parameter "pageToken": The
  5257. // next_page_token value returned from a previous list request.
  5258. func (c *ProjectsAgentSearchCall) PageToken(pageToken string) *ProjectsAgentSearchCall {
  5259. c.urlParams_.Set("pageToken", pageToken)
  5260. return c
  5261. }
  5262. // Fields allows partial responses to be retrieved. See
  5263. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5264. // for more information.
  5265. func (c *ProjectsAgentSearchCall) Fields(s ...googleapi.Field) *ProjectsAgentSearchCall {
  5266. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5267. return c
  5268. }
  5269. // IfNoneMatch sets the optional parameter which makes the operation
  5270. // fail if the object's ETag matches the given value. This is useful for
  5271. // getting updates only after the object has changed since the last
  5272. // request. Use googleapi.IsNotModified to check whether the response
  5273. // error from Do is the result of In-None-Match.
  5274. func (c *ProjectsAgentSearchCall) IfNoneMatch(entityTag string) *ProjectsAgentSearchCall {
  5275. c.ifNoneMatch_ = entityTag
  5276. return c
  5277. }
  5278. // Context sets the context to be used in this call's Do method. Any
  5279. // pending HTTP request will be aborted if the provided context is
  5280. // canceled.
  5281. func (c *ProjectsAgentSearchCall) Context(ctx context.Context) *ProjectsAgentSearchCall {
  5282. c.ctx_ = ctx
  5283. return c
  5284. }
  5285. // Header returns an http.Header that can be modified by the caller to
  5286. // add HTTP headers to the request.
  5287. func (c *ProjectsAgentSearchCall) Header() http.Header {
  5288. if c.header_ == nil {
  5289. c.header_ = make(http.Header)
  5290. }
  5291. return c.header_
  5292. }
  5293. func (c *ProjectsAgentSearchCall) doRequest(alt string) (*http.Response, error) {
  5294. reqHeaders := make(http.Header)
  5295. for k, v := range c.header_ {
  5296. reqHeaders[k] = v
  5297. }
  5298. reqHeaders.Set("User-Agent", c.s.userAgent())
  5299. if c.ifNoneMatch_ != "" {
  5300. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5301. }
  5302. var body io.Reader = nil
  5303. c.urlParams_.Set("alt", alt)
  5304. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/agent:search")
  5305. urls += "?" + c.urlParams_.Encode()
  5306. req, _ := http.NewRequest("GET", urls, body)
  5307. req.Header = reqHeaders
  5308. googleapi.Expand(req.URL, map[string]string{
  5309. "parent": c.parent,
  5310. })
  5311. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5312. }
  5313. // Do executes the "dialogflow.projects.agent.search" call.
  5314. // Exactly one of *GoogleCloudDialogflowV2SearchAgentsResponse or error
  5315. // will be non-nil. Any non-2xx status code is an error. Response
  5316. // headers are in either
  5317. // *GoogleCloudDialogflowV2SearchAgentsResponse.ServerResponse.Header or
  5318. // (if a response was returned at all) in
  5319. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5320. // whether the returned error was because http.StatusNotModified was
  5321. // returned.
  5322. func (c *ProjectsAgentSearchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2SearchAgentsResponse, error) {
  5323. gensupport.SetOptions(c.urlParams_, opts...)
  5324. res, err := c.doRequest("json")
  5325. if res != nil && res.StatusCode == http.StatusNotModified {
  5326. if res.Body != nil {
  5327. res.Body.Close()
  5328. }
  5329. return nil, &googleapi.Error{
  5330. Code: res.StatusCode,
  5331. Header: res.Header,
  5332. }
  5333. }
  5334. if err != nil {
  5335. return nil, err
  5336. }
  5337. defer googleapi.CloseBody(res)
  5338. if err := googleapi.CheckResponse(res); err != nil {
  5339. return nil, err
  5340. }
  5341. ret := &GoogleCloudDialogflowV2SearchAgentsResponse{
  5342. ServerResponse: googleapi.ServerResponse{
  5343. Header: res.Header,
  5344. HTTPStatusCode: res.StatusCode,
  5345. },
  5346. }
  5347. target := &ret
  5348. if err := gensupport.DecodeResponse(target, res); err != nil {
  5349. return nil, err
  5350. }
  5351. return ret, nil
  5352. // {
  5353. // "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).",
  5354. // "flatPath": "v2/projects/{projectsId}/agent:search",
  5355. // "httpMethod": "GET",
  5356. // "id": "dialogflow.projects.agent.search",
  5357. // "parameterOrder": [
  5358. // "parent"
  5359. // ],
  5360. // "parameters": {
  5361. // "pageSize": {
  5362. // "description": "Optional. The maximum number of items to return in a single page. By\ndefault 100 and at most 1000.",
  5363. // "format": "int32",
  5364. // "location": "query",
  5365. // "type": "integer"
  5366. // },
  5367. // "pageToken": {
  5368. // "description": "Optional. The next_page_token value returned from a previous list request.",
  5369. // "location": "query",
  5370. // "type": "string"
  5371. // },
  5372. // "parent": {
  5373. // "description": "Required. The project to list agents from.\nFormat: `projects/\u003cProject ID or '-'\u003e`.",
  5374. // "location": "path",
  5375. // "pattern": "^projects/[^/]+$",
  5376. // "required": true,
  5377. // "type": "string"
  5378. // }
  5379. // },
  5380. // "path": "v2/{+parent}/agent:search",
  5381. // "response": {
  5382. // "$ref": "GoogleCloudDialogflowV2SearchAgentsResponse"
  5383. // },
  5384. // "scopes": [
  5385. // "https://www.googleapis.com/auth/cloud-platform"
  5386. // ]
  5387. // }
  5388. }
  5389. // Pages invokes f for each page of results.
  5390. // A non-nil error returned from f will halt the iteration.
  5391. // The provided context supersedes any context provided to the Context method.
  5392. func (c *ProjectsAgentSearchCall) Pages(ctx context.Context, f func(*GoogleCloudDialogflowV2SearchAgentsResponse) error) error {
  5393. c.ctx_ = ctx
  5394. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  5395. for {
  5396. x, err := c.Do()
  5397. if err != nil {
  5398. return err
  5399. }
  5400. if err := f(x); err != nil {
  5401. return err
  5402. }
  5403. if x.NextPageToken == "" {
  5404. return nil
  5405. }
  5406. c.PageToken(x.NextPageToken)
  5407. }
  5408. }
  5409. // method id "dialogflow.projects.agent.train":
  5410. type ProjectsAgentTrainCall struct {
  5411. s *Service
  5412. parent string
  5413. googleclouddialogflowv2trainagentrequest *GoogleCloudDialogflowV2TrainAgentRequest
  5414. urlParams_ gensupport.URLParams
  5415. ctx_ context.Context
  5416. header_ http.Header
  5417. }
  5418. // Train: Trains the specified agent.
  5419. //
  5420. // Operation <response: google.protobuf.Empty,
  5421. // metadata: google.protobuf.Struct>
  5422. func (r *ProjectsAgentService) Train(parent string, googleclouddialogflowv2trainagentrequest *GoogleCloudDialogflowV2TrainAgentRequest) *ProjectsAgentTrainCall {
  5423. c := &ProjectsAgentTrainCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5424. c.parent = parent
  5425. c.googleclouddialogflowv2trainagentrequest = googleclouddialogflowv2trainagentrequest
  5426. return c
  5427. }
  5428. // Fields allows partial responses to be retrieved. See
  5429. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5430. // for more information.
  5431. func (c *ProjectsAgentTrainCall) Fields(s ...googleapi.Field) *ProjectsAgentTrainCall {
  5432. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5433. return c
  5434. }
  5435. // Context sets the context to be used in this call's Do method. Any
  5436. // pending HTTP request will be aborted if the provided context is
  5437. // canceled.
  5438. func (c *ProjectsAgentTrainCall) Context(ctx context.Context) *ProjectsAgentTrainCall {
  5439. c.ctx_ = ctx
  5440. return c
  5441. }
  5442. // Header returns an http.Header that can be modified by the caller to
  5443. // add HTTP headers to the request.
  5444. func (c *ProjectsAgentTrainCall) Header() http.Header {
  5445. if c.header_ == nil {
  5446. c.header_ = make(http.Header)
  5447. }
  5448. return c.header_
  5449. }
  5450. func (c *ProjectsAgentTrainCall) doRequest(alt string) (*http.Response, error) {
  5451. reqHeaders := make(http.Header)
  5452. for k, v := range c.header_ {
  5453. reqHeaders[k] = v
  5454. }
  5455. reqHeaders.Set("User-Agent", c.s.userAgent())
  5456. var body io.Reader = nil
  5457. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2trainagentrequest)
  5458. if err != nil {
  5459. return nil, err
  5460. }
  5461. reqHeaders.Set("Content-Type", "application/json")
  5462. c.urlParams_.Set("alt", alt)
  5463. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/agent:train")
  5464. urls += "?" + c.urlParams_.Encode()
  5465. req, _ := http.NewRequest("POST", urls, body)
  5466. req.Header = reqHeaders
  5467. googleapi.Expand(req.URL, map[string]string{
  5468. "parent": c.parent,
  5469. })
  5470. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5471. }
  5472. // Do executes the "dialogflow.projects.agent.train" call.
  5473. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  5474. // Any non-2xx status code is an error. Response headers are in either
  5475. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  5476. // was returned at all) in error.(*googleapi.Error).Header. Use
  5477. // googleapi.IsNotModified to check whether the returned error was
  5478. // because http.StatusNotModified was returned.
  5479. func (c *ProjectsAgentTrainCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  5480. gensupport.SetOptions(c.urlParams_, opts...)
  5481. res, err := c.doRequest("json")
  5482. if res != nil && res.StatusCode == http.StatusNotModified {
  5483. if res.Body != nil {
  5484. res.Body.Close()
  5485. }
  5486. return nil, &googleapi.Error{
  5487. Code: res.StatusCode,
  5488. Header: res.Header,
  5489. }
  5490. }
  5491. if err != nil {
  5492. return nil, err
  5493. }
  5494. defer googleapi.CloseBody(res)
  5495. if err := googleapi.CheckResponse(res); err != nil {
  5496. return nil, err
  5497. }
  5498. ret := &GoogleLongrunningOperation{
  5499. ServerResponse: googleapi.ServerResponse{
  5500. Header: res.Header,
  5501. HTTPStatusCode: res.StatusCode,
  5502. },
  5503. }
  5504. target := &ret
  5505. if err := gensupport.DecodeResponse(target, res); err != nil {
  5506. return nil, err
  5507. }
  5508. return ret, nil
  5509. // {
  5510. // "description": "Trains the specified agent.\n\nOperation \u003cresponse: google.protobuf.Empty,\n metadata: google.protobuf.Struct\u003e",
  5511. // "flatPath": "v2/projects/{projectsId}/agent:train",
  5512. // "httpMethod": "POST",
  5513. // "id": "dialogflow.projects.agent.train",
  5514. // "parameterOrder": [
  5515. // "parent"
  5516. // ],
  5517. // "parameters": {
  5518. // "parent": {
  5519. // "description": "Required. The project that the agent to train is associated with.\nFormat: `projects/\u003cProject ID\u003e`.",
  5520. // "location": "path",
  5521. // "pattern": "^projects/[^/]+$",
  5522. // "required": true,
  5523. // "type": "string"
  5524. // }
  5525. // },
  5526. // "path": "v2/{+parent}/agent:train",
  5527. // "request": {
  5528. // "$ref": "GoogleCloudDialogflowV2TrainAgentRequest"
  5529. // },
  5530. // "response": {
  5531. // "$ref": "GoogleLongrunningOperation"
  5532. // },
  5533. // "scopes": [
  5534. // "https://www.googleapis.com/auth/cloud-platform"
  5535. // ]
  5536. // }
  5537. }
  5538. // method id "dialogflow.projects.agent.entityTypes.batchDelete":
  5539. type ProjectsAgentEntityTypesBatchDeleteCall struct {
  5540. s *Service
  5541. parent string
  5542. googleclouddialogflowv2batchdeleteentitytypesrequest *GoogleCloudDialogflowV2BatchDeleteEntityTypesRequest
  5543. urlParams_ gensupport.URLParams
  5544. ctx_ context.Context
  5545. header_ http.Header
  5546. }
  5547. // BatchDelete: Deletes entity types in the specified agent.
  5548. //
  5549. // Operation <response: google.protobuf.Empty,
  5550. // metadata: google.protobuf.Struct>
  5551. func (r *ProjectsAgentEntityTypesService) BatchDelete(parent string, googleclouddialogflowv2batchdeleteentitytypesrequest *GoogleCloudDialogflowV2BatchDeleteEntityTypesRequest) *ProjectsAgentEntityTypesBatchDeleteCall {
  5552. c := &ProjectsAgentEntityTypesBatchDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5553. c.parent = parent
  5554. c.googleclouddialogflowv2batchdeleteentitytypesrequest = googleclouddialogflowv2batchdeleteentitytypesrequest
  5555. return c
  5556. }
  5557. // Fields allows partial responses to be retrieved. See
  5558. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5559. // for more information.
  5560. func (c *ProjectsAgentEntityTypesBatchDeleteCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesBatchDeleteCall {
  5561. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5562. return c
  5563. }
  5564. // Context sets the context to be used in this call's Do method. Any
  5565. // pending HTTP request will be aborted if the provided context is
  5566. // canceled.
  5567. func (c *ProjectsAgentEntityTypesBatchDeleteCall) Context(ctx context.Context) *ProjectsAgentEntityTypesBatchDeleteCall {
  5568. c.ctx_ = ctx
  5569. return c
  5570. }
  5571. // Header returns an http.Header that can be modified by the caller to
  5572. // add HTTP headers to the request.
  5573. func (c *ProjectsAgentEntityTypesBatchDeleteCall) Header() http.Header {
  5574. if c.header_ == nil {
  5575. c.header_ = make(http.Header)
  5576. }
  5577. return c.header_
  5578. }
  5579. func (c *ProjectsAgentEntityTypesBatchDeleteCall) doRequest(alt string) (*http.Response, error) {
  5580. reqHeaders := make(http.Header)
  5581. for k, v := range c.header_ {
  5582. reqHeaders[k] = v
  5583. }
  5584. reqHeaders.Set("User-Agent", c.s.userAgent())
  5585. var body io.Reader = nil
  5586. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2batchdeleteentitytypesrequest)
  5587. if err != nil {
  5588. return nil, err
  5589. }
  5590. reqHeaders.Set("Content-Type", "application/json")
  5591. c.urlParams_.Set("alt", alt)
  5592. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/entityTypes:batchDelete")
  5593. urls += "?" + c.urlParams_.Encode()
  5594. req, _ := http.NewRequest("POST", urls, body)
  5595. req.Header = reqHeaders
  5596. googleapi.Expand(req.URL, map[string]string{
  5597. "parent": c.parent,
  5598. })
  5599. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5600. }
  5601. // Do executes the "dialogflow.projects.agent.entityTypes.batchDelete" call.
  5602. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  5603. // Any non-2xx status code is an error. Response headers are in either
  5604. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  5605. // was returned at all) in error.(*googleapi.Error).Header. Use
  5606. // googleapi.IsNotModified to check whether the returned error was
  5607. // because http.StatusNotModified was returned.
  5608. func (c *ProjectsAgentEntityTypesBatchDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  5609. gensupport.SetOptions(c.urlParams_, opts...)
  5610. res, err := c.doRequest("json")
  5611. if res != nil && res.StatusCode == http.StatusNotModified {
  5612. if res.Body != nil {
  5613. res.Body.Close()
  5614. }
  5615. return nil, &googleapi.Error{
  5616. Code: res.StatusCode,
  5617. Header: res.Header,
  5618. }
  5619. }
  5620. if err != nil {
  5621. return nil, err
  5622. }
  5623. defer googleapi.CloseBody(res)
  5624. if err := googleapi.CheckResponse(res); err != nil {
  5625. return nil, err
  5626. }
  5627. ret := &GoogleLongrunningOperation{
  5628. ServerResponse: googleapi.ServerResponse{
  5629. Header: res.Header,
  5630. HTTPStatusCode: res.StatusCode,
  5631. },
  5632. }
  5633. target := &ret
  5634. if err := gensupport.DecodeResponse(target, res); err != nil {
  5635. return nil, err
  5636. }
  5637. return ret, nil
  5638. // {
  5639. // "description": "Deletes entity types in the specified agent.\n\nOperation \u003cresponse: google.protobuf.Empty,\n metadata: google.protobuf.Struct\u003e",
  5640. // "flatPath": "v2/projects/{projectsId}/agent/entityTypes:batchDelete",
  5641. // "httpMethod": "POST",
  5642. // "id": "dialogflow.projects.agent.entityTypes.batchDelete",
  5643. // "parameterOrder": [
  5644. // "parent"
  5645. // ],
  5646. // "parameters": {
  5647. // "parent": {
  5648. // "description": "Required. The name of the agent to delete all entities types for. Format:\n`projects/\u003cProject ID\u003e/agent`.",
  5649. // "location": "path",
  5650. // "pattern": "^projects/[^/]+/agent$",
  5651. // "required": true,
  5652. // "type": "string"
  5653. // }
  5654. // },
  5655. // "path": "v2/{+parent}/entityTypes:batchDelete",
  5656. // "request": {
  5657. // "$ref": "GoogleCloudDialogflowV2BatchDeleteEntityTypesRequest"
  5658. // },
  5659. // "response": {
  5660. // "$ref": "GoogleLongrunningOperation"
  5661. // },
  5662. // "scopes": [
  5663. // "https://www.googleapis.com/auth/cloud-platform"
  5664. // ]
  5665. // }
  5666. }
  5667. // method id "dialogflow.projects.agent.entityTypes.batchUpdate":
  5668. type ProjectsAgentEntityTypesBatchUpdateCall struct {
  5669. s *Service
  5670. parent string
  5671. googleclouddialogflowv2batchupdateentitytypesrequest *GoogleCloudDialogflowV2BatchUpdateEntityTypesRequest
  5672. urlParams_ gensupport.URLParams
  5673. ctx_ context.Context
  5674. header_ http.Header
  5675. }
  5676. // BatchUpdate: Updates/Creates multiple entity types in the specified
  5677. // agent.
  5678. //
  5679. // Operation <response: BatchUpdateEntityTypesResponse,
  5680. // metadata: google.protobuf.Struct>
  5681. func (r *ProjectsAgentEntityTypesService) BatchUpdate(parent string, googleclouddialogflowv2batchupdateentitytypesrequest *GoogleCloudDialogflowV2BatchUpdateEntityTypesRequest) *ProjectsAgentEntityTypesBatchUpdateCall {
  5682. c := &ProjectsAgentEntityTypesBatchUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5683. c.parent = parent
  5684. c.googleclouddialogflowv2batchupdateentitytypesrequest = googleclouddialogflowv2batchupdateentitytypesrequest
  5685. return c
  5686. }
  5687. // Fields allows partial responses to be retrieved. See
  5688. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5689. // for more information.
  5690. func (c *ProjectsAgentEntityTypesBatchUpdateCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesBatchUpdateCall {
  5691. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5692. return c
  5693. }
  5694. // Context sets the context to be used in this call's Do method. Any
  5695. // pending HTTP request will be aborted if the provided context is
  5696. // canceled.
  5697. func (c *ProjectsAgentEntityTypesBatchUpdateCall) Context(ctx context.Context) *ProjectsAgentEntityTypesBatchUpdateCall {
  5698. c.ctx_ = ctx
  5699. return c
  5700. }
  5701. // Header returns an http.Header that can be modified by the caller to
  5702. // add HTTP headers to the request.
  5703. func (c *ProjectsAgentEntityTypesBatchUpdateCall) Header() http.Header {
  5704. if c.header_ == nil {
  5705. c.header_ = make(http.Header)
  5706. }
  5707. return c.header_
  5708. }
  5709. func (c *ProjectsAgentEntityTypesBatchUpdateCall) doRequest(alt string) (*http.Response, error) {
  5710. reqHeaders := make(http.Header)
  5711. for k, v := range c.header_ {
  5712. reqHeaders[k] = v
  5713. }
  5714. reqHeaders.Set("User-Agent", c.s.userAgent())
  5715. var body io.Reader = nil
  5716. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2batchupdateentitytypesrequest)
  5717. if err != nil {
  5718. return nil, err
  5719. }
  5720. reqHeaders.Set("Content-Type", "application/json")
  5721. c.urlParams_.Set("alt", alt)
  5722. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/entityTypes:batchUpdate")
  5723. urls += "?" + c.urlParams_.Encode()
  5724. req, _ := http.NewRequest("POST", urls, body)
  5725. req.Header = reqHeaders
  5726. googleapi.Expand(req.URL, map[string]string{
  5727. "parent": c.parent,
  5728. })
  5729. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5730. }
  5731. // Do executes the "dialogflow.projects.agent.entityTypes.batchUpdate" call.
  5732. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  5733. // Any non-2xx status code is an error. Response headers are in either
  5734. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  5735. // was returned at all) in error.(*googleapi.Error).Header. Use
  5736. // googleapi.IsNotModified to check whether the returned error was
  5737. // because http.StatusNotModified was returned.
  5738. func (c *ProjectsAgentEntityTypesBatchUpdateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  5739. gensupport.SetOptions(c.urlParams_, opts...)
  5740. res, err := c.doRequest("json")
  5741. if res != nil && res.StatusCode == http.StatusNotModified {
  5742. if res.Body != nil {
  5743. res.Body.Close()
  5744. }
  5745. return nil, &googleapi.Error{
  5746. Code: res.StatusCode,
  5747. Header: res.Header,
  5748. }
  5749. }
  5750. if err != nil {
  5751. return nil, err
  5752. }
  5753. defer googleapi.CloseBody(res)
  5754. if err := googleapi.CheckResponse(res); err != nil {
  5755. return nil, err
  5756. }
  5757. ret := &GoogleLongrunningOperation{
  5758. ServerResponse: googleapi.ServerResponse{
  5759. Header: res.Header,
  5760. HTTPStatusCode: res.StatusCode,
  5761. },
  5762. }
  5763. target := &ret
  5764. if err := gensupport.DecodeResponse(target, res); err != nil {
  5765. return nil, err
  5766. }
  5767. return ret, nil
  5768. // {
  5769. // "description": "Updates/Creates multiple entity types in the specified agent.\n\nOperation \u003cresponse: BatchUpdateEntityTypesResponse,\n metadata: google.protobuf.Struct\u003e",
  5770. // "flatPath": "v2/projects/{projectsId}/agent/entityTypes:batchUpdate",
  5771. // "httpMethod": "POST",
  5772. // "id": "dialogflow.projects.agent.entityTypes.batchUpdate",
  5773. // "parameterOrder": [
  5774. // "parent"
  5775. // ],
  5776. // "parameters": {
  5777. // "parent": {
  5778. // "description": "Required. The name of the agent to update or create entity types in.\nFormat: `projects/\u003cProject ID\u003e/agent`.",
  5779. // "location": "path",
  5780. // "pattern": "^projects/[^/]+/agent$",
  5781. // "required": true,
  5782. // "type": "string"
  5783. // }
  5784. // },
  5785. // "path": "v2/{+parent}/entityTypes:batchUpdate",
  5786. // "request": {
  5787. // "$ref": "GoogleCloudDialogflowV2BatchUpdateEntityTypesRequest"
  5788. // },
  5789. // "response": {
  5790. // "$ref": "GoogleLongrunningOperation"
  5791. // },
  5792. // "scopes": [
  5793. // "https://www.googleapis.com/auth/cloud-platform"
  5794. // ]
  5795. // }
  5796. }
  5797. // method id "dialogflow.projects.agent.entityTypes.create":
  5798. type ProjectsAgentEntityTypesCreateCall struct {
  5799. s *Service
  5800. parent string
  5801. googleclouddialogflowv2entitytype *GoogleCloudDialogflowV2EntityType
  5802. urlParams_ gensupport.URLParams
  5803. ctx_ context.Context
  5804. header_ http.Header
  5805. }
  5806. // Create: Creates an entity type in the specified agent.
  5807. func (r *ProjectsAgentEntityTypesService) Create(parent string, googleclouddialogflowv2entitytype *GoogleCloudDialogflowV2EntityType) *ProjectsAgentEntityTypesCreateCall {
  5808. c := &ProjectsAgentEntityTypesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5809. c.parent = parent
  5810. c.googleclouddialogflowv2entitytype = googleclouddialogflowv2entitytype
  5811. return c
  5812. }
  5813. // LanguageCode sets the optional parameter "languageCode": The language
  5814. // of entity synonyms defined in `entity_type`. If not
  5815. // specified, the agent's default language is used.
  5816. // [More than a
  5817. // dozen
  5818. // languages](https://dialogflow.com/docs/reference/language) are
  5819. // supported.
  5820. // Note: languages must be enabled in the agent, before they can be
  5821. // used.
  5822. func (c *ProjectsAgentEntityTypesCreateCall) LanguageCode(languageCode string) *ProjectsAgentEntityTypesCreateCall {
  5823. c.urlParams_.Set("languageCode", languageCode)
  5824. return c
  5825. }
  5826. // Fields allows partial responses to be retrieved. See
  5827. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5828. // for more information.
  5829. func (c *ProjectsAgentEntityTypesCreateCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesCreateCall {
  5830. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5831. return c
  5832. }
  5833. // Context sets the context to be used in this call's Do method. Any
  5834. // pending HTTP request will be aborted if the provided context is
  5835. // canceled.
  5836. func (c *ProjectsAgentEntityTypesCreateCall) Context(ctx context.Context) *ProjectsAgentEntityTypesCreateCall {
  5837. c.ctx_ = ctx
  5838. return c
  5839. }
  5840. // Header returns an http.Header that can be modified by the caller to
  5841. // add HTTP headers to the request.
  5842. func (c *ProjectsAgentEntityTypesCreateCall) Header() http.Header {
  5843. if c.header_ == nil {
  5844. c.header_ = make(http.Header)
  5845. }
  5846. return c.header_
  5847. }
  5848. func (c *ProjectsAgentEntityTypesCreateCall) doRequest(alt string) (*http.Response, error) {
  5849. reqHeaders := make(http.Header)
  5850. for k, v := range c.header_ {
  5851. reqHeaders[k] = v
  5852. }
  5853. reqHeaders.Set("User-Agent", c.s.userAgent())
  5854. var body io.Reader = nil
  5855. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2entitytype)
  5856. if err != nil {
  5857. return nil, err
  5858. }
  5859. reqHeaders.Set("Content-Type", "application/json")
  5860. c.urlParams_.Set("alt", alt)
  5861. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/entityTypes")
  5862. urls += "?" + c.urlParams_.Encode()
  5863. req, _ := http.NewRequest("POST", urls, body)
  5864. req.Header = reqHeaders
  5865. googleapi.Expand(req.URL, map[string]string{
  5866. "parent": c.parent,
  5867. })
  5868. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5869. }
  5870. // Do executes the "dialogflow.projects.agent.entityTypes.create" call.
  5871. // Exactly one of *GoogleCloudDialogflowV2EntityType or error will be
  5872. // non-nil. Any non-2xx status code is an error. Response headers are in
  5873. // either *GoogleCloudDialogflowV2EntityType.ServerResponse.Header or
  5874. // (if a response was returned at all) in
  5875. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5876. // whether the returned error was because http.StatusNotModified was
  5877. // returned.
  5878. func (c *ProjectsAgentEntityTypesCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2EntityType, error) {
  5879. gensupport.SetOptions(c.urlParams_, opts...)
  5880. res, err := c.doRequest("json")
  5881. if res != nil && res.StatusCode == http.StatusNotModified {
  5882. if res.Body != nil {
  5883. res.Body.Close()
  5884. }
  5885. return nil, &googleapi.Error{
  5886. Code: res.StatusCode,
  5887. Header: res.Header,
  5888. }
  5889. }
  5890. if err != nil {
  5891. return nil, err
  5892. }
  5893. defer googleapi.CloseBody(res)
  5894. if err := googleapi.CheckResponse(res); err != nil {
  5895. return nil, err
  5896. }
  5897. ret := &GoogleCloudDialogflowV2EntityType{
  5898. ServerResponse: googleapi.ServerResponse{
  5899. Header: res.Header,
  5900. HTTPStatusCode: res.StatusCode,
  5901. },
  5902. }
  5903. target := &ret
  5904. if err := gensupport.DecodeResponse(target, res); err != nil {
  5905. return nil, err
  5906. }
  5907. return ret, nil
  5908. // {
  5909. // "description": "Creates an entity type in the specified agent.",
  5910. // "flatPath": "v2/projects/{projectsId}/agent/entityTypes",
  5911. // "httpMethod": "POST",
  5912. // "id": "dialogflow.projects.agent.entityTypes.create",
  5913. // "parameterOrder": [
  5914. // "parent"
  5915. // ],
  5916. // "parameters": {
  5917. // "languageCode": {
  5918. // "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.",
  5919. // "location": "query",
  5920. // "type": "string"
  5921. // },
  5922. // "parent": {
  5923. // "description": "Required. The agent to create a entity type for.\nFormat: `projects/\u003cProject ID\u003e/agent`.",
  5924. // "location": "path",
  5925. // "pattern": "^projects/[^/]+/agent$",
  5926. // "required": true,
  5927. // "type": "string"
  5928. // }
  5929. // },
  5930. // "path": "v2/{+parent}/entityTypes",
  5931. // "request": {
  5932. // "$ref": "GoogleCloudDialogflowV2EntityType"
  5933. // },
  5934. // "response": {
  5935. // "$ref": "GoogleCloudDialogflowV2EntityType"
  5936. // },
  5937. // "scopes": [
  5938. // "https://www.googleapis.com/auth/cloud-platform"
  5939. // ]
  5940. // }
  5941. }
  5942. // method id "dialogflow.projects.agent.entityTypes.delete":
  5943. type ProjectsAgentEntityTypesDeleteCall struct {
  5944. s *Service
  5945. name string
  5946. urlParams_ gensupport.URLParams
  5947. ctx_ context.Context
  5948. header_ http.Header
  5949. }
  5950. // Delete: Deletes the specified entity type.
  5951. func (r *ProjectsAgentEntityTypesService) Delete(name string) *ProjectsAgentEntityTypesDeleteCall {
  5952. c := &ProjectsAgentEntityTypesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5953. c.name = name
  5954. return c
  5955. }
  5956. // Fields allows partial responses to be retrieved. See
  5957. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5958. // for more information.
  5959. func (c *ProjectsAgentEntityTypesDeleteCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesDeleteCall {
  5960. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5961. return c
  5962. }
  5963. // Context sets the context to be used in this call's Do method. Any
  5964. // pending HTTP request will be aborted if the provided context is
  5965. // canceled.
  5966. func (c *ProjectsAgentEntityTypesDeleteCall) Context(ctx context.Context) *ProjectsAgentEntityTypesDeleteCall {
  5967. c.ctx_ = ctx
  5968. return c
  5969. }
  5970. // Header returns an http.Header that can be modified by the caller to
  5971. // add HTTP headers to the request.
  5972. func (c *ProjectsAgentEntityTypesDeleteCall) Header() http.Header {
  5973. if c.header_ == nil {
  5974. c.header_ = make(http.Header)
  5975. }
  5976. return c.header_
  5977. }
  5978. func (c *ProjectsAgentEntityTypesDeleteCall) doRequest(alt string) (*http.Response, error) {
  5979. reqHeaders := make(http.Header)
  5980. for k, v := range c.header_ {
  5981. reqHeaders[k] = v
  5982. }
  5983. reqHeaders.Set("User-Agent", c.s.userAgent())
  5984. var body io.Reader = nil
  5985. c.urlParams_.Set("alt", alt)
  5986. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  5987. urls += "?" + c.urlParams_.Encode()
  5988. req, _ := http.NewRequest("DELETE", urls, body)
  5989. req.Header = reqHeaders
  5990. googleapi.Expand(req.URL, map[string]string{
  5991. "name": c.name,
  5992. })
  5993. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5994. }
  5995. // Do executes the "dialogflow.projects.agent.entityTypes.delete" call.
  5996. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  5997. // non-2xx status code is an error. Response headers are in either
  5998. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  5999. // returned at all) in error.(*googleapi.Error).Header. Use
  6000. // googleapi.IsNotModified to check whether the returned error was
  6001. // because http.StatusNotModified was returned.
  6002. func (c *ProjectsAgentEntityTypesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  6003. gensupport.SetOptions(c.urlParams_, opts...)
  6004. res, err := c.doRequest("json")
  6005. if res != nil && res.StatusCode == http.StatusNotModified {
  6006. if res.Body != nil {
  6007. res.Body.Close()
  6008. }
  6009. return nil, &googleapi.Error{
  6010. Code: res.StatusCode,
  6011. Header: res.Header,
  6012. }
  6013. }
  6014. if err != nil {
  6015. return nil, err
  6016. }
  6017. defer googleapi.CloseBody(res)
  6018. if err := googleapi.CheckResponse(res); err != nil {
  6019. return nil, err
  6020. }
  6021. ret := &GoogleProtobufEmpty{
  6022. ServerResponse: googleapi.ServerResponse{
  6023. Header: res.Header,
  6024. HTTPStatusCode: res.StatusCode,
  6025. },
  6026. }
  6027. target := &ret
  6028. if err := gensupport.DecodeResponse(target, res); err != nil {
  6029. return nil, err
  6030. }
  6031. return ret, nil
  6032. // {
  6033. // "description": "Deletes the specified entity type.",
  6034. // "flatPath": "v2/projects/{projectsId}/agent/entityTypes/{entityTypesId}",
  6035. // "httpMethod": "DELETE",
  6036. // "id": "dialogflow.projects.agent.entityTypes.delete",
  6037. // "parameterOrder": [
  6038. // "name"
  6039. // ],
  6040. // "parameters": {
  6041. // "name": {
  6042. // "description": "Required. The name of the entity type to delete.\nFormat: `projects/\u003cProject ID\u003e/agent/entityTypes/\u003cEntityType ID\u003e`.",
  6043. // "location": "path",
  6044. // "pattern": "^projects/[^/]+/agent/entityTypes/[^/]+$",
  6045. // "required": true,
  6046. // "type": "string"
  6047. // }
  6048. // },
  6049. // "path": "v2/{+name}",
  6050. // "response": {
  6051. // "$ref": "GoogleProtobufEmpty"
  6052. // },
  6053. // "scopes": [
  6054. // "https://www.googleapis.com/auth/cloud-platform"
  6055. // ]
  6056. // }
  6057. }
  6058. // method id "dialogflow.projects.agent.entityTypes.get":
  6059. type ProjectsAgentEntityTypesGetCall struct {
  6060. s *Service
  6061. name string
  6062. urlParams_ gensupport.URLParams
  6063. ifNoneMatch_ string
  6064. ctx_ context.Context
  6065. header_ http.Header
  6066. }
  6067. // Get: Retrieves the specified entity type.
  6068. func (r *ProjectsAgentEntityTypesService) Get(name string) *ProjectsAgentEntityTypesGetCall {
  6069. c := &ProjectsAgentEntityTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6070. c.name = name
  6071. return c
  6072. }
  6073. // LanguageCode sets the optional parameter "languageCode": The language
  6074. // to retrieve entity synonyms for. If not specified,
  6075. // the agent's default language is used.
  6076. // [More than a
  6077. // dozen
  6078. // languages](https://dialogflow.com/docs/reference/language) are
  6079. // supported.
  6080. // Note: languages must be enabled in the agent, before they can be
  6081. // used.
  6082. func (c *ProjectsAgentEntityTypesGetCall) LanguageCode(languageCode string) *ProjectsAgentEntityTypesGetCall {
  6083. c.urlParams_.Set("languageCode", languageCode)
  6084. return c
  6085. }
  6086. // Fields allows partial responses to be retrieved. See
  6087. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6088. // for more information.
  6089. func (c *ProjectsAgentEntityTypesGetCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesGetCall {
  6090. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6091. return c
  6092. }
  6093. // IfNoneMatch sets the optional parameter which makes the operation
  6094. // fail if the object's ETag matches the given value. This is useful for
  6095. // getting updates only after the object has changed since the last
  6096. // request. Use googleapi.IsNotModified to check whether the response
  6097. // error from Do is the result of In-None-Match.
  6098. func (c *ProjectsAgentEntityTypesGetCall) IfNoneMatch(entityTag string) *ProjectsAgentEntityTypesGetCall {
  6099. c.ifNoneMatch_ = entityTag
  6100. return c
  6101. }
  6102. // Context sets the context to be used in this call's Do method. Any
  6103. // pending HTTP request will be aborted if the provided context is
  6104. // canceled.
  6105. func (c *ProjectsAgentEntityTypesGetCall) Context(ctx context.Context) *ProjectsAgentEntityTypesGetCall {
  6106. c.ctx_ = ctx
  6107. return c
  6108. }
  6109. // Header returns an http.Header that can be modified by the caller to
  6110. // add HTTP headers to the request.
  6111. func (c *ProjectsAgentEntityTypesGetCall) Header() http.Header {
  6112. if c.header_ == nil {
  6113. c.header_ = make(http.Header)
  6114. }
  6115. return c.header_
  6116. }
  6117. func (c *ProjectsAgentEntityTypesGetCall) doRequest(alt string) (*http.Response, error) {
  6118. reqHeaders := make(http.Header)
  6119. for k, v := range c.header_ {
  6120. reqHeaders[k] = v
  6121. }
  6122. reqHeaders.Set("User-Agent", c.s.userAgent())
  6123. if c.ifNoneMatch_ != "" {
  6124. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6125. }
  6126. var body io.Reader = nil
  6127. c.urlParams_.Set("alt", alt)
  6128. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  6129. urls += "?" + c.urlParams_.Encode()
  6130. req, _ := http.NewRequest("GET", urls, body)
  6131. req.Header = reqHeaders
  6132. googleapi.Expand(req.URL, map[string]string{
  6133. "name": c.name,
  6134. })
  6135. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6136. }
  6137. // Do executes the "dialogflow.projects.agent.entityTypes.get" call.
  6138. // Exactly one of *GoogleCloudDialogflowV2EntityType or error will be
  6139. // non-nil. Any non-2xx status code is an error. Response headers are in
  6140. // either *GoogleCloudDialogflowV2EntityType.ServerResponse.Header or
  6141. // (if a response was returned at all) in
  6142. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6143. // whether the returned error was because http.StatusNotModified was
  6144. // returned.
  6145. func (c *ProjectsAgentEntityTypesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2EntityType, error) {
  6146. gensupport.SetOptions(c.urlParams_, opts...)
  6147. res, err := c.doRequest("json")
  6148. if res != nil && res.StatusCode == http.StatusNotModified {
  6149. if res.Body != nil {
  6150. res.Body.Close()
  6151. }
  6152. return nil, &googleapi.Error{
  6153. Code: res.StatusCode,
  6154. Header: res.Header,
  6155. }
  6156. }
  6157. if err != nil {
  6158. return nil, err
  6159. }
  6160. defer googleapi.CloseBody(res)
  6161. if err := googleapi.CheckResponse(res); err != nil {
  6162. return nil, err
  6163. }
  6164. ret := &GoogleCloudDialogflowV2EntityType{
  6165. ServerResponse: googleapi.ServerResponse{
  6166. Header: res.Header,
  6167. HTTPStatusCode: res.StatusCode,
  6168. },
  6169. }
  6170. target := &ret
  6171. if err := gensupport.DecodeResponse(target, res); err != nil {
  6172. return nil, err
  6173. }
  6174. return ret, nil
  6175. // {
  6176. // "description": "Retrieves the specified entity type.",
  6177. // "flatPath": "v2/projects/{projectsId}/agent/entityTypes/{entityTypesId}",
  6178. // "httpMethod": "GET",
  6179. // "id": "dialogflow.projects.agent.entityTypes.get",
  6180. // "parameterOrder": [
  6181. // "name"
  6182. // ],
  6183. // "parameters": {
  6184. // "languageCode": {
  6185. // "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.",
  6186. // "location": "query",
  6187. // "type": "string"
  6188. // },
  6189. // "name": {
  6190. // "description": "Required. The name of the entity type.\nFormat: `projects/\u003cProject ID\u003e/agent/entityTypes/\u003cEntityType ID\u003e`.",
  6191. // "location": "path",
  6192. // "pattern": "^projects/[^/]+/agent/entityTypes/[^/]+$",
  6193. // "required": true,
  6194. // "type": "string"
  6195. // }
  6196. // },
  6197. // "path": "v2/{+name}",
  6198. // "response": {
  6199. // "$ref": "GoogleCloudDialogflowV2EntityType"
  6200. // },
  6201. // "scopes": [
  6202. // "https://www.googleapis.com/auth/cloud-platform"
  6203. // ]
  6204. // }
  6205. }
  6206. // method id "dialogflow.projects.agent.entityTypes.list":
  6207. type ProjectsAgentEntityTypesListCall struct {
  6208. s *Service
  6209. parent string
  6210. urlParams_ gensupport.URLParams
  6211. ifNoneMatch_ string
  6212. ctx_ context.Context
  6213. header_ http.Header
  6214. }
  6215. // List: Returns the list of all entity types in the specified agent.
  6216. func (r *ProjectsAgentEntityTypesService) List(parent string) *ProjectsAgentEntityTypesListCall {
  6217. c := &ProjectsAgentEntityTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6218. c.parent = parent
  6219. return c
  6220. }
  6221. // LanguageCode sets the optional parameter "languageCode": The language
  6222. // to list entity synonyms for. If not specified,
  6223. // the agent's default language is used.
  6224. // [More than a
  6225. // dozen
  6226. // languages](https://dialogflow.com/docs/reference/language) are
  6227. // supported.
  6228. // Note: languages must be enabled in the agent, before they can be
  6229. // used.
  6230. func (c *ProjectsAgentEntityTypesListCall) LanguageCode(languageCode string) *ProjectsAgentEntityTypesListCall {
  6231. c.urlParams_.Set("languageCode", languageCode)
  6232. return c
  6233. }
  6234. // PageSize sets the optional parameter "pageSize": The maximum number
  6235. // of items to return in a single page. By
  6236. // default 100 and at most 1000.
  6237. func (c *ProjectsAgentEntityTypesListCall) PageSize(pageSize int64) *ProjectsAgentEntityTypesListCall {
  6238. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  6239. return c
  6240. }
  6241. // PageToken sets the optional parameter "pageToken": The
  6242. // next_page_token value returned from a previous list request.
  6243. func (c *ProjectsAgentEntityTypesListCall) PageToken(pageToken string) *ProjectsAgentEntityTypesListCall {
  6244. c.urlParams_.Set("pageToken", pageToken)
  6245. return c
  6246. }
  6247. // Fields allows partial responses to be retrieved. See
  6248. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6249. // for more information.
  6250. func (c *ProjectsAgentEntityTypesListCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesListCall {
  6251. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6252. return c
  6253. }
  6254. // IfNoneMatch sets the optional parameter which makes the operation
  6255. // fail if the object's ETag matches the given value. This is useful for
  6256. // getting updates only after the object has changed since the last
  6257. // request. Use googleapi.IsNotModified to check whether the response
  6258. // error from Do is the result of In-None-Match.
  6259. func (c *ProjectsAgentEntityTypesListCall) IfNoneMatch(entityTag string) *ProjectsAgentEntityTypesListCall {
  6260. c.ifNoneMatch_ = entityTag
  6261. return c
  6262. }
  6263. // Context sets the context to be used in this call's Do method. Any
  6264. // pending HTTP request will be aborted if the provided context is
  6265. // canceled.
  6266. func (c *ProjectsAgentEntityTypesListCall) Context(ctx context.Context) *ProjectsAgentEntityTypesListCall {
  6267. c.ctx_ = ctx
  6268. return c
  6269. }
  6270. // Header returns an http.Header that can be modified by the caller to
  6271. // add HTTP headers to the request.
  6272. func (c *ProjectsAgentEntityTypesListCall) Header() http.Header {
  6273. if c.header_ == nil {
  6274. c.header_ = make(http.Header)
  6275. }
  6276. return c.header_
  6277. }
  6278. func (c *ProjectsAgentEntityTypesListCall) doRequest(alt string) (*http.Response, error) {
  6279. reqHeaders := make(http.Header)
  6280. for k, v := range c.header_ {
  6281. reqHeaders[k] = v
  6282. }
  6283. reqHeaders.Set("User-Agent", c.s.userAgent())
  6284. if c.ifNoneMatch_ != "" {
  6285. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6286. }
  6287. var body io.Reader = nil
  6288. c.urlParams_.Set("alt", alt)
  6289. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/entityTypes")
  6290. urls += "?" + c.urlParams_.Encode()
  6291. req, _ := http.NewRequest("GET", urls, body)
  6292. req.Header = reqHeaders
  6293. googleapi.Expand(req.URL, map[string]string{
  6294. "parent": c.parent,
  6295. })
  6296. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6297. }
  6298. // Do executes the "dialogflow.projects.agent.entityTypes.list" call.
  6299. // Exactly one of *GoogleCloudDialogflowV2ListEntityTypesResponse or
  6300. // error will be non-nil. Any non-2xx status code is an error. Response
  6301. // headers are in either
  6302. // *GoogleCloudDialogflowV2ListEntityTypesResponse.ServerResponse.Header
  6303. // or (if a response was returned at all) in
  6304. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6305. // whether the returned error was because http.StatusNotModified was
  6306. // returned.
  6307. func (c *ProjectsAgentEntityTypesListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2ListEntityTypesResponse, error) {
  6308. gensupport.SetOptions(c.urlParams_, opts...)
  6309. res, err := c.doRequest("json")
  6310. if res != nil && res.StatusCode == http.StatusNotModified {
  6311. if res.Body != nil {
  6312. res.Body.Close()
  6313. }
  6314. return nil, &googleapi.Error{
  6315. Code: res.StatusCode,
  6316. Header: res.Header,
  6317. }
  6318. }
  6319. if err != nil {
  6320. return nil, err
  6321. }
  6322. defer googleapi.CloseBody(res)
  6323. if err := googleapi.CheckResponse(res); err != nil {
  6324. return nil, err
  6325. }
  6326. ret := &GoogleCloudDialogflowV2ListEntityTypesResponse{
  6327. ServerResponse: googleapi.ServerResponse{
  6328. Header: res.Header,
  6329. HTTPStatusCode: res.StatusCode,
  6330. },
  6331. }
  6332. target := &ret
  6333. if err := gensupport.DecodeResponse(target, res); err != nil {
  6334. return nil, err
  6335. }
  6336. return ret, nil
  6337. // {
  6338. // "description": "Returns the list of all entity types in the specified agent.",
  6339. // "flatPath": "v2/projects/{projectsId}/agent/entityTypes",
  6340. // "httpMethod": "GET",
  6341. // "id": "dialogflow.projects.agent.entityTypes.list",
  6342. // "parameterOrder": [
  6343. // "parent"
  6344. // ],
  6345. // "parameters": {
  6346. // "languageCode": {
  6347. // "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.",
  6348. // "location": "query",
  6349. // "type": "string"
  6350. // },
  6351. // "pageSize": {
  6352. // "description": "Optional. The maximum number of items to return in a single page. By\ndefault 100 and at most 1000.",
  6353. // "format": "int32",
  6354. // "location": "query",
  6355. // "type": "integer"
  6356. // },
  6357. // "pageToken": {
  6358. // "description": "Optional. The next_page_token value returned from a previous list request.",
  6359. // "location": "query",
  6360. // "type": "string"
  6361. // },
  6362. // "parent": {
  6363. // "description": "Required. The agent to list all entity types from.\nFormat: `projects/\u003cProject ID\u003e/agent`.",
  6364. // "location": "path",
  6365. // "pattern": "^projects/[^/]+/agent$",
  6366. // "required": true,
  6367. // "type": "string"
  6368. // }
  6369. // },
  6370. // "path": "v2/{+parent}/entityTypes",
  6371. // "response": {
  6372. // "$ref": "GoogleCloudDialogflowV2ListEntityTypesResponse"
  6373. // },
  6374. // "scopes": [
  6375. // "https://www.googleapis.com/auth/cloud-platform"
  6376. // ]
  6377. // }
  6378. }
  6379. // Pages invokes f for each page of results.
  6380. // A non-nil error returned from f will halt the iteration.
  6381. // The provided context supersedes any context provided to the Context method.
  6382. func (c *ProjectsAgentEntityTypesListCall) Pages(ctx context.Context, f func(*GoogleCloudDialogflowV2ListEntityTypesResponse) error) error {
  6383. c.ctx_ = ctx
  6384. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  6385. for {
  6386. x, err := c.Do()
  6387. if err != nil {
  6388. return err
  6389. }
  6390. if err := f(x); err != nil {
  6391. return err
  6392. }
  6393. if x.NextPageToken == "" {
  6394. return nil
  6395. }
  6396. c.PageToken(x.NextPageToken)
  6397. }
  6398. }
  6399. // method id "dialogflow.projects.agent.entityTypes.patch":
  6400. type ProjectsAgentEntityTypesPatchCall struct {
  6401. s *Service
  6402. nameid string
  6403. googleclouddialogflowv2entitytype *GoogleCloudDialogflowV2EntityType
  6404. urlParams_ gensupport.URLParams
  6405. ctx_ context.Context
  6406. header_ http.Header
  6407. }
  6408. // Patch: Updates the specified entity type.
  6409. func (r *ProjectsAgentEntityTypesService) Patch(nameid string, googleclouddialogflowv2entitytype *GoogleCloudDialogflowV2EntityType) *ProjectsAgentEntityTypesPatchCall {
  6410. c := &ProjectsAgentEntityTypesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6411. c.nameid = nameid
  6412. c.googleclouddialogflowv2entitytype = googleclouddialogflowv2entitytype
  6413. return c
  6414. }
  6415. // LanguageCode sets the optional parameter "languageCode": The language
  6416. // of entity synonyms defined in `entity_type`. If not
  6417. // specified, the agent's default language is used.
  6418. // [More than a
  6419. // dozen
  6420. // languages](https://dialogflow.com/docs/reference/language) are
  6421. // supported.
  6422. // Note: languages must be enabled in the agent, before they can be
  6423. // used.
  6424. func (c *ProjectsAgentEntityTypesPatchCall) LanguageCode(languageCode string) *ProjectsAgentEntityTypesPatchCall {
  6425. c.urlParams_.Set("languageCode", languageCode)
  6426. return c
  6427. }
  6428. // UpdateMask sets the optional parameter "updateMask": The mask to
  6429. // control which fields get updated.
  6430. func (c *ProjectsAgentEntityTypesPatchCall) UpdateMask(updateMask string) *ProjectsAgentEntityTypesPatchCall {
  6431. c.urlParams_.Set("updateMask", updateMask)
  6432. return c
  6433. }
  6434. // Fields allows partial responses to be retrieved. See
  6435. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6436. // for more information.
  6437. func (c *ProjectsAgentEntityTypesPatchCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesPatchCall {
  6438. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6439. return c
  6440. }
  6441. // Context sets the context to be used in this call's Do method. Any
  6442. // pending HTTP request will be aborted if the provided context is
  6443. // canceled.
  6444. func (c *ProjectsAgentEntityTypesPatchCall) Context(ctx context.Context) *ProjectsAgentEntityTypesPatchCall {
  6445. c.ctx_ = ctx
  6446. return c
  6447. }
  6448. // Header returns an http.Header that can be modified by the caller to
  6449. // add HTTP headers to the request.
  6450. func (c *ProjectsAgentEntityTypesPatchCall) Header() http.Header {
  6451. if c.header_ == nil {
  6452. c.header_ = make(http.Header)
  6453. }
  6454. return c.header_
  6455. }
  6456. func (c *ProjectsAgentEntityTypesPatchCall) doRequest(alt string) (*http.Response, error) {
  6457. reqHeaders := make(http.Header)
  6458. for k, v := range c.header_ {
  6459. reqHeaders[k] = v
  6460. }
  6461. reqHeaders.Set("User-Agent", c.s.userAgent())
  6462. var body io.Reader = nil
  6463. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2entitytype)
  6464. if err != nil {
  6465. return nil, err
  6466. }
  6467. reqHeaders.Set("Content-Type", "application/json")
  6468. c.urlParams_.Set("alt", alt)
  6469. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  6470. urls += "?" + c.urlParams_.Encode()
  6471. req, _ := http.NewRequest("PATCH", urls, body)
  6472. req.Header = reqHeaders
  6473. googleapi.Expand(req.URL, map[string]string{
  6474. "name": c.nameid,
  6475. })
  6476. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6477. }
  6478. // Do executes the "dialogflow.projects.agent.entityTypes.patch" call.
  6479. // Exactly one of *GoogleCloudDialogflowV2EntityType or error will be
  6480. // non-nil. Any non-2xx status code is an error. Response headers are in
  6481. // either *GoogleCloudDialogflowV2EntityType.ServerResponse.Header or
  6482. // (if a response was returned at all) in
  6483. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6484. // whether the returned error was because http.StatusNotModified was
  6485. // returned.
  6486. func (c *ProjectsAgentEntityTypesPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2EntityType, error) {
  6487. gensupport.SetOptions(c.urlParams_, opts...)
  6488. res, err := c.doRequest("json")
  6489. if res != nil && res.StatusCode == http.StatusNotModified {
  6490. if res.Body != nil {
  6491. res.Body.Close()
  6492. }
  6493. return nil, &googleapi.Error{
  6494. Code: res.StatusCode,
  6495. Header: res.Header,
  6496. }
  6497. }
  6498. if err != nil {
  6499. return nil, err
  6500. }
  6501. defer googleapi.CloseBody(res)
  6502. if err := googleapi.CheckResponse(res); err != nil {
  6503. return nil, err
  6504. }
  6505. ret := &GoogleCloudDialogflowV2EntityType{
  6506. ServerResponse: googleapi.ServerResponse{
  6507. Header: res.Header,
  6508. HTTPStatusCode: res.StatusCode,
  6509. },
  6510. }
  6511. target := &ret
  6512. if err := gensupport.DecodeResponse(target, res); err != nil {
  6513. return nil, err
  6514. }
  6515. return ret, nil
  6516. // {
  6517. // "description": "Updates the specified entity type.",
  6518. // "flatPath": "v2/projects/{projectsId}/agent/entityTypes/{entityTypesId}",
  6519. // "httpMethod": "PATCH",
  6520. // "id": "dialogflow.projects.agent.entityTypes.patch",
  6521. // "parameterOrder": [
  6522. // "name"
  6523. // ],
  6524. // "parameters": {
  6525. // "languageCode": {
  6526. // "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.",
  6527. // "location": "query",
  6528. // "type": "string"
  6529. // },
  6530. // "name": {
  6531. // "description": "Required for all methods except `create` (`create` populates the name\nautomatically.\nThe unique identifier of the entity type. Format:\n`projects/\u003cProject ID\u003e/agent/entityTypes/\u003cEntity Type ID\u003e`.",
  6532. // "location": "path",
  6533. // "pattern": "^projects/[^/]+/agent/entityTypes/[^/]+$",
  6534. // "required": true,
  6535. // "type": "string"
  6536. // },
  6537. // "updateMask": {
  6538. // "description": "Optional. The mask to control which fields get updated.",
  6539. // "format": "google-fieldmask",
  6540. // "location": "query",
  6541. // "type": "string"
  6542. // }
  6543. // },
  6544. // "path": "v2/{+name}",
  6545. // "request": {
  6546. // "$ref": "GoogleCloudDialogflowV2EntityType"
  6547. // },
  6548. // "response": {
  6549. // "$ref": "GoogleCloudDialogflowV2EntityType"
  6550. // },
  6551. // "scopes": [
  6552. // "https://www.googleapis.com/auth/cloud-platform"
  6553. // ]
  6554. // }
  6555. }
  6556. // method id "dialogflow.projects.agent.entityTypes.entities.batchCreate":
  6557. type ProjectsAgentEntityTypesEntitiesBatchCreateCall struct {
  6558. s *Service
  6559. parent string
  6560. googleclouddialogflowv2batchcreateentitiesrequest *GoogleCloudDialogflowV2BatchCreateEntitiesRequest
  6561. urlParams_ gensupport.URLParams
  6562. ctx_ context.Context
  6563. header_ http.Header
  6564. }
  6565. // BatchCreate: Creates multiple new entities in the specified entity
  6566. // type (extends the
  6567. // existing collection of entries).
  6568. //
  6569. // Operation <response: google.protobuf.Empty>
  6570. func (r *ProjectsAgentEntityTypesEntitiesService) BatchCreate(parent string, googleclouddialogflowv2batchcreateentitiesrequest *GoogleCloudDialogflowV2BatchCreateEntitiesRequest) *ProjectsAgentEntityTypesEntitiesBatchCreateCall {
  6571. c := &ProjectsAgentEntityTypesEntitiesBatchCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6572. c.parent = parent
  6573. c.googleclouddialogflowv2batchcreateentitiesrequest = googleclouddialogflowv2batchcreateentitiesrequest
  6574. return c
  6575. }
  6576. // Fields allows partial responses to be retrieved. See
  6577. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6578. // for more information.
  6579. func (c *ProjectsAgentEntityTypesEntitiesBatchCreateCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesEntitiesBatchCreateCall {
  6580. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6581. return c
  6582. }
  6583. // Context sets the context to be used in this call's Do method. Any
  6584. // pending HTTP request will be aborted if the provided context is
  6585. // canceled.
  6586. func (c *ProjectsAgentEntityTypesEntitiesBatchCreateCall) Context(ctx context.Context) *ProjectsAgentEntityTypesEntitiesBatchCreateCall {
  6587. c.ctx_ = ctx
  6588. return c
  6589. }
  6590. // Header returns an http.Header that can be modified by the caller to
  6591. // add HTTP headers to the request.
  6592. func (c *ProjectsAgentEntityTypesEntitiesBatchCreateCall) Header() http.Header {
  6593. if c.header_ == nil {
  6594. c.header_ = make(http.Header)
  6595. }
  6596. return c.header_
  6597. }
  6598. func (c *ProjectsAgentEntityTypesEntitiesBatchCreateCall) doRequest(alt string) (*http.Response, error) {
  6599. reqHeaders := make(http.Header)
  6600. for k, v := range c.header_ {
  6601. reqHeaders[k] = v
  6602. }
  6603. reqHeaders.Set("User-Agent", c.s.userAgent())
  6604. var body io.Reader = nil
  6605. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2batchcreateentitiesrequest)
  6606. if err != nil {
  6607. return nil, err
  6608. }
  6609. reqHeaders.Set("Content-Type", "application/json")
  6610. c.urlParams_.Set("alt", alt)
  6611. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/entities:batchCreate")
  6612. urls += "?" + c.urlParams_.Encode()
  6613. req, _ := http.NewRequest("POST", urls, body)
  6614. req.Header = reqHeaders
  6615. googleapi.Expand(req.URL, map[string]string{
  6616. "parent": c.parent,
  6617. })
  6618. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6619. }
  6620. // Do executes the "dialogflow.projects.agent.entityTypes.entities.batchCreate" call.
  6621. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  6622. // Any non-2xx status code is an error. Response headers are in either
  6623. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  6624. // was returned at all) in error.(*googleapi.Error).Header. Use
  6625. // googleapi.IsNotModified to check whether the returned error was
  6626. // because http.StatusNotModified was returned.
  6627. func (c *ProjectsAgentEntityTypesEntitiesBatchCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  6628. gensupport.SetOptions(c.urlParams_, opts...)
  6629. res, err := c.doRequest("json")
  6630. if res != nil && res.StatusCode == http.StatusNotModified {
  6631. if res.Body != nil {
  6632. res.Body.Close()
  6633. }
  6634. return nil, &googleapi.Error{
  6635. Code: res.StatusCode,
  6636. Header: res.Header,
  6637. }
  6638. }
  6639. if err != nil {
  6640. return nil, err
  6641. }
  6642. defer googleapi.CloseBody(res)
  6643. if err := googleapi.CheckResponse(res); err != nil {
  6644. return nil, err
  6645. }
  6646. ret := &GoogleLongrunningOperation{
  6647. ServerResponse: googleapi.ServerResponse{
  6648. Header: res.Header,
  6649. HTTPStatusCode: res.StatusCode,
  6650. },
  6651. }
  6652. target := &ret
  6653. if err := gensupport.DecodeResponse(target, res); err != nil {
  6654. return nil, err
  6655. }
  6656. return ret, nil
  6657. // {
  6658. // "description": "Creates multiple new entities in the specified entity type (extends the\nexisting collection of entries).\n\nOperation \u003cresponse: google.protobuf.Empty\u003e",
  6659. // "flatPath": "v2/projects/{projectsId}/agent/entityTypes/{entityTypesId}/entities:batchCreate",
  6660. // "httpMethod": "POST",
  6661. // "id": "dialogflow.projects.agent.entityTypes.entities.batchCreate",
  6662. // "parameterOrder": [
  6663. // "parent"
  6664. // ],
  6665. // "parameters": {
  6666. // "parent": {
  6667. // "description": "Required. The name of the entity type to create entities in. Format:\n`projects/\u003cProject ID\u003e/agent/entityTypes/\u003cEntity Type ID\u003e`.",
  6668. // "location": "path",
  6669. // "pattern": "^projects/[^/]+/agent/entityTypes/[^/]+$",
  6670. // "required": true,
  6671. // "type": "string"
  6672. // }
  6673. // },
  6674. // "path": "v2/{+parent}/entities:batchCreate",
  6675. // "request": {
  6676. // "$ref": "GoogleCloudDialogflowV2BatchCreateEntitiesRequest"
  6677. // },
  6678. // "response": {
  6679. // "$ref": "GoogleLongrunningOperation"
  6680. // },
  6681. // "scopes": [
  6682. // "https://www.googleapis.com/auth/cloud-platform"
  6683. // ]
  6684. // }
  6685. }
  6686. // method id "dialogflow.projects.agent.entityTypes.entities.batchDelete":
  6687. type ProjectsAgentEntityTypesEntitiesBatchDeleteCall struct {
  6688. s *Service
  6689. parent string
  6690. googleclouddialogflowv2batchdeleteentitiesrequest *GoogleCloudDialogflowV2BatchDeleteEntitiesRequest
  6691. urlParams_ gensupport.URLParams
  6692. ctx_ context.Context
  6693. header_ http.Header
  6694. }
  6695. // BatchDelete: Deletes entities in the specified entity
  6696. // type.
  6697. //
  6698. // Operation <response: google.protobuf.Empty,
  6699. // metadata: google.protobuf.Struct>
  6700. func (r *ProjectsAgentEntityTypesEntitiesService) BatchDelete(parent string, googleclouddialogflowv2batchdeleteentitiesrequest *GoogleCloudDialogflowV2BatchDeleteEntitiesRequest) *ProjectsAgentEntityTypesEntitiesBatchDeleteCall {
  6701. c := &ProjectsAgentEntityTypesEntitiesBatchDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6702. c.parent = parent
  6703. c.googleclouddialogflowv2batchdeleteentitiesrequest = googleclouddialogflowv2batchdeleteentitiesrequest
  6704. return c
  6705. }
  6706. // Fields allows partial responses to be retrieved. See
  6707. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6708. // for more information.
  6709. func (c *ProjectsAgentEntityTypesEntitiesBatchDeleteCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesEntitiesBatchDeleteCall {
  6710. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6711. return c
  6712. }
  6713. // Context sets the context to be used in this call's Do method. Any
  6714. // pending HTTP request will be aborted if the provided context is
  6715. // canceled.
  6716. func (c *ProjectsAgentEntityTypesEntitiesBatchDeleteCall) Context(ctx context.Context) *ProjectsAgentEntityTypesEntitiesBatchDeleteCall {
  6717. c.ctx_ = ctx
  6718. return c
  6719. }
  6720. // Header returns an http.Header that can be modified by the caller to
  6721. // add HTTP headers to the request.
  6722. func (c *ProjectsAgentEntityTypesEntitiesBatchDeleteCall) Header() http.Header {
  6723. if c.header_ == nil {
  6724. c.header_ = make(http.Header)
  6725. }
  6726. return c.header_
  6727. }
  6728. func (c *ProjectsAgentEntityTypesEntitiesBatchDeleteCall) doRequest(alt string) (*http.Response, error) {
  6729. reqHeaders := make(http.Header)
  6730. for k, v := range c.header_ {
  6731. reqHeaders[k] = v
  6732. }
  6733. reqHeaders.Set("User-Agent", c.s.userAgent())
  6734. var body io.Reader = nil
  6735. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2batchdeleteentitiesrequest)
  6736. if err != nil {
  6737. return nil, err
  6738. }
  6739. reqHeaders.Set("Content-Type", "application/json")
  6740. c.urlParams_.Set("alt", alt)
  6741. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/entities:batchDelete")
  6742. urls += "?" + c.urlParams_.Encode()
  6743. req, _ := http.NewRequest("POST", urls, body)
  6744. req.Header = reqHeaders
  6745. googleapi.Expand(req.URL, map[string]string{
  6746. "parent": c.parent,
  6747. })
  6748. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6749. }
  6750. // Do executes the "dialogflow.projects.agent.entityTypes.entities.batchDelete" call.
  6751. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  6752. // Any non-2xx status code is an error. Response headers are in either
  6753. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  6754. // was returned at all) in error.(*googleapi.Error).Header. Use
  6755. // googleapi.IsNotModified to check whether the returned error was
  6756. // because http.StatusNotModified was returned.
  6757. func (c *ProjectsAgentEntityTypesEntitiesBatchDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  6758. gensupport.SetOptions(c.urlParams_, opts...)
  6759. res, err := c.doRequest("json")
  6760. if res != nil && res.StatusCode == http.StatusNotModified {
  6761. if res.Body != nil {
  6762. res.Body.Close()
  6763. }
  6764. return nil, &googleapi.Error{
  6765. Code: res.StatusCode,
  6766. Header: res.Header,
  6767. }
  6768. }
  6769. if err != nil {
  6770. return nil, err
  6771. }
  6772. defer googleapi.CloseBody(res)
  6773. if err := googleapi.CheckResponse(res); err != nil {
  6774. return nil, err
  6775. }
  6776. ret := &GoogleLongrunningOperation{
  6777. ServerResponse: googleapi.ServerResponse{
  6778. Header: res.Header,
  6779. HTTPStatusCode: res.StatusCode,
  6780. },
  6781. }
  6782. target := &ret
  6783. if err := gensupport.DecodeResponse(target, res); err != nil {
  6784. return nil, err
  6785. }
  6786. return ret, nil
  6787. // {
  6788. // "description": "Deletes entities in the specified entity type.\n\nOperation \u003cresponse: google.protobuf.Empty,\n metadata: google.protobuf.Struct\u003e",
  6789. // "flatPath": "v2/projects/{projectsId}/agent/entityTypes/{entityTypesId}/entities:batchDelete",
  6790. // "httpMethod": "POST",
  6791. // "id": "dialogflow.projects.agent.entityTypes.entities.batchDelete",
  6792. // "parameterOrder": [
  6793. // "parent"
  6794. // ],
  6795. // "parameters": {
  6796. // "parent": {
  6797. // "description": "Required. The name of the entity type to delete entries for. Format:\n`projects/\u003cProject ID\u003e/agent/entityTypes/\u003cEntity Type ID\u003e`.",
  6798. // "location": "path",
  6799. // "pattern": "^projects/[^/]+/agent/entityTypes/[^/]+$",
  6800. // "required": true,
  6801. // "type": "string"
  6802. // }
  6803. // },
  6804. // "path": "v2/{+parent}/entities:batchDelete",
  6805. // "request": {
  6806. // "$ref": "GoogleCloudDialogflowV2BatchDeleteEntitiesRequest"
  6807. // },
  6808. // "response": {
  6809. // "$ref": "GoogleLongrunningOperation"
  6810. // },
  6811. // "scopes": [
  6812. // "https://www.googleapis.com/auth/cloud-platform"
  6813. // ]
  6814. // }
  6815. }
  6816. // method id "dialogflow.projects.agent.entityTypes.entities.batchUpdate":
  6817. type ProjectsAgentEntityTypesEntitiesBatchUpdateCall struct {
  6818. s *Service
  6819. parent string
  6820. googleclouddialogflowv2batchupdateentitiesrequest *GoogleCloudDialogflowV2BatchUpdateEntitiesRequest
  6821. urlParams_ gensupport.URLParams
  6822. ctx_ context.Context
  6823. header_ http.Header
  6824. }
  6825. // BatchUpdate: Updates entities in the specified entity type (replaces
  6826. // the existing
  6827. // collection of entries).
  6828. //
  6829. // Operation <response: google.protobuf.Empty,
  6830. // metadata: google.protobuf.Struct>
  6831. func (r *ProjectsAgentEntityTypesEntitiesService) BatchUpdate(parent string, googleclouddialogflowv2batchupdateentitiesrequest *GoogleCloudDialogflowV2BatchUpdateEntitiesRequest) *ProjectsAgentEntityTypesEntitiesBatchUpdateCall {
  6832. c := &ProjectsAgentEntityTypesEntitiesBatchUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6833. c.parent = parent
  6834. c.googleclouddialogflowv2batchupdateentitiesrequest = googleclouddialogflowv2batchupdateentitiesrequest
  6835. return c
  6836. }
  6837. // Fields allows partial responses to be retrieved. See
  6838. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6839. // for more information.
  6840. func (c *ProjectsAgentEntityTypesEntitiesBatchUpdateCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesEntitiesBatchUpdateCall {
  6841. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6842. return c
  6843. }
  6844. // Context sets the context to be used in this call's Do method. Any
  6845. // pending HTTP request will be aborted if the provided context is
  6846. // canceled.
  6847. func (c *ProjectsAgentEntityTypesEntitiesBatchUpdateCall) Context(ctx context.Context) *ProjectsAgentEntityTypesEntitiesBatchUpdateCall {
  6848. c.ctx_ = ctx
  6849. return c
  6850. }
  6851. // Header returns an http.Header that can be modified by the caller to
  6852. // add HTTP headers to the request.
  6853. func (c *ProjectsAgentEntityTypesEntitiesBatchUpdateCall) Header() http.Header {
  6854. if c.header_ == nil {
  6855. c.header_ = make(http.Header)
  6856. }
  6857. return c.header_
  6858. }
  6859. func (c *ProjectsAgentEntityTypesEntitiesBatchUpdateCall) doRequest(alt string) (*http.Response, error) {
  6860. reqHeaders := make(http.Header)
  6861. for k, v := range c.header_ {
  6862. reqHeaders[k] = v
  6863. }
  6864. reqHeaders.Set("User-Agent", c.s.userAgent())
  6865. var body io.Reader = nil
  6866. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2batchupdateentitiesrequest)
  6867. if err != nil {
  6868. return nil, err
  6869. }
  6870. reqHeaders.Set("Content-Type", "application/json")
  6871. c.urlParams_.Set("alt", alt)
  6872. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/entities:batchUpdate")
  6873. urls += "?" + c.urlParams_.Encode()
  6874. req, _ := http.NewRequest("POST", urls, body)
  6875. req.Header = reqHeaders
  6876. googleapi.Expand(req.URL, map[string]string{
  6877. "parent": c.parent,
  6878. })
  6879. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6880. }
  6881. // Do executes the "dialogflow.projects.agent.entityTypes.entities.batchUpdate" call.
  6882. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  6883. // Any non-2xx status code is an error. Response headers are in either
  6884. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  6885. // was returned at all) in error.(*googleapi.Error).Header. Use
  6886. // googleapi.IsNotModified to check whether the returned error was
  6887. // because http.StatusNotModified was returned.
  6888. func (c *ProjectsAgentEntityTypesEntitiesBatchUpdateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  6889. gensupport.SetOptions(c.urlParams_, opts...)
  6890. res, err := c.doRequest("json")
  6891. if res != nil && res.StatusCode == http.StatusNotModified {
  6892. if res.Body != nil {
  6893. res.Body.Close()
  6894. }
  6895. return nil, &googleapi.Error{
  6896. Code: res.StatusCode,
  6897. Header: res.Header,
  6898. }
  6899. }
  6900. if err != nil {
  6901. return nil, err
  6902. }
  6903. defer googleapi.CloseBody(res)
  6904. if err := googleapi.CheckResponse(res); err != nil {
  6905. return nil, err
  6906. }
  6907. ret := &GoogleLongrunningOperation{
  6908. ServerResponse: googleapi.ServerResponse{
  6909. Header: res.Header,
  6910. HTTPStatusCode: res.StatusCode,
  6911. },
  6912. }
  6913. target := &ret
  6914. if err := gensupport.DecodeResponse(target, res); err != nil {
  6915. return nil, err
  6916. }
  6917. return ret, nil
  6918. // {
  6919. // "description": "Updates entities in the specified entity type (replaces the existing\ncollection of entries).\n\nOperation \u003cresponse: google.protobuf.Empty,\n metadata: google.protobuf.Struct\u003e",
  6920. // "flatPath": "v2/projects/{projectsId}/agent/entityTypes/{entityTypesId}/entities:batchUpdate",
  6921. // "httpMethod": "POST",
  6922. // "id": "dialogflow.projects.agent.entityTypes.entities.batchUpdate",
  6923. // "parameterOrder": [
  6924. // "parent"
  6925. // ],
  6926. // "parameters": {
  6927. // "parent": {
  6928. // "description": "Required. The name of the entity type to update the entities in. Format:\n`projects/\u003cProject ID\u003e/agent/entityTypes/\u003cEntity Type ID\u003e`.",
  6929. // "location": "path",
  6930. // "pattern": "^projects/[^/]+/agent/entityTypes/[^/]+$",
  6931. // "required": true,
  6932. // "type": "string"
  6933. // }
  6934. // },
  6935. // "path": "v2/{+parent}/entities:batchUpdate",
  6936. // "request": {
  6937. // "$ref": "GoogleCloudDialogflowV2BatchUpdateEntitiesRequest"
  6938. // },
  6939. // "response": {
  6940. // "$ref": "GoogleLongrunningOperation"
  6941. // },
  6942. // "scopes": [
  6943. // "https://www.googleapis.com/auth/cloud-platform"
  6944. // ]
  6945. // }
  6946. }
  6947. // method id "dialogflow.projects.agent.intents.batchDelete":
  6948. type ProjectsAgentIntentsBatchDeleteCall struct {
  6949. s *Service
  6950. parent string
  6951. googleclouddialogflowv2batchdeleteintentsrequest *GoogleCloudDialogflowV2BatchDeleteIntentsRequest
  6952. urlParams_ gensupport.URLParams
  6953. ctx_ context.Context
  6954. header_ http.Header
  6955. }
  6956. // BatchDelete: Deletes intents in the specified agent.
  6957. //
  6958. // Operation <response: google.protobuf.Empty>
  6959. func (r *ProjectsAgentIntentsService) BatchDelete(parent string, googleclouddialogflowv2batchdeleteintentsrequest *GoogleCloudDialogflowV2BatchDeleteIntentsRequest) *ProjectsAgentIntentsBatchDeleteCall {
  6960. c := &ProjectsAgentIntentsBatchDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6961. c.parent = parent
  6962. c.googleclouddialogflowv2batchdeleteintentsrequest = googleclouddialogflowv2batchdeleteintentsrequest
  6963. return c
  6964. }
  6965. // Fields allows partial responses to be retrieved. See
  6966. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6967. // for more information.
  6968. func (c *ProjectsAgentIntentsBatchDeleteCall) Fields(s ...googleapi.Field) *ProjectsAgentIntentsBatchDeleteCall {
  6969. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6970. return c
  6971. }
  6972. // Context sets the context to be used in this call's Do method. Any
  6973. // pending HTTP request will be aborted if the provided context is
  6974. // canceled.
  6975. func (c *ProjectsAgentIntentsBatchDeleteCall) Context(ctx context.Context) *ProjectsAgentIntentsBatchDeleteCall {
  6976. c.ctx_ = ctx
  6977. return c
  6978. }
  6979. // Header returns an http.Header that can be modified by the caller to
  6980. // add HTTP headers to the request.
  6981. func (c *ProjectsAgentIntentsBatchDeleteCall) Header() http.Header {
  6982. if c.header_ == nil {
  6983. c.header_ = make(http.Header)
  6984. }
  6985. return c.header_
  6986. }
  6987. func (c *ProjectsAgentIntentsBatchDeleteCall) doRequest(alt string) (*http.Response, error) {
  6988. reqHeaders := make(http.Header)
  6989. for k, v := range c.header_ {
  6990. reqHeaders[k] = v
  6991. }
  6992. reqHeaders.Set("User-Agent", c.s.userAgent())
  6993. var body io.Reader = nil
  6994. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2batchdeleteintentsrequest)
  6995. if err != nil {
  6996. return nil, err
  6997. }
  6998. reqHeaders.Set("Content-Type", "application/json")
  6999. c.urlParams_.Set("alt", alt)
  7000. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/intents:batchDelete")
  7001. urls += "?" + c.urlParams_.Encode()
  7002. req, _ := http.NewRequest("POST", urls, body)
  7003. req.Header = reqHeaders
  7004. googleapi.Expand(req.URL, map[string]string{
  7005. "parent": c.parent,
  7006. })
  7007. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7008. }
  7009. // Do executes the "dialogflow.projects.agent.intents.batchDelete" call.
  7010. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  7011. // Any non-2xx status code is an error. Response headers are in either
  7012. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  7013. // was returned at all) in error.(*googleapi.Error).Header. Use
  7014. // googleapi.IsNotModified to check whether the returned error was
  7015. // because http.StatusNotModified was returned.
  7016. func (c *ProjectsAgentIntentsBatchDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  7017. gensupport.SetOptions(c.urlParams_, opts...)
  7018. res, err := c.doRequest("json")
  7019. if res != nil && res.StatusCode == http.StatusNotModified {
  7020. if res.Body != nil {
  7021. res.Body.Close()
  7022. }
  7023. return nil, &googleapi.Error{
  7024. Code: res.StatusCode,
  7025. Header: res.Header,
  7026. }
  7027. }
  7028. if err != nil {
  7029. return nil, err
  7030. }
  7031. defer googleapi.CloseBody(res)
  7032. if err := googleapi.CheckResponse(res); err != nil {
  7033. return nil, err
  7034. }
  7035. ret := &GoogleLongrunningOperation{
  7036. ServerResponse: googleapi.ServerResponse{
  7037. Header: res.Header,
  7038. HTTPStatusCode: res.StatusCode,
  7039. },
  7040. }
  7041. target := &ret
  7042. if err := gensupport.DecodeResponse(target, res); err != nil {
  7043. return nil, err
  7044. }
  7045. return ret, nil
  7046. // {
  7047. // "description": "Deletes intents in the specified agent.\n\nOperation \u003cresponse: google.protobuf.Empty\u003e",
  7048. // "flatPath": "v2/projects/{projectsId}/agent/intents:batchDelete",
  7049. // "httpMethod": "POST",
  7050. // "id": "dialogflow.projects.agent.intents.batchDelete",
  7051. // "parameterOrder": [
  7052. // "parent"
  7053. // ],
  7054. // "parameters": {
  7055. // "parent": {
  7056. // "description": "Required. The name of the agent to delete all entities types for. Format:\n`projects/\u003cProject ID\u003e/agent`.",
  7057. // "location": "path",
  7058. // "pattern": "^projects/[^/]+/agent$",
  7059. // "required": true,
  7060. // "type": "string"
  7061. // }
  7062. // },
  7063. // "path": "v2/{+parent}/intents:batchDelete",
  7064. // "request": {
  7065. // "$ref": "GoogleCloudDialogflowV2BatchDeleteIntentsRequest"
  7066. // },
  7067. // "response": {
  7068. // "$ref": "GoogleLongrunningOperation"
  7069. // },
  7070. // "scopes": [
  7071. // "https://www.googleapis.com/auth/cloud-platform"
  7072. // ]
  7073. // }
  7074. }
  7075. // method id "dialogflow.projects.agent.intents.batchUpdate":
  7076. type ProjectsAgentIntentsBatchUpdateCall struct {
  7077. s *Service
  7078. parent string
  7079. googleclouddialogflowv2batchupdateintentsrequest *GoogleCloudDialogflowV2BatchUpdateIntentsRequest
  7080. urlParams_ gensupport.URLParams
  7081. ctx_ context.Context
  7082. header_ http.Header
  7083. }
  7084. // BatchUpdate: Updates/Creates multiple intents in the specified
  7085. // agent.
  7086. //
  7087. // Operation <response: BatchUpdateIntentsResponse>
  7088. func (r *ProjectsAgentIntentsService) BatchUpdate(parent string, googleclouddialogflowv2batchupdateintentsrequest *GoogleCloudDialogflowV2BatchUpdateIntentsRequest) *ProjectsAgentIntentsBatchUpdateCall {
  7089. c := &ProjectsAgentIntentsBatchUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7090. c.parent = parent
  7091. c.googleclouddialogflowv2batchupdateintentsrequest = googleclouddialogflowv2batchupdateintentsrequest
  7092. return c
  7093. }
  7094. // Fields allows partial responses to be retrieved. See
  7095. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7096. // for more information.
  7097. func (c *ProjectsAgentIntentsBatchUpdateCall) Fields(s ...googleapi.Field) *ProjectsAgentIntentsBatchUpdateCall {
  7098. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7099. return c
  7100. }
  7101. // Context sets the context to be used in this call's Do method. Any
  7102. // pending HTTP request will be aborted if the provided context is
  7103. // canceled.
  7104. func (c *ProjectsAgentIntentsBatchUpdateCall) Context(ctx context.Context) *ProjectsAgentIntentsBatchUpdateCall {
  7105. c.ctx_ = ctx
  7106. return c
  7107. }
  7108. // Header returns an http.Header that can be modified by the caller to
  7109. // add HTTP headers to the request.
  7110. func (c *ProjectsAgentIntentsBatchUpdateCall) Header() http.Header {
  7111. if c.header_ == nil {
  7112. c.header_ = make(http.Header)
  7113. }
  7114. return c.header_
  7115. }
  7116. func (c *ProjectsAgentIntentsBatchUpdateCall) doRequest(alt string) (*http.Response, error) {
  7117. reqHeaders := make(http.Header)
  7118. for k, v := range c.header_ {
  7119. reqHeaders[k] = v
  7120. }
  7121. reqHeaders.Set("User-Agent", c.s.userAgent())
  7122. var body io.Reader = nil
  7123. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2batchupdateintentsrequest)
  7124. if err != nil {
  7125. return nil, err
  7126. }
  7127. reqHeaders.Set("Content-Type", "application/json")
  7128. c.urlParams_.Set("alt", alt)
  7129. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/intents:batchUpdate")
  7130. urls += "?" + c.urlParams_.Encode()
  7131. req, _ := http.NewRequest("POST", urls, body)
  7132. req.Header = reqHeaders
  7133. googleapi.Expand(req.URL, map[string]string{
  7134. "parent": c.parent,
  7135. })
  7136. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7137. }
  7138. // Do executes the "dialogflow.projects.agent.intents.batchUpdate" call.
  7139. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  7140. // Any non-2xx status code is an error. Response headers are in either
  7141. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  7142. // was returned at all) in error.(*googleapi.Error).Header. Use
  7143. // googleapi.IsNotModified to check whether the returned error was
  7144. // because http.StatusNotModified was returned.
  7145. func (c *ProjectsAgentIntentsBatchUpdateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  7146. gensupport.SetOptions(c.urlParams_, opts...)
  7147. res, err := c.doRequest("json")
  7148. if res != nil && res.StatusCode == http.StatusNotModified {
  7149. if res.Body != nil {
  7150. res.Body.Close()
  7151. }
  7152. return nil, &googleapi.Error{
  7153. Code: res.StatusCode,
  7154. Header: res.Header,
  7155. }
  7156. }
  7157. if err != nil {
  7158. return nil, err
  7159. }
  7160. defer googleapi.CloseBody(res)
  7161. if err := googleapi.CheckResponse(res); err != nil {
  7162. return nil, err
  7163. }
  7164. ret := &GoogleLongrunningOperation{
  7165. ServerResponse: googleapi.ServerResponse{
  7166. Header: res.Header,
  7167. HTTPStatusCode: res.StatusCode,
  7168. },
  7169. }
  7170. target := &ret
  7171. if err := gensupport.DecodeResponse(target, res); err != nil {
  7172. return nil, err
  7173. }
  7174. return ret, nil
  7175. // {
  7176. // "description": "Updates/Creates multiple intents in the specified agent.\n\nOperation \u003cresponse: BatchUpdateIntentsResponse\u003e",
  7177. // "flatPath": "v2/projects/{projectsId}/agent/intents:batchUpdate",
  7178. // "httpMethod": "POST",
  7179. // "id": "dialogflow.projects.agent.intents.batchUpdate",
  7180. // "parameterOrder": [
  7181. // "parent"
  7182. // ],
  7183. // "parameters": {
  7184. // "parent": {
  7185. // "description": "Required. The name of the agent to update or create intents in.\nFormat: `projects/\u003cProject ID\u003e/agent`.",
  7186. // "location": "path",
  7187. // "pattern": "^projects/[^/]+/agent$",
  7188. // "required": true,
  7189. // "type": "string"
  7190. // }
  7191. // },
  7192. // "path": "v2/{+parent}/intents:batchUpdate",
  7193. // "request": {
  7194. // "$ref": "GoogleCloudDialogflowV2BatchUpdateIntentsRequest"
  7195. // },
  7196. // "response": {
  7197. // "$ref": "GoogleLongrunningOperation"
  7198. // },
  7199. // "scopes": [
  7200. // "https://www.googleapis.com/auth/cloud-platform"
  7201. // ]
  7202. // }
  7203. }
  7204. // method id "dialogflow.projects.agent.intents.create":
  7205. type ProjectsAgentIntentsCreateCall struct {
  7206. s *Service
  7207. parent string
  7208. googleclouddialogflowv2intent *GoogleCloudDialogflowV2Intent
  7209. urlParams_ gensupport.URLParams
  7210. ctx_ context.Context
  7211. header_ http.Header
  7212. }
  7213. // Create: Creates an intent in the specified agent.
  7214. func (r *ProjectsAgentIntentsService) Create(parent string, googleclouddialogflowv2intent *GoogleCloudDialogflowV2Intent) *ProjectsAgentIntentsCreateCall {
  7215. c := &ProjectsAgentIntentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7216. c.parent = parent
  7217. c.googleclouddialogflowv2intent = googleclouddialogflowv2intent
  7218. return c
  7219. }
  7220. // IntentView sets the optional parameter "intentView": The resource
  7221. // view to apply to the returned intent.
  7222. //
  7223. // Possible values:
  7224. // "INTENT_VIEW_UNSPECIFIED"
  7225. // "INTENT_VIEW_FULL"
  7226. func (c *ProjectsAgentIntentsCreateCall) IntentView(intentView string) *ProjectsAgentIntentsCreateCall {
  7227. c.urlParams_.Set("intentView", intentView)
  7228. return c
  7229. }
  7230. // LanguageCode sets the optional parameter "languageCode": The language
  7231. // of training phrases, parameters and rich messages
  7232. // defined in `intent`. If not specified, the agent's default language
  7233. // is
  7234. // used. [More than a
  7235. // dozen
  7236. // languages](https://dialogflow.com/docs/reference/language) are
  7237. // supported.
  7238. // Note: languages must be enabled in the agent, before they can be
  7239. // used.
  7240. func (c *ProjectsAgentIntentsCreateCall) LanguageCode(languageCode string) *ProjectsAgentIntentsCreateCall {
  7241. c.urlParams_.Set("languageCode", languageCode)
  7242. return c
  7243. }
  7244. // Fields allows partial responses to be retrieved. See
  7245. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7246. // for more information.
  7247. func (c *ProjectsAgentIntentsCreateCall) Fields(s ...googleapi.Field) *ProjectsAgentIntentsCreateCall {
  7248. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7249. return c
  7250. }
  7251. // Context sets the context to be used in this call's Do method. Any
  7252. // pending HTTP request will be aborted if the provided context is
  7253. // canceled.
  7254. func (c *ProjectsAgentIntentsCreateCall) Context(ctx context.Context) *ProjectsAgentIntentsCreateCall {
  7255. c.ctx_ = ctx
  7256. return c
  7257. }
  7258. // Header returns an http.Header that can be modified by the caller to
  7259. // add HTTP headers to the request.
  7260. func (c *ProjectsAgentIntentsCreateCall) Header() http.Header {
  7261. if c.header_ == nil {
  7262. c.header_ = make(http.Header)
  7263. }
  7264. return c.header_
  7265. }
  7266. func (c *ProjectsAgentIntentsCreateCall) doRequest(alt string) (*http.Response, error) {
  7267. reqHeaders := make(http.Header)
  7268. for k, v := range c.header_ {
  7269. reqHeaders[k] = v
  7270. }
  7271. reqHeaders.Set("User-Agent", c.s.userAgent())
  7272. var body io.Reader = nil
  7273. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2intent)
  7274. if err != nil {
  7275. return nil, err
  7276. }
  7277. reqHeaders.Set("Content-Type", "application/json")
  7278. c.urlParams_.Set("alt", alt)
  7279. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/intents")
  7280. urls += "?" + c.urlParams_.Encode()
  7281. req, _ := http.NewRequest("POST", urls, body)
  7282. req.Header = reqHeaders
  7283. googleapi.Expand(req.URL, map[string]string{
  7284. "parent": c.parent,
  7285. })
  7286. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7287. }
  7288. // Do executes the "dialogflow.projects.agent.intents.create" call.
  7289. // Exactly one of *GoogleCloudDialogflowV2Intent or error will be
  7290. // non-nil. Any non-2xx status code is an error. Response headers are in
  7291. // either *GoogleCloudDialogflowV2Intent.ServerResponse.Header or (if a
  7292. // response was returned at all) in error.(*googleapi.Error).Header. Use
  7293. // googleapi.IsNotModified to check whether the returned error was
  7294. // because http.StatusNotModified was returned.
  7295. func (c *ProjectsAgentIntentsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2Intent, error) {
  7296. gensupport.SetOptions(c.urlParams_, opts...)
  7297. res, err := c.doRequest("json")
  7298. if res != nil && res.StatusCode == http.StatusNotModified {
  7299. if res.Body != nil {
  7300. res.Body.Close()
  7301. }
  7302. return nil, &googleapi.Error{
  7303. Code: res.StatusCode,
  7304. Header: res.Header,
  7305. }
  7306. }
  7307. if err != nil {
  7308. return nil, err
  7309. }
  7310. defer googleapi.CloseBody(res)
  7311. if err := googleapi.CheckResponse(res); err != nil {
  7312. return nil, err
  7313. }
  7314. ret := &GoogleCloudDialogflowV2Intent{
  7315. ServerResponse: googleapi.ServerResponse{
  7316. Header: res.Header,
  7317. HTTPStatusCode: res.StatusCode,
  7318. },
  7319. }
  7320. target := &ret
  7321. if err := gensupport.DecodeResponse(target, res); err != nil {
  7322. return nil, err
  7323. }
  7324. return ret, nil
  7325. // {
  7326. // "description": "Creates an intent in the specified agent.",
  7327. // "flatPath": "v2/projects/{projectsId}/agent/intents",
  7328. // "httpMethod": "POST",
  7329. // "id": "dialogflow.projects.agent.intents.create",
  7330. // "parameterOrder": [
  7331. // "parent"
  7332. // ],
  7333. // "parameters": {
  7334. // "intentView": {
  7335. // "description": "Optional. The resource view to apply to the returned intent.",
  7336. // "enum": [
  7337. // "INTENT_VIEW_UNSPECIFIED",
  7338. // "INTENT_VIEW_FULL"
  7339. // ],
  7340. // "location": "query",
  7341. // "type": "string"
  7342. // },
  7343. // "languageCode": {
  7344. // "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.",
  7345. // "location": "query",
  7346. // "type": "string"
  7347. // },
  7348. // "parent": {
  7349. // "description": "Required. The agent to create a intent for.\nFormat: `projects/\u003cProject ID\u003e/agent`.",
  7350. // "location": "path",
  7351. // "pattern": "^projects/[^/]+/agent$",
  7352. // "required": true,
  7353. // "type": "string"
  7354. // }
  7355. // },
  7356. // "path": "v2/{+parent}/intents",
  7357. // "request": {
  7358. // "$ref": "GoogleCloudDialogflowV2Intent"
  7359. // },
  7360. // "response": {
  7361. // "$ref": "GoogleCloudDialogflowV2Intent"
  7362. // },
  7363. // "scopes": [
  7364. // "https://www.googleapis.com/auth/cloud-platform"
  7365. // ]
  7366. // }
  7367. }
  7368. // method id "dialogflow.projects.agent.intents.delete":
  7369. type ProjectsAgentIntentsDeleteCall struct {
  7370. s *Service
  7371. name string
  7372. urlParams_ gensupport.URLParams
  7373. ctx_ context.Context
  7374. header_ http.Header
  7375. }
  7376. // Delete: Deletes the specified intent.
  7377. func (r *ProjectsAgentIntentsService) Delete(name string) *ProjectsAgentIntentsDeleteCall {
  7378. c := &ProjectsAgentIntentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7379. c.name = name
  7380. return c
  7381. }
  7382. // Fields allows partial responses to be retrieved. See
  7383. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7384. // for more information.
  7385. func (c *ProjectsAgentIntentsDeleteCall) Fields(s ...googleapi.Field) *ProjectsAgentIntentsDeleteCall {
  7386. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7387. return c
  7388. }
  7389. // Context sets the context to be used in this call's Do method. Any
  7390. // pending HTTP request will be aborted if the provided context is
  7391. // canceled.
  7392. func (c *ProjectsAgentIntentsDeleteCall) Context(ctx context.Context) *ProjectsAgentIntentsDeleteCall {
  7393. c.ctx_ = ctx
  7394. return c
  7395. }
  7396. // Header returns an http.Header that can be modified by the caller to
  7397. // add HTTP headers to the request.
  7398. func (c *ProjectsAgentIntentsDeleteCall) Header() http.Header {
  7399. if c.header_ == nil {
  7400. c.header_ = make(http.Header)
  7401. }
  7402. return c.header_
  7403. }
  7404. func (c *ProjectsAgentIntentsDeleteCall) doRequest(alt string) (*http.Response, error) {
  7405. reqHeaders := make(http.Header)
  7406. for k, v := range c.header_ {
  7407. reqHeaders[k] = v
  7408. }
  7409. reqHeaders.Set("User-Agent", c.s.userAgent())
  7410. var body io.Reader = nil
  7411. c.urlParams_.Set("alt", alt)
  7412. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  7413. urls += "?" + c.urlParams_.Encode()
  7414. req, _ := http.NewRequest("DELETE", urls, body)
  7415. req.Header = reqHeaders
  7416. googleapi.Expand(req.URL, map[string]string{
  7417. "name": c.name,
  7418. })
  7419. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7420. }
  7421. // Do executes the "dialogflow.projects.agent.intents.delete" call.
  7422. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  7423. // non-2xx status code is an error. Response headers are in either
  7424. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  7425. // returned at all) in error.(*googleapi.Error).Header. Use
  7426. // googleapi.IsNotModified to check whether the returned error was
  7427. // because http.StatusNotModified was returned.
  7428. func (c *ProjectsAgentIntentsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  7429. gensupport.SetOptions(c.urlParams_, opts...)
  7430. res, err := c.doRequest("json")
  7431. if res != nil && res.StatusCode == http.StatusNotModified {
  7432. if res.Body != nil {
  7433. res.Body.Close()
  7434. }
  7435. return nil, &googleapi.Error{
  7436. Code: res.StatusCode,
  7437. Header: res.Header,
  7438. }
  7439. }
  7440. if err != nil {
  7441. return nil, err
  7442. }
  7443. defer googleapi.CloseBody(res)
  7444. if err := googleapi.CheckResponse(res); err != nil {
  7445. return nil, err
  7446. }
  7447. ret := &GoogleProtobufEmpty{
  7448. ServerResponse: googleapi.ServerResponse{
  7449. Header: res.Header,
  7450. HTTPStatusCode: res.StatusCode,
  7451. },
  7452. }
  7453. target := &ret
  7454. if err := gensupport.DecodeResponse(target, res); err != nil {
  7455. return nil, err
  7456. }
  7457. return ret, nil
  7458. // {
  7459. // "description": "Deletes the specified intent.",
  7460. // "flatPath": "v2/projects/{projectsId}/agent/intents/{intentsId}",
  7461. // "httpMethod": "DELETE",
  7462. // "id": "dialogflow.projects.agent.intents.delete",
  7463. // "parameterOrder": [
  7464. // "name"
  7465. // ],
  7466. // "parameters": {
  7467. // "name": {
  7468. // "description": "Required. The name of the intent to delete.\nFormat: `projects/\u003cProject ID\u003e/agent/intents/\u003cIntent ID\u003e`.",
  7469. // "location": "path",
  7470. // "pattern": "^projects/[^/]+/agent/intents/[^/]+$",
  7471. // "required": true,
  7472. // "type": "string"
  7473. // }
  7474. // },
  7475. // "path": "v2/{+name}",
  7476. // "response": {
  7477. // "$ref": "GoogleProtobufEmpty"
  7478. // },
  7479. // "scopes": [
  7480. // "https://www.googleapis.com/auth/cloud-platform"
  7481. // ]
  7482. // }
  7483. }
  7484. // method id "dialogflow.projects.agent.intents.get":
  7485. type ProjectsAgentIntentsGetCall struct {
  7486. s *Service
  7487. name string
  7488. urlParams_ gensupport.URLParams
  7489. ifNoneMatch_ string
  7490. ctx_ context.Context
  7491. header_ http.Header
  7492. }
  7493. // Get: Retrieves the specified intent.
  7494. func (r *ProjectsAgentIntentsService) Get(name string) *ProjectsAgentIntentsGetCall {
  7495. c := &ProjectsAgentIntentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7496. c.name = name
  7497. return c
  7498. }
  7499. // IntentView sets the optional parameter "intentView": The resource
  7500. // view to apply to the returned intent.
  7501. //
  7502. // Possible values:
  7503. // "INTENT_VIEW_UNSPECIFIED"
  7504. // "INTENT_VIEW_FULL"
  7505. func (c *ProjectsAgentIntentsGetCall) IntentView(intentView string) *ProjectsAgentIntentsGetCall {
  7506. c.urlParams_.Set("intentView", intentView)
  7507. return c
  7508. }
  7509. // LanguageCode sets the optional parameter "languageCode": The language
  7510. // to retrieve training phrases, parameters and rich
  7511. // messages for. If not specified, the agent's default language is
  7512. // used.
  7513. // [More than a
  7514. // dozen
  7515. // languages](https://dialogflow.com/docs/reference/language) are
  7516. // supported.
  7517. // Note: languages must be enabled in the agent, before they can be
  7518. // used.
  7519. func (c *ProjectsAgentIntentsGetCall) LanguageCode(languageCode string) *ProjectsAgentIntentsGetCall {
  7520. c.urlParams_.Set("languageCode", languageCode)
  7521. return c
  7522. }
  7523. // Fields allows partial responses to be retrieved. See
  7524. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7525. // for more information.
  7526. func (c *ProjectsAgentIntentsGetCall) Fields(s ...googleapi.Field) *ProjectsAgentIntentsGetCall {
  7527. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7528. return c
  7529. }
  7530. // IfNoneMatch sets the optional parameter which makes the operation
  7531. // fail if the object's ETag matches the given value. This is useful for
  7532. // getting updates only after the object has changed since the last
  7533. // request. Use googleapi.IsNotModified to check whether the response
  7534. // error from Do is the result of In-None-Match.
  7535. func (c *ProjectsAgentIntentsGetCall) IfNoneMatch(entityTag string) *ProjectsAgentIntentsGetCall {
  7536. c.ifNoneMatch_ = entityTag
  7537. return c
  7538. }
  7539. // Context sets the context to be used in this call's Do method. Any
  7540. // pending HTTP request will be aborted if the provided context is
  7541. // canceled.
  7542. func (c *ProjectsAgentIntentsGetCall) Context(ctx context.Context) *ProjectsAgentIntentsGetCall {
  7543. c.ctx_ = ctx
  7544. return c
  7545. }
  7546. // Header returns an http.Header that can be modified by the caller to
  7547. // add HTTP headers to the request.
  7548. func (c *ProjectsAgentIntentsGetCall) Header() http.Header {
  7549. if c.header_ == nil {
  7550. c.header_ = make(http.Header)
  7551. }
  7552. return c.header_
  7553. }
  7554. func (c *ProjectsAgentIntentsGetCall) doRequest(alt string) (*http.Response, error) {
  7555. reqHeaders := make(http.Header)
  7556. for k, v := range c.header_ {
  7557. reqHeaders[k] = v
  7558. }
  7559. reqHeaders.Set("User-Agent", c.s.userAgent())
  7560. if c.ifNoneMatch_ != "" {
  7561. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7562. }
  7563. var body io.Reader = nil
  7564. c.urlParams_.Set("alt", alt)
  7565. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  7566. urls += "?" + c.urlParams_.Encode()
  7567. req, _ := http.NewRequest("GET", urls, body)
  7568. req.Header = reqHeaders
  7569. googleapi.Expand(req.URL, map[string]string{
  7570. "name": c.name,
  7571. })
  7572. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7573. }
  7574. // Do executes the "dialogflow.projects.agent.intents.get" call.
  7575. // Exactly one of *GoogleCloudDialogflowV2Intent or error will be
  7576. // non-nil. Any non-2xx status code is an error. Response headers are in
  7577. // either *GoogleCloudDialogflowV2Intent.ServerResponse.Header or (if a
  7578. // response was returned at all) in error.(*googleapi.Error).Header. Use
  7579. // googleapi.IsNotModified to check whether the returned error was
  7580. // because http.StatusNotModified was returned.
  7581. func (c *ProjectsAgentIntentsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2Intent, error) {
  7582. gensupport.SetOptions(c.urlParams_, opts...)
  7583. res, err := c.doRequest("json")
  7584. if res != nil && res.StatusCode == http.StatusNotModified {
  7585. if res.Body != nil {
  7586. res.Body.Close()
  7587. }
  7588. return nil, &googleapi.Error{
  7589. Code: res.StatusCode,
  7590. Header: res.Header,
  7591. }
  7592. }
  7593. if err != nil {
  7594. return nil, err
  7595. }
  7596. defer googleapi.CloseBody(res)
  7597. if err := googleapi.CheckResponse(res); err != nil {
  7598. return nil, err
  7599. }
  7600. ret := &GoogleCloudDialogflowV2Intent{
  7601. ServerResponse: googleapi.ServerResponse{
  7602. Header: res.Header,
  7603. HTTPStatusCode: res.StatusCode,
  7604. },
  7605. }
  7606. target := &ret
  7607. if err := gensupport.DecodeResponse(target, res); err != nil {
  7608. return nil, err
  7609. }
  7610. return ret, nil
  7611. // {
  7612. // "description": "Retrieves the specified intent.",
  7613. // "flatPath": "v2/projects/{projectsId}/agent/intents/{intentsId}",
  7614. // "httpMethod": "GET",
  7615. // "id": "dialogflow.projects.agent.intents.get",
  7616. // "parameterOrder": [
  7617. // "name"
  7618. // ],
  7619. // "parameters": {
  7620. // "intentView": {
  7621. // "description": "Optional. The resource view to apply to the returned intent.",
  7622. // "enum": [
  7623. // "INTENT_VIEW_UNSPECIFIED",
  7624. // "INTENT_VIEW_FULL"
  7625. // ],
  7626. // "location": "query",
  7627. // "type": "string"
  7628. // },
  7629. // "languageCode": {
  7630. // "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.",
  7631. // "location": "query",
  7632. // "type": "string"
  7633. // },
  7634. // "name": {
  7635. // "description": "Required. The name of the intent.\nFormat: `projects/\u003cProject ID\u003e/agent/intents/\u003cIntent ID\u003e`.",
  7636. // "location": "path",
  7637. // "pattern": "^projects/[^/]+/agent/intents/[^/]+$",
  7638. // "required": true,
  7639. // "type": "string"
  7640. // }
  7641. // },
  7642. // "path": "v2/{+name}",
  7643. // "response": {
  7644. // "$ref": "GoogleCloudDialogflowV2Intent"
  7645. // },
  7646. // "scopes": [
  7647. // "https://www.googleapis.com/auth/cloud-platform"
  7648. // ]
  7649. // }
  7650. }
  7651. // method id "dialogflow.projects.agent.intents.list":
  7652. type ProjectsAgentIntentsListCall struct {
  7653. s *Service
  7654. parent string
  7655. urlParams_ gensupport.URLParams
  7656. ifNoneMatch_ string
  7657. ctx_ context.Context
  7658. header_ http.Header
  7659. }
  7660. // List: Returns the list of all intents in the specified agent.
  7661. func (r *ProjectsAgentIntentsService) List(parent string) *ProjectsAgentIntentsListCall {
  7662. c := &ProjectsAgentIntentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7663. c.parent = parent
  7664. return c
  7665. }
  7666. // IntentView sets the optional parameter "intentView": The resource
  7667. // view to apply to the returned intent.
  7668. //
  7669. // Possible values:
  7670. // "INTENT_VIEW_UNSPECIFIED"
  7671. // "INTENT_VIEW_FULL"
  7672. func (c *ProjectsAgentIntentsListCall) IntentView(intentView string) *ProjectsAgentIntentsListCall {
  7673. c.urlParams_.Set("intentView", intentView)
  7674. return c
  7675. }
  7676. // LanguageCode sets the optional parameter "languageCode": The language
  7677. // to list training phrases, parameters and rich
  7678. // messages for. If not specified, the agent's default language is
  7679. // used.
  7680. // [More than a
  7681. // dozen
  7682. // languages](https://dialogflow.com/docs/reference/language) are
  7683. // supported.
  7684. // Note: languages must be enabled in the agent before they can be used.
  7685. func (c *ProjectsAgentIntentsListCall) LanguageCode(languageCode string) *ProjectsAgentIntentsListCall {
  7686. c.urlParams_.Set("languageCode", languageCode)
  7687. return c
  7688. }
  7689. // PageSize sets the optional parameter "pageSize": The maximum number
  7690. // of items to return in a single page. By
  7691. // default 100 and at most 1000.
  7692. func (c *ProjectsAgentIntentsListCall) PageSize(pageSize int64) *ProjectsAgentIntentsListCall {
  7693. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  7694. return c
  7695. }
  7696. // PageToken sets the optional parameter "pageToken": The
  7697. // next_page_token value returned from a previous list request.
  7698. func (c *ProjectsAgentIntentsListCall) PageToken(pageToken string) *ProjectsAgentIntentsListCall {
  7699. c.urlParams_.Set("pageToken", pageToken)
  7700. return c
  7701. }
  7702. // Fields allows partial responses to be retrieved. See
  7703. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7704. // for more information.
  7705. func (c *ProjectsAgentIntentsListCall) Fields(s ...googleapi.Field) *ProjectsAgentIntentsListCall {
  7706. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7707. return c
  7708. }
  7709. // IfNoneMatch sets the optional parameter which makes the operation
  7710. // fail if the object's ETag matches the given value. This is useful for
  7711. // getting updates only after the object has changed since the last
  7712. // request. Use googleapi.IsNotModified to check whether the response
  7713. // error from Do is the result of In-None-Match.
  7714. func (c *ProjectsAgentIntentsListCall) IfNoneMatch(entityTag string) *ProjectsAgentIntentsListCall {
  7715. c.ifNoneMatch_ = entityTag
  7716. return c
  7717. }
  7718. // Context sets the context to be used in this call's Do method. Any
  7719. // pending HTTP request will be aborted if the provided context is
  7720. // canceled.
  7721. func (c *ProjectsAgentIntentsListCall) Context(ctx context.Context) *ProjectsAgentIntentsListCall {
  7722. c.ctx_ = ctx
  7723. return c
  7724. }
  7725. // Header returns an http.Header that can be modified by the caller to
  7726. // add HTTP headers to the request.
  7727. func (c *ProjectsAgentIntentsListCall) Header() http.Header {
  7728. if c.header_ == nil {
  7729. c.header_ = make(http.Header)
  7730. }
  7731. return c.header_
  7732. }
  7733. func (c *ProjectsAgentIntentsListCall) doRequest(alt string) (*http.Response, error) {
  7734. reqHeaders := make(http.Header)
  7735. for k, v := range c.header_ {
  7736. reqHeaders[k] = v
  7737. }
  7738. reqHeaders.Set("User-Agent", c.s.userAgent())
  7739. if c.ifNoneMatch_ != "" {
  7740. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7741. }
  7742. var body io.Reader = nil
  7743. c.urlParams_.Set("alt", alt)
  7744. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/intents")
  7745. urls += "?" + c.urlParams_.Encode()
  7746. req, _ := http.NewRequest("GET", urls, body)
  7747. req.Header = reqHeaders
  7748. googleapi.Expand(req.URL, map[string]string{
  7749. "parent": c.parent,
  7750. })
  7751. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7752. }
  7753. // Do executes the "dialogflow.projects.agent.intents.list" call.
  7754. // Exactly one of *GoogleCloudDialogflowV2ListIntentsResponse or error
  7755. // will be non-nil. Any non-2xx status code is an error. Response
  7756. // headers are in either
  7757. // *GoogleCloudDialogflowV2ListIntentsResponse.ServerResponse.Header or
  7758. // (if a response was returned at all) in
  7759. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7760. // whether the returned error was because http.StatusNotModified was
  7761. // returned.
  7762. func (c *ProjectsAgentIntentsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2ListIntentsResponse, error) {
  7763. gensupport.SetOptions(c.urlParams_, opts...)
  7764. res, err := c.doRequest("json")
  7765. if res != nil && res.StatusCode == http.StatusNotModified {
  7766. if res.Body != nil {
  7767. res.Body.Close()
  7768. }
  7769. return nil, &googleapi.Error{
  7770. Code: res.StatusCode,
  7771. Header: res.Header,
  7772. }
  7773. }
  7774. if err != nil {
  7775. return nil, err
  7776. }
  7777. defer googleapi.CloseBody(res)
  7778. if err := googleapi.CheckResponse(res); err != nil {
  7779. return nil, err
  7780. }
  7781. ret := &GoogleCloudDialogflowV2ListIntentsResponse{
  7782. ServerResponse: googleapi.ServerResponse{
  7783. Header: res.Header,
  7784. HTTPStatusCode: res.StatusCode,
  7785. },
  7786. }
  7787. target := &ret
  7788. if err := gensupport.DecodeResponse(target, res); err != nil {
  7789. return nil, err
  7790. }
  7791. return ret, nil
  7792. // {
  7793. // "description": "Returns the list of all intents in the specified agent.",
  7794. // "flatPath": "v2/projects/{projectsId}/agent/intents",
  7795. // "httpMethod": "GET",
  7796. // "id": "dialogflow.projects.agent.intents.list",
  7797. // "parameterOrder": [
  7798. // "parent"
  7799. // ],
  7800. // "parameters": {
  7801. // "intentView": {
  7802. // "description": "Optional. The resource view to apply to the returned intent.",
  7803. // "enum": [
  7804. // "INTENT_VIEW_UNSPECIFIED",
  7805. // "INTENT_VIEW_FULL"
  7806. // ],
  7807. // "location": "query",
  7808. // "type": "string"
  7809. // },
  7810. // "languageCode": {
  7811. // "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.",
  7812. // "location": "query",
  7813. // "type": "string"
  7814. // },
  7815. // "pageSize": {
  7816. // "description": "Optional. The maximum number of items to return in a single page. By\ndefault 100 and at most 1000.",
  7817. // "format": "int32",
  7818. // "location": "query",
  7819. // "type": "integer"
  7820. // },
  7821. // "pageToken": {
  7822. // "description": "Optional. The next_page_token value returned from a previous list request.",
  7823. // "location": "query",
  7824. // "type": "string"
  7825. // },
  7826. // "parent": {
  7827. // "description": "Required. The agent to list all intents from.\nFormat: `projects/\u003cProject ID\u003e/agent`.",
  7828. // "location": "path",
  7829. // "pattern": "^projects/[^/]+/agent$",
  7830. // "required": true,
  7831. // "type": "string"
  7832. // }
  7833. // },
  7834. // "path": "v2/{+parent}/intents",
  7835. // "response": {
  7836. // "$ref": "GoogleCloudDialogflowV2ListIntentsResponse"
  7837. // },
  7838. // "scopes": [
  7839. // "https://www.googleapis.com/auth/cloud-platform"
  7840. // ]
  7841. // }
  7842. }
  7843. // Pages invokes f for each page of results.
  7844. // A non-nil error returned from f will halt the iteration.
  7845. // The provided context supersedes any context provided to the Context method.
  7846. func (c *ProjectsAgentIntentsListCall) Pages(ctx context.Context, f func(*GoogleCloudDialogflowV2ListIntentsResponse) error) error {
  7847. c.ctx_ = ctx
  7848. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  7849. for {
  7850. x, err := c.Do()
  7851. if err != nil {
  7852. return err
  7853. }
  7854. if err := f(x); err != nil {
  7855. return err
  7856. }
  7857. if x.NextPageToken == "" {
  7858. return nil
  7859. }
  7860. c.PageToken(x.NextPageToken)
  7861. }
  7862. }
  7863. // method id "dialogflow.projects.agent.intents.patch":
  7864. type ProjectsAgentIntentsPatchCall struct {
  7865. s *Service
  7866. nameid string
  7867. googleclouddialogflowv2intent *GoogleCloudDialogflowV2Intent
  7868. urlParams_ gensupport.URLParams
  7869. ctx_ context.Context
  7870. header_ http.Header
  7871. }
  7872. // Patch: Updates the specified intent.
  7873. func (r *ProjectsAgentIntentsService) Patch(nameid string, googleclouddialogflowv2intent *GoogleCloudDialogflowV2Intent) *ProjectsAgentIntentsPatchCall {
  7874. c := &ProjectsAgentIntentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7875. c.nameid = nameid
  7876. c.googleclouddialogflowv2intent = googleclouddialogflowv2intent
  7877. return c
  7878. }
  7879. // IntentView sets the optional parameter "intentView": The resource
  7880. // view to apply to the returned intent.
  7881. //
  7882. // Possible values:
  7883. // "INTENT_VIEW_UNSPECIFIED"
  7884. // "INTENT_VIEW_FULL"
  7885. func (c *ProjectsAgentIntentsPatchCall) IntentView(intentView string) *ProjectsAgentIntentsPatchCall {
  7886. c.urlParams_.Set("intentView", intentView)
  7887. return c
  7888. }
  7889. // LanguageCode sets the optional parameter "languageCode": The language
  7890. // of training phrases, parameters and rich messages
  7891. // defined in `intent`. If not specified, the agent's default language
  7892. // is
  7893. // used. [More than a
  7894. // dozen
  7895. // languages](https://dialogflow.com/docs/reference/language) are
  7896. // supported.
  7897. // Note: languages must be enabled in the agent, before they can be
  7898. // used.
  7899. func (c *ProjectsAgentIntentsPatchCall) LanguageCode(languageCode string) *ProjectsAgentIntentsPatchCall {
  7900. c.urlParams_.Set("languageCode", languageCode)
  7901. return c
  7902. }
  7903. // UpdateMask sets the optional parameter "updateMask": The mask to
  7904. // control which fields get updated.
  7905. func (c *ProjectsAgentIntentsPatchCall) UpdateMask(updateMask string) *ProjectsAgentIntentsPatchCall {
  7906. c.urlParams_.Set("updateMask", updateMask)
  7907. return c
  7908. }
  7909. // Fields allows partial responses to be retrieved. See
  7910. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7911. // for more information.
  7912. func (c *ProjectsAgentIntentsPatchCall) Fields(s ...googleapi.Field) *ProjectsAgentIntentsPatchCall {
  7913. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7914. return c
  7915. }
  7916. // Context sets the context to be used in this call's Do method. Any
  7917. // pending HTTP request will be aborted if the provided context is
  7918. // canceled.
  7919. func (c *ProjectsAgentIntentsPatchCall) Context(ctx context.Context) *ProjectsAgentIntentsPatchCall {
  7920. c.ctx_ = ctx
  7921. return c
  7922. }
  7923. // Header returns an http.Header that can be modified by the caller to
  7924. // add HTTP headers to the request.
  7925. func (c *ProjectsAgentIntentsPatchCall) Header() http.Header {
  7926. if c.header_ == nil {
  7927. c.header_ = make(http.Header)
  7928. }
  7929. return c.header_
  7930. }
  7931. func (c *ProjectsAgentIntentsPatchCall) doRequest(alt string) (*http.Response, error) {
  7932. reqHeaders := make(http.Header)
  7933. for k, v := range c.header_ {
  7934. reqHeaders[k] = v
  7935. }
  7936. reqHeaders.Set("User-Agent", c.s.userAgent())
  7937. var body io.Reader = nil
  7938. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2intent)
  7939. if err != nil {
  7940. return nil, err
  7941. }
  7942. reqHeaders.Set("Content-Type", "application/json")
  7943. c.urlParams_.Set("alt", alt)
  7944. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  7945. urls += "?" + c.urlParams_.Encode()
  7946. req, _ := http.NewRequest("PATCH", urls, body)
  7947. req.Header = reqHeaders
  7948. googleapi.Expand(req.URL, map[string]string{
  7949. "name": c.nameid,
  7950. })
  7951. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7952. }
  7953. // Do executes the "dialogflow.projects.agent.intents.patch" call.
  7954. // Exactly one of *GoogleCloudDialogflowV2Intent or error will be
  7955. // non-nil. Any non-2xx status code is an error. Response headers are in
  7956. // either *GoogleCloudDialogflowV2Intent.ServerResponse.Header or (if a
  7957. // response 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 *ProjectsAgentIntentsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2Intent, 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 := &GoogleCloudDialogflowV2Intent{
  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": "Updates the specified intent.",
  7992. // "flatPath": "v2/projects/{projectsId}/agent/intents/{intentsId}",
  7993. // "httpMethod": "PATCH",
  7994. // "id": "dialogflow.projects.agent.intents.patch",
  7995. // "parameterOrder": [
  7996. // "name"
  7997. // ],
  7998. // "parameters": {
  7999. // "intentView": {
  8000. // "description": "Optional. The resource view to apply to the returned intent.",
  8001. // "enum": [
  8002. // "INTENT_VIEW_UNSPECIFIED",
  8003. // "INTENT_VIEW_FULL"
  8004. // ],
  8005. // "location": "query",
  8006. // "type": "string"
  8007. // },
  8008. // "languageCode": {
  8009. // "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.",
  8010. // "location": "query",
  8011. // "type": "string"
  8012. // },
  8013. // "name": {
  8014. // "description": "Required for all methods except `create` (`create` populates the name\nautomatically.\nThe unique identifier of this intent.\nFormat: `projects/\u003cProject ID\u003e/agent/intents/\u003cIntent ID\u003e`.",
  8015. // "location": "path",
  8016. // "pattern": "^projects/[^/]+/agent/intents/[^/]+$",
  8017. // "required": true,
  8018. // "type": "string"
  8019. // },
  8020. // "updateMask": {
  8021. // "description": "Optional. The mask to control which fields get updated.",
  8022. // "format": "google-fieldmask",
  8023. // "location": "query",
  8024. // "type": "string"
  8025. // }
  8026. // },
  8027. // "path": "v2/{+name}",
  8028. // "request": {
  8029. // "$ref": "GoogleCloudDialogflowV2Intent"
  8030. // },
  8031. // "response": {
  8032. // "$ref": "GoogleCloudDialogflowV2Intent"
  8033. // },
  8034. // "scopes": [
  8035. // "https://www.googleapis.com/auth/cloud-platform"
  8036. // ]
  8037. // }
  8038. }
  8039. // method id "dialogflow.projects.agent.sessions.deleteContexts":
  8040. type ProjectsAgentSessionsDeleteContextsCall struct {
  8041. s *Service
  8042. parent string
  8043. urlParams_ gensupport.URLParams
  8044. ctx_ context.Context
  8045. header_ http.Header
  8046. }
  8047. // DeleteContexts: Deletes all active contexts in the specified session.
  8048. func (r *ProjectsAgentSessionsService) DeleteContexts(parent string) *ProjectsAgentSessionsDeleteContextsCall {
  8049. c := &ProjectsAgentSessionsDeleteContextsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8050. c.parent = parent
  8051. return c
  8052. }
  8053. // Fields allows partial responses to be retrieved. See
  8054. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8055. // for more information.
  8056. func (c *ProjectsAgentSessionsDeleteContextsCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsDeleteContextsCall {
  8057. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8058. return c
  8059. }
  8060. // Context sets the context to be used in this call's Do method. Any
  8061. // pending HTTP request will be aborted if the provided context is
  8062. // canceled.
  8063. func (c *ProjectsAgentSessionsDeleteContextsCall) Context(ctx context.Context) *ProjectsAgentSessionsDeleteContextsCall {
  8064. c.ctx_ = ctx
  8065. return c
  8066. }
  8067. // Header returns an http.Header that can be modified by the caller to
  8068. // add HTTP headers to the request.
  8069. func (c *ProjectsAgentSessionsDeleteContextsCall) Header() http.Header {
  8070. if c.header_ == nil {
  8071. c.header_ = make(http.Header)
  8072. }
  8073. return c.header_
  8074. }
  8075. func (c *ProjectsAgentSessionsDeleteContextsCall) doRequest(alt string) (*http.Response, error) {
  8076. reqHeaders := make(http.Header)
  8077. for k, v := range c.header_ {
  8078. reqHeaders[k] = v
  8079. }
  8080. reqHeaders.Set("User-Agent", c.s.userAgent())
  8081. var body io.Reader = nil
  8082. c.urlParams_.Set("alt", alt)
  8083. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/contexts")
  8084. urls += "?" + c.urlParams_.Encode()
  8085. req, _ := http.NewRequest("DELETE", urls, body)
  8086. req.Header = reqHeaders
  8087. googleapi.Expand(req.URL, map[string]string{
  8088. "parent": c.parent,
  8089. })
  8090. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8091. }
  8092. // Do executes the "dialogflow.projects.agent.sessions.deleteContexts" call.
  8093. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  8094. // non-2xx status code is an error. Response headers are in either
  8095. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  8096. // returned at all) in error.(*googleapi.Error).Header. Use
  8097. // googleapi.IsNotModified to check whether the returned error was
  8098. // because http.StatusNotModified was returned.
  8099. func (c *ProjectsAgentSessionsDeleteContextsCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  8100. gensupport.SetOptions(c.urlParams_, opts...)
  8101. res, err := c.doRequest("json")
  8102. if res != nil && res.StatusCode == http.StatusNotModified {
  8103. if res.Body != nil {
  8104. res.Body.Close()
  8105. }
  8106. return nil, &googleapi.Error{
  8107. Code: res.StatusCode,
  8108. Header: res.Header,
  8109. }
  8110. }
  8111. if err != nil {
  8112. return nil, err
  8113. }
  8114. defer googleapi.CloseBody(res)
  8115. if err := googleapi.CheckResponse(res); err != nil {
  8116. return nil, err
  8117. }
  8118. ret := &GoogleProtobufEmpty{
  8119. ServerResponse: googleapi.ServerResponse{
  8120. Header: res.Header,
  8121. HTTPStatusCode: res.StatusCode,
  8122. },
  8123. }
  8124. target := &ret
  8125. if err := gensupport.DecodeResponse(target, res); err != nil {
  8126. return nil, err
  8127. }
  8128. return ret, nil
  8129. // {
  8130. // "description": "Deletes all active contexts in the specified session.",
  8131. // "flatPath": "v2/projects/{projectsId}/agent/sessions/{sessionsId}/contexts",
  8132. // "httpMethod": "DELETE",
  8133. // "id": "dialogflow.projects.agent.sessions.deleteContexts",
  8134. // "parameterOrder": [
  8135. // "parent"
  8136. // ],
  8137. // "parameters": {
  8138. // "parent": {
  8139. // "description": "Required. The name of the session to delete all contexts from. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e`.",
  8140. // "location": "path",
  8141. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+$",
  8142. // "required": true,
  8143. // "type": "string"
  8144. // }
  8145. // },
  8146. // "path": "v2/{+parent}/contexts",
  8147. // "response": {
  8148. // "$ref": "GoogleProtobufEmpty"
  8149. // },
  8150. // "scopes": [
  8151. // "https://www.googleapis.com/auth/cloud-platform"
  8152. // ]
  8153. // }
  8154. }
  8155. // method id "dialogflow.projects.agent.sessions.detectIntent":
  8156. type ProjectsAgentSessionsDetectIntentCall struct {
  8157. s *Service
  8158. sessionid string
  8159. googleclouddialogflowv2detectintentrequest *GoogleCloudDialogflowV2DetectIntentRequest
  8160. urlParams_ gensupport.URLParams
  8161. ctx_ context.Context
  8162. header_ http.Header
  8163. }
  8164. // DetectIntent: Processes a natural language query and returns
  8165. // structured, actionable data
  8166. // as a result. This method is not idempotent, because it may cause
  8167. // contexts
  8168. // and session entity types to be updated, which in turn might
  8169. // affect
  8170. // results of future queries.
  8171. func (r *ProjectsAgentSessionsService) DetectIntent(sessionid string, googleclouddialogflowv2detectintentrequest *GoogleCloudDialogflowV2DetectIntentRequest) *ProjectsAgentSessionsDetectIntentCall {
  8172. c := &ProjectsAgentSessionsDetectIntentCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8173. c.sessionid = sessionid
  8174. c.googleclouddialogflowv2detectintentrequest = googleclouddialogflowv2detectintentrequest
  8175. return c
  8176. }
  8177. // Fields allows partial responses to be retrieved. See
  8178. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8179. // for more information.
  8180. func (c *ProjectsAgentSessionsDetectIntentCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsDetectIntentCall {
  8181. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8182. return c
  8183. }
  8184. // Context sets the context to be used in this call's Do method. Any
  8185. // pending HTTP request will be aborted if the provided context is
  8186. // canceled.
  8187. func (c *ProjectsAgentSessionsDetectIntentCall) Context(ctx context.Context) *ProjectsAgentSessionsDetectIntentCall {
  8188. c.ctx_ = ctx
  8189. return c
  8190. }
  8191. // Header returns an http.Header that can be modified by the caller to
  8192. // add HTTP headers to the request.
  8193. func (c *ProjectsAgentSessionsDetectIntentCall) Header() http.Header {
  8194. if c.header_ == nil {
  8195. c.header_ = make(http.Header)
  8196. }
  8197. return c.header_
  8198. }
  8199. func (c *ProjectsAgentSessionsDetectIntentCall) doRequest(alt string) (*http.Response, error) {
  8200. reqHeaders := make(http.Header)
  8201. for k, v := range c.header_ {
  8202. reqHeaders[k] = v
  8203. }
  8204. reqHeaders.Set("User-Agent", c.s.userAgent())
  8205. var body io.Reader = nil
  8206. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2detectintentrequest)
  8207. if err != nil {
  8208. return nil, err
  8209. }
  8210. reqHeaders.Set("Content-Type", "application/json")
  8211. c.urlParams_.Set("alt", alt)
  8212. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+session}:detectIntent")
  8213. urls += "?" + c.urlParams_.Encode()
  8214. req, _ := http.NewRequest("POST", urls, body)
  8215. req.Header = reqHeaders
  8216. googleapi.Expand(req.URL, map[string]string{
  8217. "session": c.sessionid,
  8218. })
  8219. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8220. }
  8221. // Do executes the "dialogflow.projects.agent.sessions.detectIntent" call.
  8222. // Exactly one of *GoogleCloudDialogflowV2DetectIntentResponse or error
  8223. // will be non-nil. Any non-2xx status code is an error. Response
  8224. // headers are in either
  8225. // *GoogleCloudDialogflowV2DetectIntentResponse.ServerResponse.Header or
  8226. // (if a response was returned at all) in
  8227. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8228. // whether the returned error was because http.StatusNotModified was
  8229. // returned.
  8230. func (c *ProjectsAgentSessionsDetectIntentCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2DetectIntentResponse, error) {
  8231. gensupport.SetOptions(c.urlParams_, opts...)
  8232. res, err := c.doRequest("json")
  8233. if res != nil && res.StatusCode == http.StatusNotModified {
  8234. if res.Body != nil {
  8235. res.Body.Close()
  8236. }
  8237. return nil, &googleapi.Error{
  8238. Code: res.StatusCode,
  8239. Header: res.Header,
  8240. }
  8241. }
  8242. if err != nil {
  8243. return nil, err
  8244. }
  8245. defer googleapi.CloseBody(res)
  8246. if err := googleapi.CheckResponse(res); err != nil {
  8247. return nil, err
  8248. }
  8249. ret := &GoogleCloudDialogflowV2DetectIntentResponse{
  8250. ServerResponse: googleapi.ServerResponse{
  8251. Header: res.Header,
  8252. HTTPStatusCode: res.StatusCode,
  8253. },
  8254. }
  8255. target := &ret
  8256. if err := gensupport.DecodeResponse(target, res); err != nil {
  8257. return nil, err
  8258. }
  8259. return ret, nil
  8260. // {
  8261. // "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.",
  8262. // "flatPath": "v2/projects/{projectsId}/agent/sessions/{sessionsId}:detectIntent",
  8263. // "httpMethod": "POST",
  8264. // "id": "dialogflow.projects.agent.sessions.detectIntent",
  8265. // "parameterOrder": [
  8266. // "session"
  8267. // ],
  8268. // "parameters": {
  8269. // "session": {
  8270. // "description": "Required. The name of the session this query is sent to. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e`. It's up to the API\ncaller to choose an appropriate session ID. It can be a random number or\nsome type of user identifier (preferably hashed). The length of the session\nID must not exceed 36 bytes.",
  8271. // "location": "path",
  8272. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+$",
  8273. // "required": true,
  8274. // "type": "string"
  8275. // }
  8276. // },
  8277. // "path": "v2/{+session}:detectIntent",
  8278. // "request": {
  8279. // "$ref": "GoogleCloudDialogflowV2DetectIntentRequest"
  8280. // },
  8281. // "response": {
  8282. // "$ref": "GoogleCloudDialogflowV2DetectIntentResponse"
  8283. // },
  8284. // "scopes": [
  8285. // "https://www.googleapis.com/auth/cloud-platform"
  8286. // ]
  8287. // }
  8288. }
  8289. // method id "dialogflow.projects.agent.sessions.contexts.create":
  8290. type ProjectsAgentSessionsContextsCreateCall struct {
  8291. s *Service
  8292. parent string
  8293. googleclouddialogflowv2context *GoogleCloudDialogflowV2Context
  8294. urlParams_ gensupport.URLParams
  8295. ctx_ context.Context
  8296. header_ http.Header
  8297. }
  8298. // Create: Creates a context.
  8299. func (r *ProjectsAgentSessionsContextsService) Create(parent string, googleclouddialogflowv2context *GoogleCloudDialogflowV2Context) *ProjectsAgentSessionsContextsCreateCall {
  8300. c := &ProjectsAgentSessionsContextsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8301. c.parent = parent
  8302. c.googleclouddialogflowv2context = googleclouddialogflowv2context
  8303. return c
  8304. }
  8305. // Fields allows partial responses to be retrieved. See
  8306. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8307. // for more information.
  8308. func (c *ProjectsAgentSessionsContextsCreateCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsContextsCreateCall {
  8309. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8310. return c
  8311. }
  8312. // Context sets the context to be used in this call's Do method. Any
  8313. // pending HTTP request will be aborted if the provided context is
  8314. // canceled.
  8315. func (c *ProjectsAgentSessionsContextsCreateCall) Context(ctx context.Context) *ProjectsAgentSessionsContextsCreateCall {
  8316. c.ctx_ = ctx
  8317. return c
  8318. }
  8319. // Header returns an http.Header that can be modified by the caller to
  8320. // add HTTP headers to the request.
  8321. func (c *ProjectsAgentSessionsContextsCreateCall) Header() http.Header {
  8322. if c.header_ == nil {
  8323. c.header_ = make(http.Header)
  8324. }
  8325. return c.header_
  8326. }
  8327. func (c *ProjectsAgentSessionsContextsCreateCall) doRequest(alt string) (*http.Response, error) {
  8328. reqHeaders := make(http.Header)
  8329. for k, v := range c.header_ {
  8330. reqHeaders[k] = v
  8331. }
  8332. reqHeaders.Set("User-Agent", c.s.userAgent())
  8333. var body io.Reader = nil
  8334. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2context)
  8335. if err != nil {
  8336. return nil, err
  8337. }
  8338. reqHeaders.Set("Content-Type", "application/json")
  8339. c.urlParams_.Set("alt", alt)
  8340. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/contexts")
  8341. urls += "?" + c.urlParams_.Encode()
  8342. req, _ := http.NewRequest("POST", urls, body)
  8343. req.Header = reqHeaders
  8344. googleapi.Expand(req.URL, map[string]string{
  8345. "parent": c.parent,
  8346. })
  8347. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8348. }
  8349. // Do executes the "dialogflow.projects.agent.sessions.contexts.create" call.
  8350. // Exactly one of *GoogleCloudDialogflowV2Context or error will be
  8351. // non-nil. Any non-2xx status code is an error. Response headers are in
  8352. // either *GoogleCloudDialogflowV2Context.ServerResponse.Header or (if a
  8353. // response was returned at all) in error.(*googleapi.Error).Header. Use
  8354. // googleapi.IsNotModified to check whether the returned error was
  8355. // because http.StatusNotModified was returned.
  8356. func (c *ProjectsAgentSessionsContextsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2Context, error) {
  8357. gensupport.SetOptions(c.urlParams_, opts...)
  8358. res, err := c.doRequest("json")
  8359. if res != nil && res.StatusCode == http.StatusNotModified {
  8360. if res.Body != nil {
  8361. res.Body.Close()
  8362. }
  8363. return nil, &googleapi.Error{
  8364. Code: res.StatusCode,
  8365. Header: res.Header,
  8366. }
  8367. }
  8368. if err != nil {
  8369. return nil, err
  8370. }
  8371. defer googleapi.CloseBody(res)
  8372. if err := googleapi.CheckResponse(res); err != nil {
  8373. return nil, err
  8374. }
  8375. ret := &GoogleCloudDialogflowV2Context{
  8376. ServerResponse: googleapi.ServerResponse{
  8377. Header: res.Header,
  8378. HTTPStatusCode: res.StatusCode,
  8379. },
  8380. }
  8381. target := &ret
  8382. if err := gensupport.DecodeResponse(target, res); err != nil {
  8383. return nil, err
  8384. }
  8385. return ret, nil
  8386. // {
  8387. // "description": "Creates a context.",
  8388. // "flatPath": "v2/projects/{projectsId}/agent/sessions/{sessionsId}/contexts",
  8389. // "httpMethod": "POST",
  8390. // "id": "dialogflow.projects.agent.sessions.contexts.create",
  8391. // "parameterOrder": [
  8392. // "parent"
  8393. // ],
  8394. // "parameters": {
  8395. // "parent": {
  8396. // "description": "Required. The session to create a context for.\nFormat: `projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e`.",
  8397. // "location": "path",
  8398. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+$",
  8399. // "required": true,
  8400. // "type": "string"
  8401. // }
  8402. // },
  8403. // "path": "v2/{+parent}/contexts",
  8404. // "request": {
  8405. // "$ref": "GoogleCloudDialogflowV2Context"
  8406. // },
  8407. // "response": {
  8408. // "$ref": "GoogleCloudDialogflowV2Context"
  8409. // },
  8410. // "scopes": [
  8411. // "https://www.googleapis.com/auth/cloud-platform"
  8412. // ]
  8413. // }
  8414. }
  8415. // method id "dialogflow.projects.agent.sessions.contexts.delete":
  8416. type ProjectsAgentSessionsContextsDeleteCall struct {
  8417. s *Service
  8418. name string
  8419. urlParams_ gensupport.URLParams
  8420. ctx_ context.Context
  8421. header_ http.Header
  8422. }
  8423. // Delete: Deletes the specified context.
  8424. func (r *ProjectsAgentSessionsContextsService) Delete(name string) *ProjectsAgentSessionsContextsDeleteCall {
  8425. c := &ProjectsAgentSessionsContextsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8426. c.name = name
  8427. return c
  8428. }
  8429. // Fields allows partial responses to be retrieved. See
  8430. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8431. // for more information.
  8432. func (c *ProjectsAgentSessionsContextsDeleteCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsContextsDeleteCall {
  8433. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8434. return c
  8435. }
  8436. // Context sets the context to be used in this call's Do method. Any
  8437. // pending HTTP request will be aborted if the provided context is
  8438. // canceled.
  8439. func (c *ProjectsAgentSessionsContextsDeleteCall) Context(ctx context.Context) *ProjectsAgentSessionsContextsDeleteCall {
  8440. c.ctx_ = ctx
  8441. return c
  8442. }
  8443. // Header returns an http.Header that can be modified by the caller to
  8444. // add HTTP headers to the request.
  8445. func (c *ProjectsAgentSessionsContextsDeleteCall) Header() http.Header {
  8446. if c.header_ == nil {
  8447. c.header_ = make(http.Header)
  8448. }
  8449. return c.header_
  8450. }
  8451. func (c *ProjectsAgentSessionsContextsDeleteCall) doRequest(alt string) (*http.Response, error) {
  8452. reqHeaders := make(http.Header)
  8453. for k, v := range c.header_ {
  8454. reqHeaders[k] = v
  8455. }
  8456. reqHeaders.Set("User-Agent", c.s.userAgent())
  8457. var body io.Reader = nil
  8458. c.urlParams_.Set("alt", alt)
  8459. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  8460. urls += "?" + c.urlParams_.Encode()
  8461. req, _ := http.NewRequest("DELETE", urls, body)
  8462. req.Header = reqHeaders
  8463. googleapi.Expand(req.URL, map[string]string{
  8464. "name": c.name,
  8465. })
  8466. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8467. }
  8468. // Do executes the "dialogflow.projects.agent.sessions.contexts.delete" call.
  8469. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  8470. // non-2xx status code is an error. Response headers are in either
  8471. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  8472. // returned at all) in error.(*googleapi.Error).Header. Use
  8473. // googleapi.IsNotModified to check whether the returned error was
  8474. // because http.StatusNotModified was returned.
  8475. func (c *ProjectsAgentSessionsContextsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  8476. gensupport.SetOptions(c.urlParams_, opts...)
  8477. res, err := c.doRequest("json")
  8478. if res != nil && res.StatusCode == http.StatusNotModified {
  8479. if res.Body != nil {
  8480. res.Body.Close()
  8481. }
  8482. return nil, &googleapi.Error{
  8483. Code: res.StatusCode,
  8484. Header: res.Header,
  8485. }
  8486. }
  8487. if err != nil {
  8488. return nil, err
  8489. }
  8490. defer googleapi.CloseBody(res)
  8491. if err := googleapi.CheckResponse(res); err != nil {
  8492. return nil, err
  8493. }
  8494. ret := &GoogleProtobufEmpty{
  8495. ServerResponse: googleapi.ServerResponse{
  8496. Header: res.Header,
  8497. HTTPStatusCode: res.StatusCode,
  8498. },
  8499. }
  8500. target := &ret
  8501. if err := gensupport.DecodeResponse(target, res); err != nil {
  8502. return nil, err
  8503. }
  8504. return ret, nil
  8505. // {
  8506. // "description": "Deletes the specified context.",
  8507. // "flatPath": "v2/projects/{projectsId}/agent/sessions/{sessionsId}/contexts/{contextsId}",
  8508. // "httpMethod": "DELETE",
  8509. // "id": "dialogflow.projects.agent.sessions.contexts.delete",
  8510. // "parameterOrder": [
  8511. // "name"
  8512. // ],
  8513. // "parameters": {
  8514. // "name": {
  8515. // "description": "Required. The name of the context to delete. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e/contexts/\u003cContext ID\u003e`.",
  8516. // "location": "path",
  8517. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+/contexts/[^/]+$",
  8518. // "required": true,
  8519. // "type": "string"
  8520. // }
  8521. // },
  8522. // "path": "v2/{+name}",
  8523. // "response": {
  8524. // "$ref": "GoogleProtobufEmpty"
  8525. // },
  8526. // "scopes": [
  8527. // "https://www.googleapis.com/auth/cloud-platform"
  8528. // ]
  8529. // }
  8530. }
  8531. // method id "dialogflow.projects.agent.sessions.contexts.get":
  8532. type ProjectsAgentSessionsContextsGetCall struct {
  8533. s *Service
  8534. name string
  8535. urlParams_ gensupport.URLParams
  8536. ifNoneMatch_ string
  8537. ctx_ context.Context
  8538. header_ http.Header
  8539. }
  8540. // Get: Retrieves the specified context.
  8541. func (r *ProjectsAgentSessionsContextsService) Get(name string) *ProjectsAgentSessionsContextsGetCall {
  8542. c := &ProjectsAgentSessionsContextsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8543. c.name = name
  8544. return c
  8545. }
  8546. // Fields allows partial responses to be retrieved. See
  8547. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8548. // for more information.
  8549. func (c *ProjectsAgentSessionsContextsGetCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsContextsGetCall {
  8550. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8551. return c
  8552. }
  8553. // IfNoneMatch sets the optional parameter which makes the operation
  8554. // fail if the object's ETag matches the given value. This is useful for
  8555. // getting updates only after the object has changed since the last
  8556. // request. Use googleapi.IsNotModified to check whether the response
  8557. // error from Do is the result of In-None-Match.
  8558. func (c *ProjectsAgentSessionsContextsGetCall) IfNoneMatch(entityTag string) *ProjectsAgentSessionsContextsGetCall {
  8559. c.ifNoneMatch_ = entityTag
  8560. return c
  8561. }
  8562. // Context sets the context to be used in this call's Do method. Any
  8563. // pending HTTP request will be aborted if the provided context is
  8564. // canceled.
  8565. func (c *ProjectsAgentSessionsContextsGetCall) Context(ctx context.Context) *ProjectsAgentSessionsContextsGetCall {
  8566. c.ctx_ = ctx
  8567. return c
  8568. }
  8569. // Header returns an http.Header that can be modified by the caller to
  8570. // add HTTP headers to the request.
  8571. func (c *ProjectsAgentSessionsContextsGetCall) Header() http.Header {
  8572. if c.header_ == nil {
  8573. c.header_ = make(http.Header)
  8574. }
  8575. return c.header_
  8576. }
  8577. func (c *ProjectsAgentSessionsContextsGetCall) doRequest(alt string) (*http.Response, error) {
  8578. reqHeaders := make(http.Header)
  8579. for k, v := range c.header_ {
  8580. reqHeaders[k] = v
  8581. }
  8582. reqHeaders.Set("User-Agent", c.s.userAgent())
  8583. if c.ifNoneMatch_ != "" {
  8584. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8585. }
  8586. var body io.Reader = nil
  8587. c.urlParams_.Set("alt", alt)
  8588. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  8589. urls += "?" + c.urlParams_.Encode()
  8590. req, _ := http.NewRequest("GET", urls, body)
  8591. req.Header = reqHeaders
  8592. googleapi.Expand(req.URL, map[string]string{
  8593. "name": c.name,
  8594. })
  8595. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8596. }
  8597. // Do executes the "dialogflow.projects.agent.sessions.contexts.get" call.
  8598. // Exactly one of *GoogleCloudDialogflowV2Context or error will be
  8599. // non-nil. Any non-2xx status code is an error. Response headers are in
  8600. // either *GoogleCloudDialogflowV2Context.ServerResponse.Header or (if a
  8601. // response was returned at all) in error.(*googleapi.Error).Header. Use
  8602. // googleapi.IsNotModified to check whether the returned error was
  8603. // because http.StatusNotModified was returned.
  8604. func (c *ProjectsAgentSessionsContextsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2Context, error) {
  8605. gensupport.SetOptions(c.urlParams_, opts...)
  8606. res, err := c.doRequest("json")
  8607. if res != nil && res.StatusCode == http.StatusNotModified {
  8608. if res.Body != nil {
  8609. res.Body.Close()
  8610. }
  8611. return nil, &googleapi.Error{
  8612. Code: res.StatusCode,
  8613. Header: res.Header,
  8614. }
  8615. }
  8616. if err != nil {
  8617. return nil, err
  8618. }
  8619. defer googleapi.CloseBody(res)
  8620. if err := googleapi.CheckResponse(res); err != nil {
  8621. return nil, err
  8622. }
  8623. ret := &GoogleCloudDialogflowV2Context{
  8624. ServerResponse: googleapi.ServerResponse{
  8625. Header: res.Header,
  8626. HTTPStatusCode: res.StatusCode,
  8627. },
  8628. }
  8629. target := &ret
  8630. if err := gensupport.DecodeResponse(target, res); err != nil {
  8631. return nil, err
  8632. }
  8633. return ret, nil
  8634. // {
  8635. // "description": "Retrieves the specified context.",
  8636. // "flatPath": "v2/projects/{projectsId}/agent/sessions/{sessionsId}/contexts/{contextsId}",
  8637. // "httpMethod": "GET",
  8638. // "id": "dialogflow.projects.agent.sessions.contexts.get",
  8639. // "parameterOrder": [
  8640. // "name"
  8641. // ],
  8642. // "parameters": {
  8643. // "name": {
  8644. // "description": "Required. The name of the context. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e/contexts/\u003cContext ID\u003e`.",
  8645. // "location": "path",
  8646. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+/contexts/[^/]+$",
  8647. // "required": true,
  8648. // "type": "string"
  8649. // }
  8650. // },
  8651. // "path": "v2/{+name}",
  8652. // "response": {
  8653. // "$ref": "GoogleCloudDialogflowV2Context"
  8654. // },
  8655. // "scopes": [
  8656. // "https://www.googleapis.com/auth/cloud-platform"
  8657. // ]
  8658. // }
  8659. }
  8660. // method id "dialogflow.projects.agent.sessions.contexts.list":
  8661. type ProjectsAgentSessionsContextsListCall struct {
  8662. s *Service
  8663. parent string
  8664. urlParams_ gensupport.URLParams
  8665. ifNoneMatch_ string
  8666. ctx_ context.Context
  8667. header_ http.Header
  8668. }
  8669. // List: Returns the list of all contexts in the specified session.
  8670. func (r *ProjectsAgentSessionsContextsService) List(parent string) *ProjectsAgentSessionsContextsListCall {
  8671. c := &ProjectsAgentSessionsContextsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8672. c.parent = parent
  8673. return c
  8674. }
  8675. // PageSize sets the optional parameter "pageSize": The maximum number
  8676. // of items to return in a single page. By
  8677. // default 100 and at most 1000.
  8678. func (c *ProjectsAgentSessionsContextsListCall) PageSize(pageSize int64) *ProjectsAgentSessionsContextsListCall {
  8679. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  8680. return c
  8681. }
  8682. // PageToken sets the optional parameter "pageToken": The
  8683. // next_page_token value returned from a previous list request.
  8684. func (c *ProjectsAgentSessionsContextsListCall) PageToken(pageToken string) *ProjectsAgentSessionsContextsListCall {
  8685. c.urlParams_.Set("pageToken", pageToken)
  8686. return c
  8687. }
  8688. // Fields allows partial responses to be retrieved. See
  8689. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8690. // for more information.
  8691. func (c *ProjectsAgentSessionsContextsListCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsContextsListCall {
  8692. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8693. return c
  8694. }
  8695. // IfNoneMatch sets the optional parameter which makes the operation
  8696. // fail if the object's ETag matches the given value. This is useful for
  8697. // getting updates only after the object has changed since the last
  8698. // request. Use googleapi.IsNotModified to check whether the response
  8699. // error from Do is the result of In-None-Match.
  8700. func (c *ProjectsAgentSessionsContextsListCall) IfNoneMatch(entityTag string) *ProjectsAgentSessionsContextsListCall {
  8701. c.ifNoneMatch_ = entityTag
  8702. return c
  8703. }
  8704. // Context sets the context to be used in this call's Do method. Any
  8705. // pending HTTP request will be aborted if the provided context is
  8706. // canceled.
  8707. func (c *ProjectsAgentSessionsContextsListCall) Context(ctx context.Context) *ProjectsAgentSessionsContextsListCall {
  8708. c.ctx_ = ctx
  8709. return c
  8710. }
  8711. // Header returns an http.Header that can be modified by the caller to
  8712. // add HTTP headers to the request.
  8713. func (c *ProjectsAgentSessionsContextsListCall) Header() http.Header {
  8714. if c.header_ == nil {
  8715. c.header_ = make(http.Header)
  8716. }
  8717. return c.header_
  8718. }
  8719. func (c *ProjectsAgentSessionsContextsListCall) doRequest(alt string) (*http.Response, error) {
  8720. reqHeaders := make(http.Header)
  8721. for k, v := range c.header_ {
  8722. reqHeaders[k] = v
  8723. }
  8724. reqHeaders.Set("User-Agent", c.s.userAgent())
  8725. if c.ifNoneMatch_ != "" {
  8726. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8727. }
  8728. var body io.Reader = nil
  8729. c.urlParams_.Set("alt", alt)
  8730. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/contexts")
  8731. urls += "?" + c.urlParams_.Encode()
  8732. req, _ := http.NewRequest("GET", urls, body)
  8733. req.Header = reqHeaders
  8734. googleapi.Expand(req.URL, map[string]string{
  8735. "parent": c.parent,
  8736. })
  8737. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8738. }
  8739. // Do executes the "dialogflow.projects.agent.sessions.contexts.list" call.
  8740. // Exactly one of *GoogleCloudDialogflowV2ListContextsResponse or error
  8741. // will be non-nil. Any non-2xx status code is an error. Response
  8742. // headers are in either
  8743. // *GoogleCloudDialogflowV2ListContextsResponse.ServerResponse.Header or
  8744. // (if a response was returned at all) in
  8745. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8746. // whether the returned error was because http.StatusNotModified was
  8747. // returned.
  8748. func (c *ProjectsAgentSessionsContextsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2ListContextsResponse, error) {
  8749. gensupport.SetOptions(c.urlParams_, opts...)
  8750. res, err := c.doRequest("json")
  8751. if res != nil && res.StatusCode == http.StatusNotModified {
  8752. if res.Body != nil {
  8753. res.Body.Close()
  8754. }
  8755. return nil, &googleapi.Error{
  8756. Code: res.StatusCode,
  8757. Header: res.Header,
  8758. }
  8759. }
  8760. if err != nil {
  8761. return nil, err
  8762. }
  8763. defer googleapi.CloseBody(res)
  8764. if err := googleapi.CheckResponse(res); err != nil {
  8765. return nil, err
  8766. }
  8767. ret := &GoogleCloudDialogflowV2ListContextsResponse{
  8768. ServerResponse: googleapi.ServerResponse{
  8769. Header: res.Header,
  8770. HTTPStatusCode: res.StatusCode,
  8771. },
  8772. }
  8773. target := &ret
  8774. if err := gensupport.DecodeResponse(target, res); err != nil {
  8775. return nil, err
  8776. }
  8777. return ret, nil
  8778. // {
  8779. // "description": "Returns the list of all contexts in the specified session.",
  8780. // "flatPath": "v2/projects/{projectsId}/agent/sessions/{sessionsId}/contexts",
  8781. // "httpMethod": "GET",
  8782. // "id": "dialogflow.projects.agent.sessions.contexts.list",
  8783. // "parameterOrder": [
  8784. // "parent"
  8785. // ],
  8786. // "parameters": {
  8787. // "pageSize": {
  8788. // "description": "Optional. The maximum number of items to return in a single page. By\ndefault 100 and at most 1000.",
  8789. // "format": "int32",
  8790. // "location": "query",
  8791. // "type": "integer"
  8792. // },
  8793. // "pageToken": {
  8794. // "description": "Optional. The next_page_token value returned from a previous list request.",
  8795. // "location": "query",
  8796. // "type": "string"
  8797. // },
  8798. // "parent": {
  8799. // "description": "Required. The session to list all contexts from.\nFormat: `projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e`.",
  8800. // "location": "path",
  8801. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+$",
  8802. // "required": true,
  8803. // "type": "string"
  8804. // }
  8805. // },
  8806. // "path": "v2/{+parent}/contexts",
  8807. // "response": {
  8808. // "$ref": "GoogleCloudDialogflowV2ListContextsResponse"
  8809. // },
  8810. // "scopes": [
  8811. // "https://www.googleapis.com/auth/cloud-platform"
  8812. // ]
  8813. // }
  8814. }
  8815. // Pages invokes f for each page of results.
  8816. // A non-nil error returned from f will halt the iteration.
  8817. // The provided context supersedes any context provided to the Context method.
  8818. func (c *ProjectsAgentSessionsContextsListCall) Pages(ctx context.Context, f func(*GoogleCloudDialogflowV2ListContextsResponse) error) error {
  8819. c.ctx_ = ctx
  8820. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  8821. for {
  8822. x, err := c.Do()
  8823. if err != nil {
  8824. return err
  8825. }
  8826. if err := f(x); err != nil {
  8827. return err
  8828. }
  8829. if x.NextPageToken == "" {
  8830. return nil
  8831. }
  8832. c.PageToken(x.NextPageToken)
  8833. }
  8834. }
  8835. // method id "dialogflow.projects.agent.sessions.contexts.patch":
  8836. type ProjectsAgentSessionsContextsPatchCall struct {
  8837. s *Service
  8838. nameid string
  8839. googleclouddialogflowv2context *GoogleCloudDialogflowV2Context
  8840. urlParams_ gensupport.URLParams
  8841. ctx_ context.Context
  8842. header_ http.Header
  8843. }
  8844. // Patch: Updates the specified context.
  8845. func (r *ProjectsAgentSessionsContextsService) Patch(nameid string, googleclouddialogflowv2context *GoogleCloudDialogflowV2Context) *ProjectsAgentSessionsContextsPatchCall {
  8846. c := &ProjectsAgentSessionsContextsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8847. c.nameid = nameid
  8848. c.googleclouddialogflowv2context = googleclouddialogflowv2context
  8849. return c
  8850. }
  8851. // UpdateMask sets the optional parameter "updateMask": The mask to
  8852. // control which fields get updated.
  8853. func (c *ProjectsAgentSessionsContextsPatchCall) UpdateMask(updateMask string) *ProjectsAgentSessionsContextsPatchCall {
  8854. c.urlParams_.Set("updateMask", updateMask)
  8855. return c
  8856. }
  8857. // Fields allows partial responses to be retrieved. See
  8858. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8859. // for more information.
  8860. func (c *ProjectsAgentSessionsContextsPatchCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsContextsPatchCall {
  8861. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8862. return c
  8863. }
  8864. // Context sets the context to be used in this call's Do method. Any
  8865. // pending HTTP request will be aborted if the provided context is
  8866. // canceled.
  8867. func (c *ProjectsAgentSessionsContextsPatchCall) Context(ctx context.Context) *ProjectsAgentSessionsContextsPatchCall {
  8868. c.ctx_ = ctx
  8869. return c
  8870. }
  8871. // Header returns an http.Header that can be modified by the caller to
  8872. // add HTTP headers to the request.
  8873. func (c *ProjectsAgentSessionsContextsPatchCall) Header() http.Header {
  8874. if c.header_ == nil {
  8875. c.header_ = make(http.Header)
  8876. }
  8877. return c.header_
  8878. }
  8879. func (c *ProjectsAgentSessionsContextsPatchCall) doRequest(alt string) (*http.Response, error) {
  8880. reqHeaders := make(http.Header)
  8881. for k, v := range c.header_ {
  8882. reqHeaders[k] = v
  8883. }
  8884. reqHeaders.Set("User-Agent", c.s.userAgent())
  8885. var body io.Reader = nil
  8886. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2context)
  8887. if err != nil {
  8888. return nil, err
  8889. }
  8890. reqHeaders.Set("Content-Type", "application/json")
  8891. c.urlParams_.Set("alt", alt)
  8892. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  8893. urls += "?" + c.urlParams_.Encode()
  8894. req, _ := http.NewRequest("PATCH", urls, body)
  8895. req.Header = reqHeaders
  8896. googleapi.Expand(req.URL, map[string]string{
  8897. "name": c.nameid,
  8898. })
  8899. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8900. }
  8901. // Do executes the "dialogflow.projects.agent.sessions.contexts.patch" call.
  8902. // Exactly one of *GoogleCloudDialogflowV2Context or error will be
  8903. // non-nil. Any non-2xx status code is an error. Response headers are in
  8904. // either *GoogleCloudDialogflowV2Context.ServerResponse.Header or (if a
  8905. // response was returned at all) in error.(*googleapi.Error).Header. Use
  8906. // googleapi.IsNotModified to check whether the returned error was
  8907. // because http.StatusNotModified was returned.
  8908. func (c *ProjectsAgentSessionsContextsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2Context, error) {
  8909. gensupport.SetOptions(c.urlParams_, opts...)
  8910. res, err := c.doRequest("json")
  8911. if res != nil && res.StatusCode == http.StatusNotModified {
  8912. if res.Body != nil {
  8913. res.Body.Close()
  8914. }
  8915. return nil, &googleapi.Error{
  8916. Code: res.StatusCode,
  8917. Header: res.Header,
  8918. }
  8919. }
  8920. if err != nil {
  8921. return nil, err
  8922. }
  8923. defer googleapi.CloseBody(res)
  8924. if err := googleapi.CheckResponse(res); err != nil {
  8925. return nil, err
  8926. }
  8927. ret := &GoogleCloudDialogflowV2Context{
  8928. ServerResponse: googleapi.ServerResponse{
  8929. Header: res.Header,
  8930. HTTPStatusCode: res.StatusCode,
  8931. },
  8932. }
  8933. target := &ret
  8934. if err := gensupport.DecodeResponse(target, res); err != nil {
  8935. return nil, err
  8936. }
  8937. return ret, nil
  8938. // {
  8939. // "description": "Updates the specified context.",
  8940. // "flatPath": "v2/projects/{projectsId}/agent/sessions/{sessionsId}/contexts/{contextsId}",
  8941. // "httpMethod": "PATCH",
  8942. // "id": "dialogflow.projects.agent.sessions.contexts.patch",
  8943. // "parameterOrder": [
  8944. // "name"
  8945. // ],
  8946. // "parameters": {
  8947. // "name": {
  8948. // "description": "Required. The unique identifier of the context. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e/contexts/\u003cContext ID\u003e`.",
  8949. // "location": "path",
  8950. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+/contexts/[^/]+$",
  8951. // "required": true,
  8952. // "type": "string"
  8953. // },
  8954. // "updateMask": {
  8955. // "description": "Optional. The mask to control which fields get updated.",
  8956. // "format": "google-fieldmask",
  8957. // "location": "query",
  8958. // "type": "string"
  8959. // }
  8960. // },
  8961. // "path": "v2/{+name}",
  8962. // "request": {
  8963. // "$ref": "GoogleCloudDialogflowV2Context"
  8964. // },
  8965. // "response": {
  8966. // "$ref": "GoogleCloudDialogflowV2Context"
  8967. // },
  8968. // "scopes": [
  8969. // "https://www.googleapis.com/auth/cloud-platform"
  8970. // ]
  8971. // }
  8972. }
  8973. // method id "dialogflow.projects.agent.sessions.entityTypes.create":
  8974. type ProjectsAgentSessionsEntityTypesCreateCall struct {
  8975. s *Service
  8976. parent string
  8977. googleclouddialogflowv2sessionentitytype *GoogleCloudDialogflowV2SessionEntityType
  8978. urlParams_ gensupport.URLParams
  8979. ctx_ context.Context
  8980. header_ http.Header
  8981. }
  8982. // Create: Creates a session entity type.
  8983. func (r *ProjectsAgentSessionsEntityTypesService) Create(parent string, googleclouddialogflowv2sessionentitytype *GoogleCloudDialogflowV2SessionEntityType) *ProjectsAgentSessionsEntityTypesCreateCall {
  8984. c := &ProjectsAgentSessionsEntityTypesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8985. c.parent = parent
  8986. c.googleclouddialogflowv2sessionentitytype = googleclouddialogflowv2sessionentitytype
  8987. return c
  8988. }
  8989. // Fields allows partial responses to be retrieved. See
  8990. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8991. // for more information.
  8992. func (c *ProjectsAgentSessionsEntityTypesCreateCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsEntityTypesCreateCall {
  8993. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8994. return c
  8995. }
  8996. // Context sets the context to be used in this call's Do method. Any
  8997. // pending HTTP request will be aborted if the provided context is
  8998. // canceled.
  8999. func (c *ProjectsAgentSessionsEntityTypesCreateCall) Context(ctx context.Context) *ProjectsAgentSessionsEntityTypesCreateCall {
  9000. c.ctx_ = ctx
  9001. return c
  9002. }
  9003. // Header returns an http.Header that can be modified by the caller to
  9004. // add HTTP headers to the request.
  9005. func (c *ProjectsAgentSessionsEntityTypesCreateCall) Header() http.Header {
  9006. if c.header_ == nil {
  9007. c.header_ = make(http.Header)
  9008. }
  9009. return c.header_
  9010. }
  9011. func (c *ProjectsAgentSessionsEntityTypesCreateCall) doRequest(alt string) (*http.Response, error) {
  9012. reqHeaders := make(http.Header)
  9013. for k, v := range c.header_ {
  9014. reqHeaders[k] = v
  9015. }
  9016. reqHeaders.Set("User-Agent", c.s.userAgent())
  9017. var body io.Reader = nil
  9018. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2sessionentitytype)
  9019. if err != nil {
  9020. return nil, err
  9021. }
  9022. reqHeaders.Set("Content-Type", "application/json")
  9023. c.urlParams_.Set("alt", alt)
  9024. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/entityTypes")
  9025. urls += "?" + c.urlParams_.Encode()
  9026. req, _ := http.NewRequest("POST", urls, body)
  9027. req.Header = reqHeaders
  9028. googleapi.Expand(req.URL, map[string]string{
  9029. "parent": c.parent,
  9030. })
  9031. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9032. }
  9033. // Do executes the "dialogflow.projects.agent.sessions.entityTypes.create" call.
  9034. // Exactly one of *GoogleCloudDialogflowV2SessionEntityType or error
  9035. // will be non-nil. Any non-2xx status code is an error. Response
  9036. // headers are in either
  9037. // *GoogleCloudDialogflowV2SessionEntityType.ServerResponse.Header or
  9038. // (if a response was returned at all) in
  9039. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9040. // whether the returned error was because http.StatusNotModified was
  9041. // returned.
  9042. func (c *ProjectsAgentSessionsEntityTypesCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2SessionEntityType, error) {
  9043. gensupport.SetOptions(c.urlParams_, opts...)
  9044. res, err := c.doRequest("json")
  9045. if res != nil && res.StatusCode == http.StatusNotModified {
  9046. if res.Body != nil {
  9047. res.Body.Close()
  9048. }
  9049. return nil, &googleapi.Error{
  9050. Code: res.StatusCode,
  9051. Header: res.Header,
  9052. }
  9053. }
  9054. if err != nil {
  9055. return nil, err
  9056. }
  9057. defer googleapi.CloseBody(res)
  9058. if err := googleapi.CheckResponse(res); err != nil {
  9059. return nil, err
  9060. }
  9061. ret := &GoogleCloudDialogflowV2SessionEntityType{
  9062. ServerResponse: googleapi.ServerResponse{
  9063. Header: res.Header,
  9064. HTTPStatusCode: res.StatusCode,
  9065. },
  9066. }
  9067. target := &ret
  9068. if err := gensupport.DecodeResponse(target, res); err != nil {
  9069. return nil, err
  9070. }
  9071. return ret, nil
  9072. // {
  9073. // "description": "Creates a session entity type.",
  9074. // "flatPath": "v2/projects/{projectsId}/agent/sessions/{sessionsId}/entityTypes",
  9075. // "httpMethod": "POST",
  9076. // "id": "dialogflow.projects.agent.sessions.entityTypes.create",
  9077. // "parameterOrder": [
  9078. // "parent"
  9079. // ],
  9080. // "parameters": {
  9081. // "parent": {
  9082. // "description": "Required. The session to create a session entity type for.\nFormat: `projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e`.",
  9083. // "location": "path",
  9084. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+$",
  9085. // "required": true,
  9086. // "type": "string"
  9087. // }
  9088. // },
  9089. // "path": "v2/{+parent}/entityTypes",
  9090. // "request": {
  9091. // "$ref": "GoogleCloudDialogflowV2SessionEntityType"
  9092. // },
  9093. // "response": {
  9094. // "$ref": "GoogleCloudDialogflowV2SessionEntityType"
  9095. // },
  9096. // "scopes": [
  9097. // "https://www.googleapis.com/auth/cloud-platform"
  9098. // ]
  9099. // }
  9100. }
  9101. // method id "dialogflow.projects.agent.sessions.entityTypes.delete":
  9102. type ProjectsAgentSessionsEntityTypesDeleteCall struct {
  9103. s *Service
  9104. name string
  9105. urlParams_ gensupport.URLParams
  9106. ctx_ context.Context
  9107. header_ http.Header
  9108. }
  9109. // Delete: Deletes the specified session entity type.
  9110. func (r *ProjectsAgentSessionsEntityTypesService) Delete(name string) *ProjectsAgentSessionsEntityTypesDeleteCall {
  9111. c := &ProjectsAgentSessionsEntityTypesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9112. c.name = name
  9113. return c
  9114. }
  9115. // Fields allows partial responses to be retrieved. See
  9116. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9117. // for more information.
  9118. func (c *ProjectsAgentSessionsEntityTypesDeleteCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsEntityTypesDeleteCall {
  9119. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9120. return c
  9121. }
  9122. // Context sets the context to be used in this call's Do method. Any
  9123. // pending HTTP request will be aborted if the provided context is
  9124. // canceled.
  9125. func (c *ProjectsAgentSessionsEntityTypesDeleteCall) Context(ctx context.Context) *ProjectsAgentSessionsEntityTypesDeleteCall {
  9126. c.ctx_ = ctx
  9127. return c
  9128. }
  9129. // Header returns an http.Header that can be modified by the caller to
  9130. // add HTTP headers to the request.
  9131. func (c *ProjectsAgentSessionsEntityTypesDeleteCall) Header() http.Header {
  9132. if c.header_ == nil {
  9133. c.header_ = make(http.Header)
  9134. }
  9135. return c.header_
  9136. }
  9137. func (c *ProjectsAgentSessionsEntityTypesDeleteCall) doRequest(alt string) (*http.Response, error) {
  9138. reqHeaders := make(http.Header)
  9139. for k, v := range c.header_ {
  9140. reqHeaders[k] = v
  9141. }
  9142. reqHeaders.Set("User-Agent", c.s.userAgent())
  9143. var body io.Reader = nil
  9144. c.urlParams_.Set("alt", alt)
  9145. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  9146. urls += "?" + c.urlParams_.Encode()
  9147. req, _ := http.NewRequest("DELETE", urls, body)
  9148. req.Header = reqHeaders
  9149. googleapi.Expand(req.URL, map[string]string{
  9150. "name": c.name,
  9151. })
  9152. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9153. }
  9154. // Do executes the "dialogflow.projects.agent.sessions.entityTypes.delete" call.
  9155. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  9156. // non-2xx status code is an error. Response headers are in either
  9157. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  9158. // returned at all) in error.(*googleapi.Error).Header. Use
  9159. // googleapi.IsNotModified to check whether the returned error was
  9160. // because http.StatusNotModified was returned.
  9161. func (c *ProjectsAgentSessionsEntityTypesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  9162. gensupport.SetOptions(c.urlParams_, opts...)
  9163. res, err := c.doRequest("json")
  9164. if res != nil && res.StatusCode == http.StatusNotModified {
  9165. if res.Body != nil {
  9166. res.Body.Close()
  9167. }
  9168. return nil, &googleapi.Error{
  9169. Code: res.StatusCode,
  9170. Header: res.Header,
  9171. }
  9172. }
  9173. if err != nil {
  9174. return nil, err
  9175. }
  9176. defer googleapi.CloseBody(res)
  9177. if err := googleapi.CheckResponse(res); err != nil {
  9178. return nil, err
  9179. }
  9180. ret := &GoogleProtobufEmpty{
  9181. ServerResponse: googleapi.ServerResponse{
  9182. Header: res.Header,
  9183. HTTPStatusCode: res.StatusCode,
  9184. },
  9185. }
  9186. target := &ret
  9187. if err := gensupport.DecodeResponse(target, res); err != nil {
  9188. return nil, err
  9189. }
  9190. return ret, nil
  9191. // {
  9192. // "description": "Deletes the specified session entity type.",
  9193. // "flatPath": "v2/projects/{projectsId}/agent/sessions/{sessionsId}/entityTypes/{entityTypesId}",
  9194. // "httpMethod": "DELETE",
  9195. // "id": "dialogflow.projects.agent.sessions.entityTypes.delete",
  9196. // "parameterOrder": [
  9197. // "name"
  9198. // ],
  9199. // "parameters": {
  9200. // "name": {
  9201. // "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`.",
  9202. // "location": "path",
  9203. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+/entityTypes/[^/]+$",
  9204. // "required": true,
  9205. // "type": "string"
  9206. // }
  9207. // },
  9208. // "path": "v2/{+name}",
  9209. // "response": {
  9210. // "$ref": "GoogleProtobufEmpty"
  9211. // },
  9212. // "scopes": [
  9213. // "https://www.googleapis.com/auth/cloud-platform"
  9214. // ]
  9215. // }
  9216. }
  9217. // method id "dialogflow.projects.agent.sessions.entityTypes.get":
  9218. type ProjectsAgentSessionsEntityTypesGetCall struct {
  9219. s *Service
  9220. name string
  9221. urlParams_ gensupport.URLParams
  9222. ifNoneMatch_ string
  9223. ctx_ context.Context
  9224. header_ http.Header
  9225. }
  9226. // Get: Retrieves the specified session entity type.
  9227. func (r *ProjectsAgentSessionsEntityTypesService) Get(name string) *ProjectsAgentSessionsEntityTypesGetCall {
  9228. c := &ProjectsAgentSessionsEntityTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9229. c.name = name
  9230. return c
  9231. }
  9232. // Fields allows partial responses to be retrieved. See
  9233. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9234. // for more information.
  9235. func (c *ProjectsAgentSessionsEntityTypesGetCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsEntityTypesGetCall {
  9236. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9237. return c
  9238. }
  9239. // IfNoneMatch sets the optional parameter which makes the operation
  9240. // fail if the object's ETag matches the given value. This is useful for
  9241. // getting updates only after the object has changed since the last
  9242. // request. Use googleapi.IsNotModified to check whether the response
  9243. // error from Do is the result of In-None-Match.
  9244. func (c *ProjectsAgentSessionsEntityTypesGetCall) IfNoneMatch(entityTag string) *ProjectsAgentSessionsEntityTypesGetCall {
  9245. c.ifNoneMatch_ = entityTag
  9246. return c
  9247. }
  9248. // Context sets the context to be used in this call's Do method. Any
  9249. // pending HTTP request will be aborted if the provided context is
  9250. // canceled.
  9251. func (c *ProjectsAgentSessionsEntityTypesGetCall) Context(ctx context.Context) *ProjectsAgentSessionsEntityTypesGetCall {
  9252. c.ctx_ = ctx
  9253. return c
  9254. }
  9255. // Header returns an http.Header that can be modified by the caller to
  9256. // add HTTP headers to the request.
  9257. func (c *ProjectsAgentSessionsEntityTypesGetCall) Header() http.Header {
  9258. if c.header_ == nil {
  9259. c.header_ = make(http.Header)
  9260. }
  9261. return c.header_
  9262. }
  9263. func (c *ProjectsAgentSessionsEntityTypesGetCall) doRequest(alt string) (*http.Response, error) {
  9264. reqHeaders := make(http.Header)
  9265. for k, v := range c.header_ {
  9266. reqHeaders[k] = v
  9267. }
  9268. reqHeaders.Set("User-Agent", c.s.userAgent())
  9269. if c.ifNoneMatch_ != "" {
  9270. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9271. }
  9272. var body io.Reader = nil
  9273. c.urlParams_.Set("alt", alt)
  9274. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  9275. urls += "?" + c.urlParams_.Encode()
  9276. req, _ := http.NewRequest("GET", urls, body)
  9277. req.Header = reqHeaders
  9278. googleapi.Expand(req.URL, map[string]string{
  9279. "name": c.name,
  9280. })
  9281. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9282. }
  9283. // Do executes the "dialogflow.projects.agent.sessions.entityTypes.get" call.
  9284. // Exactly one of *GoogleCloudDialogflowV2SessionEntityType or error
  9285. // will be non-nil. Any non-2xx status code is an error. Response
  9286. // headers are in either
  9287. // *GoogleCloudDialogflowV2SessionEntityType.ServerResponse.Header or
  9288. // (if a response was returned at all) in
  9289. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9290. // whether the returned error was because http.StatusNotModified was
  9291. // returned.
  9292. func (c *ProjectsAgentSessionsEntityTypesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2SessionEntityType, error) {
  9293. gensupport.SetOptions(c.urlParams_, opts...)
  9294. res, err := c.doRequest("json")
  9295. if res != nil && res.StatusCode == http.StatusNotModified {
  9296. if res.Body != nil {
  9297. res.Body.Close()
  9298. }
  9299. return nil, &googleapi.Error{
  9300. Code: res.StatusCode,
  9301. Header: res.Header,
  9302. }
  9303. }
  9304. if err != nil {
  9305. return nil, err
  9306. }
  9307. defer googleapi.CloseBody(res)
  9308. if err := googleapi.CheckResponse(res); err != nil {
  9309. return nil, err
  9310. }
  9311. ret := &GoogleCloudDialogflowV2SessionEntityType{
  9312. ServerResponse: googleapi.ServerResponse{
  9313. Header: res.Header,
  9314. HTTPStatusCode: res.StatusCode,
  9315. },
  9316. }
  9317. target := &ret
  9318. if err := gensupport.DecodeResponse(target, res); err != nil {
  9319. return nil, err
  9320. }
  9321. return ret, nil
  9322. // {
  9323. // "description": "Retrieves the specified session entity type.",
  9324. // "flatPath": "v2/projects/{projectsId}/agent/sessions/{sessionsId}/entityTypes/{entityTypesId}",
  9325. // "httpMethod": "GET",
  9326. // "id": "dialogflow.projects.agent.sessions.entityTypes.get",
  9327. // "parameterOrder": [
  9328. // "name"
  9329. // ],
  9330. // "parameters": {
  9331. // "name": {
  9332. // "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`.",
  9333. // "location": "path",
  9334. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+/entityTypes/[^/]+$",
  9335. // "required": true,
  9336. // "type": "string"
  9337. // }
  9338. // },
  9339. // "path": "v2/{+name}",
  9340. // "response": {
  9341. // "$ref": "GoogleCloudDialogflowV2SessionEntityType"
  9342. // },
  9343. // "scopes": [
  9344. // "https://www.googleapis.com/auth/cloud-platform"
  9345. // ]
  9346. // }
  9347. }
  9348. // method id "dialogflow.projects.agent.sessions.entityTypes.list":
  9349. type ProjectsAgentSessionsEntityTypesListCall struct {
  9350. s *Service
  9351. parent string
  9352. urlParams_ gensupport.URLParams
  9353. ifNoneMatch_ string
  9354. ctx_ context.Context
  9355. header_ http.Header
  9356. }
  9357. // List: Returns the list of all session entity types in the specified
  9358. // session.
  9359. func (r *ProjectsAgentSessionsEntityTypesService) List(parent string) *ProjectsAgentSessionsEntityTypesListCall {
  9360. c := &ProjectsAgentSessionsEntityTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9361. c.parent = parent
  9362. return c
  9363. }
  9364. // PageSize sets the optional parameter "pageSize": The maximum number
  9365. // of items to return in a single page. By
  9366. // default 100 and at most 1000.
  9367. func (c *ProjectsAgentSessionsEntityTypesListCall) PageSize(pageSize int64) *ProjectsAgentSessionsEntityTypesListCall {
  9368. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  9369. return c
  9370. }
  9371. // PageToken sets the optional parameter "pageToken": The
  9372. // next_page_token value returned from a previous list request.
  9373. func (c *ProjectsAgentSessionsEntityTypesListCall) PageToken(pageToken string) *ProjectsAgentSessionsEntityTypesListCall {
  9374. c.urlParams_.Set("pageToken", pageToken)
  9375. return c
  9376. }
  9377. // Fields allows partial responses to be retrieved. See
  9378. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9379. // for more information.
  9380. func (c *ProjectsAgentSessionsEntityTypesListCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsEntityTypesListCall {
  9381. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9382. return c
  9383. }
  9384. // IfNoneMatch sets the optional parameter which makes the operation
  9385. // fail if the object's ETag matches the given value. This is useful for
  9386. // getting updates only after the object has changed since the last
  9387. // request. Use googleapi.IsNotModified to check whether the response
  9388. // error from Do is the result of In-None-Match.
  9389. func (c *ProjectsAgentSessionsEntityTypesListCall) IfNoneMatch(entityTag string) *ProjectsAgentSessionsEntityTypesListCall {
  9390. c.ifNoneMatch_ = entityTag
  9391. return c
  9392. }
  9393. // Context sets the context to be used in this call's Do method. Any
  9394. // pending HTTP request will be aborted if the provided context is
  9395. // canceled.
  9396. func (c *ProjectsAgentSessionsEntityTypesListCall) Context(ctx context.Context) *ProjectsAgentSessionsEntityTypesListCall {
  9397. c.ctx_ = ctx
  9398. return c
  9399. }
  9400. // Header returns an http.Header that can be modified by the caller to
  9401. // add HTTP headers to the request.
  9402. func (c *ProjectsAgentSessionsEntityTypesListCall) Header() http.Header {
  9403. if c.header_ == nil {
  9404. c.header_ = make(http.Header)
  9405. }
  9406. return c.header_
  9407. }
  9408. func (c *ProjectsAgentSessionsEntityTypesListCall) doRequest(alt string) (*http.Response, error) {
  9409. reqHeaders := make(http.Header)
  9410. for k, v := range c.header_ {
  9411. reqHeaders[k] = v
  9412. }
  9413. reqHeaders.Set("User-Agent", c.s.userAgent())
  9414. if c.ifNoneMatch_ != "" {
  9415. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9416. }
  9417. var body io.Reader = nil
  9418. c.urlParams_.Set("alt", alt)
  9419. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/entityTypes")
  9420. urls += "?" + c.urlParams_.Encode()
  9421. req, _ := http.NewRequest("GET", urls, body)
  9422. req.Header = reqHeaders
  9423. googleapi.Expand(req.URL, map[string]string{
  9424. "parent": c.parent,
  9425. })
  9426. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9427. }
  9428. // Do executes the "dialogflow.projects.agent.sessions.entityTypes.list" call.
  9429. // Exactly one of *GoogleCloudDialogflowV2ListSessionEntityTypesResponse
  9430. // or error will be non-nil. Any non-2xx status code is an error.
  9431. // Response headers are in either
  9432. // *GoogleCloudDialogflowV2ListSessionEntityTypesResponse.ServerResponse.
  9433. // Header or (if a response was returned at all) in
  9434. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9435. // whether the returned error was because http.StatusNotModified was
  9436. // returned.
  9437. func (c *ProjectsAgentSessionsEntityTypesListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2ListSessionEntityTypesResponse, error) {
  9438. gensupport.SetOptions(c.urlParams_, opts...)
  9439. res, err := c.doRequest("json")
  9440. if res != nil && res.StatusCode == http.StatusNotModified {
  9441. if res.Body != nil {
  9442. res.Body.Close()
  9443. }
  9444. return nil, &googleapi.Error{
  9445. Code: res.StatusCode,
  9446. Header: res.Header,
  9447. }
  9448. }
  9449. if err != nil {
  9450. return nil, err
  9451. }
  9452. defer googleapi.CloseBody(res)
  9453. if err := googleapi.CheckResponse(res); err != nil {
  9454. return nil, err
  9455. }
  9456. ret := &GoogleCloudDialogflowV2ListSessionEntityTypesResponse{
  9457. ServerResponse: googleapi.ServerResponse{
  9458. Header: res.Header,
  9459. HTTPStatusCode: res.StatusCode,
  9460. },
  9461. }
  9462. target := &ret
  9463. if err := gensupport.DecodeResponse(target, res); err != nil {
  9464. return nil, err
  9465. }
  9466. return ret, nil
  9467. // {
  9468. // "description": "Returns the list of all session entity types in the specified session.",
  9469. // "flatPath": "v2/projects/{projectsId}/agent/sessions/{sessionsId}/entityTypes",
  9470. // "httpMethod": "GET",
  9471. // "id": "dialogflow.projects.agent.sessions.entityTypes.list",
  9472. // "parameterOrder": [
  9473. // "parent"
  9474. // ],
  9475. // "parameters": {
  9476. // "pageSize": {
  9477. // "description": "Optional. The maximum number of items to return in a single page. By\ndefault 100 and at most 1000.",
  9478. // "format": "int32",
  9479. // "location": "query",
  9480. // "type": "integer"
  9481. // },
  9482. // "pageToken": {
  9483. // "description": "Optional. The next_page_token value returned from a previous list request.",
  9484. // "location": "query",
  9485. // "type": "string"
  9486. // },
  9487. // "parent": {
  9488. // "description": "Required. The session to list all session entity types from.\nFormat: `projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e`.",
  9489. // "location": "path",
  9490. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+$",
  9491. // "required": true,
  9492. // "type": "string"
  9493. // }
  9494. // },
  9495. // "path": "v2/{+parent}/entityTypes",
  9496. // "response": {
  9497. // "$ref": "GoogleCloudDialogflowV2ListSessionEntityTypesResponse"
  9498. // },
  9499. // "scopes": [
  9500. // "https://www.googleapis.com/auth/cloud-platform"
  9501. // ]
  9502. // }
  9503. }
  9504. // Pages invokes f for each page of results.
  9505. // A non-nil error returned from f will halt the iteration.
  9506. // The provided context supersedes any context provided to the Context method.
  9507. func (c *ProjectsAgentSessionsEntityTypesListCall) Pages(ctx context.Context, f func(*GoogleCloudDialogflowV2ListSessionEntityTypesResponse) error) error {
  9508. c.ctx_ = ctx
  9509. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  9510. for {
  9511. x, err := c.Do()
  9512. if err != nil {
  9513. return err
  9514. }
  9515. if err := f(x); err != nil {
  9516. return err
  9517. }
  9518. if x.NextPageToken == "" {
  9519. return nil
  9520. }
  9521. c.PageToken(x.NextPageToken)
  9522. }
  9523. }
  9524. // method id "dialogflow.projects.agent.sessions.entityTypes.patch":
  9525. type ProjectsAgentSessionsEntityTypesPatchCall struct {
  9526. s *Service
  9527. nameid string
  9528. googleclouddialogflowv2sessionentitytype *GoogleCloudDialogflowV2SessionEntityType
  9529. urlParams_ gensupport.URLParams
  9530. ctx_ context.Context
  9531. header_ http.Header
  9532. }
  9533. // Patch: Updates the specified session entity type.
  9534. func (r *ProjectsAgentSessionsEntityTypesService) Patch(nameid string, googleclouddialogflowv2sessionentitytype *GoogleCloudDialogflowV2SessionEntityType) *ProjectsAgentSessionsEntityTypesPatchCall {
  9535. c := &ProjectsAgentSessionsEntityTypesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9536. c.nameid = nameid
  9537. c.googleclouddialogflowv2sessionentitytype = googleclouddialogflowv2sessionentitytype
  9538. return c
  9539. }
  9540. // UpdateMask sets the optional parameter "updateMask": The mask to
  9541. // control which fields get updated.
  9542. func (c *ProjectsAgentSessionsEntityTypesPatchCall) UpdateMask(updateMask string) *ProjectsAgentSessionsEntityTypesPatchCall {
  9543. c.urlParams_.Set("updateMask", updateMask)
  9544. return c
  9545. }
  9546. // Fields allows partial responses to be retrieved. See
  9547. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9548. // for more information.
  9549. func (c *ProjectsAgentSessionsEntityTypesPatchCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsEntityTypesPatchCall {
  9550. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9551. return c
  9552. }
  9553. // Context sets the context to be used in this call's Do method. Any
  9554. // pending HTTP request will be aborted if the provided context is
  9555. // canceled.
  9556. func (c *ProjectsAgentSessionsEntityTypesPatchCall) Context(ctx context.Context) *ProjectsAgentSessionsEntityTypesPatchCall {
  9557. c.ctx_ = ctx
  9558. return c
  9559. }
  9560. // Header returns an http.Header that can be modified by the caller to
  9561. // add HTTP headers to the request.
  9562. func (c *ProjectsAgentSessionsEntityTypesPatchCall) Header() http.Header {
  9563. if c.header_ == nil {
  9564. c.header_ = make(http.Header)
  9565. }
  9566. return c.header_
  9567. }
  9568. func (c *ProjectsAgentSessionsEntityTypesPatchCall) doRequest(alt string) (*http.Response, error) {
  9569. reqHeaders := make(http.Header)
  9570. for k, v := range c.header_ {
  9571. reqHeaders[k] = v
  9572. }
  9573. reqHeaders.Set("User-Agent", c.s.userAgent())
  9574. var body io.Reader = nil
  9575. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2sessionentitytype)
  9576. if err != nil {
  9577. return nil, err
  9578. }
  9579. reqHeaders.Set("Content-Type", "application/json")
  9580. c.urlParams_.Set("alt", alt)
  9581. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  9582. urls += "?" + c.urlParams_.Encode()
  9583. req, _ := http.NewRequest("PATCH", urls, body)
  9584. req.Header = reqHeaders
  9585. googleapi.Expand(req.URL, map[string]string{
  9586. "name": c.nameid,
  9587. })
  9588. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9589. }
  9590. // Do executes the "dialogflow.projects.agent.sessions.entityTypes.patch" call.
  9591. // Exactly one of *GoogleCloudDialogflowV2SessionEntityType or error
  9592. // will be non-nil. Any non-2xx status code is an error. Response
  9593. // headers are in either
  9594. // *GoogleCloudDialogflowV2SessionEntityType.ServerResponse.Header or
  9595. // (if a response was returned at all) in
  9596. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9597. // whether the returned error was because http.StatusNotModified was
  9598. // returned.
  9599. func (c *ProjectsAgentSessionsEntityTypesPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2SessionEntityType, error) {
  9600. gensupport.SetOptions(c.urlParams_, opts...)
  9601. res, err := c.doRequest("json")
  9602. if res != nil && res.StatusCode == http.StatusNotModified {
  9603. if res.Body != nil {
  9604. res.Body.Close()
  9605. }
  9606. return nil, &googleapi.Error{
  9607. Code: res.StatusCode,
  9608. Header: res.Header,
  9609. }
  9610. }
  9611. if err != nil {
  9612. return nil, err
  9613. }
  9614. defer googleapi.CloseBody(res)
  9615. if err := googleapi.CheckResponse(res); err != nil {
  9616. return nil, err
  9617. }
  9618. ret := &GoogleCloudDialogflowV2SessionEntityType{
  9619. ServerResponse: googleapi.ServerResponse{
  9620. Header: res.Header,
  9621. HTTPStatusCode: res.StatusCode,
  9622. },
  9623. }
  9624. target := &ret
  9625. if err := gensupport.DecodeResponse(target, res); err != nil {
  9626. return nil, err
  9627. }
  9628. return ret, nil
  9629. // {
  9630. // "description": "Updates the specified session entity type.",
  9631. // "flatPath": "v2/projects/{projectsId}/agent/sessions/{sessionsId}/entityTypes/{entityTypesId}",
  9632. // "httpMethod": "PATCH",
  9633. // "id": "dialogflow.projects.agent.sessions.entityTypes.patch",
  9634. // "parameterOrder": [
  9635. // "name"
  9636. // ],
  9637. // "parameters": {
  9638. // "name": {
  9639. // "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`.",
  9640. // "location": "path",
  9641. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+/entityTypes/[^/]+$",
  9642. // "required": true,
  9643. // "type": "string"
  9644. // },
  9645. // "updateMask": {
  9646. // "description": "Optional. The mask to control which fields get updated.",
  9647. // "format": "google-fieldmask",
  9648. // "location": "query",
  9649. // "type": "string"
  9650. // }
  9651. // },
  9652. // "path": "v2/{+name}",
  9653. // "request": {
  9654. // "$ref": "GoogleCloudDialogflowV2SessionEntityType"
  9655. // },
  9656. // "response": {
  9657. // "$ref": "GoogleCloudDialogflowV2SessionEntityType"
  9658. // },
  9659. // "scopes": [
  9660. // "https://www.googleapis.com/auth/cloud-platform"
  9661. // ]
  9662. // }
  9663. }
  9664. // method id "dialogflow.projects.operations.get":
  9665. type ProjectsOperationsGetCall struct {
  9666. s *Service
  9667. name string
  9668. urlParams_ gensupport.URLParams
  9669. ifNoneMatch_ string
  9670. ctx_ context.Context
  9671. header_ http.Header
  9672. }
  9673. // Get: Gets the latest state of a long-running operation. Clients can
  9674. // use this
  9675. // method to poll the operation result at intervals as recommended by
  9676. // the API
  9677. // service.
  9678. func (r *ProjectsOperationsService) Get(name string) *ProjectsOperationsGetCall {
  9679. c := &ProjectsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9680. c.name = name
  9681. return c
  9682. }
  9683. // Fields allows partial responses to be retrieved. See
  9684. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9685. // for more information.
  9686. func (c *ProjectsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsOperationsGetCall {
  9687. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9688. return c
  9689. }
  9690. // IfNoneMatch sets the optional parameter which makes the operation
  9691. // fail if the object's ETag matches the given value. This is useful for
  9692. // getting updates only after the object has changed since the last
  9693. // request. Use googleapi.IsNotModified to check whether the response
  9694. // error from Do is the result of In-None-Match.
  9695. func (c *ProjectsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsOperationsGetCall {
  9696. c.ifNoneMatch_ = entityTag
  9697. return c
  9698. }
  9699. // Context sets the context to be used in this call's Do method. Any
  9700. // pending HTTP request will be aborted if the provided context is
  9701. // canceled.
  9702. func (c *ProjectsOperationsGetCall) Context(ctx context.Context) *ProjectsOperationsGetCall {
  9703. c.ctx_ = ctx
  9704. return c
  9705. }
  9706. // Header returns an http.Header that can be modified by the caller to
  9707. // add HTTP headers to the request.
  9708. func (c *ProjectsOperationsGetCall) Header() http.Header {
  9709. if c.header_ == nil {
  9710. c.header_ = make(http.Header)
  9711. }
  9712. return c.header_
  9713. }
  9714. func (c *ProjectsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  9715. reqHeaders := make(http.Header)
  9716. for k, v := range c.header_ {
  9717. reqHeaders[k] = v
  9718. }
  9719. reqHeaders.Set("User-Agent", c.s.userAgent())
  9720. if c.ifNoneMatch_ != "" {
  9721. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9722. }
  9723. var body io.Reader = nil
  9724. c.urlParams_.Set("alt", alt)
  9725. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  9726. urls += "?" + c.urlParams_.Encode()
  9727. req, _ := http.NewRequest("GET", urls, body)
  9728. req.Header = reqHeaders
  9729. googleapi.Expand(req.URL, map[string]string{
  9730. "name": c.name,
  9731. })
  9732. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9733. }
  9734. // Do executes the "dialogflow.projects.operations.get" call.
  9735. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  9736. // Any non-2xx status code is an error. Response headers are in either
  9737. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  9738. // was returned at all) in error.(*googleapi.Error).Header. Use
  9739. // googleapi.IsNotModified to check whether the returned error was
  9740. // because http.StatusNotModified was returned.
  9741. func (c *ProjectsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  9742. gensupport.SetOptions(c.urlParams_, opts...)
  9743. res, err := c.doRequest("json")
  9744. if res != nil && res.StatusCode == http.StatusNotModified {
  9745. if res.Body != nil {
  9746. res.Body.Close()
  9747. }
  9748. return nil, &googleapi.Error{
  9749. Code: res.StatusCode,
  9750. Header: res.Header,
  9751. }
  9752. }
  9753. if err != nil {
  9754. return nil, err
  9755. }
  9756. defer googleapi.CloseBody(res)
  9757. if err := googleapi.CheckResponse(res); err != nil {
  9758. return nil, err
  9759. }
  9760. ret := &GoogleLongrunningOperation{
  9761. ServerResponse: googleapi.ServerResponse{
  9762. Header: res.Header,
  9763. HTTPStatusCode: res.StatusCode,
  9764. },
  9765. }
  9766. target := &ret
  9767. if err := gensupport.DecodeResponse(target, res); err != nil {
  9768. return nil, err
  9769. }
  9770. return ret, nil
  9771. // {
  9772. // "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.",
  9773. // "flatPath": "v2/projects/{projectsId}/operations/{operationsId}",
  9774. // "httpMethod": "GET",
  9775. // "id": "dialogflow.projects.operations.get",
  9776. // "parameterOrder": [
  9777. // "name"
  9778. // ],
  9779. // "parameters": {
  9780. // "name": {
  9781. // "description": "The name of the operation resource.",
  9782. // "location": "path",
  9783. // "pattern": "^projects/[^/]+/operations/[^/]+$",
  9784. // "required": true,
  9785. // "type": "string"
  9786. // }
  9787. // },
  9788. // "path": "v2/{+name}",
  9789. // "response": {
  9790. // "$ref": "GoogleLongrunningOperation"
  9791. // },
  9792. // "scopes": [
  9793. // "https://www.googleapis.com/auth/cloud-platform"
  9794. // ]
  9795. // }
  9796. }