diff --git a/Protos/Readme b/Protos/Readme deleted file mode 100644 index 4459c72..0000000 --- a/Protos/Readme +++ /dev/null @@ -1,10 +0,0 @@ - -connector_service.proto is adapted from Data Connect server protos. -third_party/firebase/dataconnect/emulator/server/api/connector_service.proto - -With following changes - -Follow same changes as specified by the copybara lines. -Where it says strip, take that line out and follow any replace rules with a replace - -The google protos are obtained from https://github.com/googleapis/googleapis/tree/master - diff --git a/Protos/Readme.md b/Protos/Readme.md new file mode 100644 index 0000000..c58af94 --- /dev/null +++ b/Protos/Readme.md @@ -0,0 +1,70 @@ +# Data Connect protos +This folder contains the Data Connect protos defining the GRPC service. + +# Google Protos +The google protos are obtained from https://github.com/googleapis/googleapis/tree/master + +# Instructions to Generate the Swift files for the protos + +## Step 1: +(for Googlers) Copy the .proto files from + +`third_party/firebase/dataconnect/emulator/server/api/connector_service.proto` + +`third_party/firebase/dataconnect/emulator/server/api/graphql_error.proto` + + +## Step 2: +If needed, adjust package name after discussion with server team. + +Make following changes if needed - +- Follow same changes as specified by the copybara lines. +- Where it says strip, take that line out and follow any replace rules with a replace +- If protos reference any internal packages, those are typically not needed by the SDKs or these are marked with copybara strip rules. + +## Step 3: +Get the standard protoc compiler and ensure that it is in your system path + +## Step 4: +Get the protoc Swift gen plugin from the releases section of Swift GRPC + +https://github.com/grpc/grpc-swift/releases + +Under the 'Assets' section of a release, download the protoc-grpc-swift-plugins file for macOS. +Example: +protoc-grpc-swift-plugins-1.23.1.zip + +## Step 5: +Extract this in a location of your choice. You will need the folder path of the extracted folder. + +## Step 6: +Edit the `build_protos.sh` script that is present in the same folder as this Readme file. + +Adjust the variables that configure the folder paths needed by the script + +Note: If you don't have the protoc compiler in your PATH, you will need specify the full path of the protoc binary in the script above + +## Step 7: +Open a Terminal at the folder where the script is and run the build_protos.sh script + +`sh build_protos.sh` + + +## Step 8: +If this script executes successfully (i.e. no errors printed), it will place the generated files in the +`data-connect-ios-sdk/Sources/ProtoGen` folder + +If any of the generated Swift files doesn't have the standard License, insert one. + +## Step 9: +If the proto package or endpoint names have changed you may get build errors. You will need to adjust the new name in two files + +`data-connect-ios-sdk/Sources/Internal/GrpcClient.swift` + +`data-connect-ios-sdk/Sources/Internal/Codec.swift` + +## Step 10: +Run Integration tests to confirm that the new protos are working fine. + + + diff --git a/Protos/build_protos.sh b/Protos/build_protos.sh index 9934f32..47c2caf 100644 --- a/Protos/build_protos.sh +++ b/Protos/build_protos.sh @@ -15,24 +15,22 @@ # limitations under the License. - #This is a convenience script to build protos and generate Swift files #It requires the Swift grpc and proto plugins which are part of swift-grpc project #Script should be run from the folder containing this script protoc_path="protoc" -sdk_folder="/Users/aashishp/Code/firebase-private/firebase-ios-sdk" -sdk_name="FirebaseDataConnect" -plugin_folder="/Users/aashishp/Code/grpc-swift/.build/release" +sdk_folder="/Users/aashishp/Code/data-connect-ios-sdk" +plugin_folder="/Users/aashishp/dev/protoc-grpc-swift-plugins-1.23.0/bin" protoc graphql_error.proto connector_service.proto \ - --proto_path=$sdk_folder/$sdk_name/Protos/ \ + --proto_path=$sdk_folder/Protos/ \ --plugin=$plugin_folder/protoc-gen-swift \ --swift_opt=Visibility=Public \ - --swift_out=$sdk_folder/$sdk_name/Sources/ProtoGen \ + --swift_out=$sdk_folder/Sources/ProtoGen \ --plugin=$plugin_folder/protoc-gen-grpc-swift \ --grpc-swift_opt=Visibility=Public \ - --grpc-swift_out=$sdk_folder/$sdk_name/Sources/ProtoGen + --grpc-swift_out=$sdk_folder/Sources/ProtoGen diff --git a/Protos/connector_service.proto b/Protos/connector_service.proto index 91ac3b1..d73af18 100644 --- a/Protos/connector_service.proto +++ b/Protos/connector_service.proto @@ -16,35 +16,27 @@ //adopted from third_party/firebase/dataconnect/emulator/server/api/connector_service.proto syntax = "proto3"; -package google.firebase.dataconnect.v1alpha; +package google.firebase.dataconnect.v1beta; 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_package = "com.google.firebase.dataconnect.v1beta"; 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: "*" + additional_bindings { + post: "/v1beta/{name=projects/*/locations/*/services/*/connectors/*}:executeQuery" + body: "*" + } }; } @@ -54,6 +46,10 @@ service ConnectorService { option (google.api.http) = { post: "/v1alpha/{name=projects/*/locations/*/services/*/connectors/*}:executeMutation" body: "*" + additional_bindings { + post: "/v1beta/{name=projects/*/locations/*/services/*/connectors/*}:executeMutation" + body: "*" + } }; } } @@ -65,9 +61,7 @@ message ExecuteQueryRequest { // ``` // projects/{project}/locations/{location}/services/{service}/connectors/{connector} // ``` - string name = 1 [ - (google.api.field_behavior) = REQUIRED - ]; + string name = 1 [(google.api.field_behavior) = REQUIRED]; // The name of the GraphQL operation name. // Required because all Connector operations must be named. @@ -87,9 +81,7 @@ message ExecuteMutationRequest { // ``` // projects/{project}/locations/{location}/services/{service}/connectors/{connector} // ``` - string name = 1 [ - (google.api.field_behavior) = REQUIRED - ]; + string name = 1 [(google.api.field_behavior) = REQUIRED]; // The name of the GraphQL operation name. // Required because all Connector operations must be named. diff --git a/Protos/graphql_error.proto b/Protos/graphql_error.proto index 01a31ed..87d8535 100644 --- a/Protos/graphql_error.proto +++ b/Protos/graphql_error.proto @@ -16,15 +16,14 @@ syntax = "proto3"; -package google.firebase.dataconnect.v1alpha; +package google.firebase.dataconnect.v1beta; import "google/protobuf/struct.proto"; -option java_package = "com.google.firebase.dataconnect.v1alpha"; +option java_package = "com.google.firebase.dataconnect.v1beta"; option java_multiple_files = true; option java_outer_classname = "GraphqlErrorProto"; - // GraphqlError conforms to the GraphQL error spec. // https://spec.graphql.org/draft/#sec-Errors // diff --git a/Sources/Internal/Codec.swift b/Sources/Internal/Codec.swift index d08c4ca..1744c87 100644 --- a/Sources/Internal/Codec.swift +++ b/Sources/Internal/Codec.swift @@ -16,6 +16,12 @@ import Foundation import SwiftProtobuf +@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) +public typealias FirebaseDataConnectExecuteMutationRequest = + Google_Firebase_Dataconnect_V1beta_ExecuteMutationRequest +public typealias FirebaseDataConnectExecuteQueryRequest = + Google_Firebase_Dataconnect_V1beta_ExecuteQueryRequest + @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) class Codec { // Encode Codable to Protos @@ -46,14 +52,14 @@ class Codec { request: QueryRequest< VariableType >) throws - -> Google_Firebase_Dataconnect_V1alpha_ExecuteQueryRequest { + -> FirebaseDataConnectExecuteQueryRequest { do { var varStruct: Google_Protobuf_Struct? = nil if let variables = request.variables { varStruct = try encode(args: variables) } - let internalRequest = Google_Firebase_Dataconnect_V1alpha_ExecuteQueryRequest.with { ireq in + let internalRequest = FirebaseDataConnectExecuteQueryRequest.with { ireq in ireq.operationName = request.operationName if let varStruct { @@ -73,14 +79,14 @@ class Codec { request: MutationRequest< VariableType >) throws - -> Google_Firebase_Dataconnect_V1alpha_ExecuteMutationRequest { + -> FirebaseDataConnectExecuteMutationRequest { do { var varStruct: Google_Protobuf_Struct? = nil if let variables = request.variables { varStruct = try encode(args: variables) } - let internalRequest = Google_Firebase_Dataconnect_V1alpha_ExecuteMutationRequest + let internalRequest = FirebaseDataConnectExecuteMutationRequest .with { ireq in ireq.operationName = request.operationName diff --git a/Sources/Internal/GrpcClient.swift b/Sources/Internal/GrpcClient.swift index 7b88514..dc69dc6 100644 --- a/Sources/Internal/GrpcClient.swift +++ b/Sources/Internal/GrpcClient.swift @@ -24,6 +24,10 @@ import NIOPosix import OSLog import SwiftProtobuf +@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) +public typealias FirebaseDataConnectAsyncClient = + Google_Firebase_Dataconnect_V1beta_ConnectorServiceAsyncClient + @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) actor GrpcClient: CustomStringConvertible { nonisolated let description: String @@ -56,7 +60,7 @@ actor GrpcClient: CustomStringConvertible { private let googRequestHeaderValue: String - private lazy var client: Google_Firebase_Dataconnect_V1alpha_ConnectorServiceAsyncClient? = { + private lazy var client: FirebaseDataConnectAsyncClient? = { do { FirebaseLogger.dataConnect.debug("\(self.description) initialization starts.") let group = PlatformSupport.makeEventLoopGroup(loopCount: threadPoolSize) @@ -68,7 +72,7 @@ actor GrpcClient: CustomStringConvertible { eventLoopGroup: group ) FirebaseLogger.dataConnect.debug("\(self.description) has been created.") - return Google_Firebase_Dataconnect_V1alpha_ConnectorServiceAsyncClient(channel: channel) + return FirebaseDataConnectAsyncClient(channel: channel) } catch { FirebaseLogger.dataConnect.error("Error:\(error) when creating \(self.description).") return nil diff --git a/Sources/ProtoGen/connector_service.grpc.swift b/Sources/ProtoGen/connector_service.grpc.swift index 35a55bc..d466b10 100644 --- a/Sources/ProtoGen/connector_service.grpc.swift +++ b/Sources/ProtoGen/connector_service.grpc.swift @@ -1,64 +1,52 @@ // // DO NOT EDIT. +// swift-format-ignore-file // // Generated by the protocol buffer compiler. // Source: connector_service.proto // -// -// Copyright 2018, gRPC Authors All rights reserved. +// 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 +// 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. -// + import GRPC import NIO import NIOConcurrencyHelpers import SwiftProtobuf -/// 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. -/// -/// Usage: instantiate `Google_Firebase_Dataconnect_V1alpha_ConnectorServiceClient`, then call +/// Usage: instantiate `Google_Firebase_Dataconnect_V1beta_ConnectorServiceClient`, then call /// methods of this protocol to make API calls. -public protocol Google_Firebase_Dataconnect_V1alpha_ConnectorServiceClientProtocol: GRPCClient { +public protocol Google_Firebase_Dataconnect_V1beta_ConnectorServiceClientProtocol: GRPCClient { var serviceName: String { get } - var interceptors: Google_Firebase_Dataconnect_V1alpha_ConnectorServiceClientInterceptorFactoryProtocol? { + var interceptors: Google_Firebase_Dataconnect_V1beta_ConnectorServiceClientInterceptorFactoryProtocol? { get } - func executeQuery(_ request: Google_Firebase_Dataconnect_V1alpha_ExecuteQueryRequest, + func executeQuery(_ request: Google_Firebase_Dataconnect_V1beta_ExecuteQueryRequest, callOptions: CallOptions?) - -> UnaryCall + -> UnaryCall - func executeMutation(_ request: Google_Firebase_Dataconnect_V1alpha_ExecuteMutationRequest, + func executeMutation(_ request: Google_Firebase_Dataconnect_V1beta_ExecuteMutationRequest, callOptions: CallOptions?) - -> UnaryCall + -> UnaryCall } -public extension Google_Firebase_Dataconnect_V1alpha_ConnectorServiceClientProtocol { +public extension Google_Firebase_Dataconnect_V1beta_ConnectorServiceClientProtocol { var serviceName: String { - return "google.firebase.dataconnect.v1alpha.ConnectorService" + return "google.firebase.dataconnect.v1beta.ConnectorService" } /// Execute a predefined query in a Connector. @@ -67,12 +55,12 @@ public extension Google_Firebase_Dataconnect_V1alpha_ConnectorServiceClientProto /// - request: Request to send to ExecuteQuery. /// - callOptions: Call options. /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - func executeQuery(_ request: Google_Firebase_Dataconnect_V1alpha_ExecuteQueryRequest, + func executeQuery(_ request: Google_Firebase_Dataconnect_V1beta_ExecuteQueryRequest, callOptions: CallOptions? = nil) - -> UnaryCall { + -> UnaryCall { return makeUnaryCall( - path: Google_Firebase_Dataconnect_V1alpha_ConnectorServiceClientMetadata.Methods.executeQuery + path: Google_Firebase_Dataconnect_V1beta_ConnectorServiceClientMetadata.Methods.executeQuery .path, request: request, callOptions: callOptions ?? defaultCallOptions, @@ -86,12 +74,12 @@ public extension Google_Firebase_Dataconnect_V1alpha_ConnectorServiceClientProto /// - request: Request to send to ExecuteMutation. /// - callOptions: Call options. /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - func executeMutation(_ request: Google_Firebase_Dataconnect_V1alpha_ExecuteMutationRequest, + func executeMutation(_ request: Google_Firebase_Dataconnect_V1beta_ExecuteMutationRequest, callOptions: CallOptions? = nil) - -> UnaryCall { + -> UnaryCall { return makeUnaryCall( - path: Google_Firebase_Dataconnect_V1alpha_ConnectorServiceClientMetadata.Methods + path: Google_Firebase_Dataconnect_V1beta_ConnectorServiceClientMetadata.Methods .executeMutation.path, request: request, callOptions: callOptions ?? defaultCallOptions, @@ -100,28 +88,26 @@ public extension Google_Firebase_Dataconnect_V1alpha_ConnectorServiceClientProto } } -#if compiler(>=5.6) - @available(*, deprecated) - extension Google_Firebase_Dataconnect_V1alpha_ConnectorServiceClient: @unchecked Sendable {} -#endif // compiler(>=5.6) +@available(*, deprecated) +extension Google_Firebase_Dataconnect_V1beta_ConnectorServiceClient: @unchecked Sendable {} -@available(*, deprecated, renamed: "Google_Firebase_Dataconnect_V1alpha_ConnectorServiceNIOClient") -public final class Google_Firebase_Dataconnect_V1alpha_ConnectorServiceClient: Google_Firebase_Dataconnect_V1alpha_ConnectorServiceClientProtocol { +@available(*, deprecated, renamed: "Google_Firebase_Dataconnect_V1beta_ConnectorServiceNIOClient") +public final class Google_Firebase_Dataconnect_V1beta_ConnectorServiceClient: Google_Firebase_Dataconnect_V1beta_ConnectorServiceClientProtocol { private let lock = Lock() private var _defaultCallOptions: CallOptions - private var _interceptors: Google_Firebase_Dataconnect_V1alpha_ConnectorServiceClientInterceptorFactoryProtocol? + private var _interceptors: Google_Firebase_Dataconnect_V1beta_ConnectorServiceClientInterceptorFactoryProtocol? public let channel: GRPCChannel public var defaultCallOptions: CallOptions { get { lock.withLock { self._defaultCallOptions } } set { lock.withLockVoid { self._defaultCallOptions = newValue } } } - public var interceptors: Google_Firebase_Dataconnect_V1alpha_ConnectorServiceClientInterceptorFactoryProtocol? { + public var interceptors: Google_Firebase_Dataconnect_V1beta_ConnectorServiceClientInterceptorFactoryProtocol? { get { lock.withLock { self._interceptors } } set { lock.withLockVoid { self._interceptors = newValue } } } - /// Creates a client for the google.firebase.dataconnect.v1alpha.ConnectorService service. + /// Creates a client for the google.firebase.dataconnect.v1beta.ConnectorService service. /// /// - Parameters: /// - channel: `GRPCChannel` to the service host. @@ -129,7 +115,7 @@ public final class Google_Firebase_Dataconnect_V1alpha_ConnectorServiceClient: G /// - interceptors: A factory providing interceptors for each RPC. public init(channel: GRPCChannel, defaultCallOptions: CallOptions = CallOptions(), - interceptors: Google_Firebase_Dataconnect_V1alpha_ConnectorServiceClientInterceptorFactoryProtocol? = + interceptors: Google_Firebase_Dataconnect_V1beta_ConnectorServiceClientInterceptorFactoryProtocol? = nil) { self.channel = channel _defaultCallOptions = defaultCallOptions @@ -137,12 +123,12 @@ public final class Google_Firebase_Dataconnect_V1alpha_ConnectorServiceClient: G } } -public struct Google_Firebase_Dataconnect_V1alpha_ConnectorServiceNIOClient: Google_Firebase_Dataconnect_V1alpha_ConnectorServiceClientProtocol { +public struct Google_Firebase_Dataconnect_V1beta_ConnectorServiceNIOClient: Google_Firebase_Dataconnect_V1beta_ConnectorServiceClientProtocol { public var channel: GRPCChannel public var defaultCallOptions: CallOptions - public var interceptors: Google_Firebase_Dataconnect_V1alpha_ConnectorServiceClientInterceptorFactoryProtocol? + public var interceptors: Google_Firebase_Dataconnect_V1beta_ConnectorServiceClientInterceptorFactoryProtocol? - /// Creates a client for the google.firebase.dataconnect.v1alpha.ConnectorService service. + /// Creates a client for the google.firebase.dataconnect.v1beta.ConnectorService service. /// /// - Parameters: /// - channel: `GRPCChannel` to the service host. @@ -150,7 +136,7 @@ public struct Google_Firebase_Dataconnect_V1alpha_ConnectorServiceNIOClient: Goo /// - interceptors: A factory providing interceptors for each RPC. public init(channel: GRPCChannel, defaultCallOptions: CallOptions = CallOptions(), - interceptors: Google_Firebase_Dataconnect_V1alpha_ConnectorServiceClientInterceptorFactoryProtocol? = + interceptors: Google_Firebase_Dataconnect_V1beta_ConnectorServiceClientInterceptorFactoryProtocol? = nil) { self.channel = channel self.defaultCallOptions = defaultCallOptions @@ -158,192 +144,163 @@ public struct Google_Firebase_Dataconnect_V1alpha_ConnectorServiceNIOClient: Goo } } -#if compiler(>=5.6) - /// 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. - @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) - public protocol Google_Firebase_Dataconnect_V1alpha_ConnectorServiceAsyncClientProtocol: GRPCClient { - static var serviceDescriptor: GRPCServiceDescriptor { get } - var interceptors: Google_Firebase_Dataconnect_V1alpha_ConnectorServiceClientInterceptorFactoryProtocol? { - get - } - - func makeExecuteQueryCall(_ request: Google_Firebase_Dataconnect_V1alpha_ExecuteQueryRequest, - callOptions: CallOptions?) - -> GRPCAsyncUnaryCall - - func makeExecuteMutationCall(_ request: Google_Firebase_Dataconnect_V1alpha_ExecuteMutationRequest, - callOptions: CallOptions?) - -> GRPCAsyncUnaryCall +@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) +public protocol Google_Firebase_Dataconnect_V1beta_ConnectorServiceAsyncClientProtocol: GRPCClient { + static var serviceDescriptor: GRPCServiceDescriptor { get } + var interceptors: Google_Firebase_Dataconnect_V1beta_ConnectorServiceClientInterceptorFactoryProtocol? { + get } - @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) - public extension Google_Firebase_Dataconnect_V1alpha_ConnectorServiceAsyncClientProtocol { - static var serviceDescriptor: GRPCServiceDescriptor { - return Google_Firebase_Dataconnect_V1alpha_ConnectorServiceClientMetadata.serviceDescriptor - } + func makeExecuteQueryCall(_ request: Google_Firebase_Dataconnect_V1beta_ExecuteQueryRequest, + callOptions: CallOptions?) + -> GRPCAsyncUnaryCall - var interceptors: Google_Firebase_Dataconnect_V1alpha_ConnectorServiceClientInterceptorFactoryProtocol? { - return nil - } + func makeExecuteMutationCall(_ request: Google_Firebase_Dataconnect_V1beta_ExecuteMutationRequest, + callOptions: CallOptions?) + -> GRPCAsyncUnaryCall +} - func makeExecuteQueryCall(_ request: Google_Firebase_Dataconnect_V1alpha_ExecuteQueryRequest, - callOptions: CallOptions? = nil) - -> GRPCAsyncUnaryCall { - return makeAsyncUnaryCall( - path: Google_Firebase_Dataconnect_V1alpha_ConnectorServiceClientMetadata.Methods - .executeQuery - .path, - request: request, - callOptions: callOptions ?? defaultCallOptions, - interceptors: interceptors?.makeExecuteQueryInterceptors() ?? [] - ) - } +@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) +public extension Google_Firebase_Dataconnect_V1beta_ConnectorServiceAsyncClientProtocol { + static var serviceDescriptor: GRPCServiceDescriptor { + return Google_Firebase_Dataconnect_V1beta_ConnectorServiceClientMetadata.serviceDescriptor + } - func makeExecuteMutationCall(_ request: Google_Firebase_Dataconnect_V1alpha_ExecuteMutationRequest, - callOptions: CallOptions? = nil) - -> GRPCAsyncUnaryCall { - return makeAsyncUnaryCall( - path: Google_Firebase_Dataconnect_V1alpha_ConnectorServiceClientMetadata.Methods - .executeMutation.path, - request: request, - callOptions: callOptions ?? defaultCallOptions, - interceptors: interceptors?.makeExecuteMutationInterceptors() ?? [] - ) - } + var interceptors: Google_Firebase_Dataconnect_V1beta_ConnectorServiceClientInterceptorFactoryProtocol? { + return nil } - @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) - public extension Google_Firebase_Dataconnect_V1alpha_ConnectorServiceAsyncClientProtocol { - func executeQuery(_ request: Google_Firebase_Dataconnect_V1alpha_ExecuteQueryRequest, - callOptions: CallOptions? = nil) async throws - -> Google_Firebase_Dataconnect_V1alpha_ExecuteQueryResponse { - return try await performAsyncUnaryCall( - path: Google_Firebase_Dataconnect_V1alpha_ConnectorServiceClientMetadata.Methods - .executeQuery - .path, - request: request, - callOptions: callOptions ?? defaultCallOptions, - interceptors: interceptors?.makeExecuteQueryInterceptors() ?? [] - ) - } + func makeExecuteQueryCall(_ request: Google_Firebase_Dataconnect_V1beta_ExecuteQueryRequest, + callOptions: CallOptions? = nil) + -> GRPCAsyncUnaryCall { + return makeAsyncUnaryCall( + path: Google_Firebase_Dataconnect_V1beta_ConnectorServiceClientMetadata.Methods.executeQuery + .path, + request: request, + callOptions: callOptions ?? defaultCallOptions, + interceptors: interceptors?.makeExecuteQueryInterceptors() ?? [] + ) + } - func executeMutation(_ request: Google_Firebase_Dataconnect_V1alpha_ExecuteMutationRequest, - callOptions: CallOptions? = nil) async throws - -> Google_Firebase_Dataconnect_V1alpha_ExecuteMutationResponse { - return try await performAsyncUnaryCall( - path: Google_Firebase_Dataconnect_V1alpha_ConnectorServiceClientMetadata.Methods - .executeMutation.path, - request: request, - callOptions: callOptions ?? defaultCallOptions, - interceptors: interceptors?.makeExecuteMutationInterceptors() ?? [] - ) - } + func makeExecuteMutationCall(_ request: Google_Firebase_Dataconnect_V1beta_ExecuteMutationRequest, + callOptions: CallOptions? = nil) + -> GRPCAsyncUnaryCall { + return makeAsyncUnaryCall( + path: Google_Firebase_Dataconnect_V1beta_ConnectorServiceClientMetadata.Methods + .executeMutation.path, + request: request, + callOptions: callOptions ?? defaultCallOptions, + interceptors: interceptors?.makeExecuteMutationInterceptors() ?? [] + ) } +} - @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) - public struct Google_Firebase_Dataconnect_V1alpha_ConnectorServiceAsyncClient: Google_Firebase_Dataconnect_V1alpha_ConnectorServiceAsyncClientProtocol { - public var channel: GRPCChannel - public var defaultCallOptions: CallOptions - public var interceptors: Google_Firebase_Dataconnect_V1alpha_ConnectorServiceClientInterceptorFactoryProtocol? - - public init(channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Google_Firebase_Dataconnect_V1alpha_ConnectorServiceClientInterceptorFactoryProtocol? = - nil) { - self.channel = channel - self.defaultCallOptions = defaultCallOptions - self.interceptors = interceptors - } +@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) +public extension Google_Firebase_Dataconnect_V1beta_ConnectorServiceAsyncClientProtocol { + func executeQuery(_ request: Google_Firebase_Dataconnect_V1beta_ExecuteQueryRequest, + callOptions: CallOptions? = nil) async throws + -> Google_Firebase_Dataconnect_V1beta_ExecuteQueryResponse { + return try await performAsyncUnaryCall( + path: Google_Firebase_Dataconnect_V1beta_ConnectorServiceClientMetadata.Methods.executeQuery + .path, + request: request, + callOptions: callOptions ?? defaultCallOptions, + interceptors: interceptors?.makeExecuteQueryInterceptors() ?? [] + ) + } + + func executeMutation(_ request: Google_Firebase_Dataconnect_V1beta_ExecuteMutationRequest, + callOptions: CallOptions? = nil) async throws + -> Google_Firebase_Dataconnect_V1beta_ExecuteMutationResponse { + return try await performAsyncUnaryCall( + path: Google_Firebase_Dataconnect_V1beta_ConnectorServiceClientMetadata.Methods + .executeMutation.path, + request: request, + callOptions: callOptions ?? defaultCallOptions, + interceptors: interceptors?.makeExecuteMutationInterceptors() ?? [] + ) } +} + +@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) +public struct Google_Firebase_Dataconnect_V1beta_ConnectorServiceAsyncClient: Google_Firebase_Dataconnect_V1beta_ConnectorServiceAsyncClientProtocol { + public var channel: GRPCChannel + public var defaultCallOptions: CallOptions + public var interceptors: Google_Firebase_Dataconnect_V1beta_ConnectorServiceClientInterceptorFactoryProtocol? -#endif // compiler(>=5.6) + public init(channel: GRPCChannel, + defaultCallOptions: CallOptions = CallOptions(), + interceptors: Google_Firebase_Dataconnect_V1beta_ConnectorServiceClientInterceptorFactoryProtocol? = + nil) { + self.channel = channel + self.defaultCallOptions = defaultCallOptions + self.interceptors = interceptors + } +} -public protocol Google_Firebase_Dataconnect_V1alpha_ConnectorServiceClientInterceptorFactoryProtocol: - Swift.Sendable { +public protocol Google_Firebase_Dataconnect_V1beta_ConnectorServiceClientInterceptorFactoryProtocol: Sendable { /// - Returns: Interceptors to use when invoking 'executeQuery'. func makeExecuteQueryInterceptors() -> [ClientInterceptor< - Google_Firebase_Dataconnect_V1alpha_ExecuteQueryRequest, - Google_Firebase_Dataconnect_V1alpha_ExecuteQueryResponse + Google_Firebase_Dataconnect_V1beta_ExecuteQueryRequest, + Google_Firebase_Dataconnect_V1beta_ExecuteQueryResponse >] /// - Returns: Interceptors to use when invoking 'executeMutation'. func makeExecuteMutationInterceptors() -> [ClientInterceptor< - Google_Firebase_Dataconnect_V1alpha_ExecuteMutationRequest, - Google_Firebase_Dataconnect_V1alpha_ExecuteMutationResponse + Google_Firebase_Dataconnect_V1beta_ExecuteMutationRequest, + Google_Firebase_Dataconnect_V1beta_ExecuteMutationResponse >] } -public enum Google_Firebase_Dataconnect_V1alpha_ConnectorServiceClientMetadata { +public enum Google_Firebase_Dataconnect_V1beta_ConnectorServiceClientMetadata { public static let serviceDescriptor = GRPCServiceDescriptor( name: "ConnectorService", - fullName: "google.firebase.dataconnect.v1alpha.ConnectorService", + fullName: "google.firebase.dataconnect.v1beta.ConnectorService", methods: [ - Google_Firebase_Dataconnect_V1alpha_ConnectorServiceClientMetadata.Methods.executeQuery, - Google_Firebase_Dataconnect_V1alpha_ConnectorServiceClientMetadata.Methods.executeMutation, + Google_Firebase_Dataconnect_V1beta_ConnectorServiceClientMetadata.Methods.executeQuery, + Google_Firebase_Dataconnect_V1beta_ConnectorServiceClientMetadata.Methods.executeMutation, ] ) public enum Methods { public static let executeQuery = GRPCMethodDescriptor( name: "ExecuteQuery", - path: "/google.firebase.dataconnect.v1alpha.ConnectorService/ExecuteQuery", + path: "/google.firebase.dataconnect.v1beta.ConnectorService/ExecuteQuery", type: GRPCCallType.unary ) public static let executeMutation = GRPCMethodDescriptor( name: "ExecuteMutation", - path: "/google.firebase.dataconnect.v1alpha.ConnectorService/ExecuteMutation", + path: "/google.firebase.dataconnect.v1beta.ConnectorService/ExecuteMutation", type: GRPCCallType.unary ) } } -/// 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. -/// /// To build a server, implement a class that conforms to this protocol. -public protocol Google_Firebase_Dataconnect_V1alpha_ConnectorServiceProvider: CallHandlerProvider { - var interceptors: Google_Firebase_Dataconnect_V1alpha_ConnectorServiceServerInterceptorFactoryProtocol? { +public protocol Google_Firebase_Dataconnect_V1beta_ConnectorServiceProvider: CallHandlerProvider { + var interceptors: Google_Firebase_Dataconnect_V1beta_ConnectorServiceServerInterceptorFactoryProtocol? { get } /// Execute a predefined query in a Connector. - func executeQuery(request: Google_Firebase_Dataconnect_V1alpha_ExecuteQueryRequest, + func executeQuery(request: Google_Firebase_Dataconnect_V1beta_ExecuteQueryRequest, context: StatusOnlyCallContext) - -> EventLoopFuture + -> EventLoopFuture /// Execute a predefined mutation in a Connector. - func executeMutation(request: Google_Firebase_Dataconnect_V1alpha_ExecuteMutationRequest, + func executeMutation(request: Google_Firebase_Dataconnect_V1beta_ExecuteMutationRequest, context: StatusOnlyCallContext) - -> EventLoopFuture + -> EventLoopFuture } -public extension Google_Firebase_Dataconnect_V1alpha_ConnectorServiceProvider { +public extension Google_Firebase_Dataconnect_V1beta_ConnectorServiceProvider { var serviceName: Substring { - return Google_Firebase_Dataconnect_V1alpha_ConnectorServiceServerMetadata.serviceDescriptor + return Google_Firebase_Dataconnect_V1beta_ConnectorServiceServerMetadata.serviceDescriptor .fullName[...] } @@ -357,10 +314,10 @@ public extension Google_Firebase_Dataconnect_V1alpha_ConnectorServiceProvider { return UnaryServerHandler( context: context, requestDeserializer: ProtobufDeserializer< - Google_Firebase_Dataconnect_V1alpha_ExecuteQueryRequest + Google_Firebase_Dataconnect_V1beta_ExecuteQueryRequest >(), responseSerializer: ProtobufSerializer< - Google_Firebase_Dataconnect_V1alpha_ExecuteQueryResponse + Google_Firebase_Dataconnect_V1beta_ExecuteQueryResponse >(), interceptors: interceptors?.makeExecuteQueryInterceptors() ?? [], userFunction: executeQuery(request:context:) @@ -370,10 +327,10 @@ public extension Google_Firebase_Dataconnect_V1alpha_ConnectorServiceProvider { return UnaryServerHandler( context: context, requestDeserializer: ProtobufDeserializer< - Google_Firebase_Dataconnect_V1alpha_ExecuteMutationRequest + Google_Firebase_Dataconnect_V1beta_ExecuteMutationRequest >(), responseSerializer: ProtobufSerializer< - Google_Firebase_Dataconnect_V1alpha_ExecuteMutationResponse + Google_Firebase_Dataconnect_V1beta_ExecuteMutationResponse >(), interceptors: interceptors?.makeExecuteMutationInterceptors() ?? [], userFunction: executeMutation(request:context:) @@ -385,127 +342,112 @@ public extension Google_Firebase_Dataconnect_V1alpha_ConnectorServiceProvider { } } -#if compiler(>=5.6) +/// To implement a server, implement an object which conforms to this protocol. +@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) +public protocol Google_Firebase_Dataconnect_V1beta_ConnectorServiceAsyncProvider: CallHandlerProvider, + Sendable { + static var serviceDescriptor: GRPCServiceDescriptor { get } + var interceptors: Google_Firebase_Dataconnect_V1beta_ConnectorServiceServerInterceptorFactoryProtocol? { + get + } - /// 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. - /// - /// To implement a server, implement an object which conforms to this protocol. - @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) - public protocol Google_Firebase_Dataconnect_V1alpha_ConnectorServiceAsyncProvider: CallHandlerProvider { - static var serviceDescriptor: GRPCServiceDescriptor { get } - var interceptors: Google_Firebase_Dataconnect_V1alpha_ConnectorServiceServerInterceptorFactoryProtocol? { - get - } + /// Execute a predefined query in a Connector. + func executeQuery(request: Google_Firebase_Dataconnect_V1beta_ExecuteQueryRequest, + context: GRPCAsyncServerCallContext) async throws + -> Google_Firebase_Dataconnect_V1beta_ExecuteQueryResponse - /// Execute a predefined query in a Connector. - @Sendable func executeQuery(request: Google_Firebase_Dataconnect_V1alpha_ExecuteQueryRequest, - context: GRPCAsyncServerCallContext) async throws - -> Google_Firebase_Dataconnect_V1alpha_ExecuteQueryResponse + /// Execute a predefined mutation in a Connector. + func executeMutation(request: Google_Firebase_Dataconnect_V1beta_ExecuteMutationRequest, + context: GRPCAsyncServerCallContext) async throws + -> Google_Firebase_Dataconnect_V1beta_ExecuteMutationResponse +} - /// Execute a predefined mutation in a Connector. - @Sendable func executeMutation(request: Google_Firebase_Dataconnect_V1alpha_ExecuteMutationRequest, - context: GRPCAsyncServerCallContext) async throws - -> Google_Firebase_Dataconnect_V1alpha_ExecuteMutationResponse +@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) +public extension Google_Firebase_Dataconnect_V1beta_ConnectorServiceAsyncProvider { + static var serviceDescriptor: GRPCServiceDescriptor { + return Google_Firebase_Dataconnect_V1beta_ConnectorServiceServerMetadata.serviceDescriptor } - @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) - public extension Google_Firebase_Dataconnect_V1alpha_ConnectorServiceAsyncProvider { - static var serviceDescriptor: GRPCServiceDescriptor { - return Google_Firebase_Dataconnect_V1alpha_ConnectorServiceServerMetadata.serviceDescriptor - } + var serviceName: Substring { + return Google_Firebase_Dataconnect_V1beta_ConnectorServiceServerMetadata.serviceDescriptor + .fullName[...] + } - var serviceName: Substring { - return Google_Firebase_Dataconnect_V1alpha_ConnectorServiceServerMetadata.serviceDescriptor - .fullName[...] - } + var interceptors: Google_Firebase_Dataconnect_V1beta_ConnectorServiceServerInterceptorFactoryProtocol? { + return nil + } - var interceptors: Google_Firebase_Dataconnect_V1alpha_ConnectorServiceServerInterceptorFactoryProtocol? { - return nil - } + func handle(method name: Substring, + context: CallHandlerContext) -> GRPCServerHandlerProtocol? { + switch name { + case "ExecuteQuery": + return GRPCAsyncServerHandler( + context: context, + requestDeserializer: ProtobufDeserializer< + Google_Firebase_Dataconnect_V1beta_ExecuteQueryRequest + >(), + responseSerializer: ProtobufSerializer< + Google_Firebase_Dataconnect_V1beta_ExecuteQueryResponse + >(), + interceptors: interceptors?.makeExecuteQueryInterceptors() ?? [], + wrapping: { try await self.executeQuery(request: $0, context: $1) } + ) - func handle(method name: Substring, - context: CallHandlerContext) -> GRPCServerHandlerProtocol? { - switch name { - case "ExecuteQuery": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer< - Google_Firebase_Dataconnect_V1alpha_ExecuteQueryRequest - >(), - responseSerializer: ProtobufSerializer< - Google_Firebase_Dataconnect_V1alpha_ExecuteQueryResponse - >(), - interceptors: interceptors?.makeExecuteQueryInterceptors() ?? [], - wrapping: executeQuery(request:context:) - ) - - case "ExecuteMutation": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer< - Google_Firebase_Dataconnect_V1alpha_ExecuteMutationRequest - >(), - responseSerializer: ProtobufSerializer< - Google_Firebase_Dataconnect_V1alpha_ExecuteMutationResponse - >(), - interceptors: interceptors?.makeExecuteMutationInterceptors() ?? [], - wrapping: executeMutation(request:context:) - ) - - default: - return nil - } + case "ExecuteMutation": + return GRPCAsyncServerHandler( + context: context, + requestDeserializer: ProtobufDeserializer< + Google_Firebase_Dataconnect_V1beta_ExecuteMutationRequest + >(), + responseSerializer: ProtobufSerializer< + Google_Firebase_Dataconnect_V1beta_ExecuteMutationResponse + >(), + interceptors: interceptors?.makeExecuteMutationInterceptors() ?? [], + wrapping: { try await self.executeMutation(request: $0, context: $1) } + ) + + default: + return nil } } +} -#endif // compiler(>=5.6) - -public protocol Google_Firebase_Dataconnect_V1alpha_ConnectorServiceServerInterceptorFactoryProtocol { +public protocol Google_Firebase_Dataconnect_V1beta_ConnectorServiceServerInterceptorFactoryProtocol: Sendable { /// - Returns: Interceptors to use when handling 'executeQuery'. /// Defaults to calling `self.makeInterceptors()`. func makeExecuteQueryInterceptors() -> [ServerInterceptor< - Google_Firebase_Dataconnect_V1alpha_ExecuteQueryRequest, - Google_Firebase_Dataconnect_V1alpha_ExecuteQueryResponse + Google_Firebase_Dataconnect_V1beta_ExecuteQueryRequest, + Google_Firebase_Dataconnect_V1beta_ExecuteQueryResponse >] /// - Returns: Interceptors to use when handling 'executeMutation'. /// Defaults to calling `self.makeInterceptors()`. func makeExecuteMutationInterceptors() -> [ServerInterceptor< - Google_Firebase_Dataconnect_V1alpha_ExecuteMutationRequest, - Google_Firebase_Dataconnect_V1alpha_ExecuteMutationResponse + Google_Firebase_Dataconnect_V1beta_ExecuteMutationRequest, + Google_Firebase_Dataconnect_V1beta_ExecuteMutationResponse >] } -public enum Google_Firebase_Dataconnect_V1alpha_ConnectorServiceServerMetadata { +public enum Google_Firebase_Dataconnect_V1beta_ConnectorServiceServerMetadata { public static let serviceDescriptor = GRPCServiceDescriptor( name: "ConnectorService", - fullName: "google.firebase.dataconnect.v1alpha.ConnectorService", + fullName: "google.firebase.dataconnect.v1beta.ConnectorService", methods: [ - Google_Firebase_Dataconnect_V1alpha_ConnectorServiceServerMetadata.Methods.executeQuery, - Google_Firebase_Dataconnect_V1alpha_ConnectorServiceServerMetadata.Methods.executeMutation, + Google_Firebase_Dataconnect_V1beta_ConnectorServiceServerMetadata.Methods.executeQuery, + Google_Firebase_Dataconnect_V1beta_ConnectorServiceServerMetadata.Methods.executeMutation, ] ) public enum Methods { public static let executeQuery = GRPCMethodDescriptor( name: "ExecuteQuery", - path: "/google.firebase.dataconnect.v1alpha.ConnectorService/ExecuteQuery", + path: "/google.firebase.dataconnect.v1beta.ConnectorService/ExecuteQuery", type: GRPCCallType.unary ) public static let executeMutation = GRPCMethodDescriptor( name: "ExecuteMutation", - path: "/google.firebase.dataconnect.v1alpha.ConnectorService/ExecuteMutation", + path: "/google.firebase.dataconnect.v1beta.ConnectorService/ExecuteMutation", type: GRPCCallType.unary ) } diff --git a/Sources/ProtoGen/connector_service.pb.swift b/Sources/ProtoGen/connector_service.pb.swift index 31c0695..e15dc74 100644 --- a/Sources/ProtoGen/connector_service.pb.swift +++ b/Sources/ProtoGen/connector_service.pb.swift @@ -7,6 +7,20 @@ // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ +// 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 import Foundation @@ -23,7 +37,7 @@ fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAP } /// The ExecuteQuery request to Firebase Data Connect. -public struct Google_Firebase_Dataconnect_V1alpha_ExecuteQueryRequest { +public struct Google_Firebase_Dataconnect_V1beta_ExecuteQueryRequest { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -60,7 +74,7 @@ public struct Google_Firebase_Dataconnect_V1alpha_ExecuteQueryRequest { } /// The ExecuteMutation request to Firebase Data Connect. -public struct Google_Firebase_Dataconnect_V1alpha_ExecuteMutationRequest { +public struct Google_Firebase_Dataconnect_V1beta_ExecuteMutationRequest { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -97,7 +111,7 @@ public struct Google_Firebase_Dataconnect_V1alpha_ExecuteMutationRequest { } /// The ExecuteQuery response from Firebase Data Connect. -public struct Google_Firebase_Dataconnect_V1alpha_ExecuteQueryResponse { +public struct Google_Firebase_Dataconnect_V1beta_ExecuteQueryResponse { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -113,7 +127,7 @@ public struct Google_Firebase_Dataconnect_V1alpha_ExecuteQueryResponse { public mutating func clearData() {self._data = nil} /// Errors of this response. - public var errors: [Google_Firebase_Dataconnect_V1alpha_GraphqlError] = [] + public var errors: [Google_Firebase_Dataconnect_V1beta_GraphqlError] = [] public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -123,7 +137,7 @@ public struct Google_Firebase_Dataconnect_V1alpha_ExecuteQueryResponse { } /// The ExecuteMutation response from Firebase Data Connect. -public struct Google_Firebase_Dataconnect_V1alpha_ExecuteMutationResponse { +public struct Google_Firebase_Dataconnect_V1beta_ExecuteMutationResponse { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -139,7 +153,7 @@ public struct Google_Firebase_Dataconnect_V1alpha_ExecuteMutationResponse { public mutating func clearData() {self._data = nil} /// Errors of this response. - public var errors: [Google_Firebase_Dataconnect_V1alpha_GraphqlError] = [] + public var errors: [Google_Firebase_Dataconnect_V1beta_GraphqlError] = [] public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -149,17 +163,17 @@ public struct Google_Firebase_Dataconnect_V1alpha_ExecuteMutationResponse { } #if swift(>=5.5) && canImport(_Concurrency) -extension Google_Firebase_Dataconnect_V1alpha_ExecuteQueryRequest: @unchecked Sendable {} -extension Google_Firebase_Dataconnect_V1alpha_ExecuteMutationRequest: @unchecked Sendable {} -extension Google_Firebase_Dataconnect_V1alpha_ExecuteQueryResponse: @unchecked Sendable {} -extension Google_Firebase_Dataconnect_V1alpha_ExecuteMutationResponse: @unchecked Sendable {} +extension Google_Firebase_Dataconnect_V1beta_ExecuteQueryRequest: @unchecked Sendable {} +extension Google_Firebase_Dataconnect_V1beta_ExecuteMutationRequest: @unchecked Sendable {} +extension Google_Firebase_Dataconnect_V1beta_ExecuteQueryResponse: @unchecked Sendable {} +extension Google_Firebase_Dataconnect_V1beta_ExecuteMutationResponse: @unchecked Sendable {} #endif // swift(>=5.5) && canImport(_Concurrency) // MARK: - Code below here is support for the SwiftProtobuf runtime. -fileprivate let _protobuf_package = "google.firebase.dataconnect.v1alpha" +fileprivate let _protobuf_package = "google.firebase.dataconnect.v1beta" -extension Google_Firebase_Dataconnect_V1alpha_ExecuteQueryRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { +extension Google_Firebase_Dataconnect_V1beta_ExecuteQueryRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { public static let protoMessageName: String = _protobuf_package + ".ExecuteQueryRequest" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "name"), @@ -198,7 +212,7 @@ extension Google_Firebase_Dataconnect_V1alpha_ExecuteQueryRequest: SwiftProtobuf try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: Google_Firebase_Dataconnect_V1alpha_ExecuteQueryRequest, rhs: Google_Firebase_Dataconnect_V1alpha_ExecuteQueryRequest) -> Bool { + public static func ==(lhs: Google_Firebase_Dataconnect_V1beta_ExecuteQueryRequest, rhs: Google_Firebase_Dataconnect_V1beta_ExecuteQueryRequest) -> Bool { if lhs.name != rhs.name {return false} if lhs.operationName != rhs.operationName {return false} if lhs._variables != rhs._variables {return false} @@ -207,7 +221,7 @@ extension Google_Firebase_Dataconnect_V1alpha_ExecuteQueryRequest: SwiftProtobuf } } -extension Google_Firebase_Dataconnect_V1alpha_ExecuteMutationRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { +extension Google_Firebase_Dataconnect_V1beta_ExecuteMutationRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { public static let protoMessageName: String = _protobuf_package + ".ExecuteMutationRequest" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "name"), @@ -246,7 +260,7 @@ extension Google_Firebase_Dataconnect_V1alpha_ExecuteMutationRequest: SwiftProto try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: Google_Firebase_Dataconnect_V1alpha_ExecuteMutationRequest, rhs: Google_Firebase_Dataconnect_V1alpha_ExecuteMutationRequest) -> Bool { + public static func ==(lhs: Google_Firebase_Dataconnect_V1beta_ExecuteMutationRequest, rhs: Google_Firebase_Dataconnect_V1beta_ExecuteMutationRequest) -> Bool { if lhs.name != rhs.name {return false} if lhs.operationName != rhs.operationName {return false} if lhs._variables != rhs._variables {return false} @@ -255,7 +269,7 @@ extension Google_Firebase_Dataconnect_V1alpha_ExecuteMutationRequest: SwiftProto } } -extension Google_Firebase_Dataconnect_V1alpha_ExecuteQueryResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { +extension Google_Firebase_Dataconnect_V1beta_ExecuteQueryResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { public static let protoMessageName: String = _protobuf_package + ".ExecuteQueryResponse" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "data"), @@ -289,7 +303,7 @@ extension Google_Firebase_Dataconnect_V1alpha_ExecuteQueryResponse: SwiftProtobu try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: Google_Firebase_Dataconnect_V1alpha_ExecuteQueryResponse, rhs: Google_Firebase_Dataconnect_V1alpha_ExecuteQueryResponse) -> Bool { + public static func ==(lhs: Google_Firebase_Dataconnect_V1beta_ExecuteQueryResponse, rhs: Google_Firebase_Dataconnect_V1beta_ExecuteQueryResponse) -> Bool { if lhs._data != rhs._data {return false} if lhs.errors != rhs.errors {return false} if lhs.unknownFields != rhs.unknownFields {return false} @@ -297,7 +311,7 @@ extension Google_Firebase_Dataconnect_V1alpha_ExecuteQueryResponse: SwiftProtobu } } -extension Google_Firebase_Dataconnect_V1alpha_ExecuteMutationResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { +extension Google_Firebase_Dataconnect_V1beta_ExecuteMutationResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { public static let protoMessageName: String = _protobuf_package + ".ExecuteMutationResponse" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "data"), @@ -331,7 +345,7 @@ extension Google_Firebase_Dataconnect_V1alpha_ExecuteMutationResponse: SwiftProt try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: Google_Firebase_Dataconnect_V1alpha_ExecuteMutationResponse, rhs: Google_Firebase_Dataconnect_V1alpha_ExecuteMutationResponse) -> Bool { + public static func ==(lhs: Google_Firebase_Dataconnect_V1beta_ExecuteMutationResponse, rhs: Google_Firebase_Dataconnect_V1beta_ExecuteMutationResponse) -> Bool { if lhs._data != rhs._data {return false} if lhs.errors != rhs.errors {return false} if lhs.unknownFields != rhs.unknownFields {return false} diff --git a/Sources/ProtoGen/graphql_error.pb.swift b/Sources/ProtoGen/graphql_error.pb.swift index 289e3fa..a4505ea 100644 --- a/Sources/ProtoGen/graphql_error.pb.swift +++ b/Sources/ProtoGen/graphql_error.pb.swift @@ -7,6 +7,20 @@ // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ +// 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. + // Adapted from third_party/firebase/dataconnect/emulator/server/api/graphql_error.proto import Foundation @@ -33,7 +47,7 @@ fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAP /// - Upon query execution error, `ExecuteGraphql`, `ExecuteGraphqlRead`, /// `ExecuteMutation` and `ExecuteQuery` all return Code.OK with a list of /// `GraphqlError` in response body. -public struct Google_Firebase_Dataconnect_V1alpha_GraphqlError { +public struct Google_Firebase_Dataconnect_V1beta_GraphqlError { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -53,7 +67,7 @@ public struct Google_Firebase_Dataconnect_V1alpha_GraphqlError { /// /// Omitted in `ExecuteMutation` and `ExecuteQuery` since the caller shouldn't /// have access access the underlying GQL source. - public var locations: [Google_Firebase_Dataconnect_V1alpha_SourceLocation] = [] + public var locations: [Google_Firebase_Dataconnect_V1beta_SourceLocation] = [] /// The result field which could not be populated due to error. /// @@ -71,8 +85,8 @@ public struct Google_Firebase_Dataconnect_V1alpha_GraphqlError { public mutating func clearPath() {self._path = nil} /// Additional error information. - public var extensions: Google_Firebase_Dataconnect_V1alpha_GraphqlErrorExtensions { - get {return _extensions ?? Google_Firebase_Dataconnect_V1alpha_GraphqlErrorExtensions()} + public var extensions: Google_Firebase_Dataconnect_V1beta_GraphqlErrorExtensions { + get {return _extensions ?? Google_Firebase_Dataconnect_V1beta_GraphqlErrorExtensions()} set {_extensions = newValue} } /// Returns true if `extensions` has been explicitly set. @@ -85,11 +99,11 @@ public struct Google_Firebase_Dataconnect_V1alpha_GraphqlError { public init() {} fileprivate var _path: SwiftProtobuf.Google_Protobuf_ListValue? = nil - fileprivate var _extensions: Google_Firebase_Dataconnect_V1alpha_GraphqlErrorExtensions? = nil + fileprivate var _extensions: Google_Firebase_Dataconnect_V1beta_GraphqlErrorExtensions? = nil } /// SourceLocation references a location in a GraphQL source. -public struct Google_Firebase_Dataconnect_V1alpha_SourceLocation { +public struct Google_Firebase_Dataconnect_V1beta_SourceLocation { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -108,7 +122,7 @@ public struct Google_Firebase_Dataconnect_V1alpha_SourceLocation { /// GraphqlErrorExtensions contains additional information of `GraphqlError`. /// (-- TODO(b/305311379): include more detailed error fields: /// go/firemat:api:gql-errors. --) -public struct Google_Firebase_Dataconnect_V1alpha_GraphqlErrorExtensions { +public struct Google_Firebase_Dataconnect_V1beta_GraphqlErrorExtensions { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -124,16 +138,16 @@ public struct Google_Firebase_Dataconnect_V1alpha_GraphqlErrorExtensions { } #if swift(>=5.5) && canImport(_Concurrency) -extension Google_Firebase_Dataconnect_V1alpha_GraphqlError: @unchecked Sendable {} -extension Google_Firebase_Dataconnect_V1alpha_SourceLocation: @unchecked Sendable {} -extension Google_Firebase_Dataconnect_V1alpha_GraphqlErrorExtensions: @unchecked Sendable {} +extension Google_Firebase_Dataconnect_V1beta_GraphqlError: @unchecked Sendable {} +extension Google_Firebase_Dataconnect_V1beta_SourceLocation: @unchecked Sendable {} +extension Google_Firebase_Dataconnect_V1beta_GraphqlErrorExtensions: @unchecked Sendable {} #endif // swift(>=5.5) && canImport(_Concurrency) // MARK: - Code below here is support for the SwiftProtobuf runtime. -fileprivate let _protobuf_package = "google.firebase.dataconnect.v1alpha" +fileprivate let _protobuf_package = "google.firebase.dataconnect.v1beta" -extension Google_Firebase_Dataconnect_V1alpha_GraphqlError: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { +extension Google_Firebase_Dataconnect_V1beta_GraphqlError: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { public static let protoMessageName: String = _protobuf_package + ".GraphqlError" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "message"), @@ -177,7 +191,7 @@ extension Google_Firebase_Dataconnect_V1alpha_GraphqlError: SwiftProtobuf.Messag try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: Google_Firebase_Dataconnect_V1alpha_GraphqlError, rhs: Google_Firebase_Dataconnect_V1alpha_GraphqlError) -> Bool { + public static func ==(lhs: Google_Firebase_Dataconnect_V1beta_GraphqlError, rhs: Google_Firebase_Dataconnect_V1beta_GraphqlError) -> Bool { if lhs.message != rhs.message {return false} if lhs.locations != rhs.locations {return false} if lhs._path != rhs._path {return false} @@ -187,7 +201,7 @@ extension Google_Firebase_Dataconnect_V1alpha_GraphqlError: SwiftProtobuf.Messag } } -extension Google_Firebase_Dataconnect_V1alpha_SourceLocation: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { +extension Google_Firebase_Dataconnect_V1beta_SourceLocation: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { public static let protoMessageName: String = _protobuf_package + ".SourceLocation" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "line"), @@ -217,7 +231,7 @@ extension Google_Firebase_Dataconnect_V1alpha_SourceLocation: SwiftProtobuf.Mess try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: Google_Firebase_Dataconnect_V1alpha_SourceLocation, rhs: Google_Firebase_Dataconnect_V1alpha_SourceLocation) -> Bool { + public static func ==(lhs: Google_Firebase_Dataconnect_V1beta_SourceLocation, rhs: Google_Firebase_Dataconnect_V1beta_SourceLocation) -> Bool { if lhs.line != rhs.line {return false} if lhs.column != rhs.column {return false} if lhs.unknownFields != rhs.unknownFields {return false} @@ -225,7 +239,7 @@ extension Google_Firebase_Dataconnect_V1alpha_SourceLocation: SwiftProtobuf.Mess } } -extension Google_Firebase_Dataconnect_V1alpha_GraphqlErrorExtensions: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { +extension Google_Firebase_Dataconnect_V1beta_GraphqlErrorExtensions: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { public static let protoMessageName: String = _protobuf_package + ".GraphqlErrorExtensions" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "file"), @@ -250,7 +264,7 @@ extension Google_Firebase_Dataconnect_V1alpha_GraphqlErrorExtensions: SwiftProto try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: Google_Firebase_Dataconnect_V1alpha_GraphqlErrorExtensions, rhs: Google_Firebase_Dataconnect_V1alpha_GraphqlErrorExtensions) -> Bool { + public static func ==(lhs: Google_Firebase_Dataconnect_V1beta_GraphqlErrorExtensions, rhs: Google_Firebase_Dataconnect_V1beta_GraphqlErrorExtensions) -> Bool { if lhs.file != rhs.file {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true