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.
 
 
 

12686 lines
493 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/v2beta1"
  8. // ...
  9. // dialogflowService, err := dialogflow.New(oauthHttpClient)
  10. package dialogflow // import "google.golang.org/api/dialogflow/v2beta1"
  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:v2beta1"
  41. const apiName = "dialogflow"
  42. const apiVersion = "v2beta1"
  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.Environments = NewProjectsAgentEnvironmentsService(s)
  84. rs.Intents = NewProjectsAgentIntentsService(s)
  85. rs.Sessions = NewProjectsAgentSessionsService(s)
  86. return rs
  87. }
  88. type ProjectsAgentService struct {
  89. s *Service
  90. EntityTypes *ProjectsAgentEntityTypesService
  91. Environments *ProjectsAgentEnvironmentsService
  92. Intents *ProjectsAgentIntentsService
  93. Sessions *ProjectsAgentSessionsService
  94. }
  95. func NewProjectsAgentEntityTypesService(s *Service) *ProjectsAgentEntityTypesService {
  96. rs := &ProjectsAgentEntityTypesService{s: s}
  97. rs.Entities = NewProjectsAgentEntityTypesEntitiesService(s)
  98. return rs
  99. }
  100. type ProjectsAgentEntityTypesService struct {
  101. s *Service
  102. Entities *ProjectsAgentEntityTypesEntitiesService
  103. }
  104. func NewProjectsAgentEntityTypesEntitiesService(s *Service) *ProjectsAgentEntityTypesEntitiesService {
  105. rs := &ProjectsAgentEntityTypesEntitiesService{s: s}
  106. return rs
  107. }
  108. type ProjectsAgentEntityTypesEntitiesService struct {
  109. s *Service
  110. }
  111. func NewProjectsAgentEnvironmentsService(s *Service) *ProjectsAgentEnvironmentsService {
  112. rs := &ProjectsAgentEnvironmentsService{s: s}
  113. rs.Users = NewProjectsAgentEnvironmentsUsersService(s)
  114. return rs
  115. }
  116. type ProjectsAgentEnvironmentsService struct {
  117. s *Service
  118. Users *ProjectsAgentEnvironmentsUsersService
  119. }
  120. func NewProjectsAgentEnvironmentsUsersService(s *Service) *ProjectsAgentEnvironmentsUsersService {
  121. rs := &ProjectsAgentEnvironmentsUsersService{s: s}
  122. rs.Sessions = NewProjectsAgentEnvironmentsUsersSessionsService(s)
  123. return rs
  124. }
  125. type ProjectsAgentEnvironmentsUsersService struct {
  126. s *Service
  127. Sessions *ProjectsAgentEnvironmentsUsersSessionsService
  128. }
  129. func NewProjectsAgentEnvironmentsUsersSessionsService(s *Service) *ProjectsAgentEnvironmentsUsersSessionsService {
  130. rs := &ProjectsAgentEnvironmentsUsersSessionsService{s: s}
  131. rs.Contexts = NewProjectsAgentEnvironmentsUsersSessionsContextsService(s)
  132. rs.EntityTypes = NewProjectsAgentEnvironmentsUsersSessionsEntityTypesService(s)
  133. return rs
  134. }
  135. type ProjectsAgentEnvironmentsUsersSessionsService struct {
  136. s *Service
  137. Contexts *ProjectsAgentEnvironmentsUsersSessionsContextsService
  138. EntityTypes *ProjectsAgentEnvironmentsUsersSessionsEntityTypesService
  139. }
  140. func NewProjectsAgentEnvironmentsUsersSessionsContextsService(s *Service) *ProjectsAgentEnvironmentsUsersSessionsContextsService {
  141. rs := &ProjectsAgentEnvironmentsUsersSessionsContextsService{s: s}
  142. return rs
  143. }
  144. type ProjectsAgentEnvironmentsUsersSessionsContextsService struct {
  145. s *Service
  146. }
  147. func NewProjectsAgentEnvironmentsUsersSessionsEntityTypesService(s *Service) *ProjectsAgentEnvironmentsUsersSessionsEntityTypesService {
  148. rs := &ProjectsAgentEnvironmentsUsersSessionsEntityTypesService{s: s}
  149. return rs
  150. }
  151. type ProjectsAgentEnvironmentsUsersSessionsEntityTypesService struct {
  152. s *Service
  153. }
  154. func NewProjectsAgentIntentsService(s *Service) *ProjectsAgentIntentsService {
  155. rs := &ProjectsAgentIntentsService{s: s}
  156. return rs
  157. }
  158. type ProjectsAgentIntentsService struct {
  159. s *Service
  160. }
  161. func NewProjectsAgentSessionsService(s *Service) *ProjectsAgentSessionsService {
  162. rs := &ProjectsAgentSessionsService{s: s}
  163. rs.Contexts = NewProjectsAgentSessionsContextsService(s)
  164. rs.EntityTypes = NewProjectsAgentSessionsEntityTypesService(s)
  165. return rs
  166. }
  167. type ProjectsAgentSessionsService struct {
  168. s *Service
  169. Contexts *ProjectsAgentSessionsContextsService
  170. EntityTypes *ProjectsAgentSessionsEntityTypesService
  171. }
  172. func NewProjectsAgentSessionsContextsService(s *Service) *ProjectsAgentSessionsContextsService {
  173. rs := &ProjectsAgentSessionsContextsService{s: s}
  174. return rs
  175. }
  176. type ProjectsAgentSessionsContextsService struct {
  177. s *Service
  178. }
  179. func NewProjectsAgentSessionsEntityTypesService(s *Service) *ProjectsAgentSessionsEntityTypesService {
  180. rs := &ProjectsAgentSessionsEntityTypesService{s: s}
  181. return rs
  182. }
  183. type ProjectsAgentSessionsEntityTypesService struct {
  184. s *Service
  185. }
  186. func NewProjectsOperationsService(s *Service) *ProjectsOperationsService {
  187. rs := &ProjectsOperationsService{s: s}
  188. return rs
  189. }
  190. type ProjectsOperationsService struct {
  191. s *Service
  192. }
  193. // GoogleCloudDialogflowV2BatchUpdateEntityTypesResponse: The response
  194. // message for EntityTypes.BatchUpdateEntityTypes.
  195. type GoogleCloudDialogflowV2BatchUpdateEntityTypesResponse struct {
  196. // EntityTypes: The collection of updated or created entity types.
  197. EntityTypes []*GoogleCloudDialogflowV2EntityType `json:"entityTypes,omitempty"`
  198. // ForceSendFields is a list of field names (e.g. "EntityTypes") to
  199. // unconditionally include in API requests. By default, fields with
  200. // empty values are omitted from API requests. However, any non-pointer,
  201. // non-interface field appearing in ForceSendFields will be sent to the
  202. // server regardless of whether the field is empty or not. This may be
  203. // used to include empty fields in Patch requests.
  204. ForceSendFields []string `json:"-"`
  205. // NullFields is a list of field names (e.g. "EntityTypes") to include
  206. // in API requests with the JSON null value. By default, fields with
  207. // empty values are omitted from API requests. However, any field with
  208. // an empty value appearing in NullFields will be sent to the server as
  209. // null. It is an error if a field in this list has a non-empty value.
  210. // This may be used to include null fields in Patch requests.
  211. NullFields []string `json:"-"`
  212. }
  213. func (s *GoogleCloudDialogflowV2BatchUpdateEntityTypesResponse) MarshalJSON() ([]byte, error) {
  214. type NoMethod GoogleCloudDialogflowV2BatchUpdateEntityTypesResponse
  215. raw := NoMethod(*s)
  216. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  217. }
  218. // GoogleCloudDialogflowV2BatchUpdateIntentsResponse: The response
  219. // message for Intents.BatchUpdateIntents.
  220. type GoogleCloudDialogflowV2BatchUpdateIntentsResponse struct {
  221. // Intents: The collection of updated or created intents.
  222. Intents []*GoogleCloudDialogflowV2Intent `json:"intents,omitempty"`
  223. // ForceSendFields is a list of field names (e.g. "Intents") to
  224. // unconditionally include in API requests. By default, fields with
  225. // empty values are omitted from API requests. However, any non-pointer,
  226. // non-interface field appearing in ForceSendFields will be sent to the
  227. // server regardless of whether the field is empty or not. This may be
  228. // used to include empty fields in Patch requests.
  229. ForceSendFields []string `json:"-"`
  230. // NullFields is a list of field names (e.g. "Intents") to include in
  231. // API requests with the JSON null value. By default, fields with empty
  232. // values are omitted from API requests. However, any field with an
  233. // empty value appearing in NullFields will be sent to the server as
  234. // null. It is an error if a field in this list has a non-empty value.
  235. // This may be used to include null fields in Patch requests.
  236. NullFields []string `json:"-"`
  237. }
  238. func (s *GoogleCloudDialogflowV2BatchUpdateIntentsResponse) MarshalJSON() ([]byte, error) {
  239. type NoMethod GoogleCloudDialogflowV2BatchUpdateIntentsResponse
  240. raw := NoMethod(*s)
  241. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  242. }
  243. // GoogleCloudDialogflowV2Context: Represents a context.
  244. type GoogleCloudDialogflowV2Context struct {
  245. // LifespanCount: Optional. The number of conversational query requests
  246. // after which the
  247. // context expires. If set to `0` (the default) the context
  248. // expires
  249. // immediately. Contexts expire automatically after 10 minutes even if
  250. // there
  251. // are no matching queries.
  252. LifespanCount int64 `json:"lifespanCount,omitempty"`
  253. // Name: Required. The unique identifier of the context.
  254. // Format:
  255. // `projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context
  256. // ID>`.
  257. Name string `json:"name,omitempty"`
  258. // Parameters: Optional. The collection of parameters associated with
  259. // this context.
  260. // Refer to [this
  261. // doc](https://dialogflow.com/docs/actions-and-parameters) for
  262. // syntax.
  263. Parameters googleapi.RawMessage `json:"parameters,omitempty"`
  264. // ForceSendFields is a list of field names (e.g. "LifespanCount") to
  265. // unconditionally include in API requests. By default, fields with
  266. // empty values are omitted from API requests. However, any non-pointer,
  267. // non-interface field appearing in ForceSendFields will be sent to the
  268. // server regardless of whether the field is empty or not. This may be
  269. // used to include empty fields in Patch requests.
  270. ForceSendFields []string `json:"-"`
  271. // NullFields is a list of field names (e.g. "LifespanCount") to include
  272. // in API requests with the JSON null value. By default, fields with
  273. // empty values are omitted from API requests. However, any field with
  274. // an empty value appearing in NullFields will be sent to the server as
  275. // null. It is an error if a field in this list has a non-empty value.
  276. // This may be used to include null fields in Patch requests.
  277. NullFields []string `json:"-"`
  278. }
  279. func (s *GoogleCloudDialogflowV2Context) MarshalJSON() ([]byte, error) {
  280. type NoMethod GoogleCloudDialogflowV2Context
  281. raw := NoMethod(*s)
  282. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  283. }
  284. // GoogleCloudDialogflowV2EntityType: Represents an entity type.
  285. // Entity types serve as a tool for extracting parameter values from
  286. // natural
  287. // language queries.
  288. type GoogleCloudDialogflowV2EntityType struct {
  289. // AutoExpansionMode: Optional. Indicates whether the entity type can be
  290. // automatically
  291. // expanded.
  292. //
  293. // Possible values:
  294. // "AUTO_EXPANSION_MODE_UNSPECIFIED" - Auto expansion disabled for the
  295. // entity.
  296. // "AUTO_EXPANSION_MODE_DEFAULT" - Allows an agent to recognize values
  297. // that have not been explicitly
  298. // listed in the entity.
  299. AutoExpansionMode string `json:"autoExpansionMode,omitempty"`
  300. // DisplayName: Required. The name of the entity.
  301. DisplayName string `json:"displayName,omitempty"`
  302. // Entities: Optional. The collection of entities associated with the
  303. // entity type.
  304. Entities []*GoogleCloudDialogflowV2EntityTypeEntity `json:"entities,omitempty"`
  305. // Kind: Required. Indicates the kind of entity type.
  306. //
  307. // Possible values:
  308. // "KIND_UNSPECIFIED" - Not specified. This value should be never
  309. // used.
  310. // "KIND_MAP" - Map entity types allow mapping of a group of synonyms
  311. // to a canonical
  312. // value.
  313. // "KIND_LIST" - List entity types contain a set of entries that do
  314. // not map to canonical
  315. // values. However, list entity types can contain references to other
  316. // entity
  317. // types (with or without aliases).
  318. Kind string `json:"kind,omitempty"`
  319. // Name: Required for all methods except `create` (`create` populates
  320. // the name
  321. // automatically.
  322. // The unique identifier of the entity type. Format:
  323. // `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.
  324. Name string `json:"name,omitempty"`
  325. // ForceSendFields is a list of field names (e.g. "AutoExpansionMode")
  326. // to unconditionally include in API requests. By default, fields with
  327. // empty values are omitted from API requests. However, any non-pointer,
  328. // non-interface field appearing in ForceSendFields will be sent to the
  329. // server regardless of whether the field is empty or not. This may be
  330. // used to include empty fields in Patch requests.
  331. ForceSendFields []string `json:"-"`
  332. // NullFields is a list of field names (e.g. "AutoExpansionMode") to
  333. // include in API requests with the JSON null value. By default, fields
  334. // with empty values are omitted from API requests. However, any field
  335. // with an empty value appearing in NullFields will be sent to the
  336. // server as null. It is an error if a field in this list has a
  337. // non-empty value. This may be used to include null fields in Patch
  338. // requests.
  339. NullFields []string `json:"-"`
  340. }
  341. func (s *GoogleCloudDialogflowV2EntityType) MarshalJSON() ([]byte, error) {
  342. type NoMethod GoogleCloudDialogflowV2EntityType
  343. raw := NoMethod(*s)
  344. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  345. }
  346. // GoogleCloudDialogflowV2EntityTypeEntity: Optional. Represents an
  347. // entity.
  348. type GoogleCloudDialogflowV2EntityTypeEntity struct {
  349. // Synonyms: Required. A collection of synonyms. For `KIND_LIST` entity
  350. // types this
  351. // must contain exactly one synonym equal to `value`.
  352. Synonyms []string `json:"synonyms,omitempty"`
  353. // Value: Required.
  354. // For `KIND_MAP` entity types:
  355. // A canonical name to be used in place of synonyms.
  356. // For `KIND_LIST` entity types:
  357. // A string that can contain references to other entity types (with
  358. // or
  359. // without aliases).
  360. Value string `json:"value,omitempty"`
  361. // ForceSendFields is a list of field names (e.g. "Synonyms") to
  362. // unconditionally include in API requests. By default, fields with
  363. // empty values are omitted from API requests. However, any non-pointer,
  364. // non-interface field appearing in ForceSendFields will be sent to the
  365. // server regardless of whether the field is empty or not. This may be
  366. // used to include empty fields in Patch requests.
  367. ForceSendFields []string `json:"-"`
  368. // NullFields is a list of field names (e.g. "Synonyms") to include in
  369. // API requests with the JSON null value. By default, fields with empty
  370. // values are omitted from API requests. However, any field with an
  371. // empty value appearing in NullFields will be sent to the server as
  372. // null. It is an error if a field in this list has a non-empty value.
  373. // This may be used to include null fields in Patch requests.
  374. NullFields []string `json:"-"`
  375. }
  376. func (s *GoogleCloudDialogflowV2EntityTypeEntity) MarshalJSON() ([]byte, error) {
  377. type NoMethod GoogleCloudDialogflowV2EntityTypeEntity
  378. raw := NoMethod(*s)
  379. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  380. }
  381. // GoogleCloudDialogflowV2EventInput: Events allow for matching intents
  382. // by event name instead of the natural
  383. // language input. For instance, input `<event: { name:
  384. // “welcome_event”,
  385. // parameters: { name: “Sam” } }>` can trigger a personalized
  386. // welcome response.
  387. // The parameter `name` may be used by the agent in the
  388. // response:
  389. // `“Hello #welcome_event.name! What can I do for you today?”`.
  390. type GoogleCloudDialogflowV2EventInput struct {
  391. // LanguageCode: Required. The language of this query. See
  392. // [Language
  393. // Support](https://dialogflow.com/docs/languages) for a list of
  394. // the
  395. // currently supported language codes. Note that queries in the same
  396. // session
  397. // do not necessarily need to specify the same language.
  398. LanguageCode string `json:"languageCode,omitempty"`
  399. // Name: Required. The unique identifier of the event.
  400. Name string `json:"name,omitempty"`
  401. // Parameters: Optional. The collection of parameters associated with
  402. // the event.
  403. Parameters googleapi.RawMessage `json:"parameters,omitempty"`
  404. // ForceSendFields is a list of field names (e.g. "LanguageCode") to
  405. // unconditionally include in API requests. By default, fields with
  406. // empty values are omitted from API requests. However, any non-pointer,
  407. // non-interface field appearing in ForceSendFields will be sent to the
  408. // server regardless of whether the field is empty or not. This may be
  409. // used to include empty fields in Patch requests.
  410. ForceSendFields []string `json:"-"`
  411. // NullFields is a list of field names (e.g. "LanguageCode") to include
  412. // in API requests with the JSON null value. By default, fields with
  413. // empty values are omitted from API requests. However, any field with
  414. // an empty value appearing in NullFields will be sent to the server as
  415. // null. It is an error if a field in this list has a non-empty value.
  416. // This may be used to include null fields in Patch requests.
  417. NullFields []string `json:"-"`
  418. }
  419. func (s *GoogleCloudDialogflowV2EventInput) MarshalJSON() ([]byte, error) {
  420. type NoMethod GoogleCloudDialogflowV2EventInput
  421. raw := NoMethod(*s)
  422. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  423. }
  424. // GoogleCloudDialogflowV2ExportAgentResponse: The response message for
  425. // Agents.ExportAgent.
  426. type GoogleCloudDialogflowV2ExportAgentResponse struct {
  427. // AgentContent: The exported agent.
  428. //
  429. // Example for how to export an agent to a zip file via a command
  430. // line:
  431. //
  432. // curl \
  433. //
  434. // 'https://dialogflow.googleapis.com/v2/projects/<project_name>/agent:ex
  435. // port'\
  436. // -X POST \
  437. // -H 'Authorization: Bearer '$(gcloud auth print-access-token) \
  438. // -H 'Accept: application/json' \
  439. // -H 'Content-Type: application/json' \
  440. // --compressed \
  441. // --data-binary '{}' \
  442. // | grep agentContent | sed -e 's/.*"agentContent": "\([^"]*\)".*/\1/'
  443. // \
  444. // | base64 --decode > <agent zip file>
  445. AgentContent string `json:"agentContent,omitempty"`
  446. // AgentUri: The URI to a file containing the exported agent. This field
  447. // is populated
  448. // only if `agent_uri` is specified in `ExportAgentRequest`.
  449. AgentUri string `json:"agentUri,omitempty"`
  450. // ForceSendFields is a list of field names (e.g. "AgentContent") to
  451. // unconditionally include in API requests. By default, fields with
  452. // empty values are omitted from API requests. However, any non-pointer,
  453. // non-interface field appearing in ForceSendFields will be sent to the
  454. // server regardless of whether the field is empty or not. This may be
  455. // used to include empty fields in Patch requests.
  456. ForceSendFields []string `json:"-"`
  457. // NullFields is a list of field names (e.g. "AgentContent") to include
  458. // in API requests with the JSON null value. By default, fields with
  459. // empty values are omitted from API requests. However, any field with
  460. // an empty value appearing in NullFields will be sent to the server as
  461. // null. It is an error if a field in this list has a non-empty value.
  462. // This may be used to include null fields in Patch requests.
  463. NullFields []string `json:"-"`
  464. }
  465. func (s *GoogleCloudDialogflowV2ExportAgentResponse) MarshalJSON() ([]byte, error) {
  466. type NoMethod GoogleCloudDialogflowV2ExportAgentResponse
  467. raw := NoMethod(*s)
  468. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  469. }
  470. // GoogleCloudDialogflowV2Intent: Represents an intent.
  471. // Intents convert a number of user expressions or patterns into an
  472. // action. An
  473. // action is an extraction of a user command or sentence semantics.
  474. // Next available field number: 22.
  475. type GoogleCloudDialogflowV2Intent struct {
  476. // Action: Optional. The name of the action associated with the intent.
  477. Action string `json:"action,omitempty"`
  478. // DefaultResponsePlatforms: Optional. The list of platforms for which
  479. // the first response will be
  480. // taken from among the messages assigned to the DEFAULT_PLATFORM.
  481. //
  482. // Possible values:
  483. // "PLATFORM_UNSPECIFIED" - Not specified.
  484. // "FACEBOOK" - Facebook.
  485. // "SLACK" - Slack.
  486. // "TELEGRAM" - Telegram.
  487. // "KIK" - Kik.
  488. // "SKYPE" - Skype.
  489. // "LINE" - Line.
  490. // "VIBER" - Viber.
  491. // "ACTIONS_ON_GOOGLE" - Actions on Google.
  492. // When using Actions on Google, you can choose one of the
  493. // specific
  494. // Intent.Message types that mention support for Actions on Google,
  495. // or you can use the advanced Intent.Message.payload field.
  496. // The payload field provides access to AoG features not available in
  497. // the
  498. // specific message types.
  499. // If using the Intent.Message.payload field, it should have a
  500. // structure
  501. // similar to the JSON message shown here. For more information,
  502. // see
  503. // [Actions on Google
  504. // Webhook
  505. // Format](https://developers.google.com/actions/dialogflow/webho
  506. // ok)
  507. // <pre>{
  508. // "expectUserResponse": true,
  509. // "isSsml": false,
  510. // "noInputPrompts": [],
  511. // "richResponse": {
  512. // "items": [
  513. // {
  514. // "simpleResponse": {
  515. // "displayText": "hi",
  516. // "textToSpeech": "hello"
  517. // }
  518. // }
  519. // ],
  520. // "suggestions": [
  521. // {
  522. // "title": "Say this"
  523. // },
  524. // {
  525. // "title": "or this"
  526. // }
  527. // ]
  528. // },
  529. // "systemIntent": {
  530. // "data": {
  531. // "@type":
  532. // "type.googleapis.com/google.actions.v2.OptionValueSpec",
  533. // "listSelect": {
  534. // "items": [
  535. // {
  536. // "optionInfo": {
  537. // "key": "key1",
  538. // "synonyms": [
  539. // "key one"
  540. // ]
  541. // },
  542. // "title": "must not be empty, but unique"
  543. // },
  544. // {
  545. // "optionInfo": {
  546. // "key": "key2",
  547. // "synonyms": [
  548. // "key two"
  549. // ]
  550. // },
  551. // "title": "must not be empty, but unique"
  552. // }
  553. // ]
  554. // }
  555. // },
  556. // "intent": "actions.intent.OPTION"
  557. // }
  558. // }</pre>
  559. DefaultResponsePlatforms []string `json:"defaultResponsePlatforms,omitempty"`
  560. // DisplayName: Required. The name of this intent.
  561. DisplayName string `json:"displayName,omitempty"`
  562. // Events: Optional. The collection of event names that trigger the
  563. // intent.
  564. // If the collection of input contexts is not empty, all of the contexts
  565. // must
  566. // be present in the active user session for an event to trigger this
  567. // intent.
  568. Events []string `json:"events,omitempty"`
  569. // FollowupIntentInfo: Optional. Collection of information about all
  570. // followup intents that have
  571. // name of this intent as a root_name.
  572. FollowupIntentInfo []*GoogleCloudDialogflowV2IntentFollowupIntentInfo `json:"followupIntentInfo,omitempty"`
  573. // InputContextNames: Optional. The list of context names required for
  574. // this intent to be
  575. // triggered.
  576. // Format: `projects/<Project ID>/agent/sessions/-/contexts/<Context
  577. // ID>`.
  578. InputContextNames []string `json:"inputContextNames,omitempty"`
  579. // IsFallback: Optional. Indicates whether this is a fallback intent.
  580. IsFallback bool `json:"isFallback,omitempty"`
  581. // Messages: Optional. The collection of rich messages corresponding to
  582. // the
  583. // `Response` field in the Dialogflow console.
  584. Messages []*GoogleCloudDialogflowV2IntentMessage `json:"messages,omitempty"`
  585. // MlDisabled: Optional. Indicates whether Machine Learning is disabled
  586. // for the intent.
  587. // Note: If `ml_diabled` setting is set to true, then this intent is
  588. // not
  589. // taken into account during inference in `ML ONLY` match mode.
  590. // Also,
  591. // auto-markup in the UI is turned off.
  592. MlDisabled bool `json:"mlDisabled,omitempty"`
  593. // Name: Required for all methods except `create` (`create` populates
  594. // the name
  595. // automatically.
  596. // The unique identifier of this intent.
  597. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  598. Name string `json:"name,omitempty"`
  599. // OutputContexts: Optional. The collection of contexts that are
  600. // activated when the intent
  601. // is matched. Context messages in this collection should not set
  602. // the
  603. // parameters field. Setting the `lifespan_count` to 0 will reset the
  604. // context
  605. // when the intent is matched.
  606. // Format: `projects/<Project ID>/agent/sessions/-/contexts/<Context
  607. // ID>`.
  608. OutputContexts []*GoogleCloudDialogflowV2Context `json:"outputContexts,omitempty"`
  609. // Parameters: Optional. The collection of parameters associated with
  610. // the intent.
  611. Parameters []*GoogleCloudDialogflowV2IntentParameter `json:"parameters,omitempty"`
  612. // ParentFollowupIntentName: The unique identifier of the parent intent
  613. // in the chain of followup
  614. // intents.
  615. // It identifies the parent followup intent.
  616. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  617. ParentFollowupIntentName string `json:"parentFollowupIntentName,omitempty"`
  618. // Priority: Optional. The priority of this intent. Higher numbers
  619. // represent higher
  620. // priorities. Zero or negative numbers mean that the intent is
  621. // disabled.
  622. Priority int64 `json:"priority,omitempty"`
  623. // ResetContexts: Optional. Indicates whether to delete all contexts in
  624. // the current
  625. // session when this intent is matched.
  626. ResetContexts bool `json:"resetContexts,omitempty"`
  627. // RootFollowupIntentName: The unique identifier of the root intent in
  628. // the chain of followup intents.
  629. // It identifies the correct followup intents chain for this
  630. // intent.
  631. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  632. RootFollowupIntentName string `json:"rootFollowupIntentName,omitempty"`
  633. // TrainingPhrases: Optional. The collection of examples/templates that
  634. // the agent is
  635. // trained on.
  636. TrainingPhrases []*GoogleCloudDialogflowV2IntentTrainingPhrase `json:"trainingPhrases,omitempty"`
  637. // WebhookState: Required. Indicates whether webhooks are enabled for
  638. // the intent.
  639. //
  640. // Possible values:
  641. // "WEBHOOK_STATE_UNSPECIFIED" - Webhook is disabled in the agent and
  642. // in the intent.
  643. // "WEBHOOK_STATE_ENABLED" - Webhook is enabled in the agent and in
  644. // the intent.
  645. // "WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING" - Webhook is enabled in
  646. // the agent and in the intent. Also, each slot
  647. // filling prompt is forwarded to the webhook.
  648. WebhookState string `json:"webhookState,omitempty"`
  649. // ForceSendFields is a list of field names (e.g. "Action") to
  650. // unconditionally include in API requests. By default, fields with
  651. // empty values are omitted from API requests. However, any non-pointer,
  652. // non-interface field appearing in ForceSendFields will be sent to the
  653. // server regardless of whether the field is empty or not. This may be
  654. // used to include empty fields in Patch requests.
  655. ForceSendFields []string `json:"-"`
  656. // NullFields is a list of field names (e.g. "Action") to include in API
  657. // requests with the JSON null value. By default, fields with empty
  658. // values are omitted from API requests. However, any field with an
  659. // empty value appearing in NullFields will be sent to the server as
  660. // null. It is an error if a field in this list has a non-empty value.
  661. // This may be used to include null fields in Patch requests.
  662. NullFields []string `json:"-"`
  663. }
  664. func (s *GoogleCloudDialogflowV2Intent) MarshalJSON() ([]byte, error) {
  665. type NoMethod GoogleCloudDialogflowV2Intent
  666. raw := NoMethod(*s)
  667. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  668. }
  669. // GoogleCloudDialogflowV2IntentFollowupIntentInfo: Represents a single
  670. // followup intent in the chain.
  671. type GoogleCloudDialogflowV2IntentFollowupIntentInfo struct {
  672. // FollowupIntentName: The unique identifier of the followup
  673. // intent.
  674. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  675. FollowupIntentName string `json:"followupIntentName,omitempty"`
  676. // ParentFollowupIntentName: The unique identifier of the followup
  677. // intent parent.
  678. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  679. ParentFollowupIntentName string `json:"parentFollowupIntentName,omitempty"`
  680. // ForceSendFields is a list of field names (e.g. "FollowupIntentName")
  681. // to unconditionally include in API requests. By default, fields with
  682. // empty values are omitted from API requests. However, any non-pointer,
  683. // non-interface field appearing in ForceSendFields will be sent to the
  684. // server regardless of whether the field is empty or not. This may be
  685. // used to include empty fields in Patch requests.
  686. ForceSendFields []string `json:"-"`
  687. // NullFields is a list of field names (e.g. "FollowupIntentName") to
  688. // include in API requests with the JSON null value. By default, fields
  689. // with empty values are omitted from API requests. However, any field
  690. // with an empty value appearing in NullFields will be sent to the
  691. // server as null. It is an error if a field in this list has a
  692. // non-empty value. This may be used to include null fields in Patch
  693. // requests.
  694. NullFields []string `json:"-"`
  695. }
  696. func (s *GoogleCloudDialogflowV2IntentFollowupIntentInfo) MarshalJSON() ([]byte, error) {
  697. type NoMethod GoogleCloudDialogflowV2IntentFollowupIntentInfo
  698. raw := NoMethod(*s)
  699. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  700. }
  701. // GoogleCloudDialogflowV2IntentMessage: Corresponds to the `Response`
  702. // field in the Dialogflow console.
  703. type GoogleCloudDialogflowV2IntentMessage struct {
  704. // BasicCard: The basic card response for Actions on Google.
  705. BasicCard *GoogleCloudDialogflowV2IntentMessageBasicCard `json:"basicCard,omitempty"`
  706. // Card: The card response.
  707. Card *GoogleCloudDialogflowV2IntentMessageCard `json:"card,omitempty"`
  708. // CarouselSelect: The carousel card response for Actions on Google.
  709. CarouselSelect *GoogleCloudDialogflowV2IntentMessageCarouselSelect `json:"carouselSelect,omitempty"`
  710. // Image: The image response.
  711. Image *GoogleCloudDialogflowV2IntentMessageImage `json:"image,omitempty"`
  712. // LinkOutSuggestion: The link out suggestion chip for Actions on
  713. // Google.
  714. LinkOutSuggestion *GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion `json:"linkOutSuggestion,omitempty"`
  715. // ListSelect: The list card response for Actions on Google.
  716. ListSelect *GoogleCloudDialogflowV2IntentMessageListSelect `json:"listSelect,omitempty"`
  717. // Payload: Returns a response containing a custom, platform-specific
  718. // payload.
  719. // See the Intent.Message.Platform type for a description of
  720. // the
  721. // structure that may be required for your platform.
  722. Payload googleapi.RawMessage `json:"payload,omitempty"`
  723. // Platform: Optional. The platform that this message is intended for.
  724. //
  725. // Possible values:
  726. // "PLATFORM_UNSPECIFIED" - Not specified.
  727. // "FACEBOOK" - Facebook.
  728. // "SLACK" - Slack.
  729. // "TELEGRAM" - Telegram.
  730. // "KIK" - Kik.
  731. // "SKYPE" - Skype.
  732. // "LINE" - Line.
  733. // "VIBER" - Viber.
  734. // "ACTIONS_ON_GOOGLE" - Actions on Google.
  735. // When using Actions on Google, you can choose one of the
  736. // specific
  737. // Intent.Message types that mention support for Actions on Google,
  738. // or you can use the advanced Intent.Message.payload field.
  739. // The payload field provides access to AoG features not available in
  740. // the
  741. // specific message types.
  742. // If using the Intent.Message.payload field, it should have a
  743. // structure
  744. // similar to the JSON message shown here. For more information,
  745. // see
  746. // [Actions on Google
  747. // Webhook
  748. // Format](https://developers.google.com/actions/dialogflow/webho
  749. // ok)
  750. // <pre>{
  751. // "expectUserResponse": true,
  752. // "isSsml": false,
  753. // "noInputPrompts": [],
  754. // "richResponse": {
  755. // "items": [
  756. // {
  757. // "simpleResponse": {
  758. // "displayText": "hi",
  759. // "textToSpeech": "hello"
  760. // }
  761. // }
  762. // ],
  763. // "suggestions": [
  764. // {
  765. // "title": "Say this"
  766. // },
  767. // {
  768. // "title": "or this"
  769. // }
  770. // ]
  771. // },
  772. // "systemIntent": {
  773. // "data": {
  774. // "@type":
  775. // "type.googleapis.com/google.actions.v2.OptionValueSpec",
  776. // "listSelect": {
  777. // "items": [
  778. // {
  779. // "optionInfo": {
  780. // "key": "key1",
  781. // "synonyms": [
  782. // "key one"
  783. // ]
  784. // },
  785. // "title": "must not be empty, but unique"
  786. // },
  787. // {
  788. // "optionInfo": {
  789. // "key": "key2",
  790. // "synonyms": [
  791. // "key two"
  792. // ]
  793. // },
  794. // "title": "must not be empty, but unique"
  795. // }
  796. // ]
  797. // }
  798. // },
  799. // "intent": "actions.intent.OPTION"
  800. // }
  801. // }</pre>
  802. Platform string `json:"platform,omitempty"`
  803. // QuickReplies: The quick replies response.
  804. QuickReplies *GoogleCloudDialogflowV2IntentMessageQuickReplies `json:"quickReplies,omitempty"`
  805. // SimpleResponses: The voice and text-only responses for Actions on
  806. // Google.
  807. SimpleResponses *GoogleCloudDialogflowV2IntentMessageSimpleResponses `json:"simpleResponses,omitempty"`
  808. // Suggestions: The suggestion chips for Actions on Google.
  809. Suggestions *GoogleCloudDialogflowV2IntentMessageSuggestions `json:"suggestions,omitempty"`
  810. // Text: The text response.
  811. Text *GoogleCloudDialogflowV2IntentMessageText `json:"text,omitempty"`
  812. // ForceSendFields is a list of field names (e.g. "BasicCard") to
  813. // unconditionally include in API requests. By default, fields with
  814. // empty values are omitted from API requests. However, any non-pointer,
  815. // non-interface field appearing in ForceSendFields will be sent to the
  816. // server regardless of whether the field is empty or not. This may be
  817. // used to include empty fields in Patch requests.
  818. ForceSendFields []string `json:"-"`
  819. // NullFields is a list of field names (e.g. "BasicCard") to include in
  820. // API requests with the JSON null value. By default, fields with empty
  821. // values are omitted from API requests. However, any field with an
  822. // empty value appearing in NullFields will be sent to the server as
  823. // null. It is an error if a field in this list has a non-empty value.
  824. // This may be used to include null fields in Patch requests.
  825. NullFields []string `json:"-"`
  826. }
  827. func (s *GoogleCloudDialogflowV2IntentMessage) MarshalJSON() ([]byte, error) {
  828. type NoMethod GoogleCloudDialogflowV2IntentMessage
  829. raw := NoMethod(*s)
  830. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  831. }
  832. // GoogleCloudDialogflowV2IntentMessageBasicCard: The basic card
  833. // message. Useful for displaying information.
  834. type GoogleCloudDialogflowV2IntentMessageBasicCard struct {
  835. // Buttons: Optional. The collection of card buttons.
  836. Buttons []*GoogleCloudDialogflowV2IntentMessageBasicCardButton `json:"buttons,omitempty"`
  837. // FormattedText: Required, unless image is present. The body text of
  838. // the card.
  839. FormattedText string `json:"formattedText,omitempty"`
  840. // Image: Optional. The image for the card.
  841. Image *GoogleCloudDialogflowV2IntentMessageImage `json:"image,omitempty"`
  842. // Subtitle: Optional. The subtitle of the card.
  843. Subtitle string `json:"subtitle,omitempty"`
  844. // Title: Optional. The title of the card.
  845. Title string `json:"title,omitempty"`
  846. // ForceSendFields is a list of field names (e.g. "Buttons") to
  847. // unconditionally include in API requests. By default, fields with
  848. // empty values are omitted from API requests. However, any non-pointer,
  849. // non-interface field appearing in ForceSendFields will be sent to the
  850. // server regardless of whether the field is empty or not. This may be
  851. // used to include empty fields in Patch requests.
  852. ForceSendFields []string `json:"-"`
  853. // NullFields is a list of field names (e.g. "Buttons") to include in
  854. // API requests with the JSON null value. By default, fields with empty
  855. // values are omitted from API requests. However, any field with an
  856. // empty value appearing in NullFields will be sent to the server as
  857. // null. It is an error if a field in this list has a non-empty value.
  858. // This may be used to include null fields in Patch requests.
  859. NullFields []string `json:"-"`
  860. }
  861. func (s *GoogleCloudDialogflowV2IntentMessageBasicCard) MarshalJSON() ([]byte, error) {
  862. type NoMethod GoogleCloudDialogflowV2IntentMessageBasicCard
  863. raw := NoMethod(*s)
  864. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  865. }
  866. // GoogleCloudDialogflowV2IntentMessageBasicCardButton: The button
  867. // object that appears at the bottom of a card.
  868. type GoogleCloudDialogflowV2IntentMessageBasicCardButton struct {
  869. // OpenUriAction: Required. Action to take when a user taps on the
  870. // button.
  871. OpenUriAction *GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction `json:"openUriAction,omitempty"`
  872. // Title: Required. The title of the button.
  873. Title string `json:"title,omitempty"`
  874. // ForceSendFields is a list of field names (e.g. "OpenUriAction") to
  875. // unconditionally include in API requests. By default, fields with
  876. // empty values are omitted from API requests. However, any non-pointer,
  877. // non-interface field appearing in ForceSendFields will be sent to the
  878. // server regardless of whether the field is empty or not. This may be
  879. // used to include empty fields in Patch requests.
  880. ForceSendFields []string `json:"-"`
  881. // NullFields is a list of field names (e.g. "OpenUriAction") to include
  882. // in API requests with the JSON null value. By default, fields with
  883. // empty values are omitted from API requests. However, any field with
  884. // an empty value appearing in NullFields will be sent to the server as
  885. // null. It is an error if a field in this list has a non-empty value.
  886. // This may be used to include null fields in Patch requests.
  887. NullFields []string `json:"-"`
  888. }
  889. func (s *GoogleCloudDialogflowV2IntentMessageBasicCardButton) MarshalJSON() ([]byte, error) {
  890. type NoMethod GoogleCloudDialogflowV2IntentMessageBasicCardButton
  891. raw := NoMethod(*s)
  892. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  893. }
  894. // GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction:
  895. // Opens the given URI.
  896. type GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction struct {
  897. // Uri: Required. The HTTP or HTTPS scheme URI.
  898. Uri string `json:"uri,omitempty"`
  899. // ForceSendFields is a list of field names (e.g. "Uri") to
  900. // unconditionally include in API requests. By default, fields with
  901. // empty values are omitted from API requests. However, any non-pointer,
  902. // non-interface field appearing in ForceSendFields will be sent to the
  903. // server regardless of whether the field is empty or not. This may be
  904. // used to include empty fields in Patch requests.
  905. ForceSendFields []string `json:"-"`
  906. // NullFields is a list of field names (e.g. "Uri") to include in API
  907. // requests with the JSON null value. By default, fields with empty
  908. // values are omitted from API requests. However, any field with an
  909. // empty value appearing in NullFields will be sent to the server as
  910. // null. It is an error if a field in this list has a non-empty value.
  911. // This may be used to include null fields in Patch requests.
  912. NullFields []string `json:"-"`
  913. }
  914. func (s *GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction) MarshalJSON() ([]byte, error) {
  915. type NoMethod GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction
  916. raw := NoMethod(*s)
  917. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  918. }
  919. // GoogleCloudDialogflowV2IntentMessageCard: The card response message.
  920. type GoogleCloudDialogflowV2IntentMessageCard struct {
  921. // Buttons: Optional. The collection of card buttons.
  922. Buttons []*GoogleCloudDialogflowV2IntentMessageCardButton `json:"buttons,omitempty"`
  923. // ImageUri: Optional. The public URI to an image file for the card.
  924. ImageUri string `json:"imageUri,omitempty"`
  925. // Subtitle: Optional. The subtitle of the card.
  926. Subtitle string `json:"subtitle,omitempty"`
  927. // Title: Optional. The title of the card.
  928. Title string `json:"title,omitempty"`
  929. // ForceSendFields is a list of field names (e.g. "Buttons") to
  930. // unconditionally include in API requests. By default, fields with
  931. // empty values are omitted from API requests. However, any non-pointer,
  932. // non-interface field appearing in ForceSendFields will be sent to the
  933. // server regardless of whether the field is empty or not. This may be
  934. // used to include empty fields in Patch requests.
  935. ForceSendFields []string `json:"-"`
  936. // NullFields is a list of field names (e.g. "Buttons") to include in
  937. // API requests with the JSON null value. By default, fields with empty
  938. // values are omitted from API requests. However, any field with an
  939. // empty value appearing in NullFields will be sent to the server as
  940. // null. It is an error if a field in this list has a non-empty value.
  941. // This may be used to include null fields in Patch requests.
  942. NullFields []string `json:"-"`
  943. }
  944. func (s *GoogleCloudDialogflowV2IntentMessageCard) MarshalJSON() ([]byte, error) {
  945. type NoMethod GoogleCloudDialogflowV2IntentMessageCard
  946. raw := NoMethod(*s)
  947. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  948. }
  949. // GoogleCloudDialogflowV2IntentMessageCardButton: Optional. Contains
  950. // information about a button.
  951. type GoogleCloudDialogflowV2IntentMessageCardButton struct {
  952. // Postback: Optional. The text to send back to the Dialogflow API or a
  953. // URI to
  954. // open.
  955. Postback string `json:"postback,omitempty"`
  956. // Text: Optional. The text to show on the button.
  957. Text string `json:"text,omitempty"`
  958. // ForceSendFields is a list of field names (e.g. "Postback") to
  959. // unconditionally include in API requests. By default, fields with
  960. // empty values are omitted from API requests. However, any non-pointer,
  961. // non-interface field appearing in ForceSendFields will be sent to the
  962. // server regardless of whether the field is empty or not. This may be
  963. // used to include empty fields in Patch requests.
  964. ForceSendFields []string `json:"-"`
  965. // NullFields is a list of field names (e.g. "Postback") to include in
  966. // API requests with the JSON null value. By default, fields with empty
  967. // values are omitted from API requests. However, any field with an
  968. // empty value appearing in NullFields will be sent to the server as
  969. // null. It is an error if a field in this list has a non-empty value.
  970. // This may be used to include null fields in Patch requests.
  971. NullFields []string `json:"-"`
  972. }
  973. func (s *GoogleCloudDialogflowV2IntentMessageCardButton) MarshalJSON() ([]byte, error) {
  974. type NoMethod GoogleCloudDialogflowV2IntentMessageCardButton
  975. raw := NoMethod(*s)
  976. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  977. }
  978. // GoogleCloudDialogflowV2IntentMessageCarouselSelect: The card for
  979. // presenting a carousel of options to select from.
  980. type GoogleCloudDialogflowV2IntentMessageCarouselSelect struct {
  981. // Items: Required. Carousel items.
  982. Items []*GoogleCloudDialogflowV2IntentMessageCarouselSelectItem `json:"items,omitempty"`
  983. // ForceSendFields is a list of field names (e.g. "Items") to
  984. // unconditionally include in API requests. By default, fields with
  985. // empty values are omitted from API requests. However, any non-pointer,
  986. // non-interface field appearing in ForceSendFields will be sent to the
  987. // server regardless of whether the field is empty or not. This may be
  988. // used to include empty fields in Patch requests.
  989. ForceSendFields []string `json:"-"`
  990. // NullFields is a list of field names (e.g. "Items") to include in API
  991. // requests with the JSON null value. By default, fields with empty
  992. // values are omitted from API requests. However, any field with an
  993. // empty value appearing in NullFields will be sent to the server as
  994. // null. It is an error if a field in this list has a non-empty value.
  995. // This may be used to include null fields in Patch requests.
  996. NullFields []string `json:"-"`
  997. }
  998. func (s *GoogleCloudDialogflowV2IntentMessageCarouselSelect) MarshalJSON() ([]byte, error) {
  999. type NoMethod GoogleCloudDialogflowV2IntentMessageCarouselSelect
  1000. raw := NoMethod(*s)
  1001. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1002. }
  1003. // GoogleCloudDialogflowV2IntentMessageCarouselSelectItem: An item in
  1004. // the carousel.
  1005. type GoogleCloudDialogflowV2IntentMessageCarouselSelectItem struct {
  1006. // Description: Optional. The body text of the card.
  1007. Description string `json:"description,omitempty"`
  1008. // Image: Optional. The image to display.
  1009. Image *GoogleCloudDialogflowV2IntentMessageImage `json:"image,omitempty"`
  1010. // Info: Required. Additional info about the option item.
  1011. Info *GoogleCloudDialogflowV2IntentMessageSelectItemInfo `json:"info,omitempty"`
  1012. // Title: Required. Title of the carousel item.
  1013. Title string `json:"title,omitempty"`
  1014. // ForceSendFields is a list of field names (e.g. "Description") to
  1015. // unconditionally include in API requests. By default, fields with
  1016. // empty values are omitted from API requests. However, any non-pointer,
  1017. // non-interface field appearing in ForceSendFields will be sent to the
  1018. // server regardless of whether the field is empty or not. This may be
  1019. // used to include empty fields in Patch requests.
  1020. ForceSendFields []string `json:"-"`
  1021. // NullFields is a list of field names (e.g. "Description") to include
  1022. // in API requests with the JSON null value. By default, fields with
  1023. // empty values are omitted from API requests. However, any field with
  1024. // an empty value appearing in NullFields will be sent to the server as
  1025. // null. It is an error if a field in this list has a non-empty value.
  1026. // This may be used to include null fields in Patch requests.
  1027. NullFields []string `json:"-"`
  1028. }
  1029. func (s *GoogleCloudDialogflowV2IntentMessageCarouselSelectItem) MarshalJSON() ([]byte, error) {
  1030. type NoMethod GoogleCloudDialogflowV2IntentMessageCarouselSelectItem
  1031. raw := NoMethod(*s)
  1032. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1033. }
  1034. // GoogleCloudDialogflowV2IntentMessageImage: The image response
  1035. // message.
  1036. type GoogleCloudDialogflowV2IntentMessageImage struct {
  1037. // AccessibilityText: Optional. A text description of the image to be
  1038. // used for accessibility,
  1039. // e.g., screen readers.
  1040. AccessibilityText string `json:"accessibilityText,omitempty"`
  1041. // ImageUri: Optional. The public URI to an image file.
  1042. ImageUri string `json:"imageUri,omitempty"`
  1043. // ForceSendFields is a list of field names (e.g. "AccessibilityText")
  1044. // to unconditionally include in API requests. By default, fields with
  1045. // empty values are omitted from API requests. However, any non-pointer,
  1046. // non-interface field appearing in ForceSendFields will be sent to the
  1047. // server regardless of whether the field is empty or not. This may be
  1048. // used to include empty fields in Patch requests.
  1049. ForceSendFields []string `json:"-"`
  1050. // NullFields is a list of field names (e.g. "AccessibilityText") to
  1051. // include in API requests with the JSON null value. By default, fields
  1052. // with empty values are omitted from API requests. However, any field
  1053. // with an empty value appearing in NullFields will be sent to the
  1054. // server as null. It is an error if a field in this list has a
  1055. // non-empty value. This may be used to include null fields in Patch
  1056. // requests.
  1057. NullFields []string `json:"-"`
  1058. }
  1059. func (s *GoogleCloudDialogflowV2IntentMessageImage) MarshalJSON() ([]byte, error) {
  1060. type NoMethod GoogleCloudDialogflowV2IntentMessageImage
  1061. raw := NoMethod(*s)
  1062. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1063. }
  1064. // GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion: The suggestion
  1065. // chip message that allows the user to jump out to the app
  1066. // or website associated with this agent.
  1067. type GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion struct {
  1068. // DestinationName: Required. The name of the app or site this chip is
  1069. // linking to.
  1070. DestinationName string `json:"destinationName,omitempty"`
  1071. // Uri: Required. The URI of the app or site to open when the user taps
  1072. // the
  1073. // suggestion chip.
  1074. Uri string `json:"uri,omitempty"`
  1075. // ForceSendFields is a list of field names (e.g. "DestinationName") to
  1076. // unconditionally include in API requests. By default, fields with
  1077. // empty values are omitted from API requests. However, any non-pointer,
  1078. // non-interface field appearing in ForceSendFields will be sent to the
  1079. // server regardless of whether the field is empty or not. This may be
  1080. // used to include empty fields in Patch requests.
  1081. ForceSendFields []string `json:"-"`
  1082. // NullFields is a list of field names (e.g. "DestinationName") to
  1083. // include in API requests with the JSON null value. By default, fields
  1084. // with empty values are omitted from API requests. However, any field
  1085. // with an empty value appearing in NullFields will be sent to the
  1086. // server as null. It is an error if a field in this list has a
  1087. // non-empty value. This may be used to include null fields in Patch
  1088. // requests.
  1089. NullFields []string `json:"-"`
  1090. }
  1091. func (s *GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion) MarshalJSON() ([]byte, error) {
  1092. type NoMethod GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion
  1093. raw := NoMethod(*s)
  1094. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1095. }
  1096. // GoogleCloudDialogflowV2IntentMessageListSelect: The card for
  1097. // presenting a list of options to select from.
  1098. type GoogleCloudDialogflowV2IntentMessageListSelect struct {
  1099. // Items: Required. List items.
  1100. Items []*GoogleCloudDialogflowV2IntentMessageListSelectItem `json:"items,omitempty"`
  1101. // Title: Optional. The overall title of the list.
  1102. Title string `json:"title,omitempty"`
  1103. // ForceSendFields is a list of field names (e.g. "Items") to
  1104. // unconditionally include in API requests. By default, fields with
  1105. // empty values are omitted from API requests. However, any non-pointer,
  1106. // non-interface field appearing in ForceSendFields will be sent to the
  1107. // server regardless of whether the field is empty or not. This may be
  1108. // used to include empty fields in Patch requests.
  1109. ForceSendFields []string `json:"-"`
  1110. // NullFields is a list of field names (e.g. "Items") to include in API
  1111. // requests with the JSON null value. By default, fields with empty
  1112. // values are omitted from API requests. However, any field with an
  1113. // empty value appearing in NullFields will be sent to the server as
  1114. // null. It is an error if a field in this list has a non-empty value.
  1115. // This may be used to include null fields in Patch requests.
  1116. NullFields []string `json:"-"`
  1117. }
  1118. func (s *GoogleCloudDialogflowV2IntentMessageListSelect) MarshalJSON() ([]byte, error) {
  1119. type NoMethod GoogleCloudDialogflowV2IntentMessageListSelect
  1120. raw := NoMethod(*s)
  1121. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1122. }
  1123. // GoogleCloudDialogflowV2IntentMessageListSelectItem: An item in the
  1124. // list.
  1125. type GoogleCloudDialogflowV2IntentMessageListSelectItem struct {
  1126. // Description: Optional. The main text describing the item.
  1127. Description string `json:"description,omitempty"`
  1128. // Image: Optional. The image to display.
  1129. Image *GoogleCloudDialogflowV2IntentMessageImage `json:"image,omitempty"`
  1130. // Info: Required. Additional information about this option.
  1131. Info *GoogleCloudDialogflowV2IntentMessageSelectItemInfo `json:"info,omitempty"`
  1132. // Title: Required. The title of the list item.
  1133. Title string `json:"title,omitempty"`
  1134. // ForceSendFields is a list of field names (e.g. "Description") to
  1135. // unconditionally include in API requests. By default, fields with
  1136. // empty values are omitted from API requests. However, any non-pointer,
  1137. // non-interface field appearing in ForceSendFields will be sent to the
  1138. // server regardless of whether the field is empty or not. This may be
  1139. // used to include empty fields in Patch requests.
  1140. ForceSendFields []string `json:"-"`
  1141. // NullFields is a list of field names (e.g. "Description") to include
  1142. // in API requests with the JSON null value. By default, fields with
  1143. // empty values are omitted from API requests. However, any field with
  1144. // an empty value appearing in NullFields will be sent to the server as
  1145. // null. It is an error if a field in this list has a non-empty value.
  1146. // This may be used to include null fields in Patch requests.
  1147. NullFields []string `json:"-"`
  1148. }
  1149. func (s *GoogleCloudDialogflowV2IntentMessageListSelectItem) MarshalJSON() ([]byte, error) {
  1150. type NoMethod GoogleCloudDialogflowV2IntentMessageListSelectItem
  1151. raw := NoMethod(*s)
  1152. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1153. }
  1154. // GoogleCloudDialogflowV2IntentMessageQuickReplies: The quick replies
  1155. // response message.
  1156. type GoogleCloudDialogflowV2IntentMessageQuickReplies struct {
  1157. // QuickReplies: Optional. The collection of quick replies.
  1158. QuickReplies []string `json:"quickReplies,omitempty"`
  1159. // Title: Optional. The title of the collection of quick replies.
  1160. Title string `json:"title,omitempty"`
  1161. // ForceSendFields is a list of field names (e.g. "QuickReplies") to
  1162. // unconditionally include in API requests. By default, fields with
  1163. // empty values are omitted from API requests. However, any non-pointer,
  1164. // non-interface field appearing in ForceSendFields will be sent to the
  1165. // server regardless of whether the field is empty or not. This may be
  1166. // used to include empty fields in Patch requests.
  1167. ForceSendFields []string `json:"-"`
  1168. // NullFields is a list of field names (e.g. "QuickReplies") to include
  1169. // in API requests with the JSON null value. By default, fields with
  1170. // empty values are omitted from API requests. However, any field with
  1171. // an empty value appearing in NullFields will be sent to the server as
  1172. // null. It is an error if a field in this list has a non-empty value.
  1173. // This may be used to include null fields in Patch requests.
  1174. NullFields []string `json:"-"`
  1175. }
  1176. func (s *GoogleCloudDialogflowV2IntentMessageQuickReplies) MarshalJSON() ([]byte, error) {
  1177. type NoMethod GoogleCloudDialogflowV2IntentMessageQuickReplies
  1178. raw := NoMethod(*s)
  1179. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1180. }
  1181. // GoogleCloudDialogflowV2IntentMessageSelectItemInfo: Additional info
  1182. // about the select item for when it is triggered in a
  1183. // dialog.
  1184. type GoogleCloudDialogflowV2IntentMessageSelectItemInfo struct {
  1185. // Key: Required. A unique key that will be sent back to the agent if
  1186. // this
  1187. // response is given.
  1188. Key string `json:"key,omitempty"`
  1189. // Synonyms: Optional. A list of synonyms that can also be used to
  1190. // trigger this
  1191. // item in dialog.
  1192. Synonyms []string `json:"synonyms,omitempty"`
  1193. // ForceSendFields is a list of field names (e.g. "Key") to
  1194. // unconditionally include in API requests. By default, fields with
  1195. // empty values are omitted from API requests. However, any non-pointer,
  1196. // non-interface field appearing in ForceSendFields will be sent to the
  1197. // server regardless of whether the field is empty or not. This may be
  1198. // used to include empty fields in Patch requests.
  1199. ForceSendFields []string `json:"-"`
  1200. // NullFields is a list of field names (e.g. "Key") to include in API
  1201. // requests with the JSON null value. By default, fields with empty
  1202. // values are omitted from API requests. However, any field with an
  1203. // empty value appearing in NullFields will be sent to the server as
  1204. // null. It is an error if a field in this list has a non-empty value.
  1205. // This may be used to include null fields in Patch requests.
  1206. NullFields []string `json:"-"`
  1207. }
  1208. func (s *GoogleCloudDialogflowV2IntentMessageSelectItemInfo) MarshalJSON() ([]byte, error) {
  1209. type NoMethod GoogleCloudDialogflowV2IntentMessageSelectItemInfo
  1210. raw := NoMethod(*s)
  1211. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1212. }
  1213. // GoogleCloudDialogflowV2IntentMessageSimpleResponse: The simple
  1214. // response message containing speech or text.
  1215. type GoogleCloudDialogflowV2IntentMessageSimpleResponse struct {
  1216. // DisplayText: Optional. The text to display.
  1217. DisplayText string `json:"displayText,omitempty"`
  1218. // Ssml: One of text_to_speech or ssml must be provided. Structured
  1219. // spoken
  1220. // response to the user in the SSML format. Mutually exclusive
  1221. // with
  1222. // text_to_speech.
  1223. Ssml string `json:"ssml,omitempty"`
  1224. // TextToSpeech: One of text_to_speech or ssml must be provided. The
  1225. // plain text of the
  1226. // speech output. Mutually exclusive with ssml.
  1227. TextToSpeech string `json:"textToSpeech,omitempty"`
  1228. // ForceSendFields is a list of field names (e.g. "DisplayText") to
  1229. // unconditionally include in API requests. By default, fields with
  1230. // empty values are omitted from API requests. However, any non-pointer,
  1231. // non-interface field appearing in ForceSendFields will be sent to the
  1232. // server regardless of whether the field is empty or not. This may be
  1233. // used to include empty fields in Patch requests.
  1234. ForceSendFields []string `json:"-"`
  1235. // NullFields is a list of field names (e.g. "DisplayText") to include
  1236. // in API requests with the JSON null value. By default, fields with
  1237. // empty values are omitted from API requests. However, any field with
  1238. // an empty value appearing in NullFields will be sent to the server as
  1239. // null. It is an error if a field in this list has a non-empty value.
  1240. // This may be used to include null fields in Patch requests.
  1241. NullFields []string `json:"-"`
  1242. }
  1243. func (s *GoogleCloudDialogflowV2IntentMessageSimpleResponse) MarshalJSON() ([]byte, error) {
  1244. type NoMethod GoogleCloudDialogflowV2IntentMessageSimpleResponse
  1245. raw := NoMethod(*s)
  1246. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1247. }
  1248. // GoogleCloudDialogflowV2IntentMessageSimpleResponses: The collection
  1249. // of simple response candidates.
  1250. // This message in `QueryResult.fulfillment_messages`
  1251. // and
  1252. // `WebhookResponse.fulfillment_messages` should contain only
  1253. // one
  1254. // `SimpleResponse`.
  1255. type GoogleCloudDialogflowV2IntentMessageSimpleResponses struct {
  1256. // SimpleResponses: Required. The list of simple responses.
  1257. SimpleResponses []*GoogleCloudDialogflowV2IntentMessageSimpleResponse `json:"simpleResponses,omitempty"`
  1258. // ForceSendFields is a list of field names (e.g. "SimpleResponses") to
  1259. // unconditionally include in API requests. By default, fields with
  1260. // empty values are omitted from API requests. However, any non-pointer,
  1261. // non-interface field appearing in ForceSendFields will be sent to the
  1262. // server regardless of whether the field is empty or not. This may be
  1263. // used to include empty fields in Patch requests.
  1264. ForceSendFields []string `json:"-"`
  1265. // NullFields is a list of field names (e.g. "SimpleResponses") to
  1266. // include in API requests with the JSON null value. By default, fields
  1267. // with empty values are omitted from API requests. However, any field
  1268. // with an empty value appearing in NullFields will be sent to the
  1269. // server as null. It is an error if a field in this list has a
  1270. // non-empty value. This may be used to include null fields in Patch
  1271. // requests.
  1272. NullFields []string `json:"-"`
  1273. }
  1274. func (s *GoogleCloudDialogflowV2IntentMessageSimpleResponses) MarshalJSON() ([]byte, error) {
  1275. type NoMethod GoogleCloudDialogflowV2IntentMessageSimpleResponses
  1276. raw := NoMethod(*s)
  1277. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1278. }
  1279. // GoogleCloudDialogflowV2IntentMessageSuggestion: The suggestion chip
  1280. // message that the user can tap to quickly post a reply
  1281. // to the conversation.
  1282. type GoogleCloudDialogflowV2IntentMessageSuggestion struct {
  1283. // Title: Required. The text shown the in the suggestion chip.
  1284. Title string `json:"title,omitempty"`
  1285. // ForceSendFields is a list of field names (e.g. "Title") 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. "Title") to include in API
  1293. // 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 *GoogleCloudDialogflowV2IntentMessageSuggestion) MarshalJSON() ([]byte, error) {
  1301. type NoMethod GoogleCloudDialogflowV2IntentMessageSuggestion
  1302. raw := NoMethod(*s)
  1303. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1304. }
  1305. // GoogleCloudDialogflowV2IntentMessageSuggestions: The collection of
  1306. // suggestions.
  1307. type GoogleCloudDialogflowV2IntentMessageSuggestions struct {
  1308. // Suggestions: Required. The list of suggested replies.
  1309. Suggestions []*GoogleCloudDialogflowV2IntentMessageSuggestion `json:"suggestions,omitempty"`
  1310. // ForceSendFields is a list of field names (e.g. "Suggestions") to
  1311. // unconditionally include in API requests. By default, fields with
  1312. // empty values are omitted from API requests. However, any non-pointer,
  1313. // non-interface field appearing in ForceSendFields will be sent to the
  1314. // server regardless of whether the field is empty or not. This may be
  1315. // used to include empty fields in Patch requests.
  1316. ForceSendFields []string `json:"-"`
  1317. // NullFields is a list of field names (e.g. "Suggestions") to include
  1318. // in API requests with the JSON null value. By default, fields with
  1319. // empty values are omitted from API requests. However, any field with
  1320. // an empty value appearing in NullFields will be sent to the server as
  1321. // null. It is an error if a field in this list has a non-empty value.
  1322. // This may be used to include null fields in Patch requests.
  1323. NullFields []string `json:"-"`
  1324. }
  1325. func (s *GoogleCloudDialogflowV2IntentMessageSuggestions) MarshalJSON() ([]byte, error) {
  1326. type NoMethod GoogleCloudDialogflowV2IntentMessageSuggestions
  1327. raw := NoMethod(*s)
  1328. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1329. }
  1330. // GoogleCloudDialogflowV2IntentMessageText: The text response message.
  1331. type GoogleCloudDialogflowV2IntentMessageText struct {
  1332. // Text: Optional. The collection of the agent's responses.
  1333. Text []string `json:"text,omitempty"`
  1334. // ForceSendFields is a list of field names (e.g. "Text") to
  1335. // unconditionally include in API requests. By default, fields with
  1336. // empty values are omitted from API requests. However, any non-pointer,
  1337. // non-interface field appearing in ForceSendFields will be sent to the
  1338. // server regardless of whether the field is empty or not. This may be
  1339. // used to include empty fields in Patch requests.
  1340. ForceSendFields []string `json:"-"`
  1341. // NullFields is a list of field names (e.g. "Text") to include in API
  1342. // requests with the JSON null value. By default, fields with empty
  1343. // values are omitted from API requests. However, any field with an
  1344. // empty value appearing in NullFields will be sent to the server as
  1345. // null. It is an error if a field in this list has a non-empty value.
  1346. // This may be used to include null fields in Patch requests.
  1347. NullFields []string `json:"-"`
  1348. }
  1349. func (s *GoogleCloudDialogflowV2IntentMessageText) MarshalJSON() ([]byte, error) {
  1350. type NoMethod GoogleCloudDialogflowV2IntentMessageText
  1351. raw := NoMethod(*s)
  1352. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1353. }
  1354. // GoogleCloudDialogflowV2IntentParameter: Represents intent parameters.
  1355. type GoogleCloudDialogflowV2IntentParameter struct {
  1356. // DefaultValue: Optional. The default value to use when the `value`
  1357. // yields an empty
  1358. // result.
  1359. // Default values can be extracted from contexts by using the
  1360. // following
  1361. // syntax: `#context_name.parameter_name`.
  1362. DefaultValue string `json:"defaultValue,omitempty"`
  1363. // DisplayName: Required. The name of the parameter.
  1364. DisplayName string `json:"displayName,omitempty"`
  1365. // EntityTypeDisplayName: Optional. The name of the entity type,
  1366. // prefixed with `@`, that
  1367. // describes values of the parameter. If the parameter is
  1368. // required, this must be provided.
  1369. EntityTypeDisplayName string `json:"entityTypeDisplayName,omitempty"`
  1370. // IsList: Optional. Indicates whether the parameter represents a list
  1371. // of values.
  1372. IsList bool `json:"isList,omitempty"`
  1373. // Mandatory: Optional. Indicates whether the parameter is required.
  1374. // That is,
  1375. // whether the intent cannot be completed without collecting the
  1376. // parameter
  1377. // value.
  1378. Mandatory bool `json:"mandatory,omitempty"`
  1379. // Name: The unique identifier of this parameter.
  1380. Name string `json:"name,omitempty"`
  1381. // Prompts: Optional. The collection of prompts that the agent can
  1382. // present to the
  1383. // user in order to collect value for the parameter.
  1384. Prompts []string `json:"prompts,omitempty"`
  1385. // Value: Optional. The definition of the parameter value. It can be:
  1386. // - a constant string,
  1387. // - a parameter value defined as `$parameter_name`,
  1388. // - an original parameter value defined as
  1389. // `$parameter_name.original`,
  1390. // - a parameter value from some context defined as
  1391. // `#context_name.parameter_name`.
  1392. Value string `json:"value,omitempty"`
  1393. // ForceSendFields is a list of field names (e.g. "DefaultValue") to
  1394. // unconditionally include in API requests. By default, fields with
  1395. // empty values are omitted from API requests. However, any non-pointer,
  1396. // non-interface field appearing in ForceSendFields will be sent to the
  1397. // server regardless of whether the field is empty or not. This may be
  1398. // used to include empty fields in Patch requests.
  1399. ForceSendFields []string `json:"-"`
  1400. // NullFields is a list of field names (e.g. "DefaultValue") to include
  1401. // in API requests with the JSON null value. By default, fields with
  1402. // empty values are omitted from API requests. However, any field with
  1403. // an empty value appearing in NullFields will be sent to the server as
  1404. // null. It is an error if a field in this list has a non-empty value.
  1405. // This may be used to include null fields in Patch requests.
  1406. NullFields []string `json:"-"`
  1407. }
  1408. func (s *GoogleCloudDialogflowV2IntentParameter) MarshalJSON() ([]byte, error) {
  1409. type NoMethod GoogleCloudDialogflowV2IntentParameter
  1410. raw := NoMethod(*s)
  1411. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1412. }
  1413. // GoogleCloudDialogflowV2IntentTrainingPhrase: Represents an example or
  1414. // template that the agent is trained on.
  1415. type GoogleCloudDialogflowV2IntentTrainingPhrase struct {
  1416. // Name: Required. The unique identifier of this training phrase.
  1417. Name string `json:"name,omitempty"`
  1418. // Parts: Required. The collection of training phrase parts (can be
  1419. // annotated).
  1420. // Fields: `entity_type`, `alias` and `user_defined` should be
  1421. // populated
  1422. // only for the annotated parts of the training phrase.
  1423. Parts []*GoogleCloudDialogflowV2IntentTrainingPhrasePart `json:"parts,omitempty"`
  1424. // TimesAddedCount: Optional. Indicates how many times this example or
  1425. // template was added to
  1426. // the intent. Each time a developer adds an existing sample by editing
  1427. // an
  1428. // intent or training, this counter is increased.
  1429. TimesAddedCount int64 `json:"timesAddedCount,omitempty"`
  1430. // Type: Required. The type of the training phrase.
  1431. //
  1432. // Possible values:
  1433. // "TYPE_UNSPECIFIED" - Not specified. This value should never be
  1434. // used.
  1435. // "EXAMPLE" - Examples do not contain @-prefixed entity type names,
  1436. // but example parts
  1437. // can be annotated with entity types.
  1438. // "TEMPLATE" - Templates are not annotated with entity types, but
  1439. // they can contain
  1440. // @-prefixed entity type names as substrings.
  1441. Type string `json:"type,omitempty"`
  1442. // ForceSendFields is a list of field names (e.g. "Name") to
  1443. // unconditionally include in API requests. By default, fields with
  1444. // empty values are omitted from API requests. However, any non-pointer,
  1445. // non-interface field appearing in ForceSendFields will be sent to the
  1446. // server regardless of whether the field is empty or not. This may be
  1447. // used to include empty fields in Patch requests.
  1448. ForceSendFields []string `json:"-"`
  1449. // NullFields is a list of field names (e.g. "Name") to include in API
  1450. // requests with the JSON null value. By default, fields with empty
  1451. // values are omitted from API requests. However, any field with an
  1452. // empty value appearing in NullFields will be sent to the server as
  1453. // null. It is an error if a field in this list has a non-empty value.
  1454. // This may be used to include null fields in Patch requests.
  1455. NullFields []string `json:"-"`
  1456. }
  1457. func (s *GoogleCloudDialogflowV2IntentTrainingPhrase) MarshalJSON() ([]byte, error) {
  1458. type NoMethod GoogleCloudDialogflowV2IntentTrainingPhrase
  1459. raw := NoMethod(*s)
  1460. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1461. }
  1462. // GoogleCloudDialogflowV2IntentTrainingPhrasePart: Represents a part of
  1463. // a training phrase.
  1464. type GoogleCloudDialogflowV2IntentTrainingPhrasePart struct {
  1465. // Alias: Optional. The parameter name for the value extracted from
  1466. // the
  1467. // annotated part of the example.
  1468. Alias string `json:"alias,omitempty"`
  1469. // EntityType: Optional. The entity type name prefixed with `@`. This
  1470. // field is
  1471. // required for the annotated part of the text and applies only
  1472. // to
  1473. // examples.
  1474. EntityType string `json:"entityType,omitempty"`
  1475. // Text: Required. The text corresponding to the example or template,
  1476. // if there are no annotations. For
  1477. // annotated examples, it is the text for one of the example's parts.
  1478. Text string `json:"text,omitempty"`
  1479. // UserDefined: Optional. Indicates whether the text was manually
  1480. // annotated by the
  1481. // developer.
  1482. UserDefined bool `json:"userDefined,omitempty"`
  1483. // ForceSendFields is a list of field names (e.g. "Alias") to
  1484. // unconditionally include in API requests. By default, fields with
  1485. // empty values are omitted from API requests. However, any non-pointer,
  1486. // non-interface field appearing in ForceSendFields will be sent to the
  1487. // server regardless of whether the field is empty or not. This may be
  1488. // used to include empty fields in Patch requests.
  1489. ForceSendFields []string `json:"-"`
  1490. // NullFields is a list of field names (e.g. "Alias") to include in API
  1491. // requests with the JSON null value. By default, fields with empty
  1492. // values are omitted from API requests. However, any field with an
  1493. // empty value appearing in NullFields will be sent to the server as
  1494. // null. It is an error if a field in this list has a non-empty value.
  1495. // This may be used to include null fields in Patch requests.
  1496. NullFields []string `json:"-"`
  1497. }
  1498. func (s *GoogleCloudDialogflowV2IntentTrainingPhrasePart) MarshalJSON() ([]byte, error) {
  1499. type NoMethod GoogleCloudDialogflowV2IntentTrainingPhrasePart
  1500. raw := NoMethod(*s)
  1501. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1502. }
  1503. // GoogleCloudDialogflowV2OriginalDetectIntentRequest: Represents the
  1504. // contents of the original request that was passed to
  1505. // the `[Streaming]DetectIntent` call.
  1506. type GoogleCloudDialogflowV2OriginalDetectIntentRequest struct {
  1507. // Payload: Optional. This field is set to the value of
  1508. // `QueryParameters.payload` field
  1509. // passed in the request.
  1510. Payload googleapi.RawMessage `json:"payload,omitempty"`
  1511. // Source: The source of this request, e.g., `google`, `facebook`,
  1512. // `slack`. It is set
  1513. // by Dialogflow-owned servers.
  1514. Source string `json:"source,omitempty"`
  1515. // ForceSendFields is a list of field names (e.g. "Payload") to
  1516. // unconditionally include in API requests. By default, fields with
  1517. // empty values are omitted from API requests. However, any non-pointer,
  1518. // non-interface field appearing in ForceSendFields will be sent to the
  1519. // server regardless of whether the field is empty or not. This may be
  1520. // used to include empty fields in Patch requests.
  1521. ForceSendFields []string `json:"-"`
  1522. // NullFields is a list of field names (e.g. "Payload") to include in
  1523. // API requests with the JSON null value. By default, fields with empty
  1524. // values are omitted from API requests. However, any field with an
  1525. // empty value appearing in NullFields will be sent to the server as
  1526. // null. It is an error if a field in this list has a non-empty value.
  1527. // This may be used to include null fields in Patch requests.
  1528. NullFields []string `json:"-"`
  1529. }
  1530. func (s *GoogleCloudDialogflowV2OriginalDetectIntentRequest) MarshalJSON() ([]byte, error) {
  1531. type NoMethod GoogleCloudDialogflowV2OriginalDetectIntentRequest
  1532. raw := NoMethod(*s)
  1533. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1534. }
  1535. // GoogleCloudDialogflowV2QueryResult: Represents the result of
  1536. // conversational query or event processing.
  1537. type GoogleCloudDialogflowV2QueryResult struct {
  1538. // Action: The action name from the matched intent.
  1539. Action string `json:"action,omitempty"`
  1540. // AllRequiredParamsPresent: This field is set to:
  1541. // - `false` if the matched intent has required parameters and not all
  1542. // of
  1543. // the required parameter values have been collected.
  1544. // - `true` if all required parameter values have been collected, or if
  1545. // the
  1546. // matched intent doesn't contain any required parameters.
  1547. AllRequiredParamsPresent bool `json:"allRequiredParamsPresent,omitempty"`
  1548. // DiagnosticInfo: The free-form diagnostic info. For example, this
  1549. // field
  1550. // could contain webhook call latency.
  1551. DiagnosticInfo googleapi.RawMessage `json:"diagnosticInfo,omitempty"`
  1552. // FulfillmentMessages: The collection of rich messages to present to
  1553. // the user.
  1554. FulfillmentMessages []*GoogleCloudDialogflowV2IntentMessage `json:"fulfillmentMessages,omitempty"`
  1555. // FulfillmentText: The text to be pronounced to the user or shown on
  1556. // the screen.
  1557. FulfillmentText string `json:"fulfillmentText,omitempty"`
  1558. // Intent: The intent that matched the conversational query. Some,
  1559. // not
  1560. // all fields are filled in this message, including but not limited
  1561. // to:
  1562. // `name`, `display_name` and `webhook_state`.
  1563. Intent *GoogleCloudDialogflowV2Intent `json:"intent,omitempty"`
  1564. // IntentDetectionConfidence: The intent detection confidence. Values
  1565. // range from 0.0
  1566. // (completely uncertain) to 1.0 (completely certain).
  1567. IntentDetectionConfidence float64 `json:"intentDetectionConfidence,omitempty"`
  1568. // LanguageCode: The language that was triggered during intent
  1569. // detection.
  1570. // See [Language
  1571. // Support](https://dialogflow.com/docs/reference/language)
  1572. // for a list of the currently supported language codes.
  1573. LanguageCode string `json:"languageCode,omitempty"`
  1574. // OutputContexts: The collection of output contexts. If
  1575. // applicable,
  1576. // `output_contexts.parameters` contains entries with name
  1577. // `<parameter name>.original` containing the original parameter
  1578. // values
  1579. // before the query.
  1580. OutputContexts []*GoogleCloudDialogflowV2Context `json:"outputContexts,omitempty"`
  1581. // Parameters: The collection of extracted parameters.
  1582. Parameters googleapi.RawMessage `json:"parameters,omitempty"`
  1583. // QueryText: The original conversational query text:
  1584. // - If natural language text was provided as input, `query_text`
  1585. // contains
  1586. // a copy of the input.
  1587. // - If natural language speech audio was provided as input,
  1588. // `query_text`
  1589. // contains the speech recognition result. If speech recognizer
  1590. // produced
  1591. // multiple alternatives, a particular one is picked.
  1592. // - If an event was provided as input, `query_text` is not set.
  1593. QueryText string `json:"queryText,omitempty"`
  1594. // SpeechRecognitionConfidence: The Speech recognition confidence
  1595. // between 0.0 and 1.0. A higher number
  1596. // indicates an estimated greater likelihood that the recognized words
  1597. // are
  1598. // correct. The default of 0.0 is a sentinel value indicating that
  1599. // confidence
  1600. // was not set.
  1601. //
  1602. // This field is not guaranteed to be accurate or set. In particular
  1603. // this
  1604. // field isn't set for StreamingDetectIntent since the streaming
  1605. // endpoint has
  1606. // separate confidence estimates per portion of the audio
  1607. // in
  1608. // StreamingRecognitionResult.
  1609. SpeechRecognitionConfidence float64 `json:"speechRecognitionConfidence,omitempty"`
  1610. // WebhookPayload: If the query was fulfilled by a webhook call, this
  1611. // field is set to the
  1612. // value of the `payload` field returned in the webhook response.
  1613. WebhookPayload googleapi.RawMessage `json:"webhookPayload,omitempty"`
  1614. // WebhookSource: If the query was fulfilled by a webhook call, this
  1615. // field is set to the
  1616. // value of the `source` field returned in the webhook response.
  1617. WebhookSource string `json:"webhookSource,omitempty"`
  1618. // ForceSendFields is a list of field names (e.g. "Action") to
  1619. // unconditionally include in API requests. By default, fields with
  1620. // empty values are omitted from API requests. However, any non-pointer,
  1621. // non-interface field appearing in ForceSendFields will be sent to the
  1622. // server regardless of whether the field is empty or not. This may be
  1623. // used to include empty fields in Patch requests.
  1624. ForceSendFields []string `json:"-"`
  1625. // NullFields is a list of field names (e.g. "Action") to include in API
  1626. // requests with the JSON null value. By default, fields with empty
  1627. // values are omitted from API requests. However, any field with an
  1628. // empty value appearing in NullFields will be sent to the server as
  1629. // null. It is an error if a field in this list has a non-empty value.
  1630. // This may be used to include null fields in Patch requests.
  1631. NullFields []string `json:"-"`
  1632. }
  1633. func (s *GoogleCloudDialogflowV2QueryResult) MarshalJSON() ([]byte, error) {
  1634. type NoMethod GoogleCloudDialogflowV2QueryResult
  1635. raw := NoMethod(*s)
  1636. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1637. }
  1638. func (s *GoogleCloudDialogflowV2QueryResult) UnmarshalJSON(data []byte) error {
  1639. type NoMethod GoogleCloudDialogflowV2QueryResult
  1640. var s1 struct {
  1641. IntentDetectionConfidence gensupport.JSONFloat64 `json:"intentDetectionConfidence"`
  1642. SpeechRecognitionConfidence gensupport.JSONFloat64 `json:"speechRecognitionConfidence"`
  1643. *NoMethod
  1644. }
  1645. s1.NoMethod = (*NoMethod)(s)
  1646. if err := json.Unmarshal(data, &s1); err != nil {
  1647. return err
  1648. }
  1649. s.IntentDetectionConfidence = float64(s1.IntentDetectionConfidence)
  1650. s.SpeechRecognitionConfidence = float64(s1.SpeechRecognitionConfidence)
  1651. return nil
  1652. }
  1653. // GoogleCloudDialogflowV2WebhookRequest: The request message for a
  1654. // webhook call.
  1655. type GoogleCloudDialogflowV2WebhookRequest struct {
  1656. // OriginalDetectIntentRequest: Optional. The contents of the original
  1657. // request that was passed to
  1658. // `[Streaming]DetectIntent` call.
  1659. OriginalDetectIntentRequest *GoogleCloudDialogflowV2OriginalDetectIntentRequest `json:"originalDetectIntentRequest,omitempty"`
  1660. // QueryResult: The result of the conversational query or event
  1661. // processing. Contains the
  1662. // same value as `[Streaming]DetectIntentResponse.query_result`.
  1663. QueryResult *GoogleCloudDialogflowV2QueryResult `json:"queryResult,omitempty"`
  1664. // ResponseId: The unique identifier of the response. Contains the same
  1665. // value as
  1666. // `[Streaming]DetectIntentResponse.response_id`.
  1667. ResponseId string `json:"responseId,omitempty"`
  1668. // Session: The unique identifier of detectIntent request session.
  1669. // Can be used to identify end-user inside webhook
  1670. // implementation.
  1671. // Format: `projects/<Project ID>/agent/sessions/<Session ID>`.
  1672. Session string `json:"session,omitempty"`
  1673. // ForceSendFields is a list of field names (e.g.
  1674. // "OriginalDetectIntentRequest") to unconditionally include in API
  1675. // requests. By default, fields with empty values are omitted from API
  1676. // requests. However, any non-pointer, non-interface field appearing in
  1677. // ForceSendFields will be sent to the server regardless of whether the
  1678. // field is empty or not. This may be used to include empty fields in
  1679. // Patch requests.
  1680. ForceSendFields []string `json:"-"`
  1681. // NullFields is a list of field names (e.g.
  1682. // "OriginalDetectIntentRequest") to include in API requests with the
  1683. // JSON null value. By default, fields with empty values are omitted
  1684. // from API requests. However, any field with an empty value appearing
  1685. // in NullFields will be sent to the server as null. It is an error if a
  1686. // field in this list has a non-empty value. This may be used to include
  1687. // null fields in Patch requests.
  1688. NullFields []string `json:"-"`
  1689. }
  1690. func (s *GoogleCloudDialogflowV2WebhookRequest) MarshalJSON() ([]byte, error) {
  1691. type NoMethod GoogleCloudDialogflowV2WebhookRequest
  1692. raw := NoMethod(*s)
  1693. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1694. }
  1695. // GoogleCloudDialogflowV2WebhookResponse: The response message for a
  1696. // webhook call.
  1697. type GoogleCloudDialogflowV2WebhookResponse struct {
  1698. // FollowupEventInput: Optional. Makes the platform immediately invoke
  1699. // another `DetectIntent` call
  1700. // internally with the specified event as input.
  1701. FollowupEventInput *GoogleCloudDialogflowV2EventInput `json:"followupEventInput,omitempty"`
  1702. // FulfillmentMessages: Optional. The collection of rich messages to
  1703. // present to the user. This
  1704. // value is passed directly to `QueryResult.fulfillment_messages`.
  1705. FulfillmentMessages []*GoogleCloudDialogflowV2IntentMessage `json:"fulfillmentMessages,omitempty"`
  1706. // FulfillmentText: Optional. The text to be shown on the screen. This
  1707. // value is passed directly
  1708. // to `QueryResult.fulfillment_text`.
  1709. FulfillmentText string `json:"fulfillmentText,omitempty"`
  1710. // OutputContexts: Optional. The collection of output contexts. This
  1711. // value is passed directly
  1712. // to `QueryResult.output_contexts`.
  1713. OutputContexts []*GoogleCloudDialogflowV2Context `json:"outputContexts,omitempty"`
  1714. // Payload: Optional. This value is passed directly to
  1715. // `QueryResult.webhook_payload`.
  1716. // See the related `fulfillment_messages[i].payload field`, which may be
  1717. // used
  1718. // as an alternative to this field.
  1719. //
  1720. // This field can be used for Actions on Google responses.
  1721. // It should have a structure similar to the JSON message shown here.
  1722. // For more
  1723. // information, see
  1724. // [Actions on Google
  1725. // Webhook
  1726. // Format](https://developers.google.com/actions/dialogflow/webho
  1727. // ok)
  1728. // <pre>{
  1729. // "google": {
  1730. // "expectUserResponse": true,
  1731. // "richResponse": {
  1732. // "items": [
  1733. // {
  1734. // "simpleResponse": {
  1735. // "textToSpeech": "this is a simple response"
  1736. // }
  1737. // }
  1738. // ]
  1739. // }
  1740. // }
  1741. // }</pre>
  1742. Payload googleapi.RawMessage `json:"payload,omitempty"`
  1743. // Source: Optional. This value is passed directly to
  1744. // `QueryResult.webhook_source`.
  1745. Source string `json:"source,omitempty"`
  1746. // ForceSendFields is a list of field names (e.g. "FollowupEventInput")
  1747. // to unconditionally include in API requests. By default, fields with
  1748. // empty values are omitted from API requests. However, any non-pointer,
  1749. // non-interface field appearing in ForceSendFields will be sent to the
  1750. // server regardless of whether the field is empty or not. This may be
  1751. // used to include empty fields in Patch requests.
  1752. ForceSendFields []string `json:"-"`
  1753. // NullFields is a list of field names (e.g. "FollowupEventInput") to
  1754. // include in API requests with the JSON null value. By default, fields
  1755. // with empty values are omitted from API requests. However, any field
  1756. // with an empty value appearing in NullFields will be sent to the
  1757. // server as null. It is an error if a field in this list has a
  1758. // non-empty value. This may be used to include null fields in Patch
  1759. // requests.
  1760. NullFields []string `json:"-"`
  1761. }
  1762. func (s *GoogleCloudDialogflowV2WebhookResponse) MarshalJSON() ([]byte, error) {
  1763. type NoMethod GoogleCloudDialogflowV2WebhookResponse
  1764. raw := NoMethod(*s)
  1765. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1766. }
  1767. // GoogleCloudDialogflowV2beta1Agent: Represents a conversational agent.
  1768. type GoogleCloudDialogflowV2beta1Agent struct {
  1769. // AvatarUri: Optional. The URI of the agent's avatar.
  1770. // Avatars are used throughout the Dialogflow console and in the
  1771. // self-hosted
  1772. // [Web Demo](https://dialogflow.com/docs/integrations/web-demo)
  1773. // integration.
  1774. AvatarUri string `json:"avatarUri,omitempty"`
  1775. // ClassificationThreshold: Optional. To filter out false positive
  1776. // results and still get variety in
  1777. // matched natural language inputs for your agent, you can tune the
  1778. // machine
  1779. // learning classification threshold. If the returned score value is
  1780. // less than
  1781. // the threshold value, then a fallback intent is be triggered or, if
  1782. // there
  1783. // are no fallback intents defined, no intent will be triggered. The
  1784. // score
  1785. // values range from 0.0 (completely uncertain) to 1.0 (completely
  1786. // certain).
  1787. // If set to 0.0, the default of 0.3 is used.
  1788. ClassificationThreshold float64 `json:"classificationThreshold,omitempty"`
  1789. // DefaultLanguageCode: Required. The default language of the agent as a
  1790. // language tag. See
  1791. // [Language Support](https://dialogflow.com/docs/reference/language)
  1792. // for a
  1793. // list of the currently supported language codes.
  1794. // This field cannot be set by the `Update` method.
  1795. DefaultLanguageCode string `json:"defaultLanguageCode,omitempty"`
  1796. // Description: Optional. The description of this agent.
  1797. // The maximum length is 500 characters. If exceeded, the request is
  1798. // rejected.
  1799. Description string `json:"description,omitempty"`
  1800. // DisplayName: Required. The name of this agent.
  1801. DisplayName string `json:"displayName,omitempty"`
  1802. // EnableLogging: Optional. Determines whether this agent should log
  1803. // conversation queries.
  1804. EnableLogging bool `json:"enableLogging,omitempty"`
  1805. // MatchMode: Optional. Determines how intents are detected from user
  1806. // queries.
  1807. //
  1808. // Possible values:
  1809. // "MATCH_MODE_UNSPECIFIED" - Not specified.
  1810. // "MATCH_MODE_HYBRID" - Best for agents with a small number of
  1811. // examples in intents and/or wide
  1812. // use of templates syntax and composite entities.
  1813. // "MATCH_MODE_ML_ONLY" - Can be used for agents with a large number
  1814. // of examples in intents,
  1815. // especially the ones using @sys.any or very large developer entities.
  1816. MatchMode string `json:"matchMode,omitempty"`
  1817. // Parent: Required. The project of this agent.
  1818. // Format: `projects/<Project ID>`.
  1819. Parent string `json:"parent,omitempty"`
  1820. // SupportedLanguageCodes: Optional. The list of all languages supported
  1821. // by this agent (except for the
  1822. // `default_language_code`).
  1823. SupportedLanguageCodes []string `json:"supportedLanguageCodes,omitempty"`
  1824. // TimeZone: Required. The time zone of this agent from the
  1825. // [time zone database](https://www.iana.org/time-zones),
  1826. // e.g.,
  1827. // America/New_York, Europe/Paris.
  1828. TimeZone string `json:"timeZone,omitempty"`
  1829. // ServerResponse contains the HTTP response code and headers from the
  1830. // server.
  1831. googleapi.ServerResponse `json:"-"`
  1832. // ForceSendFields is a list of field names (e.g. "AvatarUri") to
  1833. // unconditionally include in API requests. By default, fields with
  1834. // empty values are omitted from API requests. However, any non-pointer,
  1835. // non-interface field appearing in ForceSendFields will be sent to the
  1836. // server regardless of whether the field is empty or not. This may be
  1837. // used to include empty fields in Patch requests.
  1838. ForceSendFields []string `json:"-"`
  1839. // NullFields is a list of field names (e.g. "AvatarUri") to include in
  1840. // API requests with the JSON null value. By default, fields with empty
  1841. // values are omitted from API requests. However, any field with an
  1842. // empty value appearing in NullFields will be sent to the server as
  1843. // null. It is an error if a field in this list has a non-empty value.
  1844. // This may be used to include null fields in Patch requests.
  1845. NullFields []string `json:"-"`
  1846. }
  1847. func (s *GoogleCloudDialogflowV2beta1Agent) MarshalJSON() ([]byte, error) {
  1848. type NoMethod GoogleCloudDialogflowV2beta1Agent
  1849. raw := NoMethod(*s)
  1850. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1851. }
  1852. func (s *GoogleCloudDialogflowV2beta1Agent) UnmarshalJSON(data []byte) error {
  1853. type NoMethod GoogleCloudDialogflowV2beta1Agent
  1854. var s1 struct {
  1855. ClassificationThreshold gensupport.JSONFloat64 `json:"classificationThreshold"`
  1856. *NoMethod
  1857. }
  1858. s1.NoMethod = (*NoMethod)(s)
  1859. if err := json.Unmarshal(data, &s1); err != nil {
  1860. return err
  1861. }
  1862. s.ClassificationThreshold = float64(s1.ClassificationThreshold)
  1863. return nil
  1864. }
  1865. // GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest: The request
  1866. // message for EntityTypes.BatchCreateEntities.
  1867. type GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest struct {
  1868. // Entities: Required. The collection of entities to create.
  1869. Entities []*GoogleCloudDialogflowV2beta1EntityTypeEntity `json:"entities,omitempty"`
  1870. // LanguageCode: Optional. The language of entity synonyms defined in
  1871. // `entities`. If not
  1872. // specified, the agent's default language is used.
  1873. // [More than a
  1874. // dozen
  1875. // languages](https://dialogflow.com/docs/reference/language) are
  1876. // supported.
  1877. // Note: languages must be enabled in the agent, before they can be
  1878. // used.
  1879. LanguageCode string `json:"languageCode,omitempty"`
  1880. // ForceSendFields is a list of field names (e.g. "Entities") to
  1881. // unconditionally include in API requests. By default, fields with
  1882. // empty values are omitted from API requests. However, any non-pointer,
  1883. // non-interface field appearing in ForceSendFields will be sent to the
  1884. // server regardless of whether the field is empty or not. This may be
  1885. // used to include empty fields in Patch requests.
  1886. ForceSendFields []string `json:"-"`
  1887. // NullFields is a list of field names (e.g. "Entities") to include in
  1888. // API requests with the JSON null value. By default, fields with empty
  1889. // values are omitted from API requests. However, any field with an
  1890. // empty value appearing in NullFields will be sent to the server as
  1891. // null. It is an error if a field in this list has a non-empty value.
  1892. // This may be used to include null fields in Patch requests.
  1893. NullFields []string `json:"-"`
  1894. }
  1895. func (s *GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest) MarshalJSON() ([]byte, error) {
  1896. type NoMethod GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest
  1897. raw := NoMethod(*s)
  1898. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1899. }
  1900. // GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest: The request
  1901. // message for EntityTypes.BatchDeleteEntities.
  1902. type GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest struct {
  1903. // EntityValues: Required. The canonical `values` of the entities to
  1904. // delete. Note that
  1905. // these are not fully-qualified names, i.e. they don't start
  1906. // with
  1907. // `projects/<Project ID>`.
  1908. EntityValues []string `json:"entityValues,omitempty"`
  1909. // LanguageCode: Optional. The language of entity synonyms defined in
  1910. // `entities`. If not
  1911. // specified, the agent's default language is used.
  1912. // [More than a
  1913. // dozen
  1914. // languages](https://dialogflow.com/docs/reference/language) are
  1915. // supported.
  1916. // Note: languages must be enabled in the agent, before they can be
  1917. // used.
  1918. LanguageCode string `json:"languageCode,omitempty"`
  1919. // ForceSendFields is a list of field names (e.g. "EntityValues") to
  1920. // unconditionally include in API requests. By default, fields with
  1921. // empty values are omitted from API requests. However, any non-pointer,
  1922. // non-interface field appearing in ForceSendFields will be sent to the
  1923. // server regardless of whether the field is empty or not. This may be
  1924. // used to include empty fields in Patch requests.
  1925. ForceSendFields []string `json:"-"`
  1926. // NullFields is a list of field names (e.g. "EntityValues") to include
  1927. // in API requests with the JSON null value. By default, fields with
  1928. // empty values are omitted from API requests. However, any field with
  1929. // an empty value appearing in NullFields will be sent to the server as
  1930. // null. It is an error if a field in this list has a non-empty value.
  1931. // This may be used to include null fields in Patch requests.
  1932. NullFields []string `json:"-"`
  1933. }
  1934. func (s *GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest) MarshalJSON() ([]byte, error) {
  1935. type NoMethod GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest
  1936. raw := NoMethod(*s)
  1937. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1938. }
  1939. // GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest: The
  1940. // request message for EntityTypes.BatchDeleteEntityTypes.
  1941. type GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest struct {
  1942. // EntityTypeNames: Required. The names entity types to delete. All
  1943. // names must point to the
  1944. // same agent as `parent`.
  1945. EntityTypeNames []string `json:"entityTypeNames,omitempty"`
  1946. // ForceSendFields is a list of field names (e.g. "EntityTypeNames") 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. "EntityTypeNames") to
  1954. // include in API requests with the JSON null value. By default, fields
  1955. // with empty values are omitted from API requests. However, any field
  1956. // with an empty value appearing in NullFields will be sent to the
  1957. // server as null. It is an error if a field in this list has a
  1958. // non-empty value. This may be used to include null fields in Patch
  1959. // requests.
  1960. NullFields []string `json:"-"`
  1961. }
  1962. func (s *GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest) MarshalJSON() ([]byte, error) {
  1963. type NoMethod GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest
  1964. raw := NoMethod(*s)
  1965. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1966. }
  1967. // GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest: The request
  1968. // message for Intents.BatchDeleteIntents.
  1969. type GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest struct {
  1970. // Intents: Required. The collection of intents to delete. Only intent
  1971. // `name` must be
  1972. // filled in.
  1973. Intents []*GoogleCloudDialogflowV2beta1Intent `json:"intents,omitempty"`
  1974. // ForceSendFields is a list of field names (e.g. "Intents") to
  1975. // unconditionally include in API requests. By default, fields with
  1976. // empty values are omitted from API requests. However, any non-pointer,
  1977. // non-interface field appearing in ForceSendFields will be sent to the
  1978. // server regardless of whether the field is empty or not. This may be
  1979. // used to include empty fields in Patch requests.
  1980. ForceSendFields []string `json:"-"`
  1981. // NullFields is a list of field names (e.g. "Intents") to include in
  1982. // API requests with the JSON null value. By default, fields with empty
  1983. // values are omitted from API requests. However, any field with an
  1984. // empty value appearing in NullFields will be sent to the server as
  1985. // null. It is an error if a field in this list has a non-empty value.
  1986. // This may be used to include null fields in Patch requests.
  1987. NullFields []string `json:"-"`
  1988. }
  1989. func (s *GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest) MarshalJSON() ([]byte, error) {
  1990. type NoMethod GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest
  1991. raw := NoMethod(*s)
  1992. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1993. }
  1994. // GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest: The response
  1995. // message for EntityTypes.BatchCreateEntities.
  1996. type GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest struct {
  1997. // Entities: Required. The collection of new entities to replace the
  1998. // existing entities.
  1999. Entities []*GoogleCloudDialogflowV2beta1EntityTypeEntity `json:"entities,omitempty"`
  2000. // LanguageCode: Optional. The language of entity synonyms defined in
  2001. // `entities`. If not
  2002. // specified, the agent's default language is used.
  2003. // [More than a
  2004. // dozen
  2005. // languages](https://dialogflow.com/docs/reference/language) are
  2006. // supported.
  2007. // Note: languages must be enabled in the agent, before they can be
  2008. // used.
  2009. LanguageCode string `json:"languageCode,omitempty"`
  2010. // UpdateMask: Optional. The mask to control which fields get updated.
  2011. UpdateMask string `json:"updateMask,omitempty"`
  2012. // ForceSendFields is a list of field names (e.g. "Entities") to
  2013. // unconditionally include in API requests. By default, fields with
  2014. // empty values are omitted from API requests. However, any non-pointer,
  2015. // non-interface field appearing in ForceSendFields will be sent to the
  2016. // server regardless of whether the field is empty or not. This may be
  2017. // used to include empty fields in Patch requests.
  2018. ForceSendFields []string `json:"-"`
  2019. // NullFields is a list of field names (e.g. "Entities") to include in
  2020. // API requests with the JSON null value. By default, fields with empty
  2021. // values are omitted from API requests. However, any field with an
  2022. // empty value appearing in NullFields will be sent to the server as
  2023. // null. It is an error if a field in this list has a non-empty value.
  2024. // This may be used to include null fields in Patch requests.
  2025. NullFields []string `json:"-"`
  2026. }
  2027. func (s *GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest) MarshalJSON() ([]byte, error) {
  2028. type NoMethod GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest
  2029. raw := NoMethod(*s)
  2030. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2031. }
  2032. // GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesRequest: The
  2033. // request message for EntityTypes.BatchUpdateEntityTypes.
  2034. type GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesRequest struct {
  2035. // EntityTypeBatchInline: The collection of entity type to update or
  2036. // create.
  2037. EntityTypeBatchInline *GoogleCloudDialogflowV2beta1EntityTypeBatch `json:"entityTypeBatchInline,omitempty"`
  2038. // EntityTypeBatchUri: The URI to a Google Cloud Storage file containing
  2039. // entity types to update
  2040. // or create. The file format can either be a serialized proto
  2041. // (of
  2042. // EntityBatch type) or a JSON object. Note: The URI must start
  2043. // with
  2044. // "gs://".
  2045. EntityTypeBatchUri string `json:"entityTypeBatchUri,omitempty"`
  2046. // LanguageCode: Optional. The language of entity synonyms defined in
  2047. // `entity_types`. If not
  2048. // specified, the agent's default language is used.
  2049. // [More than a
  2050. // dozen
  2051. // languages](https://dialogflow.com/docs/reference/language) are
  2052. // supported.
  2053. // Note: languages must be enabled in the agent, before they can be
  2054. // used.
  2055. LanguageCode string `json:"languageCode,omitempty"`
  2056. // UpdateMask: Optional. The mask to control which fields get updated.
  2057. UpdateMask string `json:"updateMask,omitempty"`
  2058. // ForceSendFields is a list of field names (e.g.
  2059. // "EntityTypeBatchInline") to unconditionally include in API requests.
  2060. // By default, fields with empty values are omitted from API requests.
  2061. // However, any non-pointer, non-interface field appearing in
  2062. // ForceSendFields will be sent to the server regardless of whether the
  2063. // field is empty or not. This may be used to include empty fields in
  2064. // Patch requests.
  2065. ForceSendFields []string `json:"-"`
  2066. // NullFields is a list of field names (e.g. "EntityTypeBatchInline") to
  2067. // include in API requests with the JSON null value. By default, fields
  2068. // with empty values are omitted from API requests. However, any field
  2069. // with an empty value appearing in NullFields will be sent to the
  2070. // server as null. It is an error if a field in this list has a
  2071. // non-empty value. This may be used to include null fields in Patch
  2072. // requests.
  2073. NullFields []string `json:"-"`
  2074. }
  2075. func (s *GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesRequest) MarshalJSON() ([]byte, error) {
  2076. type NoMethod GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesRequest
  2077. raw := NoMethod(*s)
  2078. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2079. }
  2080. // GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesResponse: The
  2081. // response message for EntityTypes.BatchUpdateEntityTypes.
  2082. type GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesResponse struct {
  2083. // EntityTypes: The collection of updated or created entity types.
  2084. EntityTypes []*GoogleCloudDialogflowV2beta1EntityType `json:"entityTypes,omitempty"`
  2085. // ForceSendFields is a list of field names (e.g. "EntityTypes") to
  2086. // unconditionally include in API requests. By default, fields with
  2087. // empty values are omitted from API requests. However, any non-pointer,
  2088. // non-interface field appearing in ForceSendFields will be sent to the
  2089. // server regardless of whether the field is empty or not. This may be
  2090. // used to include empty fields in Patch requests.
  2091. ForceSendFields []string `json:"-"`
  2092. // NullFields is a list of field names (e.g. "EntityTypes") to include
  2093. // in API requests with the JSON null value. By default, fields with
  2094. // empty values are omitted from API requests. However, any field with
  2095. // an empty value appearing in NullFields will be sent to the server as
  2096. // null. It is an error if a field in this list has a non-empty value.
  2097. // This may be used to include null fields in Patch requests.
  2098. NullFields []string `json:"-"`
  2099. }
  2100. func (s *GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesResponse) MarshalJSON() ([]byte, error) {
  2101. type NoMethod GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesResponse
  2102. raw := NoMethod(*s)
  2103. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2104. }
  2105. // GoogleCloudDialogflowV2beta1BatchUpdateIntentsRequest: The request
  2106. // message for Intents.BatchUpdateIntents.
  2107. type GoogleCloudDialogflowV2beta1BatchUpdateIntentsRequest struct {
  2108. // IntentBatchInline: The collection of intents to update or create.
  2109. IntentBatchInline *GoogleCloudDialogflowV2beta1IntentBatch `json:"intentBatchInline,omitempty"`
  2110. // IntentBatchUri: The URI to a Google Cloud Storage file containing
  2111. // intents to update or
  2112. // create. The file format can either be a serialized proto (of
  2113. // IntentBatch
  2114. // type) or JSON object. Note: The URI must start with "gs://".
  2115. IntentBatchUri string `json:"intentBatchUri,omitempty"`
  2116. // IntentView: Optional. The resource view to apply to the returned
  2117. // intent.
  2118. //
  2119. // Possible values:
  2120. // "INTENT_VIEW_UNSPECIFIED" - Training phrases field is not populated
  2121. // in the response.
  2122. // "INTENT_VIEW_FULL" - All fields are populated.
  2123. IntentView string `json:"intentView,omitempty"`
  2124. // LanguageCode: Optional. The language of training phrases, parameters
  2125. // and rich messages
  2126. // defined in `intents`. If not specified, the agent's default language
  2127. // is
  2128. // used. [More than a
  2129. // dozen
  2130. // languages](https://dialogflow.com/docs/reference/language) are
  2131. // supported.
  2132. // Note: languages must be enabled in the agent, before they can be
  2133. // used.
  2134. LanguageCode string `json:"languageCode,omitempty"`
  2135. // UpdateMask: Optional. The mask to control which fields get updated.
  2136. UpdateMask string `json:"updateMask,omitempty"`
  2137. // ForceSendFields is a list of field names (e.g. "IntentBatchInline")
  2138. // to unconditionally include in API requests. By default, fields with
  2139. // empty values are omitted from API requests. However, any non-pointer,
  2140. // non-interface field appearing in ForceSendFields will be sent to the
  2141. // server regardless of whether the field is empty or not. This may be
  2142. // used to include empty fields in Patch requests.
  2143. ForceSendFields []string `json:"-"`
  2144. // NullFields is a list of field names (e.g. "IntentBatchInline") to
  2145. // include in API requests with the JSON null value. By default, fields
  2146. // with empty values are omitted from API requests. However, any field
  2147. // with an empty value appearing in NullFields will be sent to the
  2148. // server as null. It is an error if a field in this list has a
  2149. // non-empty value. This may be used to include null fields in Patch
  2150. // requests.
  2151. NullFields []string `json:"-"`
  2152. }
  2153. func (s *GoogleCloudDialogflowV2beta1BatchUpdateIntentsRequest) MarshalJSON() ([]byte, error) {
  2154. type NoMethod GoogleCloudDialogflowV2beta1BatchUpdateIntentsRequest
  2155. raw := NoMethod(*s)
  2156. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2157. }
  2158. // GoogleCloudDialogflowV2beta1BatchUpdateIntentsResponse: The response
  2159. // message for Intents.BatchUpdateIntents.
  2160. type GoogleCloudDialogflowV2beta1BatchUpdateIntentsResponse struct {
  2161. // Intents: The collection of updated or created intents.
  2162. Intents []*GoogleCloudDialogflowV2beta1Intent `json:"intents,omitempty"`
  2163. // ForceSendFields is a list of field names (e.g. "Intents") to
  2164. // unconditionally include in API requests. By default, fields with
  2165. // empty values are omitted from API requests. However, any non-pointer,
  2166. // non-interface field appearing in ForceSendFields will be sent to the
  2167. // server regardless of whether the field is empty or not. This may be
  2168. // used to include empty fields in Patch requests.
  2169. ForceSendFields []string `json:"-"`
  2170. // NullFields is a list of field names (e.g. "Intents") to include in
  2171. // API requests with the JSON null value. By default, fields with empty
  2172. // values are omitted from API requests. However, any field with an
  2173. // empty value appearing in NullFields will be sent to the server as
  2174. // null. It is an error if a field in this list has a non-empty value.
  2175. // This may be used to include null fields in Patch requests.
  2176. NullFields []string `json:"-"`
  2177. }
  2178. func (s *GoogleCloudDialogflowV2beta1BatchUpdateIntentsResponse) MarshalJSON() ([]byte, error) {
  2179. type NoMethod GoogleCloudDialogflowV2beta1BatchUpdateIntentsResponse
  2180. raw := NoMethod(*s)
  2181. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2182. }
  2183. // GoogleCloudDialogflowV2beta1Context: Represents a context.
  2184. type GoogleCloudDialogflowV2beta1Context struct {
  2185. // LifespanCount: Optional. The number of conversational query requests
  2186. // after which the
  2187. // context expires. If set to `0` (the default) the context
  2188. // expires
  2189. // immediately. Contexts expire automatically after 10 minutes even if
  2190. // there
  2191. // are no matching queries.
  2192. LifespanCount int64 `json:"lifespanCount,omitempty"`
  2193. // Name: Required. The unique identifier of the context.
  2194. // Format:
  2195. // `projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context
  2196. // ID>`,
  2197. // or
  2198. // `projects/<Project ID>/agent/environments/<Environment
  2199. // ID>/users/<User
  2200. // ID>/sessions/<Session ID>/contexts/<Context ID>`. Note: Environments
  2201. // and
  2202. // users are under construction and will be available soon. The Context
  2203. // ID is
  2204. // always converted to lowercase. If <Environment ID> is not specified,
  2205. // we
  2206. // assume default 'draft' environment. If <User ID> is not specified,
  2207. // we
  2208. // assume default '-' user.
  2209. Name string `json:"name,omitempty"`
  2210. // Parameters: Optional. The collection of parameters associated with
  2211. // this context.
  2212. // Refer to [this
  2213. // doc](https://dialogflow.com/docs/actions-and-parameters) for
  2214. // syntax.
  2215. Parameters googleapi.RawMessage `json:"parameters,omitempty"`
  2216. // ServerResponse contains the HTTP response code and headers from the
  2217. // server.
  2218. googleapi.ServerResponse `json:"-"`
  2219. // ForceSendFields is a list of field names (e.g. "LifespanCount") to
  2220. // unconditionally include in API requests. By default, fields with
  2221. // empty values are omitted from API requests. However, any non-pointer,
  2222. // non-interface field appearing in ForceSendFields will be sent to the
  2223. // server regardless of whether the field is empty or not. This may be
  2224. // used to include empty fields in Patch requests.
  2225. ForceSendFields []string `json:"-"`
  2226. // NullFields is a list of field names (e.g. "LifespanCount") to include
  2227. // in API requests with the JSON null value. By default, fields with
  2228. // empty values are omitted from API requests. However, any field with
  2229. // an empty value appearing in NullFields will be sent to the server as
  2230. // null. It is an error if a field in this list has a non-empty value.
  2231. // This may be used to include null fields in Patch requests.
  2232. NullFields []string `json:"-"`
  2233. }
  2234. func (s *GoogleCloudDialogflowV2beta1Context) MarshalJSON() ([]byte, error) {
  2235. type NoMethod GoogleCloudDialogflowV2beta1Context
  2236. raw := NoMethod(*s)
  2237. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2238. }
  2239. // GoogleCloudDialogflowV2beta1DetectIntentRequest: The request to
  2240. // detect user's intent.
  2241. type GoogleCloudDialogflowV2beta1DetectIntentRequest struct {
  2242. // InputAudio: Optional. The natural language speech audio to be
  2243. // processed. This field
  2244. // should be populated iff `query_input` is set to an input audio
  2245. // config.
  2246. // A single request can contain up to 1 minute of speech audio data.
  2247. InputAudio string `json:"inputAudio,omitempty"`
  2248. // QueryInput: Required. The input specification. It can be set to:
  2249. //
  2250. // 1. an audio config
  2251. // which instructs the speech recognizer how to process the speech
  2252. // audio,
  2253. //
  2254. // 2. a conversational query in the form of text, or
  2255. //
  2256. // 3. an event that specifies which intent to trigger.
  2257. QueryInput *GoogleCloudDialogflowV2beta1QueryInput `json:"queryInput,omitempty"`
  2258. // QueryParams: Optional. The parameters of this query.
  2259. QueryParams *GoogleCloudDialogflowV2beta1QueryParameters `json:"queryParams,omitempty"`
  2260. // ForceSendFields is a list of field names (e.g. "InputAudio") to
  2261. // unconditionally include in API requests. By default, fields with
  2262. // empty values are omitted from API requests. However, any non-pointer,
  2263. // non-interface field appearing in ForceSendFields will be sent to the
  2264. // server regardless of whether the field is empty or not. This may be
  2265. // used to include empty fields in Patch requests.
  2266. ForceSendFields []string `json:"-"`
  2267. // NullFields is a list of field names (e.g. "InputAudio") to include in
  2268. // API requests with the JSON null value. By default, fields with empty
  2269. // values are omitted from API requests. However, any field with an
  2270. // empty value appearing in NullFields will be sent to the server as
  2271. // null. It is an error if a field in this list has a non-empty value.
  2272. // This may be used to include null fields in Patch requests.
  2273. NullFields []string `json:"-"`
  2274. }
  2275. func (s *GoogleCloudDialogflowV2beta1DetectIntentRequest) MarshalJSON() ([]byte, error) {
  2276. type NoMethod GoogleCloudDialogflowV2beta1DetectIntentRequest
  2277. raw := NoMethod(*s)
  2278. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2279. }
  2280. // GoogleCloudDialogflowV2beta1DetectIntentResponse: The message
  2281. // returned from the DetectIntent method.
  2282. type GoogleCloudDialogflowV2beta1DetectIntentResponse struct {
  2283. // QueryResult: The results of the conversational query or event
  2284. // processing.
  2285. QueryResult *GoogleCloudDialogflowV2beta1QueryResult `json:"queryResult,omitempty"`
  2286. // ResponseId: The unique identifier of the response. It can be used
  2287. // to
  2288. // locate a response in the training example set or for reporting
  2289. // issues.
  2290. ResponseId string `json:"responseId,omitempty"`
  2291. // WebhookStatus: Specifies the status of the webhook request.
  2292. // `webhook_status`
  2293. // is never populated in webhook requests.
  2294. WebhookStatus *GoogleRpcStatus `json:"webhookStatus,omitempty"`
  2295. // ServerResponse contains the HTTP response code and headers from the
  2296. // server.
  2297. googleapi.ServerResponse `json:"-"`
  2298. // ForceSendFields is a list of field names (e.g. "QueryResult") to
  2299. // unconditionally include in API requests. By default, fields with
  2300. // empty values are omitted from API requests. However, any non-pointer,
  2301. // non-interface field appearing in ForceSendFields will be sent to the
  2302. // server regardless of whether the field is empty or not. This may be
  2303. // used to include empty fields in Patch requests.
  2304. ForceSendFields []string `json:"-"`
  2305. // NullFields is a list of field names (e.g. "QueryResult") to include
  2306. // in API requests with the JSON null value. By default, fields with
  2307. // empty values are omitted from API requests. However, any field with
  2308. // an empty value appearing in NullFields will be sent to the server as
  2309. // null. It is an error if a field in this list has a non-empty value.
  2310. // This may be used to include null fields in Patch requests.
  2311. NullFields []string `json:"-"`
  2312. }
  2313. func (s *GoogleCloudDialogflowV2beta1DetectIntentResponse) MarshalJSON() ([]byte, error) {
  2314. type NoMethod GoogleCloudDialogflowV2beta1DetectIntentResponse
  2315. raw := NoMethod(*s)
  2316. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2317. }
  2318. // GoogleCloudDialogflowV2beta1EntityType: Represents an entity
  2319. // type.
  2320. // Entity types serve as a tool for extracting parameter values from
  2321. // natural
  2322. // language queries.
  2323. type GoogleCloudDialogflowV2beta1EntityType struct {
  2324. // AutoExpansionMode: Optional. Indicates whether the entity type can be
  2325. // automatically
  2326. // expanded.
  2327. //
  2328. // Possible values:
  2329. // "AUTO_EXPANSION_MODE_UNSPECIFIED" - Auto expansion disabled for the
  2330. // entity.
  2331. // "AUTO_EXPANSION_MODE_DEFAULT" - Allows an agent to recognize values
  2332. // that have not been explicitly
  2333. // listed in the entity.
  2334. AutoExpansionMode string `json:"autoExpansionMode,omitempty"`
  2335. // DisplayName: Required. The name of the entity.
  2336. DisplayName string `json:"displayName,omitempty"`
  2337. // Entities: Optional. The collection of entities associated with the
  2338. // entity type.
  2339. Entities []*GoogleCloudDialogflowV2beta1EntityTypeEntity `json:"entities,omitempty"`
  2340. // Kind: Required. Indicates the kind of entity type.
  2341. //
  2342. // Possible values:
  2343. // "KIND_UNSPECIFIED" - Not specified. This value should be never
  2344. // used.
  2345. // "KIND_MAP" - Map entity types allow mapping of a group of synonyms
  2346. // to a canonical
  2347. // value.
  2348. // "KIND_LIST" - List entity types contain a set of entries that do
  2349. // not map to canonical
  2350. // values. However, list entity types can contain references to other
  2351. // entity
  2352. // types (with or without aliases).
  2353. Kind string `json:"kind,omitempty"`
  2354. // Name: Required for all methods except `create` (`create` populates
  2355. // the name
  2356. // automatically.
  2357. // The unique identifier of the entity type. Format:
  2358. // `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.
  2359. Name string `json:"name,omitempty"`
  2360. // ServerResponse contains the HTTP response code and headers from the
  2361. // server.
  2362. googleapi.ServerResponse `json:"-"`
  2363. // ForceSendFields is a list of field names (e.g. "AutoExpansionMode")
  2364. // to unconditionally include in API requests. By default, fields with
  2365. // empty values are omitted from API requests. However, any non-pointer,
  2366. // non-interface field appearing in ForceSendFields will be sent to the
  2367. // server regardless of whether the field is empty or not. This may be
  2368. // used to include empty fields in Patch requests.
  2369. ForceSendFields []string `json:"-"`
  2370. // NullFields is a list of field names (e.g. "AutoExpansionMode") to
  2371. // include in API requests with the JSON null value. By default, fields
  2372. // with empty values are omitted from API requests. However, any field
  2373. // with an empty value appearing in NullFields will be sent to the
  2374. // server as null. It is an error if a field in this list has a
  2375. // non-empty value. This may be used to include null fields in Patch
  2376. // requests.
  2377. NullFields []string `json:"-"`
  2378. }
  2379. func (s *GoogleCloudDialogflowV2beta1EntityType) MarshalJSON() ([]byte, error) {
  2380. type NoMethod GoogleCloudDialogflowV2beta1EntityType
  2381. raw := NoMethod(*s)
  2382. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2383. }
  2384. // GoogleCloudDialogflowV2beta1EntityTypeBatch: This message is a
  2385. // wrapper around a collection of entity types.
  2386. type GoogleCloudDialogflowV2beta1EntityTypeBatch struct {
  2387. // EntityTypes: A collection of entity types.
  2388. EntityTypes []*GoogleCloudDialogflowV2beta1EntityType `json:"entityTypes,omitempty"`
  2389. // ForceSendFields is a list of field names (e.g. "EntityTypes") to
  2390. // unconditionally include in API requests. By default, fields with
  2391. // empty values are omitted from API requests. However, any non-pointer,
  2392. // non-interface field appearing in ForceSendFields will be sent to the
  2393. // server regardless of whether the field is empty or not. This may be
  2394. // used to include empty fields in Patch requests.
  2395. ForceSendFields []string `json:"-"`
  2396. // NullFields is a list of field names (e.g. "EntityTypes") to include
  2397. // in API requests with the JSON null value. By default, fields with
  2398. // empty values are omitted from API requests. However, any field with
  2399. // an empty value appearing in NullFields will be sent to the server as
  2400. // null. It is an error if a field in this list has a non-empty value.
  2401. // This may be used to include null fields in Patch requests.
  2402. NullFields []string `json:"-"`
  2403. }
  2404. func (s *GoogleCloudDialogflowV2beta1EntityTypeBatch) MarshalJSON() ([]byte, error) {
  2405. type NoMethod GoogleCloudDialogflowV2beta1EntityTypeBatch
  2406. raw := NoMethod(*s)
  2407. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2408. }
  2409. // GoogleCloudDialogflowV2beta1EntityTypeEntity: Optional. Represents an
  2410. // entity.
  2411. type GoogleCloudDialogflowV2beta1EntityTypeEntity struct {
  2412. // Synonyms: Required. A collection of synonyms. For `KIND_LIST` entity
  2413. // types this
  2414. // must contain exactly one synonym equal to `value`.
  2415. Synonyms []string `json:"synonyms,omitempty"`
  2416. // Value: Required.
  2417. // For `KIND_MAP` entity types:
  2418. // A canonical name to be used in place of synonyms.
  2419. // For `KIND_LIST` entity types:
  2420. // A string that can contain references to other entity types (with
  2421. // or
  2422. // without aliases).
  2423. Value string `json:"value,omitempty"`
  2424. // ForceSendFields is a list of field names (e.g. "Synonyms") to
  2425. // unconditionally include in API requests. By default, fields with
  2426. // empty values are omitted from API requests. However, any non-pointer,
  2427. // non-interface field appearing in ForceSendFields will be sent to the
  2428. // server regardless of whether the field is empty or not. This may be
  2429. // used to include empty fields in Patch requests.
  2430. ForceSendFields []string `json:"-"`
  2431. // NullFields is a list of field names (e.g. "Synonyms") to include in
  2432. // API requests with the JSON null value. By default, fields with empty
  2433. // values are omitted from API requests. However, any field with an
  2434. // empty value appearing in NullFields will be sent to the server as
  2435. // null. It is an error if a field in this list has a non-empty value.
  2436. // This may be used to include null fields in Patch requests.
  2437. NullFields []string `json:"-"`
  2438. }
  2439. func (s *GoogleCloudDialogflowV2beta1EntityTypeEntity) MarshalJSON() ([]byte, error) {
  2440. type NoMethod GoogleCloudDialogflowV2beta1EntityTypeEntity
  2441. raw := NoMethod(*s)
  2442. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2443. }
  2444. // GoogleCloudDialogflowV2beta1EventInput: Events allow for matching
  2445. // intents by event name instead of the natural
  2446. // language input. For instance, input `<event: { name:
  2447. // “welcome_event”,
  2448. // parameters: { name: “Sam” } }>` can trigger a personalized
  2449. // welcome response.
  2450. // The parameter `name` may be used by the agent in the
  2451. // response:
  2452. // `“Hello #welcome_event.name! What can I do for you today?”`.
  2453. type GoogleCloudDialogflowV2beta1EventInput struct {
  2454. // LanguageCode: Required. The language of this query. See
  2455. // [Language
  2456. // Support](https://dialogflow.com/docs/languages) for a list of
  2457. // the
  2458. // currently supported language codes. Note that queries in the same
  2459. // session
  2460. // do not necessarily need to specify the same language.
  2461. LanguageCode string `json:"languageCode,omitempty"`
  2462. // Name: Required. The unique identifier of the event.
  2463. Name string `json:"name,omitempty"`
  2464. // Parameters: Optional. The collection of parameters associated with
  2465. // the event.
  2466. Parameters googleapi.RawMessage `json:"parameters,omitempty"`
  2467. // ForceSendFields is a list of field names (e.g. "LanguageCode") to
  2468. // unconditionally include in API requests. By default, fields with
  2469. // empty values are omitted from API requests. However, any non-pointer,
  2470. // non-interface field appearing in ForceSendFields will be sent to the
  2471. // server regardless of whether the field is empty or not. This may be
  2472. // used to include empty fields in Patch requests.
  2473. ForceSendFields []string `json:"-"`
  2474. // NullFields is a list of field names (e.g. "LanguageCode") to include
  2475. // in API requests with the JSON null value. By default, fields with
  2476. // empty values are omitted from API requests. However, any field with
  2477. // an empty value appearing in NullFields will be sent to the server as
  2478. // null. It is an error if a field in this list has a non-empty value.
  2479. // This may be used to include null fields in Patch requests.
  2480. NullFields []string `json:"-"`
  2481. }
  2482. func (s *GoogleCloudDialogflowV2beta1EventInput) MarshalJSON() ([]byte, error) {
  2483. type NoMethod GoogleCloudDialogflowV2beta1EventInput
  2484. raw := NoMethod(*s)
  2485. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2486. }
  2487. // GoogleCloudDialogflowV2beta1ExportAgentRequest: The request message
  2488. // for Agents.ExportAgent.
  2489. type GoogleCloudDialogflowV2beta1ExportAgentRequest struct {
  2490. // AgentUri: Optional. The
  2491. // [Google Cloud Storage](https://cloud.google.com/storage/docs/)
  2492. // URI to export the agent to.
  2493. // The format of this URI must be `gs://<bucket-name>/<object-name>`.
  2494. // If left unspecified, the serialized agent is returned inline.
  2495. AgentUri string `json:"agentUri,omitempty"`
  2496. // ForceSendFields is a list of field names (e.g. "AgentUri") to
  2497. // unconditionally include in API requests. By default, fields with
  2498. // empty values are omitted from API requests. However, any non-pointer,
  2499. // non-interface field appearing in ForceSendFields will be sent to the
  2500. // server regardless of whether the field is empty or not. This may be
  2501. // used to include empty fields in Patch requests.
  2502. ForceSendFields []string `json:"-"`
  2503. // NullFields is a list of field names (e.g. "AgentUri") to include in
  2504. // API requests with the JSON null value. By default, fields with empty
  2505. // values are omitted from API requests. However, any field with an
  2506. // empty value appearing in NullFields will be sent to the server as
  2507. // null. It is an error if a field in this list has a non-empty value.
  2508. // This may be used to include null fields in Patch requests.
  2509. NullFields []string `json:"-"`
  2510. }
  2511. func (s *GoogleCloudDialogflowV2beta1ExportAgentRequest) MarshalJSON() ([]byte, error) {
  2512. type NoMethod GoogleCloudDialogflowV2beta1ExportAgentRequest
  2513. raw := NoMethod(*s)
  2514. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2515. }
  2516. // GoogleCloudDialogflowV2beta1ExportAgentResponse: The response message
  2517. // for Agents.ExportAgent.
  2518. type GoogleCloudDialogflowV2beta1ExportAgentResponse struct {
  2519. // AgentContent: The exported agent.
  2520. //
  2521. // Example for how to export an agent to a zip file via a command
  2522. // line:
  2523. //
  2524. // curl \
  2525. //
  2526. // 'https://dialogflow.googleapis.com/v2beta1/projects/<project_name>/age
  2527. // nt:export'\
  2528. // -X POST \
  2529. // -H 'Authorization: Bearer '$(gcloud auth print-access-token) \
  2530. // -H 'Accept: application/json' \
  2531. // -H 'Content-Type: application/json' \
  2532. // --compressed \
  2533. // --data-binary '{}' \
  2534. // | grep agentContent | sed -e 's/.*"agentContent": "\([^"]*\)".*/\1/'
  2535. // \
  2536. // | base64 --decode > <agent zip file>
  2537. AgentContent string `json:"agentContent,omitempty"`
  2538. // AgentUri: The URI to a file containing the exported agent. This field
  2539. // is populated
  2540. // only if `agent_uri` is specified in `ExportAgentRequest`.
  2541. AgentUri string `json:"agentUri,omitempty"`
  2542. // ForceSendFields is a list of field names (e.g. "AgentContent") to
  2543. // unconditionally include in API requests. By default, fields with
  2544. // empty values are omitted from API requests. However, any non-pointer,
  2545. // non-interface field appearing in ForceSendFields will be sent to the
  2546. // server regardless of whether the field is empty or not. This may be
  2547. // used to include empty fields in Patch requests.
  2548. ForceSendFields []string `json:"-"`
  2549. // NullFields is a list of field names (e.g. "AgentContent") to include
  2550. // in API requests with the JSON null value. By default, fields with
  2551. // empty values are omitted from API requests. However, any field with
  2552. // an empty value appearing in NullFields will be sent to the server as
  2553. // null. It is an error if a field in this list has a non-empty value.
  2554. // This may be used to include null fields in Patch requests.
  2555. NullFields []string `json:"-"`
  2556. }
  2557. func (s *GoogleCloudDialogflowV2beta1ExportAgentResponse) MarshalJSON() ([]byte, error) {
  2558. type NoMethod GoogleCloudDialogflowV2beta1ExportAgentResponse
  2559. raw := NoMethod(*s)
  2560. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2561. }
  2562. // GoogleCloudDialogflowV2beta1ImportAgentRequest: The request message
  2563. // for Agents.ImportAgent.
  2564. type GoogleCloudDialogflowV2beta1ImportAgentRequest struct {
  2565. // AgentContent: The agent to import.
  2566. //
  2567. // Example for how to import an agent via the command line:
  2568. //
  2569. // curl \
  2570. //
  2571. // 'https://dialogflow.googleapis.com/v2beta1/projects/<project_name>/age
  2572. // nt:import\
  2573. // -X POST \
  2574. // -H 'Authorization: Bearer '$(gcloud auth print-access-token) \
  2575. // -H 'Accept: application/json' \
  2576. // -H 'Content-Type: application/json' \
  2577. // --compressed \
  2578. // --data-binary "{
  2579. // 'agentContent': '$(cat <agent zip file> | base64 -w 0)'
  2580. // }"
  2581. AgentContent string `json:"agentContent,omitempty"`
  2582. // AgentUri: The URI to a Google Cloud Storage file containing the agent
  2583. // to import.
  2584. // Note: The URI must start with "gs://".
  2585. AgentUri string `json:"agentUri,omitempty"`
  2586. // ForceSendFields is a list of field names (e.g. "AgentContent") to
  2587. // unconditionally include in API requests. By default, fields with
  2588. // empty values are omitted from API requests. However, any non-pointer,
  2589. // non-interface field appearing in ForceSendFields will be sent to the
  2590. // server regardless of whether the field is empty or not. This may be
  2591. // used to include empty fields in Patch requests.
  2592. ForceSendFields []string `json:"-"`
  2593. // NullFields is a list of field names (e.g. "AgentContent") to include
  2594. // in API requests with the JSON null value. By default, fields with
  2595. // empty values are omitted from API requests. However, any field with
  2596. // an empty value appearing in NullFields will be sent to the server as
  2597. // null. It is an error if a field in this list has a non-empty value.
  2598. // This may be used to include null fields in Patch requests.
  2599. NullFields []string `json:"-"`
  2600. }
  2601. func (s *GoogleCloudDialogflowV2beta1ImportAgentRequest) MarshalJSON() ([]byte, error) {
  2602. type NoMethod GoogleCloudDialogflowV2beta1ImportAgentRequest
  2603. raw := NoMethod(*s)
  2604. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2605. }
  2606. // GoogleCloudDialogflowV2beta1InputAudioConfig: Instructs the speech
  2607. // recognizer how to process the audio content.
  2608. type GoogleCloudDialogflowV2beta1InputAudioConfig struct {
  2609. // AudioEncoding: Required. Audio encoding of the audio content to
  2610. // process.
  2611. //
  2612. // Possible values:
  2613. // "AUDIO_ENCODING_UNSPECIFIED" - Not specified.
  2614. // "AUDIO_ENCODING_LINEAR_16" - Uncompressed 16-bit signed
  2615. // little-endian samples (Linear PCM).
  2616. // "AUDIO_ENCODING_FLAC" -
  2617. // [`FLAC`](https://xiph.org/flac/documentation.html) (Free Lossless
  2618. // Audio
  2619. // Codec) is the recommended encoding because it is lossless
  2620. // (therefore
  2621. // recognition is not compromised) and requires only about half
  2622. // the
  2623. // bandwidth of `LINEAR16`. `FLAC` stream encoding supports 16-bit
  2624. // and
  2625. // 24-bit samples, however, not all fields in `STREAMINFO` are
  2626. // supported.
  2627. // "AUDIO_ENCODING_MULAW" - 8-bit samples that compand 14-bit audio
  2628. // samples using G.711 PCMU/mu-law.
  2629. // "AUDIO_ENCODING_AMR" - Adaptive Multi-Rate Narrowband codec.
  2630. // `sample_rate_hertz` must be 8000.
  2631. // "AUDIO_ENCODING_AMR_WB" - Adaptive Multi-Rate Wideband codec.
  2632. // `sample_rate_hertz` must be 16000.
  2633. // "AUDIO_ENCODING_OGG_OPUS" - Opus encoded audio frames in Ogg
  2634. // container
  2635. // ([OggOpus](https://wiki.xiph.org/OggOpus)).
  2636. // `sample_rate_her
  2637. // tz` must be 16000.
  2638. // "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE" - Although the use of lossy
  2639. // encodings is not recommended, if a very low
  2640. // bitrate encoding is required, `OGG_OPUS` is highly preferred
  2641. // over
  2642. // Speex encoding. The [Speex](https://speex.org/) encoding supported
  2643. // by
  2644. // Dialogflow API has a header byte in each block, as in MIME
  2645. // type
  2646. // `audio/x-speex-with-header-byte`.
  2647. // It is a variant of the RTP Speex encoding defined in
  2648. // [RFC 5574](https://tools.ietf.org/html/rfc5574).
  2649. // The stream is a sequence of blocks, one block per RTP packet. Each
  2650. // block
  2651. // starts with a byte containing the length of the block, in bytes,
  2652. // followed
  2653. // by one or more frames of Speex data, padded to an integral number
  2654. // of
  2655. // bytes (octets) as specified in RFC 5574. In other words, each RTP
  2656. // header
  2657. // is replaced with a single byte containing the block length. Only
  2658. // Speex
  2659. // wideband is supported. `sample_rate_hertz` must be 16000.
  2660. AudioEncoding string `json:"audioEncoding,omitempty"`
  2661. // LanguageCode: Required. The language of the supplied audio.
  2662. // Dialogflow does not do
  2663. // translations. See
  2664. // [Language
  2665. // Support](https://dialogflow.com/docs/languages) for a list of
  2666. // the
  2667. // currently supported language codes. Note that queries in the same
  2668. // session
  2669. // do not necessarily need to specify the same language.
  2670. LanguageCode string `json:"languageCode,omitempty"`
  2671. // PhraseHints: Optional. The collection of phrase hints which are used
  2672. // to boost accuracy
  2673. // of speech recognition.
  2674. // Refer to
  2675. // [Cloud Speech
  2676. // API
  2677. // documentation](https://cloud.google.com/speech-to-text/docs/basics
  2678. // #phrase-hints)
  2679. // for more details.
  2680. PhraseHints []string `json:"phraseHints,omitempty"`
  2681. // SampleRateHertz: Required. Sample rate (in Hertz) of the audio
  2682. // content sent in the query.
  2683. // Refer to
  2684. // [Cloud Speech
  2685. // API
  2686. // documentation](https://cloud.google.com/speech-to-text/docs/basics
  2687. // ) for
  2688. // more details.
  2689. SampleRateHertz int64 `json:"sampleRateHertz,omitempty"`
  2690. // ForceSendFields is a list of field names (e.g. "AudioEncoding") to
  2691. // unconditionally include in API requests. By default, fields with
  2692. // empty values are omitted from API requests. However, any non-pointer,
  2693. // non-interface field appearing in ForceSendFields will be sent to the
  2694. // server regardless of whether the field is empty or not. This may be
  2695. // used to include empty fields in Patch requests.
  2696. ForceSendFields []string `json:"-"`
  2697. // NullFields is a list of field names (e.g. "AudioEncoding") to include
  2698. // in API requests with the JSON null value. By default, fields with
  2699. // empty values are omitted from API requests. However, any field with
  2700. // an empty value appearing in NullFields will be sent to the server as
  2701. // null. It is an error if a field in this list has a non-empty value.
  2702. // This may be used to include null fields in Patch requests.
  2703. NullFields []string `json:"-"`
  2704. }
  2705. func (s *GoogleCloudDialogflowV2beta1InputAudioConfig) MarshalJSON() ([]byte, error) {
  2706. type NoMethod GoogleCloudDialogflowV2beta1InputAudioConfig
  2707. raw := NoMethod(*s)
  2708. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2709. }
  2710. // GoogleCloudDialogflowV2beta1Intent: Represents an intent.
  2711. // Intents convert a number of user expressions or patterns into an
  2712. // action. An
  2713. // action is an extraction of a user command or sentence semantics.
  2714. // Next available field number: 22.
  2715. type GoogleCloudDialogflowV2beta1Intent struct {
  2716. // Action: Optional. The name of the action associated with the intent.
  2717. Action string `json:"action,omitempty"`
  2718. // DefaultResponsePlatforms: Optional. The list of platforms for which
  2719. // the first response will be
  2720. // taken from among the messages assigned to the DEFAULT_PLATFORM.
  2721. //
  2722. // Possible values:
  2723. // "PLATFORM_UNSPECIFIED" - Not specified.
  2724. // "FACEBOOK" - Facebook.
  2725. // "SLACK" - Slack.
  2726. // "TELEGRAM" - Telegram.
  2727. // "KIK" - Kik.
  2728. // "SKYPE" - Skype.
  2729. // "LINE" - Line.
  2730. // "VIBER" - Viber.
  2731. // "ACTIONS_ON_GOOGLE" - Actions on Google.
  2732. // When using Actions on Google, you can choose one of the
  2733. // specific
  2734. // Intent.Message types that mention support for Actions on Google,
  2735. // or you can use the advanced Intent.Message.payload field.
  2736. // The payload field provides access to AoG features not available in
  2737. // the
  2738. // specific message types.
  2739. // If using the Intent.Message.payload field, it should have a
  2740. // structure
  2741. // similar to the JSON message shown here. For more information,
  2742. // see
  2743. // [Actions on Google
  2744. // Webhook
  2745. // Format](https://developers.google.com/actions/dialogflow/webho
  2746. // ok)
  2747. // <pre>{
  2748. // "expectUserResponse": true,
  2749. // "isSsml": false,
  2750. // "noInputPrompts": [],
  2751. // "richResponse": {
  2752. // "items": [
  2753. // {
  2754. // "simpleResponse": {
  2755. // "displayText": "hi",
  2756. // "textToSpeech": "hello"
  2757. // }
  2758. // }
  2759. // ],
  2760. // "suggestions": [
  2761. // {
  2762. // "title": "Say this"
  2763. // },
  2764. // {
  2765. // "title": "or this"
  2766. // }
  2767. // ]
  2768. // },
  2769. // "systemIntent": {
  2770. // "data": {
  2771. // "@type":
  2772. // "type.googleapis.com/google.actions.v2.OptionValueSpec",
  2773. // "listSelect": {
  2774. // "items": [
  2775. // {
  2776. // "optionInfo": {
  2777. // "key": "key1",
  2778. // "synonyms": [
  2779. // "key one"
  2780. // ]
  2781. // },
  2782. // "title": "must not be empty, but unique"
  2783. // },
  2784. // {
  2785. // "optionInfo": {
  2786. // "key": "key2",
  2787. // "synonyms": [
  2788. // "key two"
  2789. // ]
  2790. // },
  2791. // "title": "must not be empty, but unique"
  2792. // }
  2793. // ]
  2794. // }
  2795. // },
  2796. // "intent": "actions.intent.OPTION"
  2797. // }
  2798. // }</pre>
  2799. DefaultResponsePlatforms []string `json:"defaultResponsePlatforms,omitempty"`
  2800. // DisplayName: Required. The name of this intent.
  2801. DisplayName string `json:"displayName,omitempty"`
  2802. // Events: Optional. The collection of event names that trigger the
  2803. // intent.
  2804. // If the collection of input contexts is not empty, all of the contexts
  2805. // must
  2806. // be present in the active user session for an event to trigger this
  2807. // intent.
  2808. Events []string `json:"events,omitempty"`
  2809. // FollowupIntentInfo: Optional. Collection of information about all
  2810. // followup intents that have
  2811. // name of this intent as a root_name.
  2812. FollowupIntentInfo []*GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo `json:"followupIntentInfo,omitempty"`
  2813. // InputContextNames: Optional. The list of context names required for
  2814. // this intent to be
  2815. // triggered.
  2816. // Format: `projects/<Project ID>/agent/sessions/-/contexts/<Context
  2817. // ID>`.
  2818. InputContextNames []string `json:"inputContextNames,omitempty"`
  2819. // IsFallback: Optional. Indicates whether this is a fallback intent.
  2820. IsFallback bool `json:"isFallback,omitempty"`
  2821. // Messages: Optional. The collection of rich messages corresponding to
  2822. // the
  2823. // `Response` field in the Dialogflow console.
  2824. Messages []*GoogleCloudDialogflowV2beta1IntentMessage `json:"messages,omitempty"`
  2825. // MlDisabled: Optional. Indicates whether Machine Learning is disabled
  2826. // for the intent.
  2827. // Note: If `ml_disabled` setting is set to true, then this intent is
  2828. // not
  2829. // taken into account during inference in `ML ONLY` match mode.
  2830. // Also,
  2831. // auto-markup in the UI is turned off.
  2832. MlDisabled bool `json:"mlDisabled,omitempty"`
  2833. // MlEnabled: Optional. Indicates whether Machine Learning is enabled
  2834. // for the intent.
  2835. // Note: If `ml_enabled` setting is set to false, then this intent is
  2836. // not
  2837. // taken into account during inference in `ML ONLY` match mode.
  2838. // Also,
  2839. // auto-markup in the UI is turned off.
  2840. // DEPRECATED! Please use `ml_disabled` field instead.
  2841. // NOTE: If both `ml_enabled` and `ml_disabled` are either not set or
  2842. // false,
  2843. // then the default value is determined as follows:
  2844. // - Before April 15th, 2018 the default is:
  2845. // ml_enabled = false / ml_disabled = true.
  2846. // - After April 15th, 2018 the default is:
  2847. // ml_enabled = true / ml_disabled = false.
  2848. MlEnabled bool `json:"mlEnabled,omitempty"`
  2849. // Name: Required for all methods except `create` (`create` populates
  2850. // the name
  2851. // automatically.
  2852. // The unique identifier of this intent.
  2853. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  2854. Name string `json:"name,omitempty"`
  2855. // OutputContexts: Optional. The collection of contexts that are
  2856. // activated when the intent
  2857. // is matched. Context messages in this collection should not set
  2858. // the
  2859. // parameters field. Setting the `lifespan_count` to 0 will reset the
  2860. // context
  2861. // when the intent is matched.
  2862. // Format: `projects/<Project ID>/agent/sessions/-/contexts/<Context
  2863. // ID>`.
  2864. OutputContexts []*GoogleCloudDialogflowV2beta1Context `json:"outputContexts,omitempty"`
  2865. // Parameters: Optional. The collection of parameters associated with
  2866. // the intent.
  2867. Parameters []*GoogleCloudDialogflowV2beta1IntentParameter `json:"parameters,omitempty"`
  2868. // ParentFollowupIntentName: The unique identifier of the parent intent
  2869. // in the chain of followup
  2870. // intents.
  2871. // It identifies the parent followup intent.
  2872. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  2873. ParentFollowupIntentName string `json:"parentFollowupIntentName,omitempty"`
  2874. // Priority: Optional. The priority of this intent. Higher numbers
  2875. // represent higher
  2876. // priorities. Zero or negative numbers mean that the intent is
  2877. // disabled.
  2878. Priority int64 `json:"priority,omitempty"`
  2879. // ResetContexts: Optional. Indicates whether to delete all contexts in
  2880. // the current
  2881. // session when this intent is matched.
  2882. ResetContexts bool `json:"resetContexts,omitempty"`
  2883. // RootFollowupIntentName: The unique identifier of the root intent in
  2884. // the chain of followup intents.
  2885. // It identifies the correct followup intents chain for this
  2886. // intent.
  2887. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  2888. RootFollowupIntentName string `json:"rootFollowupIntentName,omitempty"`
  2889. // TrainingPhrases: Optional. The collection of examples/templates that
  2890. // the agent is
  2891. // trained on.
  2892. TrainingPhrases []*GoogleCloudDialogflowV2beta1IntentTrainingPhrase `json:"trainingPhrases,omitempty"`
  2893. // WebhookState: Required. Indicates whether webhooks are enabled for
  2894. // the intent.
  2895. //
  2896. // Possible values:
  2897. // "WEBHOOK_STATE_UNSPECIFIED" - Webhook is disabled in the agent and
  2898. // in the intent.
  2899. // "WEBHOOK_STATE_ENABLED" - Webhook is enabled in the agent and in
  2900. // the intent.
  2901. // "WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING" - Webhook is enabled in
  2902. // the agent and in the intent. Also, each slot
  2903. // filling prompt is forwarded to the webhook.
  2904. WebhookState string `json:"webhookState,omitempty"`
  2905. // ServerResponse contains the HTTP response code and headers from the
  2906. // server.
  2907. googleapi.ServerResponse `json:"-"`
  2908. // ForceSendFields is a list of field names (e.g. "Action") to
  2909. // unconditionally include in API requests. By default, fields with
  2910. // empty values are omitted from API requests. However, any non-pointer,
  2911. // non-interface field appearing in ForceSendFields will be sent to the
  2912. // server regardless of whether the field is empty or not. This may be
  2913. // used to include empty fields in Patch requests.
  2914. ForceSendFields []string `json:"-"`
  2915. // NullFields is a list of field names (e.g. "Action") to include in API
  2916. // requests with the JSON null value. By default, fields with empty
  2917. // values are omitted from API requests. However, any field with an
  2918. // empty value appearing in NullFields will be sent to the server as
  2919. // null. It is an error if a field in this list has a non-empty value.
  2920. // This may be used to include null fields in Patch requests.
  2921. NullFields []string `json:"-"`
  2922. }
  2923. func (s *GoogleCloudDialogflowV2beta1Intent) MarshalJSON() ([]byte, error) {
  2924. type NoMethod GoogleCloudDialogflowV2beta1Intent
  2925. raw := NoMethod(*s)
  2926. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2927. }
  2928. // GoogleCloudDialogflowV2beta1IntentBatch: This message is a wrapper
  2929. // around a collection of intents.
  2930. type GoogleCloudDialogflowV2beta1IntentBatch struct {
  2931. // Intents: A collection of intents.
  2932. Intents []*GoogleCloudDialogflowV2beta1Intent `json:"intents,omitempty"`
  2933. // ForceSendFields is a list of field names (e.g. "Intents") to
  2934. // unconditionally include in API requests. By default, fields with
  2935. // empty values are omitted from API requests. However, any non-pointer,
  2936. // non-interface field appearing in ForceSendFields will be sent to the
  2937. // server regardless of whether the field is empty or not. This may be
  2938. // used to include empty fields in Patch requests.
  2939. ForceSendFields []string `json:"-"`
  2940. // NullFields is a list of field names (e.g. "Intents") to include in
  2941. // API requests with the JSON null value. By default, fields with empty
  2942. // values are omitted from API requests. However, any field with an
  2943. // empty value appearing in NullFields will be sent to the server as
  2944. // null. It is an error if a field in this list has a non-empty value.
  2945. // This may be used to include null fields in Patch requests.
  2946. NullFields []string `json:"-"`
  2947. }
  2948. func (s *GoogleCloudDialogflowV2beta1IntentBatch) MarshalJSON() ([]byte, error) {
  2949. type NoMethod GoogleCloudDialogflowV2beta1IntentBatch
  2950. raw := NoMethod(*s)
  2951. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2952. }
  2953. // GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo: Represents a
  2954. // single followup intent in the chain.
  2955. type GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo struct {
  2956. // FollowupIntentName: The unique identifier of the followup
  2957. // intent.
  2958. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  2959. FollowupIntentName string `json:"followupIntentName,omitempty"`
  2960. // ParentFollowupIntentName: The unique identifier of the followup
  2961. // intent parent.
  2962. // Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
  2963. ParentFollowupIntentName string `json:"parentFollowupIntentName,omitempty"`
  2964. // ForceSendFields is a list of field names (e.g. "FollowupIntentName")
  2965. // to unconditionally include in API requests. By default, fields with
  2966. // empty values are omitted from API requests. However, any non-pointer,
  2967. // non-interface field appearing in ForceSendFields will be sent to the
  2968. // server regardless of whether the field is empty or not. This may be
  2969. // used to include empty fields in Patch requests.
  2970. ForceSendFields []string `json:"-"`
  2971. // NullFields is a list of field names (e.g. "FollowupIntentName") to
  2972. // include in API requests with the JSON null value. By default, fields
  2973. // with empty values are omitted from API requests. However, any field
  2974. // with an empty value appearing in NullFields will be sent to the
  2975. // server as null. It is an error if a field in this list has a
  2976. // non-empty value. This may be used to include null fields in Patch
  2977. // requests.
  2978. NullFields []string `json:"-"`
  2979. }
  2980. func (s *GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo) MarshalJSON() ([]byte, error) {
  2981. type NoMethod GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo
  2982. raw := NoMethod(*s)
  2983. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2984. }
  2985. // GoogleCloudDialogflowV2beta1IntentMessage: Corresponds to the
  2986. // `Response` field in the Dialogflow console.
  2987. type GoogleCloudDialogflowV2beta1IntentMessage struct {
  2988. // BasicCard: Displays a basic card for Actions on Google.
  2989. BasicCard *GoogleCloudDialogflowV2beta1IntentMessageBasicCard `json:"basicCard,omitempty"`
  2990. // Card: Displays a card.
  2991. Card *GoogleCloudDialogflowV2beta1IntentMessageCard `json:"card,omitempty"`
  2992. // CarouselSelect: Displays a carousel card for Actions on Google.
  2993. CarouselSelect *GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect `json:"carouselSelect,omitempty"`
  2994. // Image: Displays an image.
  2995. Image *GoogleCloudDialogflowV2beta1IntentMessageImage `json:"image,omitempty"`
  2996. // LinkOutSuggestion: Displays a link out suggestion chip for Actions on
  2997. // Google.
  2998. LinkOutSuggestion *GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion `json:"linkOutSuggestion,omitempty"`
  2999. // ListSelect: Displays a list card for Actions on Google.
  3000. ListSelect *GoogleCloudDialogflowV2beta1IntentMessageListSelect `json:"listSelect,omitempty"`
  3001. // Payload: Returns a response containing a custom, platform-specific
  3002. // payload.
  3003. // See the Intent.Message.Platform type for a description of
  3004. // the
  3005. // structure that may be required for your platform.
  3006. Payload googleapi.RawMessage `json:"payload,omitempty"`
  3007. // Platform: Optional. The platform that this message is intended for.
  3008. //
  3009. // Possible values:
  3010. // "PLATFORM_UNSPECIFIED" - Not specified.
  3011. // "FACEBOOK" - Facebook.
  3012. // "SLACK" - Slack.
  3013. // "TELEGRAM" - Telegram.
  3014. // "KIK" - Kik.
  3015. // "SKYPE" - Skype.
  3016. // "LINE" - Line.
  3017. // "VIBER" - Viber.
  3018. // "ACTIONS_ON_GOOGLE" - Actions on Google.
  3019. // When using Actions on Google, you can choose one of the
  3020. // specific
  3021. // Intent.Message types that mention support for Actions on Google,
  3022. // or you can use the advanced Intent.Message.payload field.
  3023. // The payload field provides access to AoG features not available in
  3024. // the
  3025. // specific message types.
  3026. // If using the Intent.Message.payload field, it should have a
  3027. // structure
  3028. // similar to the JSON message shown here. For more information,
  3029. // see
  3030. // [Actions on Google
  3031. // Webhook
  3032. // Format](https://developers.google.com/actions/dialogflow/webho
  3033. // ok)
  3034. // <pre>{
  3035. // "expectUserResponse": true,
  3036. // "isSsml": false,
  3037. // "noInputPrompts": [],
  3038. // "richResponse": {
  3039. // "items": [
  3040. // {
  3041. // "simpleResponse": {
  3042. // "displayText": "hi",
  3043. // "textToSpeech": "hello"
  3044. // }
  3045. // }
  3046. // ],
  3047. // "suggestions": [
  3048. // {
  3049. // "title": "Say this"
  3050. // },
  3051. // {
  3052. // "title": "or this"
  3053. // }
  3054. // ]
  3055. // },
  3056. // "systemIntent": {
  3057. // "data": {
  3058. // "@type":
  3059. // "type.googleapis.com/google.actions.v2.OptionValueSpec",
  3060. // "listSelect": {
  3061. // "items": [
  3062. // {
  3063. // "optionInfo": {
  3064. // "key": "key1",
  3065. // "synonyms": [
  3066. // "key one"
  3067. // ]
  3068. // },
  3069. // "title": "must not be empty, but unique"
  3070. // },
  3071. // {
  3072. // "optionInfo": {
  3073. // "key": "key2",
  3074. // "synonyms": [
  3075. // "key two"
  3076. // ]
  3077. // },
  3078. // "title": "must not be empty, but unique"
  3079. // }
  3080. // ]
  3081. // }
  3082. // },
  3083. // "intent": "actions.intent.OPTION"
  3084. // }
  3085. // }</pre>
  3086. Platform string `json:"platform,omitempty"`
  3087. // QuickReplies: Displays quick replies.
  3088. QuickReplies *GoogleCloudDialogflowV2beta1IntentMessageQuickReplies `json:"quickReplies,omitempty"`
  3089. // SimpleResponses: Returns a voice or text-only response for Actions on
  3090. // Google.
  3091. SimpleResponses *GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses `json:"simpleResponses,omitempty"`
  3092. // Suggestions: Displays suggestion chips for Actions on Google.
  3093. Suggestions *GoogleCloudDialogflowV2beta1IntentMessageSuggestions `json:"suggestions,omitempty"`
  3094. // Text: Returns a text response.
  3095. Text *GoogleCloudDialogflowV2beta1IntentMessageText `json:"text,omitempty"`
  3096. // ForceSendFields is a list of field names (e.g. "BasicCard") to
  3097. // unconditionally include in API requests. By default, fields with
  3098. // empty values are omitted from API requests. However, any non-pointer,
  3099. // non-interface field appearing in ForceSendFields will be sent to the
  3100. // server regardless of whether the field is empty or not. This may be
  3101. // used to include empty fields in Patch requests.
  3102. ForceSendFields []string `json:"-"`
  3103. // NullFields is a list of field names (e.g. "BasicCard") to include in
  3104. // API requests with the JSON null value. By default, fields with empty
  3105. // values are omitted from API requests. However, any field with an
  3106. // empty value appearing in NullFields will be sent to the server as
  3107. // null. It is an error if a field in this list has a non-empty value.
  3108. // This may be used to include null fields in Patch requests.
  3109. NullFields []string `json:"-"`
  3110. }
  3111. func (s *GoogleCloudDialogflowV2beta1IntentMessage) MarshalJSON() ([]byte, error) {
  3112. type NoMethod GoogleCloudDialogflowV2beta1IntentMessage
  3113. raw := NoMethod(*s)
  3114. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3115. }
  3116. // GoogleCloudDialogflowV2beta1IntentMessageBasicCard: The basic card
  3117. // message. Useful for displaying information.
  3118. type GoogleCloudDialogflowV2beta1IntentMessageBasicCard struct {
  3119. // Buttons: Optional. The collection of card buttons.
  3120. Buttons []*GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton `json:"buttons,omitempty"`
  3121. // FormattedText: Required, unless image is present. The body text of
  3122. // the card.
  3123. FormattedText string `json:"formattedText,omitempty"`
  3124. // Image: Optional. The image for the card.
  3125. Image *GoogleCloudDialogflowV2beta1IntentMessageImage `json:"image,omitempty"`
  3126. // Subtitle: Optional. The subtitle of the card.
  3127. Subtitle string `json:"subtitle,omitempty"`
  3128. // Title: Optional. The title of the card.
  3129. Title string `json:"title,omitempty"`
  3130. // ForceSendFields is a list of field names (e.g. "Buttons") to
  3131. // unconditionally include in API requests. By default, fields with
  3132. // empty values are omitted from API requests. However, any non-pointer,
  3133. // non-interface field appearing in ForceSendFields will be sent to the
  3134. // server regardless of whether the field is empty or not. This may be
  3135. // used to include empty fields in Patch requests.
  3136. ForceSendFields []string `json:"-"`
  3137. // NullFields is a list of field names (e.g. "Buttons") to include in
  3138. // API requests with the JSON null value. By default, fields with empty
  3139. // values are omitted from API requests. However, any field with an
  3140. // empty value appearing in NullFields will be sent to the server as
  3141. // null. It is an error if a field in this list has a non-empty value.
  3142. // This may be used to include null fields in Patch requests.
  3143. NullFields []string `json:"-"`
  3144. }
  3145. func (s *GoogleCloudDialogflowV2beta1IntentMessageBasicCard) MarshalJSON() ([]byte, error) {
  3146. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageBasicCard
  3147. raw := NoMethod(*s)
  3148. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3149. }
  3150. // GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton: The button
  3151. // object that appears at the bottom of a card.
  3152. type GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton struct {
  3153. // OpenUriAction: Required. Action to take when a user taps on the
  3154. // button.
  3155. OpenUriAction *GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction `json:"openUriAction,omitempty"`
  3156. // Title: Required. The title of the button.
  3157. Title string `json:"title,omitempty"`
  3158. // ForceSendFields is a list of field names (e.g. "OpenUriAction") to
  3159. // unconditionally include in API requests. By default, fields with
  3160. // empty values are omitted from API requests. However, any non-pointer,
  3161. // non-interface field appearing in ForceSendFields will be sent to the
  3162. // server regardless of whether the field is empty or not. This may be
  3163. // used to include empty fields in Patch requests.
  3164. ForceSendFields []string `json:"-"`
  3165. // NullFields is a list of field names (e.g. "OpenUriAction") to include
  3166. // in API requests with the JSON null value. By default, fields with
  3167. // empty values are omitted from API requests. However, any field with
  3168. // an empty value appearing in NullFields will be sent to the server as
  3169. // null. It is an error if a field in this list has a non-empty value.
  3170. // This may be used to include null fields in Patch requests.
  3171. NullFields []string `json:"-"`
  3172. }
  3173. func (s *GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton) MarshalJSON() ([]byte, error) {
  3174. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton
  3175. raw := NoMethod(*s)
  3176. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3177. }
  3178. // GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction:
  3179. // Opens the given URI.
  3180. type GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction struct {
  3181. // Uri: Required. The HTTP or HTTPS scheme URI.
  3182. Uri string `json:"uri,omitempty"`
  3183. // ForceSendFields is a list of field names (e.g. "Uri") to
  3184. // unconditionally include in API requests. By default, fields with
  3185. // empty values are omitted from API requests. However, any non-pointer,
  3186. // non-interface field appearing in ForceSendFields will be sent to the
  3187. // server regardless of whether the field is empty or not. This may be
  3188. // used to include empty fields in Patch requests.
  3189. ForceSendFields []string `json:"-"`
  3190. // NullFields is a list of field names (e.g. "Uri") to include in API
  3191. // requests with the JSON null value. By default, fields with empty
  3192. // values are omitted from API requests. However, any field with an
  3193. // empty value appearing in NullFields will be sent to the server as
  3194. // null. It is an error if a field in this list has a non-empty value.
  3195. // This may be used to include null fields in Patch requests.
  3196. NullFields []string `json:"-"`
  3197. }
  3198. func (s *GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction) MarshalJSON() ([]byte, error) {
  3199. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction
  3200. raw := NoMethod(*s)
  3201. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3202. }
  3203. // GoogleCloudDialogflowV2beta1IntentMessageCard: The card response
  3204. // message.
  3205. type GoogleCloudDialogflowV2beta1IntentMessageCard struct {
  3206. // Buttons: Optional. The collection of card buttons.
  3207. Buttons []*GoogleCloudDialogflowV2beta1IntentMessageCardButton `json:"buttons,omitempty"`
  3208. // ImageUri: Optional. The public URI to an image file for the card.
  3209. ImageUri string `json:"imageUri,omitempty"`
  3210. // Subtitle: Optional. The subtitle of the card.
  3211. Subtitle string `json:"subtitle,omitempty"`
  3212. // Title: Optional. The title of the card.
  3213. Title string `json:"title,omitempty"`
  3214. // ForceSendFields is a list of field names (e.g. "Buttons") to
  3215. // unconditionally include in API requests. By default, fields with
  3216. // empty values are omitted from API requests. However, any non-pointer,
  3217. // non-interface field appearing in ForceSendFields will be sent to the
  3218. // server regardless of whether the field is empty or not. This may be
  3219. // used to include empty fields in Patch requests.
  3220. ForceSendFields []string `json:"-"`
  3221. // NullFields is a list of field names (e.g. "Buttons") to include in
  3222. // API requests with the JSON null value. By default, fields with empty
  3223. // values are omitted from API requests. However, any field with an
  3224. // empty value appearing in NullFields will be sent to the server as
  3225. // null. It is an error if a field in this list has a non-empty value.
  3226. // This may be used to include null fields in Patch requests.
  3227. NullFields []string `json:"-"`
  3228. }
  3229. func (s *GoogleCloudDialogflowV2beta1IntentMessageCard) MarshalJSON() ([]byte, error) {
  3230. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageCard
  3231. raw := NoMethod(*s)
  3232. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3233. }
  3234. // GoogleCloudDialogflowV2beta1IntentMessageCardButton: Optional.
  3235. // Contains information about a button.
  3236. type GoogleCloudDialogflowV2beta1IntentMessageCardButton struct {
  3237. // Postback: Optional. The text to send back to the Dialogflow API or a
  3238. // URI to
  3239. // open.
  3240. Postback string `json:"postback,omitempty"`
  3241. // Text: Optional. The text to show on the button.
  3242. Text string `json:"text,omitempty"`
  3243. // ForceSendFields is a list of field names (e.g. "Postback") to
  3244. // unconditionally include in API requests. By default, fields with
  3245. // empty values are omitted from API requests. However, any non-pointer,
  3246. // non-interface field appearing in ForceSendFields will be sent to the
  3247. // server regardless of whether the field is empty or not. This may be
  3248. // used to include empty fields in Patch requests.
  3249. ForceSendFields []string `json:"-"`
  3250. // NullFields is a list of field names (e.g. "Postback") to include in
  3251. // API requests with the JSON null value. By default, fields with empty
  3252. // values are omitted from API requests. However, any field with an
  3253. // empty value appearing in NullFields will be sent to the server as
  3254. // null. It is an error if a field in this list has a non-empty value.
  3255. // This may be used to include null fields in Patch requests.
  3256. NullFields []string `json:"-"`
  3257. }
  3258. func (s *GoogleCloudDialogflowV2beta1IntentMessageCardButton) MarshalJSON() ([]byte, error) {
  3259. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageCardButton
  3260. raw := NoMethod(*s)
  3261. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3262. }
  3263. // GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect: The card for
  3264. // presenting a carousel of options to select from.
  3265. type GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect struct {
  3266. // Items: Required. Carousel items.
  3267. Items []*GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem `json:"items,omitempty"`
  3268. // ForceSendFields is a list of field names (e.g. "Items") to
  3269. // unconditionally include in API requests. By default, fields with
  3270. // empty values are omitted from API requests. However, any non-pointer,
  3271. // non-interface field appearing in ForceSendFields will be sent to the
  3272. // server regardless of whether the field is empty or not. This may be
  3273. // used to include empty fields in Patch requests.
  3274. ForceSendFields []string `json:"-"`
  3275. // NullFields is a list of field names (e.g. "Items") to include in API
  3276. // requests with the JSON null value. By default, fields with empty
  3277. // values are omitted from API requests. However, any field with an
  3278. // empty value appearing in NullFields will be sent to the server as
  3279. // null. It is an error if a field in this list has a non-empty value.
  3280. // This may be used to include null fields in Patch requests.
  3281. NullFields []string `json:"-"`
  3282. }
  3283. func (s *GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect) MarshalJSON() ([]byte, error) {
  3284. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect
  3285. raw := NoMethod(*s)
  3286. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3287. }
  3288. // GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem: An item
  3289. // in the carousel.
  3290. type GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem struct {
  3291. // Description: Optional. The body text of the card.
  3292. Description string `json:"description,omitempty"`
  3293. // Image: Optional. The image to display.
  3294. Image *GoogleCloudDialogflowV2beta1IntentMessageImage `json:"image,omitempty"`
  3295. // Info: Required. Additional info about the option item.
  3296. Info *GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo `json:"info,omitempty"`
  3297. // Title: Required. Title of the carousel item.
  3298. Title string `json:"title,omitempty"`
  3299. // ForceSendFields is a list of field names (e.g. "Description") to
  3300. // unconditionally include in API requests. By default, fields with
  3301. // empty values are omitted from API requests. However, any non-pointer,
  3302. // non-interface field appearing in ForceSendFields will be sent to the
  3303. // server regardless of whether the field is empty or not. This may be
  3304. // used to include empty fields in Patch requests.
  3305. ForceSendFields []string `json:"-"`
  3306. // NullFields is a list of field names (e.g. "Description") to include
  3307. // in API requests with the JSON null value. By default, fields with
  3308. // empty values are omitted from API requests. However, any field with
  3309. // an empty value appearing in NullFields will be sent to the server as
  3310. // null. It is an error if a field in this list has a non-empty value.
  3311. // This may be used to include null fields in Patch requests.
  3312. NullFields []string `json:"-"`
  3313. }
  3314. func (s *GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem) MarshalJSON() ([]byte, error) {
  3315. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem
  3316. raw := NoMethod(*s)
  3317. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3318. }
  3319. // GoogleCloudDialogflowV2beta1IntentMessageImage: The image response
  3320. // message.
  3321. type GoogleCloudDialogflowV2beta1IntentMessageImage struct {
  3322. // AccessibilityText: A text description of the image to be used for
  3323. // accessibility,
  3324. // e.g., screen readers. Required if image_uri is set for
  3325. // CarouselSelect.
  3326. AccessibilityText string `json:"accessibilityText,omitempty"`
  3327. // ImageUri: Optional. The public URI to an image file.
  3328. ImageUri string `json:"imageUri,omitempty"`
  3329. // ForceSendFields is a list of field names (e.g. "AccessibilityText")
  3330. // to unconditionally include in API requests. By default, fields with
  3331. // empty values are omitted from API requests. However, any non-pointer,
  3332. // non-interface field appearing in ForceSendFields will be sent to the
  3333. // server regardless of whether the field is empty or not. This may be
  3334. // used to include empty fields in Patch requests.
  3335. ForceSendFields []string `json:"-"`
  3336. // NullFields is a list of field names (e.g. "AccessibilityText") to
  3337. // include in API requests with the JSON null value. By default, fields
  3338. // with empty values are omitted from API requests. However, any field
  3339. // with an empty value appearing in NullFields will be sent to the
  3340. // server as null. It is an error if a field in this list has a
  3341. // non-empty value. This may be used to include null fields in Patch
  3342. // requests.
  3343. NullFields []string `json:"-"`
  3344. }
  3345. func (s *GoogleCloudDialogflowV2beta1IntentMessageImage) MarshalJSON() ([]byte, error) {
  3346. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageImage
  3347. raw := NoMethod(*s)
  3348. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3349. }
  3350. // GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion: The
  3351. // suggestion chip message that allows the user to jump out to the
  3352. // app
  3353. // or website associated with this agent.
  3354. type GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion struct {
  3355. // DestinationName: Required. The name of the app or site this chip is
  3356. // linking to.
  3357. DestinationName string `json:"destinationName,omitempty"`
  3358. // Uri: Required. The URI of the app or site to open when the user taps
  3359. // the
  3360. // suggestion chip.
  3361. Uri string `json:"uri,omitempty"`
  3362. // ForceSendFields is a list of field names (e.g. "DestinationName") to
  3363. // unconditionally include in API requests. By default, fields with
  3364. // empty values are omitted from API requests. However, any non-pointer,
  3365. // non-interface field appearing in ForceSendFields will be sent to the
  3366. // server regardless of whether the field is empty or not. This may be
  3367. // used to include empty fields in Patch requests.
  3368. ForceSendFields []string `json:"-"`
  3369. // NullFields is a list of field names (e.g. "DestinationName") to
  3370. // include in API requests with the JSON null value. By default, fields
  3371. // with empty values are omitted from API requests. However, any field
  3372. // with an empty value appearing in NullFields will be sent to the
  3373. // server as null. It is an error if a field in this list has a
  3374. // non-empty value. This may be used to include null fields in Patch
  3375. // requests.
  3376. NullFields []string `json:"-"`
  3377. }
  3378. func (s *GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion) MarshalJSON() ([]byte, error) {
  3379. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion
  3380. raw := NoMethod(*s)
  3381. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3382. }
  3383. // GoogleCloudDialogflowV2beta1IntentMessageListSelect: The card for
  3384. // presenting a list of options to select from.
  3385. type GoogleCloudDialogflowV2beta1IntentMessageListSelect struct {
  3386. // Items: Required. List items.
  3387. Items []*GoogleCloudDialogflowV2beta1IntentMessageListSelectItem `json:"items,omitempty"`
  3388. // Title: Optional. The overall title of the list.
  3389. Title string `json:"title,omitempty"`
  3390. // ForceSendFields is a list of field names (e.g. "Items") to
  3391. // unconditionally include in API requests. By default, fields with
  3392. // empty values are omitted from API requests. However, any non-pointer,
  3393. // non-interface field appearing in ForceSendFields will be sent to the
  3394. // server regardless of whether the field is empty or not. This may be
  3395. // used to include empty fields in Patch requests.
  3396. ForceSendFields []string `json:"-"`
  3397. // NullFields is a list of field names (e.g. "Items") to include in API
  3398. // requests with the JSON null value. By default, fields with empty
  3399. // values are omitted from API requests. However, any field with an
  3400. // empty value appearing in NullFields will be sent to the server as
  3401. // null. It is an error if a field in this list has a non-empty value.
  3402. // This may be used to include null fields in Patch requests.
  3403. NullFields []string `json:"-"`
  3404. }
  3405. func (s *GoogleCloudDialogflowV2beta1IntentMessageListSelect) MarshalJSON() ([]byte, error) {
  3406. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageListSelect
  3407. raw := NoMethod(*s)
  3408. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3409. }
  3410. // GoogleCloudDialogflowV2beta1IntentMessageListSelectItem: An item in
  3411. // the list.
  3412. type GoogleCloudDialogflowV2beta1IntentMessageListSelectItem struct {
  3413. // Description: Optional. The main text describing the item.
  3414. Description string `json:"description,omitempty"`
  3415. // Image: Optional. The image to display.
  3416. Image *GoogleCloudDialogflowV2beta1IntentMessageImage `json:"image,omitempty"`
  3417. // Info: Required. Additional information about this option.
  3418. Info *GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo `json:"info,omitempty"`
  3419. // Title: Required. The title of the list item.
  3420. Title string `json:"title,omitempty"`
  3421. // ForceSendFields is a list of field names (e.g. "Description") to
  3422. // unconditionally include in API requests. By default, fields with
  3423. // empty values are omitted from API requests. However, any non-pointer,
  3424. // non-interface field appearing in ForceSendFields will be sent to the
  3425. // server regardless of whether the field is empty or not. This may be
  3426. // used to include empty fields in Patch requests.
  3427. ForceSendFields []string `json:"-"`
  3428. // NullFields is a list of field names (e.g. "Description") to include
  3429. // in API requests with the JSON null value. By default, fields with
  3430. // empty values are omitted from API requests. However, any field with
  3431. // an empty value appearing in NullFields will be sent to the server as
  3432. // null. It is an error if a field in this list has a non-empty value.
  3433. // This may be used to include null fields in Patch requests.
  3434. NullFields []string `json:"-"`
  3435. }
  3436. func (s *GoogleCloudDialogflowV2beta1IntentMessageListSelectItem) MarshalJSON() ([]byte, error) {
  3437. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageListSelectItem
  3438. raw := NoMethod(*s)
  3439. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3440. }
  3441. // GoogleCloudDialogflowV2beta1IntentMessageQuickReplies: The quick
  3442. // replies response message.
  3443. type GoogleCloudDialogflowV2beta1IntentMessageQuickReplies struct {
  3444. // QuickReplies: Optional. The collection of quick replies.
  3445. QuickReplies []string `json:"quickReplies,omitempty"`
  3446. // Title: Optional. The title of the collection of quick replies.
  3447. Title string `json:"title,omitempty"`
  3448. // ForceSendFields is a list of field names (e.g. "QuickReplies") to
  3449. // unconditionally include in API requests. By default, fields with
  3450. // empty values are omitted from API requests. However, any non-pointer,
  3451. // non-interface field appearing in ForceSendFields will be sent to the
  3452. // server regardless of whether the field is empty or not. This may be
  3453. // used to include empty fields in Patch requests.
  3454. ForceSendFields []string `json:"-"`
  3455. // NullFields is a list of field names (e.g. "QuickReplies") to include
  3456. // in API requests with the JSON null value. By default, fields with
  3457. // empty values are omitted from API requests. However, any field with
  3458. // an empty value appearing in NullFields will be sent to the server as
  3459. // null. It is an error if a field in this list has a non-empty value.
  3460. // This may be used to include null fields in Patch requests.
  3461. NullFields []string `json:"-"`
  3462. }
  3463. func (s *GoogleCloudDialogflowV2beta1IntentMessageQuickReplies) MarshalJSON() ([]byte, error) {
  3464. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageQuickReplies
  3465. raw := NoMethod(*s)
  3466. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3467. }
  3468. // GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo: Additional
  3469. // info about the select item for when it is triggered in a
  3470. // dialog.
  3471. type GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo struct {
  3472. // Key: Required. A unique key that will be sent back to the agent if
  3473. // this
  3474. // response is given.
  3475. Key string `json:"key,omitempty"`
  3476. // Synonyms: Optional. A list of synonyms that can also be used to
  3477. // trigger this
  3478. // item in dialog.
  3479. Synonyms []string `json:"synonyms,omitempty"`
  3480. // ForceSendFields is a list of field names (e.g. "Key") to
  3481. // unconditionally include in API requests. By default, fields with
  3482. // empty values are omitted from API requests. However, any non-pointer,
  3483. // non-interface field appearing in ForceSendFields will be sent to the
  3484. // server regardless of whether the field is empty or not. This may be
  3485. // used to include empty fields in Patch requests.
  3486. ForceSendFields []string `json:"-"`
  3487. // NullFields is a list of field names (e.g. "Key") to include in API
  3488. // requests with the JSON null value. By default, fields with empty
  3489. // values are omitted from API requests. However, any field with an
  3490. // empty value appearing in NullFields will be sent to the server as
  3491. // null. It is an error if a field in this list has a non-empty value.
  3492. // This may be used to include null fields in Patch requests.
  3493. NullFields []string `json:"-"`
  3494. }
  3495. func (s *GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo) MarshalJSON() ([]byte, error) {
  3496. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo
  3497. raw := NoMethod(*s)
  3498. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3499. }
  3500. // GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse: The simple
  3501. // response message containing speech or text.
  3502. type GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse struct {
  3503. // DisplayText: Optional. The text to display.
  3504. DisplayText string `json:"displayText,omitempty"`
  3505. // Ssml: One of text_to_speech or ssml must be provided. Structured
  3506. // spoken
  3507. // response to the user in the SSML format. Mutually exclusive
  3508. // with
  3509. // text_to_speech.
  3510. Ssml string `json:"ssml,omitempty"`
  3511. // TextToSpeech: One of text_to_speech or ssml must be provided. The
  3512. // plain text of the
  3513. // speech output. Mutually exclusive with ssml.
  3514. TextToSpeech string `json:"textToSpeech,omitempty"`
  3515. // ForceSendFields is a list of field names (e.g. "DisplayText") to
  3516. // unconditionally include in API requests. By default, fields with
  3517. // empty values are omitted from API requests. However, any non-pointer,
  3518. // non-interface field appearing in ForceSendFields will be sent to the
  3519. // server regardless of whether the field is empty or not. This may be
  3520. // used to include empty fields in Patch requests.
  3521. ForceSendFields []string `json:"-"`
  3522. // NullFields is a list of field names (e.g. "DisplayText") to include
  3523. // in API requests with the JSON null value. By default, fields with
  3524. // empty values are omitted from API requests. However, any field with
  3525. // an empty value appearing in NullFields will be sent to the server as
  3526. // null. It is an error if a field in this list has a non-empty value.
  3527. // This may be used to include null fields in Patch requests.
  3528. NullFields []string `json:"-"`
  3529. }
  3530. func (s *GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse) MarshalJSON() ([]byte, error) {
  3531. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse
  3532. raw := NoMethod(*s)
  3533. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3534. }
  3535. // GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses: The
  3536. // collection of simple response candidates.
  3537. // This message in `QueryResult.fulfillment_messages`
  3538. // and
  3539. // `WebhookResponse.fulfillment_messages` should contain only
  3540. // one
  3541. // `SimpleResponse`.
  3542. type GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses struct {
  3543. // SimpleResponses: Required. The list of simple responses.
  3544. SimpleResponses []*GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse `json:"simpleResponses,omitempty"`
  3545. // ForceSendFields is a list of field names (e.g. "SimpleResponses") to
  3546. // unconditionally include in API requests. By default, fields with
  3547. // empty values are omitted from API requests. However, any non-pointer,
  3548. // non-interface field appearing in ForceSendFields will be sent to the
  3549. // server regardless of whether the field is empty or not. This may be
  3550. // used to include empty fields in Patch requests.
  3551. ForceSendFields []string `json:"-"`
  3552. // NullFields is a list of field names (e.g. "SimpleResponses") to
  3553. // include in API requests with the JSON null value. By default, fields
  3554. // with empty values are omitted from API requests. However, any field
  3555. // with an empty value appearing in NullFields will be sent to the
  3556. // server as null. It is an error if a field in this list has a
  3557. // non-empty value. This may be used to include null fields in Patch
  3558. // requests.
  3559. NullFields []string `json:"-"`
  3560. }
  3561. func (s *GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses) MarshalJSON() ([]byte, error) {
  3562. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses
  3563. raw := NoMethod(*s)
  3564. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3565. }
  3566. // GoogleCloudDialogflowV2beta1IntentMessageSuggestion: The suggestion
  3567. // chip message that the user can tap to quickly post a reply
  3568. // to the conversation.
  3569. type GoogleCloudDialogflowV2beta1IntentMessageSuggestion struct {
  3570. // Title: Required. The text shown the in the suggestion chip.
  3571. Title string `json:"title,omitempty"`
  3572. // ForceSendFields is a list of field names (e.g. "Title") to
  3573. // unconditionally include in API requests. By default, fields with
  3574. // empty values are omitted from API requests. However, any non-pointer,
  3575. // non-interface field appearing in ForceSendFields will be sent to the
  3576. // server regardless of whether the field is empty or not. This may be
  3577. // used to include empty fields in Patch requests.
  3578. ForceSendFields []string `json:"-"`
  3579. // NullFields is a list of field names (e.g. "Title") to include in API
  3580. // requests with the JSON null value. By default, fields with empty
  3581. // values are omitted from API requests. However, any field with an
  3582. // empty value appearing in NullFields will be sent to the server as
  3583. // null. It is an error if a field in this list has a non-empty value.
  3584. // This may be used to include null fields in Patch requests.
  3585. NullFields []string `json:"-"`
  3586. }
  3587. func (s *GoogleCloudDialogflowV2beta1IntentMessageSuggestion) MarshalJSON() ([]byte, error) {
  3588. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageSuggestion
  3589. raw := NoMethod(*s)
  3590. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3591. }
  3592. // GoogleCloudDialogflowV2beta1IntentMessageSuggestions: The collection
  3593. // of suggestions.
  3594. type GoogleCloudDialogflowV2beta1IntentMessageSuggestions struct {
  3595. // Suggestions: Required. The list of suggested replies.
  3596. Suggestions []*GoogleCloudDialogflowV2beta1IntentMessageSuggestion `json:"suggestions,omitempty"`
  3597. // ForceSendFields is a list of field names (e.g. "Suggestions") to
  3598. // unconditionally include in API requests. By default, fields with
  3599. // empty values are omitted from API requests. However, any non-pointer,
  3600. // non-interface field appearing in ForceSendFields will be sent to the
  3601. // server regardless of whether the field is empty or not. This may be
  3602. // used to include empty fields in Patch requests.
  3603. ForceSendFields []string `json:"-"`
  3604. // NullFields is a list of field names (e.g. "Suggestions") to include
  3605. // in API requests with the JSON null value. By default, fields with
  3606. // empty values are omitted from API requests. However, any field with
  3607. // an empty value appearing in NullFields will be sent to the server as
  3608. // null. It is an error if a field in this list has a non-empty value.
  3609. // This may be used to include null fields in Patch requests.
  3610. NullFields []string `json:"-"`
  3611. }
  3612. func (s *GoogleCloudDialogflowV2beta1IntentMessageSuggestions) MarshalJSON() ([]byte, error) {
  3613. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageSuggestions
  3614. raw := NoMethod(*s)
  3615. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3616. }
  3617. // GoogleCloudDialogflowV2beta1IntentMessageText: The text response
  3618. // message.
  3619. type GoogleCloudDialogflowV2beta1IntentMessageText struct {
  3620. // Text: Optional. The collection of the agent's responses.
  3621. Text []string `json:"text,omitempty"`
  3622. // ForceSendFields is a list of field names (e.g. "Text") to
  3623. // unconditionally include in API requests. By default, fields with
  3624. // empty values are omitted from API requests. However, any non-pointer,
  3625. // non-interface field appearing in ForceSendFields will be sent to the
  3626. // server regardless of whether the field is empty or not. This may be
  3627. // used to include empty fields in Patch requests.
  3628. ForceSendFields []string `json:"-"`
  3629. // NullFields is a list of field names (e.g. "Text") to include in API
  3630. // requests with the JSON null value. By default, fields with empty
  3631. // values are omitted from API requests. However, any field with an
  3632. // empty value appearing in NullFields will be sent to the server as
  3633. // null. It is an error if a field in this list has a non-empty value.
  3634. // This may be used to include null fields in Patch requests.
  3635. NullFields []string `json:"-"`
  3636. }
  3637. func (s *GoogleCloudDialogflowV2beta1IntentMessageText) MarshalJSON() ([]byte, error) {
  3638. type NoMethod GoogleCloudDialogflowV2beta1IntentMessageText
  3639. raw := NoMethod(*s)
  3640. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3641. }
  3642. // GoogleCloudDialogflowV2beta1IntentParameter: Represents intent
  3643. // parameters.
  3644. type GoogleCloudDialogflowV2beta1IntentParameter struct {
  3645. // DefaultValue: Optional. The default value to use when the `value`
  3646. // yields an empty
  3647. // result.
  3648. // Default values can be extracted from contexts by using the
  3649. // following
  3650. // syntax: `#context_name.parameter_name`.
  3651. DefaultValue string `json:"defaultValue,omitempty"`
  3652. // DisplayName: Required. The name of the parameter.
  3653. DisplayName string `json:"displayName,omitempty"`
  3654. // EntityTypeDisplayName: Optional. The name of the entity type,
  3655. // prefixed with `@`, that
  3656. // describes values of the parameter. If the parameter is
  3657. // required, this must be provided.
  3658. EntityTypeDisplayName string `json:"entityTypeDisplayName,omitempty"`
  3659. // IsList: Optional. Indicates whether the parameter represents a list
  3660. // of values.
  3661. IsList bool `json:"isList,omitempty"`
  3662. // Mandatory: Optional. Indicates whether the parameter is required.
  3663. // That is,
  3664. // whether the intent cannot be completed without collecting the
  3665. // parameter
  3666. // value.
  3667. Mandatory bool `json:"mandatory,omitempty"`
  3668. // Name: The unique identifier of this parameter.
  3669. Name string `json:"name,omitempty"`
  3670. // Prompts: Optional. The collection of prompts that the agent can
  3671. // present to the
  3672. // user in order to collect value for the parameter.
  3673. Prompts []string `json:"prompts,omitempty"`
  3674. // Value: Optional. The definition of the parameter value. It can be:
  3675. // - a constant string,
  3676. // - a parameter value defined as `$parameter_name`,
  3677. // - an original parameter value defined as
  3678. // `$parameter_name.original`,
  3679. // - a parameter value from some context defined as
  3680. // `#context_name.parameter_name`.
  3681. Value string `json:"value,omitempty"`
  3682. // ForceSendFields is a list of field names (e.g. "DefaultValue") to
  3683. // unconditionally include in API requests. By default, fields with
  3684. // empty values are omitted from API requests. However, any non-pointer,
  3685. // non-interface field appearing in ForceSendFields will be sent to the
  3686. // server regardless of whether the field is empty or not. This may be
  3687. // used to include empty fields in Patch requests.
  3688. ForceSendFields []string `json:"-"`
  3689. // NullFields is a list of field names (e.g. "DefaultValue") to include
  3690. // in API requests with the JSON null value. By default, fields with
  3691. // empty values are omitted from API requests. However, any field with
  3692. // an empty value appearing in NullFields will be sent to the server as
  3693. // null. It is an error if a field in this list has a non-empty value.
  3694. // This may be used to include null fields in Patch requests.
  3695. NullFields []string `json:"-"`
  3696. }
  3697. func (s *GoogleCloudDialogflowV2beta1IntentParameter) MarshalJSON() ([]byte, error) {
  3698. type NoMethod GoogleCloudDialogflowV2beta1IntentParameter
  3699. raw := NoMethod(*s)
  3700. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3701. }
  3702. // GoogleCloudDialogflowV2beta1IntentTrainingPhrase: Represents an
  3703. // example or template that the agent is trained on.
  3704. type GoogleCloudDialogflowV2beta1IntentTrainingPhrase struct {
  3705. // Name: Required. The unique identifier of this training phrase.
  3706. Name string `json:"name,omitempty"`
  3707. // Parts: Required. The collection of training phrase parts (can be
  3708. // annotated).
  3709. // Fields: `entity_type`, `alias` and `user_defined` should be
  3710. // populated
  3711. // only for the annotated parts of the training phrase.
  3712. Parts []*GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart `json:"parts,omitempty"`
  3713. // TimesAddedCount: Optional. Indicates how many times this example or
  3714. // template was added to
  3715. // the intent. Each time a developer adds an existing sample by editing
  3716. // an
  3717. // intent or training, this counter is increased.
  3718. TimesAddedCount int64 `json:"timesAddedCount,omitempty"`
  3719. // Type: Required. The type of the training phrase.
  3720. //
  3721. // Possible values:
  3722. // "TYPE_UNSPECIFIED" - Not specified. This value should never be
  3723. // used.
  3724. // "EXAMPLE" - Examples do not contain @-prefixed entity type names,
  3725. // but example parts
  3726. // can be annotated with entity types.
  3727. // "TEMPLATE" - Templates are not annotated with entity types, but
  3728. // they can contain
  3729. // @-prefixed entity type names as substrings.
  3730. Type string `json:"type,omitempty"`
  3731. // ForceSendFields is a list of field names (e.g. "Name") to
  3732. // unconditionally include in API requests. By default, fields with
  3733. // empty values are omitted from API requests. However, any non-pointer,
  3734. // non-interface field appearing in ForceSendFields will be sent to the
  3735. // server regardless of whether the field is empty or not. This may be
  3736. // used to include empty fields in Patch requests.
  3737. ForceSendFields []string `json:"-"`
  3738. // NullFields is a list of field names (e.g. "Name") to include in API
  3739. // requests with the JSON null value. By default, fields with empty
  3740. // values are omitted from API requests. However, any field with an
  3741. // empty value appearing in NullFields will be sent to the server as
  3742. // null. It is an error if a field in this list has a non-empty value.
  3743. // This may be used to include null fields in Patch requests.
  3744. NullFields []string `json:"-"`
  3745. }
  3746. func (s *GoogleCloudDialogflowV2beta1IntentTrainingPhrase) MarshalJSON() ([]byte, error) {
  3747. type NoMethod GoogleCloudDialogflowV2beta1IntentTrainingPhrase
  3748. raw := NoMethod(*s)
  3749. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3750. }
  3751. // GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart: Represents a
  3752. // part of a training phrase.
  3753. type GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart struct {
  3754. // Alias: Optional. The parameter name for the value extracted from
  3755. // the
  3756. // annotated part of the example.
  3757. Alias string `json:"alias,omitempty"`
  3758. // EntityType: Optional. The entity type name prefixed with `@`. This
  3759. // field is
  3760. // required for the annotated part of the text and applies only
  3761. // to
  3762. // examples.
  3763. EntityType string `json:"entityType,omitempty"`
  3764. // Text: Required. The text corresponding to the example or template,
  3765. // if there are no annotations. For
  3766. // annotated examples, it is the text for one of the example's parts.
  3767. Text string `json:"text,omitempty"`
  3768. // UserDefined: Optional. Indicates whether the text was manually
  3769. // annotated by the
  3770. // developer.
  3771. UserDefined bool `json:"userDefined,omitempty"`
  3772. // ForceSendFields is a list of field names (e.g. "Alias") to
  3773. // unconditionally include in API requests. By default, fields with
  3774. // empty values are omitted from API requests. However, any non-pointer,
  3775. // non-interface field appearing in ForceSendFields will be sent to the
  3776. // server regardless of whether the field is empty or not. This may be
  3777. // used to include empty fields in Patch requests.
  3778. ForceSendFields []string `json:"-"`
  3779. // NullFields is a list of field names (e.g. "Alias") to include in API
  3780. // requests with the JSON null value. By default, fields with empty
  3781. // values are omitted from API requests. However, any field with an
  3782. // empty value appearing in NullFields will be sent to the server as
  3783. // null. It is an error if a field in this list has a non-empty value.
  3784. // This may be used to include null fields in Patch requests.
  3785. NullFields []string `json:"-"`
  3786. }
  3787. func (s *GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart) MarshalJSON() ([]byte, error) {
  3788. type NoMethod GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart
  3789. raw := NoMethod(*s)
  3790. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3791. }
  3792. // GoogleCloudDialogflowV2beta1KnowledgeOperationMetadata: Metadata in
  3793. // google::longrunning::Operation for Knowledge operations.
  3794. type GoogleCloudDialogflowV2beta1KnowledgeOperationMetadata struct {
  3795. // State: Required. The current state of this operation.
  3796. //
  3797. // Possible values:
  3798. // "STATE_UNSPECIFIED" - State unspecified.
  3799. // "PENDING" - The operation has been created.
  3800. // "RUNNING" - The operation is currently running.
  3801. // "DONE" - The operation is done, either cancelled or completed.
  3802. State string `json:"state,omitempty"`
  3803. // ForceSendFields is a list of field names (e.g. "State") to
  3804. // unconditionally include in API requests. By default, fields with
  3805. // empty values are omitted from API requests. However, any non-pointer,
  3806. // non-interface field appearing in ForceSendFields will be sent to the
  3807. // server regardless of whether the field is empty or not. This may be
  3808. // used to include empty fields in Patch requests.
  3809. ForceSendFields []string `json:"-"`
  3810. // NullFields is a list of field names (e.g. "State") to include in API
  3811. // requests with the JSON null value. By default, fields with empty
  3812. // values are omitted from API requests. However, any field with an
  3813. // empty value appearing in NullFields will be sent to the server as
  3814. // null. It is an error if a field in this list has a non-empty value.
  3815. // This may be used to include null fields in Patch requests.
  3816. NullFields []string `json:"-"`
  3817. }
  3818. func (s *GoogleCloudDialogflowV2beta1KnowledgeOperationMetadata) MarshalJSON() ([]byte, error) {
  3819. type NoMethod GoogleCloudDialogflowV2beta1KnowledgeOperationMetadata
  3820. raw := NoMethod(*s)
  3821. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3822. }
  3823. // GoogleCloudDialogflowV2beta1ListContextsResponse: The response
  3824. // message for Contexts.ListContexts.
  3825. type GoogleCloudDialogflowV2beta1ListContextsResponse struct {
  3826. // Contexts: The list of contexts. There will be a maximum number of
  3827. // items
  3828. // returned based on the page_size field in the request.
  3829. Contexts []*GoogleCloudDialogflowV2beta1Context `json:"contexts,omitempty"`
  3830. // NextPageToken: Token to retrieve the next page of results, or empty
  3831. // if there are no
  3832. // more results in the list.
  3833. NextPageToken string `json:"nextPageToken,omitempty"`
  3834. // ServerResponse contains the HTTP response code and headers from the
  3835. // server.
  3836. googleapi.ServerResponse `json:"-"`
  3837. // ForceSendFields is a list of field names (e.g. "Contexts") to
  3838. // unconditionally include in API requests. By default, fields with
  3839. // empty values are omitted from API requests. However, any non-pointer,
  3840. // non-interface field appearing in ForceSendFields will be sent to the
  3841. // server regardless of whether the field is empty or not. This may be
  3842. // used to include empty fields in Patch requests.
  3843. ForceSendFields []string `json:"-"`
  3844. // NullFields is a list of field names (e.g. "Contexts") to include in
  3845. // API requests with the JSON null value. By default, fields with empty
  3846. // values are omitted from API requests. However, any field with an
  3847. // empty value appearing in NullFields will be sent to the server as
  3848. // null. It is an error if a field in this list has a non-empty value.
  3849. // This may be used to include null fields in Patch requests.
  3850. NullFields []string `json:"-"`
  3851. }
  3852. func (s *GoogleCloudDialogflowV2beta1ListContextsResponse) MarshalJSON() ([]byte, error) {
  3853. type NoMethod GoogleCloudDialogflowV2beta1ListContextsResponse
  3854. raw := NoMethod(*s)
  3855. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3856. }
  3857. // GoogleCloudDialogflowV2beta1ListEntityTypesResponse: The response
  3858. // message for EntityTypes.ListEntityTypes.
  3859. type GoogleCloudDialogflowV2beta1ListEntityTypesResponse struct {
  3860. // EntityTypes: The list of agent entity types. There will be a maximum
  3861. // number of items
  3862. // returned based on the page_size field in the request.
  3863. EntityTypes []*GoogleCloudDialogflowV2beta1EntityType `json:"entityTypes,omitempty"`
  3864. // NextPageToken: Token to retrieve the next page of results, or empty
  3865. // if there are no
  3866. // more results in the list.
  3867. NextPageToken string `json:"nextPageToken,omitempty"`
  3868. // ServerResponse contains the HTTP response code and headers from the
  3869. // server.
  3870. googleapi.ServerResponse `json:"-"`
  3871. // ForceSendFields is a list of field names (e.g. "EntityTypes") to
  3872. // unconditionally include in API requests. By default, fields with
  3873. // empty values are omitted from API requests. However, any non-pointer,
  3874. // non-interface field appearing in ForceSendFields will be sent to the
  3875. // server regardless of whether the field is empty or not. This may be
  3876. // used to include empty fields in Patch requests.
  3877. ForceSendFields []string `json:"-"`
  3878. // NullFields is a list of field names (e.g. "EntityTypes") to include
  3879. // in API requests with the JSON null value. By default, fields with
  3880. // empty values are omitted from API requests. However, any field with
  3881. // an empty value appearing in NullFields will be sent to the server as
  3882. // null. It is an error if a field in this list has a non-empty value.
  3883. // This may be used to include null fields in Patch requests.
  3884. NullFields []string `json:"-"`
  3885. }
  3886. func (s *GoogleCloudDialogflowV2beta1ListEntityTypesResponse) MarshalJSON() ([]byte, error) {
  3887. type NoMethod GoogleCloudDialogflowV2beta1ListEntityTypesResponse
  3888. raw := NoMethod(*s)
  3889. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3890. }
  3891. // GoogleCloudDialogflowV2beta1ListIntentsResponse: The response message
  3892. // for Intents.ListIntents.
  3893. type GoogleCloudDialogflowV2beta1ListIntentsResponse struct {
  3894. // Intents: The list of agent intents. There will be a maximum number of
  3895. // items
  3896. // returned based on the page_size field in the request.
  3897. Intents []*GoogleCloudDialogflowV2beta1Intent `json:"intents,omitempty"`
  3898. // NextPageToken: Token to retrieve the next page of results, or empty
  3899. // if there are no
  3900. // more results in the list.
  3901. NextPageToken string `json:"nextPageToken,omitempty"`
  3902. // ServerResponse contains the HTTP response code and headers from the
  3903. // server.
  3904. googleapi.ServerResponse `json:"-"`
  3905. // ForceSendFields is a list of field names (e.g. "Intents") to
  3906. // unconditionally include in API requests. By default, fields with
  3907. // empty values are omitted from API requests. However, any non-pointer,
  3908. // non-interface field appearing in ForceSendFields will be sent to the
  3909. // server regardless of whether the field is empty or not. This may be
  3910. // used to include empty fields in Patch requests.
  3911. ForceSendFields []string `json:"-"`
  3912. // NullFields is a list of field names (e.g. "Intents") to include in
  3913. // API requests with the JSON null value. By default, fields with empty
  3914. // values are omitted from API requests. However, any field with an
  3915. // empty value appearing in NullFields will be sent to the server as
  3916. // null. It is an error if a field in this list has a non-empty value.
  3917. // This may be used to include null fields in Patch requests.
  3918. NullFields []string `json:"-"`
  3919. }
  3920. func (s *GoogleCloudDialogflowV2beta1ListIntentsResponse) MarshalJSON() ([]byte, error) {
  3921. type NoMethod GoogleCloudDialogflowV2beta1ListIntentsResponse
  3922. raw := NoMethod(*s)
  3923. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3924. }
  3925. // GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse: The
  3926. // response message for SessionEntityTypes.ListSessionEntityTypes.
  3927. type GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse struct {
  3928. // NextPageToken: Token to retrieve the next page of results, or empty
  3929. // if there are no
  3930. // more results in the list.
  3931. NextPageToken string `json:"nextPageToken,omitempty"`
  3932. // SessionEntityTypes: The list of session entity types. There will be a
  3933. // maximum number of items
  3934. // returned based on the page_size field in the request.
  3935. SessionEntityTypes []*GoogleCloudDialogflowV2beta1SessionEntityType `json:"sessionEntityTypes,omitempty"`
  3936. // ServerResponse contains the HTTP response code and headers from the
  3937. // server.
  3938. googleapi.ServerResponse `json:"-"`
  3939. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  3940. // unconditionally include in API requests. By default, fields with
  3941. // empty values are omitted from API requests. However, any non-pointer,
  3942. // non-interface field appearing in ForceSendFields will be sent to the
  3943. // server regardless of whether the field is empty or not. This may be
  3944. // used to include empty fields in Patch requests.
  3945. ForceSendFields []string `json:"-"`
  3946. // NullFields is a list of field names (e.g. "NextPageToken") to include
  3947. // in API requests with the JSON null value. By default, fields with
  3948. // empty values are omitted from API requests. However, any field with
  3949. // an empty value appearing in NullFields will be sent to the server as
  3950. // null. It is an error if a field in this list has a non-empty value.
  3951. // This may be used to include null fields in Patch requests.
  3952. NullFields []string `json:"-"`
  3953. }
  3954. func (s *GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse) MarshalJSON() ([]byte, error) {
  3955. type NoMethod GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse
  3956. raw := NoMethod(*s)
  3957. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3958. }
  3959. // GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest: Represents
  3960. // the contents of the original request that was passed to
  3961. // the `[Streaming]DetectIntent` call.
  3962. type GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest struct {
  3963. // Payload: Optional. This field is set to the value of
  3964. // `QueryParameters.payload` field
  3965. // passed in the request.
  3966. Payload googleapi.RawMessage `json:"payload,omitempty"`
  3967. // Source: The source of this request, e.g., `google`, `facebook`,
  3968. // `slack`. It is set
  3969. // by Dialogflow-owned servers.
  3970. Source string `json:"source,omitempty"`
  3971. // ForceSendFields is a list of field names (e.g. "Payload") to
  3972. // unconditionally include in API requests. By default, fields with
  3973. // empty values are omitted from API requests. However, any non-pointer,
  3974. // non-interface field appearing in ForceSendFields will be sent to the
  3975. // server regardless of whether the field is empty or not. This may be
  3976. // used to include empty fields in Patch requests.
  3977. ForceSendFields []string `json:"-"`
  3978. // NullFields is a list of field names (e.g. "Payload") to include in
  3979. // API requests with the JSON null value. By default, fields with empty
  3980. // values are omitted from API requests. However, any field with an
  3981. // empty value appearing in NullFields will be sent to the server as
  3982. // null. It is an error if a field in this list has a non-empty value.
  3983. // This may be used to include null fields in Patch requests.
  3984. NullFields []string `json:"-"`
  3985. }
  3986. func (s *GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest) MarshalJSON() ([]byte, error) {
  3987. type NoMethod GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest
  3988. raw := NoMethod(*s)
  3989. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3990. }
  3991. // GoogleCloudDialogflowV2beta1QueryInput: Represents the query input.
  3992. // It can contain either:
  3993. //
  3994. // 1. An audio config which
  3995. // instructs the speech recognizer how to process the speech
  3996. // audio.
  3997. //
  3998. // 2. A conversational query in the form of text,.
  3999. //
  4000. // 3. An event that specifies which intent to trigger.
  4001. type GoogleCloudDialogflowV2beta1QueryInput struct {
  4002. // AudioConfig: Instructs the speech recognizer how to process the
  4003. // speech audio.
  4004. AudioConfig *GoogleCloudDialogflowV2beta1InputAudioConfig `json:"audioConfig,omitempty"`
  4005. // Event: The event to be processed.
  4006. Event *GoogleCloudDialogflowV2beta1EventInput `json:"event,omitempty"`
  4007. // Text: The natural language text to be processed.
  4008. Text *GoogleCloudDialogflowV2beta1TextInput `json:"text,omitempty"`
  4009. // ForceSendFields is a list of field names (e.g. "AudioConfig") to
  4010. // unconditionally include in API requests. By default, fields with
  4011. // empty values are omitted from API requests. However, any non-pointer,
  4012. // non-interface field appearing in ForceSendFields will be sent to the
  4013. // server regardless of whether the field is empty or not. This may be
  4014. // used to include empty fields in Patch requests.
  4015. ForceSendFields []string `json:"-"`
  4016. // NullFields is a list of field names (e.g. "AudioConfig") to include
  4017. // in API requests with the JSON null value. By default, fields with
  4018. // empty values are omitted from API requests. However, any field with
  4019. // an empty value appearing in NullFields will be sent to the server as
  4020. // null. It is an error if a field in this list has a non-empty value.
  4021. // This may be used to include null fields in Patch requests.
  4022. NullFields []string `json:"-"`
  4023. }
  4024. func (s *GoogleCloudDialogflowV2beta1QueryInput) MarshalJSON() ([]byte, error) {
  4025. type NoMethod GoogleCloudDialogflowV2beta1QueryInput
  4026. raw := NoMethod(*s)
  4027. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4028. }
  4029. // GoogleCloudDialogflowV2beta1QueryParameters: Represents the
  4030. // parameters of the conversational query.
  4031. type GoogleCloudDialogflowV2beta1QueryParameters struct {
  4032. // Contexts: Optional. The collection of contexts to be activated before
  4033. // this query is
  4034. // executed.
  4035. Contexts []*GoogleCloudDialogflowV2beta1Context `json:"contexts,omitempty"`
  4036. // GeoLocation: Optional. The geo location of this conversational query.
  4037. GeoLocation *GoogleTypeLatLng `json:"geoLocation,omitempty"`
  4038. // Payload: Optional. This field can be used to pass custom data into
  4039. // the webhook
  4040. // associated with the agent. Arbitrary JSON objects are supported.
  4041. Payload googleapi.RawMessage `json:"payload,omitempty"`
  4042. // ResetContexts: Optional. Specifies whether to delete all contexts in
  4043. // the current session
  4044. // before the new ones are activated.
  4045. ResetContexts bool `json:"resetContexts,omitempty"`
  4046. // SessionEntityTypes: Optional. The collection of session entity types
  4047. // to replace or extend
  4048. // developer entities with for this query only. The entity synonyms
  4049. // apply
  4050. // to all languages.
  4051. SessionEntityTypes []*GoogleCloudDialogflowV2beta1SessionEntityType `json:"sessionEntityTypes,omitempty"`
  4052. // TimeZone: Optional. The time zone of this conversational query from
  4053. // the
  4054. // [time zone database](https://www.iana.org/time-zones),
  4055. // e.g.,
  4056. // America/New_York, Europe/Paris. If not provided, the time zone
  4057. // specified in
  4058. // agent settings is used.
  4059. TimeZone string `json:"timeZone,omitempty"`
  4060. // ForceSendFields is a list of field names (e.g. "Contexts") to
  4061. // unconditionally include in API requests. By default, fields with
  4062. // empty values are omitted from API requests. However, any non-pointer,
  4063. // non-interface field appearing in ForceSendFields will be sent to the
  4064. // server regardless of whether the field is empty or not. This may be
  4065. // used to include empty fields in Patch requests.
  4066. ForceSendFields []string `json:"-"`
  4067. // NullFields is a list of field names (e.g. "Contexts") to include in
  4068. // API requests with the JSON null value. By default, fields with empty
  4069. // values are omitted from API requests. However, any field with an
  4070. // empty value appearing in NullFields will be sent to the server as
  4071. // null. It is an error if a field in this list has a non-empty value.
  4072. // This may be used to include null fields in Patch requests.
  4073. NullFields []string `json:"-"`
  4074. }
  4075. func (s *GoogleCloudDialogflowV2beta1QueryParameters) MarshalJSON() ([]byte, error) {
  4076. type NoMethod GoogleCloudDialogflowV2beta1QueryParameters
  4077. raw := NoMethod(*s)
  4078. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4079. }
  4080. // GoogleCloudDialogflowV2beta1QueryResult: Represents the result of
  4081. // conversational query or event processing.
  4082. type GoogleCloudDialogflowV2beta1QueryResult struct {
  4083. // Action: The action name from the matched intent.
  4084. Action string `json:"action,omitempty"`
  4085. // AllRequiredParamsPresent: This field is set to:
  4086. // - `false` if the matched intent has required parameters and not all
  4087. // of
  4088. // the required parameter values have been collected.
  4089. // - `true` if all required parameter values have been collected, or if
  4090. // the
  4091. // matched intent doesn't contain any required parameters.
  4092. AllRequiredParamsPresent bool `json:"allRequiredParamsPresent,omitempty"`
  4093. // DiagnosticInfo: The free-form diagnostic info. For example, this
  4094. // field
  4095. // could contain webhook call latency.
  4096. DiagnosticInfo googleapi.RawMessage `json:"diagnosticInfo,omitempty"`
  4097. // FulfillmentMessages: The collection of rich messages to present to
  4098. // the user.
  4099. FulfillmentMessages []*GoogleCloudDialogflowV2beta1IntentMessage `json:"fulfillmentMessages,omitempty"`
  4100. // FulfillmentText: The text to be pronounced to the user or shown on
  4101. // the screen.
  4102. FulfillmentText string `json:"fulfillmentText,omitempty"`
  4103. // Intent: The intent that matched the conversational query. Some,
  4104. // not
  4105. // all fields are filled in this message, including but not limited
  4106. // to:
  4107. // `name`, `display_name` and `webhook_state`.
  4108. Intent *GoogleCloudDialogflowV2beta1Intent `json:"intent,omitempty"`
  4109. // IntentDetectionConfidence: The intent detection confidence. Values
  4110. // range from 0.0
  4111. // (completely uncertain) to 1.0 (completely certain).
  4112. IntentDetectionConfidence float64 `json:"intentDetectionConfidence,omitempty"`
  4113. // LanguageCode: The language that was triggered during intent
  4114. // detection.
  4115. // See [Language
  4116. // Support](https://dialogflow.com/docs/reference/language)
  4117. // for a list of the currently supported language codes.
  4118. LanguageCode string `json:"languageCode,omitempty"`
  4119. // OutputContexts: The collection of output contexts. If
  4120. // applicable,
  4121. // `output_contexts.parameters` contains entries with name
  4122. // `<parameter name>.original` containing the original parameter
  4123. // values
  4124. // before the query.
  4125. OutputContexts []*GoogleCloudDialogflowV2beta1Context `json:"outputContexts,omitempty"`
  4126. // Parameters: The collection of extracted parameters.
  4127. Parameters googleapi.RawMessage `json:"parameters,omitempty"`
  4128. // QueryText: The original conversational query text:
  4129. // - If natural language text was provided as input, `query_text`
  4130. // contains
  4131. // a copy of the input.
  4132. // - If natural language speech audio was provided as input,
  4133. // `query_text`
  4134. // contains the speech recognition result. If speech recognizer
  4135. // produced
  4136. // multiple alternatives, a particular one is picked.
  4137. // - If an event was provided as input, `query_text` is not set.
  4138. QueryText string `json:"queryText,omitempty"`
  4139. // SpeechRecognitionConfidence: The Speech recognition confidence
  4140. // between 0.0 and 1.0. A higher number
  4141. // indicates an estimated greater likelihood that the recognized words
  4142. // are
  4143. // correct. The default of 0.0 is a sentinel value indicating that
  4144. // confidence
  4145. // was not set.
  4146. //
  4147. // This field is not guaranteed to be accurate or set. In particular
  4148. // this
  4149. // field isn't set for StreamingDetectIntent since the streaming
  4150. // endpoint has
  4151. // separate confidence estimates per portion of the audio
  4152. // in
  4153. // StreamingRecognitionResult.
  4154. SpeechRecognitionConfidence float64 `json:"speechRecognitionConfidence,omitempty"`
  4155. // WebhookPayload: If the query was fulfilled by a webhook call, this
  4156. // field is set to the
  4157. // value of the `payload` field returned in the webhook response.
  4158. WebhookPayload googleapi.RawMessage `json:"webhookPayload,omitempty"`
  4159. // WebhookSource: If the query was fulfilled by a webhook call, this
  4160. // field is set to the
  4161. // value of the `source` field returned in the webhook response.
  4162. WebhookSource string `json:"webhookSource,omitempty"`
  4163. // ForceSendFields is a list of field names (e.g. "Action") to
  4164. // unconditionally include in API requests. By default, fields with
  4165. // empty values are omitted from API requests. However, any non-pointer,
  4166. // non-interface field appearing in ForceSendFields will be sent to the
  4167. // server regardless of whether the field is empty or not. This may be
  4168. // used to include empty fields in Patch requests.
  4169. ForceSendFields []string `json:"-"`
  4170. // NullFields is a list of field names (e.g. "Action") to include in API
  4171. // requests with the JSON null value. By default, fields with empty
  4172. // values are omitted from API requests. However, any field with an
  4173. // empty value appearing in NullFields will be sent to the server as
  4174. // null. It is an error if a field in this list has a non-empty value.
  4175. // This may be used to include null fields in Patch requests.
  4176. NullFields []string `json:"-"`
  4177. }
  4178. func (s *GoogleCloudDialogflowV2beta1QueryResult) MarshalJSON() ([]byte, error) {
  4179. type NoMethod GoogleCloudDialogflowV2beta1QueryResult
  4180. raw := NoMethod(*s)
  4181. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4182. }
  4183. func (s *GoogleCloudDialogflowV2beta1QueryResult) UnmarshalJSON(data []byte) error {
  4184. type NoMethod GoogleCloudDialogflowV2beta1QueryResult
  4185. var s1 struct {
  4186. IntentDetectionConfidence gensupport.JSONFloat64 `json:"intentDetectionConfidence"`
  4187. SpeechRecognitionConfidence gensupport.JSONFloat64 `json:"speechRecognitionConfidence"`
  4188. *NoMethod
  4189. }
  4190. s1.NoMethod = (*NoMethod)(s)
  4191. if err := json.Unmarshal(data, &s1); err != nil {
  4192. return err
  4193. }
  4194. s.IntentDetectionConfidence = float64(s1.IntentDetectionConfidence)
  4195. s.SpeechRecognitionConfidence = float64(s1.SpeechRecognitionConfidence)
  4196. return nil
  4197. }
  4198. // GoogleCloudDialogflowV2beta1RestoreAgentRequest: The request message
  4199. // for Agents.RestoreAgent.
  4200. type GoogleCloudDialogflowV2beta1RestoreAgentRequest struct {
  4201. // AgentContent: The agent to restore.
  4202. //
  4203. // Example for how to restore an agent via the command line:
  4204. //
  4205. // curl \
  4206. //
  4207. // 'https://dialogflow.googleapis.com/v2beta1/projects/<project_name>/age
  4208. // nt:restore\
  4209. // -X POST \
  4210. // -H 'Authorization: Bearer '$(gcloud auth print-access-token) \
  4211. // -H 'Accept: application/json' \
  4212. // -H 'Content-Type: application/json' \
  4213. // --compressed \
  4214. // --data-binary "{
  4215. // 'agentContent': '$(cat <agent zip file> | base64 -w 0)'
  4216. // }" \
  4217. AgentContent string `json:"agentContent,omitempty"`
  4218. // AgentUri: The URI to a Google Cloud Storage file containing the agent
  4219. // to restore.
  4220. // Note: The URI must start with "gs://".
  4221. AgentUri string `json:"agentUri,omitempty"`
  4222. // ForceSendFields is a list of field names (e.g. "AgentContent") to
  4223. // unconditionally include in API requests. By default, fields with
  4224. // empty values are omitted from API requests. However, any non-pointer,
  4225. // non-interface field appearing in ForceSendFields will be sent to the
  4226. // server regardless of whether the field is empty or not. This may be
  4227. // used to include empty fields in Patch requests.
  4228. ForceSendFields []string `json:"-"`
  4229. // NullFields is a list of field names (e.g. "AgentContent") to include
  4230. // in API requests with the JSON null value. By default, fields with
  4231. // empty values are omitted from API requests. However, any field with
  4232. // an empty value appearing in NullFields will be sent to the server as
  4233. // null. It is an error if a field in this list has a non-empty value.
  4234. // This may be used to include null fields in Patch requests.
  4235. NullFields []string `json:"-"`
  4236. }
  4237. func (s *GoogleCloudDialogflowV2beta1RestoreAgentRequest) MarshalJSON() ([]byte, error) {
  4238. type NoMethod GoogleCloudDialogflowV2beta1RestoreAgentRequest
  4239. raw := NoMethod(*s)
  4240. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4241. }
  4242. // GoogleCloudDialogflowV2beta1SearchAgentsResponse: The response
  4243. // message for Agents.SearchAgents.
  4244. type GoogleCloudDialogflowV2beta1SearchAgentsResponse struct {
  4245. // Agents: The list of agents. There will be a maximum number of items
  4246. // returned based
  4247. // on the page_size field in the request.
  4248. Agents []*GoogleCloudDialogflowV2beta1Agent `json:"agents,omitempty"`
  4249. // NextPageToken: Token to retrieve the next page of results, or empty
  4250. // if there are no
  4251. // more results in the list.
  4252. NextPageToken string `json:"nextPageToken,omitempty"`
  4253. // ServerResponse contains the HTTP response code and headers from the
  4254. // server.
  4255. googleapi.ServerResponse `json:"-"`
  4256. // ForceSendFields is a list of field names (e.g. "Agents") to
  4257. // unconditionally include in API requests. By default, fields with
  4258. // empty values are omitted from API requests. However, any non-pointer,
  4259. // non-interface field appearing in ForceSendFields will be sent to the
  4260. // server regardless of whether the field is empty or not. This may be
  4261. // used to include empty fields in Patch requests.
  4262. ForceSendFields []string `json:"-"`
  4263. // NullFields is a list of field names (e.g. "Agents") to include in API
  4264. // requests with the JSON null value. By default, fields with empty
  4265. // values are omitted from API requests. However, any field with an
  4266. // empty value appearing in NullFields will be sent to the server as
  4267. // null. It is an error if a field in this list has a non-empty value.
  4268. // This may be used to include null fields in Patch requests.
  4269. NullFields []string `json:"-"`
  4270. }
  4271. func (s *GoogleCloudDialogflowV2beta1SearchAgentsResponse) MarshalJSON() ([]byte, error) {
  4272. type NoMethod GoogleCloudDialogflowV2beta1SearchAgentsResponse
  4273. raw := NoMethod(*s)
  4274. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4275. }
  4276. // GoogleCloudDialogflowV2beta1SessionEntityType: Represents a session
  4277. // entity type.
  4278. //
  4279. // Extends or replaces a developer entity type at the user session level
  4280. // (we
  4281. // refer to the entity types defined at the agent level as "developer
  4282. // entity
  4283. // types").
  4284. //
  4285. // Note: session entity types apply to all queries, regardless of the
  4286. // language.
  4287. type GoogleCloudDialogflowV2beta1SessionEntityType struct {
  4288. // Entities: Required. The collection of entities associated with this
  4289. // session entity
  4290. // type.
  4291. Entities []*GoogleCloudDialogflowV2beta1EntityTypeEntity `json:"entities,omitempty"`
  4292. // EntityOverrideMode: Required. Indicates whether the additional data
  4293. // should override or
  4294. // supplement the developer entity type definition.
  4295. //
  4296. // Possible values:
  4297. // "ENTITY_OVERRIDE_MODE_UNSPECIFIED" - Not specified. This value
  4298. // should be never used.
  4299. // "ENTITY_OVERRIDE_MODE_OVERRIDE" - The collection of session
  4300. // entities overrides the collection of entities
  4301. // in the corresponding developer entity type.
  4302. // "ENTITY_OVERRIDE_MODE_SUPPLEMENT" - The collection of session
  4303. // entities extends the collection of entities in
  4304. // the corresponding developer entity type.
  4305. // Calls to `ListSessionEntityTypes`,
  4306. // `GetSessionEntityType`,
  4307. // `CreateSessionEntityType` and `UpdateSessionEntityType` return the
  4308. // full
  4309. // collection of entities from the developer entity type in the
  4310. // agent's
  4311. // default language and the session entity type.
  4312. EntityOverrideMode string `json:"entityOverrideMode,omitempty"`
  4313. // Name: Required. The unique identifier of this session entity type.
  4314. // Format:
  4315. // `projects/<Project ID>/agent/sessions/<Session
  4316. // ID>/entityTypes/<Entity Type
  4317. // Display Name>`, or
  4318. // `projects/<Project ID>/agent/environments/<Environment
  4319. // ID>/users/<User
  4320. // ID>/sessions
  4321. // /<Session ID>/entityTypes/<Entity Type Display Name>`.
  4322. // Note: Environments and users are under construction and will be
  4323. // available
  4324. // soon. If <Environment ID> is not specified, we assume default
  4325. // 'draft'
  4326. // environment. If <User ID> is not specified, we assume default '-'
  4327. // user.
  4328. Name string `json:"name,omitempty"`
  4329. // ServerResponse contains the HTTP response code and headers from the
  4330. // server.
  4331. googleapi.ServerResponse `json:"-"`
  4332. // ForceSendFields is a list of field names (e.g. "Entities") to
  4333. // unconditionally include in API requests. By default, fields with
  4334. // empty values are omitted from API requests. However, any non-pointer,
  4335. // non-interface field appearing in ForceSendFields will be sent to the
  4336. // server regardless of whether the field is empty or not. This may be
  4337. // used to include empty fields in Patch requests.
  4338. ForceSendFields []string `json:"-"`
  4339. // NullFields is a list of field names (e.g. "Entities") to include in
  4340. // API requests with the JSON null value. By default, fields with empty
  4341. // values are omitted from API requests. However, any field with an
  4342. // empty value appearing in NullFields will be sent to the server as
  4343. // null. It is an error if a field in this list has a non-empty value.
  4344. // This may be used to include null fields in Patch requests.
  4345. NullFields []string `json:"-"`
  4346. }
  4347. func (s *GoogleCloudDialogflowV2beta1SessionEntityType) MarshalJSON() ([]byte, error) {
  4348. type NoMethod GoogleCloudDialogflowV2beta1SessionEntityType
  4349. raw := NoMethod(*s)
  4350. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4351. }
  4352. // GoogleCloudDialogflowV2beta1TextInput: Represents the natural
  4353. // language text to be processed.
  4354. type GoogleCloudDialogflowV2beta1TextInput struct {
  4355. // LanguageCode: Required. The language of this conversational query.
  4356. // See [Language
  4357. // Support](https://dialogflow.com/docs/languages) for a list of
  4358. // the
  4359. // currently supported language codes. Note that queries in the same
  4360. // session
  4361. // do not necessarily need to specify the same language.
  4362. LanguageCode string `json:"languageCode,omitempty"`
  4363. // Text: Required. The UTF-8 encoded natural language text to be
  4364. // processed.
  4365. // Text length must not exceed 256 bytes.
  4366. Text string `json:"text,omitempty"`
  4367. // ForceSendFields is a list of field names (e.g. "LanguageCode") to
  4368. // unconditionally include in API requests. By default, fields with
  4369. // empty values are omitted from API requests. However, any non-pointer,
  4370. // non-interface field appearing in ForceSendFields will be sent to the
  4371. // server regardless of whether the field is empty or not. This may be
  4372. // used to include empty fields in Patch requests.
  4373. ForceSendFields []string `json:"-"`
  4374. // NullFields is a list of field names (e.g. "LanguageCode") to include
  4375. // in API requests with the JSON null value. By default, fields with
  4376. // empty values are omitted from API requests. However, any field with
  4377. // an empty value appearing in NullFields will be sent to the server as
  4378. // null. It is an error if a field in this list has a non-empty value.
  4379. // This may be used to include null fields in Patch requests.
  4380. NullFields []string `json:"-"`
  4381. }
  4382. func (s *GoogleCloudDialogflowV2beta1TextInput) MarshalJSON() ([]byte, error) {
  4383. type NoMethod GoogleCloudDialogflowV2beta1TextInput
  4384. raw := NoMethod(*s)
  4385. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4386. }
  4387. // GoogleCloudDialogflowV2beta1TrainAgentRequest: The request message
  4388. // for Agents.TrainAgent.
  4389. type GoogleCloudDialogflowV2beta1TrainAgentRequest struct {
  4390. }
  4391. // GoogleCloudDialogflowV2beta1WebhookRequest: The request message for a
  4392. // webhook call.
  4393. type GoogleCloudDialogflowV2beta1WebhookRequest struct {
  4394. // OriginalDetectIntentRequest: Optional. The contents of the original
  4395. // request that was passed to
  4396. // `[Streaming]DetectIntent` call.
  4397. OriginalDetectIntentRequest *GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest `json:"originalDetectIntentRequest,omitempty"`
  4398. // QueryResult: The result of the conversational query or event
  4399. // processing. Contains the
  4400. // same value as `[Streaming]DetectIntentResponse.query_result`.
  4401. QueryResult *GoogleCloudDialogflowV2beta1QueryResult `json:"queryResult,omitempty"`
  4402. // ResponseId: The unique identifier of the response. Contains the same
  4403. // value as
  4404. // `[Streaming]DetectIntentResponse.response_id`.
  4405. ResponseId string `json:"responseId,omitempty"`
  4406. // Session: The unique identifier of detectIntent request session.
  4407. // Can be used to identify end-user inside webhook
  4408. // implementation.
  4409. // Format: `projects/<Project ID>/agent/sessions/<Session ID>`.
  4410. Session string `json:"session,omitempty"`
  4411. // ForceSendFields is a list of field names (e.g.
  4412. // "OriginalDetectIntentRequest") to unconditionally include in API
  4413. // requests. By default, fields with empty values are omitted from API
  4414. // requests. However, any non-pointer, non-interface field appearing in
  4415. // ForceSendFields will be sent to the server regardless of whether the
  4416. // field is empty or not. This may be used to include empty fields in
  4417. // Patch requests.
  4418. ForceSendFields []string `json:"-"`
  4419. // NullFields is a list of field names (e.g.
  4420. // "OriginalDetectIntentRequest") to include in API requests with the
  4421. // JSON null value. By default, fields with empty values are omitted
  4422. // from API requests. However, any field with an empty value appearing
  4423. // in NullFields will be sent to the server as null. It is an error if a
  4424. // field in this list has a non-empty value. This may be used to include
  4425. // null fields in Patch requests.
  4426. NullFields []string `json:"-"`
  4427. }
  4428. func (s *GoogleCloudDialogflowV2beta1WebhookRequest) MarshalJSON() ([]byte, error) {
  4429. type NoMethod GoogleCloudDialogflowV2beta1WebhookRequest
  4430. raw := NoMethod(*s)
  4431. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4432. }
  4433. // GoogleCloudDialogflowV2beta1WebhookResponse: The response message for
  4434. // a webhook call.
  4435. type GoogleCloudDialogflowV2beta1WebhookResponse struct {
  4436. // FollowupEventInput: Optional. Makes the platform immediately invoke
  4437. // another `DetectIntent` call
  4438. // internally with the specified event as input.
  4439. FollowupEventInput *GoogleCloudDialogflowV2beta1EventInput `json:"followupEventInput,omitempty"`
  4440. // FulfillmentMessages: Optional. The collection of rich messages to
  4441. // present to the user. This
  4442. // value is passed directly to `QueryResult.fulfillment_messages`.
  4443. FulfillmentMessages []*GoogleCloudDialogflowV2beta1IntentMessage `json:"fulfillmentMessages,omitempty"`
  4444. // FulfillmentText: Optional. The text to be shown on the screen. This
  4445. // value is passed directly
  4446. // to `QueryResult.fulfillment_text`.
  4447. FulfillmentText string `json:"fulfillmentText,omitempty"`
  4448. // OutputContexts: Optional. The collection of output contexts. This
  4449. // value is passed directly
  4450. // to `QueryResult.output_contexts`.
  4451. OutputContexts []*GoogleCloudDialogflowV2beta1Context `json:"outputContexts,omitempty"`
  4452. // Payload: Optional. This value is passed directly to
  4453. // `QueryResult.webhook_payload`.
  4454. // See the related `fulfillment_messages[i].payload field`, which may be
  4455. // used
  4456. // as an alternative to this field.
  4457. //
  4458. // This field can be used for Actions on Google responses.
  4459. // It should have a structure similar to the JSON message shown here.
  4460. // For more
  4461. // information, see
  4462. // [Actions on Google
  4463. // Webhook
  4464. // Format](https://developers.google.com/actions/dialogflow/webho
  4465. // ok)
  4466. // <pre>{
  4467. // "google": {
  4468. // "expectUserResponse": true,
  4469. // "richResponse": {
  4470. // "items": [
  4471. // {
  4472. // "simpleResponse": {
  4473. // "textToSpeech": "this is a simple response"
  4474. // }
  4475. // }
  4476. // ]
  4477. // }
  4478. // }
  4479. // }</pre>
  4480. Payload googleapi.RawMessage `json:"payload,omitempty"`
  4481. // Source: Optional. This value is passed directly to
  4482. // `QueryResult.webhook_source`.
  4483. Source string `json:"source,omitempty"`
  4484. // ForceSendFields is a list of field names (e.g. "FollowupEventInput")
  4485. // to unconditionally include in API requests. By default, fields with
  4486. // empty values are omitted from API requests. However, any non-pointer,
  4487. // non-interface field appearing in ForceSendFields will be sent to the
  4488. // server regardless of whether the field is empty or not. This may be
  4489. // used to include empty fields in Patch requests.
  4490. ForceSendFields []string `json:"-"`
  4491. // NullFields is a list of field names (e.g. "FollowupEventInput") to
  4492. // include in API requests with the JSON null value. By default, fields
  4493. // with empty values are omitted from API requests. However, any field
  4494. // with an empty value appearing in NullFields will be sent to the
  4495. // server as null. It is an error if a field in this list has a
  4496. // non-empty value. This may be used to include null fields in Patch
  4497. // requests.
  4498. NullFields []string `json:"-"`
  4499. }
  4500. func (s *GoogleCloudDialogflowV2beta1WebhookResponse) MarshalJSON() ([]byte, error) {
  4501. type NoMethod GoogleCloudDialogflowV2beta1WebhookResponse
  4502. raw := NoMethod(*s)
  4503. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4504. }
  4505. // GoogleLongrunningOperation: This resource represents a long-running
  4506. // operation that is the result of a
  4507. // network API call.
  4508. type GoogleLongrunningOperation struct {
  4509. // Done: If the value is `false`, it means the operation is still in
  4510. // progress.
  4511. // If `true`, the operation is completed, and either `error` or
  4512. // `response` is
  4513. // available.
  4514. Done bool `json:"done,omitempty"`
  4515. // Error: The error result of the operation in case of failure or
  4516. // cancellation.
  4517. Error *GoogleRpcStatus `json:"error,omitempty"`
  4518. // Metadata: Service-specific metadata associated with the operation.
  4519. // It typically
  4520. // contains progress information and common metadata such as create
  4521. // time.
  4522. // Some services might not provide such metadata. Any method that
  4523. // returns a
  4524. // long-running operation should document the metadata type, if any.
  4525. Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  4526. // Name: The server-assigned name, which is only unique within the same
  4527. // service that
  4528. // originally returns it. If you use the default HTTP mapping,
  4529. // the
  4530. // `name` should have the format of `operations/some/unique/name`.
  4531. Name string `json:"name,omitempty"`
  4532. // Response: The normal response of the operation in case of success.
  4533. // If the original
  4534. // method returns no data on success, such as `Delete`, the response
  4535. // is
  4536. // `google.protobuf.Empty`. If the original method is
  4537. // standard
  4538. // `Get`/`Create`/`Update`, the response should be the resource. For
  4539. // other
  4540. // methods, the response should have the type `XxxResponse`, where
  4541. // `Xxx`
  4542. // is the original method name. For example, if the original method
  4543. // name
  4544. // is `TakeSnapshot()`, the inferred response type
  4545. // is
  4546. // `TakeSnapshotResponse`.
  4547. Response googleapi.RawMessage `json:"response,omitempty"`
  4548. // ServerResponse contains the HTTP response code and headers from the
  4549. // server.
  4550. googleapi.ServerResponse `json:"-"`
  4551. // ForceSendFields is a list of field names (e.g. "Done") to
  4552. // unconditionally include in API requests. By default, fields with
  4553. // empty values are omitted from API requests. However, any non-pointer,
  4554. // non-interface field appearing in ForceSendFields will be sent to the
  4555. // server regardless of whether the field is empty or not. This may be
  4556. // used to include empty fields in Patch requests.
  4557. ForceSendFields []string `json:"-"`
  4558. // NullFields is a list of field names (e.g. "Done") to include in API
  4559. // requests with the JSON null value. By default, fields with empty
  4560. // values are omitted from API requests. However, any field with an
  4561. // empty value appearing in NullFields will be sent to the server as
  4562. // null. It is an error if a field in this list has a non-empty value.
  4563. // This may be used to include null fields in Patch requests.
  4564. NullFields []string `json:"-"`
  4565. }
  4566. func (s *GoogleLongrunningOperation) MarshalJSON() ([]byte, error) {
  4567. type NoMethod GoogleLongrunningOperation
  4568. raw := NoMethod(*s)
  4569. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4570. }
  4571. // GoogleProtobufEmpty: A generic empty message that you can re-use to
  4572. // avoid defining duplicated
  4573. // empty messages in your APIs. A typical example is to use it as the
  4574. // request
  4575. // or the response type of an API method. For instance:
  4576. //
  4577. // service Foo {
  4578. // rpc Bar(google.protobuf.Empty) returns
  4579. // (google.protobuf.Empty);
  4580. // }
  4581. //
  4582. // The JSON representation for `Empty` is empty JSON object `{}`.
  4583. type GoogleProtobufEmpty struct {
  4584. // ServerResponse contains the HTTP response code and headers from the
  4585. // server.
  4586. googleapi.ServerResponse `json:"-"`
  4587. }
  4588. // GoogleRpcStatus: The `Status` type defines a logical error model that
  4589. // is suitable for different
  4590. // programming environments, including REST APIs and RPC APIs. It is
  4591. // used by
  4592. // [gRPC](https://github.com/grpc). The error model is designed to
  4593. // be:
  4594. //
  4595. // - Simple to use and understand for most users
  4596. // - Flexible enough to meet unexpected needs
  4597. //
  4598. // # Overview
  4599. //
  4600. // The `Status` message contains three pieces of data: error code, error
  4601. // message,
  4602. // and error details. The error code should be an enum value
  4603. // of
  4604. // google.rpc.Code, but it may accept additional error codes if needed.
  4605. // The
  4606. // error message should be a developer-facing English message that
  4607. // helps
  4608. // developers *understand* and *resolve* the error. If a localized
  4609. // user-facing
  4610. // error message is needed, put the localized message in the error
  4611. // details or
  4612. // localize it in the client. The optional error details may contain
  4613. // arbitrary
  4614. // information about the error. There is a predefined set of error
  4615. // detail types
  4616. // in the package `google.rpc` that can be used for common error
  4617. // conditions.
  4618. //
  4619. // # Language mapping
  4620. //
  4621. // The `Status` message is the logical representation of the error
  4622. // model, but it
  4623. // is not necessarily the actual wire format. When the `Status` message
  4624. // is
  4625. // exposed in different client libraries and different wire protocols,
  4626. // it can be
  4627. // mapped differently. For example, it will likely be mapped to some
  4628. // exceptions
  4629. // in Java, but more likely mapped to some error codes in C.
  4630. //
  4631. // # Other uses
  4632. //
  4633. // The error model and the `Status` message can be used in a variety
  4634. // of
  4635. // environments, either with or without APIs, to provide a
  4636. // consistent developer experience across different
  4637. // environments.
  4638. //
  4639. // Example uses of this error model include:
  4640. //
  4641. // - Partial errors. If a service needs to return partial errors to the
  4642. // client,
  4643. // it may embed the `Status` in the normal response to indicate the
  4644. // partial
  4645. // errors.
  4646. //
  4647. // - Workflow errors. A typical workflow has multiple steps. Each step
  4648. // may
  4649. // have a `Status` message for error reporting.
  4650. //
  4651. // - Batch operations. If a client uses batch request and batch
  4652. // response, the
  4653. // `Status` message should be used directly inside batch response,
  4654. // one for
  4655. // each error sub-response.
  4656. //
  4657. // - Asynchronous operations. If an API call embeds asynchronous
  4658. // operation
  4659. // results in its response, the status of those operations should
  4660. // be
  4661. // represented directly using the `Status` message.
  4662. //
  4663. // - Logging. If some API errors are stored in logs, the message
  4664. // `Status` could
  4665. // be used directly after any stripping needed for security/privacy
  4666. // reasons.
  4667. type GoogleRpcStatus struct {
  4668. // Code: The status code, which should be an enum value of
  4669. // google.rpc.Code.
  4670. Code int64 `json:"code,omitempty"`
  4671. // Details: A list of messages that carry the error details. There is a
  4672. // common set of
  4673. // message types for APIs to use.
  4674. Details []googleapi.RawMessage `json:"details,omitempty"`
  4675. // Message: A developer-facing error message, which should be in
  4676. // English. Any
  4677. // user-facing error message should be localized and sent in
  4678. // the
  4679. // google.rpc.Status.details field, or localized by the client.
  4680. Message string `json:"message,omitempty"`
  4681. // ForceSendFields is a list of field names (e.g. "Code") to
  4682. // unconditionally include in API requests. By default, fields with
  4683. // empty values are omitted from API requests. However, any non-pointer,
  4684. // non-interface field appearing in ForceSendFields will be sent to the
  4685. // server regardless of whether the field is empty or not. This may be
  4686. // used to include empty fields in Patch requests.
  4687. ForceSendFields []string `json:"-"`
  4688. // NullFields is a list of field names (e.g. "Code") to include in API
  4689. // requests with the JSON null value. By default, fields with empty
  4690. // values are omitted from API requests. However, any field with an
  4691. // empty value appearing in NullFields will be sent to the server as
  4692. // null. It is an error if a field in this list has a non-empty value.
  4693. // This may be used to include null fields in Patch requests.
  4694. NullFields []string `json:"-"`
  4695. }
  4696. func (s *GoogleRpcStatus) MarshalJSON() ([]byte, error) {
  4697. type NoMethod GoogleRpcStatus
  4698. raw := NoMethod(*s)
  4699. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4700. }
  4701. // GoogleTypeLatLng: An object representing a latitude/longitude pair.
  4702. // This is expressed as a pair
  4703. // of doubles representing degrees latitude and degrees longitude.
  4704. // Unless
  4705. // specified otherwise, this must conform to the
  4706. // <a
  4707. // href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
  4708. // st
  4709. // andard</a>. Values must be within normalized ranges.
  4710. type GoogleTypeLatLng struct {
  4711. // Latitude: The latitude in degrees. It must be in the range [-90.0,
  4712. // +90.0].
  4713. Latitude float64 `json:"latitude,omitempty"`
  4714. // Longitude: The longitude in degrees. It must be in the range [-180.0,
  4715. // +180.0].
  4716. Longitude float64 `json:"longitude,omitempty"`
  4717. // ForceSendFields is a list of field names (e.g. "Latitude") to
  4718. // unconditionally include in API requests. By default, fields with
  4719. // empty values are omitted from API requests. However, any non-pointer,
  4720. // non-interface field appearing in ForceSendFields will be sent to the
  4721. // server regardless of whether the field is empty or not. This may be
  4722. // used to include empty fields in Patch requests.
  4723. ForceSendFields []string `json:"-"`
  4724. // NullFields is a list of field names (e.g. "Latitude") to include in
  4725. // API requests with the JSON null value. By default, fields with empty
  4726. // values are omitted from API requests. However, any field with an
  4727. // empty value appearing in NullFields will be sent to the server as
  4728. // null. It is an error if a field in this list has a non-empty value.
  4729. // This may be used to include null fields in Patch requests.
  4730. NullFields []string `json:"-"`
  4731. }
  4732. func (s *GoogleTypeLatLng) MarshalJSON() ([]byte, error) {
  4733. type NoMethod GoogleTypeLatLng
  4734. raw := NoMethod(*s)
  4735. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4736. }
  4737. func (s *GoogleTypeLatLng) UnmarshalJSON(data []byte) error {
  4738. type NoMethod GoogleTypeLatLng
  4739. var s1 struct {
  4740. Latitude gensupport.JSONFloat64 `json:"latitude"`
  4741. Longitude gensupport.JSONFloat64 `json:"longitude"`
  4742. *NoMethod
  4743. }
  4744. s1.NoMethod = (*NoMethod)(s)
  4745. if err := json.Unmarshal(data, &s1); err != nil {
  4746. return err
  4747. }
  4748. s.Latitude = float64(s1.Latitude)
  4749. s.Longitude = float64(s1.Longitude)
  4750. return nil
  4751. }
  4752. // method id "dialogflow.projects.getAgent":
  4753. type ProjectsGetAgentCall struct {
  4754. s *Service
  4755. parent string
  4756. urlParams_ gensupport.URLParams
  4757. ifNoneMatch_ string
  4758. ctx_ context.Context
  4759. header_ http.Header
  4760. }
  4761. // GetAgent: Retrieves the specified agent.
  4762. func (r *ProjectsService) GetAgent(parent string) *ProjectsGetAgentCall {
  4763. c := &ProjectsGetAgentCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4764. c.parent = parent
  4765. return c
  4766. }
  4767. // Fields allows partial responses to be retrieved. See
  4768. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4769. // for more information.
  4770. func (c *ProjectsGetAgentCall) Fields(s ...googleapi.Field) *ProjectsGetAgentCall {
  4771. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4772. return c
  4773. }
  4774. // IfNoneMatch sets the optional parameter which makes the operation
  4775. // fail if the object's ETag matches the given value. This is useful for
  4776. // getting updates only after the object has changed since the last
  4777. // request. Use googleapi.IsNotModified to check whether the response
  4778. // error from Do is the result of In-None-Match.
  4779. func (c *ProjectsGetAgentCall) IfNoneMatch(entityTag string) *ProjectsGetAgentCall {
  4780. c.ifNoneMatch_ = entityTag
  4781. return c
  4782. }
  4783. // Context sets the context to be used in this call's Do method. Any
  4784. // pending HTTP request will be aborted if the provided context is
  4785. // canceled.
  4786. func (c *ProjectsGetAgentCall) Context(ctx context.Context) *ProjectsGetAgentCall {
  4787. c.ctx_ = ctx
  4788. return c
  4789. }
  4790. // Header returns an http.Header that can be modified by the caller to
  4791. // add HTTP headers to the request.
  4792. func (c *ProjectsGetAgentCall) Header() http.Header {
  4793. if c.header_ == nil {
  4794. c.header_ = make(http.Header)
  4795. }
  4796. return c.header_
  4797. }
  4798. func (c *ProjectsGetAgentCall) doRequest(alt string) (*http.Response, error) {
  4799. reqHeaders := make(http.Header)
  4800. for k, v := range c.header_ {
  4801. reqHeaders[k] = v
  4802. }
  4803. reqHeaders.Set("User-Agent", c.s.userAgent())
  4804. if c.ifNoneMatch_ != "" {
  4805. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4806. }
  4807. var body io.Reader = nil
  4808. c.urlParams_.Set("alt", alt)
  4809. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/agent")
  4810. urls += "?" + c.urlParams_.Encode()
  4811. req, _ := http.NewRequest("GET", urls, body)
  4812. req.Header = reqHeaders
  4813. googleapi.Expand(req.URL, map[string]string{
  4814. "parent": c.parent,
  4815. })
  4816. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4817. }
  4818. // Do executes the "dialogflow.projects.getAgent" call.
  4819. // Exactly one of *GoogleCloudDialogflowV2beta1Agent or error will be
  4820. // non-nil. Any non-2xx status code is an error. Response headers are in
  4821. // either *GoogleCloudDialogflowV2beta1Agent.ServerResponse.Header or
  4822. // (if a response was returned at all) in
  4823. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4824. // whether the returned error was because http.StatusNotModified was
  4825. // returned.
  4826. func (c *ProjectsGetAgentCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1Agent, error) {
  4827. gensupport.SetOptions(c.urlParams_, opts...)
  4828. res, err := c.doRequest("json")
  4829. if res != nil && res.StatusCode == http.StatusNotModified {
  4830. if res.Body != nil {
  4831. res.Body.Close()
  4832. }
  4833. return nil, &googleapi.Error{
  4834. Code: res.StatusCode,
  4835. Header: res.Header,
  4836. }
  4837. }
  4838. if err != nil {
  4839. return nil, err
  4840. }
  4841. defer googleapi.CloseBody(res)
  4842. if err := googleapi.CheckResponse(res); err != nil {
  4843. return nil, err
  4844. }
  4845. ret := &GoogleCloudDialogflowV2beta1Agent{
  4846. ServerResponse: googleapi.ServerResponse{
  4847. Header: res.Header,
  4848. HTTPStatusCode: res.StatusCode,
  4849. },
  4850. }
  4851. target := &ret
  4852. if err := gensupport.DecodeResponse(target, res); err != nil {
  4853. return nil, err
  4854. }
  4855. return ret, nil
  4856. // {
  4857. // "description": "Retrieves the specified agent.",
  4858. // "flatPath": "v2beta1/projects/{projectsId}/agent",
  4859. // "httpMethod": "GET",
  4860. // "id": "dialogflow.projects.getAgent",
  4861. // "parameterOrder": [
  4862. // "parent"
  4863. // ],
  4864. // "parameters": {
  4865. // "parent": {
  4866. // "description": "Required. The project that the agent to fetch is associated with.\nFormat: `projects/\u003cProject ID\u003e`.",
  4867. // "location": "path",
  4868. // "pattern": "^projects/[^/]+$",
  4869. // "required": true,
  4870. // "type": "string"
  4871. // }
  4872. // },
  4873. // "path": "v2beta1/{+parent}/agent",
  4874. // "response": {
  4875. // "$ref": "GoogleCloudDialogflowV2beta1Agent"
  4876. // },
  4877. // "scopes": [
  4878. // "https://www.googleapis.com/auth/cloud-platform"
  4879. // ]
  4880. // }
  4881. }
  4882. // method id "dialogflow.projects.agent.export":
  4883. type ProjectsAgentExportCall struct {
  4884. s *Service
  4885. parent string
  4886. googleclouddialogflowv2beta1exportagentrequest *GoogleCloudDialogflowV2beta1ExportAgentRequest
  4887. urlParams_ gensupport.URLParams
  4888. ctx_ context.Context
  4889. header_ http.Header
  4890. }
  4891. // Export: Exports the specified agent to a ZIP file.
  4892. //
  4893. //
  4894. // Operation <response: ExportAgentResponse,
  4895. // metadata: google.protobuf.Struct>
  4896. func (r *ProjectsAgentService) Export(parent string, googleclouddialogflowv2beta1exportagentrequest *GoogleCloudDialogflowV2beta1ExportAgentRequest) *ProjectsAgentExportCall {
  4897. c := &ProjectsAgentExportCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4898. c.parent = parent
  4899. c.googleclouddialogflowv2beta1exportagentrequest = googleclouddialogflowv2beta1exportagentrequest
  4900. return c
  4901. }
  4902. // Fields allows partial responses to be retrieved. See
  4903. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4904. // for more information.
  4905. func (c *ProjectsAgentExportCall) Fields(s ...googleapi.Field) *ProjectsAgentExportCall {
  4906. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4907. return c
  4908. }
  4909. // Context sets the context to be used in this call's Do method. Any
  4910. // pending HTTP request will be aborted if the provided context is
  4911. // canceled.
  4912. func (c *ProjectsAgentExportCall) Context(ctx context.Context) *ProjectsAgentExportCall {
  4913. c.ctx_ = ctx
  4914. return c
  4915. }
  4916. // Header returns an http.Header that can be modified by the caller to
  4917. // add HTTP headers to the request.
  4918. func (c *ProjectsAgentExportCall) Header() http.Header {
  4919. if c.header_ == nil {
  4920. c.header_ = make(http.Header)
  4921. }
  4922. return c.header_
  4923. }
  4924. func (c *ProjectsAgentExportCall) doRequest(alt string) (*http.Response, error) {
  4925. reqHeaders := make(http.Header)
  4926. for k, v := range c.header_ {
  4927. reqHeaders[k] = v
  4928. }
  4929. reqHeaders.Set("User-Agent", c.s.userAgent())
  4930. var body io.Reader = nil
  4931. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1exportagentrequest)
  4932. if err != nil {
  4933. return nil, err
  4934. }
  4935. reqHeaders.Set("Content-Type", "application/json")
  4936. c.urlParams_.Set("alt", alt)
  4937. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/agent:export")
  4938. urls += "?" + c.urlParams_.Encode()
  4939. req, _ := http.NewRequest("POST", urls, body)
  4940. req.Header = reqHeaders
  4941. googleapi.Expand(req.URL, map[string]string{
  4942. "parent": c.parent,
  4943. })
  4944. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4945. }
  4946. // Do executes the "dialogflow.projects.agent.export" call.
  4947. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  4948. // Any non-2xx status code is an error. Response headers are in either
  4949. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  4950. // was returned at all) in error.(*googleapi.Error).Header. Use
  4951. // googleapi.IsNotModified to check whether the returned error was
  4952. // because http.StatusNotModified was returned.
  4953. func (c *ProjectsAgentExportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  4954. gensupport.SetOptions(c.urlParams_, opts...)
  4955. res, err := c.doRequest("json")
  4956. if res != nil && res.StatusCode == http.StatusNotModified {
  4957. if res.Body != nil {
  4958. res.Body.Close()
  4959. }
  4960. return nil, &googleapi.Error{
  4961. Code: res.StatusCode,
  4962. Header: res.Header,
  4963. }
  4964. }
  4965. if err != nil {
  4966. return nil, err
  4967. }
  4968. defer googleapi.CloseBody(res)
  4969. if err := googleapi.CheckResponse(res); err != nil {
  4970. return nil, err
  4971. }
  4972. ret := &GoogleLongrunningOperation{
  4973. ServerResponse: googleapi.ServerResponse{
  4974. Header: res.Header,
  4975. HTTPStatusCode: res.StatusCode,
  4976. },
  4977. }
  4978. target := &ret
  4979. if err := gensupport.DecodeResponse(target, res); err != nil {
  4980. return nil, err
  4981. }
  4982. return ret, nil
  4983. // {
  4984. // "description": "Exports the specified agent to a ZIP file.\n\n\nOperation \u003cresponse: ExportAgentResponse,\n metadata: google.protobuf.Struct\u003e",
  4985. // "flatPath": "v2beta1/projects/{projectsId}/agent:export",
  4986. // "httpMethod": "POST",
  4987. // "id": "dialogflow.projects.agent.export",
  4988. // "parameterOrder": [
  4989. // "parent"
  4990. // ],
  4991. // "parameters": {
  4992. // "parent": {
  4993. // "description": "Required. The project that the agent to export is associated with.\nFormat: `projects/\u003cProject ID\u003e`.",
  4994. // "location": "path",
  4995. // "pattern": "^projects/[^/]+$",
  4996. // "required": true,
  4997. // "type": "string"
  4998. // }
  4999. // },
  5000. // "path": "v2beta1/{+parent}/agent:export",
  5001. // "request": {
  5002. // "$ref": "GoogleCloudDialogflowV2beta1ExportAgentRequest"
  5003. // },
  5004. // "response": {
  5005. // "$ref": "GoogleLongrunningOperation"
  5006. // },
  5007. // "scopes": [
  5008. // "https://www.googleapis.com/auth/cloud-platform"
  5009. // ]
  5010. // }
  5011. }
  5012. // method id "dialogflow.projects.agent.import":
  5013. type ProjectsAgentImportCall struct {
  5014. s *Service
  5015. parent string
  5016. googleclouddialogflowv2beta1importagentrequest *GoogleCloudDialogflowV2beta1ImportAgentRequest
  5017. urlParams_ gensupport.URLParams
  5018. ctx_ context.Context
  5019. header_ http.Header
  5020. }
  5021. // Import: Imports the specified agent from a ZIP file.
  5022. //
  5023. // Uploads new intents and entity types without deleting the existing
  5024. // ones.
  5025. // Intents and entity types with the same name are replaced with the
  5026. // new
  5027. // versions from ImportAgentRequest.
  5028. //
  5029. //
  5030. // Operation <response: google.protobuf.Empty,
  5031. // metadata: google.protobuf.Struct>
  5032. func (r *ProjectsAgentService) Import(parent string, googleclouddialogflowv2beta1importagentrequest *GoogleCloudDialogflowV2beta1ImportAgentRequest) *ProjectsAgentImportCall {
  5033. c := &ProjectsAgentImportCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5034. c.parent = parent
  5035. c.googleclouddialogflowv2beta1importagentrequest = googleclouddialogflowv2beta1importagentrequest
  5036. return c
  5037. }
  5038. // Fields allows partial responses to be retrieved. See
  5039. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5040. // for more information.
  5041. func (c *ProjectsAgentImportCall) Fields(s ...googleapi.Field) *ProjectsAgentImportCall {
  5042. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5043. return c
  5044. }
  5045. // Context sets the context to be used in this call's Do method. Any
  5046. // pending HTTP request will be aborted if the provided context is
  5047. // canceled.
  5048. func (c *ProjectsAgentImportCall) Context(ctx context.Context) *ProjectsAgentImportCall {
  5049. c.ctx_ = ctx
  5050. return c
  5051. }
  5052. // Header returns an http.Header that can be modified by the caller to
  5053. // add HTTP headers to the request.
  5054. func (c *ProjectsAgentImportCall) Header() http.Header {
  5055. if c.header_ == nil {
  5056. c.header_ = make(http.Header)
  5057. }
  5058. return c.header_
  5059. }
  5060. func (c *ProjectsAgentImportCall) doRequest(alt string) (*http.Response, error) {
  5061. reqHeaders := make(http.Header)
  5062. for k, v := range c.header_ {
  5063. reqHeaders[k] = v
  5064. }
  5065. reqHeaders.Set("User-Agent", c.s.userAgent())
  5066. var body io.Reader = nil
  5067. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1importagentrequest)
  5068. if err != nil {
  5069. return nil, err
  5070. }
  5071. reqHeaders.Set("Content-Type", "application/json")
  5072. c.urlParams_.Set("alt", alt)
  5073. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/agent:import")
  5074. urls += "?" + c.urlParams_.Encode()
  5075. req, _ := http.NewRequest("POST", urls, body)
  5076. req.Header = reqHeaders
  5077. googleapi.Expand(req.URL, map[string]string{
  5078. "parent": c.parent,
  5079. })
  5080. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5081. }
  5082. // Do executes the "dialogflow.projects.agent.import" call.
  5083. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  5084. // Any non-2xx status code is an error. Response headers are in either
  5085. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  5086. // was returned at all) in error.(*googleapi.Error).Header. Use
  5087. // googleapi.IsNotModified to check whether the returned error was
  5088. // because http.StatusNotModified was returned.
  5089. func (c *ProjectsAgentImportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  5090. gensupport.SetOptions(c.urlParams_, opts...)
  5091. res, err := c.doRequest("json")
  5092. if res != nil && res.StatusCode == http.StatusNotModified {
  5093. if res.Body != nil {
  5094. res.Body.Close()
  5095. }
  5096. return nil, &googleapi.Error{
  5097. Code: res.StatusCode,
  5098. Header: res.Header,
  5099. }
  5100. }
  5101. if err != nil {
  5102. return nil, err
  5103. }
  5104. defer googleapi.CloseBody(res)
  5105. if err := googleapi.CheckResponse(res); err != nil {
  5106. return nil, err
  5107. }
  5108. ret := &GoogleLongrunningOperation{
  5109. ServerResponse: googleapi.ServerResponse{
  5110. Header: res.Header,
  5111. HTTPStatusCode: res.StatusCode,
  5112. },
  5113. }
  5114. target := &ret
  5115. if err := gensupport.DecodeResponse(target, res); err != nil {
  5116. return nil, err
  5117. }
  5118. return ret, nil
  5119. // {
  5120. // "description": "Imports the specified agent from a ZIP file.\n\nUploads new intents and entity types without deleting the existing ones.\nIntents and entity types with the same name are replaced with the new\nversions from ImportAgentRequest.\n\n\nOperation \u003cresponse: google.protobuf.Empty,\n metadata: google.protobuf.Struct\u003e",
  5121. // "flatPath": "v2beta1/projects/{projectsId}/agent:import",
  5122. // "httpMethod": "POST",
  5123. // "id": "dialogflow.projects.agent.import",
  5124. // "parameterOrder": [
  5125. // "parent"
  5126. // ],
  5127. // "parameters": {
  5128. // "parent": {
  5129. // "description": "Required. The project that the agent to import is associated with.\nFormat: `projects/\u003cProject ID\u003e`.",
  5130. // "location": "path",
  5131. // "pattern": "^projects/[^/]+$",
  5132. // "required": true,
  5133. // "type": "string"
  5134. // }
  5135. // },
  5136. // "path": "v2beta1/{+parent}/agent:import",
  5137. // "request": {
  5138. // "$ref": "GoogleCloudDialogflowV2beta1ImportAgentRequest"
  5139. // },
  5140. // "response": {
  5141. // "$ref": "GoogleLongrunningOperation"
  5142. // },
  5143. // "scopes": [
  5144. // "https://www.googleapis.com/auth/cloud-platform"
  5145. // ]
  5146. // }
  5147. }
  5148. // method id "dialogflow.projects.agent.restore":
  5149. type ProjectsAgentRestoreCall struct {
  5150. s *Service
  5151. parent string
  5152. googleclouddialogflowv2beta1restoreagentrequest *GoogleCloudDialogflowV2beta1RestoreAgentRequest
  5153. urlParams_ gensupport.URLParams
  5154. ctx_ context.Context
  5155. header_ http.Header
  5156. }
  5157. // Restore: Restores the specified agent from a ZIP file.
  5158. //
  5159. // Replaces the current agent version with a new one. All the intents
  5160. // and
  5161. // entity types in the older version are deleted.
  5162. //
  5163. //
  5164. // Operation <response: google.protobuf.Empty,
  5165. // metadata: google.protobuf.Struct>
  5166. func (r *ProjectsAgentService) Restore(parent string, googleclouddialogflowv2beta1restoreagentrequest *GoogleCloudDialogflowV2beta1RestoreAgentRequest) *ProjectsAgentRestoreCall {
  5167. c := &ProjectsAgentRestoreCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5168. c.parent = parent
  5169. c.googleclouddialogflowv2beta1restoreagentrequest = googleclouddialogflowv2beta1restoreagentrequest
  5170. return c
  5171. }
  5172. // Fields allows partial responses to be retrieved. See
  5173. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5174. // for more information.
  5175. func (c *ProjectsAgentRestoreCall) Fields(s ...googleapi.Field) *ProjectsAgentRestoreCall {
  5176. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5177. return c
  5178. }
  5179. // Context sets the context to be used in this call's Do method. Any
  5180. // pending HTTP request will be aborted if the provided context is
  5181. // canceled.
  5182. func (c *ProjectsAgentRestoreCall) Context(ctx context.Context) *ProjectsAgentRestoreCall {
  5183. c.ctx_ = ctx
  5184. return c
  5185. }
  5186. // Header returns an http.Header that can be modified by the caller to
  5187. // add HTTP headers to the request.
  5188. func (c *ProjectsAgentRestoreCall) Header() http.Header {
  5189. if c.header_ == nil {
  5190. c.header_ = make(http.Header)
  5191. }
  5192. return c.header_
  5193. }
  5194. func (c *ProjectsAgentRestoreCall) doRequest(alt string) (*http.Response, error) {
  5195. reqHeaders := make(http.Header)
  5196. for k, v := range c.header_ {
  5197. reqHeaders[k] = v
  5198. }
  5199. reqHeaders.Set("User-Agent", c.s.userAgent())
  5200. var body io.Reader = nil
  5201. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1restoreagentrequest)
  5202. if err != nil {
  5203. return nil, err
  5204. }
  5205. reqHeaders.Set("Content-Type", "application/json")
  5206. c.urlParams_.Set("alt", alt)
  5207. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/agent:restore")
  5208. urls += "?" + c.urlParams_.Encode()
  5209. req, _ := http.NewRequest("POST", urls, body)
  5210. req.Header = reqHeaders
  5211. googleapi.Expand(req.URL, map[string]string{
  5212. "parent": c.parent,
  5213. })
  5214. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5215. }
  5216. // Do executes the "dialogflow.projects.agent.restore" call.
  5217. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  5218. // Any non-2xx status code is an error. Response headers are in either
  5219. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  5220. // was returned at all) in error.(*googleapi.Error).Header. Use
  5221. // googleapi.IsNotModified to check whether the returned error was
  5222. // because http.StatusNotModified was returned.
  5223. func (c *ProjectsAgentRestoreCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  5224. gensupport.SetOptions(c.urlParams_, opts...)
  5225. res, err := c.doRequest("json")
  5226. if res != nil && res.StatusCode == http.StatusNotModified {
  5227. if res.Body != nil {
  5228. res.Body.Close()
  5229. }
  5230. return nil, &googleapi.Error{
  5231. Code: res.StatusCode,
  5232. Header: res.Header,
  5233. }
  5234. }
  5235. if err != nil {
  5236. return nil, err
  5237. }
  5238. defer googleapi.CloseBody(res)
  5239. if err := googleapi.CheckResponse(res); err != nil {
  5240. return nil, err
  5241. }
  5242. ret := &GoogleLongrunningOperation{
  5243. ServerResponse: googleapi.ServerResponse{
  5244. Header: res.Header,
  5245. HTTPStatusCode: res.StatusCode,
  5246. },
  5247. }
  5248. target := &ret
  5249. if err := gensupport.DecodeResponse(target, res); err != nil {
  5250. return nil, err
  5251. }
  5252. return ret, nil
  5253. // {
  5254. // "description": "Restores the specified agent from a ZIP file.\n\nReplaces the current agent version with a new one. All the intents and\nentity types in the older version are deleted.\n\n\nOperation \u003cresponse: google.protobuf.Empty,\n metadata: google.protobuf.Struct\u003e",
  5255. // "flatPath": "v2beta1/projects/{projectsId}/agent:restore",
  5256. // "httpMethod": "POST",
  5257. // "id": "dialogflow.projects.agent.restore",
  5258. // "parameterOrder": [
  5259. // "parent"
  5260. // ],
  5261. // "parameters": {
  5262. // "parent": {
  5263. // "description": "Required. The project that the agent to restore is associated with.\nFormat: `projects/\u003cProject ID\u003e`.",
  5264. // "location": "path",
  5265. // "pattern": "^projects/[^/]+$",
  5266. // "required": true,
  5267. // "type": "string"
  5268. // }
  5269. // },
  5270. // "path": "v2beta1/{+parent}/agent:restore",
  5271. // "request": {
  5272. // "$ref": "GoogleCloudDialogflowV2beta1RestoreAgentRequest"
  5273. // },
  5274. // "response": {
  5275. // "$ref": "GoogleLongrunningOperation"
  5276. // },
  5277. // "scopes": [
  5278. // "https://www.googleapis.com/auth/cloud-platform"
  5279. // ]
  5280. // }
  5281. }
  5282. // method id "dialogflow.projects.agent.search":
  5283. type ProjectsAgentSearchCall struct {
  5284. s *Service
  5285. parent string
  5286. urlParams_ gensupport.URLParams
  5287. ifNoneMatch_ string
  5288. ctx_ context.Context
  5289. header_ http.Header
  5290. }
  5291. // Search: Returns the list of agents.
  5292. //
  5293. // Since there is at most one conversational agent per project, this
  5294. // method is
  5295. // useful primarily for listing all agents across projects the caller
  5296. // has
  5297. // access to. One can achieve that with a wildcard project collection id
  5298. // "-".
  5299. // Refer to
  5300. // [List
  5301. // Sub-Collections](https://cloud.google.com/apis/design/design_pat
  5302. // terns#list_sub-collections).
  5303. func (r *ProjectsAgentService) Search(parent string) *ProjectsAgentSearchCall {
  5304. c := &ProjectsAgentSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5305. c.parent = parent
  5306. return c
  5307. }
  5308. // PageSize sets the optional parameter "pageSize": The maximum number
  5309. // of items to return in a single page. By
  5310. // default 100 and at most 1000.
  5311. func (c *ProjectsAgentSearchCall) PageSize(pageSize int64) *ProjectsAgentSearchCall {
  5312. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  5313. return c
  5314. }
  5315. // PageToken sets the optional parameter "pageToken": The
  5316. // next_page_token value returned from a previous list request.
  5317. func (c *ProjectsAgentSearchCall) PageToken(pageToken string) *ProjectsAgentSearchCall {
  5318. c.urlParams_.Set("pageToken", pageToken)
  5319. return c
  5320. }
  5321. // Fields allows partial responses to be retrieved. See
  5322. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5323. // for more information.
  5324. func (c *ProjectsAgentSearchCall) Fields(s ...googleapi.Field) *ProjectsAgentSearchCall {
  5325. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5326. return c
  5327. }
  5328. // IfNoneMatch sets the optional parameter which makes the operation
  5329. // fail if the object's ETag matches the given value. This is useful for
  5330. // getting updates only after the object has changed since the last
  5331. // request. Use googleapi.IsNotModified to check whether the response
  5332. // error from Do is the result of In-None-Match.
  5333. func (c *ProjectsAgentSearchCall) IfNoneMatch(entityTag string) *ProjectsAgentSearchCall {
  5334. c.ifNoneMatch_ = entityTag
  5335. return c
  5336. }
  5337. // Context sets the context to be used in this call's Do method. Any
  5338. // pending HTTP request will be aborted if the provided context is
  5339. // canceled.
  5340. func (c *ProjectsAgentSearchCall) Context(ctx context.Context) *ProjectsAgentSearchCall {
  5341. c.ctx_ = ctx
  5342. return c
  5343. }
  5344. // Header returns an http.Header that can be modified by the caller to
  5345. // add HTTP headers to the request.
  5346. func (c *ProjectsAgentSearchCall) Header() http.Header {
  5347. if c.header_ == nil {
  5348. c.header_ = make(http.Header)
  5349. }
  5350. return c.header_
  5351. }
  5352. func (c *ProjectsAgentSearchCall) doRequest(alt string) (*http.Response, error) {
  5353. reqHeaders := make(http.Header)
  5354. for k, v := range c.header_ {
  5355. reqHeaders[k] = v
  5356. }
  5357. reqHeaders.Set("User-Agent", c.s.userAgent())
  5358. if c.ifNoneMatch_ != "" {
  5359. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5360. }
  5361. var body io.Reader = nil
  5362. c.urlParams_.Set("alt", alt)
  5363. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/agent:search")
  5364. urls += "?" + c.urlParams_.Encode()
  5365. req, _ := http.NewRequest("GET", urls, body)
  5366. req.Header = reqHeaders
  5367. googleapi.Expand(req.URL, map[string]string{
  5368. "parent": c.parent,
  5369. })
  5370. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5371. }
  5372. // Do executes the "dialogflow.projects.agent.search" call.
  5373. // Exactly one of *GoogleCloudDialogflowV2beta1SearchAgentsResponse or
  5374. // error will be non-nil. Any non-2xx status code is an error. Response
  5375. // headers are in either
  5376. // *GoogleCloudDialogflowV2beta1SearchAgentsResponse.ServerResponse.Heade
  5377. // r or (if a response was returned at all) in
  5378. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5379. // whether the returned error was because http.StatusNotModified was
  5380. // returned.
  5381. func (c *ProjectsAgentSearchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1SearchAgentsResponse, error) {
  5382. gensupport.SetOptions(c.urlParams_, opts...)
  5383. res, err := c.doRequest("json")
  5384. if res != nil && res.StatusCode == http.StatusNotModified {
  5385. if res.Body != nil {
  5386. res.Body.Close()
  5387. }
  5388. return nil, &googleapi.Error{
  5389. Code: res.StatusCode,
  5390. Header: res.Header,
  5391. }
  5392. }
  5393. if err != nil {
  5394. return nil, err
  5395. }
  5396. defer googleapi.CloseBody(res)
  5397. if err := googleapi.CheckResponse(res); err != nil {
  5398. return nil, err
  5399. }
  5400. ret := &GoogleCloudDialogflowV2beta1SearchAgentsResponse{
  5401. ServerResponse: googleapi.ServerResponse{
  5402. Header: res.Header,
  5403. HTTPStatusCode: res.StatusCode,
  5404. },
  5405. }
  5406. target := &ret
  5407. if err := gensupport.DecodeResponse(target, res); err != nil {
  5408. return nil, err
  5409. }
  5410. return ret, nil
  5411. // {
  5412. // "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).",
  5413. // "flatPath": "v2beta1/projects/{projectsId}/agent:search",
  5414. // "httpMethod": "GET",
  5415. // "id": "dialogflow.projects.agent.search",
  5416. // "parameterOrder": [
  5417. // "parent"
  5418. // ],
  5419. // "parameters": {
  5420. // "pageSize": {
  5421. // "description": "Optional. The maximum number of items to return in a single page. By\ndefault 100 and at most 1000.",
  5422. // "format": "int32",
  5423. // "location": "query",
  5424. // "type": "integer"
  5425. // },
  5426. // "pageToken": {
  5427. // "description": "Optional. The next_page_token value returned from a previous list request.",
  5428. // "location": "query",
  5429. // "type": "string"
  5430. // },
  5431. // "parent": {
  5432. // "description": "Required. The project to list agents from.\nFormat: `projects/\u003cProject ID or '-'\u003e`.",
  5433. // "location": "path",
  5434. // "pattern": "^projects/[^/]+$",
  5435. // "required": true,
  5436. // "type": "string"
  5437. // }
  5438. // },
  5439. // "path": "v2beta1/{+parent}/agent:search",
  5440. // "response": {
  5441. // "$ref": "GoogleCloudDialogflowV2beta1SearchAgentsResponse"
  5442. // },
  5443. // "scopes": [
  5444. // "https://www.googleapis.com/auth/cloud-platform"
  5445. // ]
  5446. // }
  5447. }
  5448. // Pages invokes f for each page of results.
  5449. // A non-nil error returned from f will halt the iteration.
  5450. // The provided context supersedes any context provided to the Context method.
  5451. func (c *ProjectsAgentSearchCall) Pages(ctx context.Context, f func(*GoogleCloudDialogflowV2beta1SearchAgentsResponse) error) error {
  5452. c.ctx_ = ctx
  5453. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  5454. for {
  5455. x, err := c.Do()
  5456. if err != nil {
  5457. return err
  5458. }
  5459. if err := f(x); err != nil {
  5460. return err
  5461. }
  5462. if x.NextPageToken == "" {
  5463. return nil
  5464. }
  5465. c.PageToken(x.NextPageToken)
  5466. }
  5467. }
  5468. // method id "dialogflow.projects.agent.train":
  5469. type ProjectsAgentTrainCall struct {
  5470. s *Service
  5471. parent string
  5472. googleclouddialogflowv2beta1trainagentrequest *GoogleCloudDialogflowV2beta1TrainAgentRequest
  5473. urlParams_ gensupport.URLParams
  5474. ctx_ context.Context
  5475. header_ http.Header
  5476. }
  5477. // Train: Trains the specified agent.
  5478. //
  5479. //
  5480. // Operation <response: google.protobuf.Empty,
  5481. // metadata: google.protobuf.Struct>
  5482. func (r *ProjectsAgentService) Train(parent string, googleclouddialogflowv2beta1trainagentrequest *GoogleCloudDialogflowV2beta1TrainAgentRequest) *ProjectsAgentTrainCall {
  5483. c := &ProjectsAgentTrainCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5484. c.parent = parent
  5485. c.googleclouddialogflowv2beta1trainagentrequest = googleclouddialogflowv2beta1trainagentrequest
  5486. return c
  5487. }
  5488. // Fields allows partial responses to be retrieved. See
  5489. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5490. // for more information.
  5491. func (c *ProjectsAgentTrainCall) Fields(s ...googleapi.Field) *ProjectsAgentTrainCall {
  5492. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5493. return c
  5494. }
  5495. // Context sets the context to be used in this call's Do method. Any
  5496. // pending HTTP request will be aborted if the provided context is
  5497. // canceled.
  5498. func (c *ProjectsAgentTrainCall) Context(ctx context.Context) *ProjectsAgentTrainCall {
  5499. c.ctx_ = ctx
  5500. return c
  5501. }
  5502. // Header returns an http.Header that can be modified by the caller to
  5503. // add HTTP headers to the request.
  5504. func (c *ProjectsAgentTrainCall) Header() http.Header {
  5505. if c.header_ == nil {
  5506. c.header_ = make(http.Header)
  5507. }
  5508. return c.header_
  5509. }
  5510. func (c *ProjectsAgentTrainCall) doRequest(alt string) (*http.Response, error) {
  5511. reqHeaders := make(http.Header)
  5512. for k, v := range c.header_ {
  5513. reqHeaders[k] = v
  5514. }
  5515. reqHeaders.Set("User-Agent", c.s.userAgent())
  5516. var body io.Reader = nil
  5517. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1trainagentrequest)
  5518. if err != nil {
  5519. return nil, err
  5520. }
  5521. reqHeaders.Set("Content-Type", "application/json")
  5522. c.urlParams_.Set("alt", alt)
  5523. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/agent:train")
  5524. urls += "?" + c.urlParams_.Encode()
  5525. req, _ := http.NewRequest("POST", urls, body)
  5526. req.Header = reqHeaders
  5527. googleapi.Expand(req.URL, map[string]string{
  5528. "parent": c.parent,
  5529. })
  5530. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5531. }
  5532. // Do executes the "dialogflow.projects.agent.train" call.
  5533. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  5534. // Any non-2xx status code is an error. Response headers are in either
  5535. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  5536. // was returned at all) in error.(*googleapi.Error).Header. Use
  5537. // googleapi.IsNotModified to check whether the returned error was
  5538. // because http.StatusNotModified was returned.
  5539. func (c *ProjectsAgentTrainCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  5540. gensupport.SetOptions(c.urlParams_, opts...)
  5541. res, err := c.doRequest("json")
  5542. if res != nil && res.StatusCode == http.StatusNotModified {
  5543. if res.Body != nil {
  5544. res.Body.Close()
  5545. }
  5546. return nil, &googleapi.Error{
  5547. Code: res.StatusCode,
  5548. Header: res.Header,
  5549. }
  5550. }
  5551. if err != nil {
  5552. return nil, err
  5553. }
  5554. defer googleapi.CloseBody(res)
  5555. if err := googleapi.CheckResponse(res); err != nil {
  5556. return nil, err
  5557. }
  5558. ret := &GoogleLongrunningOperation{
  5559. ServerResponse: googleapi.ServerResponse{
  5560. Header: res.Header,
  5561. HTTPStatusCode: res.StatusCode,
  5562. },
  5563. }
  5564. target := &ret
  5565. if err := gensupport.DecodeResponse(target, res); err != nil {
  5566. return nil, err
  5567. }
  5568. return ret, nil
  5569. // {
  5570. // "description": "Trains the specified agent.\n\n\nOperation \u003cresponse: google.protobuf.Empty,\n metadata: google.protobuf.Struct\u003e",
  5571. // "flatPath": "v2beta1/projects/{projectsId}/agent:train",
  5572. // "httpMethod": "POST",
  5573. // "id": "dialogflow.projects.agent.train",
  5574. // "parameterOrder": [
  5575. // "parent"
  5576. // ],
  5577. // "parameters": {
  5578. // "parent": {
  5579. // "description": "Required. The project that the agent to train is associated with.\nFormat: `projects/\u003cProject ID\u003e`.",
  5580. // "location": "path",
  5581. // "pattern": "^projects/[^/]+$",
  5582. // "required": true,
  5583. // "type": "string"
  5584. // }
  5585. // },
  5586. // "path": "v2beta1/{+parent}/agent:train",
  5587. // "request": {
  5588. // "$ref": "GoogleCloudDialogflowV2beta1TrainAgentRequest"
  5589. // },
  5590. // "response": {
  5591. // "$ref": "GoogleLongrunningOperation"
  5592. // },
  5593. // "scopes": [
  5594. // "https://www.googleapis.com/auth/cloud-platform"
  5595. // ]
  5596. // }
  5597. }
  5598. // method id "dialogflow.projects.agent.entityTypes.batchDelete":
  5599. type ProjectsAgentEntityTypesBatchDeleteCall struct {
  5600. s *Service
  5601. parent string
  5602. googleclouddialogflowv2beta1batchdeleteentitytypesrequest *GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest
  5603. urlParams_ gensupport.URLParams
  5604. ctx_ context.Context
  5605. header_ http.Header
  5606. }
  5607. // BatchDelete: Deletes entity types in the specified agent.
  5608. //
  5609. // Operation <response: google.protobuf.Empty,
  5610. // metadata: google.protobuf.Struct>
  5611. func (r *ProjectsAgentEntityTypesService) BatchDelete(parent string, googleclouddialogflowv2beta1batchdeleteentitytypesrequest *GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest) *ProjectsAgentEntityTypesBatchDeleteCall {
  5612. c := &ProjectsAgentEntityTypesBatchDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5613. c.parent = parent
  5614. c.googleclouddialogflowv2beta1batchdeleteentitytypesrequest = googleclouddialogflowv2beta1batchdeleteentitytypesrequest
  5615. return c
  5616. }
  5617. // Fields allows partial responses to be retrieved. See
  5618. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5619. // for more information.
  5620. func (c *ProjectsAgentEntityTypesBatchDeleteCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesBatchDeleteCall {
  5621. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5622. return c
  5623. }
  5624. // Context sets the context to be used in this call's Do method. Any
  5625. // pending HTTP request will be aborted if the provided context is
  5626. // canceled.
  5627. func (c *ProjectsAgentEntityTypesBatchDeleteCall) Context(ctx context.Context) *ProjectsAgentEntityTypesBatchDeleteCall {
  5628. c.ctx_ = ctx
  5629. return c
  5630. }
  5631. // Header returns an http.Header that can be modified by the caller to
  5632. // add HTTP headers to the request.
  5633. func (c *ProjectsAgentEntityTypesBatchDeleteCall) Header() http.Header {
  5634. if c.header_ == nil {
  5635. c.header_ = make(http.Header)
  5636. }
  5637. return c.header_
  5638. }
  5639. func (c *ProjectsAgentEntityTypesBatchDeleteCall) doRequest(alt string) (*http.Response, error) {
  5640. reqHeaders := make(http.Header)
  5641. for k, v := range c.header_ {
  5642. reqHeaders[k] = v
  5643. }
  5644. reqHeaders.Set("User-Agent", c.s.userAgent())
  5645. var body io.Reader = nil
  5646. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1batchdeleteentitytypesrequest)
  5647. if err != nil {
  5648. return nil, err
  5649. }
  5650. reqHeaders.Set("Content-Type", "application/json")
  5651. c.urlParams_.Set("alt", alt)
  5652. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/entityTypes:batchDelete")
  5653. urls += "?" + c.urlParams_.Encode()
  5654. req, _ := http.NewRequest("POST", urls, body)
  5655. req.Header = reqHeaders
  5656. googleapi.Expand(req.URL, map[string]string{
  5657. "parent": c.parent,
  5658. })
  5659. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5660. }
  5661. // Do executes the "dialogflow.projects.agent.entityTypes.batchDelete" call.
  5662. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  5663. // Any non-2xx status code is an error. Response headers are in either
  5664. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  5665. // was returned at all) in error.(*googleapi.Error).Header. Use
  5666. // googleapi.IsNotModified to check whether the returned error was
  5667. // because http.StatusNotModified was returned.
  5668. func (c *ProjectsAgentEntityTypesBatchDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  5669. gensupport.SetOptions(c.urlParams_, opts...)
  5670. res, err := c.doRequest("json")
  5671. if res != nil && res.StatusCode == http.StatusNotModified {
  5672. if res.Body != nil {
  5673. res.Body.Close()
  5674. }
  5675. return nil, &googleapi.Error{
  5676. Code: res.StatusCode,
  5677. Header: res.Header,
  5678. }
  5679. }
  5680. if err != nil {
  5681. return nil, err
  5682. }
  5683. defer googleapi.CloseBody(res)
  5684. if err := googleapi.CheckResponse(res); err != nil {
  5685. return nil, err
  5686. }
  5687. ret := &GoogleLongrunningOperation{
  5688. ServerResponse: googleapi.ServerResponse{
  5689. Header: res.Header,
  5690. HTTPStatusCode: res.StatusCode,
  5691. },
  5692. }
  5693. target := &ret
  5694. if err := gensupport.DecodeResponse(target, res); err != nil {
  5695. return nil, err
  5696. }
  5697. return ret, nil
  5698. // {
  5699. // "description": "Deletes entity types in the specified agent.\n\nOperation \u003cresponse: google.protobuf.Empty,\n metadata: google.protobuf.Struct\u003e",
  5700. // "flatPath": "v2beta1/projects/{projectsId}/agent/entityTypes:batchDelete",
  5701. // "httpMethod": "POST",
  5702. // "id": "dialogflow.projects.agent.entityTypes.batchDelete",
  5703. // "parameterOrder": [
  5704. // "parent"
  5705. // ],
  5706. // "parameters": {
  5707. // "parent": {
  5708. // "description": "Required. The name of the agent to delete all entities types for. Format:\n`projects/\u003cProject ID\u003e/agent`.",
  5709. // "location": "path",
  5710. // "pattern": "^projects/[^/]+/agent$",
  5711. // "required": true,
  5712. // "type": "string"
  5713. // }
  5714. // },
  5715. // "path": "v2beta1/{+parent}/entityTypes:batchDelete",
  5716. // "request": {
  5717. // "$ref": "GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest"
  5718. // },
  5719. // "response": {
  5720. // "$ref": "GoogleLongrunningOperation"
  5721. // },
  5722. // "scopes": [
  5723. // "https://www.googleapis.com/auth/cloud-platform"
  5724. // ]
  5725. // }
  5726. }
  5727. // method id "dialogflow.projects.agent.entityTypes.batchUpdate":
  5728. type ProjectsAgentEntityTypesBatchUpdateCall struct {
  5729. s *Service
  5730. parent string
  5731. googleclouddialogflowv2beta1batchupdateentitytypesrequest *GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesRequest
  5732. urlParams_ gensupport.URLParams
  5733. ctx_ context.Context
  5734. header_ http.Header
  5735. }
  5736. // BatchUpdate: Updates/Creates multiple entity types in the specified
  5737. // agent.
  5738. //
  5739. // Operation <response: BatchUpdateEntityTypesResponse,
  5740. // metadata: google.protobuf.Struct>
  5741. func (r *ProjectsAgentEntityTypesService) BatchUpdate(parent string, googleclouddialogflowv2beta1batchupdateentitytypesrequest *GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesRequest) *ProjectsAgentEntityTypesBatchUpdateCall {
  5742. c := &ProjectsAgentEntityTypesBatchUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5743. c.parent = parent
  5744. c.googleclouddialogflowv2beta1batchupdateentitytypesrequest = googleclouddialogflowv2beta1batchupdateentitytypesrequest
  5745. return c
  5746. }
  5747. // Fields allows partial responses to be retrieved. See
  5748. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5749. // for more information.
  5750. func (c *ProjectsAgentEntityTypesBatchUpdateCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesBatchUpdateCall {
  5751. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5752. return c
  5753. }
  5754. // Context sets the context to be used in this call's Do method. Any
  5755. // pending HTTP request will be aborted if the provided context is
  5756. // canceled.
  5757. func (c *ProjectsAgentEntityTypesBatchUpdateCall) Context(ctx context.Context) *ProjectsAgentEntityTypesBatchUpdateCall {
  5758. c.ctx_ = ctx
  5759. return c
  5760. }
  5761. // Header returns an http.Header that can be modified by the caller to
  5762. // add HTTP headers to the request.
  5763. func (c *ProjectsAgentEntityTypesBatchUpdateCall) Header() http.Header {
  5764. if c.header_ == nil {
  5765. c.header_ = make(http.Header)
  5766. }
  5767. return c.header_
  5768. }
  5769. func (c *ProjectsAgentEntityTypesBatchUpdateCall) doRequest(alt string) (*http.Response, error) {
  5770. reqHeaders := make(http.Header)
  5771. for k, v := range c.header_ {
  5772. reqHeaders[k] = v
  5773. }
  5774. reqHeaders.Set("User-Agent", c.s.userAgent())
  5775. var body io.Reader = nil
  5776. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1batchupdateentitytypesrequest)
  5777. if err != nil {
  5778. return nil, err
  5779. }
  5780. reqHeaders.Set("Content-Type", "application/json")
  5781. c.urlParams_.Set("alt", alt)
  5782. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/entityTypes:batchUpdate")
  5783. urls += "?" + c.urlParams_.Encode()
  5784. req, _ := http.NewRequest("POST", urls, body)
  5785. req.Header = reqHeaders
  5786. googleapi.Expand(req.URL, map[string]string{
  5787. "parent": c.parent,
  5788. })
  5789. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5790. }
  5791. // Do executes the "dialogflow.projects.agent.entityTypes.batchUpdate" call.
  5792. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  5793. // Any non-2xx status code is an error. Response headers are in either
  5794. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  5795. // was returned at all) in error.(*googleapi.Error).Header. Use
  5796. // googleapi.IsNotModified to check whether the returned error was
  5797. // because http.StatusNotModified was returned.
  5798. func (c *ProjectsAgentEntityTypesBatchUpdateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  5799. gensupport.SetOptions(c.urlParams_, opts...)
  5800. res, err := c.doRequest("json")
  5801. if res != nil && res.StatusCode == http.StatusNotModified {
  5802. if res.Body != nil {
  5803. res.Body.Close()
  5804. }
  5805. return nil, &googleapi.Error{
  5806. Code: res.StatusCode,
  5807. Header: res.Header,
  5808. }
  5809. }
  5810. if err != nil {
  5811. return nil, err
  5812. }
  5813. defer googleapi.CloseBody(res)
  5814. if err := googleapi.CheckResponse(res); err != nil {
  5815. return nil, err
  5816. }
  5817. ret := &GoogleLongrunningOperation{
  5818. ServerResponse: googleapi.ServerResponse{
  5819. Header: res.Header,
  5820. HTTPStatusCode: res.StatusCode,
  5821. },
  5822. }
  5823. target := &ret
  5824. if err := gensupport.DecodeResponse(target, res); err != nil {
  5825. return nil, err
  5826. }
  5827. return ret, nil
  5828. // {
  5829. // "description": "Updates/Creates multiple entity types in the specified agent.\n\nOperation \u003cresponse: BatchUpdateEntityTypesResponse,\n metadata: google.protobuf.Struct\u003e",
  5830. // "flatPath": "v2beta1/projects/{projectsId}/agent/entityTypes:batchUpdate",
  5831. // "httpMethod": "POST",
  5832. // "id": "dialogflow.projects.agent.entityTypes.batchUpdate",
  5833. // "parameterOrder": [
  5834. // "parent"
  5835. // ],
  5836. // "parameters": {
  5837. // "parent": {
  5838. // "description": "Required. The name of the agent to update or create entity types in.\nFormat: `projects/\u003cProject ID\u003e/agent`.",
  5839. // "location": "path",
  5840. // "pattern": "^projects/[^/]+/agent$",
  5841. // "required": true,
  5842. // "type": "string"
  5843. // }
  5844. // },
  5845. // "path": "v2beta1/{+parent}/entityTypes:batchUpdate",
  5846. // "request": {
  5847. // "$ref": "GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesRequest"
  5848. // },
  5849. // "response": {
  5850. // "$ref": "GoogleLongrunningOperation"
  5851. // },
  5852. // "scopes": [
  5853. // "https://www.googleapis.com/auth/cloud-platform"
  5854. // ]
  5855. // }
  5856. }
  5857. // method id "dialogflow.projects.agent.entityTypes.create":
  5858. type ProjectsAgentEntityTypesCreateCall struct {
  5859. s *Service
  5860. parent string
  5861. googleclouddialogflowv2beta1entitytype *GoogleCloudDialogflowV2beta1EntityType
  5862. urlParams_ gensupport.URLParams
  5863. ctx_ context.Context
  5864. header_ http.Header
  5865. }
  5866. // Create: Creates an entity type in the specified agent.
  5867. func (r *ProjectsAgentEntityTypesService) Create(parent string, googleclouddialogflowv2beta1entitytype *GoogleCloudDialogflowV2beta1EntityType) *ProjectsAgentEntityTypesCreateCall {
  5868. c := &ProjectsAgentEntityTypesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5869. c.parent = parent
  5870. c.googleclouddialogflowv2beta1entitytype = googleclouddialogflowv2beta1entitytype
  5871. return c
  5872. }
  5873. // LanguageCode sets the optional parameter "languageCode": The language
  5874. // of entity synonyms defined in `entity_type`. If not
  5875. // specified, the agent's default language is used.
  5876. // [More than a
  5877. // dozen
  5878. // languages](https://dialogflow.com/docs/reference/language) are
  5879. // supported.
  5880. // Note: languages must be enabled in the agent, before they can be
  5881. // used.
  5882. func (c *ProjectsAgentEntityTypesCreateCall) LanguageCode(languageCode string) *ProjectsAgentEntityTypesCreateCall {
  5883. c.urlParams_.Set("languageCode", languageCode)
  5884. return c
  5885. }
  5886. // Fields allows partial responses to be retrieved. See
  5887. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5888. // for more information.
  5889. func (c *ProjectsAgentEntityTypesCreateCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesCreateCall {
  5890. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5891. return c
  5892. }
  5893. // Context sets the context to be used in this call's Do method. Any
  5894. // pending HTTP request will be aborted if the provided context is
  5895. // canceled.
  5896. func (c *ProjectsAgentEntityTypesCreateCall) Context(ctx context.Context) *ProjectsAgentEntityTypesCreateCall {
  5897. c.ctx_ = ctx
  5898. return c
  5899. }
  5900. // Header returns an http.Header that can be modified by the caller to
  5901. // add HTTP headers to the request.
  5902. func (c *ProjectsAgentEntityTypesCreateCall) Header() http.Header {
  5903. if c.header_ == nil {
  5904. c.header_ = make(http.Header)
  5905. }
  5906. return c.header_
  5907. }
  5908. func (c *ProjectsAgentEntityTypesCreateCall) doRequest(alt string) (*http.Response, error) {
  5909. reqHeaders := make(http.Header)
  5910. for k, v := range c.header_ {
  5911. reqHeaders[k] = v
  5912. }
  5913. reqHeaders.Set("User-Agent", c.s.userAgent())
  5914. var body io.Reader = nil
  5915. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1entitytype)
  5916. if err != nil {
  5917. return nil, err
  5918. }
  5919. reqHeaders.Set("Content-Type", "application/json")
  5920. c.urlParams_.Set("alt", alt)
  5921. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/entityTypes")
  5922. urls += "?" + c.urlParams_.Encode()
  5923. req, _ := http.NewRequest("POST", urls, body)
  5924. req.Header = reqHeaders
  5925. googleapi.Expand(req.URL, map[string]string{
  5926. "parent": c.parent,
  5927. })
  5928. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5929. }
  5930. // Do executes the "dialogflow.projects.agent.entityTypes.create" call.
  5931. // Exactly one of *GoogleCloudDialogflowV2beta1EntityType or error will
  5932. // be non-nil. Any non-2xx status code is an error. Response headers are
  5933. // in either
  5934. // *GoogleCloudDialogflowV2beta1EntityType.ServerResponse.Header or (if
  5935. // a response was returned at all) in error.(*googleapi.Error).Header.
  5936. // Use googleapi.IsNotModified to check whether the returned error was
  5937. // because http.StatusNotModified was returned.
  5938. func (c *ProjectsAgentEntityTypesCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1EntityType, error) {
  5939. gensupport.SetOptions(c.urlParams_, opts...)
  5940. res, err := c.doRequest("json")
  5941. if res != nil && res.StatusCode == http.StatusNotModified {
  5942. if res.Body != nil {
  5943. res.Body.Close()
  5944. }
  5945. return nil, &googleapi.Error{
  5946. Code: res.StatusCode,
  5947. Header: res.Header,
  5948. }
  5949. }
  5950. if err != nil {
  5951. return nil, err
  5952. }
  5953. defer googleapi.CloseBody(res)
  5954. if err := googleapi.CheckResponse(res); err != nil {
  5955. return nil, err
  5956. }
  5957. ret := &GoogleCloudDialogflowV2beta1EntityType{
  5958. ServerResponse: googleapi.ServerResponse{
  5959. Header: res.Header,
  5960. HTTPStatusCode: res.StatusCode,
  5961. },
  5962. }
  5963. target := &ret
  5964. if err := gensupport.DecodeResponse(target, res); err != nil {
  5965. return nil, err
  5966. }
  5967. return ret, nil
  5968. // {
  5969. // "description": "Creates an entity type in the specified agent.",
  5970. // "flatPath": "v2beta1/projects/{projectsId}/agent/entityTypes",
  5971. // "httpMethod": "POST",
  5972. // "id": "dialogflow.projects.agent.entityTypes.create",
  5973. // "parameterOrder": [
  5974. // "parent"
  5975. // ],
  5976. // "parameters": {
  5977. // "languageCode": {
  5978. // "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.",
  5979. // "location": "query",
  5980. // "type": "string"
  5981. // },
  5982. // "parent": {
  5983. // "description": "Required. The agent to create a entity type for.\nFormat: `projects/\u003cProject ID\u003e/agent`.",
  5984. // "location": "path",
  5985. // "pattern": "^projects/[^/]+/agent$",
  5986. // "required": true,
  5987. // "type": "string"
  5988. // }
  5989. // },
  5990. // "path": "v2beta1/{+parent}/entityTypes",
  5991. // "request": {
  5992. // "$ref": "GoogleCloudDialogflowV2beta1EntityType"
  5993. // },
  5994. // "response": {
  5995. // "$ref": "GoogleCloudDialogflowV2beta1EntityType"
  5996. // },
  5997. // "scopes": [
  5998. // "https://www.googleapis.com/auth/cloud-platform"
  5999. // ]
  6000. // }
  6001. }
  6002. // method id "dialogflow.projects.agent.entityTypes.delete":
  6003. type ProjectsAgentEntityTypesDeleteCall struct {
  6004. s *Service
  6005. name string
  6006. urlParams_ gensupport.URLParams
  6007. ctx_ context.Context
  6008. header_ http.Header
  6009. }
  6010. // Delete: Deletes the specified entity type.
  6011. func (r *ProjectsAgentEntityTypesService) Delete(name string) *ProjectsAgentEntityTypesDeleteCall {
  6012. c := &ProjectsAgentEntityTypesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6013. c.name = name
  6014. return c
  6015. }
  6016. // Fields allows partial responses to be retrieved. See
  6017. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6018. // for more information.
  6019. func (c *ProjectsAgentEntityTypesDeleteCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesDeleteCall {
  6020. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6021. return c
  6022. }
  6023. // Context sets the context to be used in this call's Do method. Any
  6024. // pending HTTP request will be aborted if the provided context is
  6025. // canceled.
  6026. func (c *ProjectsAgentEntityTypesDeleteCall) Context(ctx context.Context) *ProjectsAgentEntityTypesDeleteCall {
  6027. c.ctx_ = ctx
  6028. return c
  6029. }
  6030. // Header returns an http.Header that can be modified by the caller to
  6031. // add HTTP headers to the request.
  6032. func (c *ProjectsAgentEntityTypesDeleteCall) Header() http.Header {
  6033. if c.header_ == nil {
  6034. c.header_ = make(http.Header)
  6035. }
  6036. return c.header_
  6037. }
  6038. func (c *ProjectsAgentEntityTypesDeleteCall) doRequest(alt string) (*http.Response, error) {
  6039. reqHeaders := make(http.Header)
  6040. for k, v := range c.header_ {
  6041. reqHeaders[k] = v
  6042. }
  6043. reqHeaders.Set("User-Agent", c.s.userAgent())
  6044. var body io.Reader = nil
  6045. c.urlParams_.Set("alt", alt)
  6046. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  6047. urls += "?" + c.urlParams_.Encode()
  6048. req, _ := http.NewRequest("DELETE", urls, body)
  6049. req.Header = reqHeaders
  6050. googleapi.Expand(req.URL, map[string]string{
  6051. "name": c.name,
  6052. })
  6053. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6054. }
  6055. // Do executes the "dialogflow.projects.agent.entityTypes.delete" call.
  6056. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  6057. // non-2xx status code is an error. Response headers are in either
  6058. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  6059. // returned at all) in error.(*googleapi.Error).Header. Use
  6060. // googleapi.IsNotModified to check whether the returned error was
  6061. // because http.StatusNotModified was returned.
  6062. func (c *ProjectsAgentEntityTypesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  6063. gensupport.SetOptions(c.urlParams_, opts...)
  6064. res, err := c.doRequest("json")
  6065. if res != nil && res.StatusCode == http.StatusNotModified {
  6066. if res.Body != nil {
  6067. res.Body.Close()
  6068. }
  6069. return nil, &googleapi.Error{
  6070. Code: res.StatusCode,
  6071. Header: res.Header,
  6072. }
  6073. }
  6074. if err != nil {
  6075. return nil, err
  6076. }
  6077. defer googleapi.CloseBody(res)
  6078. if err := googleapi.CheckResponse(res); err != nil {
  6079. return nil, err
  6080. }
  6081. ret := &GoogleProtobufEmpty{
  6082. ServerResponse: googleapi.ServerResponse{
  6083. Header: res.Header,
  6084. HTTPStatusCode: res.StatusCode,
  6085. },
  6086. }
  6087. target := &ret
  6088. if err := gensupport.DecodeResponse(target, res); err != nil {
  6089. return nil, err
  6090. }
  6091. return ret, nil
  6092. // {
  6093. // "description": "Deletes the specified entity type.",
  6094. // "flatPath": "v2beta1/projects/{projectsId}/agent/entityTypes/{entityTypesId}",
  6095. // "httpMethod": "DELETE",
  6096. // "id": "dialogflow.projects.agent.entityTypes.delete",
  6097. // "parameterOrder": [
  6098. // "name"
  6099. // ],
  6100. // "parameters": {
  6101. // "name": {
  6102. // "description": "Required. The name of the entity type to delete.\nFormat: `projects/\u003cProject ID\u003e/agent/entityTypes/\u003cEntityType ID\u003e`.",
  6103. // "location": "path",
  6104. // "pattern": "^projects/[^/]+/agent/entityTypes/[^/]+$",
  6105. // "required": true,
  6106. // "type": "string"
  6107. // }
  6108. // },
  6109. // "path": "v2beta1/{+name}",
  6110. // "response": {
  6111. // "$ref": "GoogleProtobufEmpty"
  6112. // },
  6113. // "scopes": [
  6114. // "https://www.googleapis.com/auth/cloud-platform"
  6115. // ]
  6116. // }
  6117. }
  6118. // method id "dialogflow.projects.agent.entityTypes.get":
  6119. type ProjectsAgentEntityTypesGetCall struct {
  6120. s *Service
  6121. name string
  6122. urlParams_ gensupport.URLParams
  6123. ifNoneMatch_ string
  6124. ctx_ context.Context
  6125. header_ http.Header
  6126. }
  6127. // Get: Retrieves the specified entity type.
  6128. func (r *ProjectsAgentEntityTypesService) Get(name string) *ProjectsAgentEntityTypesGetCall {
  6129. c := &ProjectsAgentEntityTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6130. c.name = name
  6131. return c
  6132. }
  6133. // LanguageCode sets the optional parameter "languageCode": The language
  6134. // to retrieve entity synonyms for. If not specified,
  6135. // the agent's default language is used.
  6136. // [More than a
  6137. // dozen
  6138. // languages](https://dialogflow.com/docs/reference/language) are
  6139. // supported.
  6140. // Note: languages must be enabled in the agent, before they can be
  6141. // used.
  6142. func (c *ProjectsAgentEntityTypesGetCall) LanguageCode(languageCode string) *ProjectsAgentEntityTypesGetCall {
  6143. c.urlParams_.Set("languageCode", languageCode)
  6144. return c
  6145. }
  6146. // Fields allows partial responses to be retrieved. See
  6147. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6148. // for more information.
  6149. func (c *ProjectsAgentEntityTypesGetCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesGetCall {
  6150. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6151. return c
  6152. }
  6153. // IfNoneMatch sets the optional parameter which makes the operation
  6154. // fail if the object's ETag matches the given value. This is useful for
  6155. // getting updates only after the object has changed since the last
  6156. // request. Use googleapi.IsNotModified to check whether the response
  6157. // error from Do is the result of In-None-Match.
  6158. func (c *ProjectsAgentEntityTypesGetCall) IfNoneMatch(entityTag string) *ProjectsAgentEntityTypesGetCall {
  6159. c.ifNoneMatch_ = entityTag
  6160. return c
  6161. }
  6162. // Context sets the context to be used in this call's Do method. Any
  6163. // pending HTTP request will be aborted if the provided context is
  6164. // canceled.
  6165. func (c *ProjectsAgentEntityTypesGetCall) Context(ctx context.Context) *ProjectsAgentEntityTypesGetCall {
  6166. c.ctx_ = ctx
  6167. return c
  6168. }
  6169. // Header returns an http.Header that can be modified by the caller to
  6170. // add HTTP headers to the request.
  6171. func (c *ProjectsAgentEntityTypesGetCall) Header() http.Header {
  6172. if c.header_ == nil {
  6173. c.header_ = make(http.Header)
  6174. }
  6175. return c.header_
  6176. }
  6177. func (c *ProjectsAgentEntityTypesGetCall) doRequest(alt string) (*http.Response, error) {
  6178. reqHeaders := make(http.Header)
  6179. for k, v := range c.header_ {
  6180. reqHeaders[k] = v
  6181. }
  6182. reqHeaders.Set("User-Agent", c.s.userAgent())
  6183. if c.ifNoneMatch_ != "" {
  6184. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6185. }
  6186. var body io.Reader = nil
  6187. c.urlParams_.Set("alt", alt)
  6188. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  6189. urls += "?" + c.urlParams_.Encode()
  6190. req, _ := http.NewRequest("GET", urls, body)
  6191. req.Header = reqHeaders
  6192. googleapi.Expand(req.URL, map[string]string{
  6193. "name": c.name,
  6194. })
  6195. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6196. }
  6197. // Do executes the "dialogflow.projects.agent.entityTypes.get" call.
  6198. // Exactly one of *GoogleCloudDialogflowV2beta1EntityType or error will
  6199. // be non-nil. Any non-2xx status code is an error. Response headers are
  6200. // in either
  6201. // *GoogleCloudDialogflowV2beta1EntityType.ServerResponse.Header or (if
  6202. // a response was returned at all) in error.(*googleapi.Error).Header.
  6203. // Use googleapi.IsNotModified to check whether the returned error was
  6204. // because http.StatusNotModified was returned.
  6205. func (c *ProjectsAgentEntityTypesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1EntityType, error) {
  6206. gensupport.SetOptions(c.urlParams_, opts...)
  6207. res, err := c.doRequest("json")
  6208. if res != nil && res.StatusCode == http.StatusNotModified {
  6209. if res.Body != nil {
  6210. res.Body.Close()
  6211. }
  6212. return nil, &googleapi.Error{
  6213. Code: res.StatusCode,
  6214. Header: res.Header,
  6215. }
  6216. }
  6217. if err != nil {
  6218. return nil, err
  6219. }
  6220. defer googleapi.CloseBody(res)
  6221. if err := googleapi.CheckResponse(res); err != nil {
  6222. return nil, err
  6223. }
  6224. ret := &GoogleCloudDialogflowV2beta1EntityType{
  6225. ServerResponse: googleapi.ServerResponse{
  6226. Header: res.Header,
  6227. HTTPStatusCode: res.StatusCode,
  6228. },
  6229. }
  6230. target := &ret
  6231. if err := gensupport.DecodeResponse(target, res); err != nil {
  6232. return nil, err
  6233. }
  6234. return ret, nil
  6235. // {
  6236. // "description": "Retrieves the specified entity type.",
  6237. // "flatPath": "v2beta1/projects/{projectsId}/agent/entityTypes/{entityTypesId}",
  6238. // "httpMethod": "GET",
  6239. // "id": "dialogflow.projects.agent.entityTypes.get",
  6240. // "parameterOrder": [
  6241. // "name"
  6242. // ],
  6243. // "parameters": {
  6244. // "languageCode": {
  6245. // "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.",
  6246. // "location": "query",
  6247. // "type": "string"
  6248. // },
  6249. // "name": {
  6250. // "description": "Required. The name of the entity type.\nFormat: `projects/\u003cProject ID\u003e/agent/entityTypes/\u003cEntityType ID\u003e`.",
  6251. // "location": "path",
  6252. // "pattern": "^projects/[^/]+/agent/entityTypes/[^/]+$",
  6253. // "required": true,
  6254. // "type": "string"
  6255. // }
  6256. // },
  6257. // "path": "v2beta1/{+name}",
  6258. // "response": {
  6259. // "$ref": "GoogleCloudDialogflowV2beta1EntityType"
  6260. // },
  6261. // "scopes": [
  6262. // "https://www.googleapis.com/auth/cloud-platform"
  6263. // ]
  6264. // }
  6265. }
  6266. // method id "dialogflow.projects.agent.entityTypes.list":
  6267. type ProjectsAgentEntityTypesListCall struct {
  6268. s *Service
  6269. parent string
  6270. urlParams_ gensupport.URLParams
  6271. ifNoneMatch_ string
  6272. ctx_ context.Context
  6273. header_ http.Header
  6274. }
  6275. // List: Returns the list of all entity types in the specified agent.
  6276. func (r *ProjectsAgentEntityTypesService) List(parent string) *ProjectsAgentEntityTypesListCall {
  6277. c := &ProjectsAgentEntityTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6278. c.parent = parent
  6279. return c
  6280. }
  6281. // LanguageCode sets the optional parameter "languageCode": The language
  6282. // to list entity synonyms for. If not specified,
  6283. // the agent's default language is used.
  6284. // [More than a
  6285. // dozen
  6286. // languages](https://dialogflow.com/docs/reference/language) are
  6287. // supported.
  6288. // Note: languages must be enabled in the agent, before they can be
  6289. // used.
  6290. func (c *ProjectsAgentEntityTypesListCall) LanguageCode(languageCode string) *ProjectsAgentEntityTypesListCall {
  6291. c.urlParams_.Set("languageCode", languageCode)
  6292. return c
  6293. }
  6294. // PageSize sets the optional parameter "pageSize": The maximum number
  6295. // of items to return in a single page. By
  6296. // default 100 and at most 1000.
  6297. func (c *ProjectsAgentEntityTypesListCall) PageSize(pageSize int64) *ProjectsAgentEntityTypesListCall {
  6298. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  6299. return c
  6300. }
  6301. // PageToken sets the optional parameter "pageToken": The
  6302. // next_page_token value returned from a previous list request.
  6303. func (c *ProjectsAgentEntityTypesListCall) PageToken(pageToken string) *ProjectsAgentEntityTypesListCall {
  6304. c.urlParams_.Set("pageToken", pageToken)
  6305. return c
  6306. }
  6307. // Fields allows partial responses to be retrieved. See
  6308. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6309. // for more information.
  6310. func (c *ProjectsAgentEntityTypesListCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesListCall {
  6311. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6312. return c
  6313. }
  6314. // IfNoneMatch sets the optional parameter which makes the operation
  6315. // fail if the object's ETag matches the given value. This is useful for
  6316. // getting updates only after the object has changed since the last
  6317. // request. Use googleapi.IsNotModified to check whether the response
  6318. // error from Do is the result of In-None-Match.
  6319. func (c *ProjectsAgentEntityTypesListCall) IfNoneMatch(entityTag string) *ProjectsAgentEntityTypesListCall {
  6320. c.ifNoneMatch_ = entityTag
  6321. return c
  6322. }
  6323. // Context sets the context to be used in this call's Do method. Any
  6324. // pending HTTP request will be aborted if the provided context is
  6325. // canceled.
  6326. func (c *ProjectsAgentEntityTypesListCall) Context(ctx context.Context) *ProjectsAgentEntityTypesListCall {
  6327. c.ctx_ = ctx
  6328. return c
  6329. }
  6330. // Header returns an http.Header that can be modified by the caller to
  6331. // add HTTP headers to the request.
  6332. func (c *ProjectsAgentEntityTypesListCall) Header() http.Header {
  6333. if c.header_ == nil {
  6334. c.header_ = make(http.Header)
  6335. }
  6336. return c.header_
  6337. }
  6338. func (c *ProjectsAgentEntityTypesListCall) doRequest(alt string) (*http.Response, error) {
  6339. reqHeaders := make(http.Header)
  6340. for k, v := range c.header_ {
  6341. reqHeaders[k] = v
  6342. }
  6343. reqHeaders.Set("User-Agent", c.s.userAgent())
  6344. if c.ifNoneMatch_ != "" {
  6345. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6346. }
  6347. var body io.Reader = nil
  6348. c.urlParams_.Set("alt", alt)
  6349. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/entityTypes")
  6350. urls += "?" + c.urlParams_.Encode()
  6351. req, _ := http.NewRequest("GET", urls, body)
  6352. req.Header = reqHeaders
  6353. googleapi.Expand(req.URL, map[string]string{
  6354. "parent": c.parent,
  6355. })
  6356. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6357. }
  6358. // Do executes the "dialogflow.projects.agent.entityTypes.list" call.
  6359. // Exactly one of *GoogleCloudDialogflowV2beta1ListEntityTypesResponse
  6360. // or error will be non-nil. Any non-2xx status code is an error.
  6361. // Response headers are in either
  6362. // *GoogleCloudDialogflowV2beta1ListEntityTypesResponse.ServerResponse.He
  6363. // ader or (if a response was returned at all) in
  6364. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6365. // whether the returned error was because http.StatusNotModified was
  6366. // returned.
  6367. func (c *ProjectsAgentEntityTypesListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1ListEntityTypesResponse, error) {
  6368. gensupport.SetOptions(c.urlParams_, opts...)
  6369. res, err := c.doRequest("json")
  6370. if res != nil && res.StatusCode == http.StatusNotModified {
  6371. if res.Body != nil {
  6372. res.Body.Close()
  6373. }
  6374. return nil, &googleapi.Error{
  6375. Code: res.StatusCode,
  6376. Header: res.Header,
  6377. }
  6378. }
  6379. if err != nil {
  6380. return nil, err
  6381. }
  6382. defer googleapi.CloseBody(res)
  6383. if err := googleapi.CheckResponse(res); err != nil {
  6384. return nil, err
  6385. }
  6386. ret := &GoogleCloudDialogflowV2beta1ListEntityTypesResponse{
  6387. ServerResponse: googleapi.ServerResponse{
  6388. Header: res.Header,
  6389. HTTPStatusCode: res.StatusCode,
  6390. },
  6391. }
  6392. target := &ret
  6393. if err := gensupport.DecodeResponse(target, res); err != nil {
  6394. return nil, err
  6395. }
  6396. return ret, nil
  6397. // {
  6398. // "description": "Returns the list of all entity types in the specified agent.",
  6399. // "flatPath": "v2beta1/projects/{projectsId}/agent/entityTypes",
  6400. // "httpMethod": "GET",
  6401. // "id": "dialogflow.projects.agent.entityTypes.list",
  6402. // "parameterOrder": [
  6403. // "parent"
  6404. // ],
  6405. // "parameters": {
  6406. // "languageCode": {
  6407. // "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.",
  6408. // "location": "query",
  6409. // "type": "string"
  6410. // },
  6411. // "pageSize": {
  6412. // "description": "Optional. The maximum number of items to return in a single page. By\ndefault 100 and at most 1000.",
  6413. // "format": "int32",
  6414. // "location": "query",
  6415. // "type": "integer"
  6416. // },
  6417. // "pageToken": {
  6418. // "description": "Optional. The next_page_token value returned from a previous list request.",
  6419. // "location": "query",
  6420. // "type": "string"
  6421. // },
  6422. // "parent": {
  6423. // "description": "Required. The agent to list all entity types from.\nFormat: `projects/\u003cProject ID\u003e/agent`.",
  6424. // "location": "path",
  6425. // "pattern": "^projects/[^/]+/agent$",
  6426. // "required": true,
  6427. // "type": "string"
  6428. // }
  6429. // },
  6430. // "path": "v2beta1/{+parent}/entityTypes",
  6431. // "response": {
  6432. // "$ref": "GoogleCloudDialogflowV2beta1ListEntityTypesResponse"
  6433. // },
  6434. // "scopes": [
  6435. // "https://www.googleapis.com/auth/cloud-platform"
  6436. // ]
  6437. // }
  6438. }
  6439. // Pages invokes f for each page of results.
  6440. // A non-nil error returned from f will halt the iteration.
  6441. // The provided context supersedes any context provided to the Context method.
  6442. func (c *ProjectsAgentEntityTypesListCall) Pages(ctx context.Context, f func(*GoogleCloudDialogflowV2beta1ListEntityTypesResponse) error) error {
  6443. c.ctx_ = ctx
  6444. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  6445. for {
  6446. x, err := c.Do()
  6447. if err != nil {
  6448. return err
  6449. }
  6450. if err := f(x); err != nil {
  6451. return err
  6452. }
  6453. if x.NextPageToken == "" {
  6454. return nil
  6455. }
  6456. c.PageToken(x.NextPageToken)
  6457. }
  6458. }
  6459. // method id "dialogflow.projects.agent.entityTypes.patch":
  6460. type ProjectsAgentEntityTypesPatchCall struct {
  6461. s *Service
  6462. nameid string
  6463. googleclouddialogflowv2beta1entitytype *GoogleCloudDialogflowV2beta1EntityType
  6464. urlParams_ gensupport.URLParams
  6465. ctx_ context.Context
  6466. header_ http.Header
  6467. }
  6468. // Patch: Updates the specified entity type.
  6469. func (r *ProjectsAgentEntityTypesService) Patch(nameid string, googleclouddialogflowv2beta1entitytype *GoogleCloudDialogflowV2beta1EntityType) *ProjectsAgentEntityTypesPatchCall {
  6470. c := &ProjectsAgentEntityTypesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6471. c.nameid = nameid
  6472. c.googleclouddialogflowv2beta1entitytype = googleclouddialogflowv2beta1entitytype
  6473. return c
  6474. }
  6475. // LanguageCode sets the optional parameter "languageCode": The language
  6476. // of entity synonyms defined in `entity_type`. If not
  6477. // specified, the agent's default language is used.
  6478. // [More than a
  6479. // dozen
  6480. // languages](https://dialogflow.com/docs/reference/language) are
  6481. // supported.
  6482. // Note: languages must be enabled in the agent, before they can be
  6483. // used.
  6484. func (c *ProjectsAgentEntityTypesPatchCall) LanguageCode(languageCode string) *ProjectsAgentEntityTypesPatchCall {
  6485. c.urlParams_.Set("languageCode", languageCode)
  6486. return c
  6487. }
  6488. // UpdateMask sets the optional parameter "updateMask": The mask to
  6489. // control which fields get updated.
  6490. func (c *ProjectsAgentEntityTypesPatchCall) UpdateMask(updateMask string) *ProjectsAgentEntityTypesPatchCall {
  6491. c.urlParams_.Set("updateMask", updateMask)
  6492. return c
  6493. }
  6494. // Fields allows partial responses to be retrieved. See
  6495. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6496. // for more information.
  6497. func (c *ProjectsAgentEntityTypesPatchCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesPatchCall {
  6498. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6499. return c
  6500. }
  6501. // Context sets the context to be used in this call's Do method. Any
  6502. // pending HTTP request will be aborted if the provided context is
  6503. // canceled.
  6504. func (c *ProjectsAgentEntityTypesPatchCall) Context(ctx context.Context) *ProjectsAgentEntityTypesPatchCall {
  6505. c.ctx_ = ctx
  6506. return c
  6507. }
  6508. // Header returns an http.Header that can be modified by the caller to
  6509. // add HTTP headers to the request.
  6510. func (c *ProjectsAgentEntityTypesPatchCall) Header() http.Header {
  6511. if c.header_ == nil {
  6512. c.header_ = make(http.Header)
  6513. }
  6514. return c.header_
  6515. }
  6516. func (c *ProjectsAgentEntityTypesPatchCall) doRequest(alt string) (*http.Response, error) {
  6517. reqHeaders := make(http.Header)
  6518. for k, v := range c.header_ {
  6519. reqHeaders[k] = v
  6520. }
  6521. reqHeaders.Set("User-Agent", c.s.userAgent())
  6522. var body io.Reader = nil
  6523. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1entitytype)
  6524. if err != nil {
  6525. return nil, err
  6526. }
  6527. reqHeaders.Set("Content-Type", "application/json")
  6528. c.urlParams_.Set("alt", alt)
  6529. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  6530. urls += "?" + c.urlParams_.Encode()
  6531. req, _ := http.NewRequest("PATCH", urls, body)
  6532. req.Header = reqHeaders
  6533. googleapi.Expand(req.URL, map[string]string{
  6534. "name": c.nameid,
  6535. })
  6536. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6537. }
  6538. // Do executes the "dialogflow.projects.agent.entityTypes.patch" call.
  6539. // Exactly one of *GoogleCloudDialogflowV2beta1EntityType or error will
  6540. // be non-nil. Any non-2xx status code is an error. Response headers are
  6541. // in either
  6542. // *GoogleCloudDialogflowV2beta1EntityType.ServerResponse.Header or (if
  6543. // a response was returned at all) in error.(*googleapi.Error).Header.
  6544. // Use googleapi.IsNotModified to check whether the returned error was
  6545. // because http.StatusNotModified was returned.
  6546. func (c *ProjectsAgentEntityTypesPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1EntityType, error) {
  6547. gensupport.SetOptions(c.urlParams_, opts...)
  6548. res, err := c.doRequest("json")
  6549. if res != nil && res.StatusCode == http.StatusNotModified {
  6550. if res.Body != nil {
  6551. res.Body.Close()
  6552. }
  6553. return nil, &googleapi.Error{
  6554. Code: res.StatusCode,
  6555. Header: res.Header,
  6556. }
  6557. }
  6558. if err != nil {
  6559. return nil, err
  6560. }
  6561. defer googleapi.CloseBody(res)
  6562. if err := googleapi.CheckResponse(res); err != nil {
  6563. return nil, err
  6564. }
  6565. ret := &GoogleCloudDialogflowV2beta1EntityType{
  6566. ServerResponse: googleapi.ServerResponse{
  6567. Header: res.Header,
  6568. HTTPStatusCode: res.StatusCode,
  6569. },
  6570. }
  6571. target := &ret
  6572. if err := gensupport.DecodeResponse(target, res); err != nil {
  6573. return nil, err
  6574. }
  6575. return ret, nil
  6576. // {
  6577. // "description": "Updates the specified entity type.",
  6578. // "flatPath": "v2beta1/projects/{projectsId}/agent/entityTypes/{entityTypesId}",
  6579. // "httpMethod": "PATCH",
  6580. // "id": "dialogflow.projects.agent.entityTypes.patch",
  6581. // "parameterOrder": [
  6582. // "name"
  6583. // ],
  6584. // "parameters": {
  6585. // "languageCode": {
  6586. // "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.",
  6587. // "location": "query",
  6588. // "type": "string"
  6589. // },
  6590. // "name": {
  6591. // "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`.",
  6592. // "location": "path",
  6593. // "pattern": "^projects/[^/]+/agent/entityTypes/[^/]+$",
  6594. // "required": true,
  6595. // "type": "string"
  6596. // },
  6597. // "updateMask": {
  6598. // "description": "Optional. The mask to control which fields get updated.",
  6599. // "format": "google-fieldmask",
  6600. // "location": "query",
  6601. // "type": "string"
  6602. // }
  6603. // },
  6604. // "path": "v2beta1/{+name}",
  6605. // "request": {
  6606. // "$ref": "GoogleCloudDialogflowV2beta1EntityType"
  6607. // },
  6608. // "response": {
  6609. // "$ref": "GoogleCloudDialogflowV2beta1EntityType"
  6610. // },
  6611. // "scopes": [
  6612. // "https://www.googleapis.com/auth/cloud-platform"
  6613. // ]
  6614. // }
  6615. }
  6616. // method id "dialogflow.projects.agent.entityTypes.entities.batchCreate":
  6617. type ProjectsAgentEntityTypesEntitiesBatchCreateCall struct {
  6618. s *Service
  6619. parent string
  6620. googleclouddialogflowv2beta1batchcreateentitiesrequest *GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest
  6621. urlParams_ gensupport.URLParams
  6622. ctx_ context.Context
  6623. header_ http.Header
  6624. }
  6625. // BatchCreate: Creates multiple new entities in the specified entity
  6626. // type (extends the
  6627. // existing collection of entries).
  6628. //
  6629. // Operation <response: google.protobuf.Empty>
  6630. func (r *ProjectsAgentEntityTypesEntitiesService) BatchCreate(parent string, googleclouddialogflowv2beta1batchcreateentitiesrequest *GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest) *ProjectsAgentEntityTypesEntitiesBatchCreateCall {
  6631. c := &ProjectsAgentEntityTypesEntitiesBatchCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6632. c.parent = parent
  6633. c.googleclouddialogflowv2beta1batchcreateentitiesrequest = googleclouddialogflowv2beta1batchcreateentitiesrequest
  6634. return c
  6635. }
  6636. // Fields allows partial responses to be retrieved. See
  6637. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6638. // for more information.
  6639. func (c *ProjectsAgentEntityTypesEntitiesBatchCreateCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesEntitiesBatchCreateCall {
  6640. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6641. return c
  6642. }
  6643. // Context sets the context to be used in this call's Do method. Any
  6644. // pending HTTP request will be aborted if the provided context is
  6645. // canceled.
  6646. func (c *ProjectsAgentEntityTypesEntitiesBatchCreateCall) Context(ctx context.Context) *ProjectsAgentEntityTypesEntitiesBatchCreateCall {
  6647. c.ctx_ = ctx
  6648. return c
  6649. }
  6650. // Header returns an http.Header that can be modified by the caller to
  6651. // add HTTP headers to the request.
  6652. func (c *ProjectsAgentEntityTypesEntitiesBatchCreateCall) Header() http.Header {
  6653. if c.header_ == nil {
  6654. c.header_ = make(http.Header)
  6655. }
  6656. return c.header_
  6657. }
  6658. func (c *ProjectsAgentEntityTypesEntitiesBatchCreateCall) doRequest(alt string) (*http.Response, error) {
  6659. reqHeaders := make(http.Header)
  6660. for k, v := range c.header_ {
  6661. reqHeaders[k] = v
  6662. }
  6663. reqHeaders.Set("User-Agent", c.s.userAgent())
  6664. var body io.Reader = nil
  6665. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1batchcreateentitiesrequest)
  6666. if err != nil {
  6667. return nil, err
  6668. }
  6669. reqHeaders.Set("Content-Type", "application/json")
  6670. c.urlParams_.Set("alt", alt)
  6671. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/entities:batchCreate")
  6672. urls += "?" + c.urlParams_.Encode()
  6673. req, _ := http.NewRequest("POST", urls, body)
  6674. req.Header = reqHeaders
  6675. googleapi.Expand(req.URL, map[string]string{
  6676. "parent": c.parent,
  6677. })
  6678. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6679. }
  6680. // Do executes the "dialogflow.projects.agent.entityTypes.entities.batchCreate" call.
  6681. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  6682. // Any non-2xx status code is an error. Response headers are in either
  6683. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  6684. // was returned at all) in error.(*googleapi.Error).Header. Use
  6685. // googleapi.IsNotModified to check whether the returned error was
  6686. // because http.StatusNotModified was returned.
  6687. func (c *ProjectsAgentEntityTypesEntitiesBatchCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  6688. gensupport.SetOptions(c.urlParams_, opts...)
  6689. res, err := c.doRequest("json")
  6690. if res != nil && res.StatusCode == http.StatusNotModified {
  6691. if res.Body != nil {
  6692. res.Body.Close()
  6693. }
  6694. return nil, &googleapi.Error{
  6695. Code: res.StatusCode,
  6696. Header: res.Header,
  6697. }
  6698. }
  6699. if err != nil {
  6700. return nil, err
  6701. }
  6702. defer googleapi.CloseBody(res)
  6703. if err := googleapi.CheckResponse(res); err != nil {
  6704. return nil, err
  6705. }
  6706. ret := &GoogleLongrunningOperation{
  6707. ServerResponse: googleapi.ServerResponse{
  6708. Header: res.Header,
  6709. HTTPStatusCode: res.StatusCode,
  6710. },
  6711. }
  6712. target := &ret
  6713. if err := gensupport.DecodeResponse(target, res); err != nil {
  6714. return nil, err
  6715. }
  6716. return ret, nil
  6717. // {
  6718. // "description": "Creates multiple new entities in the specified entity type (extends the\nexisting collection of entries).\n\nOperation \u003cresponse: google.protobuf.Empty\u003e",
  6719. // "flatPath": "v2beta1/projects/{projectsId}/agent/entityTypes/{entityTypesId}/entities:batchCreate",
  6720. // "httpMethod": "POST",
  6721. // "id": "dialogflow.projects.agent.entityTypes.entities.batchCreate",
  6722. // "parameterOrder": [
  6723. // "parent"
  6724. // ],
  6725. // "parameters": {
  6726. // "parent": {
  6727. // "description": "Required. The name of the entity type to create entities in. Format:\n`projects/\u003cProject ID\u003e/agent/entityTypes/\u003cEntity Type ID\u003e`.",
  6728. // "location": "path",
  6729. // "pattern": "^projects/[^/]+/agent/entityTypes/[^/]+$",
  6730. // "required": true,
  6731. // "type": "string"
  6732. // }
  6733. // },
  6734. // "path": "v2beta1/{+parent}/entities:batchCreate",
  6735. // "request": {
  6736. // "$ref": "GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest"
  6737. // },
  6738. // "response": {
  6739. // "$ref": "GoogleLongrunningOperation"
  6740. // },
  6741. // "scopes": [
  6742. // "https://www.googleapis.com/auth/cloud-platform"
  6743. // ]
  6744. // }
  6745. }
  6746. // method id "dialogflow.projects.agent.entityTypes.entities.batchDelete":
  6747. type ProjectsAgentEntityTypesEntitiesBatchDeleteCall struct {
  6748. s *Service
  6749. parent string
  6750. googleclouddialogflowv2beta1batchdeleteentitiesrequest *GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest
  6751. urlParams_ gensupport.URLParams
  6752. ctx_ context.Context
  6753. header_ http.Header
  6754. }
  6755. // BatchDelete: Deletes entities in the specified entity
  6756. // type.
  6757. //
  6758. // Operation <response: google.protobuf.Empty,
  6759. // metadata: google.protobuf.Struct>
  6760. func (r *ProjectsAgentEntityTypesEntitiesService) BatchDelete(parent string, googleclouddialogflowv2beta1batchdeleteentitiesrequest *GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest) *ProjectsAgentEntityTypesEntitiesBatchDeleteCall {
  6761. c := &ProjectsAgentEntityTypesEntitiesBatchDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6762. c.parent = parent
  6763. c.googleclouddialogflowv2beta1batchdeleteentitiesrequest = googleclouddialogflowv2beta1batchdeleteentitiesrequest
  6764. return c
  6765. }
  6766. // Fields allows partial responses to be retrieved. See
  6767. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6768. // for more information.
  6769. func (c *ProjectsAgentEntityTypesEntitiesBatchDeleteCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesEntitiesBatchDeleteCall {
  6770. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6771. return c
  6772. }
  6773. // Context sets the context to be used in this call's Do method. Any
  6774. // pending HTTP request will be aborted if the provided context is
  6775. // canceled.
  6776. func (c *ProjectsAgentEntityTypesEntitiesBatchDeleteCall) Context(ctx context.Context) *ProjectsAgentEntityTypesEntitiesBatchDeleteCall {
  6777. c.ctx_ = ctx
  6778. return c
  6779. }
  6780. // Header returns an http.Header that can be modified by the caller to
  6781. // add HTTP headers to the request.
  6782. func (c *ProjectsAgentEntityTypesEntitiesBatchDeleteCall) Header() http.Header {
  6783. if c.header_ == nil {
  6784. c.header_ = make(http.Header)
  6785. }
  6786. return c.header_
  6787. }
  6788. func (c *ProjectsAgentEntityTypesEntitiesBatchDeleteCall) doRequest(alt string) (*http.Response, error) {
  6789. reqHeaders := make(http.Header)
  6790. for k, v := range c.header_ {
  6791. reqHeaders[k] = v
  6792. }
  6793. reqHeaders.Set("User-Agent", c.s.userAgent())
  6794. var body io.Reader = nil
  6795. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1batchdeleteentitiesrequest)
  6796. if err != nil {
  6797. return nil, err
  6798. }
  6799. reqHeaders.Set("Content-Type", "application/json")
  6800. c.urlParams_.Set("alt", alt)
  6801. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/entities:batchDelete")
  6802. urls += "?" + c.urlParams_.Encode()
  6803. req, _ := http.NewRequest("POST", urls, body)
  6804. req.Header = reqHeaders
  6805. googleapi.Expand(req.URL, map[string]string{
  6806. "parent": c.parent,
  6807. })
  6808. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6809. }
  6810. // Do executes the "dialogflow.projects.agent.entityTypes.entities.batchDelete" call.
  6811. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  6812. // Any non-2xx status code is an error. Response headers are in either
  6813. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  6814. // was returned at all) in error.(*googleapi.Error).Header. Use
  6815. // googleapi.IsNotModified to check whether the returned error was
  6816. // because http.StatusNotModified was returned.
  6817. func (c *ProjectsAgentEntityTypesEntitiesBatchDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  6818. gensupport.SetOptions(c.urlParams_, opts...)
  6819. res, err := c.doRequest("json")
  6820. if res != nil && res.StatusCode == http.StatusNotModified {
  6821. if res.Body != nil {
  6822. res.Body.Close()
  6823. }
  6824. return nil, &googleapi.Error{
  6825. Code: res.StatusCode,
  6826. Header: res.Header,
  6827. }
  6828. }
  6829. if err != nil {
  6830. return nil, err
  6831. }
  6832. defer googleapi.CloseBody(res)
  6833. if err := googleapi.CheckResponse(res); err != nil {
  6834. return nil, err
  6835. }
  6836. ret := &GoogleLongrunningOperation{
  6837. ServerResponse: googleapi.ServerResponse{
  6838. Header: res.Header,
  6839. HTTPStatusCode: res.StatusCode,
  6840. },
  6841. }
  6842. target := &ret
  6843. if err := gensupport.DecodeResponse(target, res); err != nil {
  6844. return nil, err
  6845. }
  6846. return ret, nil
  6847. // {
  6848. // "description": "Deletes entities in the specified entity type.\n\nOperation \u003cresponse: google.protobuf.Empty,\n metadata: google.protobuf.Struct\u003e",
  6849. // "flatPath": "v2beta1/projects/{projectsId}/agent/entityTypes/{entityTypesId}/entities:batchDelete",
  6850. // "httpMethod": "POST",
  6851. // "id": "dialogflow.projects.agent.entityTypes.entities.batchDelete",
  6852. // "parameterOrder": [
  6853. // "parent"
  6854. // ],
  6855. // "parameters": {
  6856. // "parent": {
  6857. // "description": "Required. The name of the entity type to delete entries for. Format:\n`projects/\u003cProject ID\u003e/agent/entityTypes/\u003cEntity Type ID\u003e`.",
  6858. // "location": "path",
  6859. // "pattern": "^projects/[^/]+/agent/entityTypes/[^/]+$",
  6860. // "required": true,
  6861. // "type": "string"
  6862. // }
  6863. // },
  6864. // "path": "v2beta1/{+parent}/entities:batchDelete",
  6865. // "request": {
  6866. // "$ref": "GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest"
  6867. // },
  6868. // "response": {
  6869. // "$ref": "GoogleLongrunningOperation"
  6870. // },
  6871. // "scopes": [
  6872. // "https://www.googleapis.com/auth/cloud-platform"
  6873. // ]
  6874. // }
  6875. }
  6876. // method id "dialogflow.projects.agent.entityTypes.entities.batchUpdate":
  6877. type ProjectsAgentEntityTypesEntitiesBatchUpdateCall struct {
  6878. s *Service
  6879. parent string
  6880. googleclouddialogflowv2beta1batchupdateentitiesrequest *GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest
  6881. urlParams_ gensupport.URLParams
  6882. ctx_ context.Context
  6883. header_ http.Header
  6884. }
  6885. // BatchUpdate: Updates entities in the specified entity type (replaces
  6886. // the existing
  6887. // collection of entries).
  6888. //
  6889. // Operation <response: google.protobuf.Empty,
  6890. // metadata: google.protobuf.Struct>
  6891. func (r *ProjectsAgentEntityTypesEntitiesService) BatchUpdate(parent string, googleclouddialogflowv2beta1batchupdateentitiesrequest *GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest) *ProjectsAgentEntityTypesEntitiesBatchUpdateCall {
  6892. c := &ProjectsAgentEntityTypesEntitiesBatchUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6893. c.parent = parent
  6894. c.googleclouddialogflowv2beta1batchupdateentitiesrequest = googleclouddialogflowv2beta1batchupdateentitiesrequest
  6895. return c
  6896. }
  6897. // Fields allows partial responses to be retrieved. See
  6898. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6899. // for more information.
  6900. func (c *ProjectsAgentEntityTypesEntitiesBatchUpdateCall) Fields(s ...googleapi.Field) *ProjectsAgentEntityTypesEntitiesBatchUpdateCall {
  6901. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6902. return c
  6903. }
  6904. // Context sets the context to be used in this call's Do method. Any
  6905. // pending HTTP request will be aborted if the provided context is
  6906. // canceled.
  6907. func (c *ProjectsAgentEntityTypesEntitiesBatchUpdateCall) Context(ctx context.Context) *ProjectsAgentEntityTypesEntitiesBatchUpdateCall {
  6908. c.ctx_ = ctx
  6909. return c
  6910. }
  6911. // Header returns an http.Header that can be modified by the caller to
  6912. // add HTTP headers to the request.
  6913. func (c *ProjectsAgentEntityTypesEntitiesBatchUpdateCall) Header() http.Header {
  6914. if c.header_ == nil {
  6915. c.header_ = make(http.Header)
  6916. }
  6917. return c.header_
  6918. }
  6919. func (c *ProjectsAgentEntityTypesEntitiesBatchUpdateCall) doRequest(alt string) (*http.Response, error) {
  6920. reqHeaders := make(http.Header)
  6921. for k, v := range c.header_ {
  6922. reqHeaders[k] = v
  6923. }
  6924. reqHeaders.Set("User-Agent", c.s.userAgent())
  6925. var body io.Reader = nil
  6926. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1batchupdateentitiesrequest)
  6927. if err != nil {
  6928. return nil, err
  6929. }
  6930. reqHeaders.Set("Content-Type", "application/json")
  6931. c.urlParams_.Set("alt", alt)
  6932. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/entities:batchUpdate")
  6933. urls += "?" + c.urlParams_.Encode()
  6934. req, _ := http.NewRequest("POST", urls, body)
  6935. req.Header = reqHeaders
  6936. googleapi.Expand(req.URL, map[string]string{
  6937. "parent": c.parent,
  6938. })
  6939. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6940. }
  6941. // Do executes the "dialogflow.projects.agent.entityTypes.entities.batchUpdate" call.
  6942. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  6943. // Any non-2xx status code is an error. Response headers are in either
  6944. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  6945. // was returned at all) in error.(*googleapi.Error).Header. Use
  6946. // googleapi.IsNotModified to check whether the returned error was
  6947. // because http.StatusNotModified was returned.
  6948. func (c *ProjectsAgentEntityTypesEntitiesBatchUpdateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  6949. gensupport.SetOptions(c.urlParams_, opts...)
  6950. res, err := c.doRequest("json")
  6951. if res != nil && res.StatusCode == http.StatusNotModified {
  6952. if res.Body != nil {
  6953. res.Body.Close()
  6954. }
  6955. return nil, &googleapi.Error{
  6956. Code: res.StatusCode,
  6957. Header: res.Header,
  6958. }
  6959. }
  6960. if err != nil {
  6961. return nil, err
  6962. }
  6963. defer googleapi.CloseBody(res)
  6964. if err := googleapi.CheckResponse(res); err != nil {
  6965. return nil, err
  6966. }
  6967. ret := &GoogleLongrunningOperation{
  6968. ServerResponse: googleapi.ServerResponse{
  6969. Header: res.Header,
  6970. HTTPStatusCode: res.StatusCode,
  6971. },
  6972. }
  6973. target := &ret
  6974. if err := gensupport.DecodeResponse(target, res); err != nil {
  6975. return nil, err
  6976. }
  6977. return ret, nil
  6978. // {
  6979. // "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",
  6980. // "flatPath": "v2beta1/projects/{projectsId}/agent/entityTypes/{entityTypesId}/entities:batchUpdate",
  6981. // "httpMethod": "POST",
  6982. // "id": "dialogflow.projects.agent.entityTypes.entities.batchUpdate",
  6983. // "parameterOrder": [
  6984. // "parent"
  6985. // ],
  6986. // "parameters": {
  6987. // "parent": {
  6988. // "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`.",
  6989. // "location": "path",
  6990. // "pattern": "^projects/[^/]+/agent/entityTypes/[^/]+$",
  6991. // "required": true,
  6992. // "type": "string"
  6993. // }
  6994. // },
  6995. // "path": "v2beta1/{+parent}/entities:batchUpdate",
  6996. // "request": {
  6997. // "$ref": "GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest"
  6998. // },
  6999. // "response": {
  7000. // "$ref": "GoogleLongrunningOperation"
  7001. // },
  7002. // "scopes": [
  7003. // "https://www.googleapis.com/auth/cloud-platform"
  7004. // ]
  7005. // }
  7006. }
  7007. // method id "dialogflow.projects.agent.environments.users.sessions.deleteContexts":
  7008. type ProjectsAgentEnvironmentsUsersSessionsDeleteContextsCall struct {
  7009. s *Service
  7010. parent string
  7011. urlParams_ gensupport.URLParams
  7012. ctx_ context.Context
  7013. header_ http.Header
  7014. }
  7015. // DeleteContexts: Deletes all active contexts in the specified session.
  7016. func (r *ProjectsAgentEnvironmentsUsersSessionsService) DeleteContexts(parent string) *ProjectsAgentEnvironmentsUsersSessionsDeleteContextsCall {
  7017. c := &ProjectsAgentEnvironmentsUsersSessionsDeleteContextsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7018. c.parent = parent
  7019. return c
  7020. }
  7021. // Fields allows partial responses to be retrieved. See
  7022. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7023. // for more information.
  7024. func (c *ProjectsAgentEnvironmentsUsersSessionsDeleteContextsCall) Fields(s ...googleapi.Field) *ProjectsAgentEnvironmentsUsersSessionsDeleteContextsCall {
  7025. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7026. return c
  7027. }
  7028. // Context sets the context to be used in this call's Do method. Any
  7029. // pending HTTP request will be aborted if the provided context is
  7030. // canceled.
  7031. func (c *ProjectsAgentEnvironmentsUsersSessionsDeleteContextsCall) Context(ctx context.Context) *ProjectsAgentEnvironmentsUsersSessionsDeleteContextsCall {
  7032. c.ctx_ = ctx
  7033. return c
  7034. }
  7035. // Header returns an http.Header that can be modified by the caller to
  7036. // add HTTP headers to the request.
  7037. func (c *ProjectsAgentEnvironmentsUsersSessionsDeleteContextsCall) Header() http.Header {
  7038. if c.header_ == nil {
  7039. c.header_ = make(http.Header)
  7040. }
  7041. return c.header_
  7042. }
  7043. func (c *ProjectsAgentEnvironmentsUsersSessionsDeleteContextsCall) doRequest(alt string) (*http.Response, error) {
  7044. reqHeaders := make(http.Header)
  7045. for k, v := range c.header_ {
  7046. reqHeaders[k] = v
  7047. }
  7048. reqHeaders.Set("User-Agent", c.s.userAgent())
  7049. var body io.Reader = nil
  7050. c.urlParams_.Set("alt", alt)
  7051. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/contexts")
  7052. urls += "?" + c.urlParams_.Encode()
  7053. req, _ := http.NewRequest("DELETE", urls, body)
  7054. req.Header = reqHeaders
  7055. googleapi.Expand(req.URL, map[string]string{
  7056. "parent": c.parent,
  7057. })
  7058. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7059. }
  7060. // Do executes the "dialogflow.projects.agent.environments.users.sessions.deleteContexts" call.
  7061. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  7062. // non-2xx status code is an error. Response headers are in either
  7063. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  7064. // returned at all) in error.(*googleapi.Error).Header. Use
  7065. // googleapi.IsNotModified to check whether the returned error was
  7066. // because http.StatusNotModified was returned.
  7067. func (c *ProjectsAgentEnvironmentsUsersSessionsDeleteContextsCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  7068. gensupport.SetOptions(c.urlParams_, opts...)
  7069. res, err := c.doRequest("json")
  7070. if res != nil && res.StatusCode == http.StatusNotModified {
  7071. if res.Body != nil {
  7072. res.Body.Close()
  7073. }
  7074. return nil, &googleapi.Error{
  7075. Code: res.StatusCode,
  7076. Header: res.Header,
  7077. }
  7078. }
  7079. if err != nil {
  7080. return nil, err
  7081. }
  7082. defer googleapi.CloseBody(res)
  7083. if err := googleapi.CheckResponse(res); err != nil {
  7084. return nil, err
  7085. }
  7086. ret := &GoogleProtobufEmpty{
  7087. ServerResponse: googleapi.ServerResponse{
  7088. Header: res.Header,
  7089. HTTPStatusCode: res.StatusCode,
  7090. },
  7091. }
  7092. target := &ret
  7093. if err := gensupport.DecodeResponse(target, res); err != nil {
  7094. return nil, err
  7095. }
  7096. return ret, nil
  7097. // {
  7098. // "description": "Deletes all active contexts in the specified session.",
  7099. // "flatPath": "v2beta1/projects/{projectsId}/agent/environments/{environmentsId}/users/{usersId}/sessions/{sessionsId}/contexts",
  7100. // "httpMethod": "DELETE",
  7101. // "id": "dialogflow.projects.agent.environments.users.sessions.deleteContexts",
  7102. // "parameterOrder": [
  7103. // "parent"
  7104. // ],
  7105. // "parameters": {
  7106. // "parent": {
  7107. // "description": "Required. The name of the session to delete all contexts from. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e` or `projects/\u003cProject\nID\u003e/agent/environments/\u003cEnvironment ID\u003e/users/\u003cUser ID\u003e/sessions/\u003cSession\nID\u003e`. Note: Environments and users are under construction and will be\navailable soon. If \u003cEnvironment ID\u003e is not specified we assume default\n'draft' environment. If \u003cUser ID\u003e is not specified, we assume default\n'-' user.",
  7108. // "location": "path",
  7109. // "pattern": "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+$",
  7110. // "required": true,
  7111. // "type": "string"
  7112. // }
  7113. // },
  7114. // "path": "v2beta1/{+parent}/contexts",
  7115. // "response": {
  7116. // "$ref": "GoogleProtobufEmpty"
  7117. // },
  7118. // "scopes": [
  7119. // "https://www.googleapis.com/auth/cloud-platform"
  7120. // ]
  7121. // }
  7122. }
  7123. // method id "dialogflow.projects.agent.environments.users.sessions.detectIntent":
  7124. type ProjectsAgentEnvironmentsUsersSessionsDetectIntentCall struct {
  7125. s *Service
  7126. sessionid string
  7127. googleclouddialogflowv2beta1detectintentrequest *GoogleCloudDialogflowV2beta1DetectIntentRequest
  7128. urlParams_ gensupport.URLParams
  7129. ctx_ context.Context
  7130. header_ http.Header
  7131. }
  7132. // DetectIntent: Processes a natural language query and returns
  7133. // structured, actionable data
  7134. // as a result. This method is not idempotent, because it may cause
  7135. // contexts
  7136. // and session entity types to be updated, which in turn might
  7137. // affect
  7138. // results of future queries.
  7139. func (r *ProjectsAgentEnvironmentsUsersSessionsService) DetectIntent(sessionid string, googleclouddialogflowv2beta1detectintentrequest *GoogleCloudDialogflowV2beta1DetectIntentRequest) *ProjectsAgentEnvironmentsUsersSessionsDetectIntentCall {
  7140. c := &ProjectsAgentEnvironmentsUsersSessionsDetectIntentCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7141. c.sessionid = sessionid
  7142. c.googleclouddialogflowv2beta1detectintentrequest = googleclouddialogflowv2beta1detectintentrequest
  7143. return c
  7144. }
  7145. // Fields allows partial responses to be retrieved. See
  7146. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7147. // for more information.
  7148. func (c *ProjectsAgentEnvironmentsUsersSessionsDetectIntentCall) Fields(s ...googleapi.Field) *ProjectsAgentEnvironmentsUsersSessionsDetectIntentCall {
  7149. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7150. return c
  7151. }
  7152. // Context sets the context to be used in this call's Do method. Any
  7153. // pending HTTP request will be aborted if the provided context is
  7154. // canceled.
  7155. func (c *ProjectsAgentEnvironmentsUsersSessionsDetectIntentCall) Context(ctx context.Context) *ProjectsAgentEnvironmentsUsersSessionsDetectIntentCall {
  7156. c.ctx_ = ctx
  7157. return c
  7158. }
  7159. // Header returns an http.Header that can be modified by the caller to
  7160. // add HTTP headers to the request.
  7161. func (c *ProjectsAgentEnvironmentsUsersSessionsDetectIntentCall) Header() http.Header {
  7162. if c.header_ == nil {
  7163. c.header_ = make(http.Header)
  7164. }
  7165. return c.header_
  7166. }
  7167. func (c *ProjectsAgentEnvironmentsUsersSessionsDetectIntentCall) doRequest(alt string) (*http.Response, error) {
  7168. reqHeaders := make(http.Header)
  7169. for k, v := range c.header_ {
  7170. reqHeaders[k] = v
  7171. }
  7172. reqHeaders.Set("User-Agent", c.s.userAgent())
  7173. var body io.Reader = nil
  7174. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1detectintentrequest)
  7175. if err != nil {
  7176. return nil, err
  7177. }
  7178. reqHeaders.Set("Content-Type", "application/json")
  7179. c.urlParams_.Set("alt", alt)
  7180. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+session}:detectIntent")
  7181. urls += "?" + c.urlParams_.Encode()
  7182. req, _ := http.NewRequest("POST", urls, body)
  7183. req.Header = reqHeaders
  7184. googleapi.Expand(req.URL, map[string]string{
  7185. "session": c.sessionid,
  7186. })
  7187. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7188. }
  7189. // Do executes the "dialogflow.projects.agent.environments.users.sessions.detectIntent" call.
  7190. // Exactly one of *GoogleCloudDialogflowV2beta1DetectIntentResponse or
  7191. // error will be non-nil. Any non-2xx status code is an error. Response
  7192. // headers are in either
  7193. // *GoogleCloudDialogflowV2beta1DetectIntentResponse.ServerResponse.Heade
  7194. // r or (if a response was returned at all) in
  7195. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7196. // whether the returned error was because http.StatusNotModified was
  7197. // returned.
  7198. func (c *ProjectsAgentEnvironmentsUsersSessionsDetectIntentCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1DetectIntentResponse, error) {
  7199. gensupport.SetOptions(c.urlParams_, opts...)
  7200. res, err := c.doRequest("json")
  7201. if res != nil && res.StatusCode == http.StatusNotModified {
  7202. if res.Body != nil {
  7203. res.Body.Close()
  7204. }
  7205. return nil, &googleapi.Error{
  7206. Code: res.StatusCode,
  7207. Header: res.Header,
  7208. }
  7209. }
  7210. if err != nil {
  7211. return nil, err
  7212. }
  7213. defer googleapi.CloseBody(res)
  7214. if err := googleapi.CheckResponse(res); err != nil {
  7215. return nil, err
  7216. }
  7217. ret := &GoogleCloudDialogflowV2beta1DetectIntentResponse{
  7218. ServerResponse: googleapi.ServerResponse{
  7219. Header: res.Header,
  7220. HTTPStatusCode: res.StatusCode,
  7221. },
  7222. }
  7223. target := &ret
  7224. if err := gensupport.DecodeResponse(target, res); err != nil {
  7225. return nil, err
  7226. }
  7227. return ret, nil
  7228. // {
  7229. // "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.",
  7230. // "flatPath": "v2beta1/projects/{projectsId}/agent/environments/{environmentsId}/users/{usersId}/sessions/{sessionsId}:detectIntent",
  7231. // "httpMethod": "POST",
  7232. // "id": "dialogflow.projects.agent.environments.users.sessions.detectIntent",
  7233. // "parameterOrder": [
  7234. // "session"
  7235. // ],
  7236. // "parameters": {
  7237. // "session": {
  7238. // "description": "Required. The name of the session this query is sent to. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e`, or\n`projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment ID\u003e/users/\u003cUser\nID\u003e/sessions/\u003cSession ID\u003e`. Note: Environments and users are under\nconstruction and will be available soon. If \u003cEnvironment ID\u003e is not\nspecified, we assume default 'draft' environment. If \u003cUser ID\u003e is not\nspecified, we are using \"-\". It’s up to the API caller to choose an\nappropriate \u003cSession ID\u003e and \u003cUser Id\u003e. They can be a random numbers or\nsome type of user and session identifiers (preferably hashed). The length\nof the \u003cSession ID\u003e and \u003cUser ID\u003e must not exceed 36 characters.",
  7239. // "location": "path",
  7240. // "pattern": "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+$",
  7241. // "required": true,
  7242. // "type": "string"
  7243. // }
  7244. // },
  7245. // "path": "v2beta1/{+session}:detectIntent",
  7246. // "request": {
  7247. // "$ref": "GoogleCloudDialogflowV2beta1DetectIntentRequest"
  7248. // },
  7249. // "response": {
  7250. // "$ref": "GoogleCloudDialogflowV2beta1DetectIntentResponse"
  7251. // },
  7252. // "scopes": [
  7253. // "https://www.googleapis.com/auth/cloud-platform"
  7254. // ]
  7255. // }
  7256. }
  7257. // method id "dialogflow.projects.agent.environments.users.sessions.contexts.create":
  7258. type ProjectsAgentEnvironmentsUsersSessionsContextsCreateCall struct {
  7259. s *Service
  7260. parent string
  7261. googleclouddialogflowv2beta1context *GoogleCloudDialogflowV2beta1Context
  7262. urlParams_ gensupport.URLParams
  7263. ctx_ context.Context
  7264. header_ http.Header
  7265. }
  7266. // Create: Creates a context.
  7267. func (r *ProjectsAgentEnvironmentsUsersSessionsContextsService) Create(parent string, googleclouddialogflowv2beta1context *GoogleCloudDialogflowV2beta1Context) *ProjectsAgentEnvironmentsUsersSessionsContextsCreateCall {
  7268. c := &ProjectsAgentEnvironmentsUsersSessionsContextsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7269. c.parent = parent
  7270. c.googleclouddialogflowv2beta1context = googleclouddialogflowv2beta1context
  7271. return c
  7272. }
  7273. // Fields allows partial responses to be retrieved. See
  7274. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7275. // for more information.
  7276. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsCreateCall) Fields(s ...googleapi.Field) *ProjectsAgentEnvironmentsUsersSessionsContextsCreateCall {
  7277. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7278. return c
  7279. }
  7280. // Context sets the context to be used in this call's Do method. Any
  7281. // pending HTTP request will be aborted if the provided context is
  7282. // canceled.
  7283. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsCreateCall) Context(ctx context.Context) *ProjectsAgentEnvironmentsUsersSessionsContextsCreateCall {
  7284. c.ctx_ = ctx
  7285. return c
  7286. }
  7287. // Header returns an http.Header that can be modified by the caller to
  7288. // add HTTP headers to the request.
  7289. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsCreateCall) Header() http.Header {
  7290. if c.header_ == nil {
  7291. c.header_ = make(http.Header)
  7292. }
  7293. return c.header_
  7294. }
  7295. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsCreateCall) doRequest(alt string) (*http.Response, error) {
  7296. reqHeaders := make(http.Header)
  7297. for k, v := range c.header_ {
  7298. reqHeaders[k] = v
  7299. }
  7300. reqHeaders.Set("User-Agent", c.s.userAgent())
  7301. var body io.Reader = nil
  7302. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1context)
  7303. if err != nil {
  7304. return nil, err
  7305. }
  7306. reqHeaders.Set("Content-Type", "application/json")
  7307. c.urlParams_.Set("alt", alt)
  7308. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/contexts")
  7309. urls += "?" + c.urlParams_.Encode()
  7310. req, _ := http.NewRequest("POST", urls, body)
  7311. req.Header = reqHeaders
  7312. googleapi.Expand(req.URL, map[string]string{
  7313. "parent": c.parent,
  7314. })
  7315. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7316. }
  7317. // Do executes the "dialogflow.projects.agent.environments.users.sessions.contexts.create" call.
  7318. // Exactly one of *GoogleCloudDialogflowV2beta1Context or error will be
  7319. // non-nil. Any non-2xx status code is an error. Response headers are in
  7320. // either *GoogleCloudDialogflowV2beta1Context.ServerResponse.Header or
  7321. // (if a response was returned at all) in
  7322. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7323. // whether the returned error was because http.StatusNotModified was
  7324. // returned.
  7325. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1Context, error) {
  7326. gensupport.SetOptions(c.urlParams_, opts...)
  7327. res, err := c.doRequest("json")
  7328. if res != nil && res.StatusCode == http.StatusNotModified {
  7329. if res.Body != nil {
  7330. res.Body.Close()
  7331. }
  7332. return nil, &googleapi.Error{
  7333. Code: res.StatusCode,
  7334. Header: res.Header,
  7335. }
  7336. }
  7337. if err != nil {
  7338. return nil, err
  7339. }
  7340. defer googleapi.CloseBody(res)
  7341. if err := googleapi.CheckResponse(res); err != nil {
  7342. return nil, err
  7343. }
  7344. ret := &GoogleCloudDialogflowV2beta1Context{
  7345. ServerResponse: googleapi.ServerResponse{
  7346. Header: res.Header,
  7347. HTTPStatusCode: res.StatusCode,
  7348. },
  7349. }
  7350. target := &ret
  7351. if err := gensupport.DecodeResponse(target, res); err != nil {
  7352. return nil, err
  7353. }
  7354. return ret, nil
  7355. // {
  7356. // "description": "Creates a context.",
  7357. // "flatPath": "v2beta1/projects/{projectsId}/agent/environments/{environmentsId}/users/{usersId}/sessions/{sessionsId}/contexts",
  7358. // "httpMethod": "POST",
  7359. // "id": "dialogflow.projects.agent.environments.users.sessions.contexts.create",
  7360. // "parameterOrder": [
  7361. // "parent"
  7362. // ],
  7363. // "parameters": {
  7364. // "parent": {
  7365. // "description": "Required. The session to create a context for.\nFormat: `projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e` or\n`projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment ID\u003e/users/\u003cUser\nID\u003e/sessions/\u003cSession ID\u003e`. Note: Environments and users are under\nconstruction and will be available soon. If \u003cEnvironment ID\u003e is not\nspecified, we assume default 'draft' environment. If \u003cUser ID\u003e is not\nspecified, we assume default '-' user.",
  7366. // "location": "path",
  7367. // "pattern": "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+$",
  7368. // "required": true,
  7369. // "type": "string"
  7370. // }
  7371. // },
  7372. // "path": "v2beta1/{+parent}/contexts",
  7373. // "request": {
  7374. // "$ref": "GoogleCloudDialogflowV2beta1Context"
  7375. // },
  7376. // "response": {
  7377. // "$ref": "GoogleCloudDialogflowV2beta1Context"
  7378. // },
  7379. // "scopes": [
  7380. // "https://www.googleapis.com/auth/cloud-platform"
  7381. // ]
  7382. // }
  7383. }
  7384. // method id "dialogflow.projects.agent.environments.users.sessions.contexts.delete":
  7385. type ProjectsAgentEnvironmentsUsersSessionsContextsDeleteCall struct {
  7386. s *Service
  7387. name string
  7388. urlParams_ gensupport.URLParams
  7389. ctx_ context.Context
  7390. header_ http.Header
  7391. }
  7392. // Delete: Deletes the specified context.
  7393. func (r *ProjectsAgentEnvironmentsUsersSessionsContextsService) Delete(name string) *ProjectsAgentEnvironmentsUsersSessionsContextsDeleteCall {
  7394. c := &ProjectsAgentEnvironmentsUsersSessionsContextsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7395. c.name = name
  7396. return c
  7397. }
  7398. // Fields allows partial responses to be retrieved. See
  7399. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7400. // for more information.
  7401. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsDeleteCall) Fields(s ...googleapi.Field) *ProjectsAgentEnvironmentsUsersSessionsContextsDeleteCall {
  7402. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7403. return c
  7404. }
  7405. // Context sets the context to be used in this call's Do method. Any
  7406. // pending HTTP request will be aborted if the provided context is
  7407. // canceled.
  7408. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsDeleteCall) Context(ctx context.Context) *ProjectsAgentEnvironmentsUsersSessionsContextsDeleteCall {
  7409. c.ctx_ = ctx
  7410. return c
  7411. }
  7412. // Header returns an http.Header that can be modified by the caller to
  7413. // add HTTP headers to the request.
  7414. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsDeleteCall) Header() http.Header {
  7415. if c.header_ == nil {
  7416. c.header_ = make(http.Header)
  7417. }
  7418. return c.header_
  7419. }
  7420. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsDeleteCall) doRequest(alt string) (*http.Response, error) {
  7421. reqHeaders := make(http.Header)
  7422. for k, v := range c.header_ {
  7423. reqHeaders[k] = v
  7424. }
  7425. reqHeaders.Set("User-Agent", c.s.userAgent())
  7426. var body io.Reader = nil
  7427. c.urlParams_.Set("alt", alt)
  7428. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  7429. urls += "?" + c.urlParams_.Encode()
  7430. req, _ := http.NewRequest("DELETE", urls, body)
  7431. req.Header = reqHeaders
  7432. googleapi.Expand(req.URL, map[string]string{
  7433. "name": c.name,
  7434. })
  7435. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7436. }
  7437. // Do executes the "dialogflow.projects.agent.environments.users.sessions.contexts.delete" call.
  7438. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  7439. // non-2xx status code is an error. Response headers are in either
  7440. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  7441. // returned at all) in error.(*googleapi.Error).Header. Use
  7442. // googleapi.IsNotModified to check whether the returned error was
  7443. // because http.StatusNotModified was returned.
  7444. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  7445. gensupport.SetOptions(c.urlParams_, opts...)
  7446. res, err := c.doRequest("json")
  7447. if res != nil && res.StatusCode == http.StatusNotModified {
  7448. if res.Body != nil {
  7449. res.Body.Close()
  7450. }
  7451. return nil, &googleapi.Error{
  7452. Code: res.StatusCode,
  7453. Header: res.Header,
  7454. }
  7455. }
  7456. if err != nil {
  7457. return nil, err
  7458. }
  7459. defer googleapi.CloseBody(res)
  7460. if err := googleapi.CheckResponse(res); err != nil {
  7461. return nil, err
  7462. }
  7463. ret := &GoogleProtobufEmpty{
  7464. ServerResponse: googleapi.ServerResponse{
  7465. Header: res.Header,
  7466. HTTPStatusCode: res.StatusCode,
  7467. },
  7468. }
  7469. target := &ret
  7470. if err := gensupport.DecodeResponse(target, res); err != nil {
  7471. return nil, err
  7472. }
  7473. return ret, nil
  7474. // {
  7475. // "description": "Deletes the specified context.",
  7476. // "flatPath": "v2beta1/projects/{projectsId}/agent/environments/{environmentsId}/users/{usersId}/sessions/{sessionsId}/contexts/{contextsId}",
  7477. // "httpMethod": "DELETE",
  7478. // "id": "dialogflow.projects.agent.environments.users.sessions.contexts.delete",
  7479. // "parameterOrder": [
  7480. // "name"
  7481. // ],
  7482. // "parameters": {
  7483. // "name": {
  7484. // "description": "Required. The name of the context to delete. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e/contexts/\u003cContext ID\u003e`\nor `projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment ID\u003e/users/\u003cUser\nID\u003e/sessions/\u003cSession ID\u003e/contexts/\u003cContext ID\u003e`. Note: Environments and\nusers are under construction and will be available soon. If \u003cEnvironment\nID\u003e is not specified, we assume default 'draft' environment. If \u003cUser ID\u003e\nis not specified, we assume default\n'-' user.",
  7485. // "location": "path",
  7486. // "pattern": "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/contexts/[^/]+$",
  7487. // "required": true,
  7488. // "type": "string"
  7489. // }
  7490. // },
  7491. // "path": "v2beta1/{+name}",
  7492. // "response": {
  7493. // "$ref": "GoogleProtobufEmpty"
  7494. // },
  7495. // "scopes": [
  7496. // "https://www.googleapis.com/auth/cloud-platform"
  7497. // ]
  7498. // }
  7499. }
  7500. // method id "dialogflow.projects.agent.environments.users.sessions.contexts.get":
  7501. type ProjectsAgentEnvironmentsUsersSessionsContextsGetCall struct {
  7502. s *Service
  7503. name string
  7504. urlParams_ gensupport.URLParams
  7505. ifNoneMatch_ string
  7506. ctx_ context.Context
  7507. header_ http.Header
  7508. }
  7509. // Get: Retrieves the specified context.
  7510. func (r *ProjectsAgentEnvironmentsUsersSessionsContextsService) Get(name string) *ProjectsAgentEnvironmentsUsersSessionsContextsGetCall {
  7511. c := &ProjectsAgentEnvironmentsUsersSessionsContextsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7512. c.name = name
  7513. return c
  7514. }
  7515. // Fields allows partial responses to be retrieved. See
  7516. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7517. // for more information.
  7518. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsGetCall) Fields(s ...googleapi.Field) *ProjectsAgentEnvironmentsUsersSessionsContextsGetCall {
  7519. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7520. return c
  7521. }
  7522. // IfNoneMatch sets the optional parameter which makes the operation
  7523. // fail if the object's ETag matches the given value. This is useful for
  7524. // getting updates only after the object has changed since the last
  7525. // request. Use googleapi.IsNotModified to check whether the response
  7526. // error from Do is the result of In-None-Match.
  7527. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsGetCall) IfNoneMatch(entityTag string) *ProjectsAgentEnvironmentsUsersSessionsContextsGetCall {
  7528. c.ifNoneMatch_ = entityTag
  7529. return c
  7530. }
  7531. // Context sets the context to be used in this call's Do method. Any
  7532. // pending HTTP request will be aborted if the provided context is
  7533. // canceled.
  7534. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsGetCall) Context(ctx context.Context) *ProjectsAgentEnvironmentsUsersSessionsContextsGetCall {
  7535. c.ctx_ = ctx
  7536. return c
  7537. }
  7538. // Header returns an http.Header that can be modified by the caller to
  7539. // add HTTP headers to the request.
  7540. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsGetCall) Header() http.Header {
  7541. if c.header_ == nil {
  7542. c.header_ = make(http.Header)
  7543. }
  7544. return c.header_
  7545. }
  7546. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsGetCall) doRequest(alt string) (*http.Response, error) {
  7547. reqHeaders := make(http.Header)
  7548. for k, v := range c.header_ {
  7549. reqHeaders[k] = v
  7550. }
  7551. reqHeaders.Set("User-Agent", c.s.userAgent())
  7552. if c.ifNoneMatch_ != "" {
  7553. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7554. }
  7555. var body io.Reader = nil
  7556. c.urlParams_.Set("alt", alt)
  7557. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  7558. urls += "?" + c.urlParams_.Encode()
  7559. req, _ := http.NewRequest("GET", urls, body)
  7560. req.Header = reqHeaders
  7561. googleapi.Expand(req.URL, map[string]string{
  7562. "name": c.name,
  7563. })
  7564. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7565. }
  7566. // Do executes the "dialogflow.projects.agent.environments.users.sessions.contexts.get" call.
  7567. // Exactly one of *GoogleCloudDialogflowV2beta1Context or error will be
  7568. // non-nil. Any non-2xx status code is an error. Response headers are in
  7569. // either *GoogleCloudDialogflowV2beta1Context.ServerResponse.Header or
  7570. // (if a response was returned at all) in
  7571. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7572. // whether the returned error was because http.StatusNotModified was
  7573. // returned.
  7574. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1Context, error) {
  7575. gensupport.SetOptions(c.urlParams_, opts...)
  7576. res, err := c.doRequest("json")
  7577. if res != nil && res.StatusCode == http.StatusNotModified {
  7578. if res.Body != nil {
  7579. res.Body.Close()
  7580. }
  7581. return nil, &googleapi.Error{
  7582. Code: res.StatusCode,
  7583. Header: res.Header,
  7584. }
  7585. }
  7586. if err != nil {
  7587. return nil, err
  7588. }
  7589. defer googleapi.CloseBody(res)
  7590. if err := googleapi.CheckResponse(res); err != nil {
  7591. return nil, err
  7592. }
  7593. ret := &GoogleCloudDialogflowV2beta1Context{
  7594. ServerResponse: googleapi.ServerResponse{
  7595. Header: res.Header,
  7596. HTTPStatusCode: res.StatusCode,
  7597. },
  7598. }
  7599. target := &ret
  7600. if err := gensupport.DecodeResponse(target, res); err != nil {
  7601. return nil, err
  7602. }
  7603. return ret, nil
  7604. // {
  7605. // "description": "Retrieves the specified context.",
  7606. // "flatPath": "v2beta1/projects/{projectsId}/agent/environments/{environmentsId}/users/{usersId}/sessions/{sessionsId}/contexts/{contextsId}",
  7607. // "httpMethod": "GET",
  7608. // "id": "dialogflow.projects.agent.environments.users.sessions.contexts.get",
  7609. // "parameterOrder": [
  7610. // "name"
  7611. // ],
  7612. // "parameters": {
  7613. // "name": {
  7614. // "description": "Required. The name of the context. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e/contexts/\u003cContext ID\u003e`\nor `projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment ID\u003e/users/\u003cUser\nID\u003e/sessions/\u003cSession ID\u003e/contexts/\u003cContext ID\u003e`. Note: Environments and\nusers are under construction and will be available soon. If \u003cEnvironment\nID\u003e is not specified, we assume default 'draft' environment. If \u003cUser ID\u003e\nis not specified, we assume default '-' user.",
  7615. // "location": "path",
  7616. // "pattern": "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/contexts/[^/]+$",
  7617. // "required": true,
  7618. // "type": "string"
  7619. // }
  7620. // },
  7621. // "path": "v2beta1/{+name}",
  7622. // "response": {
  7623. // "$ref": "GoogleCloudDialogflowV2beta1Context"
  7624. // },
  7625. // "scopes": [
  7626. // "https://www.googleapis.com/auth/cloud-platform"
  7627. // ]
  7628. // }
  7629. }
  7630. // method id "dialogflow.projects.agent.environments.users.sessions.contexts.list":
  7631. type ProjectsAgentEnvironmentsUsersSessionsContextsListCall struct {
  7632. s *Service
  7633. parent string
  7634. urlParams_ gensupport.URLParams
  7635. ifNoneMatch_ string
  7636. ctx_ context.Context
  7637. header_ http.Header
  7638. }
  7639. // List: Returns the list of all contexts in the specified session.
  7640. func (r *ProjectsAgentEnvironmentsUsersSessionsContextsService) List(parent string) *ProjectsAgentEnvironmentsUsersSessionsContextsListCall {
  7641. c := &ProjectsAgentEnvironmentsUsersSessionsContextsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7642. c.parent = parent
  7643. return c
  7644. }
  7645. // PageSize sets the optional parameter "pageSize": The maximum number
  7646. // of items to return in a single page. By
  7647. // default 100 and at most 1000.
  7648. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsListCall) PageSize(pageSize int64) *ProjectsAgentEnvironmentsUsersSessionsContextsListCall {
  7649. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  7650. return c
  7651. }
  7652. // PageToken sets the optional parameter "pageToken": The
  7653. // next_page_token value returned from a previous list request.
  7654. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsListCall) PageToken(pageToken string) *ProjectsAgentEnvironmentsUsersSessionsContextsListCall {
  7655. c.urlParams_.Set("pageToken", pageToken)
  7656. return c
  7657. }
  7658. // Fields allows partial responses to be retrieved. See
  7659. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7660. // for more information.
  7661. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsListCall) Fields(s ...googleapi.Field) *ProjectsAgentEnvironmentsUsersSessionsContextsListCall {
  7662. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7663. return c
  7664. }
  7665. // IfNoneMatch sets the optional parameter which makes the operation
  7666. // fail if the object's ETag matches the given value. This is useful for
  7667. // getting updates only after the object has changed since the last
  7668. // request. Use googleapi.IsNotModified to check whether the response
  7669. // error from Do is the result of In-None-Match.
  7670. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsListCall) IfNoneMatch(entityTag string) *ProjectsAgentEnvironmentsUsersSessionsContextsListCall {
  7671. c.ifNoneMatch_ = entityTag
  7672. return c
  7673. }
  7674. // Context sets the context to be used in this call's Do method. Any
  7675. // pending HTTP request will be aborted if the provided context is
  7676. // canceled.
  7677. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsListCall) Context(ctx context.Context) *ProjectsAgentEnvironmentsUsersSessionsContextsListCall {
  7678. c.ctx_ = ctx
  7679. return c
  7680. }
  7681. // Header returns an http.Header that can be modified by the caller to
  7682. // add HTTP headers to the request.
  7683. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsListCall) Header() http.Header {
  7684. if c.header_ == nil {
  7685. c.header_ = make(http.Header)
  7686. }
  7687. return c.header_
  7688. }
  7689. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsListCall) doRequest(alt string) (*http.Response, error) {
  7690. reqHeaders := make(http.Header)
  7691. for k, v := range c.header_ {
  7692. reqHeaders[k] = v
  7693. }
  7694. reqHeaders.Set("User-Agent", c.s.userAgent())
  7695. if c.ifNoneMatch_ != "" {
  7696. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7697. }
  7698. var body io.Reader = nil
  7699. c.urlParams_.Set("alt", alt)
  7700. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/contexts")
  7701. urls += "?" + c.urlParams_.Encode()
  7702. req, _ := http.NewRequest("GET", urls, body)
  7703. req.Header = reqHeaders
  7704. googleapi.Expand(req.URL, map[string]string{
  7705. "parent": c.parent,
  7706. })
  7707. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7708. }
  7709. // Do executes the "dialogflow.projects.agent.environments.users.sessions.contexts.list" call.
  7710. // Exactly one of *GoogleCloudDialogflowV2beta1ListContextsResponse or
  7711. // error will be non-nil. Any non-2xx status code is an error. Response
  7712. // headers are in either
  7713. // *GoogleCloudDialogflowV2beta1ListContextsResponse.ServerResponse.Heade
  7714. // r or (if a response was returned at all) in
  7715. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7716. // whether the returned error was because http.StatusNotModified was
  7717. // returned.
  7718. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1ListContextsResponse, error) {
  7719. gensupport.SetOptions(c.urlParams_, opts...)
  7720. res, err := c.doRequest("json")
  7721. if res != nil && res.StatusCode == http.StatusNotModified {
  7722. if res.Body != nil {
  7723. res.Body.Close()
  7724. }
  7725. return nil, &googleapi.Error{
  7726. Code: res.StatusCode,
  7727. Header: res.Header,
  7728. }
  7729. }
  7730. if err != nil {
  7731. return nil, err
  7732. }
  7733. defer googleapi.CloseBody(res)
  7734. if err := googleapi.CheckResponse(res); err != nil {
  7735. return nil, err
  7736. }
  7737. ret := &GoogleCloudDialogflowV2beta1ListContextsResponse{
  7738. ServerResponse: googleapi.ServerResponse{
  7739. Header: res.Header,
  7740. HTTPStatusCode: res.StatusCode,
  7741. },
  7742. }
  7743. target := &ret
  7744. if err := gensupport.DecodeResponse(target, res); err != nil {
  7745. return nil, err
  7746. }
  7747. return ret, nil
  7748. // {
  7749. // "description": "Returns the list of all contexts in the specified session.",
  7750. // "flatPath": "v2beta1/projects/{projectsId}/agent/environments/{environmentsId}/users/{usersId}/sessions/{sessionsId}/contexts",
  7751. // "httpMethod": "GET",
  7752. // "id": "dialogflow.projects.agent.environments.users.sessions.contexts.list",
  7753. // "parameterOrder": [
  7754. // "parent"
  7755. // ],
  7756. // "parameters": {
  7757. // "pageSize": {
  7758. // "description": "Optional. The maximum number of items to return in a single page. By\ndefault 100 and at most 1000.",
  7759. // "format": "int32",
  7760. // "location": "query",
  7761. // "type": "integer"
  7762. // },
  7763. // "pageToken": {
  7764. // "description": "Optional. The next_page_token value returned from a previous list request.",
  7765. // "location": "query",
  7766. // "type": "string"
  7767. // },
  7768. // "parent": {
  7769. // "description": "Required. The session to list all contexts from.\nFormat: `projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e` or\n`projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment ID\u003e/users/\u003cUser\nID\u003e/sessions/\u003cSession ID\u003e`. Note: Environments and users are under\nconstruction and will be available soon. If \u003cEnvironment ID\u003e is not\nspecified, we assume default 'draft' environment. If \u003cUser ID\u003e is not\nspecified, we assume default '-' user.",
  7770. // "location": "path",
  7771. // "pattern": "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+$",
  7772. // "required": true,
  7773. // "type": "string"
  7774. // }
  7775. // },
  7776. // "path": "v2beta1/{+parent}/contexts",
  7777. // "response": {
  7778. // "$ref": "GoogleCloudDialogflowV2beta1ListContextsResponse"
  7779. // },
  7780. // "scopes": [
  7781. // "https://www.googleapis.com/auth/cloud-platform"
  7782. // ]
  7783. // }
  7784. }
  7785. // Pages invokes f for each page of results.
  7786. // A non-nil error returned from f will halt the iteration.
  7787. // The provided context supersedes any context provided to the Context method.
  7788. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsListCall) Pages(ctx context.Context, f func(*GoogleCloudDialogflowV2beta1ListContextsResponse) error) error {
  7789. c.ctx_ = ctx
  7790. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  7791. for {
  7792. x, err := c.Do()
  7793. if err != nil {
  7794. return err
  7795. }
  7796. if err := f(x); err != nil {
  7797. return err
  7798. }
  7799. if x.NextPageToken == "" {
  7800. return nil
  7801. }
  7802. c.PageToken(x.NextPageToken)
  7803. }
  7804. }
  7805. // method id "dialogflow.projects.agent.environments.users.sessions.contexts.patch":
  7806. type ProjectsAgentEnvironmentsUsersSessionsContextsPatchCall struct {
  7807. s *Service
  7808. nameid string
  7809. googleclouddialogflowv2beta1context *GoogleCloudDialogflowV2beta1Context
  7810. urlParams_ gensupport.URLParams
  7811. ctx_ context.Context
  7812. header_ http.Header
  7813. }
  7814. // Patch: Updates the specified context.
  7815. func (r *ProjectsAgentEnvironmentsUsersSessionsContextsService) Patch(nameid string, googleclouddialogflowv2beta1context *GoogleCloudDialogflowV2beta1Context) *ProjectsAgentEnvironmentsUsersSessionsContextsPatchCall {
  7816. c := &ProjectsAgentEnvironmentsUsersSessionsContextsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7817. c.nameid = nameid
  7818. c.googleclouddialogflowv2beta1context = googleclouddialogflowv2beta1context
  7819. return c
  7820. }
  7821. // UpdateMask sets the optional parameter "updateMask": The mask to
  7822. // control which fields get updated.
  7823. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsPatchCall) UpdateMask(updateMask string) *ProjectsAgentEnvironmentsUsersSessionsContextsPatchCall {
  7824. c.urlParams_.Set("updateMask", updateMask)
  7825. return c
  7826. }
  7827. // Fields allows partial responses to be retrieved. See
  7828. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7829. // for more information.
  7830. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsPatchCall) Fields(s ...googleapi.Field) *ProjectsAgentEnvironmentsUsersSessionsContextsPatchCall {
  7831. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7832. return c
  7833. }
  7834. // Context sets the context to be used in this call's Do method. Any
  7835. // pending HTTP request will be aborted if the provided context is
  7836. // canceled.
  7837. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsPatchCall) Context(ctx context.Context) *ProjectsAgentEnvironmentsUsersSessionsContextsPatchCall {
  7838. c.ctx_ = ctx
  7839. return c
  7840. }
  7841. // Header returns an http.Header that can be modified by the caller to
  7842. // add HTTP headers to the request.
  7843. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsPatchCall) Header() http.Header {
  7844. if c.header_ == nil {
  7845. c.header_ = make(http.Header)
  7846. }
  7847. return c.header_
  7848. }
  7849. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsPatchCall) doRequest(alt string) (*http.Response, error) {
  7850. reqHeaders := make(http.Header)
  7851. for k, v := range c.header_ {
  7852. reqHeaders[k] = v
  7853. }
  7854. reqHeaders.Set("User-Agent", c.s.userAgent())
  7855. var body io.Reader = nil
  7856. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1context)
  7857. if err != nil {
  7858. return nil, err
  7859. }
  7860. reqHeaders.Set("Content-Type", "application/json")
  7861. c.urlParams_.Set("alt", alt)
  7862. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  7863. urls += "?" + c.urlParams_.Encode()
  7864. req, _ := http.NewRequest("PATCH", urls, body)
  7865. req.Header = reqHeaders
  7866. googleapi.Expand(req.URL, map[string]string{
  7867. "name": c.nameid,
  7868. })
  7869. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7870. }
  7871. // Do executes the "dialogflow.projects.agent.environments.users.sessions.contexts.patch" call.
  7872. // Exactly one of *GoogleCloudDialogflowV2beta1Context or error will be
  7873. // non-nil. Any non-2xx status code is an error. Response headers are in
  7874. // either *GoogleCloudDialogflowV2beta1Context.ServerResponse.Header or
  7875. // (if a response was returned at all) in
  7876. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7877. // whether the returned error was because http.StatusNotModified was
  7878. // returned.
  7879. func (c *ProjectsAgentEnvironmentsUsersSessionsContextsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1Context, error) {
  7880. gensupport.SetOptions(c.urlParams_, opts...)
  7881. res, err := c.doRequest("json")
  7882. if res != nil && res.StatusCode == http.StatusNotModified {
  7883. if res.Body != nil {
  7884. res.Body.Close()
  7885. }
  7886. return nil, &googleapi.Error{
  7887. Code: res.StatusCode,
  7888. Header: res.Header,
  7889. }
  7890. }
  7891. if err != nil {
  7892. return nil, err
  7893. }
  7894. defer googleapi.CloseBody(res)
  7895. if err := googleapi.CheckResponse(res); err != nil {
  7896. return nil, err
  7897. }
  7898. ret := &GoogleCloudDialogflowV2beta1Context{
  7899. ServerResponse: googleapi.ServerResponse{
  7900. Header: res.Header,
  7901. HTTPStatusCode: res.StatusCode,
  7902. },
  7903. }
  7904. target := &ret
  7905. if err := gensupport.DecodeResponse(target, res); err != nil {
  7906. return nil, err
  7907. }
  7908. return ret, nil
  7909. // {
  7910. // "description": "Updates the specified context.",
  7911. // "flatPath": "v2beta1/projects/{projectsId}/agent/environments/{environmentsId}/users/{usersId}/sessions/{sessionsId}/contexts/{contextsId}",
  7912. // "httpMethod": "PATCH",
  7913. // "id": "dialogflow.projects.agent.environments.users.sessions.contexts.patch",
  7914. // "parameterOrder": [
  7915. // "name"
  7916. // ],
  7917. // "parameters": {
  7918. // "name": {
  7919. // "description": "Required. The unique identifier of the context. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e/contexts/\u003cContext ID\u003e`,\nor\n`projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment ID\u003e/users/\u003cUser\nID\u003e/sessions/\u003cSession ID\u003e/contexts/\u003cContext ID\u003e`. Note: Environments and\nusers are under construction and will be available soon. The Context ID is\nalways converted to lowercase. If \u003cEnvironment ID\u003e is not specified, we\nassume default 'draft' environment. If \u003cUser ID\u003e is not specified, we\nassume default '-' user.",
  7920. // "location": "path",
  7921. // "pattern": "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/contexts/[^/]+$",
  7922. // "required": true,
  7923. // "type": "string"
  7924. // },
  7925. // "updateMask": {
  7926. // "description": "Optional. The mask to control which fields get updated.",
  7927. // "format": "google-fieldmask",
  7928. // "location": "query",
  7929. // "type": "string"
  7930. // }
  7931. // },
  7932. // "path": "v2beta1/{+name}",
  7933. // "request": {
  7934. // "$ref": "GoogleCloudDialogflowV2beta1Context"
  7935. // },
  7936. // "response": {
  7937. // "$ref": "GoogleCloudDialogflowV2beta1Context"
  7938. // },
  7939. // "scopes": [
  7940. // "https://www.googleapis.com/auth/cloud-platform"
  7941. // ]
  7942. // }
  7943. }
  7944. // method id "dialogflow.projects.agent.environments.users.sessions.entityTypes.create":
  7945. type ProjectsAgentEnvironmentsUsersSessionsEntityTypesCreateCall struct {
  7946. s *Service
  7947. parent string
  7948. googleclouddialogflowv2beta1sessionentitytype *GoogleCloudDialogflowV2beta1SessionEntityType
  7949. urlParams_ gensupport.URLParams
  7950. ctx_ context.Context
  7951. header_ http.Header
  7952. }
  7953. // Create: Creates a session entity type.
  7954. func (r *ProjectsAgentEnvironmentsUsersSessionsEntityTypesService) Create(parent string, googleclouddialogflowv2beta1sessionentitytype *GoogleCloudDialogflowV2beta1SessionEntityType) *ProjectsAgentEnvironmentsUsersSessionsEntityTypesCreateCall {
  7955. c := &ProjectsAgentEnvironmentsUsersSessionsEntityTypesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7956. c.parent = parent
  7957. c.googleclouddialogflowv2beta1sessionentitytype = googleclouddialogflowv2beta1sessionentitytype
  7958. return c
  7959. }
  7960. // Fields allows partial responses to be retrieved. See
  7961. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7962. // for more information.
  7963. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesCreateCall) Fields(s ...googleapi.Field) *ProjectsAgentEnvironmentsUsersSessionsEntityTypesCreateCall {
  7964. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7965. return c
  7966. }
  7967. // Context sets the context to be used in this call's Do method. Any
  7968. // pending HTTP request will be aborted if the provided context is
  7969. // canceled.
  7970. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesCreateCall) Context(ctx context.Context) *ProjectsAgentEnvironmentsUsersSessionsEntityTypesCreateCall {
  7971. c.ctx_ = ctx
  7972. return c
  7973. }
  7974. // Header returns an http.Header that can be modified by the caller to
  7975. // add HTTP headers to the request.
  7976. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesCreateCall) Header() http.Header {
  7977. if c.header_ == nil {
  7978. c.header_ = make(http.Header)
  7979. }
  7980. return c.header_
  7981. }
  7982. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesCreateCall) doRequest(alt string) (*http.Response, error) {
  7983. reqHeaders := make(http.Header)
  7984. for k, v := range c.header_ {
  7985. reqHeaders[k] = v
  7986. }
  7987. reqHeaders.Set("User-Agent", c.s.userAgent())
  7988. var body io.Reader = nil
  7989. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1sessionentitytype)
  7990. if err != nil {
  7991. return nil, err
  7992. }
  7993. reqHeaders.Set("Content-Type", "application/json")
  7994. c.urlParams_.Set("alt", alt)
  7995. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/entityTypes")
  7996. urls += "?" + c.urlParams_.Encode()
  7997. req, _ := http.NewRequest("POST", urls, body)
  7998. req.Header = reqHeaders
  7999. googleapi.Expand(req.URL, map[string]string{
  8000. "parent": c.parent,
  8001. })
  8002. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8003. }
  8004. // Do executes the "dialogflow.projects.agent.environments.users.sessions.entityTypes.create" call.
  8005. // Exactly one of *GoogleCloudDialogflowV2beta1SessionEntityType or
  8006. // error will be non-nil. Any non-2xx status code is an error. Response
  8007. // headers are in either
  8008. // *GoogleCloudDialogflowV2beta1SessionEntityType.ServerResponse.Header
  8009. // or (if a response was returned at all) in
  8010. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8011. // whether the returned error was because http.StatusNotModified was
  8012. // returned.
  8013. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1SessionEntityType, error) {
  8014. gensupport.SetOptions(c.urlParams_, opts...)
  8015. res, err := c.doRequest("json")
  8016. if res != nil && res.StatusCode == http.StatusNotModified {
  8017. if res.Body != nil {
  8018. res.Body.Close()
  8019. }
  8020. return nil, &googleapi.Error{
  8021. Code: res.StatusCode,
  8022. Header: res.Header,
  8023. }
  8024. }
  8025. if err != nil {
  8026. return nil, err
  8027. }
  8028. defer googleapi.CloseBody(res)
  8029. if err := googleapi.CheckResponse(res); err != nil {
  8030. return nil, err
  8031. }
  8032. ret := &GoogleCloudDialogflowV2beta1SessionEntityType{
  8033. ServerResponse: googleapi.ServerResponse{
  8034. Header: res.Header,
  8035. HTTPStatusCode: res.StatusCode,
  8036. },
  8037. }
  8038. target := &ret
  8039. if err := gensupport.DecodeResponse(target, res); err != nil {
  8040. return nil, err
  8041. }
  8042. return ret, nil
  8043. // {
  8044. // "description": "Creates a session entity type.",
  8045. // "flatPath": "v2beta1/projects/{projectsId}/agent/environments/{environmentsId}/users/{usersId}/sessions/{sessionsId}/entityTypes",
  8046. // "httpMethod": "POST",
  8047. // "id": "dialogflow.projects.agent.environments.users.sessions.entityTypes.create",
  8048. // "parameterOrder": [
  8049. // "parent"
  8050. // ],
  8051. // "parameters": {
  8052. // "parent": {
  8053. // "description": "Required. The session to create a session entity type for.\nFormat: `projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e` or\n`projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment ID\u003e/users/\u003cUser ID\u003e/\nsessions/\u003cSession ID\u003e`.\nNote: Environments and users are under construction and will be available\nsoon. If \u003cEnvironment ID\u003e is not specified, we assume default 'draft'\nenvironment. If \u003cUser ID\u003e is not specified, we assume default '-' user.",
  8054. // "location": "path",
  8055. // "pattern": "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+$",
  8056. // "required": true,
  8057. // "type": "string"
  8058. // }
  8059. // },
  8060. // "path": "v2beta1/{+parent}/entityTypes",
  8061. // "request": {
  8062. // "$ref": "GoogleCloudDialogflowV2beta1SessionEntityType"
  8063. // },
  8064. // "response": {
  8065. // "$ref": "GoogleCloudDialogflowV2beta1SessionEntityType"
  8066. // },
  8067. // "scopes": [
  8068. // "https://www.googleapis.com/auth/cloud-platform"
  8069. // ]
  8070. // }
  8071. }
  8072. // method id "dialogflow.projects.agent.environments.users.sessions.entityTypes.delete":
  8073. type ProjectsAgentEnvironmentsUsersSessionsEntityTypesDeleteCall struct {
  8074. s *Service
  8075. name string
  8076. urlParams_ gensupport.URLParams
  8077. ctx_ context.Context
  8078. header_ http.Header
  8079. }
  8080. // Delete: Deletes the specified session entity type.
  8081. func (r *ProjectsAgentEnvironmentsUsersSessionsEntityTypesService) Delete(name string) *ProjectsAgentEnvironmentsUsersSessionsEntityTypesDeleteCall {
  8082. c := &ProjectsAgentEnvironmentsUsersSessionsEntityTypesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8083. c.name = name
  8084. return c
  8085. }
  8086. // Fields allows partial responses to be retrieved. See
  8087. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8088. // for more information.
  8089. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesDeleteCall) Fields(s ...googleapi.Field) *ProjectsAgentEnvironmentsUsersSessionsEntityTypesDeleteCall {
  8090. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8091. return c
  8092. }
  8093. // Context sets the context to be used in this call's Do method. Any
  8094. // pending HTTP request will be aborted if the provided context is
  8095. // canceled.
  8096. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesDeleteCall) Context(ctx context.Context) *ProjectsAgentEnvironmentsUsersSessionsEntityTypesDeleteCall {
  8097. c.ctx_ = ctx
  8098. return c
  8099. }
  8100. // Header returns an http.Header that can be modified by the caller to
  8101. // add HTTP headers to the request.
  8102. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesDeleteCall) Header() http.Header {
  8103. if c.header_ == nil {
  8104. c.header_ = make(http.Header)
  8105. }
  8106. return c.header_
  8107. }
  8108. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesDeleteCall) doRequest(alt string) (*http.Response, error) {
  8109. reqHeaders := make(http.Header)
  8110. for k, v := range c.header_ {
  8111. reqHeaders[k] = v
  8112. }
  8113. reqHeaders.Set("User-Agent", c.s.userAgent())
  8114. var body io.Reader = nil
  8115. c.urlParams_.Set("alt", alt)
  8116. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  8117. urls += "?" + c.urlParams_.Encode()
  8118. req, _ := http.NewRequest("DELETE", urls, body)
  8119. req.Header = reqHeaders
  8120. googleapi.Expand(req.URL, map[string]string{
  8121. "name": c.name,
  8122. })
  8123. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8124. }
  8125. // Do executes the "dialogflow.projects.agent.environments.users.sessions.entityTypes.delete" call.
  8126. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  8127. // non-2xx status code is an error. Response headers are in either
  8128. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  8129. // returned at all) in error.(*googleapi.Error).Header. Use
  8130. // googleapi.IsNotModified to check whether the returned error was
  8131. // because http.StatusNotModified was returned.
  8132. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  8133. gensupport.SetOptions(c.urlParams_, opts...)
  8134. res, err := c.doRequest("json")
  8135. if res != nil && res.StatusCode == http.StatusNotModified {
  8136. if res.Body != nil {
  8137. res.Body.Close()
  8138. }
  8139. return nil, &googleapi.Error{
  8140. Code: res.StatusCode,
  8141. Header: res.Header,
  8142. }
  8143. }
  8144. if err != nil {
  8145. return nil, err
  8146. }
  8147. defer googleapi.CloseBody(res)
  8148. if err := googleapi.CheckResponse(res); err != nil {
  8149. return nil, err
  8150. }
  8151. ret := &GoogleProtobufEmpty{
  8152. ServerResponse: googleapi.ServerResponse{
  8153. Header: res.Header,
  8154. HTTPStatusCode: res.StatusCode,
  8155. },
  8156. }
  8157. target := &ret
  8158. if err := gensupport.DecodeResponse(target, res); err != nil {
  8159. return nil, err
  8160. }
  8161. return ret, nil
  8162. // {
  8163. // "description": "Deletes the specified session entity type.",
  8164. // "flatPath": "v2beta1/projects/{projectsId}/agent/environments/{environmentsId}/users/{usersId}/sessions/{sessionsId}/entityTypes/{entityTypesId}",
  8165. // "httpMethod": "DELETE",
  8166. // "id": "dialogflow.projects.agent.environments.users.sessions.entityTypes.delete",
  8167. // "parameterOrder": [
  8168. // "name"
  8169. // ],
  8170. // "parameters": {
  8171. // "name": {
  8172. // "description": "Required. The name of the entity type to delete. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e/entityTypes/\u003cEntity Type\nDisplay Name\u003e` or `projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment\nID\u003e/users/\u003cUser ID\u003e/sessions/\u003cSession ID\u003e/entityTypes/\u003cEntity Type Display\nName\u003e`.\nNote: Environments and users are under construction and will be available\nsoon. If \u003cEnvironment ID\u003e is not specified, we assume default 'draft'\nenvironment. If \u003cUser ID\u003e is not specified, we assume default '-' user.",
  8173. // "location": "path",
  8174. // "pattern": "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/entityTypes/[^/]+$",
  8175. // "required": true,
  8176. // "type": "string"
  8177. // }
  8178. // },
  8179. // "path": "v2beta1/{+name}",
  8180. // "response": {
  8181. // "$ref": "GoogleProtobufEmpty"
  8182. // },
  8183. // "scopes": [
  8184. // "https://www.googleapis.com/auth/cloud-platform"
  8185. // ]
  8186. // }
  8187. }
  8188. // method id "dialogflow.projects.agent.environments.users.sessions.entityTypes.get":
  8189. type ProjectsAgentEnvironmentsUsersSessionsEntityTypesGetCall struct {
  8190. s *Service
  8191. name string
  8192. urlParams_ gensupport.URLParams
  8193. ifNoneMatch_ string
  8194. ctx_ context.Context
  8195. header_ http.Header
  8196. }
  8197. // Get: Retrieves the specified session entity type.
  8198. func (r *ProjectsAgentEnvironmentsUsersSessionsEntityTypesService) Get(name string) *ProjectsAgentEnvironmentsUsersSessionsEntityTypesGetCall {
  8199. c := &ProjectsAgentEnvironmentsUsersSessionsEntityTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8200. c.name = name
  8201. return c
  8202. }
  8203. // Fields allows partial responses to be retrieved. See
  8204. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8205. // for more information.
  8206. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesGetCall) Fields(s ...googleapi.Field) *ProjectsAgentEnvironmentsUsersSessionsEntityTypesGetCall {
  8207. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8208. return c
  8209. }
  8210. // IfNoneMatch sets the optional parameter which makes the operation
  8211. // fail if the object's ETag matches the given value. This is useful for
  8212. // getting updates only after the object has changed since the last
  8213. // request. Use googleapi.IsNotModified to check whether the response
  8214. // error from Do is the result of In-None-Match.
  8215. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesGetCall) IfNoneMatch(entityTag string) *ProjectsAgentEnvironmentsUsersSessionsEntityTypesGetCall {
  8216. c.ifNoneMatch_ = entityTag
  8217. return c
  8218. }
  8219. // Context sets the context to be used in this call's Do method. Any
  8220. // pending HTTP request will be aborted if the provided context is
  8221. // canceled.
  8222. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesGetCall) Context(ctx context.Context) *ProjectsAgentEnvironmentsUsersSessionsEntityTypesGetCall {
  8223. c.ctx_ = ctx
  8224. return c
  8225. }
  8226. // Header returns an http.Header that can be modified by the caller to
  8227. // add HTTP headers to the request.
  8228. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesGetCall) Header() http.Header {
  8229. if c.header_ == nil {
  8230. c.header_ = make(http.Header)
  8231. }
  8232. return c.header_
  8233. }
  8234. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesGetCall) doRequest(alt string) (*http.Response, error) {
  8235. reqHeaders := make(http.Header)
  8236. for k, v := range c.header_ {
  8237. reqHeaders[k] = v
  8238. }
  8239. reqHeaders.Set("User-Agent", c.s.userAgent())
  8240. if c.ifNoneMatch_ != "" {
  8241. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8242. }
  8243. var body io.Reader = nil
  8244. c.urlParams_.Set("alt", alt)
  8245. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  8246. urls += "?" + c.urlParams_.Encode()
  8247. req, _ := http.NewRequest("GET", urls, body)
  8248. req.Header = reqHeaders
  8249. googleapi.Expand(req.URL, map[string]string{
  8250. "name": c.name,
  8251. })
  8252. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8253. }
  8254. // Do executes the "dialogflow.projects.agent.environments.users.sessions.entityTypes.get" call.
  8255. // Exactly one of *GoogleCloudDialogflowV2beta1SessionEntityType or
  8256. // error will be non-nil. Any non-2xx status code is an error. Response
  8257. // headers are in either
  8258. // *GoogleCloudDialogflowV2beta1SessionEntityType.ServerResponse.Header
  8259. // or (if a response was returned at all) in
  8260. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8261. // whether the returned error was because http.StatusNotModified was
  8262. // returned.
  8263. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1SessionEntityType, error) {
  8264. gensupport.SetOptions(c.urlParams_, opts...)
  8265. res, err := c.doRequest("json")
  8266. if res != nil && res.StatusCode == http.StatusNotModified {
  8267. if res.Body != nil {
  8268. res.Body.Close()
  8269. }
  8270. return nil, &googleapi.Error{
  8271. Code: res.StatusCode,
  8272. Header: res.Header,
  8273. }
  8274. }
  8275. if err != nil {
  8276. return nil, err
  8277. }
  8278. defer googleapi.CloseBody(res)
  8279. if err := googleapi.CheckResponse(res); err != nil {
  8280. return nil, err
  8281. }
  8282. ret := &GoogleCloudDialogflowV2beta1SessionEntityType{
  8283. ServerResponse: googleapi.ServerResponse{
  8284. Header: res.Header,
  8285. HTTPStatusCode: res.StatusCode,
  8286. },
  8287. }
  8288. target := &ret
  8289. if err := gensupport.DecodeResponse(target, res); err != nil {
  8290. return nil, err
  8291. }
  8292. return ret, nil
  8293. // {
  8294. // "description": "Retrieves the specified session entity type.",
  8295. // "flatPath": "v2beta1/projects/{projectsId}/agent/environments/{environmentsId}/users/{usersId}/sessions/{sessionsId}/entityTypes/{entityTypesId}",
  8296. // "httpMethod": "GET",
  8297. // "id": "dialogflow.projects.agent.environments.users.sessions.entityTypes.get",
  8298. // "parameterOrder": [
  8299. // "name"
  8300. // ],
  8301. // "parameters": {
  8302. // "name": {
  8303. // "description": "Required. The name of the session entity type. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e/entityTypes/\u003cEntity Type\nDisplay Name\u003e` or `projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment\nID\u003e/users/\u003cUser ID\u003e/sessions/\u003cSession ID\u003e/\nentityTypes/\u003cEntity Type Display Name\u003e`.\nNote: Environments and users re under construction and will be available\nsoon. If \u003cEnvironment ID\u003e is not specified, we assume default 'draft'\nenvironment. If \u003cUser ID\u003e is not specified, we assume default '-' user.",
  8304. // "location": "path",
  8305. // "pattern": "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/entityTypes/[^/]+$",
  8306. // "required": true,
  8307. // "type": "string"
  8308. // }
  8309. // },
  8310. // "path": "v2beta1/{+name}",
  8311. // "response": {
  8312. // "$ref": "GoogleCloudDialogflowV2beta1SessionEntityType"
  8313. // },
  8314. // "scopes": [
  8315. // "https://www.googleapis.com/auth/cloud-platform"
  8316. // ]
  8317. // }
  8318. }
  8319. // method id "dialogflow.projects.agent.environments.users.sessions.entityTypes.list":
  8320. type ProjectsAgentEnvironmentsUsersSessionsEntityTypesListCall struct {
  8321. s *Service
  8322. parent string
  8323. urlParams_ gensupport.URLParams
  8324. ifNoneMatch_ string
  8325. ctx_ context.Context
  8326. header_ http.Header
  8327. }
  8328. // List: Returns the list of all session entity types in the specified
  8329. // session.
  8330. func (r *ProjectsAgentEnvironmentsUsersSessionsEntityTypesService) List(parent string) *ProjectsAgentEnvironmentsUsersSessionsEntityTypesListCall {
  8331. c := &ProjectsAgentEnvironmentsUsersSessionsEntityTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8332. c.parent = parent
  8333. return c
  8334. }
  8335. // PageSize sets the optional parameter "pageSize": The maximum number
  8336. // of items to return in a single page. By
  8337. // default 100 and at most 1000.
  8338. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesListCall) PageSize(pageSize int64) *ProjectsAgentEnvironmentsUsersSessionsEntityTypesListCall {
  8339. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  8340. return c
  8341. }
  8342. // PageToken sets the optional parameter "pageToken": The
  8343. // next_page_token value returned from a previous list request.
  8344. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesListCall) PageToken(pageToken string) *ProjectsAgentEnvironmentsUsersSessionsEntityTypesListCall {
  8345. c.urlParams_.Set("pageToken", pageToken)
  8346. return c
  8347. }
  8348. // Fields allows partial responses to be retrieved. See
  8349. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8350. // for more information.
  8351. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesListCall) Fields(s ...googleapi.Field) *ProjectsAgentEnvironmentsUsersSessionsEntityTypesListCall {
  8352. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8353. return c
  8354. }
  8355. // IfNoneMatch sets the optional parameter which makes the operation
  8356. // fail if the object's ETag matches the given value. This is useful for
  8357. // getting updates only after the object has changed since the last
  8358. // request. Use googleapi.IsNotModified to check whether the response
  8359. // error from Do is the result of In-None-Match.
  8360. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesListCall) IfNoneMatch(entityTag string) *ProjectsAgentEnvironmentsUsersSessionsEntityTypesListCall {
  8361. c.ifNoneMatch_ = entityTag
  8362. return c
  8363. }
  8364. // Context sets the context to be used in this call's Do method. Any
  8365. // pending HTTP request will be aborted if the provided context is
  8366. // canceled.
  8367. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesListCall) Context(ctx context.Context) *ProjectsAgentEnvironmentsUsersSessionsEntityTypesListCall {
  8368. c.ctx_ = ctx
  8369. return c
  8370. }
  8371. // Header returns an http.Header that can be modified by the caller to
  8372. // add HTTP headers to the request.
  8373. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesListCall) Header() http.Header {
  8374. if c.header_ == nil {
  8375. c.header_ = make(http.Header)
  8376. }
  8377. return c.header_
  8378. }
  8379. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesListCall) doRequest(alt string) (*http.Response, error) {
  8380. reqHeaders := make(http.Header)
  8381. for k, v := range c.header_ {
  8382. reqHeaders[k] = v
  8383. }
  8384. reqHeaders.Set("User-Agent", c.s.userAgent())
  8385. if c.ifNoneMatch_ != "" {
  8386. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8387. }
  8388. var body io.Reader = nil
  8389. c.urlParams_.Set("alt", alt)
  8390. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/entityTypes")
  8391. urls += "?" + c.urlParams_.Encode()
  8392. req, _ := http.NewRequest("GET", urls, body)
  8393. req.Header = reqHeaders
  8394. googleapi.Expand(req.URL, map[string]string{
  8395. "parent": c.parent,
  8396. })
  8397. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8398. }
  8399. // Do executes the "dialogflow.projects.agent.environments.users.sessions.entityTypes.list" call.
  8400. // Exactly one of
  8401. // *GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse or error
  8402. // will be non-nil. Any non-2xx status code is an error. Response
  8403. // headers are in either
  8404. // *GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse.ServerResp
  8405. // onse.Header or (if a response was returned at all) in
  8406. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8407. // whether the returned error was because http.StatusNotModified was
  8408. // returned.
  8409. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse, error) {
  8410. gensupport.SetOptions(c.urlParams_, opts...)
  8411. res, err := c.doRequest("json")
  8412. if res != nil && res.StatusCode == http.StatusNotModified {
  8413. if res.Body != nil {
  8414. res.Body.Close()
  8415. }
  8416. return nil, &googleapi.Error{
  8417. Code: res.StatusCode,
  8418. Header: res.Header,
  8419. }
  8420. }
  8421. if err != nil {
  8422. return nil, err
  8423. }
  8424. defer googleapi.CloseBody(res)
  8425. if err := googleapi.CheckResponse(res); err != nil {
  8426. return nil, err
  8427. }
  8428. ret := &GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse{
  8429. ServerResponse: googleapi.ServerResponse{
  8430. Header: res.Header,
  8431. HTTPStatusCode: res.StatusCode,
  8432. },
  8433. }
  8434. target := &ret
  8435. if err := gensupport.DecodeResponse(target, res); err != nil {
  8436. return nil, err
  8437. }
  8438. return ret, nil
  8439. // {
  8440. // "description": "Returns the list of all session entity types in the specified session.",
  8441. // "flatPath": "v2beta1/projects/{projectsId}/agent/environments/{environmentsId}/users/{usersId}/sessions/{sessionsId}/entityTypes",
  8442. // "httpMethod": "GET",
  8443. // "id": "dialogflow.projects.agent.environments.users.sessions.entityTypes.list",
  8444. // "parameterOrder": [
  8445. // "parent"
  8446. // ],
  8447. // "parameters": {
  8448. // "pageSize": {
  8449. // "description": "Optional. The maximum number of items to return in a single page. By\ndefault 100 and at most 1000.",
  8450. // "format": "int32",
  8451. // "location": "query",
  8452. // "type": "integer"
  8453. // },
  8454. // "pageToken": {
  8455. // "description": "Optional. The next_page_token value returned from a previous list request.",
  8456. // "location": "query",
  8457. // "type": "string"
  8458. // },
  8459. // "parent": {
  8460. // "description": "Required. The session to list all session entity types from.\nFormat: `projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e` or\n`projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment ID\u003e/users/\u003cUser ID\u003e/\nsessions/\u003cSession ID\u003e`.\nNote: Environments and users are under construction and will be available\nsoon. If \u003cEnvironment ID\u003e is not specified, we assume default 'draft'\nenvironment. If \u003cUser ID\u003e is not specified, we assume default '-' user.",
  8461. // "location": "path",
  8462. // "pattern": "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+$",
  8463. // "required": true,
  8464. // "type": "string"
  8465. // }
  8466. // },
  8467. // "path": "v2beta1/{+parent}/entityTypes",
  8468. // "response": {
  8469. // "$ref": "GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse"
  8470. // },
  8471. // "scopes": [
  8472. // "https://www.googleapis.com/auth/cloud-platform"
  8473. // ]
  8474. // }
  8475. }
  8476. // Pages invokes f for each page of results.
  8477. // A non-nil error returned from f will halt the iteration.
  8478. // The provided context supersedes any context provided to the Context method.
  8479. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesListCall) Pages(ctx context.Context, f func(*GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse) error) error {
  8480. c.ctx_ = ctx
  8481. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  8482. for {
  8483. x, err := c.Do()
  8484. if err != nil {
  8485. return err
  8486. }
  8487. if err := f(x); err != nil {
  8488. return err
  8489. }
  8490. if x.NextPageToken == "" {
  8491. return nil
  8492. }
  8493. c.PageToken(x.NextPageToken)
  8494. }
  8495. }
  8496. // method id "dialogflow.projects.agent.environments.users.sessions.entityTypes.patch":
  8497. type ProjectsAgentEnvironmentsUsersSessionsEntityTypesPatchCall struct {
  8498. s *Service
  8499. nameid string
  8500. googleclouddialogflowv2beta1sessionentitytype *GoogleCloudDialogflowV2beta1SessionEntityType
  8501. urlParams_ gensupport.URLParams
  8502. ctx_ context.Context
  8503. header_ http.Header
  8504. }
  8505. // Patch: Updates the specified session entity type.
  8506. func (r *ProjectsAgentEnvironmentsUsersSessionsEntityTypesService) Patch(nameid string, googleclouddialogflowv2beta1sessionentitytype *GoogleCloudDialogflowV2beta1SessionEntityType) *ProjectsAgentEnvironmentsUsersSessionsEntityTypesPatchCall {
  8507. c := &ProjectsAgentEnvironmentsUsersSessionsEntityTypesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8508. c.nameid = nameid
  8509. c.googleclouddialogflowv2beta1sessionentitytype = googleclouddialogflowv2beta1sessionentitytype
  8510. return c
  8511. }
  8512. // UpdateMask sets the optional parameter "updateMask": The mask to
  8513. // control which fields get updated.
  8514. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesPatchCall) UpdateMask(updateMask string) *ProjectsAgentEnvironmentsUsersSessionsEntityTypesPatchCall {
  8515. c.urlParams_.Set("updateMask", updateMask)
  8516. return c
  8517. }
  8518. // Fields allows partial responses to be retrieved. See
  8519. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8520. // for more information.
  8521. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesPatchCall) Fields(s ...googleapi.Field) *ProjectsAgentEnvironmentsUsersSessionsEntityTypesPatchCall {
  8522. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8523. return c
  8524. }
  8525. // Context sets the context to be used in this call's Do method. Any
  8526. // pending HTTP request will be aborted if the provided context is
  8527. // canceled.
  8528. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesPatchCall) Context(ctx context.Context) *ProjectsAgentEnvironmentsUsersSessionsEntityTypesPatchCall {
  8529. c.ctx_ = ctx
  8530. return c
  8531. }
  8532. // Header returns an http.Header that can be modified by the caller to
  8533. // add HTTP headers to the request.
  8534. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesPatchCall) Header() http.Header {
  8535. if c.header_ == nil {
  8536. c.header_ = make(http.Header)
  8537. }
  8538. return c.header_
  8539. }
  8540. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesPatchCall) doRequest(alt string) (*http.Response, error) {
  8541. reqHeaders := make(http.Header)
  8542. for k, v := range c.header_ {
  8543. reqHeaders[k] = v
  8544. }
  8545. reqHeaders.Set("User-Agent", c.s.userAgent())
  8546. var body io.Reader = nil
  8547. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1sessionentitytype)
  8548. if err != nil {
  8549. return nil, err
  8550. }
  8551. reqHeaders.Set("Content-Type", "application/json")
  8552. c.urlParams_.Set("alt", alt)
  8553. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  8554. urls += "?" + c.urlParams_.Encode()
  8555. req, _ := http.NewRequest("PATCH", urls, body)
  8556. req.Header = reqHeaders
  8557. googleapi.Expand(req.URL, map[string]string{
  8558. "name": c.nameid,
  8559. })
  8560. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8561. }
  8562. // Do executes the "dialogflow.projects.agent.environments.users.sessions.entityTypes.patch" call.
  8563. // Exactly one of *GoogleCloudDialogflowV2beta1SessionEntityType or
  8564. // error will be non-nil. Any non-2xx status code is an error. Response
  8565. // headers are in either
  8566. // *GoogleCloudDialogflowV2beta1SessionEntityType.ServerResponse.Header
  8567. // or (if a response was returned at all) in
  8568. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8569. // whether the returned error was because http.StatusNotModified was
  8570. // returned.
  8571. func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1SessionEntityType, error) {
  8572. gensupport.SetOptions(c.urlParams_, opts...)
  8573. res, err := c.doRequest("json")
  8574. if res != nil && res.StatusCode == http.StatusNotModified {
  8575. if res.Body != nil {
  8576. res.Body.Close()
  8577. }
  8578. return nil, &googleapi.Error{
  8579. Code: res.StatusCode,
  8580. Header: res.Header,
  8581. }
  8582. }
  8583. if err != nil {
  8584. return nil, err
  8585. }
  8586. defer googleapi.CloseBody(res)
  8587. if err := googleapi.CheckResponse(res); err != nil {
  8588. return nil, err
  8589. }
  8590. ret := &GoogleCloudDialogflowV2beta1SessionEntityType{
  8591. ServerResponse: googleapi.ServerResponse{
  8592. Header: res.Header,
  8593. HTTPStatusCode: res.StatusCode,
  8594. },
  8595. }
  8596. target := &ret
  8597. if err := gensupport.DecodeResponse(target, res); err != nil {
  8598. return nil, err
  8599. }
  8600. return ret, nil
  8601. // {
  8602. // "description": "Updates the specified session entity type.",
  8603. // "flatPath": "v2beta1/projects/{projectsId}/agent/environments/{environmentsId}/users/{usersId}/sessions/{sessionsId}/entityTypes/{entityTypesId}",
  8604. // "httpMethod": "PATCH",
  8605. // "id": "dialogflow.projects.agent.environments.users.sessions.entityTypes.patch",
  8606. // "parameterOrder": [
  8607. // "name"
  8608. // ],
  8609. // "parameters": {
  8610. // "name": {
  8611. // "description": "Required. The unique identifier of this session entity type. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e/entityTypes/\u003cEntity Type\nDisplay Name\u003e`, or\n`projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment ID\u003e/users/\u003cUser\nID\u003e/sessions\n/\u003cSession ID\u003e/entityTypes/\u003cEntity Type Display Name\u003e`.\nNote: Environments and users are under construction and will be available\nsoon. If \u003cEnvironment ID\u003e is not specified, we assume default 'draft'\nenvironment. If \u003cUser ID\u003e is not specified, we assume default '-' user.",
  8612. // "location": "path",
  8613. // "pattern": "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/entityTypes/[^/]+$",
  8614. // "required": true,
  8615. // "type": "string"
  8616. // },
  8617. // "updateMask": {
  8618. // "description": "Optional. The mask to control which fields get updated.",
  8619. // "format": "google-fieldmask",
  8620. // "location": "query",
  8621. // "type": "string"
  8622. // }
  8623. // },
  8624. // "path": "v2beta1/{+name}",
  8625. // "request": {
  8626. // "$ref": "GoogleCloudDialogflowV2beta1SessionEntityType"
  8627. // },
  8628. // "response": {
  8629. // "$ref": "GoogleCloudDialogflowV2beta1SessionEntityType"
  8630. // },
  8631. // "scopes": [
  8632. // "https://www.googleapis.com/auth/cloud-platform"
  8633. // ]
  8634. // }
  8635. }
  8636. // method id "dialogflow.projects.agent.intents.batchDelete":
  8637. type ProjectsAgentIntentsBatchDeleteCall struct {
  8638. s *Service
  8639. parent string
  8640. googleclouddialogflowv2beta1batchdeleteintentsrequest *GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest
  8641. urlParams_ gensupport.URLParams
  8642. ctx_ context.Context
  8643. header_ http.Header
  8644. }
  8645. // BatchDelete: Deletes intents in the specified agent.
  8646. //
  8647. // Operation <response: google.protobuf.Empty>
  8648. func (r *ProjectsAgentIntentsService) BatchDelete(parent string, googleclouddialogflowv2beta1batchdeleteintentsrequest *GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest) *ProjectsAgentIntentsBatchDeleteCall {
  8649. c := &ProjectsAgentIntentsBatchDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8650. c.parent = parent
  8651. c.googleclouddialogflowv2beta1batchdeleteintentsrequest = googleclouddialogflowv2beta1batchdeleteintentsrequest
  8652. return c
  8653. }
  8654. // Fields allows partial responses to be retrieved. See
  8655. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8656. // for more information.
  8657. func (c *ProjectsAgentIntentsBatchDeleteCall) Fields(s ...googleapi.Field) *ProjectsAgentIntentsBatchDeleteCall {
  8658. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8659. return c
  8660. }
  8661. // Context sets the context to be used in this call's Do method. Any
  8662. // pending HTTP request will be aborted if the provided context is
  8663. // canceled.
  8664. func (c *ProjectsAgentIntentsBatchDeleteCall) Context(ctx context.Context) *ProjectsAgentIntentsBatchDeleteCall {
  8665. c.ctx_ = ctx
  8666. return c
  8667. }
  8668. // Header returns an http.Header that can be modified by the caller to
  8669. // add HTTP headers to the request.
  8670. func (c *ProjectsAgentIntentsBatchDeleteCall) Header() http.Header {
  8671. if c.header_ == nil {
  8672. c.header_ = make(http.Header)
  8673. }
  8674. return c.header_
  8675. }
  8676. func (c *ProjectsAgentIntentsBatchDeleteCall) doRequest(alt string) (*http.Response, error) {
  8677. reqHeaders := make(http.Header)
  8678. for k, v := range c.header_ {
  8679. reqHeaders[k] = v
  8680. }
  8681. reqHeaders.Set("User-Agent", c.s.userAgent())
  8682. var body io.Reader = nil
  8683. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1batchdeleteintentsrequest)
  8684. if err != nil {
  8685. return nil, err
  8686. }
  8687. reqHeaders.Set("Content-Type", "application/json")
  8688. c.urlParams_.Set("alt", alt)
  8689. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/intents:batchDelete")
  8690. urls += "?" + c.urlParams_.Encode()
  8691. req, _ := http.NewRequest("POST", urls, body)
  8692. req.Header = reqHeaders
  8693. googleapi.Expand(req.URL, map[string]string{
  8694. "parent": c.parent,
  8695. })
  8696. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8697. }
  8698. // Do executes the "dialogflow.projects.agent.intents.batchDelete" call.
  8699. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  8700. // Any non-2xx status code is an error. Response headers are in either
  8701. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  8702. // was returned at all) in error.(*googleapi.Error).Header. Use
  8703. // googleapi.IsNotModified to check whether the returned error was
  8704. // because http.StatusNotModified was returned.
  8705. func (c *ProjectsAgentIntentsBatchDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  8706. gensupport.SetOptions(c.urlParams_, opts...)
  8707. res, err := c.doRequest("json")
  8708. if res != nil && res.StatusCode == http.StatusNotModified {
  8709. if res.Body != nil {
  8710. res.Body.Close()
  8711. }
  8712. return nil, &googleapi.Error{
  8713. Code: res.StatusCode,
  8714. Header: res.Header,
  8715. }
  8716. }
  8717. if err != nil {
  8718. return nil, err
  8719. }
  8720. defer googleapi.CloseBody(res)
  8721. if err := googleapi.CheckResponse(res); err != nil {
  8722. return nil, err
  8723. }
  8724. ret := &GoogleLongrunningOperation{
  8725. ServerResponse: googleapi.ServerResponse{
  8726. Header: res.Header,
  8727. HTTPStatusCode: res.StatusCode,
  8728. },
  8729. }
  8730. target := &ret
  8731. if err := gensupport.DecodeResponse(target, res); err != nil {
  8732. return nil, err
  8733. }
  8734. return ret, nil
  8735. // {
  8736. // "description": "Deletes intents in the specified agent.\n\nOperation \u003cresponse: google.protobuf.Empty\u003e",
  8737. // "flatPath": "v2beta1/projects/{projectsId}/agent/intents:batchDelete",
  8738. // "httpMethod": "POST",
  8739. // "id": "dialogflow.projects.agent.intents.batchDelete",
  8740. // "parameterOrder": [
  8741. // "parent"
  8742. // ],
  8743. // "parameters": {
  8744. // "parent": {
  8745. // "description": "Required. The name of the agent to delete all entities types for. Format:\n`projects/\u003cProject ID\u003e/agent`.",
  8746. // "location": "path",
  8747. // "pattern": "^projects/[^/]+/agent$",
  8748. // "required": true,
  8749. // "type": "string"
  8750. // }
  8751. // },
  8752. // "path": "v2beta1/{+parent}/intents:batchDelete",
  8753. // "request": {
  8754. // "$ref": "GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest"
  8755. // },
  8756. // "response": {
  8757. // "$ref": "GoogleLongrunningOperation"
  8758. // },
  8759. // "scopes": [
  8760. // "https://www.googleapis.com/auth/cloud-platform"
  8761. // ]
  8762. // }
  8763. }
  8764. // method id "dialogflow.projects.agent.intents.batchUpdate":
  8765. type ProjectsAgentIntentsBatchUpdateCall struct {
  8766. s *Service
  8767. parent string
  8768. googleclouddialogflowv2beta1batchupdateintentsrequest *GoogleCloudDialogflowV2beta1BatchUpdateIntentsRequest
  8769. urlParams_ gensupport.URLParams
  8770. ctx_ context.Context
  8771. header_ http.Header
  8772. }
  8773. // BatchUpdate: Updates/Creates multiple intents in the specified
  8774. // agent.
  8775. //
  8776. // Operation <response: BatchUpdateIntentsResponse>
  8777. func (r *ProjectsAgentIntentsService) BatchUpdate(parent string, googleclouddialogflowv2beta1batchupdateintentsrequest *GoogleCloudDialogflowV2beta1BatchUpdateIntentsRequest) *ProjectsAgentIntentsBatchUpdateCall {
  8778. c := &ProjectsAgentIntentsBatchUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8779. c.parent = parent
  8780. c.googleclouddialogflowv2beta1batchupdateintentsrequest = googleclouddialogflowv2beta1batchupdateintentsrequest
  8781. return c
  8782. }
  8783. // Fields allows partial responses to be retrieved. See
  8784. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8785. // for more information.
  8786. func (c *ProjectsAgentIntentsBatchUpdateCall) Fields(s ...googleapi.Field) *ProjectsAgentIntentsBatchUpdateCall {
  8787. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8788. return c
  8789. }
  8790. // Context sets the context to be used in this call's Do method. Any
  8791. // pending HTTP request will be aborted if the provided context is
  8792. // canceled.
  8793. func (c *ProjectsAgentIntentsBatchUpdateCall) Context(ctx context.Context) *ProjectsAgentIntentsBatchUpdateCall {
  8794. c.ctx_ = ctx
  8795. return c
  8796. }
  8797. // Header returns an http.Header that can be modified by the caller to
  8798. // add HTTP headers to the request.
  8799. func (c *ProjectsAgentIntentsBatchUpdateCall) Header() http.Header {
  8800. if c.header_ == nil {
  8801. c.header_ = make(http.Header)
  8802. }
  8803. return c.header_
  8804. }
  8805. func (c *ProjectsAgentIntentsBatchUpdateCall) doRequest(alt string) (*http.Response, error) {
  8806. reqHeaders := make(http.Header)
  8807. for k, v := range c.header_ {
  8808. reqHeaders[k] = v
  8809. }
  8810. reqHeaders.Set("User-Agent", c.s.userAgent())
  8811. var body io.Reader = nil
  8812. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1batchupdateintentsrequest)
  8813. if err != nil {
  8814. return nil, err
  8815. }
  8816. reqHeaders.Set("Content-Type", "application/json")
  8817. c.urlParams_.Set("alt", alt)
  8818. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/intents:batchUpdate")
  8819. urls += "?" + c.urlParams_.Encode()
  8820. req, _ := http.NewRequest("POST", urls, body)
  8821. req.Header = reqHeaders
  8822. googleapi.Expand(req.URL, map[string]string{
  8823. "parent": c.parent,
  8824. })
  8825. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8826. }
  8827. // Do executes the "dialogflow.projects.agent.intents.batchUpdate" call.
  8828. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  8829. // Any non-2xx status code is an error. Response headers are in either
  8830. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  8831. // was returned at all) in error.(*googleapi.Error).Header. Use
  8832. // googleapi.IsNotModified to check whether the returned error was
  8833. // because http.StatusNotModified was returned.
  8834. func (c *ProjectsAgentIntentsBatchUpdateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  8835. gensupport.SetOptions(c.urlParams_, opts...)
  8836. res, err := c.doRequest("json")
  8837. if res != nil && res.StatusCode == http.StatusNotModified {
  8838. if res.Body != nil {
  8839. res.Body.Close()
  8840. }
  8841. return nil, &googleapi.Error{
  8842. Code: res.StatusCode,
  8843. Header: res.Header,
  8844. }
  8845. }
  8846. if err != nil {
  8847. return nil, err
  8848. }
  8849. defer googleapi.CloseBody(res)
  8850. if err := googleapi.CheckResponse(res); err != nil {
  8851. return nil, err
  8852. }
  8853. ret := &GoogleLongrunningOperation{
  8854. ServerResponse: googleapi.ServerResponse{
  8855. Header: res.Header,
  8856. HTTPStatusCode: res.StatusCode,
  8857. },
  8858. }
  8859. target := &ret
  8860. if err := gensupport.DecodeResponse(target, res); err != nil {
  8861. return nil, err
  8862. }
  8863. return ret, nil
  8864. // {
  8865. // "description": "Updates/Creates multiple intents in the specified agent.\n\nOperation \u003cresponse: BatchUpdateIntentsResponse\u003e",
  8866. // "flatPath": "v2beta1/projects/{projectsId}/agent/intents:batchUpdate",
  8867. // "httpMethod": "POST",
  8868. // "id": "dialogflow.projects.agent.intents.batchUpdate",
  8869. // "parameterOrder": [
  8870. // "parent"
  8871. // ],
  8872. // "parameters": {
  8873. // "parent": {
  8874. // "description": "Required. The name of the agent to update or create intents in.\nFormat: `projects/\u003cProject ID\u003e/agent`.",
  8875. // "location": "path",
  8876. // "pattern": "^projects/[^/]+/agent$",
  8877. // "required": true,
  8878. // "type": "string"
  8879. // }
  8880. // },
  8881. // "path": "v2beta1/{+parent}/intents:batchUpdate",
  8882. // "request": {
  8883. // "$ref": "GoogleCloudDialogflowV2beta1BatchUpdateIntentsRequest"
  8884. // },
  8885. // "response": {
  8886. // "$ref": "GoogleLongrunningOperation"
  8887. // },
  8888. // "scopes": [
  8889. // "https://www.googleapis.com/auth/cloud-platform"
  8890. // ]
  8891. // }
  8892. }
  8893. // method id "dialogflow.projects.agent.intents.create":
  8894. type ProjectsAgentIntentsCreateCall struct {
  8895. s *Service
  8896. parent string
  8897. googleclouddialogflowv2beta1intent *GoogleCloudDialogflowV2beta1Intent
  8898. urlParams_ gensupport.URLParams
  8899. ctx_ context.Context
  8900. header_ http.Header
  8901. }
  8902. // Create: Creates an intent in the specified agent.
  8903. func (r *ProjectsAgentIntentsService) Create(parent string, googleclouddialogflowv2beta1intent *GoogleCloudDialogflowV2beta1Intent) *ProjectsAgentIntentsCreateCall {
  8904. c := &ProjectsAgentIntentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8905. c.parent = parent
  8906. c.googleclouddialogflowv2beta1intent = googleclouddialogflowv2beta1intent
  8907. return c
  8908. }
  8909. // IntentView sets the optional parameter "intentView": The resource
  8910. // view to apply to the returned intent.
  8911. //
  8912. // Possible values:
  8913. // "INTENT_VIEW_UNSPECIFIED"
  8914. // "INTENT_VIEW_FULL"
  8915. func (c *ProjectsAgentIntentsCreateCall) IntentView(intentView string) *ProjectsAgentIntentsCreateCall {
  8916. c.urlParams_.Set("intentView", intentView)
  8917. return c
  8918. }
  8919. // LanguageCode sets the optional parameter "languageCode": The language
  8920. // of training phrases, parameters and rich messages
  8921. // defined in `intent`. If not specified, the agent's default language
  8922. // is
  8923. // used. [More than a
  8924. // dozen
  8925. // languages](https://dialogflow.com/docs/reference/language) are
  8926. // supported.
  8927. // Note: languages must be enabled in the agent, before they can be
  8928. // used.
  8929. func (c *ProjectsAgentIntentsCreateCall) LanguageCode(languageCode string) *ProjectsAgentIntentsCreateCall {
  8930. c.urlParams_.Set("languageCode", languageCode)
  8931. return c
  8932. }
  8933. // Fields allows partial responses to be retrieved. See
  8934. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8935. // for more information.
  8936. func (c *ProjectsAgentIntentsCreateCall) Fields(s ...googleapi.Field) *ProjectsAgentIntentsCreateCall {
  8937. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8938. return c
  8939. }
  8940. // Context sets the context to be used in this call's Do method. Any
  8941. // pending HTTP request will be aborted if the provided context is
  8942. // canceled.
  8943. func (c *ProjectsAgentIntentsCreateCall) Context(ctx context.Context) *ProjectsAgentIntentsCreateCall {
  8944. c.ctx_ = ctx
  8945. return c
  8946. }
  8947. // Header returns an http.Header that can be modified by the caller to
  8948. // add HTTP headers to the request.
  8949. func (c *ProjectsAgentIntentsCreateCall) Header() http.Header {
  8950. if c.header_ == nil {
  8951. c.header_ = make(http.Header)
  8952. }
  8953. return c.header_
  8954. }
  8955. func (c *ProjectsAgentIntentsCreateCall) doRequest(alt string) (*http.Response, error) {
  8956. reqHeaders := make(http.Header)
  8957. for k, v := range c.header_ {
  8958. reqHeaders[k] = v
  8959. }
  8960. reqHeaders.Set("User-Agent", c.s.userAgent())
  8961. var body io.Reader = nil
  8962. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1intent)
  8963. if err != nil {
  8964. return nil, err
  8965. }
  8966. reqHeaders.Set("Content-Type", "application/json")
  8967. c.urlParams_.Set("alt", alt)
  8968. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/intents")
  8969. urls += "?" + c.urlParams_.Encode()
  8970. req, _ := http.NewRequest("POST", urls, body)
  8971. req.Header = reqHeaders
  8972. googleapi.Expand(req.URL, map[string]string{
  8973. "parent": c.parent,
  8974. })
  8975. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8976. }
  8977. // Do executes the "dialogflow.projects.agent.intents.create" call.
  8978. // Exactly one of *GoogleCloudDialogflowV2beta1Intent or error will be
  8979. // non-nil. Any non-2xx status code is an error. Response headers are in
  8980. // either *GoogleCloudDialogflowV2beta1Intent.ServerResponse.Header or
  8981. // (if a response was returned at all) in
  8982. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8983. // whether the returned error was because http.StatusNotModified was
  8984. // returned.
  8985. func (c *ProjectsAgentIntentsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1Intent, error) {
  8986. gensupport.SetOptions(c.urlParams_, opts...)
  8987. res, err := c.doRequest("json")
  8988. if res != nil && res.StatusCode == http.StatusNotModified {
  8989. if res.Body != nil {
  8990. res.Body.Close()
  8991. }
  8992. return nil, &googleapi.Error{
  8993. Code: res.StatusCode,
  8994. Header: res.Header,
  8995. }
  8996. }
  8997. if err != nil {
  8998. return nil, err
  8999. }
  9000. defer googleapi.CloseBody(res)
  9001. if err := googleapi.CheckResponse(res); err != nil {
  9002. return nil, err
  9003. }
  9004. ret := &GoogleCloudDialogflowV2beta1Intent{
  9005. ServerResponse: googleapi.ServerResponse{
  9006. Header: res.Header,
  9007. HTTPStatusCode: res.StatusCode,
  9008. },
  9009. }
  9010. target := &ret
  9011. if err := gensupport.DecodeResponse(target, res); err != nil {
  9012. return nil, err
  9013. }
  9014. return ret, nil
  9015. // {
  9016. // "description": "Creates an intent in the specified agent.",
  9017. // "flatPath": "v2beta1/projects/{projectsId}/agent/intents",
  9018. // "httpMethod": "POST",
  9019. // "id": "dialogflow.projects.agent.intents.create",
  9020. // "parameterOrder": [
  9021. // "parent"
  9022. // ],
  9023. // "parameters": {
  9024. // "intentView": {
  9025. // "description": "Optional. The resource view to apply to the returned intent.",
  9026. // "enum": [
  9027. // "INTENT_VIEW_UNSPECIFIED",
  9028. // "INTENT_VIEW_FULL"
  9029. // ],
  9030. // "location": "query",
  9031. // "type": "string"
  9032. // },
  9033. // "languageCode": {
  9034. // "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.",
  9035. // "location": "query",
  9036. // "type": "string"
  9037. // },
  9038. // "parent": {
  9039. // "description": "Required. The agent to create a intent for.\nFormat: `projects/\u003cProject ID\u003e/agent`.",
  9040. // "location": "path",
  9041. // "pattern": "^projects/[^/]+/agent$",
  9042. // "required": true,
  9043. // "type": "string"
  9044. // }
  9045. // },
  9046. // "path": "v2beta1/{+parent}/intents",
  9047. // "request": {
  9048. // "$ref": "GoogleCloudDialogflowV2beta1Intent"
  9049. // },
  9050. // "response": {
  9051. // "$ref": "GoogleCloudDialogflowV2beta1Intent"
  9052. // },
  9053. // "scopes": [
  9054. // "https://www.googleapis.com/auth/cloud-platform"
  9055. // ]
  9056. // }
  9057. }
  9058. // method id "dialogflow.projects.agent.intents.delete":
  9059. type ProjectsAgentIntentsDeleteCall struct {
  9060. s *Service
  9061. name string
  9062. urlParams_ gensupport.URLParams
  9063. ctx_ context.Context
  9064. header_ http.Header
  9065. }
  9066. // Delete: Deletes the specified intent.
  9067. func (r *ProjectsAgentIntentsService) Delete(name string) *ProjectsAgentIntentsDeleteCall {
  9068. c := &ProjectsAgentIntentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9069. c.name = name
  9070. return c
  9071. }
  9072. // Fields allows partial responses to be retrieved. See
  9073. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9074. // for more information.
  9075. func (c *ProjectsAgentIntentsDeleteCall) Fields(s ...googleapi.Field) *ProjectsAgentIntentsDeleteCall {
  9076. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9077. return c
  9078. }
  9079. // Context sets the context to be used in this call's Do method. Any
  9080. // pending HTTP request will be aborted if the provided context is
  9081. // canceled.
  9082. func (c *ProjectsAgentIntentsDeleteCall) Context(ctx context.Context) *ProjectsAgentIntentsDeleteCall {
  9083. c.ctx_ = ctx
  9084. return c
  9085. }
  9086. // Header returns an http.Header that can be modified by the caller to
  9087. // add HTTP headers to the request.
  9088. func (c *ProjectsAgentIntentsDeleteCall) Header() http.Header {
  9089. if c.header_ == nil {
  9090. c.header_ = make(http.Header)
  9091. }
  9092. return c.header_
  9093. }
  9094. func (c *ProjectsAgentIntentsDeleteCall) doRequest(alt string) (*http.Response, error) {
  9095. reqHeaders := make(http.Header)
  9096. for k, v := range c.header_ {
  9097. reqHeaders[k] = v
  9098. }
  9099. reqHeaders.Set("User-Agent", c.s.userAgent())
  9100. var body io.Reader = nil
  9101. c.urlParams_.Set("alt", alt)
  9102. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  9103. urls += "?" + c.urlParams_.Encode()
  9104. req, _ := http.NewRequest("DELETE", urls, body)
  9105. req.Header = reqHeaders
  9106. googleapi.Expand(req.URL, map[string]string{
  9107. "name": c.name,
  9108. })
  9109. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9110. }
  9111. // Do executes the "dialogflow.projects.agent.intents.delete" call.
  9112. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  9113. // non-2xx status code is an error. Response headers are in either
  9114. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  9115. // returned at all) in error.(*googleapi.Error).Header. Use
  9116. // googleapi.IsNotModified to check whether the returned error was
  9117. // because http.StatusNotModified was returned.
  9118. func (c *ProjectsAgentIntentsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  9119. gensupport.SetOptions(c.urlParams_, opts...)
  9120. res, err := c.doRequest("json")
  9121. if res != nil && res.StatusCode == http.StatusNotModified {
  9122. if res.Body != nil {
  9123. res.Body.Close()
  9124. }
  9125. return nil, &googleapi.Error{
  9126. Code: res.StatusCode,
  9127. Header: res.Header,
  9128. }
  9129. }
  9130. if err != nil {
  9131. return nil, err
  9132. }
  9133. defer googleapi.CloseBody(res)
  9134. if err := googleapi.CheckResponse(res); err != nil {
  9135. return nil, err
  9136. }
  9137. ret := &GoogleProtobufEmpty{
  9138. ServerResponse: googleapi.ServerResponse{
  9139. Header: res.Header,
  9140. HTTPStatusCode: res.StatusCode,
  9141. },
  9142. }
  9143. target := &ret
  9144. if err := gensupport.DecodeResponse(target, res); err != nil {
  9145. return nil, err
  9146. }
  9147. return ret, nil
  9148. // {
  9149. // "description": "Deletes the specified intent.",
  9150. // "flatPath": "v2beta1/projects/{projectsId}/agent/intents/{intentsId}",
  9151. // "httpMethod": "DELETE",
  9152. // "id": "dialogflow.projects.agent.intents.delete",
  9153. // "parameterOrder": [
  9154. // "name"
  9155. // ],
  9156. // "parameters": {
  9157. // "name": {
  9158. // "description": "Required. The name of the intent to delete.\nFormat: `projects/\u003cProject ID\u003e/agent/intents/\u003cIntent ID\u003e`.",
  9159. // "location": "path",
  9160. // "pattern": "^projects/[^/]+/agent/intents/[^/]+$",
  9161. // "required": true,
  9162. // "type": "string"
  9163. // }
  9164. // },
  9165. // "path": "v2beta1/{+name}",
  9166. // "response": {
  9167. // "$ref": "GoogleProtobufEmpty"
  9168. // },
  9169. // "scopes": [
  9170. // "https://www.googleapis.com/auth/cloud-platform"
  9171. // ]
  9172. // }
  9173. }
  9174. // method id "dialogflow.projects.agent.intents.get":
  9175. type ProjectsAgentIntentsGetCall struct {
  9176. s *Service
  9177. name string
  9178. urlParams_ gensupport.URLParams
  9179. ifNoneMatch_ string
  9180. ctx_ context.Context
  9181. header_ http.Header
  9182. }
  9183. // Get: Retrieves the specified intent.
  9184. func (r *ProjectsAgentIntentsService) Get(name string) *ProjectsAgentIntentsGetCall {
  9185. c := &ProjectsAgentIntentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9186. c.name = name
  9187. return c
  9188. }
  9189. // IntentView sets the optional parameter "intentView": The resource
  9190. // view to apply to the returned intent.
  9191. //
  9192. // Possible values:
  9193. // "INTENT_VIEW_UNSPECIFIED"
  9194. // "INTENT_VIEW_FULL"
  9195. func (c *ProjectsAgentIntentsGetCall) IntentView(intentView string) *ProjectsAgentIntentsGetCall {
  9196. c.urlParams_.Set("intentView", intentView)
  9197. return c
  9198. }
  9199. // LanguageCode sets the optional parameter "languageCode": The language
  9200. // to retrieve training phrases, parameters and rich
  9201. // messages for. If not specified, the agent's default language is
  9202. // used.
  9203. // [More than a
  9204. // dozen
  9205. // languages](https://dialogflow.com/docs/reference/language) are
  9206. // supported.
  9207. // Note: languages must be enabled in the agent, before they can be
  9208. // used.
  9209. func (c *ProjectsAgentIntentsGetCall) LanguageCode(languageCode string) *ProjectsAgentIntentsGetCall {
  9210. c.urlParams_.Set("languageCode", languageCode)
  9211. return c
  9212. }
  9213. // Fields allows partial responses to be retrieved. See
  9214. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9215. // for more information.
  9216. func (c *ProjectsAgentIntentsGetCall) Fields(s ...googleapi.Field) *ProjectsAgentIntentsGetCall {
  9217. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9218. return c
  9219. }
  9220. // IfNoneMatch sets the optional parameter which makes the operation
  9221. // fail if the object's ETag matches the given value. This is useful for
  9222. // getting updates only after the object has changed since the last
  9223. // request. Use googleapi.IsNotModified to check whether the response
  9224. // error from Do is the result of In-None-Match.
  9225. func (c *ProjectsAgentIntentsGetCall) IfNoneMatch(entityTag string) *ProjectsAgentIntentsGetCall {
  9226. c.ifNoneMatch_ = entityTag
  9227. return c
  9228. }
  9229. // Context sets the context to be used in this call's Do method. Any
  9230. // pending HTTP request will be aborted if the provided context is
  9231. // canceled.
  9232. func (c *ProjectsAgentIntentsGetCall) Context(ctx context.Context) *ProjectsAgentIntentsGetCall {
  9233. c.ctx_ = ctx
  9234. return c
  9235. }
  9236. // Header returns an http.Header that can be modified by the caller to
  9237. // add HTTP headers to the request.
  9238. func (c *ProjectsAgentIntentsGetCall) Header() http.Header {
  9239. if c.header_ == nil {
  9240. c.header_ = make(http.Header)
  9241. }
  9242. return c.header_
  9243. }
  9244. func (c *ProjectsAgentIntentsGetCall) doRequest(alt string) (*http.Response, error) {
  9245. reqHeaders := make(http.Header)
  9246. for k, v := range c.header_ {
  9247. reqHeaders[k] = v
  9248. }
  9249. reqHeaders.Set("User-Agent", c.s.userAgent())
  9250. if c.ifNoneMatch_ != "" {
  9251. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9252. }
  9253. var body io.Reader = nil
  9254. c.urlParams_.Set("alt", alt)
  9255. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  9256. urls += "?" + c.urlParams_.Encode()
  9257. req, _ := http.NewRequest("GET", urls, body)
  9258. req.Header = reqHeaders
  9259. googleapi.Expand(req.URL, map[string]string{
  9260. "name": c.name,
  9261. })
  9262. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9263. }
  9264. // Do executes the "dialogflow.projects.agent.intents.get" call.
  9265. // Exactly one of *GoogleCloudDialogflowV2beta1Intent or error will be
  9266. // non-nil. Any non-2xx status code is an error. Response headers are in
  9267. // either *GoogleCloudDialogflowV2beta1Intent.ServerResponse.Header or
  9268. // (if a response was returned at all) in
  9269. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9270. // whether the returned error was because http.StatusNotModified was
  9271. // returned.
  9272. func (c *ProjectsAgentIntentsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1Intent, error) {
  9273. gensupport.SetOptions(c.urlParams_, opts...)
  9274. res, err := c.doRequest("json")
  9275. if res != nil && res.StatusCode == http.StatusNotModified {
  9276. if res.Body != nil {
  9277. res.Body.Close()
  9278. }
  9279. return nil, &googleapi.Error{
  9280. Code: res.StatusCode,
  9281. Header: res.Header,
  9282. }
  9283. }
  9284. if err != nil {
  9285. return nil, err
  9286. }
  9287. defer googleapi.CloseBody(res)
  9288. if err := googleapi.CheckResponse(res); err != nil {
  9289. return nil, err
  9290. }
  9291. ret := &GoogleCloudDialogflowV2beta1Intent{
  9292. ServerResponse: googleapi.ServerResponse{
  9293. Header: res.Header,
  9294. HTTPStatusCode: res.StatusCode,
  9295. },
  9296. }
  9297. target := &ret
  9298. if err := gensupport.DecodeResponse(target, res); err != nil {
  9299. return nil, err
  9300. }
  9301. return ret, nil
  9302. // {
  9303. // "description": "Retrieves the specified intent.",
  9304. // "flatPath": "v2beta1/projects/{projectsId}/agent/intents/{intentsId}",
  9305. // "httpMethod": "GET",
  9306. // "id": "dialogflow.projects.agent.intents.get",
  9307. // "parameterOrder": [
  9308. // "name"
  9309. // ],
  9310. // "parameters": {
  9311. // "intentView": {
  9312. // "description": "Optional. The resource view to apply to the returned intent.",
  9313. // "enum": [
  9314. // "INTENT_VIEW_UNSPECIFIED",
  9315. // "INTENT_VIEW_FULL"
  9316. // ],
  9317. // "location": "query",
  9318. // "type": "string"
  9319. // },
  9320. // "languageCode": {
  9321. // "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.",
  9322. // "location": "query",
  9323. // "type": "string"
  9324. // },
  9325. // "name": {
  9326. // "description": "Required. The name of the intent.\nFormat: `projects/\u003cProject ID\u003e/agent/intents/\u003cIntent ID\u003e`.",
  9327. // "location": "path",
  9328. // "pattern": "^projects/[^/]+/agent/intents/[^/]+$",
  9329. // "required": true,
  9330. // "type": "string"
  9331. // }
  9332. // },
  9333. // "path": "v2beta1/{+name}",
  9334. // "response": {
  9335. // "$ref": "GoogleCloudDialogflowV2beta1Intent"
  9336. // },
  9337. // "scopes": [
  9338. // "https://www.googleapis.com/auth/cloud-platform"
  9339. // ]
  9340. // }
  9341. }
  9342. // method id "dialogflow.projects.agent.intents.list":
  9343. type ProjectsAgentIntentsListCall struct {
  9344. s *Service
  9345. parent string
  9346. urlParams_ gensupport.URLParams
  9347. ifNoneMatch_ string
  9348. ctx_ context.Context
  9349. header_ http.Header
  9350. }
  9351. // List: Returns the list of all intents in the specified agent.
  9352. func (r *ProjectsAgentIntentsService) List(parent string) *ProjectsAgentIntentsListCall {
  9353. c := &ProjectsAgentIntentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9354. c.parent = parent
  9355. return c
  9356. }
  9357. // IntentView sets the optional parameter "intentView": The resource
  9358. // view to apply to the returned intent.
  9359. //
  9360. // Possible values:
  9361. // "INTENT_VIEW_UNSPECIFIED"
  9362. // "INTENT_VIEW_FULL"
  9363. func (c *ProjectsAgentIntentsListCall) IntentView(intentView string) *ProjectsAgentIntentsListCall {
  9364. c.urlParams_.Set("intentView", intentView)
  9365. return c
  9366. }
  9367. // LanguageCode sets the optional parameter "languageCode": The language
  9368. // to list training phrases, parameters and rich
  9369. // messages for. If not specified, the agent's default language is
  9370. // used.
  9371. // [More than a
  9372. // dozen
  9373. // languages](https://dialogflow.com/docs/reference/language) are
  9374. // supported.
  9375. // Note: languages must be enabled in the agent before they can be used.
  9376. func (c *ProjectsAgentIntentsListCall) LanguageCode(languageCode string) *ProjectsAgentIntentsListCall {
  9377. c.urlParams_.Set("languageCode", languageCode)
  9378. return c
  9379. }
  9380. // PageSize sets the optional parameter "pageSize": The maximum number
  9381. // of items to return in a single page. By
  9382. // default 100 and at most 1000.
  9383. func (c *ProjectsAgentIntentsListCall) PageSize(pageSize int64) *ProjectsAgentIntentsListCall {
  9384. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  9385. return c
  9386. }
  9387. // PageToken sets the optional parameter "pageToken": The
  9388. // next_page_token value returned from a previous list request.
  9389. func (c *ProjectsAgentIntentsListCall) PageToken(pageToken string) *ProjectsAgentIntentsListCall {
  9390. c.urlParams_.Set("pageToken", pageToken)
  9391. return c
  9392. }
  9393. // Fields allows partial responses to be retrieved. See
  9394. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9395. // for more information.
  9396. func (c *ProjectsAgentIntentsListCall) Fields(s ...googleapi.Field) *ProjectsAgentIntentsListCall {
  9397. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9398. return c
  9399. }
  9400. // IfNoneMatch sets the optional parameter which makes the operation
  9401. // fail if the object's ETag matches the given value. This is useful for
  9402. // getting updates only after the object has changed since the last
  9403. // request. Use googleapi.IsNotModified to check whether the response
  9404. // error from Do is the result of In-None-Match.
  9405. func (c *ProjectsAgentIntentsListCall) IfNoneMatch(entityTag string) *ProjectsAgentIntentsListCall {
  9406. c.ifNoneMatch_ = entityTag
  9407. return c
  9408. }
  9409. // Context sets the context to be used in this call's Do method. Any
  9410. // pending HTTP request will be aborted if the provided context is
  9411. // canceled.
  9412. func (c *ProjectsAgentIntentsListCall) Context(ctx context.Context) *ProjectsAgentIntentsListCall {
  9413. c.ctx_ = ctx
  9414. return c
  9415. }
  9416. // Header returns an http.Header that can be modified by the caller to
  9417. // add HTTP headers to the request.
  9418. func (c *ProjectsAgentIntentsListCall) Header() http.Header {
  9419. if c.header_ == nil {
  9420. c.header_ = make(http.Header)
  9421. }
  9422. return c.header_
  9423. }
  9424. func (c *ProjectsAgentIntentsListCall) doRequest(alt string) (*http.Response, error) {
  9425. reqHeaders := make(http.Header)
  9426. for k, v := range c.header_ {
  9427. reqHeaders[k] = v
  9428. }
  9429. reqHeaders.Set("User-Agent", c.s.userAgent())
  9430. if c.ifNoneMatch_ != "" {
  9431. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9432. }
  9433. var body io.Reader = nil
  9434. c.urlParams_.Set("alt", alt)
  9435. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/intents")
  9436. urls += "?" + c.urlParams_.Encode()
  9437. req, _ := http.NewRequest("GET", urls, body)
  9438. req.Header = reqHeaders
  9439. googleapi.Expand(req.URL, map[string]string{
  9440. "parent": c.parent,
  9441. })
  9442. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9443. }
  9444. // Do executes the "dialogflow.projects.agent.intents.list" call.
  9445. // Exactly one of *GoogleCloudDialogflowV2beta1ListIntentsResponse or
  9446. // error will be non-nil. Any non-2xx status code is an error. Response
  9447. // headers are in either
  9448. // *GoogleCloudDialogflowV2beta1ListIntentsResponse.ServerResponse.Header
  9449. // or (if a response was returned at all) in
  9450. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9451. // whether the returned error was because http.StatusNotModified was
  9452. // returned.
  9453. func (c *ProjectsAgentIntentsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1ListIntentsResponse, error) {
  9454. gensupport.SetOptions(c.urlParams_, opts...)
  9455. res, err := c.doRequest("json")
  9456. if res != nil && res.StatusCode == http.StatusNotModified {
  9457. if res.Body != nil {
  9458. res.Body.Close()
  9459. }
  9460. return nil, &googleapi.Error{
  9461. Code: res.StatusCode,
  9462. Header: res.Header,
  9463. }
  9464. }
  9465. if err != nil {
  9466. return nil, err
  9467. }
  9468. defer googleapi.CloseBody(res)
  9469. if err := googleapi.CheckResponse(res); err != nil {
  9470. return nil, err
  9471. }
  9472. ret := &GoogleCloudDialogflowV2beta1ListIntentsResponse{
  9473. ServerResponse: googleapi.ServerResponse{
  9474. Header: res.Header,
  9475. HTTPStatusCode: res.StatusCode,
  9476. },
  9477. }
  9478. target := &ret
  9479. if err := gensupport.DecodeResponse(target, res); err != nil {
  9480. return nil, err
  9481. }
  9482. return ret, nil
  9483. // {
  9484. // "description": "Returns the list of all intents in the specified agent.",
  9485. // "flatPath": "v2beta1/projects/{projectsId}/agent/intents",
  9486. // "httpMethod": "GET",
  9487. // "id": "dialogflow.projects.agent.intents.list",
  9488. // "parameterOrder": [
  9489. // "parent"
  9490. // ],
  9491. // "parameters": {
  9492. // "intentView": {
  9493. // "description": "Optional. The resource view to apply to the returned intent.",
  9494. // "enum": [
  9495. // "INTENT_VIEW_UNSPECIFIED",
  9496. // "INTENT_VIEW_FULL"
  9497. // ],
  9498. // "location": "query",
  9499. // "type": "string"
  9500. // },
  9501. // "languageCode": {
  9502. // "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.",
  9503. // "location": "query",
  9504. // "type": "string"
  9505. // },
  9506. // "pageSize": {
  9507. // "description": "Optional. The maximum number of items to return in a single page. By\ndefault 100 and at most 1000.",
  9508. // "format": "int32",
  9509. // "location": "query",
  9510. // "type": "integer"
  9511. // },
  9512. // "pageToken": {
  9513. // "description": "Optional. The next_page_token value returned from a previous list request.",
  9514. // "location": "query",
  9515. // "type": "string"
  9516. // },
  9517. // "parent": {
  9518. // "description": "Required. The agent to list all intents from.\nFormat: `projects/\u003cProject ID\u003e/agent`.",
  9519. // "location": "path",
  9520. // "pattern": "^projects/[^/]+/agent$",
  9521. // "required": true,
  9522. // "type": "string"
  9523. // }
  9524. // },
  9525. // "path": "v2beta1/{+parent}/intents",
  9526. // "response": {
  9527. // "$ref": "GoogleCloudDialogflowV2beta1ListIntentsResponse"
  9528. // },
  9529. // "scopes": [
  9530. // "https://www.googleapis.com/auth/cloud-platform"
  9531. // ]
  9532. // }
  9533. }
  9534. // Pages invokes f for each page of results.
  9535. // A non-nil error returned from f will halt the iteration.
  9536. // The provided context supersedes any context provided to the Context method.
  9537. func (c *ProjectsAgentIntentsListCall) Pages(ctx context.Context, f func(*GoogleCloudDialogflowV2beta1ListIntentsResponse) error) error {
  9538. c.ctx_ = ctx
  9539. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  9540. for {
  9541. x, err := c.Do()
  9542. if err != nil {
  9543. return err
  9544. }
  9545. if err := f(x); err != nil {
  9546. return err
  9547. }
  9548. if x.NextPageToken == "" {
  9549. return nil
  9550. }
  9551. c.PageToken(x.NextPageToken)
  9552. }
  9553. }
  9554. // method id "dialogflow.projects.agent.intents.patch":
  9555. type ProjectsAgentIntentsPatchCall struct {
  9556. s *Service
  9557. nameid string
  9558. googleclouddialogflowv2beta1intent *GoogleCloudDialogflowV2beta1Intent
  9559. urlParams_ gensupport.URLParams
  9560. ctx_ context.Context
  9561. header_ http.Header
  9562. }
  9563. // Patch: Updates the specified intent.
  9564. func (r *ProjectsAgentIntentsService) Patch(nameid string, googleclouddialogflowv2beta1intent *GoogleCloudDialogflowV2beta1Intent) *ProjectsAgentIntentsPatchCall {
  9565. c := &ProjectsAgentIntentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9566. c.nameid = nameid
  9567. c.googleclouddialogflowv2beta1intent = googleclouddialogflowv2beta1intent
  9568. return c
  9569. }
  9570. // IntentView sets the optional parameter "intentView": The resource
  9571. // view to apply to the returned intent.
  9572. //
  9573. // Possible values:
  9574. // "INTENT_VIEW_UNSPECIFIED"
  9575. // "INTENT_VIEW_FULL"
  9576. func (c *ProjectsAgentIntentsPatchCall) IntentView(intentView string) *ProjectsAgentIntentsPatchCall {
  9577. c.urlParams_.Set("intentView", intentView)
  9578. return c
  9579. }
  9580. // LanguageCode sets the optional parameter "languageCode": The language
  9581. // of training phrases, parameters and rich messages
  9582. // defined in `intent`. If not specified, the agent's default language
  9583. // is
  9584. // used. [More than a
  9585. // dozen
  9586. // languages](https://dialogflow.com/docs/reference/language) are
  9587. // supported.
  9588. // Note: languages must be enabled in the agent, before they can be
  9589. // used.
  9590. func (c *ProjectsAgentIntentsPatchCall) LanguageCode(languageCode string) *ProjectsAgentIntentsPatchCall {
  9591. c.urlParams_.Set("languageCode", languageCode)
  9592. return c
  9593. }
  9594. // UpdateMask sets the optional parameter "updateMask": The mask to
  9595. // control which fields get updated.
  9596. func (c *ProjectsAgentIntentsPatchCall) UpdateMask(updateMask string) *ProjectsAgentIntentsPatchCall {
  9597. c.urlParams_.Set("updateMask", updateMask)
  9598. return c
  9599. }
  9600. // Fields allows partial responses to be retrieved. See
  9601. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9602. // for more information.
  9603. func (c *ProjectsAgentIntentsPatchCall) Fields(s ...googleapi.Field) *ProjectsAgentIntentsPatchCall {
  9604. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9605. return c
  9606. }
  9607. // Context sets the context to be used in this call's Do method. Any
  9608. // pending HTTP request will be aborted if the provided context is
  9609. // canceled.
  9610. func (c *ProjectsAgentIntentsPatchCall) Context(ctx context.Context) *ProjectsAgentIntentsPatchCall {
  9611. c.ctx_ = ctx
  9612. return c
  9613. }
  9614. // Header returns an http.Header that can be modified by the caller to
  9615. // add HTTP headers to the request.
  9616. func (c *ProjectsAgentIntentsPatchCall) Header() http.Header {
  9617. if c.header_ == nil {
  9618. c.header_ = make(http.Header)
  9619. }
  9620. return c.header_
  9621. }
  9622. func (c *ProjectsAgentIntentsPatchCall) doRequest(alt string) (*http.Response, error) {
  9623. reqHeaders := make(http.Header)
  9624. for k, v := range c.header_ {
  9625. reqHeaders[k] = v
  9626. }
  9627. reqHeaders.Set("User-Agent", c.s.userAgent())
  9628. var body io.Reader = nil
  9629. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1intent)
  9630. if err != nil {
  9631. return nil, err
  9632. }
  9633. reqHeaders.Set("Content-Type", "application/json")
  9634. c.urlParams_.Set("alt", alt)
  9635. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  9636. urls += "?" + c.urlParams_.Encode()
  9637. req, _ := http.NewRequest("PATCH", urls, body)
  9638. req.Header = reqHeaders
  9639. googleapi.Expand(req.URL, map[string]string{
  9640. "name": c.nameid,
  9641. })
  9642. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9643. }
  9644. // Do executes the "dialogflow.projects.agent.intents.patch" call.
  9645. // Exactly one of *GoogleCloudDialogflowV2beta1Intent or error will be
  9646. // non-nil. Any non-2xx status code is an error. Response headers are in
  9647. // either *GoogleCloudDialogflowV2beta1Intent.ServerResponse.Header or
  9648. // (if a response was returned at all) in
  9649. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9650. // whether the returned error was because http.StatusNotModified was
  9651. // returned.
  9652. func (c *ProjectsAgentIntentsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1Intent, error) {
  9653. gensupport.SetOptions(c.urlParams_, opts...)
  9654. res, err := c.doRequest("json")
  9655. if res != nil && res.StatusCode == http.StatusNotModified {
  9656. if res.Body != nil {
  9657. res.Body.Close()
  9658. }
  9659. return nil, &googleapi.Error{
  9660. Code: res.StatusCode,
  9661. Header: res.Header,
  9662. }
  9663. }
  9664. if err != nil {
  9665. return nil, err
  9666. }
  9667. defer googleapi.CloseBody(res)
  9668. if err := googleapi.CheckResponse(res); err != nil {
  9669. return nil, err
  9670. }
  9671. ret := &GoogleCloudDialogflowV2beta1Intent{
  9672. ServerResponse: googleapi.ServerResponse{
  9673. Header: res.Header,
  9674. HTTPStatusCode: res.StatusCode,
  9675. },
  9676. }
  9677. target := &ret
  9678. if err := gensupport.DecodeResponse(target, res); err != nil {
  9679. return nil, err
  9680. }
  9681. return ret, nil
  9682. // {
  9683. // "description": "Updates the specified intent.",
  9684. // "flatPath": "v2beta1/projects/{projectsId}/agent/intents/{intentsId}",
  9685. // "httpMethod": "PATCH",
  9686. // "id": "dialogflow.projects.agent.intents.patch",
  9687. // "parameterOrder": [
  9688. // "name"
  9689. // ],
  9690. // "parameters": {
  9691. // "intentView": {
  9692. // "description": "Optional. The resource view to apply to the returned intent.",
  9693. // "enum": [
  9694. // "INTENT_VIEW_UNSPECIFIED",
  9695. // "INTENT_VIEW_FULL"
  9696. // ],
  9697. // "location": "query",
  9698. // "type": "string"
  9699. // },
  9700. // "languageCode": {
  9701. // "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.",
  9702. // "location": "query",
  9703. // "type": "string"
  9704. // },
  9705. // "name": {
  9706. // "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`.",
  9707. // "location": "path",
  9708. // "pattern": "^projects/[^/]+/agent/intents/[^/]+$",
  9709. // "required": true,
  9710. // "type": "string"
  9711. // },
  9712. // "updateMask": {
  9713. // "description": "Optional. The mask to control which fields get updated.",
  9714. // "format": "google-fieldmask",
  9715. // "location": "query",
  9716. // "type": "string"
  9717. // }
  9718. // },
  9719. // "path": "v2beta1/{+name}",
  9720. // "request": {
  9721. // "$ref": "GoogleCloudDialogflowV2beta1Intent"
  9722. // },
  9723. // "response": {
  9724. // "$ref": "GoogleCloudDialogflowV2beta1Intent"
  9725. // },
  9726. // "scopes": [
  9727. // "https://www.googleapis.com/auth/cloud-platform"
  9728. // ]
  9729. // }
  9730. }
  9731. // method id "dialogflow.projects.agent.sessions.deleteContexts":
  9732. type ProjectsAgentSessionsDeleteContextsCall struct {
  9733. s *Service
  9734. parent string
  9735. urlParams_ gensupport.URLParams
  9736. ctx_ context.Context
  9737. header_ http.Header
  9738. }
  9739. // DeleteContexts: Deletes all active contexts in the specified session.
  9740. func (r *ProjectsAgentSessionsService) DeleteContexts(parent string) *ProjectsAgentSessionsDeleteContextsCall {
  9741. c := &ProjectsAgentSessionsDeleteContextsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9742. c.parent = parent
  9743. return c
  9744. }
  9745. // Fields allows partial responses to be retrieved. See
  9746. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9747. // for more information.
  9748. func (c *ProjectsAgentSessionsDeleteContextsCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsDeleteContextsCall {
  9749. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9750. return c
  9751. }
  9752. // Context sets the context to be used in this call's Do method. Any
  9753. // pending HTTP request will be aborted if the provided context is
  9754. // canceled.
  9755. func (c *ProjectsAgentSessionsDeleteContextsCall) Context(ctx context.Context) *ProjectsAgentSessionsDeleteContextsCall {
  9756. c.ctx_ = ctx
  9757. return c
  9758. }
  9759. // Header returns an http.Header that can be modified by the caller to
  9760. // add HTTP headers to the request.
  9761. func (c *ProjectsAgentSessionsDeleteContextsCall) Header() http.Header {
  9762. if c.header_ == nil {
  9763. c.header_ = make(http.Header)
  9764. }
  9765. return c.header_
  9766. }
  9767. func (c *ProjectsAgentSessionsDeleteContextsCall) doRequest(alt string) (*http.Response, error) {
  9768. reqHeaders := make(http.Header)
  9769. for k, v := range c.header_ {
  9770. reqHeaders[k] = v
  9771. }
  9772. reqHeaders.Set("User-Agent", c.s.userAgent())
  9773. var body io.Reader = nil
  9774. c.urlParams_.Set("alt", alt)
  9775. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/contexts")
  9776. urls += "?" + c.urlParams_.Encode()
  9777. req, _ := http.NewRequest("DELETE", urls, body)
  9778. req.Header = reqHeaders
  9779. googleapi.Expand(req.URL, map[string]string{
  9780. "parent": c.parent,
  9781. })
  9782. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9783. }
  9784. // Do executes the "dialogflow.projects.agent.sessions.deleteContexts" call.
  9785. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  9786. // non-2xx status code is an error. Response headers are in either
  9787. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  9788. // returned at all) in error.(*googleapi.Error).Header. Use
  9789. // googleapi.IsNotModified to check whether the returned error was
  9790. // because http.StatusNotModified was returned.
  9791. func (c *ProjectsAgentSessionsDeleteContextsCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  9792. gensupport.SetOptions(c.urlParams_, opts...)
  9793. res, err := c.doRequest("json")
  9794. if res != nil && res.StatusCode == http.StatusNotModified {
  9795. if res.Body != nil {
  9796. res.Body.Close()
  9797. }
  9798. return nil, &googleapi.Error{
  9799. Code: res.StatusCode,
  9800. Header: res.Header,
  9801. }
  9802. }
  9803. if err != nil {
  9804. return nil, err
  9805. }
  9806. defer googleapi.CloseBody(res)
  9807. if err := googleapi.CheckResponse(res); err != nil {
  9808. return nil, err
  9809. }
  9810. ret := &GoogleProtobufEmpty{
  9811. ServerResponse: googleapi.ServerResponse{
  9812. Header: res.Header,
  9813. HTTPStatusCode: res.StatusCode,
  9814. },
  9815. }
  9816. target := &ret
  9817. if err := gensupport.DecodeResponse(target, res); err != nil {
  9818. return nil, err
  9819. }
  9820. return ret, nil
  9821. // {
  9822. // "description": "Deletes all active contexts in the specified session.",
  9823. // "flatPath": "v2beta1/projects/{projectsId}/agent/sessions/{sessionsId}/contexts",
  9824. // "httpMethod": "DELETE",
  9825. // "id": "dialogflow.projects.agent.sessions.deleteContexts",
  9826. // "parameterOrder": [
  9827. // "parent"
  9828. // ],
  9829. // "parameters": {
  9830. // "parent": {
  9831. // "description": "Required. The name of the session to delete all contexts from. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e` or `projects/\u003cProject\nID\u003e/agent/environments/\u003cEnvironment ID\u003e/users/\u003cUser ID\u003e/sessions/\u003cSession\nID\u003e`. Note: Environments and users are under construction and will be\navailable soon. If \u003cEnvironment ID\u003e is not specified we assume default\n'draft' environment. If \u003cUser ID\u003e is not specified, we assume default\n'-' user.",
  9832. // "location": "path",
  9833. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+$",
  9834. // "required": true,
  9835. // "type": "string"
  9836. // }
  9837. // },
  9838. // "path": "v2beta1/{+parent}/contexts",
  9839. // "response": {
  9840. // "$ref": "GoogleProtobufEmpty"
  9841. // },
  9842. // "scopes": [
  9843. // "https://www.googleapis.com/auth/cloud-platform"
  9844. // ]
  9845. // }
  9846. }
  9847. // method id "dialogflow.projects.agent.sessions.detectIntent":
  9848. type ProjectsAgentSessionsDetectIntentCall struct {
  9849. s *Service
  9850. sessionid string
  9851. googleclouddialogflowv2beta1detectintentrequest *GoogleCloudDialogflowV2beta1DetectIntentRequest
  9852. urlParams_ gensupport.URLParams
  9853. ctx_ context.Context
  9854. header_ http.Header
  9855. }
  9856. // DetectIntent: Processes a natural language query and returns
  9857. // structured, actionable data
  9858. // as a result. This method is not idempotent, because it may cause
  9859. // contexts
  9860. // and session entity types to be updated, which in turn might
  9861. // affect
  9862. // results of future queries.
  9863. func (r *ProjectsAgentSessionsService) DetectIntent(sessionid string, googleclouddialogflowv2beta1detectintentrequest *GoogleCloudDialogflowV2beta1DetectIntentRequest) *ProjectsAgentSessionsDetectIntentCall {
  9864. c := &ProjectsAgentSessionsDetectIntentCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9865. c.sessionid = sessionid
  9866. c.googleclouddialogflowv2beta1detectintentrequest = googleclouddialogflowv2beta1detectintentrequest
  9867. return c
  9868. }
  9869. // Fields allows partial responses to be retrieved. See
  9870. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9871. // for more information.
  9872. func (c *ProjectsAgentSessionsDetectIntentCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsDetectIntentCall {
  9873. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9874. return c
  9875. }
  9876. // Context sets the context to be used in this call's Do method. Any
  9877. // pending HTTP request will be aborted if the provided context is
  9878. // canceled.
  9879. func (c *ProjectsAgentSessionsDetectIntentCall) Context(ctx context.Context) *ProjectsAgentSessionsDetectIntentCall {
  9880. c.ctx_ = ctx
  9881. return c
  9882. }
  9883. // Header returns an http.Header that can be modified by the caller to
  9884. // add HTTP headers to the request.
  9885. func (c *ProjectsAgentSessionsDetectIntentCall) Header() http.Header {
  9886. if c.header_ == nil {
  9887. c.header_ = make(http.Header)
  9888. }
  9889. return c.header_
  9890. }
  9891. func (c *ProjectsAgentSessionsDetectIntentCall) doRequest(alt string) (*http.Response, error) {
  9892. reqHeaders := make(http.Header)
  9893. for k, v := range c.header_ {
  9894. reqHeaders[k] = v
  9895. }
  9896. reqHeaders.Set("User-Agent", c.s.userAgent())
  9897. var body io.Reader = nil
  9898. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1detectintentrequest)
  9899. if err != nil {
  9900. return nil, err
  9901. }
  9902. reqHeaders.Set("Content-Type", "application/json")
  9903. c.urlParams_.Set("alt", alt)
  9904. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+session}:detectIntent")
  9905. urls += "?" + c.urlParams_.Encode()
  9906. req, _ := http.NewRequest("POST", urls, body)
  9907. req.Header = reqHeaders
  9908. googleapi.Expand(req.URL, map[string]string{
  9909. "session": c.sessionid,
  9910. })
  9911. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9912. }
  9913. // Do executes the "dialogflow.projects.agent.sessions.detectIntent" call.
  9914. // Exactly one of *GoogleCloudDialogflowV2beta1DetectIntentResponse or
  9915. // error will be non-nil. Any non-2xx status code is an error. Response
  9916. // headers are in either
  9917. // *GoogleCloudDialogflowV2beta1DetectIntentResponse.ServerResponse.Heade
  9918. // r or (if a response was returned at all) in
  9919. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9920. // whether the returned error was because http.StatusNotModified was
  9921. // returned.
  9922. func (c *ProjectsAgentSessionsDetectIntentCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1DetectIntentResponse, error) {
  9923. gensupport.SetOptions(c.urlParams_, opts...)
  9924. res, err := c.doRequest("json")
  9925. if res != nil && res.StatusCode == http.StatusNotModified {
  9926. if res.Body != nil {
  9927. res.Body.Close()
  9928. }
  9929. return nil, &googleapi.Error{
  9930. Code: res.StatusCode,
  9931. Header: res.Header,
  9932. }
  9933. }
  9934. if err != nil {
  9935. return nil, err
  9936. }
  9937. defer googleapi.CloseBody(res)
  9938. if err := googleapi.CheckResponse(res); err != nil {
  9939. return nil, err
  9940. }
  9941. ret := &GoogleCloudDialogflowV2beta1DetectIntentResponse{
  9942. ServerResponse: googleapi.ServerResponse{
  9943. Header: res.Header,
  9944. HTTPStatusCode: res.StatusCode,
  9945. },
  9946. }
  9947. target := &ret
  9948. if err := gensupport.DecodeResponse(target, res); err != nil {
  9949. return nil, err
  9950. }
  9951. return ret, nil
  9952. // {
  9953. // "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.",
  9954. // "flatPath": "v2beta1/projects/{projectsId}/agent/sessions/{sessionsId}:detectIntent",
  9955. // "httpMethod": "POST",
  9956. // "id": "dialogflow.projects.agent.sessions.detectIntent",
  9957. // "parameterOrder": [
  9958. // "session"
  9959. // ],
  9960. // "parameters": {
  9961. // "session": {
  9962. // "description": "Required. The name of the session this query is sent to. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e`, or\n`projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment ID\u003e/users/\u003cUser\nID\u003e/sessions/\u003cSession ID\u003e`. Note: Environments and users are under\nconstruction and will be available soon. If \u003cEnvironment ID\u003e is not\nspecified, we assume default 'draft' environment. If \u003cUser ID\u003e is not\nspecified, we are using \"-\". It’s up to the API caller to choose an\nappropriate \u003cSession ID\u003e and \u003cUser Id\u003e. They can be a random numbers or\nsome type of user and session identifiers (preferably hashed). The length\nof the \u003cSession ID\u003e and \u003cUser ID\u003e must not exceed 36 characters.",
  9963. // "location": "path",
  9964. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+$",
  9965. // "required": true,
  9966. // "type": "string"
  9967. // }
  9968. // },
  9969. // "path": "v2beta1/{+session}:detectIntent",
  9970. // "request": {
  9971. // "$ref": "GoogleCloudDialogflowV2beta1DetectIntentRequest"
  9972. // },
  9973. // "response": {
  9974. // "$ref": "GoogleCloudDialogflowV2beta1DetectIntentResponse"
  9975. // },
  9976. // "scopes": [
  9977. // "https://www.googleapis.com/auth/cloud-platform"
  9978. // ]
  9979. // }
  9980. }
  9981. // method id "dialogflow.projects.agent.sessions.contexts.create":
  9982. type ProjectsAgentSessionsContextsCreateCall struct {
  9983. s *Service
  9984. parent string
  9985. googleclouddialogflowv2beta1context *GoogleCloudDialogflowV2beta1Context
  9986. urlParams_ gensupport.URLParams
  9987. ctx_ context.Context
  9988. header_ http.Header
  9989. }
  9990. // Create: Creates a context.
  9991. func (r *ProjectsAgentSessionsContextsService) Create(parent string, googleclouddialogflowv2beta1context *GoogleCloudDialogflowV2beta1Context) *ProjectsAgentSessionsContextsCreateCall {
  9992. c := &ProjectsAgentSessionsContextsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9993. c.parent = parent
  9994. c.googleclouddialogflowv2beta1context = googleclouddialogflowv2beta1context
  9995. return c
  9996. }
  9997. // Fields allows partial responses to be retrieved. See
  9998. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9999. // for more information.
  10000. func (c *ProjectsAgentSessionsContextsCreateCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsContextsCreateCall {
  10001. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10002. return c
  10003. }
  10004. // Context sets the context to be used in this call's Do method. Any
  10005. // pending HTTP request will be aborted if the provided context is
  10006. // canceled.
  10007. func (c *ProjectsAgentSessionsContextsCreateCall) Context(ctx context.Context) *ProjectsAgentSessionsContextsCreateCall {
  10008. c.ctx_ = ctx
  10009. return c
  10010. }
  10011. // Header returns an http.Header that can be modified by the caller to
  10012. // add HTTP headers to the request.
  10013. func (c *ProjectsAgentSessionsContextsCreateCall) Header() http.Header {
  10014. if c.header_ == nil {
  10015. c.header_ = make(http.Header)
  10016. }
  10017. return c.header_
  10018. }
  10019. func (c *ProjectsAgentSessionsContextsCreateCall) doRequest(alt string) (*http.Response, error) {
  10020. reqHeaders := make(http.Header)
  10021. for k, v := range c.header_ {
  10022. reqHeaders[k] = v
  10023. }
  10024. reqHeaders.Set("User-Agent", c.s.userAgent())
  10025. var body io.Reader = nil
  10026. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1context)
  10027. if err != nil {
  10028. return nil, err
  10029. }
  10030. reqHeaders.Set("Content-Type", "application/json")
  10031. c.urlParams_.Set("alt", alt)
  10032. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/contexts")
  10033. urls += "?" + c.urlParams_.Encode()
  10034. req, _ := http.NewRequest("POST", urls, body)
  10035. req.Header = reqHeaders
  10036. googleapi.Expand(req.URL, map[string]string{
  10037. "parent": c.parent,
  10038. })
  10039. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10040. }
  10041. // Do executes the "dialogflow.projects.agent.sessions.contexts.create" call.
  10042. // Exactly one of *GoogleCloudDialogflowV2beta1Context or error will be
  10043. // non-nil. Any non-2xx status code is an error. Response headers are in
  10044. // either *GoogleCloudDialogflowV2beta1Context.ServerResponse.Header or
  10045. // (if a response was returned at all) in
  10046. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  10047. // whether the returned error was because http.StatusNotModified was
  10048. // returned.
  10049. func (c *ProjectsAgentSessionsContextsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1Context, error) {
  10050. gensupport.SetOptions(c.urlParams_, opts...)
  10051. res, err := c.doRequest("json")
  10052. if res != nil && res.StatusCode == http.StatusNotModified {
  10053. if res.Body != nil {
  10054. res.Body.Close()
  10055. }
  10056. return nil, &googleapi.Error{
  10057. Code: res.StatusCode,
  10058. Header: res.Header,
  10059. }
  10060. }
  10061. if err != nil {
  10062. return nil, err
  10063. }
  10064. defer googleapi.CloseBody(res)
  10065. if err := googleapi.CheckResponse(res); err != nil {
  10066. return nil, err
  10067. }
  10068. ret := &GoogleCloudDialogflowV2beta1Context{
  10069. ServerResponse: googleapi.ServerResponse{
  10070. Header: res.Header,
  10071. HTTPStatusCode: res.StatusCode,
  10072. },
  10073. }
  10074. target := &ret
  10075. if err := gensupport.DecodeResponse(target, res); err != nil {
  10076. return nil, err
  10077. }
  10078. return ret, nil
  10079. // {
  10080. // "description": "Creates a context.",
  10081. // "flatPath": "v2beta1/projects/{projectsId}/agent/sessions/{sessionsId}/contexts",
  10082. // "httpMethod": "POST",
  10083. // "id": "dialogflow.projects.agent.sessions.contexts.create",
  10084. // "parameterOrder": [
  10085. // "parent"
  10086. // ],
  10087. // "parameters": {
  10088. // "parent": {
  10089. // "description": "Required. The session to create a context for.\nFormat: `projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e` or\n`projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment ID\u003e/users/\u003cUser\nID\u003e/sessions/\u003cSession ID\u003e`. Note: Environments and users are under\nconstruction and will be available soon. If \u003cEnvironment ID\u003e is not\nspecified, we assume default 'draft' environment. If \u003cUser ID\u003e is not\nspecified, we assume default '-' user.",
  10090. // "location": "path",
  10091. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+$",
  10092. // "required": true,
  10093. // "type": "string"
  10094. // }
  10095. // },
  10096. // "path": "v2beta1/{+parent}/contexts",
  10097. // "request": {
  10098. // "$ref": "GoogleCloudDialogflowV2beta1Context"
  10099. // },
  10100. // "response": {
  10101. // "$ref": "GoogleCloudDialogflowV2beta1Context"
  10102. // },
  10103. // "scopes": [
  10104. // "https://www.googleapis.com/auth/cloud-platform"
  10105. // ]
  10106. // }
  10107. }
  10108. // method id "dialogflow.projects.agent.sessions.contexts.delete":
  10109. type ProjectsAgentSessionsContextsDeleteCall struct {
  10110. s *Service
  10111. name string
  10112. urlParams_ gensupport.URLParams
  10113. ctx_ context.Context
  10114. header_ http.Header
  10115. }
  10116. // Delete: Deletes the specified context.
  10117. func (r *ProjectsAgentSessionsContextsService) Delete(name string) *ProjectsAgentSessionsContextsDeleteCall {
  10118. c := &ProjectsAgentSessionsContextsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10119. c.name = name
  10120. return c
  10121. }
  10122. // Fields allows partial responses to be retrieved. See
  10123. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10124. // for more information.
  10125. func (c *ProjectsAgentSessionsContextsDeleteCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsContextsDeleteCall {
  10126. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10127. return c
  10128. }
  10129. // Context sets the context to be used in this call's Do method. Any
  10130. // pending HTTP request will be aborted if the provided context is
  10131. // canceled.
  10132. func (c *ProjectsAgentSessionsContextsDeleteCall) Context(ctx context.Context) *ProjectsAgentSessionsContextsDeleteCall {
  10133. c.ctx_ = ctx
  10134. return c
  10135. }
  10136. // Header returns an http.Header that can be modified by the caller to
  10137. // add HTTP headers to the request.
  10138. func (c *ProjectsAgentSessionsContextsDeleteCall) Header() http.Header {
  10139. if c.header_ == nil {
  10140. c.header_ = make(http.Header)
  10141. }
  10142. return c.header_
  10143. }
  10144. func (c *ProjectsAgentSessionsContextsDeleteCall) doRequest(alt string) (*http.Response, error) {
  10145. reqHeaders := make(http.Header)
  10146. for k, v := range c.header_ {
  10147. reqHeaders[k] = v
  10148. }
  10149. reqHeaders.Set("User-Agent", c.s.userAgent())
  10150. var body io.Reader = nil
  10151. c.urlParams_.Set("alt", alt)
  10152. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  10153. urls += "?" + c.urlParams_.Encode()
  10154. req, _ := http.NewRequest("DELETE", urls, body)
  10155. req.Header = reqHeaders
  10156. googleapi.Expand(req.URL, map[string]string{
  10157. "name": c.name,
  10158. })
  10159. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10160. }
  10161. // Do executes the "dialogflow.projects.agent.sessions.contexts.delete" call.
  10162. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  10163. // non-2xx status code is an error. Response headers are in either
  10164. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  10165. // returned at all) in error.(*googleapi.Error).Header. Use
  10166. // googleapi.IsNotModified to check whether the returned error was
  10167. // because http.StatusNotModified was returned.
  10168. func (c *ProjectsAgentSessionsContextsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  10169. gensupport.SetOptions(c.urlParams_, opts...)
  10170. res, err := c.doRequest("json")
  10171. if res != nil && res.StatusCode == http.StatusNotModified {
  10172. if res.Body != nil {
  10173. res.Body.Close()
  10174. }
  10175. return nil, &googleapi.Error{
  10176. Code: res.StatusCode,
  10177. Header: res.Header,
  10178. }
  10179. }
  10180. if err != nil {
  10181. return nil, err
  10182. }
  10183. defer googleapi.CloseBody(res)
  10184. if err := googleapi.CheckResponse(res); err != nil {
  10185. return nil, err
  10186. }
  10187. ret := &GoogleProtobufEmpty{
  10188. ServerResponse: googleapi.ServerResponse{
  10189. Header: res.Header,
  10190. HTTPStatusCode: res.StatusCode,
  10191. },
  10192. }
  10193. target := &ret
  10194. if err := gensupport.DecodeResponse(target, res); err != nil {
  10195. return nil, err
  10196. }
  10197. return ret, nil
  10198. // {
  10199. // "description": "Deletes the specified context.",
  10200. // "flatPath": "v2beta1/projects/{projectsId}/agent/sessions/{sessionsId}/contexts/{contextsId}",
  10201. // "httpMethod": "DELETE",
  10202. // "id": "dialogflow.projects.agent.sessions.contexts.delete",
  10203. // "parameterOrder": [
  10204. // "name"
  10205. // ],
  10206. // "parameters": {
  10207. // "name": {
  10208. // "description": "Required. The name of the context to delete. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e/contexts/\u003cContext ID\u003e`\nor `projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment ID\u003e/users/\u003cUser\nID\u003e/sessions/\u003cSession ID\u003e/contexts/\u003cContext ID\u003e`. Note: Environments and\nusers are under construction and will be available soon. If \u003cEnvironment\nID\u003e is not specified, we assume default 'draft' environment. If \u003cUser ID\u003e\nis not specified, we assume default\n'-' user.",
  10209. // "location": "path",
  10210. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+/contexts/[^/]+$",
  10211. // "required": true,
  10212. // "type": "string"
  10213. // }
  10214. // },
  10215. // "path": "v2beta1/{+name}",
  10216. // "response": {
  10217. // "$ref": "GoogleProtobufEmpty"
  10218. // },
  10219. // "scopes": [
  10220. // "https://www.googleapis.com/auth/cloud-platform"
  10221. // ]
  10222. // }
  10223. }
  10224. // method id "dialogflow.projects.agent.sessions.contexts.get":
  10225. type ProjectsAgentSessionsContextsGetCall struct {
  10226. s *Service
  10227. name string
  10228. urlParams_ gensupport.URLParams
  10229. ifNoneMatch_ string
  10230. ctx_ context.Context
  10231. header_ http.Header
  10232. }
  10233. // Get: Retrieves the specified context.
  10234. func (r *ProjectsAgentSessionsContextsService) Get(name string) *ProjectsAgentSessionsContextsGetCall {
  10235. c := &ProjectsAgentSessionsContextsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10236. c.name = name
  10237. return c
  10238. }
  10239. // Fields allows partial responses to be retrieved. See
  10240. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10241. // for more information.
  10242. func (c *ProjectsAgentSessionsContextsGetCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsContextsGetCall {
  10243. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10244. return c
  10245. }
  10246. // IfNoneMatch sets the optional parameter which makes the operation
  10247. // fail if the object's ETag matches the given value. This is useful for
  10248. // getting updates only after the object has changed since the last
  10249. // request. Use googleapi.IsNotModified to check whether the response
  10250. // error from Do is the result of In-None-Match.
  10251. func (c *ProjectsAgentSessionsContextsGetCall) IfNoneMatch(entityTag string) *ProjectsAgentSessionsContextsGetCall {
  10252. c.ifNoneMatch_ = entityTag
  10253. return c
  10254. }
  10255. // Context sets the context to be used in this call's Do method. Any
  10256. // pending HTTP request will be aborted if the provided context is
  10257. // canceled.
  10258. func (c *ProjectsAgentSessionsContextsGetCall) Context(ctx context.Context) *ProjectsAgentSessionsContextsGetCall {
  10259. c.ctx_ = ctx
  10260. return c
  10261. }
  10262. // Header returns an http.Header that can be modified by the caller to
  10263. // add HTTP headers to the request.
  10264. func (c *ProjectsAgentSessionsContextsGetCall) Header() http.Header {
  10265. if c.header_ == nil {
  10266. c.header_ = make(http.Header)
  10267. }
  10268. return c.header_
  10269. }
  10270. func (c *ProjectsAgentSessionsContextsGetCall) doRequest(alt string) (*http.Response, error) {
  10271. reqHeaders := make(http.Header)
  10272. for k, v := range c.header_ {
  10273. reqHeaders[k] = v
  10274. }
  10275. reqHeaders.Set("User-Agent", c.s.userAgent())
  10276. if c.ifNoneMatch_ != "" {
  10277. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10278. }
  10279. var body io.Reader = nil
  10280. c.urlParams_.Set("alt", alt)
  10281. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  10282. urls += "?" + c.urlParams_.Encode()
  10283. req, _ := http.NewRequest("GET", urls, body)
  10284. req.Header = reqHeaders
  10285. googleapi.Expand(req.URL, map[string]string{
  10286. "name": c.name,
  10287. })
  10288. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10289. }
  10290. // Do executes the "dialogflow.projects.agent.sessions.contexts.get" call.
  10291. // Exactly one of *GoogleCloudDialogflowV2beta1Context or error will be
  10292. // non-nil. Any non-2xx status code is an error. Response headers are in
  10293. // either *GoogleCloudDialogflowV2beta1Context.ServerResponse.Header or
  10294. // (if a response was returned at all) in
  10295. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  10296. // whether the returned error was because http.StatusNotModified was
  10297. // returned.
  10298. func (c *ProjectsAgentSessionsContextsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1Context, error) {
  10299. gensupport.SetOptions(c.urlParams_, opts...)
  10300. res, err := c.doRequest("json")
  10301. if res != nil && res.StatusCode == http.StatusNotModified {
  10302. if res.Body != nil {
  10303. res.Body.Close()
  10304. }
  10305. return nil, &googleapi.Error{
  10306. Code: res.StatusCode,
  10307. Header: res.Header,
  10308. }
  10309. }
  10310. if err != nil {
  10311. return nil, err
  10312. }
  10313. defer googleapi.CloseBody(res)
  10314. if err := googleapi.CheckResponse(res); err != nil {
  10315. return nil, err
  10316. }
  10317. ret := &GoogleCloudDialogflowV2beta1Context{
  10318. ServerResponse: googleapi.ServerResponse{
  10319. Header: res.Header,
  10320. HTTPStatusCode: res.StatusCode,
  10321. },
  10322. }
  10323. target := &ret
  10324. if err := gensupport.DecodeResponse(target, res); err != nil {
  10325. return nil, err
  10326. }
  10327. return ret, nil
  10328. // {
  10329. // "description": "Retrieves the specified context.",
  10330. // "flatPath": "v2beta1/projects/{projectsId}/agent/sessions/{sessionsId}/contexts/{contextsId}",
  10331. // "httpMethod": "GET",
  10332. // "id": "dialogflow.projects.agent.sessions.contexts.get",
  10333. // "parameterOrder": [
  10334. // "name"
  10335. // ],
  10336. // "parameters": {
  10337. // "name": {
  10338. // "description": "Required. The name of the context. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e/contexts/\u003cContext ID\u003e`\nor `projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment ID\u003e/users/\u003cUser\nID\u003e/sessions/\u003cSession ID\u003e/contexts/\u003cContext ID\u003e`. Note: Environments and\nusers are under construction and will be available soon. If \u003cEnvironment\nID\u003e is not specified, we assume default 'draft' environment. If \u003cUser ID\u003e\nis not specified, we assume default '-' user.",
  10339. // "location": "path",
  10340. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+/contexts/[^/]+$",
  10341. // "required": true,
  10342. // "type": "string"
  10343. // }
  10344. // },
  10345. // "path": "v2beta1/{+name}",
  10346. // "response": {
  10347. // "$ref": "GoogleCloudDialogflowV2beta1Context"
  10348. // },
  10349. // "scopes": [
  10350. // "https://www.googleapis.com/auth/cloud-platform"
  10351. // ]
  10352. // }
  10353. }
  10354. // method id "dialogflow.projects.agent.sessions.contexts.list":
  10355. type ProjectsAgentSessionsContextsListCall struct {
  10356. s *Service
  10357. parent string
  10358. urlParams_ gensupport.URLParams
  10359. ifNoneMatch_ string
  10360. ctx_ context.Context
  10361. header_ http.Header
  10362. }
  10363. // List: Returns the list of all contexts in the specified session.
  10364. func (r *ProjectsAgentSessionsContextsService) List(parent string) *ProjectsAgentSessionsContextsListCall {
  10365. c := &ProjectsAgentSessionsContextsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10366. c.parent = parent
  10367. return c
  10368. }
  10369. // PageSize sets the optional parameter "pageSize": The maximum number
  10370. // of items to return in a single page. By
  10371. // default 100 and at most 1000.
  10372. func (c *ProjectsAgentSessionsContextsListCall) PageSize(pageSize int64) *ProjectsAgentSessionsContextsListCall {
  10373. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  10374. return c
  10375. }
  10376. // PageToken sets the optional parameter "pageToken": The
  10377. // next_page_token value returned from a previous list request.
  10378. func (c *ProjectsAgentSessionsContextsListCall) PageToken(pageToken string) *ProjectsAgentSessionsContextsListCall {
  10379. c.urlParams_.Set("pageToken", pageToken)
  10380. return c
  10381. }
  10382. // Fields allows partial responses to be retrieved. See
  10383. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10384. // for more information.
  10385. func (c *ProjectsAgentSessionsContextsListCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsContextsListCall {
  10386. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10387. return c
  10388. }
  10389. // IfNoneMatch sets the optional parameter which makes the operation
  10390. // fail if the object's ETag matches the given value. This is useful for
  10391. // getting updates only after the object has changed since the last
  10392. // request. Use googleapi.IsNotModified to check whether the response
  10393. // error from Do is the result of In-None-Match.
  10394. func (c *ProjectsAgentSessionsContextsListCall) IfNoneMatch(entityTag string) *ProjectsAgentSessionsContextsListCall {
  10395. c.ifNoneMatch_ = entityTag
  10396. return c
  10397. }
  10398. // Context sets the context to be used in this call's Do method. Any
  10399. // pending HTTP request will be aborted if the provided context is
  10400. // canceled.
  10401. func (c *ProjectsAgentSessionsContextsListCall) Context(ctx context.Context) *ProjectsAgentSessionsContextsListCall {
  10402. c.ctx_ = ctx
  10403. return c
  10404. }
  10405. // Header returns an http.Header that can be modified by the caller to
  10406. // add HTTP headers to the request.
  10407. func (c *ProjectsAgentSessionsContextsListCall) Header() http.Header {
  10408. if c.header_ == nil {
  10409. c.header_ = make(http.Header)
  10410. }
  10411. return c.header_
  10412. }
  10413. func (c *ProjectsAgentSessionsContextsListCall) doRequest(alt string) (*http.Response, error) {
  10414. reqHeaders := make(http.Header)
  10415. for k, v := range c.header_ {
  10416. reqHeaders[k] = v
  10417. }
  10418. reqHeaders.Set("User-Agent", c.s.userAgent())
  10419. if c.ifNoneMatch_ != "" {
  10420. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10421. }
  10422. var body io.Reader = nil
  10423. c.urlParams_.Set("alt", alt)
  10424. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/contexts")
  10425. urls += "?" + c.urlParams_.Encode()
  10426. req, _ := http.NewRequest("GET", urls, body)
  10427. req.Header = reqHeaders
  10428. googleapi.Expand(req.URL, map[string]string{
  10429. "parent": c.parent,
  10430. })
  10431. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10432. }
  10433. // Do executes the "dialogflow.projects.agent.sessions.contexts.list" call.
  10434. // Exactly one of *GoogleCloudDialogflowV2beta1ListContextsResponse or
  10435. // error will be non-nil. Any non-2xx status code is an error. Response
  10436. // headers are in either
  10437. // *GoogleCloudDialogflowV2beta1ListContextsResponse.ServerResponse.Heade
  10438. // r or (if a response was returned at all) in
  10439. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  10440. // whether the returned error was because http.StatusNotModified was
  10441. // returned.
  10442. func (c *ProjectsAgentSessionsContextsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1ListContextsResponse, error) {
  10443. gensupport.SetOptions(c.urlParams_, opts...)
  10444. res, err := c.doRequest("json")
  10445. if res != nil && res.StatusCode == http.StatusNotModified {
  10446. if res.Body != nil {
  10447. res.Body.Close()
  10448. }
  10449. return nil, &googleapi.Error{
  10450. Code: res.StatusCode,
  10451. Header: res.Header,
  10452. }
  10453. }
  10454. if err != nil {
  10455. return nil, err
  10456. }
  10457. defer googleapi.CloseBody(res)
  10458. if err := googleapi.CheckResponse(res); err != nil {
  10459. return nil, err
  10460. }
  10461. ret := &GoogleCloudDialogflowV2beta1ListContextsResponse{
  10462. ServerResponse: googleapi.ServerResponse{
  10463. Header: res.Header,
  10464. HTTPStatusCode: res.StatusCode,
  10465. },
  10466. }
  10467. target := &ret
  10468. if err := gensupport.DecodeResponse(target, res); err != nil {
  10469. return nil, err
  10470. }
  10471. return ret, nil
  10472. // {
  10473. // "description": "Returns the list of all contexts in the specified session.",
  10474. // "flatPath": "v2beta1/projects/{projectsId}/agent/sessions/{sessionsId}/contexts",
  10475. // "httpMethod": "GET",
  10476. // "id": "dialogflow.projects.agent.sessions.contexts.list",
  10477. // "parameterOrder": [
  10478. // "parent"
  10479. // ],
  10480. // "parameters": {
  10481. // "pageSize": {
  10482. // "description": "Optional. The maximum number of items to return in a single page. By\ndefault 100 and at most 1000.",
  10483. // "format": "int32",
  10484. // "location": "query",
  10485. // "type": "integer"
  10486. // },
  10487. // "pageToken": {
  10488. // "description": "Optional. The next_page_token value returned from a previous list request.",
  10489. // "location": "query",
  10490. // "type": "string"
  10491. // },
  10492. // "parent": {
  10493. // "description": "Required. The session to list all contexts from.\nFormat: `projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e` or\n`projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment ID\u003e/users/\u003cUser\nID\u003e/sessions/\u003cSession ID\u003e`. Note: Environments and users are under\nconstruction and will be available soon. If \u003cEnvironment ID\u003e is not\nspecified, we assume default 'draft' environment. If \u003cUser ID\u003e is not\nspecified, we assume default '-' user.",
  10494. // "location": "path",
  10495. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+$",
  10496. // "required": true,
  10497. // "type": "string"
  10498. // }
  10499. // },
  10500. // "path": "v2beta1/{+parent}/contexts",
  10501. // "response": {
  10502. // "$ref": "GoogleCloudDialogflowV2beta1ListContextsResponse"
  10503. // },
  10504. // "scopes": [
  10505. // "https://www.googleapis.com/auth/cloud-platform"
  10506. // ]
  10507. // }
  10508. }
  10509. // Pages invokes f for each page of results.
  10510. // A non-nil error returned from f will halt the iteration.
  10511. // The provided context supersedes any context provided to the Context method.
  10512. func (c *ProjectsAgentSessionsContextsListCall) Pages(ctx context.Context, f func(*GoogleCloudDialogflowV2beta1ListContextsResponse) error) error {
  10513. c.ctx_ = ctx
  10514. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  10515. for {
  10516. x, err := c.Do()
  10517. if err != nil {
  10518. return err
  10519. }
  10520. if err := f(x); err != nil {
  10521. return err
  10522. }
  10523. if x.NextPageToken == "" {
  10524. return nil
  10525. }
  10526. c.PageToken(x.NextPageToken)
  10527. }
  10528. }
  10529. // method id "dialogflow.projects.agent.sessions.contexts.patch":
  10530. type ProjectsAgentSessionsContextsPatchCall struct {
  10531. s *Service
  10532. nameid string
  10533. googleclouddialogflowv2beta1context *GoogleCloudDialogflowV2beta1Context
  10534. urlParams_ gensupport.URLParams
  10535. ctx_ context.Context
  10536. header_ http.Header
  10537. }
  10538. // Patch: Updates the specified context.
  10539. func (r *ProjectsAgentSessionsContextsService) Patch(nameid string, googleclouddialogflowv2beta1context *GoogleCloudDialogflowV2beta1Context) *ProjectsAgentSessionsContextsPatchCall {
  10540. c := &ProjectsAgentSessionsContextsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10541. c.nameid = nameid
  10542. c.googleclouddialogflowv2beta1context = googleclouddialogflowv2beta1context
  10543. return c
  10544. }
  10545. // UpdateMask sets the optional parameter "updateMask": The mask to
  10546. // control which fields get updated.
  10547. func (c *ProjectsAgentSessionsContextsPatchCall) UpdateMask(updateMask string) *ProjectsAgentSessionsContextsPatchCall {
  10548. c.urlParams_.Set("updateMask", updateMask)
  10549. return c
  10550. }
  10551. // Fields allows partial responses to be retrieved. See
  10552. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10553. // for more information.
  10554. func (c *ProjectsAgentSessionsContextsPatchCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsContextsPatchCall {
  10555. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10556. return c
  10557. }
  10558. // Context sets the context to be used in this call's Do method. Any
  10559. // pending HTTP request will be aborted if the provided context is
  10560. // canceled.
  10561. func (c *ProjectsAgentSessionsContextsPatchCall) Context(ctx context.Context) *ProjectsAgentSessionsContextsPatchCall {
  10562. c.ctx_ = ctx
  10563. return c
  10564. }
  10565. // Header returns an http.Header that can be modified by the caller to
  10566. // add HTTP headers to the request.
  10567. func (c *ProjectsAgentSessionsContextsPatchCall) Header() http.Header {
  10568. if c.header_ == nil {
  10569. c.header_ = make(http.Header)
  10570. }
  10571. return c.header_
  10572. }
  10573. func (c *ProjectsAgentSessionsContextsPatchCall) doRequest(alt string) (*http.Response, error) {
  10574. reqHeaders := make(http.Header)
  10575. for k, v := range c.header_ {
  10576. reqHeaders[k] = v
  10577. }
  10578. reqHeaders.Set("User-Agent", c.s.userAgent())
  10579. var body io.Reader = nil
  10580. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1context)
  10581. if err != nil {
  10582. return nil, err
  10583. }
  10584. reqHeaders.Set("Content-Type", "application/json")
  10585. c.urlParams_.Set("alt", alt)
  10586. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  10587. urls += "?" + c.urlParams_.Encode()
  10588. req, _ := http.NewRequest("PATCH", urls, body)
  10589. req.Header = reqHeaders
  10590. googleapi.Expand(req.URL, map[string]string{
  10591. "name": c.nameid,
  10592. })
  10593. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10594. }
  10595. // Do executes the "dialogflow.projects.agent.sessions.contexts.patch" call.
  10596. // Exactly one of *GoogleCloudDialogflowV2beta1Context or error will be
  10597. // non-nil. Any non-2xx status code is an error. Response headers are in
  10598. // either *GoogleCloudDialogflowV2beta1Context.ServerResponse.Header or
  10599. // (if a response was returned at all) in
  10600. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  10601. // whether the returned error was because http.StatusNotModified was
  10602. // returned.
  10603. func (c *ProjectsAgentSessionsContextsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1Context, error) {
  10604. gensupport.SetOptions(c.urlParams_, opts...)
  10605. res, err := c.doRequest("json")
  10606. if res != nil && res.StatusCode == http.StatusNotModified {
  10607. if res.Body != nil {
  10608. res.Body.Close()
  10609. }
  10610. return nil, &googleapi.Error{
  10611. Code: res.StatusCode,
  10612. Header: res.Header,
  10613. }
  10614. }
  10615. if err != nil {
  10616. return nil, err
  10617. }
  10618. defer googleapi.CloseBody(res)
  10619. if err := googleapi.CheckResponse(res); err != nil {
  10620. return nil, err
  10621. }
  10622. ret := &GoogleCloudDialogflowV2beta1Context{
  10623. ServerResponse: googleapi.ServerResponse{
  10624. Header: res.Header,
  10625. HTTPStatusCode: res.StatusCode,
  10626. },
  10627. }
  10628. target := &ret
  10629. if err := gensupport.DecodeResponse(target, res); err != nil {
  10630. return nil, err
  10631. }
  10632. return ret, nil
  10633. // {
  10634. // "description": "Updates the specified context.",
  10635. // "flatPath": "v2beta1/projects/{projectsId}/agent/sessions/{sessionsId}/contexts/{contextsId}",
  10636. // "httpMethod": "PATCH",
  10637. // "id": "dialogflow.projects.agent.sessions.contexts.patch",
  10638. // "parameterOrder": [
  10639. // "name"
  10640. // ],
  10641. // "parameters": {
  10642. // "name": {
  10643. // "description": "Required. The unique identifier of the context. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e/contexts/\u003cContext ID\u003e`,\nor\n`projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment ID\u003e/users/\u003cUser\nID\u003e/sessions/\u003cSession ID\u003e/contexts/\u003cContext ID\u003e`. Note: Environments and\nusers are under construction and will be available soon. The Context ID is\nalways converted to lowercase. If \u003cEnvironment ID\u003e is not specified, we\nassume default 'draft' environment. If \u003cUser ID\u003e is not specified, we\nassume default '-' user.",
  10644. // "location": "path",
  10645. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+/contexts/[^/]+$",
  10646. // "required": true,
  10647. // "type": "string"
  10648. // },
  10649. // "updateMask": {
  10650. // "description": "Optional. The mask to control which fields get updated.",
  10651. // "format": "google-fieldmask",
  10652. // "location": "query",
  10653. // "type": "string"
  10654. // }
  10655. // },
  10656. // "path": "v2beta1/{+name}",
  10657. // "request": {
  10658. // "$ref": "GoogleCloudDialogflowV2beta1Context"
  10659. // },
  10660. // "response": {
  10661. // "$ref": "GoogleCloudDialogflowV2beta1Context"
  10662. // },
  10663. // "scopes": [
  10664. // "https://www.googleapis.com/auth/cloud-platform"
  10665. // ]
  10666. // }
  10667. }
  10668. // method id "dialogflow.projects.agent.sessions.entityTypes.create":
  10669. type ProjectsAgentSessionsEntityTypesCreateCall struct {
  10670. s *Service
  10671. parent string
  10672. googleclouddialogflowv2beta1sessionentitytype *GoogleCloudDialogflowV2beta1SessionEntityType
  10673. urlParams_ gensupport.URLParams
  10674. ctx_ context.Context
  10675. header_ http.Header
  10676. }
  10677. // Create: Creates a session entity type.
  10678. func (r *ProjectsAgentSessionsEntityTypesService) Create(parent string, googleclouddialogflowv2beta1sessionentitytype *GoogleCloudDialogflowV2beta1SessionEntityType) *ProjectsAgentSessionsEntityTypesCreateCall {
  10679. c := &ProjectsAgentSessionsEntityTypesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10680. c.parent = parent
  10681. c.googleclouddialogflowv2beta1sessionentitytype = googleclouddialogflowv2beta1sessionentitytype
  10682. return c
  10683. }
  10684. // Fields allows partial responses to be retrieved. See
  10685. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10686. // for more information.
  10687. func (c *ProjectsAgentSessionsEntityTypesCreateCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsEntityTypesCreateCall {
  10688. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10689. return c
  10690. }
  10691. // Context sets the context to be used in this call's Do method. Any
  10692. // pending HTTP request will be aborted if the provided context is
  10693. // canceled.
  10694. func (c *ProjectsAgentSessionsEntityTypesCreateCall) Context(ctx context.Context) *ProjectsAgentSessionsEntityTypesCreateCall {
  10695. c.ctx_ = ctx
  10696. return c
  10697. }
  10698. // Header returns an http.Header that can be modified by the caller to
  10699. // add HTTP headers to the request.
  10700. func (c *ProjectsAgentSessionsEntityTypesCreateCall) Header() http.Header {
  10701. if c.header_ == nil {
  10702. c.header_ = make(http.Header)
  10703. }
  10704. return c.header_
  10705. }
  10706. func (c *ProjectsAgentSessionsEntityTypesCreateCall) doRequest(alt string) (*http.Response, error) {
  10707. reqHeaders := make(http.Header)
  10708. for k, v := range c.header_ {
  10709. reqHeaders[k] = v
  10710. }
  10711. reqHeaders.Set("User-Agent", c.s.userAgent())
  10712. var body io.Reader = nil
  10713. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1sessionentitytype)
  10714. if err != nil {
  10715. return nil, err
  10716. }
  10717. reqHeaders.Set("Content-Type", "application/json")
  10718. c.urlParams_.Set("alt", alt)
  10719. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/entityTypes")
  10720. urls += "?" + c.urlParams_.Encode()
  10721. req, _ := http.NewRequest("POST", urls, body)
  10722. req.Header = reqHeaders
  10723. googleapi.Expand(req.URL, map[string]string{
  10724. "parent": c.parent,
  10725. })
  10726. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10727. }
  10728. // Do executes the "dialogflow.projects.agent.sessions.entityTypes.create" call.
  10729. // Exactly one of *GoogleCloudDialogflowV2beta1SessionEntityType or
  10730. // error will be non-nil. Any non-2xx status code is an error. Response
  10731. // headers are in either
  10732. // *GoogleCloudDialogflowV2beta1SessionEntityType.ServerResponse.Header
  10733. // or (if a response was returned at all) in
  10734. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  10735. // whether the returned error was because http.StatusNotModified was
  10736. // returned.
  10737. func (c *ProjectsAgentSessionsEntityTypesCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1SessionEntityType, error) {
  10738. gensupport.SetOptions(c.urlParams_, opts...)
  10739. res, err := c.doRequest("json")
  10740. if res != nil && res.StatusCode == http.StatusNotModified {
  10741. if res.Body != nil {
  10742. res.Body.Close()
  10743. }
  10744. return nil, &googleapi.Error{
  10745. Code: res.StatusCode,
  10746. Header: res.Header,
  10747. }
  10748. }
  10749. if err != nil {
  10750. return nil, err
  10751. }
  10752. defer googleapi.CloseBody(res)
  10753. if err := googleapi.CheckResponse(res); err != nil {
  10754. return nil, err
  10755. }
  10756. ret := &GoogleCloudDialogflowV2beta1SessionEntityType{
  10757. ServerResponse: googleapi.ServerResponse{
  10758. Header: res.Header,
  10759. HTTPStatusCode: res.StatusCode,
  10760. },
  10761. }
  10762. target := &ret
  10763. if err := gensupport.DecodeResponse(target, res); err != nil {
  10764. return nil, err
  10765. }
  10766. return ret, nil
  10767. // {
  10768. // "description": "Creates a session entity type.",
  10769. // "flatPath": "v2beta1/projects/{projectsId}/agent/sessions/{sessionsId}/entityTypes",
  10770. // "httpMethod": "POST",
  10771. // "id": "dialogflow.projects.agent.sessions.entityTypes.create",
  10772. // "parameterOrder": [
  10773. // "parent"
  10774. // ],
  10775. // "parameters": {
  10776. // "parent": {
  10777. // "description": "Required. The session to create a session entity type for.\nFormat: `projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e` or\n`projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment ID\u003e/users/\u003cUser ID\u003e/\nsessions/\u003cSession ID\u003e`.\nNote: Environments and users are under construction and will be available\nsoon. If \u003cEnvironment ID\u003e is not specified, we assume default 'draft'\nenvironment. If \u003cUser ID\u003e is not specified, we assume default '-' user.",
  10778. // "location": "path",
  10779. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+$",
  10780. // "required": true,
  10781. // "type": "string"
  10782. // }
  10783. // },
  10784. // "path": "v2beta1/{+parent}/entityTypes",
  10785. // "request": {
  10786. // "$ref": "GoogleCloudDialogflowV2beta1SessionEntityType"
  10787. // },
  10788. // "response": {
  10789. // "$ref": "GoogleCloudDialogflowV2beta1SessionEntityType"
  10790. // },
  10791. // "scopes": [
  10792. // "https://www.googleapis.com/auth/cloud-platform"
  10793. // ]
  10794. // }
  10795. }
  10796. // method id "dialogflow.projects.agent.sessions.entityTypes.delete":
  10797. type ProjectsAgentSessionsEntityTypesDeleteCall struct {
  10798. s *Service
  10799. name string
  10800. urlParams_ gensupport.URLParams
  10801. ctx_ context.Context
  10802. header_ http.Header
  10803. }
  10804. // Delete: Deletes the specified session entity type.
  10805. func (r *ProjectsAgentSessionsEntityTypesService) Delete(name string) *ProjectsAgentSessionsEntityTypesDeleteCall {
  10806. c := &ProjectsAgentSessionsEntityTypesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10807. c.name = name
  10808. return c
  10809. }
  10810. // Fields allows partial responses to be retrieved. See
  10811. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10812. // for more information.
  10813. func (c *ProjectsAgentSessionsEntityTypesDeleteCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsEntityTypesDeleteCall {
  10814. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10815. return c
  10816. }
  10817. // Context sets the context to be used in this call's Do method. Any
  10818. // pending HTTP request will be aborted if the provided context is
  10819. // canceled.
  10820. func (c *ProjectsAgentSessionsEntityTypesDeleteCall) Context(ctx context.Context) *ProjectsAgentSessionsEntityTypesDeleteCall {
  10821. c.ctx_ = ctx
  10822. return c
  10823. }
  10824. // Header returns an http.Header that can be modified by the caller to
  10825. // add HTTP headers to the request.
  10826. func (c *ProjectsAgentSessionsEntityTypesDeleteCall) Header() http.Header {
  10827. if c.header_ == nil {
  10828. c.header_ = make(http.Header)
  10829. }
  10830. return c.header_
  10831. }
  10832. func (c *ProjectsAgentSessionsEntityTypesDeleteCall) doRequest(alt string) (*http.Response, error) {
  10833. reqHeaders := make(http.Header)
  10834. for k, v := range c.header_ {
  10835. reqHeaders[k] = v
  10836. }
  10837. reqHeaders.Set("User-Agent", c.s.userAgent())
  10838. var body io.Reader = nil
  10839. c.urlParams_.Set("alt", alt)
  10840. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  10841. urls += "?" + c.urlParams_.Encode()
  10842. req, _ := http.NewRequest("DELETE", urls, body)
  10843. req.Header = reqHeaders
  10844. googleapi.Expand(req.URL, map[string]string{
  10845. "name": c.name,
  10846. })
  10847. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10848. }
  10849. // Do executes the "dialogflow.projects.agent.sessions.entityTypes.delete" call.
  10850. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  10851. // non-2xx status code is an error. Response headers are in either
  10852. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  10853. // returned at all) in error.(*googleapi.Error).Header. Use
  10854. // googleapi.IsNotModified to check whether the returned error was
  10855. // because http.StatusNotModified was returned.
  10856. func (c *ProjectsAgentSessionsEntityTypesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  10857. gensupport.SetOptions(c.urlParams_, opts...)
  10858. res, err := c.doRequest("json")
  10859. if res != nil && res.StatusCode == http.StatusNotModified {
  10860. if res.Body != nil {
  10861. res.Body.Close()
  10862. }
  10863. return nil, &googleapi.Error{
  10864. Code: res.StatusCode,
  10865. Header: res.Header,
  10866. }
  10867. }
  10868. if err != nil {
  10869. return nil, err
  10870. }
  10871. defer googleapi.CloseBody(res)
  10872. if err := googleapi.CheckResponse(res); err != nil {
  10873. return nil, err
  10874. }
  10875. ret := &GoogleProtobufEmpty{
  10876. ServerResponse: googleapi.ServerResponse{
  10877. Header: res.Header,
  10878. HTTPStatusCode: res.StatusCode,
  10879. },
  10880. }
  10881. target := &ret
  10882. if err := gensupport.DecodeResponse(target, res); err != nil {
  10883. return nil, err
  10884. }
  10885. return ret, nil
  10886. // {
  10887. // "description": "Deletes the specified session entity type.",
  10888. // "flatPath": "v2beta1/projects/{projectsId}/agent/sessions/{sessionsId}/entityTypes/{entityTypesId}",
  10889. // "httpMethod": "DELETE",
  10890. // "id": "dialogflow.projects.agent.sessions.entityTypes.delete",
  10891. // "parameterOrder": [
  10892. // "name"
  10893. // ],
  10894. // "parameters": {
  10895. // "name": {
  10896. // "description": "Required. The name of the entity type to delete. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e/entityTypes/\u003cEntity Type\nDisplay Name\u003e` or `projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment\nID\u003e/users/\u003cUser ID\u003e/sessions/\u003cSession ID\u003e/entityTypes/\u003cEntity Type Display\nName\u003e`.\nNote: Environments and users are under construction and will be available\nsoon. If \u003cEnvironment ID\u003e is not specified, we assume default 'draft'\nenvironment. If \u003cUser ID\u003e is not specified, we assume default '-' user.",
  10897. // "location": "path",
  10898. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+/entityTypes/[^/]+$",
  10899. // "required": true,
  10900. // "type": "string"
  10901. // }
  10902. // },
  10903. // "path": "v2beta1/{+name}",
  10904. // "response": {
  10905. // "$ref": "GoogleProtobufEmpty"
  10906. // },
  10907. // "scopes": [
  10908. // "https://www.googleapis.com/auth/cloud-platform"
  10909. // ]
  10910. // }
  10911. }
  10912. // method id "dialogflow.projects.agent.sessions.entityTypes.get":
  10913. type ProjectsAgentSessionsEntityTypesGetCall struct {
  10914. s *Service
  10915. name string
  10916. urlParams_ gensupport.URLParams
  10917. ifNoneMatch_ string
  10918. ctx_ context.Context
  10919. header_ http.Header
  10920. }
  10921. // Get: Retrieves the specified session entity type.
  10922. func (r *ProjectsAgentSessionsEntityTypesService) Get(name string) *ProjectsAgentSessionsEntityTypesGetCall {
  10923. c := &ProjectsAgentSessionsEntityTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10924. c.name = name
  10925. return c
  10926. }
  10927. // Fields allows partial responses to be retrieved. See
  10928. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10929. // for more information.
  10930. func (c *ProjectsAgentSessionsEntityTypesGetCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsEntityTypesGetCall {
  10931. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10932. return c
  10933. }
  10934. // IfNoneMatch sets the optional parameter which makes the operation
  10935. // fail if the object's ETag matches the given value. This is useful for
  10936. // getting updates only after the object has changed since the last
  10937. // request. Use googleapi.IsNotModified to check whether the response
  10938. // error from Do is the result of In-None-Match.
  10939. func (c *ProjectsAgentSessionsEntityTypesGetCall) IfNoneMatch(entityTag string) *ProjectsAgentSessionsEntityTypesGetCall {
  10940. c.ifNoneMatch_ = entityTag
  10941. return c
  10942. }
  10943. // Context sets the context to be used in this call's Do method. Any
  10944. // pending HTTP request will be aborted if the provided context is
  10945. // canceled.
  10946. func (c *ProjectsAgentSessionsEntityTypesGetCall) Context(ctx context.Context) *ProjectsAgentSessionsEntityTypesGetCall {
  10947. c.ctx_ = ctx
  10948. return c
  10949. }
  10950. // Header returns an http.Header that can be modified by the caller to
  10951. // add HTTP headers to the request.
  10952. func (c *ProjectsAgentSessionsEntityTypesGetCall) Header() http.Header {
  10953. if c.header_ == nil {
  10954. c.header_ = make(http.Header)
  10955. }
  10956. return c.header_
  10957. }
  10958. func (c *ProjectsAgentSessionsEntityTypesGetCall) doRequest(alt string) (*http.Response, error) {
  10959. reqHeaders := make(http.Header)
  10960. for k, v := range c.header_ {
  10961. reqHeaders[k] = v
  10962. }
  10963. reqHeaders.Set("User-Agent", c.s.userAgent())
  10964. if c.ifNoneMatch_ != "" {
  10965. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10966. }
  10967. var body io.Reader = nil
  10968. c.urlParams_.Set("alt", alt)
  10969. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  10970. urls += "?" + c.urlParams_.Encode()
  10971. req, _ := http.NewRequest("GET", urls, body)
  10972. req.Header = reqHeaders
  10973. googleapi.Expand(req.URL, map[string]string{
  10974. "name": c.name,
  10975. })
  10976. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10977. }
  10978. // Do executes the "dialogflow.projects.agent.sessions.entityTypes.get" call.
  10979. // Exactly one of *GoogleCloudDialogflowV2beta1SessionEntityType or
  10980. // error will be non-nil. Any non-2xx status code is an error. Response
  10981. // headers are in either
  10982. // *GoogleCloudDialogflowV2beta1SessionEntityType.ServerResponse.Header
  10983. // or (if a response was returned at all) in
  10984. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  10985. // whether the returned error was because http.StatusNotModified was
  10986. // returned.
  10987. func (c *ProjectsAgentSessionsEntityTypesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1SessionEntityType, error) {
  10988. gensupport.SetOptions(c.urlParams_, opts...)
  10989. res, err := c.doRequest("json")
  10990. if res != nil && res.StatusCode == http.StatusNotModified {
  10991. if res.Body != nil {
  10992. res.Body.Close()
  10993. }
  10994. return nil, &googleapi.Error{
  10995. Code: res.StatusCode,
  10996. Header: res.Header,
  10997. }
  10998. }
  10999. if err != nil {
  11000. return nil, err
  11001. }
  11002. defer googleapi.CloseBody(res)
  11003. if err := googleapi.CheckResponse(res); err != nil {
  11004. return nil, err
  11005. }
  11006. ret := &GoogleCloudDialogflowV2beta1SessionEntityType{
  11007. ServerResponse: googleapi.ServerResponse{
  11008. Header: res.Header,
  11009. HTTPStatusCode: res.StatusCode,
  11010. },
  11011. }
  11012. target := &ret
  11013. if err := gensupport.DecodeResponse(target, res); err != nil {
  11014. return nil, err
  11015. }
  11016. return ret, nil
  11017. // {
  11018. // "description": "Retrieves the specified session entity type.",
  11019. // "flatPath": "v2beta1/projects/{projectsId}/agent/sessions/{sessionsId}/entityTypes/{entityTypesId}",
  11020. // "httpMethod": "GET",
  11021. // "id": "dialogflow.projects.agent.sessions.entityTypes.get",
  11022. // "parameterOrder": [
  11023. // "name"
  11024. // ],
  11025. // "parameters": {
  11026. // "name": {
  11027. // "description": "Required. The name of the session entity type. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e/entityTypes/\u003cEntity Type\nDisplay Name\u003e` or `projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment\nID\u003e/users/\u003cUser ID\u003e/sessions/\u003cSession ID\u003e/\nentityTypes/\u003cEntity Type Display Name\u003e`.\nNote: Environments and users re under construction and will be available\nsoon. If \u003cEnvironment ID\u003e is not specified, we assume default 'draft'\nenvironment. If \u003cUser ID\u003e is not specified, we assume default '-' user.",
  11028. // "location": "path",
  11029. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+/entityTypes/[^/]+$",
  11030. // "required": true,
  11031. // "type": "string"
  11032. // }
  11033. // },
  11034. // "path": "v2beta1/{+name}",
  11035. // "response": {
  11036. // "$ref": "GoogleCloudDialogflowV2beta1SessionEntityType"
  11037. // },
  11038. // "scopes": [
  11039. // "https://www.googleapis.com/auth/cloud-platform"
  11040. // ]
  11041. // }
  11042. }
  11043. // method id "dialogflow.projects.agent.sessions.entityTypes.list":
  11044. type ProjectsAgentSessionsEntityTypesListCall struct {
  11045. s *Service
  11046. parent string
  11047. urlParams_ gensupport.URLParams
  11048. ifNoneMatch_ string
  11049. ctx_ context.Context
  11050. header_ http.Header
  11051. }
  11052. // List: Returns the list of all session entity types in the specified
  11053. // session.
  11054. func (r *ProjectsAgentSessionsEntityTypesService) List(parent string) *ProjectsAgentSessionsEntityTypesListCall {
  11055. c := &ProjectsAgentSessionsEntityTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11056. c.parent = parent
  11057. return c
  11058. }
  11059. // PageSize sets the optional parameter "pageSize": The maximum number
  11060. // of items to return in a single page. By
  11061. // default 100 and at most 1000.
  11062. func (c *ProjectsAgentSessionsEntityTypesListCall) PageSize(pageSize int64) *ProjectsAgentSessionsEntityTypesListCall {
  11063. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  11064. return c
  11065. }
  11066. // PageToken sets the optional parameter "pageToken": The
  11067. // next_page_token value returned from a previous list request.
  11068. func (c *ProjectsAgentSessionsEntityTypesListCall) PageToken(pageToken string) *ProjectsAgentSessionsEntityTypesListCall {
  11069. c.urlParams_.Set("pageToken", pageToken)
  11070. return c
  11071. }
  11072. // Fields allows partial responses to be retrieved. See
  11073. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11074. // for more information.
  11075. func (c *ProjectsAgentSessionsEntityTypesListCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsEntityTypesListCall {
  11076. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11077. return c
  11078. }
  11079. // IfNoneMatch sets the optional parameter which makes the operation
  11080. // fail if the object's ETag matches the given value. This is useful for
  11081. // getting updates only after the object has changed since the last
  11082. // request. Use googleapi.IsNotModified to check whether the response
  11083. // error from Do is the result of In-None-Match.
  11084. func (c *ProjectsAgentSessionsEntityTypesListCall) IfNoneMatch(entityTag string) *ProjectsAgentSessionsEntityTypesListCall {
  11085. c.ifNoneMatch_ = entityTag
  11086. return c
  11087. }
  11088. // Context sets the context to be used in this call's Do method. Any
  11089. // pending HTTP request will be aborted if the provided context is
  11090. // canceled.
  11091. func (c *ProjectsAgentSessionsEntityTypesListCall) Context(ctx context.Context) *ProjectsAgentSessionsEntityTypesListCall {
  11092. c.ctx_ = ctx
  11093. return c
  11094. }
  11095. // Header returns an http.Header that can be modified by the caller to
  11096. // add HTTP headers to the request.
  11097. func (c *ProjectsAgentSessionsEntityTypesListCall) Header() http.Header {
  11098. if c.header_ == nil {
  11099. c.header_ = make(http.Header)
  11100. }
  11101. return c.header_
  11102. }
  11103. func (c *ProjectsAgentSessionsEntityTypesListCall) doRequest(alt string) (*http.Response, error) {
  11104. reqHeaders := make(http.Header)
  11105. for k, v := range c.header_ {
  11106. reqHeaders[k] = v
  11107. }
  11108. reqHeaders.Set("User-Agent", c.s.userAgent())
  11109. if c.ifNoneMatch_ != "" {
  11110. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11111. }
  11112. var body io.Reader = nil
  11113. c.urlParams_.Set("alt", alt)
  11114. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/entityTypes")
  11115. urls += "?" + c.urlParams_.Encode()
  11116. req, _ := http.NewRequest("GET", urls, body)
  11117. req.Header = reqHeaders
  11118. googleapi.Expand(req.URL, map[string]string{
  11119. "parent": c.parent,
  11120. })
  11121. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11122. }
  11123. // Do executes the "dialogflow.projects.agent.sessions.entityTypes.list" call.
  11124. // Exactly one of
  11125. // *GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse or error
  11126. // will be non-nil. Any non-2xx status code is an error. Response
  11127. // headers are in either
  11128. // *GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse.ServerResp
  11129. // onse.Header or (if a response was returned at all) in
  11130. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  11131. // whether the returned error was because http.StatusNotModified was
  11132. // returned.
  11133. func (c *ProjectsAgentSessionsEntityTypesListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse, error) {
  11134. gensupport.SetOptions(c.urlParams_, opts...)
  11135. res, err := c.doRequest("json")
  11136. if res != nil && res.StatusCode == http.StatusNotModified {
  11137. if res.Body != nil {
  11138. res.Body.Close()
  11139. }
  11140. return nil, &googleapi.Error{
  11141. Code: res.StatusCode,
  11142. Header: res.Header,
  11143. }
  11144. }
  11145. if err != nil {
  11146. return nil, err
  11147. }
  11148. defer googleapi.CloseBody(res)
  11149. if err := googleapi.CheckResponse(res); err != nil {
  11150. return nil, err
  11151. }
  11152. ret := &GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse{
  11153. ServerResponse: googleapi.ServerResponse{
  11154. Header: res.Header,
  11155. HTTPStatusCode: res.StatusCode,
  11156. },
  11157. }
  11158. target := &ret
  11159. if err := gensupport.DecodeResponse(target, res); err != nil {
  11160. return nil, err
  11161. }
  11162. return ret, nil
  11163. // {
  11164. // "description": "Returns the list of all session entity types in the specified session.",
  11165. // "flatPath": "v2beta1/projects/{projectsId}/agent/sessions/{sessionsId}/entityTypes",
  11166. // "httpMethod": "GET",
  11167. // "id": "dialogflow.projects.agent.sessions.entityTypes.list",
  11168. // "parameterOrder": [
  11169. // "parent"
  11170. // ],
  11171. // "parameters": {
  11172. // "pageSize": {
  11173. // "description": "Optional. The maximum number of items to return in a single page. By\ndefault 100 and at most 1000.",
  11174. // "format": "int32",
  11175. // "location": "query",
  11176. // "type": "integer"
  11177. // },
  11178. // "pageToken": {
  11179. // "description": "Optional. The next_page_token value returned from a previous list request.",
  11180. // "location": "query",
  11181. // "type": "string"
  11182. // },
  11183. // "parent": {
  11184. // "description": "Required. The session to list all session entity types from.\nFormat: `projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e` or\n`projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment ID\u003e/users/\u003cUser ID\u003e/\nsessions/\u003cSession ID\u003e`.\nNote: Environments and users are under construction and will be available\nsoon. If \u003cEnvironment ID\u003e is not specified, we assume default 'draft'\nenvironment. If \u003cUser ID\u003e is not specified, we assume default '-' user.",
  11185. // "location": "path",
  11186. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+$",
  11187. // "required": true,
  11188. // "type": "string"
  11189. // }
  11190. // },
  11191. // "path": "v2beta1/{+parent}/entityTypes",
  11192. // "response": {
  11193. // "$ref": "GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse"
  11194. // },
  11195. // "scopes": [
  11196. // "https://www.googleapis.com/auth/cloud-platform"
  11197. // ]
  11198. // }
  11199. }
  11200. // Pages invokes f for each page of results.
  11201. // A non-nil error returned from f will halt the iteration.
  11202. // The provided context supersedes any context provided to the Context method.
  11203. func (c *ProjectsAgentSessionsEntityTypesListCall) Pages(ctx context.Context, f func(*GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse) error) error {
  11204. c.ctx_ = ctx
  11205. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  11206. for {
  11207. x, err := c.Do()
  11208. if err != nil {
  11209. return err
  11210. }
  11211. if err := f(x); err != nil {
  11212. return err
  11213. }
  11214. if x.NextPageToken == "" {
  11215. return nil
  11216. }
  11217. c.PageToken(x.NextPageToken)
  11218. }
  11219. }
  11220. // method id "dialogflow.projects.agent.sessions.entityTypes.patch":
  11221. type ProjectsAgentSessionsEntityTypesPatchCall struct {
  11222. s *Service
  11223. nameid string
  11224. googleclouddialogflowv2beta1sessionentitytype *GoogleCloudDialogflowV2beta1SessionEntityType
  11225. urlParams_ gensupport.URLParams
  11226. ctx_ context.Context
  11227. header_ http.Header
  11228. }
  11229. // Patch: Updates the specified session entity type.
  11230. func (r *ProjectsAgentSessionsEntityTypesService) Patch(nameid string, googleclouddialogflowv2beta1sessionentitytype *GoogleCloudDialogflowV2beta1SessionEntityType) *ProjectsAgentSessionsEntityTypesPatchCall {
  11231. c := &ProjectsAgentSessionsEntityTypesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11232. c.nameid = nameid
  11233. c.googleclouddialogflowv2beta1sessionentitytype = googleclouddialogflowv2beta1sessionentitytype
  11234. return c
  11235. }
  11236. // UpdateMask sets the optional parameter "updateMask": The mask to
  11237. // control which fields get updated.
  11238. func (c *ProjectsAgentSessionsEntityTypesPatchCall) UpdateMask(updateMask string) *ProjectsAgentSessionsEntityTypesPatchCall {
  11239. c.urlParams_.Set("updateMask", updateMask)
  11240. return c
  11241. }
  11242. // Fields allows partial responses to be retrieved. See
  11243. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11244. // for more information.
  11245. func (c *ProjectsAgentSessionsEntityTypesPatchCall) Fields(s ...googleapi.Field) *ProjectsAgentSessionsEntityTypesPatchCall {
  11246. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11247. return c
  11248. }
  11249. // Context sets the context to be used in this call's Do method. Any
  11250. // pending HTTP request will be aborted if the provided context is
  11251. // canceled.
  11252. func (c *ProjectsAgentSessionsEntityTypesPatchCall) Context(ctx context.Context) *ProjectsAgentSessionsEntityTypesPatchCall {
  11253. c.ctx_ = ctx
  11254. return c
  11255. }
  11256. // Header returns an http.Header that can be modified by the caller to
  11257. // add HTTP headers to the request.
  11258. func (c *ProjectsAgentSessionsEntityTypesPatchCall) Header() http.Header {
  11259. if c.header_ == nil {
  11260. c.header_ = make(http.Header)
  11261. }
  11262. return c.header_
  11263. }
  11264. func (c *ProjectsAgentSessionsEntityTypesPatchCall) doRequest(alt string) (*http.Response, error) {
  11265. reqHeaders := make(http.Header)
  11266. for k, v := range c.header_ {
  11267. reqHeaders[k] = v
  11268. }
  11269. reqHeaders.Set("User-Agent", c.s.userAgent())
  11270. var body io.Reader = nil
  11271. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddialogflowv2beta1sessionentitytype)
  11272. if err != nil {
  11273. return nil, err
  11274. }
  11275. reqHeaders.Set("Content-Type", "application/json")
  11276. c.urlParams_.Set("alt", alt)
  11277. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  11278. urls += "?" + c.urlParams_.Encode()
  11279. req, _ := http.NewRequest("PATCH", urls, body)
  11280. req.Header = reqHeaders
  11281. googleapi.Expand(req.URL, map[string]string{
  11282. "name": c.nameid,
  11283. })
  11284. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11285. }
  11286. // Do executes the "dialogflow.projects.agent.sessions.entityTypes.patch" call.
  11287. // Exactly one of *GoogleCloudDialogflowV2beta1SessionEntityType or
  11288. // error will be non-nil. Any non-2xx status code is an error. Response
  11289. // headers are in either
  11290. // *GoogleCloudDialogflowV2beta1SessionEntityType.ServerResponse.Header
  11291. // or (if a response was returned at all) in
  11292. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  11293. // whether the returned error was because http.StatusNotModified was
  11294. // returned.
  11295. func (c *ProjectsAgentSessionsEntityTypesPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDialogflowV2beta1SessionEntityType, error) {
  11296. gensupport.SetOptions(c.urlParams_, opts...)
  11297. res, err := c.doRequest("json")
  11298. if res != nil && res.StatusCode == http.StatusNotModified {
  11299. if res.Body != nil {
  11300. res.Body.Close()
  11301. }
  11302. return nil, &googleapi.Error{
  11303. Code: res.StatusCode,
  11304. Header: res.Header,
  11305. }
  11306. }
  11307. if err != nil {
  11308. return nil, err
  11309. }
  11310. defer googleapi.CloseBody(res)
  11311. if err := googleapi.CheckResponse(res); err != nil {
  11312. return nil, err
  11313. }
  11314. ret := &GoogleCloudDialogflowV2beta1SessionEntityType{
  11315. ServerResponse: googleapi.ServerResponse{
  11316. Header: res.Header,
  11317. HTTPStatusCode: res.StatusCode,
  11318. },
  11319. }
  11320. target := &ret
  11321. if err := gensupport.DecodeResponse(target, res); err != nil {
  11322. return nil, err
  11323. }
  11324. return ret, nil
  11325. // {
  11326. // "description": "Updates the specified session entity type.",
  11327. // "flatPath": "v2beta1/projects/{projectsId}/agent/sessions/{sessionsId}/entityTypes/{entityTypesId}",
  11328. // "httpMethod": "PATCH",
  11329. // "id": "dialogflow.projects.agent.sessions.entityTypes.patch",
  11330. // "parameterOrder": [
  11331. // "name"
  11332. // ],
  11333. // "parameters": {
  11334. // "name": {
  11335. // "description": "Required. The unique identifier of this session entity type. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e/entityTypes/\u003cEntity Type\nDisplay Name\u003e`, or\n`projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment ID\u003e/users/\u003cUser\nID\u003e/sessions\n/\u003cSession ID\u003e/entityTypes/\u003cEntity Type Display Name\u003e`.\nNote: Environments and users are under construction and will be available\nsoon. If \u003cEnvironment ID\u003e is not specified, we assume default 'draft'\nenvironment. If \u003cUser ID\u003e is not specified, we assume default '-' user.",
  11336. // "location": "path",
  11337. // "pattern": "^projects/[^/]+/agent/sessions/[^/]+/entityTypes/[^/]+$",
  11338. // "required": true,
  11339. // "type": "string"
  11340. // },
  11341. // "updateMask": {
  11342. // "description": "Optional. The mask to control which fields get updated.",
  11343. // "format": "google-fieldmask",
  11344. // "location": "query",
  11345. // "type": "string"
  11346. // }
  11347. // },
  11348. // "path": "v2beta1/{+name}",
  11349. // "request": {
  11350. // "$ref": "GoogleCloudDialogflowV2beta1SessionEntityType"
  11351. // },
  11352. // "response": {
  11353. // "$ref": "GoogleCloudDialogflowV2beta1SessionEntityType"
  11354. // },
  11355. // "scopes": [
  11356. // "https://www.googleapis.com/auth/cloud-platform"
  11357. // ]
  11358. // }
  11359. }
  11360. // method id "dialogflow.projects.operations.get":
  11361. type ProjectsOperationsGetCall struct {
  11362. s *Service
  11363. name string
  11364. urlParams_ gensupport.URLParams
  11365. ifNoneMatch_ string
  11366. ctx_ context.Context
  11367. header_ http.Header
  11368. }
  11369. // Get: Gets the latest state of a long-running operation. Clients can
  11370. // use this
  11371. // method to poll the operation result at intervals as recommended by
  11372. // the API
  11373. // service.
  11374. func (r *ProjectsOperationsService) Get(name string) *ProjectsOperationsGetCall {
  11375. c := &ProjectsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11376. c.name = name
  11377. return c
  11378. }
  11379. // Fields allows partial responses to be retrieved. See
  11380. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11381. // for more information.
  11382. func (c *ProjectsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsOperationsGetCall {
  11383. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11384. return c
  11385. }
  11386. // IfNoneMatch sets the optional parameter which makes the operation
  11387. // fail if the object's ETag matches the given value. This is useful for
  11388. // getting updates only after the object has changed since the last
  11389. // request. Use googleapi.IsNotModified to check whether the response
  11390. // error from Do is the result of In-None-Match.
  11391. func (c *ProjectsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsOperationsGetCall {
  11392. c.ifNoneMatch_ = entityTag
  11393. return c
  11394. }
  11395. // Context sets the context to be used in this call's Do method. Any
  11396. // pending HTTP request will be aborted if the provided context is
  11397. // canceled.
  11398. func (c *ProjectsOperationsGetCall) Context(ctx context.Context) *ProjectsOperationsGetCall {
  11399. c.ctx_ = ctx
  11400. return c
  11401. }
  11402. // Header returns an http.Header that can be modified by the caller to
  11403. // add HTTP headers to the request.
  11404. func (c *ProjectsOperationsGetCall) Header() http.Header {
  11405. if c.header_ == nil {
  11406. c.header_ = make(http.Header)
  11407. }
  11408. return c.header_
  11409. }
  11410. func (c *ProjectsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  11411. reqHeaders := make(http.Header)
  11412. for k, v := range c.header_ {
  11413. reqHeaders[k] = v
  11414. }
  11415. reqHeaders.Set("User-Agent", c.s.userAgent())
  11416. if c.ifNoneMatch_ != "" {
  11417. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11418. }
  11419. var body io.Reader = nil
  11420. c.urlParams_.Set("alt", alt)
  11421. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  11422. urls += "?" + c.urlParams_.Encode()
  11423. req, _ := http.NewRequest("GET", urls, body)
  11424. req.Header = reqHeaders
  11425. googleapi.Expand(req.URL, map[string]string{
  11426. "name": c.name,
  11427. })
  11428. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11429. }
  11430. // Do executes the "dialogflow.projects.operations.get" call.
  11431. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  11432. // Any non-2xx status code is an error. Response headers are in either
  11433. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  11434. // was returned at all) in error.(*googleapi.Error).Header. Use
  11435. // googleapi.IsNotModified to check whether the returned error was
  11436. // because http.StatusNotModified was returned.
  11437. func (c *ProjectsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  11438. gensupport.SetOptions(c.urlParams_, opts...)
  11439. res, err := c.doRequest("json")
  11440. if res != nil && res.StatusCode == http.StatusNotModified {
  11441. if res.Body != nil {
  11442. res.Body.Close()
  11443. }
  11444. return nil, &googleapi.Error{
  11445. Code: res.StatusCode,
  11446. Header: res.Header,
  11447. }
  11448. }
  11449. if err != nil {
  11450. return nil, err
  11451. }
  11452. defer googleapi.CloseBody(res)
  11453. if err := googleapi.CheckResponse(res); err != nil {
  11454. return nil, err
  11455. }
  11456. ret := &GoogleLongrunningOperation{
  11457. ServerResponse: googleapi.ServerResponse{
  11458. Header: res.Header,
  11459. HTTPStatusCode: res.StatusCode,
  11460. },
  11461. }
  11462. target := &ret
  11463. if err := gensupport.DecodeResponse(target, res); err != nil {
  11464. return nil, err
  11465. }
  11466. return ret, nil
  11467. // {
  11468. // "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.",
  11469. // "flatPath": "v2beta1/projects/{projectsId}/operations/{operationsId}",
  11470. // "httpMethod": "GET",
  11471. // "id": "dialogflow.projects.operations.get",
  11472. // "parameterOrder": [
  11473. // "name"
  11474. // ],
  11475. // "parameters": {
  11476. // "name": {
  11477. // "description": "The name of the operation resource.",
  11478. // "location": "path",
  11479. // "pattern": "^projects/[^/]+/operations/[^/]+$",
  11480. // "required": true,
  11481. // "type": "string"
  11482. // }
  11483. // },
  11484. // "path": "v2beta1/{+name}",
  11485. // "response": {
  11486. // "$ref": "GoogleLongrunningOperation"
  11487. // },
  11488. // "scopes": [
  11489. // "https://www.googleapis.com/auth/cloud-platform"
  11490. // ]
  11491. // }
  11492. }