You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/rendering/PaginatorGenerator.kt
Copy file name to clipboardExpand all lines: smithy-kotlin-codegen/src/test/kotlin/software/amazon/smithy/kotlin/codegen/rendering/ClientConfigGeneratorTest.kt
Copy file name to clipboardExpand all lines: smithy-kotlin-codegen/src/test/kotlin/software/amazon/smithy/kotlin/codegen/rendering/PaginatorGeneratorTest.kt
+40-10Lines changed: 40 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -142,11 +142,12 @@ class PaginatorGeneratorTest {
142
142
val expected ="""
143
143
/**
144
144
* Paginate over [ListFunctionsResponse] results.
145
-
* When this operation is called, a [kotlinx.coroutines.Flow] is created. Flows are lazy (cold) so no service calls are
146
-
* made until the flow is collected. This also means there is no guarantee that the request is valid until then. Once
147
-
* you start collecting the flow, the SDK will lazily load response pages by making service calls until there are no
148
-
* pages left or the flow is cancelled. If there are errors in your request, you will see the failures only after you start
149
-
* collection.
145
+
*
146
+
* When this operation is called, a [kotlinx.coroutines.Flow] is created. Flows are lazy (cold) so no service
147
+
* calls are made until the flow is collected. This also means there is no guarantee that the request is valid
148
+
* until then. Once you start collecting the flow, the SDK will lazily load response pages by making service
149
+
* calls until there are no pages left or the flow is cancelled. If there are errors in your request, you will
150
+
* see the failures only after you start collection.
150
151
* @param initialRequest A [ListFunctionsRequest] to start pagination
151
152
* @return A [kotlinx.coroutines.flow.Flow] that can collect [ListFunctionsResponse]
152
153
*/
@@ -165,6 +166,20 @@ class PaginatorGeneratorTest {
165
166
emit(result)
166
167
}
167
168
}
169
+
170
+
/**
171
+
* Paginate over [ListFunctionsResponse] results.
172
+
*
173
+
* When this operation is called, a [kotlinx.coroutines.Flow] is created. Flows are lazy (cold) so no service
174
+
* calls are made until the flow is collected. This also means there is no guarantee that the request is valid
175
+
* until then. Once you start collecting the flow, the SDK will lazily load response pages by making service
176
+
* calls until there are no pages left or the flow is cancelled. If there are errors in your request, you will
177
+
* see the failures only after you start collection.
178
+
* @param block A builder block used for DSL-style invocation of the operation
179
+
* @return A [kotlinx.coroutines.flow.Flow] that can collect [ListFunctionsResponse]
180
+
*/
181
+
fun TestClient.listFunctionsPaginated(block: ListFunctionsRequest.Builder.() -> Unit): Flow<ListFunctionsResponse> =
0 commit comments