Skip to content

Commit

Permalink
chore: simplify examples involving unions (#434)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Jan 15, 2025
1 parent 855d967 commit 0c2af28
Show file tree
Hide file tree
Showing 13 changed files with 282 additions and 348 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class AuthRuleConditionTest {
AuthRuleCondition.builder()
.attribute(ConditionalAttribute.MCC)
.operation(AuthRuleCondition.Operation.IS_ONE_OF)
.value(AuthRuleCondition.Value.ofString("string"))
.value("string")
.build()
assertThat(authRuleCondition).isNotNull
assertThat(authRuleCondition.attribute()).isEqualTo(ConditionalAttribute.MCC)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class AuthRuleV2CreateParamsTest {
AuthRuleCondition.builder()
.attribute(ConditionalAttribute.MCC)
.operation(AuthRuleCondition.Operation.IS_ONE_OF)
.value(AuthRuleCondition.Value.ofString("string"))
.value("string")
.build()
)
.build()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,15 @@ class AuthRuleV2DraftParamsTest {
AuthRuleV2DraftParams.builder()
.authRuleToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.parameters(
AuthRuleV2DraftParams.Parameters.ofConditionalBlockParameters(
ConditionalBlockParameters.builder()
.addCondition(
AuthRuleCondition.builder()
.attribute(ConditionalAttribute.MCC)
.operation(AuthRuleCondition.Operation.IS_ONE_OF)
.value(AuthRuleCondition.Value.ofString("string"))
.build()
)
.build()
)
ConditionalBlockParameters.builder()
.addCondition(
AuthRuleCondition.builder()
.attribute(ConditionalAttribute.MCC)
.operation(AuthRuleCondition.Operation.IS_ONE_OF)
.value("string")
.build()
)
.build()
)
.build()
}
Expand All @@ -33,17 +31,15 @@ class AuthRuleV2DraftParamsTest {
AuthRuleV2DraftParams.builder()
.authRuleToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.parameters(
AuthRuleV2DraftParams.Parameters.ofConditionalBlockParameters(
ConditionalBlockParameters.builder()
.addCondition(
AuthRuleCondition.builder()
.attribute(ConditionalAttribute.MCC)
.operation(AuthRuleCondition.Operation.IS_ONE_OF)
.value(AuthRuleCondition.Value.ofString("string"))
.build()
)
.build()
)
ConditionalBlockParameters.builder()
.addCondition(
AuthRuleCondition.builder()
.attribute(ConditionalAttribute.MCC)
.operation(AuthRuleCondition.Operation.IS_ONE_OF)
.value("string")
.build()
)
.build()
)
.build()
val body = params.getBody()
Expand All @@ -56,7 +52,7 @@ class AuthRuleV2DraftParamsTest {
AuthRuleCondition.builder()
.attribute(ConditionalAttribute.MCC)
.operation(AuthRuleCondition.Operation.IS_ONE_OF)
.value(AuthRuleCondition.Value.ofString("string"))
.value("string")
.build()
)
.build()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ConditionalBlockParametersTest {
AuthRuleCondition.builder()
.attribute(ConditionalAttribute.MCC)
.operation(AuthRuleCondition.Operation.IS_ONE_OF)
.value(AuthRuleCondition.Value.ofString("string"))
.value("string")
.build()
)
.build()
Expand All @@ -25,7 +25,7 @@ class ConditionalBlockParametersTest {
AuthRuleCondition.builder()
.attribute(ConditionalAttribute.MCC)
.operation(AuthRuleCondition.Operation.IS_ONE_OF)
.value(AuthRuleCondition.Value.ofString("string"))
.value("string")
.build()
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,35 +17,31 @@ class V2ApplyResponseTest {
.currentVersion(
V2ApplyResponse.CurrentVersion.builder()
.parameters(
V2ApplyResponse.CurrentVersion.Parameters.ofConditionalBlockParameters(
ConditionalBlockParameters.builder()
.addCondition(
AuthRuleCondition.builder()
.attribute(ConditionalAttribute.MCC)
.operation(AuthRuleCondition.Operation.IS_ONE_OF)
.value(AuthRuleCondition.Value.ofString("string"))
.build()
)
.build()
)
ConditionalBlockParameters.builder()
.addCondition(
AuthRuleCondition.builder()
.attribute(ConditionalAttribute.MCC)
.operation(AuthRuleCondition.Operation.IS_ONE_OF)
.value("string")
.build()
)
.build()
)
.version(0L)
.build()
)
.draftVersion(
V2ApplyResponse.DraftVersion.builder()
.parameters(
V2ApplyResponse.DraftVersion.Parameters.ofConditionalBlockParameters(
ConditionalBlockParameters.builder()
.addCondition(
AuthRuleCondition.builder()
.attribute(ConditionalAttribute.MCC)
.operation(AuthRuleCondition.Operation.IS_ONE_OF)
.value(AuthRuleCondition.Value.ofString("string"))
.build()
)
.build()
)
ConditionalBlockParameters.builder()
.addCondition(
AuthRuleCondition.builder()
.attribute(ConditionalAttribute.MCC)
.operation(AuthRuleCondition.Operation.IS_ONE_OF)
.value("string")
.build()
)
.build()
)
.version(0L)
.build()
Expand All @@ -66,17 +62,15 @@ class V2ApplyResponseTest {
.isEqualTo(
V2ApplyResponse.CurrentVersion.builder()
.parameters(
V2ApplyResponse.CurrentVersion.Parameters.ofConditionalBlockParameters(
ConditionalBlockParameters.builder()
.addCondition(
AuthRuleCondition.builder()
.attribute(ConditionalAttribute.MCC)
.operation(AuthRuleCondition.Operation.IS_ONE_OF)
.value(AuthRuleCondition.Value.ofString("string"))
.build()
)
.build()
)
ConditionalBlockParameters.builder()
.addCondition(
AuthRuleCondition.builder()
.attribute(ConditionalAttribute.MCC)
.operation(AuthRuleCondition.Operation.IS_ONE_OF)
.value("string")
.build()
)
.build()
)
.version(0L)
.build()
Expand All @@ -85,17 +79,15 @@ class V2ApplyResponseTest {
.isEqualTo(
V2ApplyResponse.DraftVersion.builder()
.parameters(
V2ApplyResponse.DraftVersion.Parameters.ofConditionalBlockParameters(
ConditionalBlockParameters.builder()
.addCondition(
AuthRuleCondition.builder()
.attribute(ConditionalAttribute.MCC)
.operation(AuthRuleCondition.Operation.IS_ONE_OF)
.value(AuthRuleCondition.Value.ofString("string"))
.build()
)
.build()
)
ConditionalBlockParameters.builder()
.addCondition(
AuthRuleCondition.builder()
.attribute(ConditionalAttribute.MCC)
.operation(AuthRuleCondition.Operation.IS_ONE_OF)
.value("string")
.build()
)
.build()
)
.version(0L)
.build()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,35 +17,31 @@ class V2CreateResponseTest {
.currentVersion(
V2CreateResponse.CurrentVersion.builder()
.parameters(
V2CreateResponse.CurrentVersion.Parameters.ofConditionalBlockParameters(
ConditionalBlockParameters.builder()
.addCondition(
AuthRuleCondition.builder()
.attribute(ConditionalAttribute.MCC)
.operation(AuthRuleCondition.Operation.IS_ONE_OF)
.value(AuthRuleCondition.Value.ofString("string"))
.build()
)
.build()
)
ConditionalBlockParameters.builder()
.addCondition(
AuthRuleCondition.builder()
.attribute(ConditionalAttribute.MCC)
.operation(AuthRuleCondition.Operation.IS_ONE_OF)
.value("string")
.build()
)
.build()
)
.version(0L)
.build()
)
.draftVersion(
V2CreateResponse.DraftVersion.builder()
.parameters(
V2CreateResponse.DraftVersion.Parameters.ofConditionalBlockParameters(
ConditionalBlockParameters.builder()
.addCondition(
AuthRuleCondition.builder()
.attribute(ConditionalAttribute.MCC)
.operation(AuthRuleCondition.Operation.IS_ONE_OF)
.value(AuthRuleCondition.Value.ofString("string"))
.build()
)
.build()
)
ConditionalBlockParameters.builder()
.addCondition(
AuthRuleCondition.builder()
.attribute(ConditionalAttribute.MCC)
.operation(AuthRuleCondition.Operation.IS_ONE_OF)
.value("string")
.build()
)
.build()
)
.version(0L)
.build()
Expand All @@ -66,17 +62,15 @@ class V2CreateResponseTest {
.isEqualTo(
V2CreateResponse.CurrentVersion.builder()
.parameters(
V2CreateResponse.CurrentVersion.Parameters.ofConditionalBlockParameters(
ConditionalBlockParameters.builder()
.addCondition(
AuthRuleCondition.builder()
.attribute(ConditionalAttribute.MCC)
.operation(AuthRuleCondition.Operation.IS_ONE_OF)
.value(AuthRuleCondition.Value.ofString("string"))
.build()
)
.build()
)
ConditionalBlockParameters.builder()
.addCondition(
AuthRuleCondition.builder()
.attribute(ConditionalAttribute.MCC)
.operation(AuthRuleCondition.Operation.IS_ONE_OF)
.value("string")
.build()
)
.build()
)
.version(0L)
.build()
Expand All @@ -85,17 +79,15 @@ class V2CreateResponseTest {
.isEqualTo(
V2CreateResponse.DraftVersion.builder()
.parameters(
V2CreateResponse.DraftVersion.Parameters.ofConditionalBlockParameters(
ConditionalBlockParameters.builder()
.addCondition(
AuthRuleCondition.builder()
.attribute(ConditionalAttribute.MCC)
.operation(AuthRuleCondition.Operation.IS_ONE_OF)
.value(AuthRuleCondition.Value.ofString("string"))
.build()
)
.build()
)
ConditionalBlockParameters.builder()
.addCondition(
AuthRuleCondition.builder()
.attribute(ConditionalAttribute.MCC)
.operation(AuthRuleCondition.Operation.IS_ONE_OF)
.value("string")
.build()
)
.build()
)
.version(0L)
.build()
Expand Down
Loading

0 comments on commit 0c2af28

Please sign in to comment.