Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 103
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-7b65f996788617c2d2f2e8e941d366edd1a2844f15eefec555e220b03bbc6d4c.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-d4f03b16daf0bae33be634c959dafb0e21b0bcb156beb162f8235394dca88e7c.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ import com.withorb.api.core.toImmutable
import java.util.Objects
import java.util.Optional

/** Delete top-up by external ID */
/**
* This deactivates the top-up and voids any invoices associated with pending credit blocks
* purchased through the top-up.
*/
class CustomerCreditTopUpDeleteByExternalIdParams
private constructor(
private val externalCustomerId: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ import com.withorb.api.core.toImmutable
import java.util.Objects
import java.util.Optional

/** Delete top-up */
/**
* This deactivates the top-up and voids any invoices associated with pending credit blocks
* purchased through the top-up.
*/
class CustomerCreditTopUpDeleteParams
private constructor(
private val customerId: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5766,6 +5766,9 @@ private constructor(
@JsonProperty("end_date")
@ExcludeMissing
private val endDate: JsonField<OffsetDateTime> = JsonMissing.of(),
@JsonProperty("filter")
@ExcludeMissing
private val filter: JsonField<String> = JsonMissing.of(),
@JsonProperty("fixed_fee_quantity_transitions")
@ExcludeMissing
private val fixedFeeQuantityTransitions: JsonField<List<FixedFeeQuantityTransition>> =
Expand All @@ -5776,6 +5779,9 @@ private constructor(
@JsonProperty("start_date")
@ExcludeMissing
private val startDate: JsonField<OffsetDateTime> = JsonMissing.of(),
@JsonProperty("usage_customer_ids")
@ExcludeMissing
private val usageCustomerIds: JsonField<List<String>> = JsonMissing.of(),
@JsonAnySetter
private val additionalProperties: Map<String, JsonValue> = immutableEmptyMap(),
) {
Expand Down Expand Up @@ -5812,6 +5818,9 @@ private constructor(
fun endDate(): Optional<OffsetDateTime> =
Optional.ofNullable(endDate.getNullable("end_date"))

/** An additional filter to apply to usage queries. */
fun filter(): Optional<String> = Optional.ofNullable(filter.getNullable("filter"))

/**
* The fixed fee quantity transitions for this price interval. This is only relevant for
* fixed fees.
Expand Down Expand Up @@ -5841,6 +5850,13 @@ private constructor(
*/
fun startDate(): OffsetDateTime = startDate.getRequired("start_date")

/**
* A list of customer IDs whose usage events will be aggregated and billed under this price
* interval.
*/
fun usageCustomerIds(): Optional<List<String>> =
Optional.ofNullable(usageCustomerIds.getNullable("usage_customer_ids"))

@JsonProperty("id") @ExcludeMissing fun _id(): JsonField<String> = id

/** The day of the month that Orb bills for this price */
Expand Down Expand Up @@ -5875,6 +5891,9 @@ private constructor(
@ExcludeMissing
fun _endDate(): JsonField<OffsetDateTime> = endDate

/** An additional filter to apply to usage queries. */
@JsonProperty("filter") @ExcludeMissing fun _filter(): JsonField<String> = filter

/**
* The fixed fee quantity transitions for this price interval. This is only relevant for
* fixed fees.
Expand Down Expand Up @@ -5906,6 +5925,14 @@ private constructor(
@ExcludeMissing
fun _startDate(): JsonField<OffsetDateTime> = startDate

/**
* A list of customer IDs whose usage events will be aggregated and billed under this price
* interval.
*/
@JsonProperty("usage_customer_ids")
@ExcludeMissing
fun _usageCustomerIds(): JsonField<List<String>> = usageCustomerIds

@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map<String, JsonValue> = additionalProperties
Expand All @@ -5922,9 +5949,11 @@ private constructor(
currentBillingPeriodEndDate()
currentBillingPeriodStartDate()
endDate()
filter()
fixedFeeQuantityTransitions().ifPresent { it.forEach { it.validate() } }
price().validate()
startDate()
usageCustomerIds()
validated = true
}

Expand All @@ -5943,11 +5972,13 @@ private constructor(
private var currentBillingPeriodEndDate: JsonField<OffsetDateTime>? = null
private var currentBillingPeriodStartDate: JsonField<OffsetDateTime>? = null
private var endDate: JsonField<OffsetDateTime>? = null
private var filter: JsonField<String>? = null
private var fixedFeeQuantityTransitions:
JsonField<MutableList<FixedFeeQuantityTransition>>? =
null
private var price: JsonField<Price>? = null
private var startDate: JsonField<OffsetDateTime>? = null
private var usageCustomerIds: JsonField<MutableList<String>>? = null
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()

@JvmSynthetic
Expand All @@ -5957,10 +5988,12 @@ private constructor(
currentBillingPeriodEndDate = priceInterval.currentBillingPeriodEndDate
currentBillingPeriodStartDate = priceInterval.currentBillingPeriodStartDate
endDate = priceInterval.endDate
filter = priceInterval.filter
fixedFeeQuantityTransitions =
priceInterval.fixedFeeQuantityTransitions.map { it.toMutableList() }
price = priceInterval.price
startDate = priceInterval.startDate
usageCustomerIds = priceInterval.usageCustomerIds.map { it.toMutableList() }
additionalProperties = priceInterval.additionalProperties.toMutableMap()
}

Expand Down Expand Up @@ -6046,6 +6079,15 @@ private constructor(
*/
fun endDate(endDate: JsonField<OffsetDateTime>) = apply { this.endDate = endDate }

/** An additional filter to apply to usage queries. */
fun filter(filter: String?) = filter(JsonField.ofNullable(filter))

/** An additional filter to apply to usage queries. */
fun filter(filter: Optional<String>) = filter(filter.orElse(null))

/** An additional filter to apply to usage queries. */
fun filter(filter: JsonField<String>) = apply { this.filter = filter }

/**
* The fixed fee quantity transitions for this price interval. This is only relevant for
* fixed fees.
Expand Down Expand Up @@ -6546,6 +6588,45 @@ private constructor(
this.startDate = startDate
}

/**
* A list of customer IDs whose usage events will be aggregated and billed under this
* price interval.
*/
fun usageCustomerIds(usageCustomerIds: List<String>?) =
usageCustomerIds(JsonField.ofNullable(usageCustomerIds))

/**
* A list of customer IDs whose usage events will be aggregated and billed under this
* price interval.
*/
fun usageCustomerIds(usageCustomerIds: Optional<List<String>>) =
usageCustomerIds(usageCustomerIds.orElse(null))

/**
* A list of customer IDs whose usage events will be aggregated and billed under this
* price interval.
*/
fun usageCustomerIds(usageCustomerIds: JsonField<List<String>>) = apply {
this.usageCustomerIds = usageCustomerIds.map { it.toMutableList() }
}

/**
* A list of customer IDs whose usage events will be aggregated and billed under this
* price interval.
*/
fun addUsageCustomerId(usageCustomerId: String) = apply {
usageCustomerIds =
(usageCustomerIds ?: JsonField.of(mutableListOf())).apply {
asKnown()
.orElseThrow {
IllegalStateException(
"Field was set to non-list type: ${javaClass.simpleName}"
)
}
.add(usageCustomerId)
}
}

fun additionalProperties(additionalProperties: Map<String, JsonValue>) = apply {
this.additionalProperties.clear()
putAllAdditionalProperties(additionalProperties)
Expand All @@ -6572,11 +6653,13 @@ private constructor(
checkRequired("currentBillingPeriodEndDate", currentBillingPeriodEndDate),
checkRequired("currentBillingPeriodStartDate", currentBillingPeriodStartDate),
checkRequired("endDate", endDate),
checkRequired("filter", filter),
checkRequired("fixedFeeQuantityTransitions", fixedFeeQuantityTransitions).map {
it.toImmutable()
},
checkRequired("price", price),
checkRequired("startDate", startDate),
checkRequired("usageCustomerIds", usageCustomerIds).map { it.toImmutable() },
additionalProperties.toImmutable(),
)
}
Expand Down Expand Up @@ -6722,17 +6805,17 @@ private constructor(
return true
}

return /* spotless:off */ other is PriceInterval && id == other.id && billingCycleDay == other.billingCycleDay && currentBillingPeriodEndDate == other.currentBillingPeriodEndDate && currentBillingPeriodStartDate == other.currentBillingPeriodStartDate && endDate == other.endDate && fixedFeeQuantityTransitions == other.fixedFeeQuantityTransitions && price == other.price && startDate == other.startDate && additionalProperties == other.additionalProperties /* spotless:on */
return /* spotless:off */ other is PriceInterval && id == other.id && billingCycleDay == other.billingCycleDay && currentBillingPeriodEndDate == other.currentBillingPeriodEndDate && currentBillingPeriodStartDate == other.currentBillingPeriodStartDate && endDate == other.endDate && filter == other.filter && fixedFeeQuantityTransitions == other.fixedFeeQuantityTransitions && price == other.price && startDate == other.startDate && usageCustomerIds == other.usageCustomerIds && additionalProperties == other.additionalProperties /* spotless:on */
}

/* spotless:off */
private val hashCode: Int by lazy { Objects.hash(id, billingCycleDay, currentBillingPeriodEndDate, currentBillingPeriodStartDate, endDate, fixedFeeQuantityTransitions, price, startDate, additionalProperties) }
private val hashCode: Int by lazy { Objects.hash(id, billingCycleDay, currentBillingPeriodEndDate, currentBillingPeriodStartDate, endDate, filter, fixedFeeQuantityTransitions, price, startDate, usageCustomerIds, additionalProperties) }
/* spotless:on */

override fun hashCode(): Int = hashCode

override fun toString() =
"PriceInterval{id=$id, billingCycleDay=$billingCycleDay, currentBillingPeriodEndDate=$currentBillingPeriodEndDate, currentBillingPeriodStartDate=$currentBillingPeriodStartDate, endDate=$endDate, fixedFeeQuantityTransitions=$fixedFeeQuantityTransitions, price=$price, startDate=$startDate, additionalProperties=$additionalProperties}"
"PriceInterval{id=$id, billingCycleDay=$billingCycleDay, currentBillingPeriodEndDate=$currentBillingPeriodEndDate, currentBillingPeriodStartDate=$currentBillingPeriodStartDate, endDate=$endDate, filter=$filter, fixedFeeQuantityTransitions=$fixedFeeQuantityTransitions, price=$price, startDate=$startDate, usageCustomerIds=$usageCustomerIds, additionalProperties=$additionalProperties}"
}

@NoAutoDetect
Expand Down
Loading