1// Code generated by protoc-gen-go. DO NOT EDIT.
2// source: google/firebase/fcm/connection/v1alpha1/connection_api.proto
3
4package connection
5
6import (
7	context "context"
8	fmt "fmt"
9	math "math"
10
11	proto "github.com/golang/protobuf/proto"
12	timestamp "github.com/golang/protobuf/ptypes/timestamp"
13	_ "google.golang.org/genproto/googleapis/api/annotations"
14	grpc "google.golang.org/grpc"
15	codes "google.golang.org/grpc/codes"
16	status "google.golang.org/grpc/status"
17)
18
19// Reference imports to suppress errors if they are not otherwise used.
20var _ = proto.Marshal
21var _ = fmt.Errorf
22var _ = math.Inf
23
24// This is a compile-time assertion to ensure that this generated file
25// is compatible with the proto package it is being compiled against.
26// A compilation error at this line likely means your copy of the
27// proto package needs to be updated.
28const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
29
30// Request sent to FCM from the connected client.
31type UpstreamRequest struct {
32	// The type of request the client is making to FCM.
33	//
34	// Types that are valid to be assigned to RequestType:
35	//	*UpstreamRequest_Ack
36	RequestType          isUpstreamRequest_RequestType `protobuf_oneof:"request_type"`
37	XXX_NoUnkeyedLiteral struct{}                      `json:"-"`
38	XXX_unrecognized     []byte                        `json:"-"`
39	XXX_sizecache        int32                         `json:"-"`
40}
41
42func (m *UpstreamRequest) Reset()         { *m = UpstreamRequest{} }
43func (m *UpstreamRequest) String() string { return proto.CompactTextString(m) }
44func (*UpstreamRequest) ProtoMessage()    {}
45func (*UpstreamRequest) Descriptor() ([]byte, []int) {
46	return fileDescriptor_9af5e8ec6e2d3436, []int{0}
47}
48
49func (m *UpstreamRequest) XXX_Unmarshal(b []byte) error {
50	return xxx_messageInfo_UpstreamRequest.Unmarshal(m, b)
51}
52func (m *UpstreamRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
53	return xxx_messageInfo_UpstreamRequest.Marshal(b, m, deterministic)
54}
55func (m *UpstreamRequest) XXX_Merge(src proto.Message) {
56	xxx_messageInfo_UpstreamRequest.Merge(m, src)
57}
58func (m *UpstreamRequest) XXX_Size() int {
59	return xxx_messageInfo_UpstreamRequest.Size(m)
60}
61func (m *UpstreamRequest) XXX_DiscardUnknown() {
62	xxx_messageInfo_UpstreamRequest.DiscardUnknown(m)
63}
64
65var xxx_messageInfo_UpstreamRequest proto.InternalMessageInfo
66
67type isUpstreamRequest_RequestType interface {
68	isUpstreamRequest_RequestType()
69}
70
71type UpstreamRequest_Ack struct {
72	Ack *Ack `protobuf:"bytes,1,opt,name=ack,proto3,oneof"`
73}
74
75func (*UpstreamRequest_Ack) isUpstreamRequest_RequestType() {}
76
77func (m *UpstreamRequest) GetRequestType() isUpstreamRequest_RequestType {
78	if m != nil {
79		return m.RequestType
80	}
81	return nil
82}
83
84func (m *UpstreamRequest) GetAck() *Ack {
85	if x, ok := m.GetRequestType().(*UpstreamRequest_Ack); ok {
86		return x.Ack
87	}
88	return nil
89}
90
91// XXX_OneofWrappers is for the internal use of the proto package.
92func (*UpstreamRequest) XXX_OneofWrappers() []interface{} {
93	return []interface{}{
94		(*UpstreamRequest_Ack)(nil),
95	}
96}
97
98// Response sent to the connected client from FCM.
99type DownstreamResponse struct {
100	// The type of response FCM is sending to the client.
101	//
102	// Types that are valid to be assigned to ResponseType:
103	//	*DownstreamResponse_Message
104	ResponseType         isDownstreamResponse_ResponseType `protobuf_oneof:"response_type"`
105	XXX_NoUnkeyedLiteral struct{}                          `json:"-"`
106	XXX_unrecognized     []byte                            `json:"-"`
107	XXX_sizecache        int32                             `json:"-"`
108}
109
110func (m *DownstreamResponse) Reset()         { *m = DownstreamResponse{} }
111func (m *DownstreamResponse) String() string { return proto.CompactTextString(m) }
112func (*DownstreamResponse) ProtoMessage()    {}
113func (*DownstreamResponse) Descriptor() ([]byte, []int) {
114	return fileDescriptor_9af5e8ec6e2d3436, []int{1}
115}
116
117func (m *DownstreamResponse) XXX_Unmarshal(b []byte) error {
118	return xxx_messageInfo_DownstreamResponse.Unmarshal(m, b)
119}
120func (m *DownstreamResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
121	return xxx_messageInfo_DownstreamResponse.Marshal(b, m, deterministic)
122}
123func (m *DownstreamResponse) XXX_Merge(src proto.Message) {
124	xxx_messageInfo_DownstreamResponse.Merge(m, src)
125}
126func (m *DownstreamResponse) XXX_Size() int {
127	return xxx_messageInfo_DownstreamResponse.Size(m)
128}
129func (m *DownstreamResponse) XXX_DiscardUnknown() {
130	xxx_messageInfo_DownstreamResponse.DiscardUnknown(m)
131}
132
133var xxx_messageInfo_DownstreamResponse proto.InternalMessageInfo
134
135type isDownstreamResponse_ResponseType interface {
136	isDownstreamResponse_ResponseType()
137}
138
139type DownstreamResponse_Message struct {
140	Message *Message `protobuf:"bytes,1,opt,name=message,proto3,oneof"`
141}
142
143func (*DownstreamResponse_Message) isDownstreamResponse_ResponseType() {}
144
145func (m *DownstreamResponse) GetResponseType() isDownstreamResponse_ResponseType {
146	if m != nil {
147		return m.ResponseType
148	}
149	return nil
150}
151
152func (m *DownstreamResponse) GetMessage() *Message {
153	if x, ok := m.GetResponseType().(*DownstreamResponse_Message); ok {
154		return x.Message
155	}
156	return nil
157}
158
159// XXX_OneofWrappers is for the internal use of the proto package.
160func (*DownstreamResponse) XXX_OneofWrappers() []interface{} {
161	return []interface{}{
162		(*DownstreamResponse_Message)(nil),
163	}
164}
165
166// Acknowledgement to indicate a client successfully received an FCM message.
167//
168// If a message is not acked, FCM will continously resend the message until
169// it expires. Duplicate delivery in this case is working as intended.
170type Ack struct {
171	// Id of message being acknowledged
172	MessageId            string   `protobuf:"bytes,1,opt,name=message_id,json=messageId,proto3" json:"message_id,omitempty"`
173	XXX_NoUnkeyedLiteral struct{} `json:"-"`
174	XXX_unrecognized     []byte   `json:"-"`
175	XXX_sizecache        int32    `json:"-"`
176}
177
178func (m *Ack) Reset()         { *m = Ack{} }
179func (m *Ack) String() string { return proto.CompactTextString(m) }
180func (*Ack) ProtoMessage()    {}
181func (*Ack) Descriptor() ([]byte, []int) {
182	return fileDescriptor_9af5e8ec6e2d3436, []int{2}
183}
184
185func (m *Ack) XXX_Unmarshal(b []byte) error {
186	return xxx_messageInfo_Ack.Unmarshal(m, b)
187}
188func (m *Ack) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
189	return xxx_messageInfo_Ack.Marshal(b, m, deterministic)
190}
191func (m *Ack) XXX_Merge(src proto.Message) {
192	xxx_messageInfo_Ack.Merge(m, src)
193}
194func (m *Ack) XXX_Size() int {
195	return xxx_messageInfo_Ack.Size(m)
196}
197func (m *Ack) XXX_DiscardUnknown() {
198	xxx_messageInfo_Ack.DiscardUnknown(m)
199}
200
201var xxx_messageInfo_Ack proto.InternalMessageInfo
202
203func (m *Ack) GetMessageId() string {
204	if m != nil {
205		return m.MessageId
206	}
207	return ""
208}
209
210// Message created through the [Send
211// API](https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#resource-message).
212type Message struct {
213	// The identifier of the message. Used to ack the message.
214	MessageId string `protobuf:"bytes,1,opt,name=message_id,json=messageId,proto3" json:"message_id,omitempty"`
215	// Time the message was received in FCM.
216	CreateTime *timestamp.Timestamp `protobuf:"bytes,2,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
217	// Expiry time of the message. Currently it is always 4 weeks.
218	ExpireTime *timestamp.Timestamp `protobuf:"bytes,3,opt,name=expire_time,json=expireTime,proto3" json:"expire_time,omitempty"`
219	// The arbitrary payload set in the [Send
220	// API](https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#resource-message).
221	Data                 map[string]string `protobuf:"bytes,4,rep,name=data,proto3" json:"data,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
222	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
223	XXX_unrecognized     []byte            `json:"-"`
224	XXX_sizecache        int32             `json:"-"`
225}
226
227func (m *Message) Reset()         { *m = Message{} }
228func (m *Message) String() string { return proto.CompactTextString(m) }
229func (*Message) ProtoMessage()    {}
230func (*Message) Descriptor() ([]byte, []int) {
231	return fileDescriptor_9af5e8ec6e2d3436, []int{3}
232}
233
234func (m *Message) XXX_Unmarshal(b []byte) error {
235	return xxx_messageInfo_Message.Unmarshal(m, b)
236}
237func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
238	return xxx_messageInfo_Message.Marshal(b, m, deterministic)
239}
240func (m *Message) XXX_Merge(src proto.Message) {
241	xxx_messageInfo_Message.Merge(m, src)
242}
243func (m *Message) XXX_Size() int {
244	return xxx_messageInfo_Message.Size(m)
245}
246func (m *Message) XXX_DiscardUnknown() {
247	xxx_messageInfo_Message.DiscardUnknown(m)
248}
249
250var xxx_messageInfo_Message proto.InternalMessageInfo
251
252func (m *Message) GetMessageId() string {
253	if m != nil {
254		return m.MessageId
255	}
256	return ""
257}
258
259func (m *Message) GetCreateTime() *timestamp.Timestamp {
260	if m != nil {
261		return m.CreateTime
262	}
263	return nil
264}
265
266func (m *Message) GetExpireTime() *timestamp.Timestamp {
267	if m != nil {
268		return m.ExpireTime
269	}
270	return nil
271}
272
273func (m *Message) GetData() map[string]string {
274	if m != nil {
275		return m.Data
276	}
277	return nil
278}
279
280func init() {
281	proto.RegisterType((*UpstreamRequest)(nil), "google.firebase.fcm.connection.v1alpha1.UpstreamRequest")
282	proto.RegisterType((*DownstreamResponse)(nil), "google.firebase.fcm.connection.v1alpha1.DownstreamResponse")
283	proto.RegisterType((*Ack)(nil), "google.firebase.fcm.connection.v1alpha1.Ack")
284	proto.RegisterType((*Message)(nil), "google.firebase.fcm.connection.v1alpha1.Message")
285	proto.RegisterMapType((map[string]string)(nil), "google.firebase.fcm.connection.v1alpha1.Message.DataEntry")
286}
287
288func init() {
289	proto.RegisterFile("google/firebase/fcm/connection/v1alpha1/connection_api.proto", fileDescriptor_9af5e8ec6e2d3436)
290}
291
292var fileDescriptor_9af5e8ec6e2d3436 = []byte{
293	// 453 bytes of a gzipped FileDescriptorProto
294	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x93, 0xc1, 0x6e, 0x13, 0x31,
295	0x10, 0x86, 0xb3, 0xd9, 0x42, 0x94, 0x09, 0xa5, 0xc8, 0xe2, 0x10, 0xad, 0x40, 0x54, 0x11, 0x12,
296	0x91, 0x40, 0xde, 0x36, 0x1c, 0xa8, 0x1a, 0x0e, 0x24, 0x14, 0xa9, 0x48, 0x80, 0x60, 0x05, 0x17,
297	0x2e, 0xd1, 0xc4, 0x71, 0x16, 0x2b, 0x59, 0xdb, 0xd8, 0x4e, 0x21, 0x57, 0x0e, 0x3c, 0x03, 0xef,
298	0xc0, 0x4b, 0xa2, 0x5d, 0x7b, 0x5b, 0x04, 0x87, 0x6c, 0x6f, 0xf1, 0xcc, 0xff, 0xfd, 0xff, 0x78,
299	0xe2, 0x85, 0xe7, 0xb9, 0x52, 0xf9, 0x9a, 0xa7, 0x4b, 0x61, 0xf8, 0x1c, 0x2d, 0x4f, 0x97, 0xac,
300	0x48, 0x99, 0x92, 0x92, 0x33, 0x27, 0x94, 0x4c, 0x2f, 0x8e, 0x71, 0xad, 0xbf, 0xe0, 0xf1, 0x5f,
301	0xb5, 0x19, 0x6a, 0x41, 0xb5, 0x51, 0x4e, 0x91, 0x47, 0x9e, 0xa6, 0x35, 0x4d, 0x97, 0xac, 0xa0,
302	0x57, 0x4a, 0x5a, 0xd3, 0xc9, 0xbd, 0x10, 0x83, 0x5a, 0xa4, 0x28, 0xa5, 0x72, 0x58, 0xf6, 0xad,
303	0xb7, 0x49, 0x1e, 0x84, 0x6e, 0x75, 0x9a, 0x6f, 0x96, 0xa9, 0x13, 0x05, 0xb7, 0x0e, 0x0b, 0xed,
304	0x05, 0x03, 0x06, 0x07, 0x9f, 0xb4, 0x75, 0x86, 0x63, 0x91, 0xf1, 0xaf, 0x1b, 0x6e, 0x1d, 0x79,
305	0x01, 0x31, 0xb2, 0x55, 0x3f, 0x3a, 0x8c, 0x86, 0xbd, 0xd1, 0x13, 0xda, 0x70, 0x10, 0x3a, 0x61,
306	0xab,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, 0x16, 0xe4, 0x67, 0x04, 0x9d, 0x50, 0x21, 0x27, 0x8d, 0x07, 0xfb,
318	0xe7, 0xc9, 0x25, 0xe3, 0xc6, 0xe4, 0xff, 0xef, 0x68, 0xd0, 0x1a, 0x46, 0x47, 0xd1, 0xf4, 0x47,
319	0x04, 0x8f, 0x99, 0x2a, 0x9a, 0x1a, 0xbd, 0x8f, 0x3e, 0x7f, 0x08, 0xd2, 0x5c, 0xad, 0x51, 0xe6,
320	0x54, 0x99, 0x3c, 0xcd, 0xb9, 0xac, 0xfe, 0x8a, 0xd4, 0xb7, 0x50, 0x0b, 0xbb, 0xf3, 0xfb, 0x1d,
321	0x5f, 0xd5, 0xe6, 0x37, 0x2b, 0xfa, 0xe9, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe4, 0x30, 0x40,
322	0x1a, 0xfc, 0x03, 0x00, 0x00,
323}
324
325// Reference imports to suppress errors if they are not otherwise used.
326var _ context.Context
327var _ grpc.ClientConnInterface
328
329// This is a compile-time assertion to ensure that this generated file
330// is compatible with the grpc package it is being compiled against.
331const _ = grpc.SupportPackageIsVersion6
332
333// ConnectionApiClient is the client API for ConnectionApi service.
334//
335// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
336type ConnectionApiClient interface {
337	// Creates a streaming connection with FCM to send messages and their
338	// respective ACKs.
339	//
340	// The client credentials need to be passed in the [gRPC
341	// Metadata](https://grpc.io/docs/guides/concepts.html#metadata). The Format
342	// of the header is:
343	//   Key: "authorization"
344	//   Value: "Checkin [client_id:secret]"
345	//
346	//
347	// The project's API key also needs to be sent to authorize the project.
348	// That can be set in the X-Goog-Api-Key Metadata header.
349	Connect(ctx context.Context, opts ...grpc.CallOption) (ConnectionApi_ConnectClient, error)
350}
351
352type connectionApiClient struct {
353	cc grpc.ClientConnInterface
354}
355
356func NewConnectionApiClient(cc grpc.ClientConnInterface) ConnectionApiClient {
357	return &connectionApiClient{cc}
358}
359
360func (c *connectionApiClient) Connect(ctx context.Context, opts ...grpc.CallOption) (ConnectionApi_ConnectClient, error) {
361	stream, err := c.cc.NewStream(ctx, &_ConnectionApi_serviceDesc.Streams[0], "/google.firebase.fcm.connection.v1alpha1.ConnectionApi/Connect", opts...)
362	if err != nil {
363		return nil, err
364	}
365	x := &connectionApiConnectClient{stream}
366	return x, nil
367}
368
369type ConnectionApi_ConnectClient interface {
370	Send(*UpstreamRequest) error
371	Recv() (*DownstreamResponse, error)
372	grpc.ClientStream
373}
374
375type connectionApiConnectClient struct {
376	grpc.ClientStream
377}
378
379func (x *connectionApiConnectClient) Send(m *UpstreamRequest) error {
380	return x.ClientStream.SendMsg(m)
381}
382
383func (x *connectionApiConnectClient) Recv() (*DownstreamResponse, error) {
384	m := new(DownstreamResponse)
385	if err := x.ClientStream.RecvMsg(m); err != nil {
386		return nil, err
387	}
388	return m, nil
389}
390
391// ConnectionApiServer is the server API for ConnectionApi service.
392type ConnectionApiServer interface {
393	// Creates a streaming connection with FCM to send messages and their
394	// respective ACKs.
395	//
396	// The client credentials need to be passed in the [gRPC
397	// Metadata](https://grpc.io/docs/guides/concepts.html#metadata). The Format
398	// of the header is:
399	//   Key: "authorization"
400	//   Value: "Checkin [client_id:secret]"
401	//
402	//
403	// The project's API key also needs to be sent to authorize the project.
404	// That can be set in the X-Goog-Api-Key Metadata header.
405	Connect(ConnectionApi_ConnectServer) error
406}
407
408// UnimplementedConnectionApiServer can be embedded to have forward compatible implementations.
409type UnimplementedConnectionApiServer struct {
410}
411
412func (*UnimplementedConnectionApiServer) Connect(srv ConnectionApi_ConnectServer) error {
413	return status.Errorf(codes.Unimplemented, "method Connect not implemented")
414}
415
416func RegisterConnectionApiServer(s *grpc.Server, srv ConnectionApiServer) {
417	s.RegisterService(&_ConnectionApi_serviceDesc, srv)
418}
419
420func _ConnectionApi_Connect_Handler(srv interface{}, stream grpc.ServerStream) error {
421	return srv.(ConnectionApiServer).Connect(&connectionApiConnectServer{stream})
422}
423
424type ConnectionApi_ConnectServer interface {
425	Send(*DownstreamResponse) error
426	Recv() (*UpstreamRequest, error)
427	grpc.ServerStream
428}
429
430type connectionApiConnectServer struct {
431	grpc.ServerStream
432}
433
434func (x *connectionApiConnectServer) Send(m *DownstreamResponse) error {
435	return x.ServerStream.SendMsg(m)
436}
437
438func (x *connectionApiConnectServer) Recv() (*UpstreamRequest, error) {
439	m := new(UpstreamRequest)
440	if err := x.ServerStream.RecvMsg(m); err != nil {
441		return nil, err
442	}
443	return m, nil
444}
445
446var _ConnectionApi_serviceDesc = grpc.ServiceDesc{
447	ServiceName: "google.firebase.fcm.connection.v1alpha1.ConnectionApi",
448	HandlerType: (*ConnectionApiServer)(nil),
449	Methods:     []grpc.MethodDesc{},
450	Streams: []grpc.StreamDesc{
451		{
452			StreamName:    "Connect",
453			Handler:       _ConnectionApi_Connect_Handler,
454			ServerStreams: true,
455			ClientStreams: true,
456		},
457	},
458	Metadata: "google/firebase/fcm/connection/v1alpha1/connection_api.proto",
459}
460