@@ -33,49 +33,74 @@ 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 (
37- private val clientOptions : ClientOptions ,
38-
39- ) : OrbClientAsync {
36+ class OrbClientAsyncImpl (private val clientOptions : ClientOptions ) : OrbClientAsync {
4037
4138 private val clientOptionsWithUserAgent =
42-
43- if (clientOptions.headers.names().contains(" User-Agent" )) clientOptions
44-
45- else clientOptions.toBuilder().putHeader(" User-Agent" , " ${javaClass.simpleName} /Java ${getPackageVersion()} " ).build()
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()
4645
4746 // Pass the original clientOptions so that this client sets its own User-Agent.
4847 private val sync: OrbClient by lazy { OrbClientImpl (clientOptions) }
4948
50- private val withRawResponse: OrbClientAsync .WithRawResponse by lazy { WithRawResponseImpl (clientOptions) }
49+ private val withRawResponse: OrbClientAsync .WithRawResponse by lazy {
50+ WithRawResponseImpl (clientOptions)
51+ }
5152
52- private val topLevel: TopLevelServiceAsync by lazy { TopLevelServiceAsyncImpl (clientOptionsWithUserAgent) }
53+ private val topLevel: TopLevelServiceAsync by lazy {
54+ TopLevelServiceAsyncImpl (clientOptionsWithUserAgent)
55+ }
5356
54- private val coupons: CouponServiceAsync by lazy { CouponServiceAsyncImpl (clientOptionsWithUserAgent) }
57+ private val coupons: CouponServiceAsync by lazy {
58+ CouponServiceAsyncImpl (clientOptionsWithUserAgent)
59+ }
5560
56- private val creditNotes: CreditNoteServiceAsync by lazy { CreditNoteServiceAsyncImpl (clientOptionsWithUserAgent) }
61+ private val creditNotes: CreditNoteServiceAsync by lazy {
62+ CreditNoteServiceAsyncImpl (clientOptionsWithUserAgent)
63+ }
5764
58- private val customers: CustomerServiceAsync by lazy { CustomerServiceAsyncImpl (clientOptionsWithUserAgent) }
65+ private val customers: CustomerServiceAsync by lazy {
66+ CustomerServiceAsyncImpl (clientOptionsWithUserAgent)
67+ }
5968
60- private val events: EventServiceAsync by lazy { EventServiceAsyncImpl (clientOptionsWithUserAgent) }
69+ private val events: EventServiceAsync by lazy {
70+ EventServiceAsyncImpl (clientOptionsWithUserAgent)
71+ }
6172
62- private val invoiceLineItems: InvoiceLineItemServiceAsync by lazy { InvoiceLineItemServiceAsyncImpl (clientOptionsWithUserAgent) }
73+ private val invoiceLineItems: InvoiceLineItemServiceAsync by lazy {
74+ InvoiceLineItemServiceAsyncImpl (clientOptionsWithUserAgent)
75+ }
6376
64- private val invoices: InvoiceServiceAsync by lazy { InvoiceServiceAsyncImpl (clientOptionsWithUserAgent) }
77+ private val invoices: InvoiceServiceAsync by lazy {
78+ InvoiceServiceAsyncImpl (clientOptionsWithUserAgent)
79+ }
6580
6681 private val items: ItemServiceAsync by lazy { ItemServiceAsyncImpl (clientOptionsWithUserAgent) }
6782
68- private val metrics: MetricServiceAsync by lazy { MetricServiceAsyncImpl (clientOptionsWithUserAgent) }
83+ private val metrics: MetricServiceAsync by lazy {
84+ MetricServiceAsyncImpl (clientOptionsWithUserAgent)
85+ }
6986
7087 private val plans: PlanServiceAsync by lazy { PlanServiceAsyncImpl (clientOptionsWithUserAgent) }
7188
72- private val prices: PriceServiceAsync by lazy { PriceServiceAsyncImpl (clientOptionsWithUserAgent) }
89+ private val prices: PriceServiceAsync by lazy {
90+ PriceServiceAsyncImpl (clientOptionsWithUserAgent)
91+ }
7392
74- private val subscriptions: SubscriptionServiceAsync by lazy { SubscriptionServiceAsyncImpl (clientOptionsWithUserAgent) }
93+ private val subscriptions: SubscriptionServiceAsync by lazy {
94+ SubscriptionServiceAsyncImpl (clientOptionsWithUserAgent)
95+ }
7596
76- private val alerts: AlertServiceAsync by lazy { AlertServiceAsyncImpl (clientOptionsWithUserAgent) }
97+ private val alerts: AlertServiceAsync by lazy {
98+ AlertServiceAsyncImpl (clientOptionsWithUserAgent)
99+ }
77100
78- private val dimensionalPriceGroups: DimensionalPriceGroupServiceAsync by lazy { DimensionalPriceGroupServiceAsyncImpl (clientOptionsWithUserAgent) }
101+ private val dimensionalPriceGroups: DimensionalPriceGroupServiceAsync by lazy {
102+ DimensionalPriceGroupServiceAsyncImpl (clientOptionsWithUserAgent)
103+ }
79104
80105 override fun sync (): OrbClient = sync
81106
@@ -107,42 +132,70 @@ class OrbClientAsyncImpl(
107132
108133 override fun alerts (): AlertServiceAsync = alerts
109134
110- override fun dimensionalPriceGroups (): DimensionalPriceGroupServiceAsync = dimensionalPriceGroups
135+ override fun dimensionalPriceGroups (): DimensionalPriceGroupServiceAsync =
136+ dimensionalPriceGroups
111137
112138 override fun close () = clientOptions.httpClient.close()
113139
114- class WithRawResponseImpl internal constructor(
115- private val clientOptions : ClientOptions ,
116-
117- ) : OrbClientAsync.WithRawResponse {
140+ class WithRawResponseImpl internal constructor(private val clientOptions : ClientOptions ) :
141+ OrbClientAsync .WithRawResponse {
118142
119- private val topLevel: TopLevelServiceAsync .WithRawResponse by lazy { TopLevelServiceAsyncImpl .WithRawResponseImpl (clientOptions) }
143+ private val topLevel: TopLevelServiceAsync .WithRawResponse by lazy {
144+ TopLevelServiceAsyncImpl .WithRawResponseImpl (clientOptions)
145+ }
120146
121- private val coupons: CouponServiceAsync .WithRawResponse by lazy { CouponServiceAsyncImpl .WithRawResponseImpl (clientOptions) }
147+ private val coupons: CouponServiceAsync .WithRawResponse by lazy {
148+ CouponServiceAsyncImpl .WithRawResponseImpl (clientOptions)
149+ }
122150
123- private val creditNotes: CreditNoteServiceAsync .WithRawResponse by lazy { CreditNoteServiceAsyncImpl .WithRawResponseImpl (clientOptions) }
151+ private val creditNotes: CreditNoteServiceAsync .WithRawResponse by lazy {
152+ CreditNoteServiceAsyncImpl .WithRawResponseImpl (clientOptions)
153+ }
124154
125- private val customers: CustomerServiceAsync .WithRawResponse by lazy { CustomerServiceAsyncImpl .WithRawResponseImpl (clientOptions) }
155+ private val customers: CustomerServiceAsync .WithRawResponse by lazy {
156+ CustomerServiceAsyncImpl .WithRawResponseImpl (clientOptions)
157+ }
126158
127- private val events: EventServiceAsync .WithRawResponse by lazy { EventServiceAsyncImpl .WithRawResponseImpl (clientOptions) }
159+ private val events: EventServiceAsync .WithRawResponse by lazy {
160+ EventServiceAsyncImpl .WithRawResponseImpl (clientOptions)
161+ }
128162
129- private val invoiceLineItems: InvoiceLineItemServiceAsync .WithRawResponse by lazy { InvoiceLineItemServiceAsyncImpl .WithRawResponseImpl (clientOptions) }
163+ private val invoiceLineItems: InvoiceLineItemServiceAsync .WithRawResponse by lazy {
164+ InvoiceLineItemServiceAsyncImpl .WithRawResponseImpl (clientOptions)
165+ }
130166
131- private val invoices: InvoiceServiceAsync .WithRawResponse by lazy { InvoiceServiceAsyncImpl .WithRawResponseImpl (clientOptions) }
167+ private val invoices: InvoiceServiceAsync .WithRawResponse by lazy {
168+ InvoiceServiceAsyncImpl .WithRawResponseImpl (clientOptions)
169+ }
132170
133- private val items: ItemServiceAsync .WithRawResponse by lazy { ItemServiceAsyncImpl .WithRawResponseImpl (clientOptions) }
171+ private val items: ItemServiceAsync .WithRawResponse by lazy {
172+ ItemServiceAsyncImpl .WithRawResponseImpl (clientOptions)
173+ }
134174
135- private val metrics: MetricServiceAsync .WithRawResponse by lazy { MetricServiceAsyncImpl .WithRawResponseImpl (clientOptions) }
175+ private val metrics: MetricServiceAsync .WithRawResponse by lazy {
176+ MetricServiceAsyncImpl .WithRawResponseImpl (clientOptions)
177+ }
136178
137- private val plans: PlanServiceAsync .WithRawResponse by lazy { PlanServiceAsyncImpl .WithRawResponseImpl (clientOptions) }
179+ private val plans: PlanServiceAsync .WithRawResponse by lazy {
180+ PlanServiceAsyncImpl .WithRawResponseImpl (clientOptions)
181+ }
138182
139- private val prices: PriceServiceAsync .WithRawResponse by lazy { PriceServiceAsyncImpl .WithRawResponseImpl (clientOptions) }
183+ private val prices: PriceServiceAsync .WithRawResponse by lazy {
184+ PriceServiceAsyncImpl .WithRawResponseImpl (clientOptions)
185+ }
140186
141- private val subscriptions: SubscriptionServiceAsync .WithRawResponse by lazy { SubscriptionServiceAsyncImpl .WithRawResponseImpl (clientOptions) }
187+ private val subscriptions: SubscriptionServiceAsync .WithRawResponse by lazy {
188+ SubscriptionServiceAsyncImpl .WithRawResponseImpl (clientOptions)
189+ }
142190
143- private val alerts: AlertServiceAsync .WithRawResponse by lazy { AlertServiceAsyncImpl .WithRawResponseImpl (clientOptions) }
191+ private val alerts: AlertServiceAsync .WithRawResponse by lazy {
192+ AlertServiceAsyncImpl .WithRawResponseImpl (clientOptions)
193+ }
144194
145- private val dimensionalPriceGroups: DimensionalPriceGroupServiceAsync .WithRawResponse by lazy { DimensionalPriceGroupServiceAsyncImpl .WithRawResponseImpl (clientOptions) }
195+ private val dimensionalPriceGroups:
196+ DimensionalPriceGroupServiceAsync .WithRawResponse by lazy {
197+ DimensionalPriceGroupServiceAsyncImpl .WithRawResponseImpl (clientOptions)
198+ }
146199
147200 override fun topLevel (): TopLevelServiceAsync .WithRawResponse = topLevel
148201
@@ -154,7 +207,8 @@ class OrbClientAsyncImpl(
154207
155208 override fun events (): EventServiceAsync .WithRawResponse = events
156209
157- override fun invoiceLineItems (): InvoiceLineItemServiceAsync .WithRawResponse = invoiceLineItems
210+ override fun invoiceLineItems (): InvoiceLineItemServiceAsync .WithRawResponse =
211+ invoiceLineItems
158212
159213 override fun invoices (): InvoiceServiceAsync .WithRawResponse = invoices
160214
@@ -170,6 +224,7 @@ class OrbClientAsyncImpl(
170224
171225 override fun alerts (): AlertServiceAsync .WithRawResponse = alerts
172226
173- override fun dimensionalPriceGroups (): DimensionalPriceGroupServiceAsync .WithRawResponse = dimensionalPriceGroups
227+ override fun dimensionalPriceGroups (): DimensionalPriceGroupServiceAsync .WithRawResponse =
228+ dimensionalPriceGroups
174229 }
175230}
0 commit comments