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.
 
 
 

746 lines
30 KiB

  1. // Code generated by protoc-gen-go. DO NOT EDIT.
  2. // source: google/cloud/dialogflow/v2/context.proto
  3. package dialogflow // import "google.golang.org/genproto/googleapis/cloud/dialogflow/v2"
  4. import proto "github.com/golang/protobuf/proto"
  5. import fmt "fmt"
  6. import math "math"
  7. import empty "github.com/golang/protobuf/ptypes/empty"
  8. import _struct "github.com/golang/protobuf/ptypes/struct"
  9. import _ "google.golang.org/genproto/googleapis/api/annotations"
  10. import field_mask "google.golang.org/genproto/protobuf/field_mask"
  11. import (
  12. context "golang.org/x/net/context"
  13. grpc "google.golang.org/grpc"
  14. )
  15. // Reference imports to suppress errors if they are not otherwise used.
  16. var _ = proto.Marshal
  17. var _ = fmt.Errorf
  18. var _ = math.Inf
  19. // This is a compile-time assertion to ensure that this generated file
  20. // is compatible with the proto package it is being compiled against.
  21. // A compilation error at this line likely means your copy of the
  22. // proto package needs to be updated.
  23. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
  24. // Represents a context.
  25. type Context struct {
  26. // Required. The unique identifier of the context. Format:
  27. // `projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context ID>`.
  28. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
  29. // Optional. The number of conversational query requests after which the
  30. // context expires. If set to `0` (the default) the context expires
  31. // immediately. Contexts expire automatically after 10 minutes even if there
  32. // are no matching queries.
  33. LifespanCount int32 `protobuf:"varint,2,opt,name=lifespan_count,json=lifespanCount,proto3" json:"lifespan_count,omitempty"`
  34. // Optional. The collection of parameters associated with this context.
  35. // Refer to [this doc](https://dialogflow.com/docs/actions-and-parameters) for
  36. // syntax.
  37. Parameters *_struct.Struct `protobuf:"bytes,3,opt,name=parameters,proto3" json:"parameters,omitempty"`
  38. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  39. XXX_unrecognized []byte `json:"-"`
  40. XXX_sizecache int32 `json:"-"`
  41. }
  42. func (m *Context) Reset() { *m = Context{} }
  43. func (m *Context) String() string { return proto.CompactTextString(m) }
  44. func (*Context) ProtoMessage() {}
  45. func (*Context) Descriptor() ([]byte, []int) {
  46. return fileDescriptor_context_ec983148ff22c385, []int{0}
  47. }
  48. func (m *Context) XXX_Unmarshal(b []byte) error {
  49. return xxx_messageInfo_Context.Unmarshal(m, b)
  50. }
  51. func (m *Context) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  52. return xxx_messageInfo_Context.Marshal(b, m, deterministic)
  53. }
  54. func (dst *Context) XXX_Merge(src proto.Message) {
  55. xxx_messageInfo_Context.Merge(dst, src)
  56. }
  57. func (m *Context) XXX_Size() int {
  58. return xxx_messageInfo_Context.Size(m)
  59. }
  60. func (m *Context) XXX_DiscardUnknown() {
  61. xxx_messageInfo_Context.DiscardUnknown(m)
  62. }
  63. var xxx_messageInfo_Context proto.InternalMessageInfo
  64. func (m *Context) GetName() string {
  65. if m != nil {
  66. return m.Name
  67. }
  68. return ""
  69. }
  70. func (m *Context) GetLifespanCount() int32 {
  71. if m != nil {
  72. return m.LifespanCount
  73. }
  74. return 0
  75. }
  76. func (m *Context) GetParameters() *_struct.Struct {
  77. if m != nil {
  78. return m.Parameters
  79. }
  80. return nil
  81. }
  82. // The request message for
  83. // [Contexts.ListContexts][google.cloud.dialogflow.v2.Contexts.ListContexts].
  84. type ListContextsRequest struct {
  85. // Required. The session to list all contexts from.
  86. // Format: `projects/<Project ID>/agent/sessions/<Session ID>`.
  87. Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
  88. // Optional. The maximum number of items to return in a single page. By
  89. // default 100 and at most 1000.
  90. PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
  91. // Optional. The next_page_token value returned from a previous list request.
  92. PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
  93. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  94. XXX_unrecognized []byte `json:"-"`
  95. XXX_sizecache int32 `json:"-"`
  96. }
  97. func (m *ListContextsRequest) Reset() { *m = ListContextsRequest{} }
  98. func (m *ListContextsRequest) String() string { return proto.CompactTextString(m) }
  99. func (*ListContextsRequest) ProtoMessage() {}
  100. func (*ListContextsRequest) Descriptor() ([]byte, []int) {
  101. return fileDescriptor_context_ec983148ff22c385, []int{1}
  102. }
  103. func (m *ListContextsRequest) XXX_Unmarshal(b []byte) error {
  104. return xxx_messageInfo_ListContextsRequest.Unmarshal(m, b)
  105. }
  106. func (m *ListContextsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  107. return xxx_messageInfo_ListContextsRequest.Marshal(b, m, deterministic)
  108. }
  109. func (dst *ListContextsRequest) XXX_Merge(src proto.Message) {
  110. xxx_messageInfo_ListContextsRequest.Merge(dst, src)
  111. }
  112. func (m *ListContextsRequest) XXX_Size() int {
  113. return xxx_messageInfo_ListContextsRequest.Size(m)
  114. }
  115. func (m *ListContextsRequest) XXX_DiscardUnknown() {
  116. xxx_messageInfo_ListContextsRequest.DiscardUnknown(m)
  117. }
  118. var xxx_messageInfo_ListContextsRequest proto.InternalMessageInfo
  119. func (m *ListContextsRequest) GetParent() string {
  120. if m != nil {
  121. return m.Parent
  122. }
  123. return ""
  124. }
  125. func (m *ListContextsRequest) GetPageSize() int32 {
  126. if m != nil {
  127. return m.PageSize
  128. }
  129. return 0
  130. }
  131. func (m *ListContextsRequest) GetPageToken() string {
  132. if m != nil {
  133. return m.PageToken
  134. }
  135. return ""
  136. }
  137. // The response message for
  138. // [Contexts.ListContexts][google.cloud.dialogflow.v2.Contexts.ListContexts].
  139. type ListContextsResponse struct {
  140. // The list of contexts. There will be a maximum number of items
  141. // returned based on the page_size field in the request.
  142. Contexts []*Context `protobuf:"bytes,1,rep,name=contexts,proto3" json:"contexts,omitempty"`
  143. // Token to retrieve the next page of results, or empty if there are no
  144. // more results in the list.
  145. NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
  146. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  147. XXX_unrecognized []byte `json:"-"`
  148. XXX_sizecache int32 `json:"-"`
  149. }
  150. func (m *ListContextsResponse) Reset() { *m = ListContextsResponse{} }
  151. func (m *ListContextsResponse) String() string { return proto.CompactTextString(m) }
  152. func (*ListContextsResponse) ProtoMessage() {}
  153. func (*ListContextsResponse) Descriptor() ([]byte, []int) {
  154. return fileDescriptor_context_ec983148ff22c385, []int{2}
  155. }
  156. func (m *ListContextsResponse) XXX_Unmarshal(b []byte) error {
  157. return xxx_messageInfo_ListContextsResponse.Unmarshal(m, b)
  158. }
  159. func (m *ListContextsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  160. return xxx_messageInfo_ListContextsResponse.Marshal(b, m, deterministic)
  161. }
  162. func (dst *ListContextsResponse) XXX_Merge(src proto.Message) {
  163. xxx_messageInfo_ListContextsResponse.Merge(dst, src)
  164. }
  165. func (m *ListContextsResponse) XXX_Size() int {
  166. return xxx_messageInfo_ListContextsResponse.Size(m)
  167. }
  168. func (m *ListContextsResponse) XXX_DiscardUnknown() {
  169. xxx_messageInfo_ListContextsResponse.DiscardUnknown(m)
  170. }
  171. var xxx_messageInfo_ListContextsResponse proto.InternalMessageInfo
  172. func (m *ListContextsResponse) GetContexts() []*Context {
  173. if m != nil {
  174. return m.Contexts
  175. }
  176. return nil
  177. }
  178. func (m *ListContextsResponse) GetNextPageToken() string {
  179. if m != nil {
  180. return m.NextPageToken
  181. }
  182. return ""
  183. }
  184. // The request message for
  185. // [Contexts.GetContext][google.cloud.dialogflow.v2.Contexts.GetContext].
  186. type GetContextRequest struct {
  187. // Required. The name of the context. Format:
  188. // `projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context ID>`.
  189. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
  190. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  191. XXX_unrecognized []byte `json:"-"`
  192. XXX_sizecache int32 `json:"-"`
  193. }
  194. func (m *GetContextRequest) Reset() { *m = GetContextRequest{} }
  195. func (m *GetContextRequest) String() string { return proto.CompactTextString(m) }
  196. func (*GetContextRequest) ProtoMessage() {}
  197. func (*GetContextRequest) Descriptor() ([]byte, []int) {
  198. return fileDescriptor_context_ec983148ff22c385, []int{3}
  199. }
  200. func (m *GetContextRequest) XXX_Unmarshal(b []byte) error {
  201. return xxx_messageInfo_GetContextRequest.Unmarshal(m, b)
  202. }
  203. func (m *GetContextRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  204. return xxx_messageInfo_GetContextRequest.Marshal(b, m, deterministic)
  205. }
  206. func (dst *GetContextRequest) XXX_Merge(src proto.Message) {
  207. xxx_messageInfo_GetContextRequest.Merge(dst, src)
  208. }
  209. func (m *GetContextRequest) XXX_Size() int {
  210. return xxx_messageInfo_GetContextRequest.Size(m)
  211. }
  212. func (m *GetContextRequest) XXX_DiscardUnknown() {
  213. xxx_messageInfo_GetContextRequest.DiscardUnknown(m)
  214. }
  215. var xxx_messageInfo_GetContextRequest proto.InternalMessageInfo
  216. func (m *GetContextRequest) GetName() string {
  217. if m != nil {
  218. return m.Name
  219. }
  220. return ""
  221. }
  222. // The request message for
  223. // [Contexts.CreateContext][google.cloud.dialogflow.v2.Contexts.CreateContext].
  224. type CreateContextRequest struct {
  225. // Required. The session to create a context for.
  226. // Format: `projects/<Project ID>/agent/sessions/<Session ID>`.
  227. Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
  228. // Required. The context to create.
  229. Context *Context `protobuf:"bytes,2,opt,name=context,proto3" json:"context,omitempty"`
  230. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  231. XXX_unrecognized []byte `json:"-"`
  232. XXX_sizecache int32 `json:"-"`
  233. }
  234. func (m *CreateContextRequest) Reset() { *m = CreateContextRequest{} }
  235. func (m *CreateContextRequest) String() string { return proto.CompactTextString(m) }
  236. func (*CreateContextRequest) ProtoMessage() {}
  237. func (*CreateContextRequest) Descriptor() ([]byte, []int) {
  238. return fileDescriptor_context_ec983148ff22c385, []int{4}
  239. }
  240. func (m *CreateContextRequest) XXX_Unmarshal(b []byte) error {
  241. return xxx_messageInfo_CreateContextRequest.Unmarshal(m, b)
  242. }
  243. func (m *CreateContextRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  244. return xxx_messageInfo_CreateContextRequest.Marshal(b, m, deterministic)
  245. }
  246. func (dst *CreateContextRequest) XXX_Merge(src proto.Message) {
  247. xxx_messageInfo_CreateContextRequest.Merge(dst, src)
  248. }
  249. func (m *CreateContextRequest) XXX_Size() int {
  250. return xxx_messageInfo_CreateContextRequest.Size(m)
  251. }
  252. func (m *CreateContextRequest) XXX_DiscardUnknown() {
  253. xxx_messageInfo_CreateContextRequest.DiscardUnknown(m)
  254. }
  255. var xxx_messageInfo_CreateContextRequest proto.InternalMessageInfo
  256. func (m *CreateContextRequest) GetParent() string {
  257. if m != nil {
  258. return m.Parent
  259. }
  260. return ""
  261. }
  262. func (m *CreateContextRequest) GetContext() *Context {
  263. if m != nil {
  264. return m.Context
  265. }
  266. return nil
  267. }
  268. // The request message for
  269. // [Contexts.UpdateContext][google.cloud.dialogflow.v2.Contexts.UpdateContext].
  270. type UpdateContextRequest struct {
  271. // Required. The context to update.
  272. Context *Context `protobuf:"bytes,1,opt,name=context,proto3" json:"context,omitempty"`
  273. // Optional. The mask to control which fields get updated.
  274. UpdateMask *field_mask.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`
  275. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  276. XXX_unrecognized []byte `json:"-"`
  277. XXX_sizecache int32 `json:"-"`
  278. }
  279. func (m *UpdateContextRequest) Reset() { *m = UpdateContextRequest{} }
  280. func (m *UpdateContextRequest) String() string { return proto.CompactTextString(m) }
  281. func (*UpdateContextRequest) ProtoMessage() {}
  282. func (*UpdateContextRequest) Descriptor() ([]byte, []int) {
  283. return fileDescriptor_context_ec983148ff22c385, []int{5}
  284. }
  285. func (m *UpdateContextRequest) XXX_Unmarshal(b []byte) error {
  286. return xxx_messageInfo_UpdateContextRequest.Unmarshal(m, b)
  287. }
  288. func (m *UpdateContextRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  289. return xxx_messageInfo_UpdateContextRequest.Marshal(b, m, deterministic)
  290. }
  291. func (dst *UpdateContextRequest) XXX_Merge(src proto.Message) {
  292. xxx_messageInfo_UpdateContextRequest.Merge(dst, src)
  293. }
  294. func (m *UpdateContextRequest) XXX_Size() int {
  295. return xxx_messageInfo_UpdateContextRequest.Size(m)
  296. }
  297. func (m *UpdateContextRequest) XXX_DiscardUnknown() {
  298. xxx_messageInfo_UpdateContextRequest.DiscardUnknown(m)
  299. }
  300. var xxx_messageInfo_UpdateContextRequest proto.InternalMessageInfo
  301. func (m *UpdateContextRequest) GetContext() *Context {
  302. if m != nil {
  303. return m.Context
  304. }
  305. return nil
  306. }
  307. func (m *UpdateContextRequest) GetUpdateMask() *field_mask.FieldMask {
  308. if m != nil {
  309. return m.UpdateMask
  310. }
  311. return nil
  312. }
  313. // The request message for
  314. // [Contexts.DeleteContext][google.cloud.dialogflow.v2.Contexts.DeleteContext].
  315. type DeleteContextRequest struct {
  316. // Required. The name of the context to delete. Format:
  317. // `projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context ID>`.
  318. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
  319. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  320. XXX_unrecognized []byte `json:"-"`
  321. XXX_sizecache int32 `json:"-"`
  322. }
  323. func (m *DeleteContextRequest) Reset() { *m = DeleteContextRequest{} }
  324. func (m *DeleteContextRequest) String() string { return proto.CompactTextString(m) }
  325. func (*DeleteContextRequest) ProtoMessage() {}
  326. func (*DeleteContextRequest) Descriptor() ([]byte, []int) {
  327. return fileDescriptor_context_ec983148ff22c385, []int{6}
  328. }
  329. func (m *DeleteContextRequest) XXX_Unmarshal(b []byte) error {
  330. return xxx_messageInfo_DeleteContextRequest.Unmarshal(m, b)
  331. }
  332. func (m *DeleteContextRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  333. return xxx_messageInfo_DeleteContextRequest.Marshal(b, m, deterministic)
  334. }
  335. func (dst *DeleteContextRequest) XXX_Merge(src proto.Message) {
  336. xxx_messageInfo_DeleteContextRequest.Merge(dst, src)
  337. }
  338. func (m *DeleteContextRequest) XXX_Size() int {
  339. return xxx_messageInfo_DeleteContextRequest.Size(m)
  340. }
  341. func (m *DeleteContextRequest) XXX_DiscardUnknown() {
  342. xxx_messageInfo_DeleteContextRequest.DiscardUnknown(m)
  343. }
  344. var xxx_messageInfo_DeleteContextRequest proto.InternalMessageInfo
  345. func (m *DeleteContextRequest) GetName() string {
  346. if m != nil {
  347. return m.Name
  348. }
  349. return ""
  350. }
  351. // The request message for
  352. // [Contexts.DeleteAllContexts][google.cloud.dialogflow.v2.Contexts.DeleteAllContexts].
  353. type DeleteAllContextsRequest struct {
  354. // Required. The name of the session to delete all contexts from. Format:
  355. // `projects/<Project ID>/agent/sessions/<Session ID>`.
  356. Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
  357. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  358. XXX_unrecognized []byte `json:"-"`
  359. XXX_sizecache int32 `json:"-"`
  360. }
  361. func (m *DeleteAllContextsRequest) Reset() { *m = DeleteAllContextsRequest{} }
  362. func (m *DeleteAllContextsRequest) String() string { return proto.CompactTextString(m) }
  363. func (*DeleteAllContextsRequest) ProtoMessage() {}
  364. func (*DeleteAllContextsRequest) Descriptor() ([]byte, []int) {
  365. return fileDescriptor_context_ec983148ff22c385, []int{7}
  366. }
  367. func (m *DeleteAllContextsRequest) XXX_Unmarshal(b []byte) error {
  368. return xxx_messageInfo_DeleteAllContextsRequest.Unmarshal(m, b)
  369. }
  370. func (m *DeleteAllContextsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  371. return xxx_messageInfo_DeleteAllContextsRequest.Marshal(b, m, deterministic)
  372. }
  373. func (dst *DeleteAllContextsRequest) XXX_Merge(src proto.Message) {
  374. xxx_messageInfo_DeleteAllContextsRequest.Merge(dst, src)
  375. }
  376. func (m *DeleteAllContextsRequest) XXX_Size() int {
  377. return xxx_messageInfo_DeleteAllContextsRequest.Size(m)
  378. }
  379. func (m *DeleteAllContextsRequest) XXX_DiscardUnknown() {
  380. xxx_messageInfo_DeleteAllContextsRequest.DiscardUnknown(m)
  381. }
  382. var xxx_messageInfo_DeleteAllContextsRequest proto.InternalMessageInfo
  383. func (m *DeleteAllContextsRequest) GetParent() string {
  384. if m != nil {
  385. return m.Parent
  386. }
  387. return ""
  388. }
  389. func init() {
  390. proto.RegisterType((*Context)(nil), "google.cloud.dialogflow.v2.Context")
  391. proto.RegisterType((*ListContextsRequest)(nil), "google.cloud.dialogflow.v2.ListContextsRequest")
  392. proto.RegisterType((*ListContextsResponse)(nil), "google.cloud.dialogflow.v2.ListContextsResponse")
  393. proto.RegisterType((*GetContextRequest)(nil), "google.cloud.dialogflow.v2.GetContextRequest")
  394. proto.RegisterType((*CreateContextRequest)(nil), "google.cloud.dialogflow.v2.CreateContextRequest")
  395. proto.RegisterType((*UpdateContextRequest)(nil), "google.cloud.dialogflow.v2.UpdateContextRequest")
  396. proto.RegisterType((*DeleteContextRequest)(nil), "google.cloud.dialogflow.v2.DeleteContextRequest")
  397. proto.RegisterType((*DeleteAllContextsRequest)(nil), "google.cloud.dialogflow.v2.DeleteAllContextsRequest")
  398. }
  399. // Reference imports to suppress errors if they are not otherwise used.
  400. var _ context.Context
  401. var _ grpc.ClientConn
  402. // This is a compile-time assertion to ensure that this generated file
  403. // is compatible with the grpc package it is being compiled against.
  404. const _ = grpc.SupportPackageIsVersion4
  405. // ContextsClient is the client API for Contexts service.
  406. //
  407. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
  408. type ContextsClient interface {
  409. // Returns the list of all contexts in the specified session.
  410. ListContexts(ctx context.Context, in *ListContextsRequest, opts ...grpc.CallOption) (*ListContextsResponse, error)
  411. // Retrieves the specified context.
  412. GetContext(ctx context.Context, in *GetContextRequest, opts ...grpc.CallOption) (*Context, error)
  413. // Creates a context.
  414. CreateContext(ctx context.Context, in *CreateContextRequest, opts ...grpc.CallOption) (*Context, error)
  415. // Updates the specified context.
  416. UpdateContext(ctx context.Context, in *UpdateContextRequest, opts ...grpc.CallOption) (*Context, error)
  417. // Deletes the specified context.
  418. DeleteContext(ctx context.Context, in *DeleteContextRequest, opts ...grpc.CallOption) (*empty.Empty, error)
  419. // Deletes all active contexts in the specified session.
  420. DeleteAllContexts(ctx context.Context, in *DeleteAllContextsRequest, opts ...grpc.CallOption) (*empty.Empty, error)
  421. }
  422. type contextsClient struct {
  423. cc *grpc.ClientConn
  424. }
  425. func NewContextsClient(cc *grpc.ClientConn) ContextsClient {
  426. return &contextsClient{cc}
  427. }
  428. func (c *contextsClient) ListContexts(ctx context.Context, in *ListContextsRequest, opts ...grpc.CallOption) (*ListContextsResponse, error) {
  429. out := new(ListContextsResponse)
  430. err := c.cc.Invoke(ctx, "/google.cloud.dialogflow.v2.Contexts/ListContexts", in, out, opts...)
  431. if err != nil {
  432. return nil, err
  433. }
  434. return out, nil
  435. }
  436. func (c *contextsClient) GetContext(ctx context.Context, in *GetContextRequest, opts ...grpc.CallOption) (*Context, error) {
  437. out := new(Context)
  438. err := c.cc.Invoke(ctx, "/google.cloud.dialogflow.v2.Contexts/GetContext", in, out, opts...)
  439. if err != nil {
  440. return nil, err
  441. }
  442. return out, nil
  443. }
  444. func (c *contextsClient) CreateContext(ctx context.Context, in *CreateContextRequest, opts ...grpc.CallOption) (*Context, error) {
  445. out := new(Context)
  446. err := c.cc.Invoke(ctx, "/google.cloud.dialogflow.v2.Contexts/CreateContext", in, out, opts...)
  447. if err != nil {
  448. return nil, err
  449. }
  450. return out, nil
  451. }
  452. func (c *contextsClient) UpdateContext(ctx context.Context, in *UpdateContextRequest, opts ...grpc.CallOption) (*Context, error) {
  453. out := new(Context)
  454. err := c.cc.Invoke(ctx, "/google.cloud.dialogflow.v2.Contexts/UpdateContext", in, out, opts...)
  455. if err != nil {
  456. return nil, err
  457. }
  458. return out, nil
  459. }
  460. func (c *contextsClient) DeleteContext(ctx context.Context, in *DeleteContextRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
  461. out := new(empty.Empty)
  462. err := c.cc.Invoke(ctx, "/google.cloud.dialogflow.v2.Contexts/DeleteContext", in, out, opts...)
  463. if err != nil {
  464. return nil, err
  465. }
  466. return out, nil
  467. }
  468. func (c *contextsClient) DeleteAllContexts(ctx context.Context, in *DeleteAllContextsRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
  469. out := new(empty.Empty)
  470. err := c.cc.Invoke(ctx, "/google.cloud.dialogflow.v2.Contexts/DeleteAllContexts", in, out, opts...)
  471. if err != nil {
  472. return nil, err
  473. }
  474. return out, nil
  475. }
  476. // ContextsServer is the server API for Contexts service.
  477. type ContextsServer interface {
  478. // Returns the list of all contexts in the specified session.
  479. ListContexts(context.Context, *ListContextsRequest) (*ListContextsResponse, error)
  480. // Retrieves the specified context.
  481. GetContext(context.Context, *GetContextRequest) (*Context, error)
  482. // Creates a context.
  483. CreateContext(context.Context, *CreateContextRequest) (*Context, error)
  484. // Updates the specified context.
  485. UpdateContext(context.Context, *UpdateContextRequest) (*Context, error)
  486. // Deletes the specified context.
  487. DeleteContext(context.Context, *DeleteContextRequest) (*empty.Empty, error)
  488. // Deletes all active contexts in the specified session.
  489. DeleteAllContexts(context.Context, *DeleteAllContextsRequest) (*empty.Empty, error)
  490. }
  491. func RegisterContextsServer(s *grpc.Server, srv ContextsServer) {
  492. s.RegisterService(&_Contexts_serviceDesc, srv)
  493. }
  494. func _Contexts_ListContexts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  495. in := new(ListContextsRequest)
  496. if err := dec(in); err != nil {
  497. return nil, err
  498. }
  499. if interceptor == nil {
  500. return srv.(ContextsServer).ListContexts(ctx, in)
  501. }
  502. info := &grpc.UnaryServerInfo{
  503. Server: srv,
  504. FullMethod: "/google.cloud.dialogflow.v2.Contexts/ListContexts",
  505. }
  506. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  507. return srv.(ContextsServer).ListContexts(ctx, req.(*ListContextsRequest))
  508. }
  509. return interceptor(ctx, in, info, handler)
  510. }
  511. func _Contexts_GetContext_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  512. in := new(GetContextRequest)
  513. if err := dec(in); err != nil {
  514. return nil, err
  515. }
  516. if interceptor == nil {
  517. return srv.(ContextsServer).GetContext(ctx, in)
  518. }
  519. info := &grpc.UnaryServerInfo{
  520. Server: srv,
  521. FullMethod: "/google.cloud.dialogflow.v2.Contexts/GetContext",
  522. }
  523. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  524. return srv.(ContextsServer).GetContext(ctx, req.(*GetContextRequest))
  525. }
  526. return interceptor(ctx, in, info, handler)
  527. }
  528. func _Contexts_CreateContext_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  529. in := new(CreateContextRequest)
  530. if err := dec(in); err != nil {
  531. return nil, err
  532. }
  533. if interceptor == nil {
  534. return srv.(ContextsServer).CreateContext(ctx, in)
  535. }
  536. info := &grpc.UnaryServerInfo{
  537. Server: srv,
  538. FullMethod: "/google.cloud.dialogflow.v2.Contexts/CreateContext",
  539. }
  540. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  541. return srv.(ContextsServer).CreateContext(ctx, req.(*CreateContextRequest))
  542. }
  543. return interceptor(ctx, in, info, handler)
  544. }
  545. func _Contexts_UpdateContext_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  546. in := new(UpdateContextRequest)
  547. if err := dec(in); err != nil {
  548. return nil, err
  549. }
  550. if interceptor == nil {
  551. return srv.(ContextsServer).UpdateContext(ctx, in)
  552. }
  553. info := &grpc.UnaryServerInfo{
  554. Server: srv,
  555. FullMethod: "/google.cloud.dialogflow.v2.Contexts/UpdateContext",
  556. }
  557. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  558. return srv.(ContextsServer).UpdateContext(ctx, req.(*UpdateContextRequest))
  559. }
  560. return interceptor(ctx, in, info, handler)
  561. }
  562. func _Contexts_DeleteContext_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  563. in := new(DeleteContextRequest)
  564. if err := dec(in); err != nil {
  565. return nil, err
  566. }
  567. if interceptor == nil {
  568. return srv.(ContextsServer).DeleteContext(ctx, in)
  569. }
  570. info := &grpc.UnaryServerInfo{
  571. Server: srv,
  572. FullMethod: "/google.cloud.dialogflow.v2.Contexts/DeleteContext",
  573. }
  574. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  575. return srv.(ContextsServer).DeleteContext(ctx, req.(*DeleteContextRequest))
  576. }
  577. return interceptor(ctx, in, info, handler)
  578. }
  579. func _Contexts_DeleteAllContexts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  580. in := new(DeleteAllContextsRequest)
  581. if err := dec(in); err != nil {
  582. return nil, err
  583. }
  584. if interceptor == nil {
  585. return srv.(ContextsServer).DeleteAllContexts(ctx, in)
  586. }
  587. info := &grpc.UnaryServerInfo{
  588. Server: srv,
  589. FullMethod: "/google.cloud.dialogflow.v2.Contexts/DeleteAllContexts",
  590. }
  591. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  592. return srv.(ContextsServer).DeleteAllContexts(ctx, req.(*DeleteAllContextsRequest))
  593. }
  594. return interceptor(ctx, in, info, handler)
  595. }
  596. var _Contexts_serviceDesc = grpc.ServiceDesc{
  597. ServiceName: "google.cloud.dialogflow.v2.Contexts",
  598. HandlerType: (*ContextsServer)(nil),
  599. Methods: []grpc.MethodDesc{
  600. {
  601. MethodName: "ListContexts",
  602. Handler: _Contexts_ListContexts_Handler,
  603. },
  604. {
  605. MethodName: "GetContext",
  606. Handler: _Contexts_GetContext_Handler,
  607. },
  608. {
  609. MethodName: "CreateContext",
  610. Handler: _Contexts_CreateContext_Handler,
  611. },
  612. {
  613. MethodName: "UpdateContext",
  614. Handler: _Contexts_UpdateContext_Handler,
  615. },
  616. {
  617. MethodName: "DeleteContext",
  618. Handler: _Contexts_DeleteContext_Handler,
  619. },
  620. {
  621. MethodName: "DeleteAllContexts",
  622. Handler: _Contexts_DeleteAllContexts_Handler,
  623. },
  624. },
  625. Streams: []grpc.StreamDesc{},
  626. Metadata: "google/cloud/dialogflow/v2/context.proto",
  627. }
  628. func init() {
  629. proto.RegisterFile("google/cloud/dialogflow/v2/context.proto", fileDescriptor_context_ec983148ff22c385)
  630. }
  631. var fileDescriptor_context_ec983148ff22c385 = []byte{
  632. // 715 bytes of a gzipped FileDescriptorProto
  633. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x95, 0x4f, 0x6f, 0xd3, 0x30,
  634. 0x18, 0xc6, 0xe5, 0x0e, 0xf6, 0xe7, 0xdd, 0x0a, 0x9a, 0xa9, 0x46, 0x95, 0x0d, 0x54, 0x05, 0x01,
  635. 0x55, 0x25, 0x62, 0xc8, 0x90, 0xd0, 0x18, 0x13, 0x62, 0x2d, 0x9b, 0x84, 0x40, 0x9a, 0x3a, 0xe0,
  636. 0xc0, 0xa5, 0xf2, 0x5a, 0x37, 0x0a, 0x4b, 0xe3, 0x10, 0xbb, 0x63, 0x0c, 0x4d, 0x48, 0x7c, 0x04,
  637. 0xe0, 0x36, 0x4e, 0x1c, 0x27, 0x4e, 0x7c, 0x15, 0xbe, 0x02, 0x77, 0xae, 0x1c, 0x51, 0x1c, 0xa7,
  638. 0xff, 0x57, 0x52, 0x6e, 0x89, 0xfd, 0xd8, 0xcf, 0xcf, 0xaf, 0x9f, 0x37, 0x81, 0xa2, 0xc3, 0xb9,
  639. 0xe3, 0x31, 0x52, 0xf7, 0x78, 0xbb, 0x41, 0x1a, 0x2e, 0xf5, 0xb8, 0xd3, 0xf4, 0xf8, 0x5b, 0x72,
  640. 0x60, 0x93, 0x3a, 0xf7, 0x25, 0x3b, 0x94, 0x56, 0x10, 0x72, 0xc9, 0xb1, 0x11, 0x2b, 0x2d, 0xa5,
  641. 0xb4, 0xba, 0x4a, 0xeb, 0xc0, 0x36, 0x56, 0xf4, 0x2e, 0x34, 0x70, 0x09, 0xf5, 0x7d, 0x2e, 0xa9,
  642. 0x74, 0xb9, 0x2f, 0xe2, 0x95, 0xc6, 0xb2, 0x9e, 0x55, 0x6f, 0x7b, 0xed, 0x26, 0x61, 0xad, 0x40,
  643. 0xbe, 0xd3, 0x93, 0x85, 0xc1, 0xc9, 0xa6, 0xcb, 0xbc, 0x46, 0xad, 0x45, 0xc5, 0xbe, 0x56, 0xac,
  644. 0x0c, 0x2a, 0x84, 0x0c, 0xdb, 0x75, 0x8d, 0x65, 0x1e, 0xc3, 0x4c, 0x39, 0xe6, 0xc4, 0x18, 0xce,
  645. 0xf9, 0xb4, 0xc5, 0xf2, 0xa8, 0x80, 0x8a, 0x73, 0x55, 0xf5, 0x8c, 0xaf, 0xc3, 0x05, 0xcf, 0x6d,
  646. 0x32, 0x11, 0x50, 0xbf, 0x56, 0xe7, 0x6d, 0x5f, 0xe6, 0x33, 0x05, 0x54, 0x3c, 0x5f, 0xcd, 0x26,
  647. 0xa3, 0xe5, 0x68, 0x10, 0xdf, 0x03, 0x08, 0x68, 0x48, 0x5b, 0x4c, 0xb2, 0x50, 0xe4, 0xa7, 0x0a,
  648. 0xa8, 0x38, 0x6f, 0x5f, 0xb6, 0xf4, 0x89, 0x13, 0x63, 0x6b, 0x57, 0x19, 0x57, 0x7b, 0xa4, 0xa6,
  649. 0x0b, 0x97, 0x9e, 0xba, 0x42, 0x6a, 0x04, 0x51, 0x65, 0x6f, 0xda, 0x4c, 0x48, 0xbc, 0x04, 0xd3,
  650. 0x01, 0x0d, 0x99, 0x2f, 0x35, 0x8c, 0x7e, 0xc3, 0xcb, 0x30, 0x17, 0x50, 0x87, 0xd5, 0x84, 0x7b,
  651. 0xc4, 0x34, 0xc9, 0x6c, 0x34, 0xb0, 0xeb, 0x1e, 0x31, 0x7c, 0x25, 0x82, 0x70, 0x58, 0x4d, 0xf2,
  652. 0x7d, 0xe6, 0x2b, 0x88, 0xb9, 0xaa, 0x92, 0x3f, 0x8f, 0x06, 0xcc, 0x0f, 0x90, 0xeb, 0xb7, 0x12,
  653. 0x01, 0xf7, 0x05, 0xc3, 0x0f, 0x61, 0x56, 0xdf, 0x94, 0xc8, 0xa3, 0xc2, 0x54, 0x71, 0xde, 0xbe,
  654. 0x66, 0x9d, 0x7d, 0x57, 0x96, 0x5e, 0x5f, 0xed, 0x2c, 0xc2, 0x37, 0xe0, 0xa2, 0xcf, 0x0e, 0x65,
  655. 0xad, 0xc7, 0x3c, 0xa3, 0xcc, 0xb3, 0xd1, 0xf0, 0x4e, 0x07, 0xe0, 0x26, 0x2c, 0x6e, 0xb3, 0xc4,
  656. 0x3f, 0x39, 0xe9, 0x88, 0xa2, 0x9b, 0x2d, 0xc8, 0x95, 0x43, 0x46, 0x25, 0x1b, 0xd0, 0x9e, 0x55,
  657. 0x95, 0x0d, 0x98, 0xd1, 0x30, 0xca, 0x38, 0xe5, 0x01, 0x92, 0x35, 0xe6, 0x27, 0x04, 0xb9, 0x17,
  658. 0x41, 0x63, 0xd8, 0xaf, 0x67, 0x5f, 0x34, 0xf9, 0xbe, 0x78, 0x1d, 0xe6, 0xdb, 0x6a, 0x5b, 0x95,
  659. 0x46, 0x8d, 0x66, 0x0c, 0xa5, 0x62, 0x2b, 0x0a, 0xec, 0x33, 0x2a, 0xf6, 0xab, 0x10, 0xcb, 0xa3,
  660. 0x67, 0xb3, 0x04, 0xb9, 0x0a, 0xf3, 0xd8, 0x10, 0xd3, 0xa8, 0x7a, 0xd9, 0x90, 0x8f, 0xb5, 0x8f,
  661. 0x3c, 0x2f, 0x65, 0x92, 0xec, 0xdf, 0x33, 0x30, 0x9b, 0x68, 0xf1, 0x77, 0x04, 0x0b, 0xbd, 0xd9,
  662. 0xc0, 0x64, 0xdc, 0x41, 0x47, 0x04, 0xd6, 0xb8, 0x9d, 0x7e, 0x41, 0x1c, 0x3b, 0x73, 0xed, 0xe3,
  663. 0xcf, 0x5f, 0x9f, 0x33, 0xab, 0xf8, 0x4e, 0xf4, 0xa9, 0x78, 0x1f, 0x53, 0x6d, 0x04, 0x21, 0x7f,
  664. 0xcd, 0xea, 0x52, 0x90, 0x12, 0xa1, 0x0e, 0xf3, 0x25, 0x11, 0x4c, 0x88, 0xe8, 0x53, 0x40, 0x4a,
  665. 0xc7, 0xa4, 0x13, 0xb8, 0x13, 0x04, 0xd0, 0x4d, 0x12, 0xbe, 0x35, 0xce, 0x7b, 0x28, 0x71, 0x46,
  666. 0x9a, 0x4b, 0x1c, 0xa0, 0x8b, 0xaa, 0x3c, 0x8e, 0xad, 0x83, 0x46, 0x4a, 0xc7, 0xf8, 0x14, 0x41,
  667. 0xb6, 0x2f, 0xbe, 0x78, 0x6c, 0x71, 0x46, 0x25, 0x3d, 0x1d, 0xe3, 0xa6, 0x62, 0x7c, 0x60, 0x4e,
  668. 0x5e, 0xc1, 0xfb, 0x9d, 0x8c, 0xfe, 0x40, 0x90, 0xed, 0xcb, 0xfe, 0x78, 0xd8, 0x51, 0x6d, 0x92,
  669. 0x0e, 0xf6, 0x89, 0x82, 0xad, 0xd8, 0x6b, 0x0a, 0x36, 0xf9, 0x35, 0x4c, 0x52, 0xd8, 0x2e, 0xf4,
  670. 0x17, 0x04, 0xd9, 0xbe, 0xe6, 0x18, 0x0f, 0x3d, 0xaa, 0x8f, 0x8c, 0xa5, 0xa1, 0x3e, 0x7c, 0x1c,
  671. 0xfd, 0x55, 0x92, 0x8b, 0x2f, 0xfd, 0xc7, 0xc5, 0x7f, 0x45, 0xb0, 0x38, 0xd4, 0x87, 0xf8, 0xee,
  672. 0xbf, 0xd1, 0x86, 0xdb, 0x36, 0x25, 0xde, 0x24, 0x77, 0xbe, 0x79, 0x82, 0xe0, 0x6a, 0x9d, 0xb7,
  673. 0xc6, 0xe0, 0x6c, 0x2e, 0x68, 0x8c, 0x9d, 0xc8, 0x74, 0x07, 0xbd, 0xaa, 0x68, 0xad, 0xc3, 0x3d,
  674. 0xea, 0x3b, 0x16, 0x0f, 0x1d, 0xe2, 0x30, 0x5f, 0x21, 0x91, 0x78, 0x8a, 0x06, 0xae, 0x18, 0xf5,
  675. 0xf3, 0x5f, 0xef, 0xbe, 0xfd, 0x41, 0xe8, 0x5b, 0x26, 0x53, 0xd9, 0x3a, 0xcd, 0x18, 0xdb, 0xf1,
  676. 0x76, 0x65, 0x65, 0x5d, 0xe9, 0x5a, 0xbf, 0xb4, 0xf7, 0xa6, 0xd5, 0xae, 0xab, 0x7f, 0x03, 0x00,
  677. 0x00, 0xff, 0xff, 0xb8, 0xb1, 0x2f, 0xbf, 0x51, 0x08, 0x00, 0x00,
  678. }