@@ -686,6 +686,173 @@ extension Grpc_Testing_TestService.ClientProtocol {
686
686
}
687
687
}
688
688
689
+ @available ( macOS 15 . 0 , iOS 18 . 0 , watchOS 11 . 0 , tvOS 18 . 0 , visionOS 2 . 0 , * )
690
+ extension Grpc_Testing_TestService . ClientProtocol {
691
+ /// One empty request followed by one empty response.
692
+ public func emptyCall< Result> (
693
+ _ message: Grpc_Testing_Empty ,
694
+ metadata: GRPCCore . Metadata = [ : ] ,
695
+ options: GRPCCore . CallOptions = . defaults,
696
+ onResponse handleResponse: @Sendable @escaping ( GRPCCore . ClientResponse . Single < Grpc_Testing_Empty > ) async throws -> Result = {
697
+ try $0. message
698
+ }
699
+ ) async throws -> Result where Result: Sendable {
700
+ let request = GRPCCore . ClientRequest. Single< Grpc_Testing_Empty> (
701
+ message: message,
702
+ metadata: metadata
703
+ )
704
+ return try await self . emptyCall (
705
+ request: request,
706
+ options: options,
707
+ handleResponse
708
+ )
709
+ }
710
+
711
+ /// One request followed by one response.
712
+ public func unaryCall< Result> (
713
+ _ message: Grpc_Testing_SimpleRequest ,
714
+ metadata: GRPCCore . Metadata = [ : ] ,
715
+ options: GRPCCore . CallOptions = . defaults,
716
+ onResponse handleResponse: @Sendable @escaping ( GRPCCore . ClientResponse . Single < Grpc_Testing_SimpleResponse > ) async throws -> Result = {
717
+ try $0. message
718
+ }
719
+ ) async throws -> Result where Result: Sendable {
720
+ let request = GRPCCore . ClientRequest. Single< Grpc_Testing_SimpleRequest> (
721
+ message: message,
722
+ metadata: metadata
723
+ )
724
+ return try await self . unaryCall (
725
+ request: request,
726
+ options: options,
727
+ handleResponse
728
+ )
729
+ }
730
+
731
+ /// One request followed by one response. Response has cache control
732
+ /// headers set such that a caching HTTP proxy (such as GFE) can
733
+ /// satisfy subsequent requests.
734
+ public func cacheableUnaryCall< Result> (
735
+ _ message: Grpc_Testing_SimpleRequest ,
736
+ metadata: GRPCCore . Metadata = [ : ] ,
737
+ options: GRPCCore . CallOptions = . defaults,
738
+ onResponse handleResponse: @Sendable @escaping ( GRPCCore . ClientResponse . Single < Grpc_Testing_SimpleResponse > ) async throws -> Result = {
739
+ try $0. message
740
+ }
741
+ ) async throws -> Result where Result: Sendable {
742
+ let request = GRPCCore . ClientRequest. Single< Grpc_Testing_SimpleRequest> (
743
+ message: message,
744
+ metadata: metadata
745
+ )
746
+ return try await self . cacheableUnaryCall (
747
+ request: request,
748
+ options: options,
749
+ handleResponse
750
+ )
751
+ }
752
+
753
+ /// One request followed by a sequence of responses (streamed download).
754
+ /// The server returns the payload with client desired type and sizes.
755
+ public func streamingOutputCall< Result> (
756
+ _ message: Grpc_Testing_StreamingOutputCallRequest ,
757
+ metadata: GRPCCore . Metadata = [ : ] ,
758
+ options: GRPCCore . CallOptions = . defaults,
759
+ onResponse handleResponse: @Sendable @escaping ( GRPCCore . ClientResponse . Stream < Grpc_Testing_StreamingOutputCallResponse > ) async throws -> Result
760
+ ) async throws -> Result where Result: Sendable {
761
+ let request = GRPCCore . ClientRequest. Single< Grpc_Testing_StreamingOutputCallRequest> (
762
+ message: message,
763
+ metadata: metadata
764
+ )
765
+ return try await self . streamingOutputCall (
766
+ request: request,
767
+ options: options,
768
+ handleResponse
769
+ )
770
+ }
771
+
772
+ /// A sequence of requests followed by one response (streamed upload).
773
+ /// The server returns the aggregated size of client payload as the result.
774
+ public func streamingInputCall< Result> (
775
+ metadata: GRPCCore . Metadata = [ : ] ,
776
+ options: GRPCCore . CallOptions = . defaults,
777
+ requestProducer: @Sendable @escaping ( GRPCCore . RPCWriter < Grpc_Testing_StreamingInputCallRequest > ) async throws -> Void ,
778
+ onResponse handleResponse: @Sendable @escaping ( GRPCCore . ClientResponse . Single < Grpc_Testing_StreamingInputCallResponse > ) async throws -> Result = {
779
+ try $0. message
780
+ }
781
+ ) async throws -> Result where Result: Sendable {
782
+ let request = GRPCCore . ClientRequest. Stream< Grpc_Testing_StreamingInputCallRequest> (
783
+ metadata: metadata,
784
+ producer: requestProducer
785
+ )
786
+ return try await self . streamingInputCall (
787
+ request: request,
788
+ options: options,
789
+ handleResponse
790
+ )
791
+ }
792
+
793
+ /// A sequence of requests with each request served by the server immediately.
794
+ /// As one request could lead to multiple responses, this interface
795
+ /// demonstrates the idea of full duplexing.
796
+ public func fullDuplexCall< Result> (
797
+ metadata: GRPCCore . Metadata = [ : ] ,
798
+ options: GRPCCore . CallOptions = . defaults,
799
+ requestProducer: @Sendable @escaping ( GRPCCore . RPCWriter < Grpc_Testing_StreamingOutputCallRequest > ) async throws -> Void ,
800
+ onResponse handleResponse: @Sendable @escaping ( GRPCCore . ClientResponse . Stream < Grpc_Testing_StreamingOutputCallResponse > ) async throws -> Result
801
+ ) async throws -> Result where Result: Sendable {
802
+ let request = GRPCCore . ClientRequest. Stream< Grpc_Testing_StreamingOutputCallRequest> (
803
+ metadata: metadata,
804
+ producer: requestProducer
805
+ )
806
+ return try await self . fullDuplexCall (
807
+ request: request,
808
+ options: options,
809
+ handleResponse
810
+ )
811
+ }
812
+
813
+ /// A sequence of requests followed by a sequence of responses.
814
+ /// The server buffers all the client requests and then serves them in order. A
815
+ /// stream of responses are returned to the client when the server starts with
816
+ /// first request.
817
+ public func halfDuplexCall< Result> (
818
+ metadata: GRPCCore . Metadata = [ : ] ,
819
+ options: GRPCCore . CallOptions = . defaults,
820
+ requestProducer: @Sendable @escaping ( GRPCCore . RPCWriter < Grpc_Testing_StreamingOutputCallRequest > ) async throws -> Void ,
821
+ onResponse handleResponse: @Sendable @escaping ( GRPCCore . ClientResponse . Stream < Grpc_Testing_StreamingOutputCallResponse > ) async throws -> Result
822
+ ) async throws -> Result where Result: Sendable {
823
+ let request = GRPCCore . ClientRequest. Stream< Grpc_Testing_StreamingOutputCallRequest> (
824
+ metadata: metadata,
825
+ producer: requestProducer
826
+ )
827
+ return try await self . halfDuplexCall (
828
+ request: request,
829
+ options: options,
830
+ handleResponse
831
+ )
832
+ }
833
+
834
+ /// The test server will not implement this method. It will be used
835
+ /// to test the behavior when clients call unimplemented methods.
836
+ public func unimplementedCall< Result> (
837
+ _ message: Grpc_Testing_Empty ,
838
+ metadata: GRPCCore . Metadata = [ : ] ,
839
+ options: GRPCCore . CallOptions = . defaults,
840
+ onResponse handleResponse: @Sendable @escaping ( GRPCCore . ClientResponse . Single < Grpc_Testing_Empty > ) async throws -> Result = {
841
+ try $0. message
842
+ }
843
+ ) async throws -> Result where Result: Sendable {
844
+ let request = GRPCCore . ClientRequest. Single< Grpc_Testing_Empty> (
845
+ message: message,
846
+ metadata: metadata
847
+ )
848
+ return try await self . unimplementedCall (
849
+ request: request,
850
+ options: options,
851
+ handleResponse
852
+ )
853
+ }
854
+ }
855
+
689
856
/// A simple service to test the various types of RPCs and experiment with
690
857
/// performance with various types of payload.
691
858
@available ( macOS 15 . 0 , iOS 18 . 0 , watchOS 11 . 0 , tvOS 18 . 0 , visionOS 2 . 0 , * )
@@ -894,6 +1061,29 @@ extension Grpc_Testing_UnimplementedService.ClientProtocol {
894
1061
}
895
1062
}
896
1063
1064
+ @available ( macOS 15 . 0 , iOS 18 . 0 , watchOS 11 . 0 , tvOS 18 . 0 , visionOS 2 . 0 , * )
1065
+ extension Grpc_Testing_UnimplementedService . ClientProtocol {
1066
+ /// A call that no server should implement
1067
+ public func unimplementedCall< Result> (
1068
+ _ message: Grpc_Testing_Empty ,
1069
+ metadata: GRPCCore . Metadata = [ : ] ,
1070
+ options: GRPCCore . CallOptions = . defaults,
1071
+ onResponse handleResponse: @Sendable @escaping ( GRPCCore . ClientResponse . Single < Grpc_Testing_Empty > ) async throws -> Result = {
1072
+ try $0. message
1073
+ }
1074
+ ) async throws -> Result where Result: Sendable {
1075
+ let request = GRPCCore . ClientRequest. Single< Grpc_Testing_Empty> (
1076
+ message: message,
1077
+ metadata: metadata
1078
+ )
1079
+ return try await self . unimplementedCall (
1080
+ request: request,
1081
+ options: options,
1082
+ handleResponse
1083
+ )
1084
+ }
1085
+ }
1086
+
897
1087
/// A simple service NOT implemented at servers so clients can test for
898
1088
/// that case.
899
1089
@available ( macOS 15 . 0 , iOS 18 . 0 , watchOS 11 . 0 , tvOS 18 . 0 , visionOS 2 . 0 , * )
@@ -980,6 +1170,47 @@ extension Grpc_Testing_ReconnectService.ClientProtocol {
980
1170
}
981
1171
}
982
1172
1173
+ @available ( macOS 15 . 0 , iOS 18 . 0 , watchOS 11 . 0 , tvOS 18 . 0 , visionOS 2 . 0 , * )
1174
+ extension Grpc_Testing_ReconnectService . ClientProtocol {
1175
+ public func start< Result> (
1176
+ _ message: Grpc_Testing_ReconnectParams ,
1177
+ metadata: GRPCCore . Metadata = [ : ] ,
1178
+ options: GRPCCore . CallOptions = . defaults,
1179
+ onResponse handleResponse: @Sendable @escaping ( GRPCCore . ClientResponse . Single < Grpc_Testing_Empty > ) async throws -> Result = {
1180
+ try $0. message
1181
+ }
1182
+ ) async throws -> Result where Result: Sendable {
1183
+ let request = GRPCCore . ClientRequest. Single< Grpc_Testing_ReconnectParams> (
1184
+ message: message,
1185
+ metadata: metadata
1186
+ )
1187
+ return try await self . start (
1188
+ request: request,
1189
+ options: options,
1190
+ handleResponse
1191
+ )
1192
+ }
1193
+
1194
+ public func stop< Result> (
1195
+ _ message: Grpc_Testing_Empty ,
1196
+ metadata: GRPCCore . Metadata = [ : ] ,
1197
+ options: GRPCCore . CallOptions = . defaults,
1198
+ onResponse handleResponse: @Sendable @escaping ( GRPCCore . ClientResponse . Single < Grpc_Testing_ReconnectInfo > ) async throws -> Result = {
1199
+ try $0. message
1200
+ }
1201
+ ) async throws -> Result where Result: Sendable {
1202
+ let request = GRPCCore . ClientRequest. Single< Grpc_Testing_Empty> (
1203
+ message: message,
1204
+ metadata: metadata
1205
+ )
1206
+ return try await self . stop (
1207
+ request: request,
1208
+ options: options,
1209
+ handleResponse
1210
+ )
1211
+ }
1212
+ }
1213
+
983
1214
/// A service used to control reconnect server.
984
1215
@available ( macOS 15 . 0 , iOS 18 . 0 , watchOS 11 . 0 , tvOS 18 . 0 , visionOS 2 . 0 , * )
985
1216
public struct Grpc_Testing_ReconnectServiceClient : Grpc_Testing_ReconnectService . ClientProtocol {
0 commit comments