@@ -33,74 +33,49 @@ import com.withorb.api.services.async.SubscriptionServiceAsyncImpl
3333import com.withorb.api.services.async.TopLevelServiceAsync
3434import com.withorb.api.services.async.TopLevelServiceAsyncImpl
3535
36- class OrbClientAsyncImpl (private val clientOptions : ClientOptions ) : OrbClientAsync {
36+ class OrbClientAsyncImpl (
37+ private val clientOptions : ClientOptions ,
38+
39+ ) : OrbClientAsync {
3740
3841 private val clientOptionsWithUserAgent =
39- if (clientOptions.headers.names().contains(" User-Agent" )) clientOptions
40- else
41- clientOptions
42- .toBuilder()
43- .putHeader(" User-Agent" , " ${javaClass.simpleName} /Java ${getPackageVersion()} " )
44- .build()
42+
43+ if (clientOptions.headers.names().contains(" User-Agent" )) clientOptions
44+
45+ else clientOptions.toBuilder().putHeader(" User-Agent" , " ${javaClass.simpleName} /Java ${getPackageVersion()} " ).build()
4546
4647 // Pass the original clientOptions so that this client sets its own User-Agent.
4748 private val sync: OrbClient by lazy { OrbClientImpl (clientOptions) }
4849
49- private val withRawResponse: OrbClientAsync .WithRawResponse by lazy {
50- WithRawResponseImpl (clientOptions)
51- }
50+ private val withRawResponse: OrbClientAsync .WithRawResponse by lazy { WithRawResponseImpl (clientOptions) }
5251
53- private val topLevel: TopLevelServiceAsync by lazy {
54- TopLevelServiceAsyncImpl (clientOptionsWithUserAgent)
55- }
52+ private val topLevel: TopLevelServiceAsync by lazy { TopLevelServiceAsyncImpl (clientOptionsWithUserAgent) }
5653
57- private val coupons: CouponServiceAsync by lazy {
58- CouponServiceAsyncImpl (clientOptionsWithUserAgent)
59- }
54+ private val coupons: CouponServiceAsync by lazy { CouponServiceAsyncImpl (clientOptionsWithUserAgent) }
6055
61- private val creditNotes: CreditNoteServiceAsync by lazy {
62- CreditNoteServiceAsyncImpl (clientOptionsWithUserAgent)
63- }
56+ private val creditNotes: CreditNoteServiceAsync by lazy { CreditNoteServiceAsyncImpl (clientOptionsWithUserAgent) }
6457
65- private val customers: CustomerServiceAsync by lazy {
66- CustomerServiceAsyncImpl (clientOptionsWithUserAgent)
67- }
58+ private val customers: CustomerServiceAsync by lazy { CustomerServiceAsyncImpl (clientOptionsWithUserAgent) }
6859
69- private val events: EventServiceAsync by lazy {
70- EventServiceAsyncImpl (clientOptionsWithUserAgent)
71- }
60+ private val events: EventServiceAsync by lazy { EventServiceAsyncImpl (clientOptionsWithUserAgent) }
7261
73- private val invoiceLineItems: InvoiceLineItemServiceAsync by lazy {
74- InvoiceLineItemServiceAsyncImpl (clientOptionsWithUserAgent)
75- }
62+ private val invoiceLineItems: InvoiceLineItemServiceAsync by lazy { InvoiceLineItemServiceAsyncImpl (clientOptionsWithUserAgent) }
7663
77- private val invoices: InvoiceServiceAsync by lazy {
78- InvoiceServiceAsyncImpl (clientOptionsWithUserAgent)
79- }
64+ private val invoices: InvoiceServiceAsync by lazy { InvoiceServiceAsyncImpl (clientOptionsWithUserAgent) }
8065
8166 private val items: ItemServiceAsync by lazy { ItemServiceAsyncImpl (clientOptionsWithUserAgent) }
8267
83- private val metrics: MetricServiceAsync by lazy {
84- MetricServiceAsyncImpl (clientOptionsWithUserAgent)
85- }
68+ private val metrics: MetricServiceAsync by lazy { MetricServiceAsyncImpl (clientOptionsWithUserAgent) }
8669
8770 private val plans: PlanServiceAsync by lazy { PlanServiceAsyncImpl (clientOptionsWithUserAgent) }
8871
89- private val prices: PriceServiceAsync by lazy {
90- PriceServiceAsyncImpl (clientOptionsWithUserAgent)
91- }
72+ private val prices: PriceServiceAsync by lazy { PriceServiceAsyncImpl (clientOptionsWithUserAgent) }
9273
93- private val subscriptions: SubscriptionServiceAsync by lazy {
94- SubscriptionServiceAsyncImpl (clientOptionsWithUserAgent)
95- }
74+ private val subscriptions: SubscriptionServiceAsync by lazy { SubscriptionServiceAsyncImpl (clientOptionsWithUserAgent) }
9675
97- private val alerts: AlertServiceAsync by lazy {
98- AlertServiceAsyncImpl (clientOptionsWithUserAgent)
99- }
76+ private val alerts: AlertServiceAsync by lazy { AlertServiceAsyncImpl (clientOptionsWithUserAgent) }
10077
101- private val dimensionalPriceGroups: DimensionalPriceGroupServiceAsync by lazy {
102- DimensionalPriceGroupServiceAsyncImpl (clientOptionsWithUserAgent)
103- }
78+ private val dimensionalPriceGroups: DimensionalPriceGroupServiceAsync by lazy { DimensionalPriceGroupServiceAsyncImpl (clientOptionsWithUserAgent) }
10479
10580 override fun sync (): OrbClient = sync
10681
@@ -132,70 +107,42 @@ class OrbClientAsyncImpl(private val clientOptions: ClientOptions) : OrbClientAs
132107
133108 override fun alerts (): AlertServiceAsync = alerts
134109
135- override fun dimensionalPriceGroups (): DimensionalPriceGroupServiceAsync =
136- dimensionalPriceGroups
110+ override fun dimensionalPriceGroups (): DimensionalPriceGroupServiceAsync = dimensionalPriceGroups
137111
138112 override fun close () = clientOptions.httpClient.close()
139113
140- class WithRawResponseImpl internal constructor(private val clientOptions : ClientOptions ) :
141- OrbClientAsync .WithRawResponse {
114+ class WithRawResponseImpl internal constructor(
115+ private val clientOptions : ClientOptions ,
116+
117+ ) : OrbClientAsync.WithRawResponse {
142118
143- private val topLevel: TopLevelServiceAsync .WithRawResponse by lazy {
144- TopLevelServiceAsyncImpl .WithRawResponseImpl (clientOptions)
145- }
119+ private val topLevel: TopLevelServiceAsync .WithRawResponse by lazy { TopLevelServiceAsyncImpl .WithRawResponseImpl (clientOptions) }
146120
147- private val coupons: CouponServiceAsync .WithRawResponse by lazy {
148- CouponServiceAsyncImpl .WithRawResponseImpl (clientOptions)
149- }
121+ private val coupons: CouponServiceAsync .WithRawResponse by lazy { CouponServiceAsyncImpl .WithRawResponseImpl (clientOptions) }
150122
151- private val creditNotes: CreditNoteServiceAsync .WithRawResponse by lazy {
152- CreditNoteServiceAsyncImpl .WithRawResponseImpl (clientOptions)
153- }
123+ private val creditNotes: CreditNoteServiceAsync .WithRawResponse by lazy { CreditNoteServiceAsyncImpl .WithRawResponseImpl (clientOptions) }
154124
155- private val customers: CustomerServiceAsync .WithRawResponse by lazy {
156- CustomerServiceAsyncImpl .WithRawResponseImpl (clientOptions)
157- }
125+ private val customers: CustomerServiceAsync .WithRawResponse by lazy { CustomerServiceAsyncImpl .WithRawResponseImpl (clientOptions) }
158126
159- private val events: EventServiceAsync .WithRawResponse by lazy {
160- EventServiceAsyncImpl .WithRawResponseImpl (clientOptions)
161- }
127+ private val events: EventServiceAsync .WithRawResponse by lazy { EventServiceAsyncImpl .WithRawResponseImpl (clientOptions) }
162128
163- private val invoiceLineItems: InvoiceLineItemServiceAsync .WithRawResponse by lazy {
164- InvoiceLineItemServiceAsyncImpl .WithRawResponseImpl (clientOptions)
165- }
129+ private val invoiceLineItems: InvoiceLineItemServiceAsync .WithRawResponse by lazy { InvoiceLineItemServiceAsyncImpl .WithRawResponseImpl (clientOptions) }
166130
167- private val invoices: InvoiceServiceAsync .WithRawResponse by lazy {
168- InvoiceServiceAsyncImpl .WithRawResponseImpl (clientOptions)
169- }
131+ private val invoices: InvoiceServiceAsync .WithRawResponse by lazy { InvoiceServiceAsyncImpl .WithRawResponseImpl (clientOptions) }
170132
171- private val items: ItemServiceAsync .WithRawResponse by lazy {
172- ItemServiceAsyncImpl .WithRawResponseImpl (clientOptions)
173- }
133+ private val items: ItemServiceAsync .WithRawResponse by lazy { ItemServiceAsyncImpl .WithRawResponseImpl (clientOptions) }
174134
175- private val metrics: MetricServiceAsync .WithRawResponse by lazy {
176- MetricServiceAsyncImpl .WithRawResponseImpl (clientOptions)
177- }
135+ private val metrics: MetricServiceAsync .WithRawResponse by lazy { MetricServiceAsyncImpl .WithRawResponseImpl (clientOptions) }
178136
179- private val plans: PlanServiceAsync .WithRawResponse by lazy {
180- PlanServiceAsyncImpl .WithRawResponseImpl (clientOptions)
181- }
137+ private val plans: PlanServiceAsync .WithRawResponse by lazy { PlanServiceAsyncImpl .WithRawResponseImpl (clientOptions) }
182138
183- private val prices: PriceServiceAsync .WithRawResponse by lazy {
184- PriceServiceAsyncImpl .WithRawResponseImpl (clientOptions)
185- }
139+ private val prices: PriceServiceAsync .WithRawResponse by lazy { PriceServiceAsyncImpl .WithRawResponseImpl (clientOptions) }
186140
187- private val subscriptions: SubscriptionServiceAsync .WithRawResponse by lazy {
188- SubscriptionServiceAsyncImpl .WithRawResponseImpl (clientOptions)
189- }
141+ private val subscriptions: SubscriptionServiceAsync .WithRawResponse by lazy { SubscriptionServiceAsyncImpl .WithRawResponseImpl (clientOptions) }
190142
191- private val alerts: AlertServiceAsync .WithRawResponse by lazy {
192- AlertServiceAsyncImpl .WithRawResponseImpl (clientOptions)
193- }
143+ private val alerts: AlertServiceAsync .WithRawResponse by lazy { AlertServiceAsyncImpl .WithRawResponseImpl (clientOptions) }
194144
195- private val dimensionalPriceGroups:
196- DimensionalPriceGroupServiceAsync .WithRawResponse by lazy {
197- DimensionalPriceGroupServiceAsyncImpl .WithRawResponseImpl (clientOptions)
198- }
145+ private val dimensionalPriceGroups: DimensionalPriceGroupServiceAsync .WithRawResponse by lazy { DimensionalPriceGroupServiceAsyncImpl .WithRawResponseImpl (clientOptions) }
199146
200147 override fun topLevel (): TopLevelServiceAsync .WithRawResponse = topLevel
201148
@@ -207,8 +154,7 @@ class OrbClientAsyncImpl(private val clientOptions: ClientOptions) : OrbClientAs
207154
208155 override fun events (): EventServiceAsync .WithRawResponse = events
209156
210- override fun invoiceLineItems (): InvoiceLineItemServiceAsync .WithRawResponse =
211- invoiceLineItems
157+ override fun invoiceLineItems (): InvoiceLineItemServiceAsync .WithRawResponse = invoiceLineItems
212158
213159 override fun invoices (): InvoiceServiceAsync .WithRawResponse = invoices
214160
@@ -224,7 +170,6 @@ class OrbClientAsyncImpl(private val clientOptions: ClientOptions) : OrbClientAs
224170
225171 override fun alerts (): AlertServiceAsync .WithRawResponse = alerts
226172
227- override fun dimensionalPriceGroups (): DimensionalPriceGroupServiceAsync .WithRawResponse =
228- dimensionalPriceGroups
173+ override fun dimensionalPriceGroups (): DimensionalPriceGroupServiceAsync .WithRawResponse = dimensionalPriceGroups
229174 }
230175}
0 commit comments