| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- // Copyright 2024 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.
- //adopted from third_party/firebase/dataconnect/emulator/server/api/connector_service.proto
- syntax = "proto3";
- package google.firebase.dataconnect.v1alpha;
- import "google/api/annotations.proto";
- import "google/api/field_behavior.proto";
- import "google/protobuf/struct.proto";
- import "graphql_error.proto";
- option java_package = "com.google.firebase.dataconnect.v1alpha";
- option java_multiple_files = true;
- option java_outer_classname = "ConnectorServiceProto";
- // Firebase Data Connect provides means to deploy a set of predefined GraphQL
- // operations (queries and mutations) as a Connector.
- //
- // Firebase developers can build mobile and web apps that uses Connectors
- // to access Data Sources directly. Connectors allow operations without
- // admin credentials and help Firebase customers control the API exposure.
- //
- // Note: `ConnectorService` doesn't check IAM permissions and instead developers
- // must define auth policies on each pre-defined operation to secure this
- // connector. The auth policies typically define rules on the Firebase Auth
- // token.
- service ConnectorService {
- // Execute a predefined query in a Connector.
- rpc ExecuteQuery(ExecuteQueryRequest) returns (ExecuteQueryResponse) {
- option (google.api.http) = {
- post: "/v1alpha/{name=projects/*/locations/*/services/*/connectors/*}:executeQuery"
- body: "*"
- };
- }
- // Execute a predefined mutation in a Connector.
- rpc ExecuteMutation(ExecuteMutationRequest)
- returns (ExecuteMutationResponse) {
- option (google.api.http) = {
- post: "/v1alpha/{name=projects/*/locations/*/services/*/connectors/*}:executeMutation"
- body: "*"
- };
- }
- }
- // The ExecuteQuery request to Firebase Data Connect.
- message ExecuteQueryRequest {
- // The resource name of the connector to find the predefined query, in
- // the format:
- // ```
- // projects/{project}/locations/{location}/services/{service}/connectors/{connector}
- // ```
- string name = 1 [
- (google.api.field_behavior) = REQUIRED
- ];
- // The name of the GraphQL operation name.
- // Required because all Connector operations must be named.
- // See https://graphql.org/learn/queries/#operation-name.
- // (-- api-linter: core::0122::name-suffix=disabled
- // aip.dev/not-precedent: Must conform to GraphQL HTTP spec standard. --)
- string operation_name = 2 [(google.api.field_behavior) = REQUIRED];
- // Values for GraphQL variables provided in this request.
- google.protobuf.Struct variables = 3 [(google.api.field_behavior) = OPTIONAL];
- }
- // The ExecuteMutation request to Firebase Data Connect.
- message ExecuteMutationRequest {
- // The resource name of the connector to find the predefined mutation, in
- // the format:
- // ```
- // projects/{project}/locations/{location}/services/{service}/connectors/{connector}
- // ```
- string name = 1 [
- (google.api.field_behavior) = REQUIRED
- ];
- // The name of the GraphQL operation name.
- // Required because all Connector operations must be named.
- // See https://graphql.org/learn/queries/#operation-name.
- // (-- api-linter: core::0122::name-suffix=disabled
- // aip.dev/not-precedent: Must conform to GraphQL HTTP spec standard. --)
- string operation_name = 2 [(google.api.field_behavior) = REQUIRED];
- // Values for GraphQL variables provided in this request.
- google.protobuf.Struct variables = 3 [(google.api.field_behavior) = OPTIONAL];
- }
- // The ExecuteQuery response from Firebase Data Connect.
- message ExecuteQueryResponse {
- // The result of executing the requested operation.
- google.protobuf.Struct data = 1;
- // Errors of this response.
- repeated GraphqlError errors = 2;
- }
- // The ExecuteMutation response from Firebase Data Connect.
- message ExecuteMutationResponse {
- // The result of executing the requested operation.
- google.protobuf.Struct data = 1;
- // Errors of this response.
- repeated GraphqlError errors = 2;
- }
|