Skip to content

Commit

Permalink
chore: update example values in tests and docs (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] committed Dec 12, 2024
1 parent 1ef14e9 commit 28f1ab5
Show file tree
Hide file tree
Showing 58 changed files with 1,834 additions and 399 deletions.
51 changes: 43 additions & 8 deletions orb-java-core/src/test/kotlin/com/withorb/api/models/AlertTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

package com.withorb.api.models

import com.withorb.api.core.JsonValue
import java.time.OffsetDateTime
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test
Expand All @@ -15,23 +16,57 @@ class AlertTest {
.id("XuxCbt7x9L82yyeF")
.createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
.currency("currency")
.customer(Alert.Customer.builder().build())
.customer(
Alert.Customer.builder()
.putAdditionalProperty("foo", JsonValue.from("string"))
.build()
)
.enabled(true)
.metric(Alert.Metric.builder().build())
.plan(Alert.Plan.builder().build())
.subscription(Alert.Subscription.builder().build())
.metric(
Alert.Metric.builder()
.putAdditionalProperty("foo", JsonValue.from("string"))
.build()
)
.plan(
Alert.Plan.builder()
.putAdditionalProperty("foo", JsonValue.from("string"))
.build()
)
.subscription(
Alert.Subscription.builder()
.putAdditionalProperty("foo", JsonValue.from("string"))
.build()
)
.thresholds(listOf(Alert.Threshold.builder().value(0.0).build()))
.type(Alert.Type.USAGE_EXCEEDED)
.build()
assertThat(alert).isNotNull
assertThat(alert.id()).isEqualTo("XuxCbt7x9L82yyeF")
assertThat(alert.createdAt()).isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
assertThat(alert.currency()).contains("currency")
assertThat(alert.customer()).contains(Alert.Customer.builder().build())
assertThat(alert.customer())
.contains(
Alert.Customer.builder()
.putAdditionalProperty("foo", JsonValue.from("string"))
.build()
)
assertThat(alert.enabled()).isEqualTo(true)
assertThat(alert.metric()).contains(Alert.Metric.builder().build())
assertThat(alert.plan()).contains(Alert.Plan.builder().build())
assertThat(alert.subscription()).contains(Alert.Subscription.builder().build())
assertThat(alert.metric())
.contains(
Alert.Metric.builder()
.putAdditionalProperty("foo", JsonValue.from("string"))
.build()
)
assertThat(alert.plan())
.contains(
Alert.Plan.builder().putAdditionalProperty("foo", JsonValue.from("string")).build()
)
assertThat(alert.subscription())
.contains(
Alert.Subscription.builder()
.putAdditionalProperty("foo", JsonValue.from("string"))
.build()
)
assertThat(alert.thresholds().get())
.containsExactly(Alert.Threshold.builder().value(0.0).build())
assertThat(alert.type()).isEqualTo(Alert.Type.USAGE_EXCEEDED)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ class AmountDiscountTest {
val amountDiscount =
AmountDiscount.builder()
.amountDiscount("amount_discount")
.appliesToPriceIds(listOf("string"))
.appliesToPriceIds(listOf("h74gfhdjvn7ujokd", "7hfgtgjnbvc3ujkl"))
.discountType(AmountDiscount.DiscountType.AMOUNT)
.reason("reason")
.build()
assertThat(amountDiscount).isNotNull
assertThat(amountDiscount.amountDiscount()).isEqualTo("amount_discount")
assertThat(amountDiscount.appliesToPriceIds()).containsExactly("string")
assertThat(amountDiscount.appliesToPriceIds())
.containsExactly("h74gfhdjvn7ujokd", "7hfgtgjnbvc3ujkl")
assertThat(amountDiscount.discountType()).isEqualTo(AmountDiscount.DiscountType.AMOUNT)
assertThat(amountDiscount.reason()).contains("reason")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

package com.withorb.api.models

import com.withorb.api.core.JsonValue
import java.time.OffsetDateTime
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test
Expand Down Expand Up @@ -31,7 +32,11 @@ class BillableMetricTest {
.name("name")
.build()
)
.metadata(BillableMetric.Metadata.builder().build())
.metadata(
BillableMetric.Metadata.builder()
.putAdditionalProperty("foo", JsonValue.from("string"))
.build()
)
.name("name")
.status(BillableMetric.Status.ACTIVE)
.build()
Expand All @@ -56,7 +61,12 @@ class BillableMetricTest {
.name("name")
.build()
)
assertThat(billableMetric.metadata()).isEqualTo(BillableMetric.Metadata.builder().build())
assertThat(billableMetric.metadata())
.isEqualTo(
BillableMetric.Metadata.builder()
.putAdditionalProperty("foo", JsonValue.from("string"))
.build()
)
assertThat(billableMetric.name()).isEqualTo("name")
assertThat(billableMetric.status()).isEqualTo(BillableMetric.Status.ACTIVE)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class CouponTest {
.discount(
Coupon.Discount.ofPercentageDiscount(
PercentageDiscount.builder()
.appliesToPriceIds(listOf("string"))
.appliesToPriceIds(listOf("h74gfhdjvn7ujokd", "7hfgtgjnbvc3ujkl"))
.discountType(PercentageDiscount.DiscountType.PERCENTAGE)
.percentageDiscount(0.15)
.reason("reason")
Expand All @@ -36,7 +36,7 @@ class CouponTest {
.isEqualTo(
Coupon.Discount.ofPercentageDiscount(
PercentageDiscount.builder()
.appliesToPriceIds(listOf("string"))
.appliesToPriceIds(listOf("h74gfhdjvn7ujokd", "7hfgtgjnbvc3ujkl"))
.discountType(PercentageDiscount.DiscountType.PERCENTAGE)
.percentageDiscount(0.15)
.reason("reason")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

package com.withorb.api.models

import com.withorb.api.core.JsonValue
import java.time.OffsetDateTime
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test
Expand Down Expand Up @@ -56,7 +57,12 @@ class CustomerCostListByExternalIdResponseTest {
.discount(
Discount.ofPercentageDiscount(
PercentageDiscount.builder()
.appliesToPriceIds(listOf("string"))
.appliesToPriceIds(
listOf(
"h74gfhdjvn7ujokd",
"7hfgtgjnbvc3ujkl"
)
)
.discountType(
PercentageDiscount.DiscountType
.PERCENTAGE
Expand Down Expand Up @@ -94,7 +100,12 @@ class CustomerCostListByExternalIdResponseTest {
)
.maximumAmount("maximum_amount")
.metadata(
Price.UnitPrice.Metadata.builder().build()
Price.UnitPrice.Metadata.builder()
.putAdditionalProperty(
"foo",
JsonValue.from("string")
)
.build()
)
.minimum(
Price.UnitPrice.Minimum.builder()
Expand Down Expand Up @@ -172,7 +183,12 @@ class CustomerCostListByExternalIdResponseTest {
.discount(
Discount.ofPercentageDiscount(
PercentageDiscount.builder()
.appliesToPriceIds(listOf("string"))
.appliesToPriceIds(
listOf(
"h74gfhdjvn7ujokd",
"7hfgtgjnbvc3ujkl"
)
)
.discountType(
PercentageDiscount.DiscountType
.PERCENTAGE
Expand Down Expand Up @@ -208,7 +224,14 @@ class CustomerCostListByExternalIdResponseTest {
.build()
)
.maximumAmount("maximum_amount")
.metadata(Price.UnitPrice.Metadata.builder().build())
.metadata(
Price.UnitPrice.Metadata.builder()
.putAdditionalProperty(
"foo",
JsonValue.from("string")
)
.build()
)
.minimum(
Price.UnitPrice.Minimum.builder()
.appliesToPriceIds(listOf("string"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

package com.withorb.api.models

import com.withorb.api.core.JsonValue
import java.time.OffsetDateTime
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test
Expand Down Expand Up @@ -56,7 +57,12 @@ class CustomerCostListResponseTest {
.discount(
Discount.ofPercentageDiscount(
PercentageDiscount.builder()
.appliesToPriceIds(listOf("string"))
.appliesToPriceIds(
listOf(
"h74gfhdjvn7ujokd",
"7hfgtgjnbvc3ujkl"
)
)
.discountType(
PercentageDiscount.DiscountType
.PERCENTAGE
Expand Down Expand Up @@ -94,7 +100,12 @@ class CustomerCostListResponseTest {
)
.maximumAmount("maximum_amount")
.metadata(
Price.UnitPrice.Metadata.builder().build()
Price.UnitPrice.Metadata.builder()
.putAdditionalProperty(
"foo",
JsonValue.from("string")
)
.build()
)
.minimum(
Price.UnitPrice.Minimum.builder()
Expand Down Expand Up @@ -172,7 +183,12 @@ class CustomerCostListResponseTest {
.discount(
Discount.ofPercentageDiscount(
PercentageDiscount.builder()
.appliesToPriceIds(listOf("string"))
.appliesToPriceIds(
listOf(
"h74gfhdjvn7ujokd",
"7hfgtgjnbvc3ujkl"
)
)
.discountType(
PercentageDiscount.DiscountType
.PERCENTAGE
Expand Down Expand Up @@ -208,7 +224,14 @@ class CustomerCostListResponseTest {
.build()
)
.maximumAmount("maximum_amount")
.metadata(Price.UnitPrice.Metadata.builder().build())
.metadata(
Price.UnitPrice.Metadata.builder()
.putAdditionalProperty(
"foo",
JsonValue.from("string")
)
.build()
)
.minimum(
Price.UnitPrice.Minimum.builder()
.appliesToPriceIds(listOf("string"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

package com.withorb.api.models

import com.withorb.api.core.JsonValue
import com.withorb.api.models.*
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test
Expand Down Expand Up @@ -42,7 +43,11 @@ class CustomerCreateParamsTest {
.currency("currency")
.emailDelivery(true)
.externalCustomerId("external_customer_id")
.metadata(CustomerCreateParams.Metadata.builder().build())
.metadata(
CustomerCreateParams.Metadata.builder()
.putAdditionalProperty("foo", JsonValue.from("string"))
.build()
)
.paymentProvider(CustomerCreateParams.PaymentProvider.QUICKBOOKS)
.paymentProviderId("payment_provider_id")
.reportingConfiguration(
Expand Down Expand Up @@ -117,7 +122,11 @@ class CustomerCreateParamsTest {
.currency("currency")
.emailDelivery(true)
.externalCustomerId("external_customer_id")
.metadata(CustomerCreateParams.Metadata.builder().build())
.metadata(
CustomerCreateParams.Metadata.builder()
.putAdditionalProperty("foo", JsonValue.from("string"))
.build()
)
.paymentProvider(CustomerCreateParams.PaymentProvider.QUICKBOOKS)
.paymentProviderId("payment_provider_id")
.reportingConfiguration(
Expand Down Expand Up @@ -190,7 +199,12 @@ class CustomerCreateParamsTest {
assertThat(body.currency()).isEqualTo("currency")
assertThat(body.emailDelivery()).isEqualTo(true)
assertThat(body.externalCustomerId()).isEqualTo("external_customer_id")
assertThat(body.metadata()).isEqualTo(CustomerCreateParams.Metadata.builder().build())
assertThat(body.metadata())
.isEqualTo(
CustomerCreateParams.Metadata.builder()
.putAdditionalProperty("foo", JsonValue.from("string"))
.build()
)
assertThat(body.paymentProvider())
.isEqualTo(CustomerCreateParams.PaymentProvider.QUICKBOOKS)
assertThat(body.paymentProviderId()).isEqualTo("payment_provider_id")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

package com.withorb.api.models

import com.withorb.api.core.JsonValue
import com.withorb.api.models.*
import java.time.OffsetDateTime
import org.assertj.core.api.Assertions.assertThat
Expand Down Expand Up @@ -44,6 +45,7 @@ class CustomerCreditLedgerCreateEntryByExternalIdParamsTest {
.AddIncrementCreditLedgerEntryRequestParams
.Metadata
.builder()
.putAdditionalProperty("foo", JsonValue.from("string"))
.build()
)
.perUnitCostBasis("per_unit_cost_basis")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

package com.withorb.api.models

import com.withorb.api.core.JsonValue
import com.withorb.api.models.*
import java.time.OffsetDateTime
import org.assertj.core.api.Assertions.assertThat
Expand Down Expand Up @@ -43,6 +44,7 @@ class CustomerCreditLedgerCreateEntryParamsTest {
.AddIncrementCreditLedgerEntryRequestParams
.Metadata
.builder()
.putAdditionalProperty("foo", JsonValue.from("string"))
.build()
)
.perUnitCostBasis("per_unit_cost_basis")
Expand Down
Loading

0 comments on commit 28f1ab5

Please sign in to comment.