Skip to content

Commit

Permalink
style(internal): make enum value definitions less verbose (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] committed Dec 12, 2024
1 parent 28f1ab5 commit 1a3bc07
Show file tree
Hide file tree
Showing 76 changed files with 3,289 additions and 3,457 deletions.
10 changes: 5 additions & 5 deletions orb-java-core/src/main/kotlin/com/withorb/api/models/Alert.kt
Original file line number Diff line number Diff line change
Expand Up @@ -686,15 +686,15 @@ private constructor(

companion object {

@JvmField val USAGE_EXCEEDED = Type(JsonField.of("usage_exceeded"))
@JvmField val USAGE_EXCEEDED = of("usage_exceeded")

@JvmField val COST_EXCEEDED = Type(JsonField.of("cost_exceeded"))
@JvmField val COST_EXCEEDED = of("cost_exceeded")

@JvmField val CREDIT_BALANCE_DEPLETED = Type(JsonField.of("credit_balance_depleted"))
@JvmField val CREDIT_BALANCE_DEPLETED = of("credit_balance_depleted")

@JvmField val CREDIT_BALANCE_DROPPED = Type(JsonField.of("credit_balance_dropped"))
@JvmField val CREDIT_BALANCE_DROPPED = of("credit_balance_dropped")

@JvmField val CREDIT_BALANCE_RECOVERED = Type(JsonField.of("credit_balance_recovered"))
@JvmField val CREDIT_BALANCE_RECOVERED = of("credit_balance_recovered")

@JvmStatic fun of(value: String) = Type(JsonField.of(value))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,15 +364,15 @@ constructor(

companion object {

@JvmField val USAGE_EXCEEDED = Type(JsonField.of("usage_exceeded"))
@JvmField val USAGE_EXCEEDED = of("usage_exceeded")

@JvmField val COST_EXCEEDED = Type(JsonField.of("cost_exceeded"))
@JvmField val COST_EXCEEDED = of("cost_exceeded")

@JvmField val CREDIT_BALANCE_DEPLETED = Type(JsonField.of("credit_balance_depleted"))
@JvmField val CREDIT_BALANCE_DEPLETED = of("credit_balance_depleted")

@JvmField val CREDIT_BALANCE_DROPPED = Type(JsonField.of("credit_balance_dropped"))
@JvmField val CREDIT_BALANCE_DROPPED = of("credit_balance_dropped")

@JvmField val CREDIT_BALANCE_RECOVERED = Type(JsonField.of("credit_balance_recovered"))
@JvmField val CREDIT_BALANCE_RECOVERED = of("credit_balance_recovered")

@JvmStatic fun of(value: String) = Type(JsonField.of(value))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,15 +374,15 @@ constructor(

companion object {

@JvmField val USAGE_EXCEEDED = Type(JsonField.of("usage_exceeded"))
@JvmField val USAGE_EXCEEDED = of("usage_exceeded")

@JvmField val COST_EXCEEDED = Type(JsonField.of("cost_exceeded"))
@JvmField val COST_EXCEEDED = of("cost_exceeded")

@JvmField val CREDIT_BALANCE_DEPLETED = Type(JsonField.of("credit_balance_depleted"))
@JvmField val CREDIT_BALANCE_DEPLETED = of("credit_balance_depleted")

@JvmField val CREDIT_BALANCE_DROPPED = Type(JsonField.of("credit_balance_dropped"))
@JvmField val CREDIT_BALANCE_DROPPED = of("credit_balance_dropped")

@JvmField val CREDIT_BALANCE_RECOVERED = Type(JsonField.of("credit_balance_recovered"))
@JvmField val CREDIT_BALANCE_RECOVERED = of("credit_balance_recovered")

@JvmStatic fun of(value: String) = Type(JsonField.of(value))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -452,15 +452,15 @@ constructor(

companion object {

@JvmField val USAGE_EXCEEDED = Type(JsonField.of("usage_exceeded"))
@JvmField val USAGE_EXCEEDED = of("usage_exceeded")

@JvmField val COST_EXCEEDED = Type(JsonField.of("cost_exceeded"))
@JvmField val COST_EXCEEDED = of("cost_exceeded")

@JvmField val CREDIT_BALANCE_DEPLETED = Type(JsonField.of("credit_balance_depleted"))
@JvmField val CREDIT_BALANCE_DEPLETED = of("credit_balance_depleted")

@JvmField val CREDIT_BALANCE_DROPPED = Type(JsonField.of("credit_balance_dropped"))
@JvmField val CREDIT_BALANCE_DROPPED = of("credit_balance_dropped")

@JvmField val CREDIT_BALANCE_RECOVERED = Type(JsonField.of("credit_balance_recovered"))
@JvmField val CREDIT_BALANCE_RECOVERED = of("credit_balance_recovered")

@JvmStatic fun of(value: String) = Type(JsonField.of(value))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ private constructor(

companion object {

@JvmField val AMOUNT = DiscountType(JsonField.of("amount"))
@JvmField val AMOUNT = of("amount")

@JvmStatic fun of(value: String) = DiscountType(JsonField.of(value))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,11 +302,11 @@ private constructor(

companion object {

@JvmField val ACTIVE = Status(JsonField.of("active"))
@JvmField val ACTIVE = of("active")

@JvmField val DRAFT = Status(JsonField.of("draft"))
@JvmField val DRAFT = of("draft")

@JvmField val ARCHIVED = Status(JsonField.of("archived"))
@JvmField val ARCHIVED = of("archived")

@JvmStatic fun of(value: String) = Status(JsonField.of(value))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ private constructor(

companion object {

@JvmField val START_OF_TERM = BillingCycleRelativeDate(JsonField.of("start_of_term"))
@JvmField val START_OF_TERM = of("start_of_term")

@JvmField val END_OF_TERM = BillingCycleRelativeDate(JsonField.of("end_of_term"))
@JvmField val END_OF_TERM = of("end_of_term")

@JvmStatic fun of(value: String) = BillingCycleRelativeDate(JsonField.of(value))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ constructor(

companion object {

@JvmField val PERCENTAGE = DiscountType(JsonField.of("percentage"))
@JvmField val PERCENTAGE = of("percentage")

@JvmStatic fun of(value: String) = DiscountType(JsonField.of(value))
}
Expand Down Expand Up @@ -805,7 +805,7 @@ constructor(

companion object {

@JvmField val AMOUNT = DiscountType(JsonField.of("amount"))
@JvmField val AMOUNT = of("amount")

@JvmStatic fun of(value: String) = DiscountType(JsonField.of(value))
}
Expand Down
20 changes: 10 additions & 10 deletions orb-java-core/src/main/kotlin/com/withorb/api/models/CreditNote.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1038,9 +1038,9 @@ private constructor(

companion object {

@JvmField val PERCENTAGE = DiscountType(JsonField.of("percentage"))
@JvmField val PERCENTAGE = of("percentage")

@JvmField val AMOUNT = DiscountType(JsonField.of("amount"))
@JvmField val AMOUNT = of("amount")

@JvmStatic fun of(value: String) = DiscountType(JsonField.of(value))
}
Expand Down Expand Up @@ -1275,7 +1275,7 @@ private constructor(

companion object {

@JvmField val PERCENTAGE = DiscountType(JsonField.of("percentage"))
@JvmField val PERCENTAGE = of("percentage")

@JvmStatic fun of(value: String) = DiscountType(JsonField.of(value))
}
Expand Down Expand Up @@ -1448,13 +1448,13 @@ private constructor(

companion object {

@JvmField val DUPLICATE = Reason(JsonField.of("Duplicate"))
@JvmField val DUPLICATE = of("Duplicate")

@JvmField val FRAUDULENT = Reason(JsonField.of("Fraudulent"))
@JvmField val FRAUDULENT = of("Fraudulent")

@JvmField val ORDER_CHANGE = Reason(JsonField.of("Order change"))
@JvmField val ORDER_CHANGE = of("Order change")

@JvmField val PRODUCT_UNSATISFACTORY = Reason(JsonField.of("Product unsatisfactory"))
@JvmField val PRODUCT_UNSATISFACTORY = of("Product unsatisfactory")

@JvmStatic fun of(value: String) = Reason(JsonField.of(value))
}
Expand Down Expand Up @@ -1517,9 +1517,9 @@ private constructor(

companion object {

@JvmField val REFUND = Type(JsonField.of("refund"))
@JvmField val REFUND = of("refund")

@JvmField val ADJUSTMENT = Type(JsonField.of("adjustment"))
@JvmField val ADJUSTMENT = of("adjustment")

@JvmStatic fun of(value: String) = Type(JsonField.of(value))
}
Expand Down Expand Up @@ -1717,7 +1717,7 @@ private constructor(

companion object {

@JvmField val PERCENTAGE = DiscountType(JsonField.of("percentage"))
@JvmField val PERCENTAGE = of("percentage")

@JvmStatic fun of(value: String) = DiscountType(JsonField.of(value))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,13 +435,13 @@ constructor(

companion object {

@JvmField val DUPLICATE = Reason(JsonField.of("duplicate"))
@JvmField val DUPLICATE = of("duplicate")

@JvmField val FRAUDULENT = Reason(JsonField.of("fraudulent"))
@JvmField val FRAUDULENT = of("fraudulent")

@JvmField val ORDER_CHANGE = Reason(JsonField.of("order_change"))
@JvmField val ORDER_CHANGE = of("order_change")

@JvmField val PRODUCT_UNSATISFACTORY = Reason(JsonField.of("product_unsatisfactory"))
@JvmField val PRODUCT_UNSATISFACTORY = of("product_unsatisfactory")

@JvmStatic fun of(value: String) = Reason(JsonField.of(value))
}
Expand Down
Loading

0 comments on commit 1a3bc07

Please sign in to comment.