Skip to content

Commit 0dcf1be

Browse files
docs: add build method comments (#347)
1 parent 670dae5 commit 0dcf1be

File tree

210 files changed

+26899
-827
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

210 files changed

+26899
-827
lines changed

orb-java-client-okhttp/src/main/kotlin/com/withorb/api/client/okhttp/OrbOkHttpClient.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,11 @@ class OrbOkHttpClient private constructor() {
156156

157157
fun fromEnv() = apply { clientOptions.fromEnv() }
158158

159+
/**
160+
* Returns an immutable instance of [OrbClient].
161+
*
162+
* Further updates to this [Builder] will not mutate the returned instance.
163+
*/
159164
fun build(): OrbClient =
160165
OrbClientImpl(
161166
clientOptions

orb-java-client-okhttp/src/main/kotlin/com/withorb/api/client/okhttp/OrbOkHttpClientAsync.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,11 @@ class OrbOkHttpClientAsync private constructor() {
156156

157157
fun fromEnv() = apply { clientOptions.fromEnv() }
158158

159+
/**
160+
* Returns an immutable instance of [OrbClientAsync].
161+
*
162+
* Further updates to this [Builder] will not mutate the returned instance.
163+
*/
159164
fun build(): OrbClientAsync =
160165
OrbClientAsyncImpl(
161166
clientOptions

orb-java-core/src/main/kotlin/com/withorb/api/core/ClientOptions.kt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,19 @@ private constructor(
189189
System.getenv("ORB_WEBHOOK_SECRET")?.let { webhookSecret(it) }
190190
}
191191

192+
/**
193+
* Returns an immutable instance of [ClientOptions].
194+
*
195+
* Further updates to this [Builder] will not mutate the returned instance.
196+
*
197+
* The following fields are required:
198+
* ```java
199+
* .httpClient()
200+
* .apiKey()
201+
* ```
202+
*
203+
* @throws IllegalStateException if any required field is unset.
204+
*/
192205
fun build(): ClientOptions {
193206
val httpClient = checkRequired("httpClient", httpClient)
194207
val apiKey = checkRequired("apiKey", apiKey)

orb-java-core/src/main/kotlin/com/withorb/api/core/Timeout.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,11 @@ private constructor(
132132
/** Alias for calling [Builder.request] with `request.orElse(null)`. */
133133
fun request(request: Optional<Duration>) = request(request.getOrNull())
134134

135+
/**
136+
* Returns an immutable instance of [Timeout].
137+
*
138+
* Further updates to this [Builder] will not mutate the returned instance.
139+
*/
135140
fun build(): Timeout = Timeout(connect, read, write, request)
136141
}
137142

orb-java-core/src/main/kotlin/com/withorb/api/errors/OrbError.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ private constructor(
6060
keys.forEach(::removeAdditionalProperty)
6161
}
6262

63+
/**
64+
* Returns an immutable instance of [OrbError].
65+
*
66+
* Further updates to this [Builder] will not mutate the returned instance.
67+
*/
6368
fun build(): OrbError = OrbError(additionalProperties.toImmutable())
6469
}
6570

orb-java-core/src/main/kotlin/com/withorb/api/models/Alert.kt

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,27 @@ private constructor(
464464
keys.forEach(::removeAdditionalProperty)
465465
}
466466

467+
/**
468+
* Returns an immutable instance of [Alert].
469+
*
470+
* Further updates to this [Builder] will not mutate the returned instance.
471+
*
472+
* The following fields are required:
473+
* ```java
474+
* .id()
475+
* .createdAt()
476+
* .currency()
477+
* .customer()
478+
* .enabled()
479+
* .metric()
480+
* .plan()
481+
* .subscription()
482+
* .thresholds()
483+
* .type()
484+
* ```
485+
*
486+
* @throws IllegalStateException if any required field is unset.
487+
*/
467488
fun build(): Alert =
468489
Alert(
469490
checkRequired("id", id),
@@ -620,6 +641,19 @@ private constructor(
620641
keys.forEach(::removeAdditionalProperty)
621642
}
622643

644+
/**
645+
* Returns an immutable instance of [Customer].
646+
*
647+
* Further updates to this [Builder] will not mutate the returned instance.
648+
*
649+
* The following fields are required:
650+
* ```java
651+
* .id()
652+
* .externalCustomerId()
653+
* ```
654+
*
655+
* @throws IllegalStateException if any required field is unset.
656+
*/
623657
fun build(): Customer =
624658
Customer(
625659
checkRequired("id", id),
@@ -741,6 +775,18 @@ private constructor(
741775
keys.forEach(::removeAdditionalProperty)
742776
}
743777

778+
/**
779+
* Returns an immutable instance of [Metric].
780+
*
781+
* Further updates to this [Builder] will not mutate the returned instance.
782+
*
783+
* The following fields are required:
784+
* ```java
785+
* .id()
786+
* ```
787+
*
788+
* @throws IllegalStateException if any required field is unset.
789+
*/
744790
fun build(): Metric =
745791
Metric(checkRequired("id", id), additionalProperties.toImmutable())
746792
}
@@ -980,6 +1026,21 @@ private constructor(
9801026
keys.forEach(::removeAdditionalProperty)
9811027
}
9821028

1029+
/**
1030+
* Returns an immutable instance of [Plan].
1031+
*
1032+
* Further updates to this [Builder] will not mutate the returned instance.
1033+
*
1034+
* The following fields are required:
1035+
* ```java
1036+
* .id()
1037+
* .externalPlanId()
1038+
* .name()
1039+
* .planVersion()
1040+
* ```
1041+
*
1042+
* @throws IllegalStateException if any required field is unset.
1043+
*/
9831044
fun build(): Plan =
9841045
Plan(
9851046
checkRequired("id", id),
@@ -1103,6 +1164,18 @@ private constructor(
11031164
keys.forEach(::removeAdditionalProperty)
11041165
}
11051166

1167+
/**
1168+
* Returns an immutable instance of [Subscription].
1169+
*
1170+
* Further updates to this [Builder] will not mutate the returned instance.
1171+
*
1172+
* The following fields are required:
1173+
* ```java
1174+
* .id()
1175+
* ```
1176+
*
1177+
* @throws IllegalStateException if any required field is unset.
1178+
*/
11061179
fun build(): Subscription =
11071180
Subscription(checkRequired("id", id), additionalProperties.toImmutable())
11081181
}
@@ -1230,6 +1303,18 @@ private constructor(
12301303
keys.forEach(::removeAdditionalProperty)
12311304
}
12321305

1306+
/**
1307+
* Returns an immutable instance of [Threshold].
1308+
*
1309+
* Further updates to this [Builder] will not mutate the returned instance.
1310+
*
1311+
* The following fields are required:
1312+
* ```java
1313+
* .value()
1314+
* ```
1315+
*
1316+
* @throws IllegalStateException if any required field is unset.
1317+
*/
12331318
fun build(): Threshold =
12341319
Threshold(checkRequired("value", value), additionalProperties.toImmutable())
12351320
}

orb-java-core/src/main/kotlin/com/withorb/api/models/AlertCreateForCustomerParams.kt

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,19 @@ private constructor(
292292
keys.forEach(::removeAdditionalProperty)
293293
}
294294

295+
/**
296+
* Returns an immutable instance of [Body].
297+
*
298+
* Further updates to this [Builder] will not mutate the returned instance.
299+
*
300+
* The following fields are required:
301+
* ```java
302+
* .currency()
303+
* .type()
304+
* ```
305+
*
306+
* @throws IllegalStateException if any required field is unset.
307+
*/
295308
fun build(): Body =
296309
Body(
297310
checkRequired("currency", currency),
@@ -518,6 +531,20 @@ private constructor(
518531
additionalQueryParams.removeAll(keys)
519532
}
520533

534+
/**
535+
* Returns an immutable instance of [AlertCreateForCustomerParams].
536+
*
537+
* Further updates to this [Builder] will not mutate the returned instance.
538+
*
539+
* The following fields are required:
540+
* ```java
541+
* .customerId()
542+
* .currency()
543+
* .type()
544+
* ```
545+
*
546+
* @throws IllegalStateException if any required field is unset.
547+
*/
521548
fun build(): AlertCreateForCustomerParams =
522549
AlertCreateForCustomerParams(
523550
checkRequired("customerId", customerId),
@@ -737,6 +764,18 @@ private constructor(
737764
keys.forEach(::removeAdditionalProperty)
738765
}
739766

767+
/**
768+
* Returns an immutable instance of [Threshold].
769+
*
770+
* Further updates to this [Builder] will not mutate the returned instance.
771+
*
772+
* The following fields are required:
773+
* ```java
774+
* .value()
775+
* ```
776+
*
777+
* @throws IllegalStateException if any required field is unset.
778+
*/
740779
fun build(): Threshold =
741780
Threshold(checkRequired("value", value), additionalProperties.toImmutable())
742781
}

orb-java-core/src/main/kotlin/com/withorb/api/models/AlertCreateForExternalCustomerParams.kt

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,19 @@ private constructor(
292292
keys.forEach(::removeAdditionalProperty)
293293
}
294294

295+
/**
296+
* Returns an immutable instance of [Body].
297+
*
298+
* Further updates to this [Builder] will not mutate the returned instance.
299+
*
300+
* The following fields are required:
301+
* ```java
302+
* .currency()
303+
* .type()
304+
* ```
305+
*
306+
* @throws IllegalStateException if any required field is unset.
307+
*/
295308
fun build(): Body =
296309
Body(
297310
checkRequired("currency", currency),
@@ -524,6 +537,20 @@ private constructor(
524537
additionalQueryParams.removeAll(keys)
525538
}
526539

540+
/**
541+
* Returns an immutable instance of [AlertCreateForExternalCustomerParams].
542+
*
543+
* Further updates to this [Builder] will not mutate the returned instance.
544+
*
545+
* The following fields are required:
546+
* ```java
547+
* .externalCustomerId()
548+
* .currency()
549+
* .type()
550+
* ```
551+
*
552+
* @throws IllegalStateException if any required field is unset.
553+
*/
527554
fun build(): AlertCreateForExternalCustomerParams =
528555
AlertCreateForExternalCustomerParams(
529556
checkRequired("externalCustomerId", externalCustomerId),
@@ -743,6 +770,18 @@ private constructor(
743770
keys.forEach(::removeAdditionalProperty)
744771
}
745772

773+
/**
774+
* Returns an immutable instance of [Threshold].
775+
*
776+
* Further updates to this [Builder] will not mutate the returned instance.
777+
*
778+
* The following fields are required:
779+
* ```java
780+
* .value()
781+
* ```
782+
*
783+
* @throws IllegalStateException if any required field is unset.
784+
*/
746785
fun build(): Threshold =
747786
Threshold(checkRequired("value", value), additionalProperties.toImmutable())
748787
}

orb-java-core/src/main/kotlin/com/withorb/api/models/AlertCreateForSubscriptionParams.kt

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,19 @@ private constructor(
293293
keys.forEach(::removeAdditionalProperty)
294294
}
295295

296+
/**
297+
* Returns an immutable instance of [Body].
298+
*
299+
* Further updates to this [Builder] will not mutate the returned instance.
300+
*
301+
* The following fields are required:
302+
* ```java
303+
* .thresholds()
304+
* .type()
305+
* ```
306+
*
307+
* @throws IllegalStateException if any required field is unset.
308+
*/
296309
fun build(): Body =
297310
Body(
298311
checkRequired("thresholds", thresholds).map { it.toImmutable() },
@@ -522,6 +535,20 @@ private constructor(
522535
additionalQueryParams.removeAll(keys)
523536
}
524537

538+
/**
539+
* Returns an immutable instance of [AlertCreateForSubscriptionParams].
540+
*
541+
* Further updates to this [Builder] will not mutate the returned instance.
542+
*
543+
* The following fields are required:
544+
* ```java
545+
* .subscriptionId()
546+
* .thresholds()
547+
* .type()
548+
* ```
549+
*
550+
* @throws IllegalStateException if any required field is unset.
551+
*/
525552
fun build(): AlertCreateForSubscriptionParams =
526553
AlertCreateForSubscriptionParams(
527554
checkRequired("subscriptionId", subscriptionId),
@@ -637,6 +664,18 @@ private constructor(
637664
keys.forEach(::removeAdditionalProperty)
638665
}
639666

667+
/**
668+
* Returns an immutable instance of [Threshold].
669+
*
670+
* Further updates to this [Builder] will not mutate the returned instance.
671+
*
672+
* The following fields are required:
673+
* ```java
674+
* .value()
675+
* ```
676+
*
677+
* @throws IllegalStateException if any required field is unset.
678+
*/
640679
fun build(): Threshold =
641680
Threshold(checkRequired("value", value), additionalProperties.toImmutable())
642681
}

orb-java-core/src/main/kotlin/com/withorb/api/models/AlertDisableParams.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,18 @@ private constructor(
223223
keys.forEach(::removeAdditionalBodyProperty)
224224
}
225225

226+
/**
227+
* Returns an immutable instance of [AlertDisableParams].
228+
*
229+
* Further updates to this [Builder] will not mutate the returned instance.
230+
*
231+
* The following fields are required:
232+
* ```java
233+
* .alertConfigurationId()
234+
* ```
235+
*
236+
* @throws IllegalStateException if any required field is unset.
237+
*/
226238
fun build(): AlertDisableParams =
227239
AlertDisableParams(
228240
checkRequired("alertConfigurationId", alertConfigurationId),

0 commit comments

Comments
 (0)