Skip to content

Commit

Permalink
feat(client): add more builder convenience methods for lists (#304)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored Jan 8, 2025
1 parent cb27bea commit ba717bc
Showing 1 changed file with 165 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,96 @@ constructor(
}
}

/**
* An array of objects where each object contains the input params for a single
* `action_type` request on a `resource_type` resource
*/
fun addResource(
paymentOrderAsyncCreateRequest: Resource.PaymentOrderAsyncCreateRequest
) =
addResource(
Resource.ofPaymentOrderAsyncCreateRequest(paymentOrderAsyncCreateRequest)
)

/**
* An array of objects where each object contains the input params for a single
* `action_type` request on a `resource_type` resource
*/
fun addResource(expectedPaymentCreateRequest: Resource.ExpectedPaymentCreateRequest) =
addResource(Resource.ofExpectedPaymentCreateRequest(expectedPaymentCreateRequest))

/**
* An array of objects where each object contains the input params for a single
* `action_type` request on a `resource_type` resource
*/
fun addResource(
ledgerTransactionCreateRequest: Resource.LedgerTransactionCreateRequest
) =
addResource(
Resource.ofLedgerTransactionCreateRequest(ledgerTransactionCreateRequest)
)

/**
* An array of objects where each object contains the input params for a single
* `action_type` request on a `resource_type` resource
*/
fun addResource(transactionCreateRequest: Resource.TransactionCreateRequest) =
addResource(Resource.ofTransactionCreateRequest(transactionCreateRequest))

/**
* An array of objects where each object contains the input params for a single
* `action_type` request on a `resource_type` resource
*/
fun addResource(id: Resource.Id) = addResource(Resource.ofId(id))

/**
* An array of objects where each object contains the input params for a single
* `action_type` request on a `resource_type` resource
*/
fun addResource(
paymentOrderUpdateRequestWithId: Resource.PaymentOrderUpdateRequestWithId
) =
addResource(
Resource.ofPaymentOrderUpdateRequestWithId(paymentOrderUpdateRequestWithId)
)

/**
* An array of objects where each object contains the input params for a single
* `action_type` request on a `resource_type` resource
*/
fun addResource(
expectedPaymentUpdateRequestWithId: Resource.ExpectedPaymentUpdateRequestWithId
) =
addResource(
Resource.ofExpectedPaymentUpdateRequestWithId(
expectedPaymentUpdateRequestWithId
)
)

/**
* An array of objects where each object contains the input params for a single
* `action_type` request on a `resource_type` resource
*/
fun addResource(
transactionUpdateRequestWithId: Resource.TransactionUpdateRequestWithId
) =
addResource(
Resource.ofTransactionUpdateRequestWithId(transactionUpdateRequestWithId)
)

/**
* An array of objects where each object contains the input params for a single
* `action_type` request on a `resource_type` resource
*/
fun addResource(
ledgerTransactionUpdateRequestWithId: Resource.LedgerTransactionUpdateRequestWithId
) =
addResource(
Resource.ofLedgerTransactionUpdateRequestWithId(
ledgerTransactionUpdateRequestWithId
)
)

/**
* Additional data represented as key-value pairs. Both the key and value must be
* strings.
Expand Down Expand Up @@ -342,6 +432,81 @@ constructor(
*/
fun addResource(resource: Resource) = apply { body.addResource(resource) }

/**
* An array of objects where each object contains the input params for a single
* `action_type` request on a `resource_type` resource
*/
fun addResource(paymentOrderAsyncCreateRequest: Resource.PaymentOrderAsyncCreateRequest) =
apply {
body.addResource(paymentOrderAsyncCreateRequest)
}

/**
* An array of objects where each object contains the input params for a single
* `action_type` request on a `resource_type` resource
*/
fun addResource(expectedPaymentCreateRequest: Resource.ExpectedPaymentCreateRequest) =
apply {
body.addResource(expectedPaymentCreateRequest)
}

/**
* An array of objects where each object contains the input params for a single
* `action_type` request on a `resource_type` resource
*/
fun addResource(ledgerTransactionCreateRequest: Resource.LedgerTransactionCreateRequest) =
apply {
body.addResource(ledgerTransactionCreateRequest)
}

/**
* An array of objects where each object contains the input params for a single
* `action_type` request on a `resource_type` resource
*/
fun addResource(transactionCreateRequest: Resource.TransactionCreateRequest) = apply {
body.addResource(transactionCreateRequest)
}

/**
* An array of objects where each object contains the input params for a single
* `action_type` request on a `resource_type` resource
*/
fun addResource(id: Resource.Id) = apply { body.addResource(id) }

/**
* An array of objects where each object contains the input params for a single
* `action_type` request on a `resource_type` resource
*/
fun addResource(paymentOrderUpdateRequestWithId: Resource.PaymentOrderUpdateRequestWithId) =
apply {
body.addResource(paymentOrderUpdateRequestWithId)
}

/**
* An array of objects where each object contains the input params for a single
* `action_type` request on a `resource_type` resource
*/
fun addResource(
expectedPaymentUpdateRequestWithId: Resource.ExpectedPaymentUpdateRequestWithId
) = apply { body.addResource(expectedPaymentUpdateRequestWithId) }

/**
* An array of objects where each object contains the input params for a single
* `action_type` request on a `resource_type` resource
*/
fun addResource(transactionUpdateRequestWithId: Resource.TransactionUpdateRequestWithId) =
apply {
body.addResource(transactionUpdateRequestWithId)
}

/**
* An array of objects where each object contains the input params for a single
* `action_type` request on a `resource_type` resource
*/
fun addResource(
ledgerTransactionUpdateRequestWithId: Resource.LedgerTransactionUpdateRequestWithId
) = apply { body.addResource(ledgerTransactionUpdateRequestWithId) }

/**
* Additional data represented as key-value pairs. Both the key and value must be strings.
*/
Expand Down

0 comments on commit ba717bc

Please sign in to comment.