Skip to content

Commit e6da0bf

Browse files
docs: add build method comments (#86)
1 parent 3d4d199 commit e6da0bf

34 files changed

+1552
-0
lines changed

openlayer-java-client-okhttp/src/main/kotlin/com/openlayer/api/client/okhttp/OpenlayerOkHttpClient.kt

+5
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,11 @@ class OpenlayerOkHttpClient private constructor() {
151151

152152
fun fromEnv() = apply { clientOptions.fromEnv() }
153153

154+
/**
155+
* Returns an immutable instance of [OpenlayerClient].
156+
*
157+
* Further updates to this [Builder] will not mutate the returned instance.
158+
*/
154159
fun build(): OpenlayerClient =
155160
OpenlayerClientImpl(
156161
clientOptions

openlayer-java-client-okhttp/src/main/kotlin/com/openlayer/api/client/okhttp/OpenlayerOkHttpClientAsync.kt

+5
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@ class OpenlayerOkHttpClientAsync private constructor() {
153153

154154
fun fromEnv() = apply { clientOptions.fromEnv() }
155155

156+
/**
157+
* Returns an immutable instance of [OpenlayerClientAsync].
158+
*
159+
* Further updates to this [Builder] will not mutate the returned instance.
160+
*/
156161
fun build(): OpenlayerClientAsync =
157162
OpenlayerClientAsyncImpl(
158163
clientOptions

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

+12
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,18 @@ private constructor(
179179

180180
fun fromEnv() = apply { System.getenv("OPENLAYER_API_KEY")?.let { apiKey(it) } }
181181

182+
/**
183+
* Returns an immutable instance of [ClientOptions].
184+
*
185+
* Further updates to this [Builder] will not mutate the returned instance.
186+
*
187+
* The following fields are required:
188+
* ```java
189+
* .httpClient()
190+
* ```
191+
*
192+
* @throws IllegalStateException if any required field is unset.
193+
*/
182194
fun build(): ClientOptions {
183195
val httpClient = checkRequired("httpClient", httpClient)
184196

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

+5
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

openlayer-java-core/src/main/kotlin/com/openlayer/api/errors/OpenlayerError.kt

+5
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 [OpenlayerError].
65+
*
66+
* Further updates to this [Builder] will not mutate the returned instance.
67+
*/
6368
fun build(): OpenlayerError = OpenlayerError(additionalProperties.toImmutable())
6469
}
6570

openlayer-java-core/src/main/kotlin/com/openlayer/api/models/commits/CommitRetrieveParams.kt

+12
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,18 @@ private constructor(
166166
additionalQueryParams.removeAll(keys)
167167
}
168168

169+
/**
170+
* Returns an immutable instance of [CommitRetrieveParams].
171+
*
172+
* Further updates to this [Builder] will not mutate the returned instance.
173+
*
174+
* The following fields are required:
175+
* ```java
176+
* .projectVersionId()
177+
* ```
178+
*
179+
* @throws IllegalStateException if any required field is unset.
180+
*/
169181
fun build(): CommitRetrieveParams =
170182
CommitRetrieveParams(
171183
checkRequired("projectVersionId", projectVersionId),

openlayer-java-core/src/main/kotlin/com/openlayer/api/models/commits/CommitRetrieveResponse.kt

+56
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,31 @@ private constructor(
737737
keys.forEach(::removeAdditionalProperty)
738738
}
739739

740+
/**
741+
* Returns an immutable instance of [CommitRetrieveResponse].
742+
*
743+
* Further updates to this [Builder] will not mutate the returned instance.
744+
*
745+
* The following fields are required:
746+
* ```java
747+
* .id()
748+
* .commit()
749+
* .dateArchived()
750+
* .dateCreated()
751+
* .failingGoalCount()
752+
* .mlModelId()
753+
* .passingGoalCount()
754+
* .projectId()
755+
* .status()
756+
* .statusMessage()
757+
* .storageUri()
758+
* .totalGoalCount()
759+
* .trainingDatasetId()
760+
* .validationDatasetId()
761+
* ```
762+
*
763+
* @throws IllegalStateException if any required field is unset.
764+
*/
740765
fun build(): CommitRetrieveResponse =
741766
CommitRetrieveResponse(
742767
checkRequired("id", id),
@@ -1293,6 +1318,25 @@ private constructor(
12931318
keys.forEach(::removeAdditionalProperty)
12941319
}
12951320

1321+
/**
1322+
* Returns an immutable instance of [Commit].
1323+
*
1324+
* Further updates to this [Builder] will not mutate the returned instance.
1325+
*
1326+
* The following fields are required:
1327+
* ```java
1328+
* .id()
1329+
* .authorId()
1330+
* .fileSize()
1331+
* .message()
1332+
* .mlModelId()
1333+
* .storageUri()
1334+
* .trainingDatasetId()
1335+
* .validationDatasetId()
1336+
* ```
1337+
*
1338+
* @throws IllegalStateException if any required field is unset.
1339+
*/
12961340
fun build(): Commit =
12971341
Commit(
12981342
checkRequired("id", id),
@@ -1551,6 +1595,18 @@ private constructor(
15511595
keys.forEach(::removeAdditionalProperty)
15521596
}
15531597

1598+
/**
1599+
* Returns an immutable instance of [Links].
1600+
*
1601+
* Further updates to this [Builder] will not mutate the returned instance.
1602+
*
1603+
* The following fields are required:
1604+
* ```java
1605+
* .app()
1606+
* ```
1607+
*
1608+
* @throws IllegalStateException if any required field is unset.
1609+
*/
15541610
fun build(): Links =
15551611
Links(checkRequired("app", app), additionalProperties.toImmutable())
15561612
}

openlayer-java-core/src/main/kotlin/com/openlayer/api/models/commits/testresults/TestResultListParams.kt

+12
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,18 @@ private constructor(
277277
additionalQueryParams.removeAll(keys)
278278
}
279279

280+
/**
281+
* Returns an immutable instance of [TestResultListParams].
282+
*
283+
* Further updates to this [Builder] will not mutate the returned instance.
284+
*
285+
* The following fields are required:
286+
* ```java
287+
* .projectVersionId()
288+
* ```
289+
*
290+
* @throws IllegalStateException if any required field is unset.
291+
*/
280292
fun build(): TestResultListParams =
281293
TestResultListParams(
282294
checkRequired("projectVersionId", projectVersionId),

openlayer-java-core/src/main/kotlin/com/openlayer/api/models/commits/testresults/TestResultListResponse.kt

+62
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,18 @@ private constructor(
139139
keys.forEach(::removeAdditionalProperty)
140140
}
141141

142+
/**
143+
* Returns an immutable instance of [TestResultListResponse].
144+
*
145+
* Further updates to this [Builder] will not mutate the returned instance.
146+
*
147+
* The following fields are required:
148+
* ```java
149+
* .items()
150+
* ```
151+
*
152+
* @throws IllegalStateException if any required field is unset.
153+
*/
142154
fun build(): TestResultListResponse =
143155
TestResultListResponse(
144156
checkRequired("items", items).map { it.toImmutable() },
@@ -647,6 +659,26 @@ private constructor(
647659
keys.forEach(::removeAdditionalProperty)
648660
}
649661

662+
/**
663+
* Returns an immutable instance of [Item].
664+
*
665+
* Further updates to this [Builder] will not mutate the returned instance.
666+
*
667+
* The following fields are required:
668+
* ```java
669+
* .id()
670+
* .dateCreated()
671+
* .dateDataEnds()
672+
* .dateDataStarts()
673+
* .dateUpdated()
674+
* .inferencePipelineId()
675+
* .projectVersionId()
676+
* .status()
677+
* .statusMessage()
678+
* ```
679+
*
680+
* @throws IllegalStateException if any required field is unset.
681+
*/
650682
fun build(): Item =
651683
Item(
652684
checkRequired("id", id),
@@ -1725,6 +1757,31 @@ private constructor(
17251757
keys.forEach(::removeAdditionalProperty)
17261758
}
17271759

1760+
/**
1761+
* Returns an immutable instance of [Goal].
1762+
*
1763+
* Further updates to this [Builder] will not mutate the returned instance.
1764+
*
1765+
* The following fields are required:
1766+
* ```java
1767+
* .id()
1768+
* .commentCount()
1769+
* .creatorId()
1770+
* .dateArchived()
1771+
* .dateCreated()
1772+
* .dateUpdated()
1773+
* .description()
1774+
* .name()
1775+
* .number()
1776+
* .originProjectVersionId()
1777+
* .subtype()
1778+
* .suggested()
1779+
* .thresholds()
1780+
* .type()
1781+
* ```
1782+
*
1783+
* @throws IllegalStateException if any required field is unset.
1784+
*/
17281785
fun build(): Goal =
17291786
Goal(
17301787
checkRequired("id", id),
@@ -2025,6 +2082,11 @@ private constructor(
20252082
keys.forEach(::removeAdditionalProperty)
20262083
}
20272084

2085+
/**
2086+
* Returns an immutable instance of [Threshold].
2087+
*
2088+
* Further updates to this [Builder] will not mutate the returned instance.
2089+
*/
20282090
fun build(): Threshold =
20292091
Threshold(
20302092
insightName,

openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineDeleteParams.kt

+12
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,18 @@ private constructor(
202202
keys.forEach(::removeAdditionalBodyProperty)
203203
}
204204

205+
/**
206+
* Returns an immutable instance of [InferencePipelineDeleteParams].
207+
*
208+
* Further updates to this [Builder] will not mutate the returned instance.
209+
*
210+
* The following fields are required:
211+
* ```java
212+
* .inferencePipelineId()
213+
* ```
214+
*
215+
* @throws IllegalStateException if any required field is unset.
216+
*/
205217
fun build(): InferencePipelineDeleteParams =
206218
InferencePipelineDeleteParams(
207219
checkRequired("inferencePipelineId", inferencePipelineId),

openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineRetrieveParams.kt

+12
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,18 @@ private constructor(
202202
additionalQueryParams.removeAll(keys)
203203
}
204204

205+
/**
206+
* Returns an immutable instance of [InferencePipelineRetrieveParams].
207+
*
208+
* Further updates to this [Builder] will not mutate the returned instance.
209+
*
210+
* The following fields are required:
211+
* ```java
212+
* .inferencePipelineId()
213+
* ```
214+
*
215+
* @throws IllegalStateException if any required field is unset.
216+
*/
205217
fun build(): InferencePipelineRetrieveParams =
206218
InferencePipelineRetrieveParams(
207219
checkRequired("inferencePipelineId", inferencePipelineId),

0 commit comments

Comments
 (0)