From 43a324913190da118e1c3c1a89ef6cfc47c5caf3 Mon Sep 17 00:00:00 2001 From: Google APIs Date: Thu, 11 Apr 2019 13:32:38 -0700 Subject: [PATCH] Synchronize new proto/yaml changes. PiperOrigin-RevId: 243131243 --- .../connection/fcmconnection_v1alpha1.yaml | 17 ++++ .../connection/v1alpha1/connection_api.proto | 89 +++++++++++++++++++ 2 files changed, 106 insertions(+) create mode 100644 google/firebase/fcm/connection/fcmconnection_v1alpha1.yaml create mode 100644 google/firebase/fcm/connection/v1alpha1/connection_api.proto diff --git a/google/firebase/fcm/connection/fcmconnection_v1alpha1.yaml b/google/firebase/fcm/connection/fcmconnection_v1alpha1.yaml new file mode 100644 index 000000000..84b454b90 --- /dev/null +++ b/google/firebase/fcm/connection/fcmconnection_v1alpha1.yaml @@ -0,0 +1,17 @@ +type: google.api.Service +config_version: 3 +name: fcmconnection.googleapis.com +title: FCM Connection API + +apis: +- name: google.firebase.fcm.connection.v1alpha1.ConnectionApi + +documentation: + summary: An API to connect clients to receive FCM messages. + overview: |- + The FCM Connection API allows developers’ client applications to create + long-lived bi-directional gRPC connections with FCM in order to receive & + send messages from/to their respective app servers. Historically, + developers could only send push notifications/messages to Android, iOS & + browsers. This API allows all gRPC supported client platforms to connect + to FCM. diff --git a/google/firebase/fcm/connection/v1alpha1/connection_api.proto b/google/firebase/fcm/connection/v1alpha1/connection_api.proto new file mode 100644 index 000000000..7a95a578c --- /dev/null +++ b/google/firebase/fcm/connection/v1alpha1/connection_api.proto @@ -0,0 +1,89 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.firebase.fcm.connection.v1alpha1; + +import "google/api/annotations.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/firebase/fcm/connection/v1alpha1;connection"; +option java_multiple_files = true; +option java_package = "com.google.firebase.fcm.connection.v1alpha1"; + +// FCM's service to create client connections to send/receive messages. +service ConnectionApi { + // Creates a streaming connection with FCM to send messages and their + // respective ACKs. + // + // The client credentials need to be passed in the [gRPC + // Metadata](https://grpc.io/docs/guides/concepts.html#metadata). The Format + // of the header is: + // Key: "authorization" + // Value: "Checkin [client_id:secret]" + // + // + // The project's API key also needs to be sent to authorize the project. + // That can be set in the X-Goog-Api-Key Metadata header. + rpc Connect(stream UpstreamRequest) returns (stream DownstreamResponse) { + } +} + +// Request sent to FCM from the connected client. +message UpstreamRequest { + // The type of request the client is making to FCM. + oneof request_type { + // Message acknowledgement. + Ack ack = 1; + } +} + +// Response sent to the connected client from FCM. +message DownstreamResponse { + // The type of response FCM is sending to the client. + oneof response_type { + // Message sent to FCM via the [Send + // API](https://firebase.google.com/docs/cloud-messaging/send-message) + // targeting this client. + Message message = 1; + } +} + +// Acknowledgement to indicate a client successfully received an FCM message. +// +// If a message is not acked, FCM will continously resend the message until +// it expires. Duplicate delivery in this case is working as intended. +message Ack { + // Id of message being acknowledged + string message_id = 1; +} + +// Message created through the [Send +// API](https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#resource-message). +message Message { + // The identifier of the message. Used to ack the message. + string message_id = 1; + + // Time the message was received in FCM. + google.protobuf.Timestamp create_time = 2; + + // Expiry time of the message. Currently it is always 4 weeks. + google.protobuf.Timestamp expire_time = 3; + + // The arbitrary payload set in the [Send + // API](https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#resource-message). + map data = 4; +}