1+ // DO NOT EDIT.
2+ // swift-format-ignore-file
3+ // swiftlint:disable all
4+ //
5+ // Generated by the gRPC Swift generator plugin for the protocol buffer compiler.
6+ // Source: balance/v1/ocp_balance_service.proto
7+ //
8+ // For information on using the generated types, please see the documentation:
9+ // https://github.com/grpc/grpc-swift
10+
11+ import GRPCCore
12+ import GRPCProtobuf
13+
14+ // MARK: - ocp.balance.v1.Balance
15+
16+ /// Namespace containing generated types for the "ocp.balance.v1.Balance" service.
17+ @available ( macOS 15 . 0 , iOS 18 . 0 , watchOS 11 . 0 , tvOS 18 . 0 , visionOS 2 . 0 , * )
18+ public enum Ocp_Balance_V1_Balance {
19+ /// Service descriptor for the "ocp.balance.v1.Balance" service.
20+ public static let descriptor = GRPCCore . ServiceDescriptor ( fullyQualifiedService: " ocp.balance.v1.Balance " )
21+ /// Namespace for method metadata.
22+ public enum Method {
23+ /// Namespace for "GetBalance" metadata.
24+ public enum GetBalance {
25+ /// Request type for "GetBalance".
26+ public typealias Input = Ocp_Balance_V1_GetBalanceRequest
27+ /// Response type for "GetBalance".
28+ public typealias Output = Ocp_Balance_V1_GetBalanceResponse
29+ /// Descriptor for "GetBalance".
30+ public static let descriptor = GRPCCore . MethodDescriptor (
31+ service: GRPCCore . ServiceDescriptor ( fullyQualifiedService: " ocp.balance.v1.Balance " ) ,
32+ method: " GetBalance "
33+ )
34+ }
35+ /// Descriptors for all methods in the "ocp.balance.v1.Balance" service.
36+ public static let descriptors : [ GRPCCore . MethodDescriptor ] = [
37+ GetBalance . descriptor
38+ ]
39+ }
40+ }
41+
42+ @available ( macOS 15 . 0 , iOS 18 . 0 , watchOS 11 . 0 , tvOS 18 . 0 , visionOS 2 . 0 , * )
43+ extension GRPCCore . ServiceDescriptor {
44+ /// Service descriptor for the "ocp.balance.v1.Balance" service.
45+ public static let ocp_balance_v1_Balance = GRPCCore . ServiceDescriptor ( fullyQualifiedService: " ocp.balance.v1.Balance " )
46+ }
47+
48+ // MARK: ocp.balance.v1.Balance (client)
49+
50+ @available ( macOS 15 . 0 , iOS 18 . 0 , watchOS 11 . 0 , tvOS 18 . 0 , visionOS 2 . 0 , * )
51+ extension Ocp_Balance_V1_Balance {
52+ /// Generated client protocol for the "ocp.balance.v1.Balance" service.
53+ ///
54+ /// You don't need to implement this protocol directly, use the generated
55+ /// implementation, ``Client``.
56+ public protocol ClientProtocol : Sendable {
57+ /// Call the "GetBalance" method.
58+ ///
59+ /// > Source IDL Documentation:
60+ /// >
61+ /// > GetBalance returns balance data for any owner account
62+ ///
63+ /// - Parameters:
64+ /// - request: A request containing a single `Ocp_Balance_V1_GetBalanceRequest` message.
65+ /// - serializer: A serializer for `Ocp_Balance_V1_GetBalanceRequest` messages.
66+ /// - deserializer: A deserializer for `Ocp_Balance_V1_GetBalanceResponse` messages.
67+ /// - options: Options to apply to this RPC.
68+ /// - handleResponse: A closure which handles the response, the result of which is
69+ /// returned to the caller. Returning from the closure will cancel the RPC if it
70+ /// hasn't already finished.
71+ /// - Returns: The result of `handleResponse`.
72+ func getBalance< Result> (
73+ request: GRPCCore . ClientRequest < Ocp_Balance_V1_GetBalanceRequest > ,
74+ serializer: some GRPCCore . MessageSerializer < Ocp_Balance_V1_GetBalanceRequest > ,
75+ deserializer: some GRPCCore . MessageDeserializer < Ocp_Balance_V1_GetBalanceResponse > ,
76+ options: GRPCCore . CallOptions ,
77+ onResponse handleResponse: @Sendable @escaping ( GRPCCore . ClientResponse < Ocp_Balance_V1_GetBalanceResponse > ) async throws -> Result
78+ ) async throws -> Result where Result: Sendable
79+ }
80+
81+ /// Generated client for the "ocp.balance.v1.Balance" service.
82+ ///
83+ /// The ``Client`` provides an implementation of ``ClientProtocol`` which wraps
84+ /// a `GRPCCore.GRPCCClient`. The underlying `GRPCClient` provides the long-lived
85+ /// means of communication with the remote peer.
86+ public struct Client < Transport> : ClientProtocol where Transport: GRPCCore . ClientTransport {
87+ private let client : GRPCCore . GRPCClient < Transport >
88+
89+ /// Creates a new client wrapping the provided `GRPCCore.GRPCClient`.
90+ ///
91+ /// - Parameters:
92+ /// - client: A `GRPCCore.GRPCClient` providing a communication channel to the service.
93+ public init ( wrapping client: GRPCCore . GRPCClient < Transport > ) {
94+ self . client = client
95+ }
96+
97+ /// Call the "GetBalance" method.
98+ ///
99+ /// > Source IDL Documentation:
100+ /// >
101+ /// > GetBalance returns balance data for any owner account
102+ ///
103+ /// - Parameters:
104+ /// - request: A request containing a single `Ocp_Balance_V1_GetBalanceRequest` message.
105+ /// - serializer: A serializer for `Ocp_Balance_V1_GetBalanceRequest` messages.
106+ /// - deserializer: A deserializer for `Ocp_Balance_V1_GetBalanceResponse` messages.
107+ /// - options: Options to apply to this RPC.
108+ /// - handleResponse: A closure which handles the response, the result of which is
109+ /// returned to the caller. Returning from the closure will cancel the RPC if it
110+ /// hasn't already finished.
111+ /// - Returns: The result of `handleResponse`.
112+ public func getBalance< Result> (
113+ request: GRPCCore . ClientRequest < Ocp_Balance_V1_GetBalanceRequest > ,
114+ serializer: some GRPCCore . MessageSerializer < Ocp_Balance_V1_GetBalanceRequest > ,
115+ deserializer: some GRPCCore . MessageDeserializer < Ocp_Balance_V1_GetBalanceResponse > ,
116+ options: GRPCCore . CallOptions = . defaults,
117+ onResponse handleResponse: @Sendable @escaping ( GRPCCore . ClientResponse < Ocp_Balance_V1_GetBalanceResponse > ) async throws -> Result = { response in
118+ try response. message
119+ }
120+ ) async throws -> Result where Result: Sendable {
121+ try await self . client. unary (
122+ request: request,
123+ descriptor: Ocp_Balance_V1_Balance . Method. GetBalance. descriptor,
124+ serializer: serializer,
125+ deserializer: deserializer,
126+ options: options,
127+ onResponse: handleResponse
128+ )
129+ }
130+ }
131+ }
132+
133+ // Helpers providing default arguments to 'ClientProtocol' methods.
134+ @available ( macOS 15 . 0 , iOS 18 . 0 , watchOS 11 . 0 , tvOS 18 . 0 , visionOS 2 . 0 , * )
135+ extension Ocp_Balance_V1_Balance . ClientProtocol {
136+ /// Call the "GetBalance" method.
137+ ///
138+ /// > Source IDL Documentation:
139+ /// >
140+ /// > GetBalance returns balance data for any owner account
141+ ///
142+ /// - Parameters:
143+ /// - request: A request containing a single `Ocp_Balance_V1_GetBalanceRequest` message.
144+ /// - options: Options to apply to this RPC.
145+ /// - handleResponse: A closure which handles the response, the result of which is
146+ /// returned to the caller. Returning from the closure will cancel the RPC if it
147+ /// hasn't already finished.
148+ /// - Returns: The result of `handleResponse`.
149+ public func getBalance< Result> (
150+ request: GRPCCore . ClientRequest < Ocp_Balance_V1_GetBalanceRequest > ,
151+ options: GRPCCore . CallOptions = . defaults,
152+ onResponse handleResponse: @Sendable @escaping ( GRPCCore . ClientResponse < Ocp_Balance_V1_GetBalanceResponse > ) async throws -> Result = { response in
153+ try response. message
154+ }
155+ ) async throws -> Result where Result: Sendable {
156+ try await self . getBalance (
157+ request: request,
158+ serializer: GRPCProtobuf . ProtobufSerializer < Ocp_Balance_V1_GetBalanceRequest > ( ) ,
159+ deserializer: GRPCProtobuf . ProtobufDeserializer < Ocp_Balance_V1_GetBalanceResponse > ( ) ,
160+ options: options,
161+ onResponse: handleResponse
162+ )
163+ }
164+ }
165+
166+ // Helpers providing sugared APIs for 'ClientProtocol' methods.
167+ @available ( macOS 15 . 0 , iOS 18 . 0 , watchOS 11 . 0 , tvOS 18 . 0 , visionOS 2 . 0 , * )
168+ extension Ocp_Balance_V1_Balance . ClientProtocol {
169+ /// Call the "GetBalance" method.
170+ ///
171+ /// > Source IDL Documentation:
172+ /// >
173+ /// > GetBalance returns balance data for any owner account
174+ ///
175+ /// - Parameters:
176+ /// - message: request message to send.
177+ /// - metadata: Additional metadata to send, defaults to empty.
178+ /// - options: Options to apply to this RPC, defaults to `.defaults`.
179+ /// - handleResponse: A closure which handles the response, the result of which is
180+ /// returned to the caller. Returning from the closure will cancel the RPC if it
181+ /// hasn't already finished.
182+ /// - Returns: The result of `handleResponse`.
183+ public func getBalance< Result> (
184+ _ message: Ocp_Balance_V1_GetBalanceRequest ,
185+ metadata: GRPCCore . Metadata = [ : ] ,
186+ options: GRPCCore . CallOptions = . defaults,
187+ onResponse handleResponse: @Sendable @escaping ( GRPCCore . ClientResponse < Ocp_Balance_V1_GetBalanceResponse > ) async throws -> Result = { response in
188+ try response. message
189+ }
190+ ) async throws -> Result where Result: Sendable {
191+ let request = GRPCCore . ClientRequest< Ocp_Balance_V1_GetBalanceRequest> (
192+ message: message,
193+ metadata: metadata
194+ )
195+ return try await self . getBalance (
196+ request: request,
197+ options: options,
198+ onResponse: handleResponse
199+ )
200+ }
201+ }
0 commit comments