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
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ constructor(
private val additionalQueryParams: QueryParams,
) {

/** The identifier of the Account to retrieve. */
fun accountId(): String = accountId

/** The moment to query the balance at. If not set, returns the current balances. */
fun atTime(): Optional<OffsetDateTime> = Optional.ofNullable(atTime)

fun _additionalHeaders(): Headers = additionalHeaders
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ constructor(
private val additionalBodyProperties: Map<String, JsonValue>,
) {

/** The identifier of the Account to close. The account must have a zero balance. */
fun accountId(): String = accountId

fun _additionalHeaders(): Headers = additionalHeaders
Expand All @@ -27,9 +28,8 @@ constructor(
fun _additionalBodyProperties(): Map<String, JsonValue> = additionalBodyProperties

@JvmSynthetic
internal fun getBody(): Optional<Map<String, JsonValue>> {
return Optional.ofNullable(additionalBodyProperties.ifEmpty { null })
}
internal fun getBody(): Optional<Map<String, JsonValue>> =
Optional.ofNullable(additionalBodyProperties.ifEmpty { null })

@JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,39 +18,36 @@ import java.util.Optional

class AccountCreateParams
constructor(
private val name: String,
private val entityId: String?,
private val informationalEntityId: String?,
private val programId: String?,
private val body: AccountCreateBody,
private val additionalHeaders: Headers,
private val additionalQueryParams: QueryParams,
private val additionalBodyProperties: Map<String, JsonValue>,
) {

fun name(): String = name
/** The name you choose for the Account. */
fun name(): String = body.name()

fun entityId(): Optional<String> = Optional.ofNullable(entityId)
/** The identifier for the Entity that will own the Account. */
fun entityId(): Optional<String> = body.entityId()

fun informationalEntityId(): Optional<String> = Optional.ofNullable(informationalEntityId)
/**
* The identifier of an Entity that, while not owning the Account, is associated with its
* activity. Its relationship to your group must be `informational`.
*/
fun informationalEntityId(): Optional<String> = body.informationalEntityId()

fun programId(): Optional<String> = Optional.ofNullable(programId)
/**
* The identifier for the Program that this Account falls under. Required if you operate more
* than one Program.
*/
fun programId(): Optional<String> = body.programId()

fun _additionalHeaders(): Headers = additionalHeaders

fun _additionalQueryParams(): QueryParams = additionalQueryParams

fun _additionalBodyProperties(): Map<String, JsonValue> = additionalBodyProperties

@JvmSynthetic
internal fun getBody(): AccountCreateBody {
return AccountCreateBody(
name,
entityId,
informationalEntityId,
programId,
additionalBodyProperties,
)
}
fun _additionalBodyProperties(): Map<String, JsonValue> = body._additionalProperties()

@JvmSynthetic internal fun getBody(): AccountCreateBody = body

@JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders

Expand Down Expand Up @@ -193,44 +190,36 @@ constructor(
@NoAutoDetect
class Builder {

private var name: String? = null
private var entityId: String? = null
private var informationalEntityId: String? = null
private var programId: String? = null
private var body: AccountCreateBody.Builder = AccountCreateBody.builder()
private var additionalHeaders: Headers.Builder = Headers.builder()
private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
private var additionalBodyProperties: MutableMap<String, JsonValue> = mutableMapOf()

@JvmSynthetic
internal fun from(accountCreateParams: AccountCreateParams) = apply {
name = accountCreateParams.name
entityId = accountCreateParams.entityId
informationalEntityId = accountCreateParams.informationalEntityId
programId = accountCreateParams.programId
body = accountCreateParams.body.toBuilder()
additionalHeaders = accountCreateParams.additionalHeaders.toBuilder()
additionalQueryParams = accountCreateParams.additionalQueryParams.toBuilder()
additionalBodyProperties = accountCreateParams.additionalBodyProperties.toMutableMap()
}

/** The name you choose for the Account. */
fun name(name: String) = apply { this.name = name }
fun name(name: String) = apply { body.name(name) }

/** The identifier for the Entity that will own the Account. */
fun entityId(entityId: String) = apply { this.entityId = entityId }
fun entityId(entityId: String) = apply { body.entityId(entityId) }

/**
* The identifier of an Entity that, while not owning the Account, is associated with its
* activity. Its relationship to your group must be `informational`.
*/
fun informationalEntityId(informationalEntityId: String) = apply {
this.informationalEntityId = informationalEntityId
body.informationalEntityId(informationalEntityId)
}

/**
* The identifier for the Program that this Account falls under. Required if you operate
* more than one Program.
*/
fun programId(programId: String) = apply { this.programId = programId }
fun programId(programId: String) = apply { body.programId(programId) }

fun additionalHeaders(additionalHeaders: Headers) = apply {
this.additionalHeaders.clear()
Expand Down Expand Up @@ -331,36 +320,29 @@ constructor(
}

fun additionalBodyProperties(additionalBodyProperties: Map<String, JsonValue>) = apply {
this.additionalBodyProperties.clear()
putAllAdditionalBodyProperties(additionalBodyProperties)
body.additionalProperties(additionalBodyProperties)
}

fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply {
additionalBodyProperties.put(key, value)
body.putAdditionalProperty(key, value)
}

fun putAllAdditionalBodyProperties(additionalBodyProperties: Map<String, JsonValue>) =
apply {
this.additionalBodyProperties.putAll(additionalBodyProperties)
body.putAllAdditionalProperties(additionalBodyProperties)
}

fun removeAdditionalBodyProperty(key: String) = apply {
additionalBodyProperties.remove(key)
}
fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) }

fun removeAllAdditionalBodyProperties(keys: Set<String>) = apply {
keys.forEach(::removeAdditionalBodyProperty)
body.removeAllAdditionalProperties(keys)
}

fun build(): AccountCreateParams =
AccountCreateParams(
checkNotNull(name) { "`name` is required but was not set" },
entityId,
informationalEntityId,
programId,
body.build(),
additionalHeaders.build(),
additionalQueryParams.build(),
additionalBodyProperties.toImmutable(),
)
}

Expand All @@ -369,11 +351,11 @@ constructor(
return true
}

return /* spotless:off */ other is AccountCreateParams && name == other.name && entityId == other.entityId && informationalEntityId == other.informationalEntityId && programId == other.programId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */
return /* spotless:off */ other is AccountCreateParams && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */
}

override fun hashCode(): Int = /* spotless:off */ Objects.hash(name, entityId, informationalEntityId, programId, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */
override fun hashCode(): Int = /* spotless:off */ Objects.hash(body, additionalHeaders, additionalQueryParams) /* spotless:on */

override fun toString() =
"AccountCreateParams{name=$name, entityId=$entityId, informationalEntityId=$informationalEntityId, programId=$programId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}"
"AccountCreateParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,29 @@ constructor(

fun createdAt(): Optional<CreatedAt> = Optional.ofNullable(createdAt)

/** Return the page of entries after this one. */
fun cursor(): Optional<String> = Optional.ofNullable(cursor)

/** Filter Accounts for those belonging to the specified Entity. */
fun entityId(): Optional<String> = Optional.ofNullable(entityId)

/**
* Filter records to the one with the specified `idempotency_key` you chose for that object.
* This value is unique across Increase and is used to ensure that a request is only processed
* once. Learn more about [idempotency](https://increase.com/documentation/idempotency-keys).
*/
fun idempotencyKey(): Optional<String> = Optional.ofNullable(idempotencyKey)

/** Filter Accounts for those belonging to the specified Entity as informational. */
fun informationalEntityId(): Optional<String> = Optional.ofNullable(informationalEntityId)

/** Limit the size of the list that is returned. The default (and maximum) is 100 objects. */
fun limit(): Optional<Long> = Optional.ofNullable(limit)

/** Filter Accounts for those in a specific Program. */
fun programId(): Optional<String> = Optional.ofNullable(programId)

/** Filter Accounts for those with the specified status. */
fun status(): Optional<Status> = Optional.ofNullable(status)

fun _additionalHeaders(): Headers = additionalHeaders
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,39 +21,30 @@ import java.util.Optional

class AccountNumberCreateParams
constructor(
private val accountId: String,
private val name: String,
private val inboundAch: InboundAch?,
private val inboundChecks: InboundChecks?,
private val body: AccountNumberCreateBody,
private val additionalHeaders: Headers,
private val additionalQueryParams: QueryParams,
private val additionalBodyProperties: Map<String, JsonValue>,
) {

fun accountId(): String = accountId
/** The Account the Account Number should belong to. */
fun accountId(): String = body.accountId()

fun name(): String = name
/** The name you choose for the Account Number. */
fun name(): String = body.name()

fun inboundAch(): Optional<InboundAch> = Optional.ofNullable(inboundAch)
/** Options related to how this Account Number should handle inbound ACH transfers. */
fun inboundAch(): Optional<InboundAch> = body.inboundAch()

fun inboundChecks(): Optional<InboundChecks> = Optional.ofNullable(inboundChecks)
/** Options related to how this Account Number should handle inbound check withdrawals. */
fun inboundChecks(): Optional<InboundChecks> = body.inboundChecks()

fun _additionalHeaders(): Headers = additionalHeaders

fun _additionalQueryParams(): QueryParams = additionalQueryParams

fun _additionalBodyProperties(): Map<String, JsonValue> = additionalBodyProperties

@JvmSynthetic
internal fun getBody(): AccountNumberCreateBody {
return AccountNumberCreateBody(
accountId,
name,
inboundAch,
inboundChecks,
additionalBodyProperties,
)
}
fun _additionalBodyProperties(): Map<String, JsonValue> = body._additionalProperties()

@JvmSynthetic internal fun getBody(): AccountNumberCreateBody = body

@JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders

Expand Down Expand Up @@ -186,38 +177,29 @@ constructor(
@NoAutoDetect
class Builder {

private var accountId: String? = null
private var name: String? = null
private var inboundAch: InboundAch? = null
private var inboundChecks: InboundChecks? = null
private var body: AccountNumberCreateBody.Builder = AccountNumberCreateBody.builder()
private var additionalHeaders: Headers.Builder = Headers.builder()
private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
private var additionalBodyProperties: MutableMap<String, JsonValue> = mutableMapOf()

@JvmSynthetic
internal fun from(accountNumberCreateParams: AccountNumberCreateParams) = apply {
accountId = accountNumberCreateParams.accountId
name = accountNumberCreateParams.name
inboundAch = accountNumberCreateParams.inboundAch
inboundChecks = accountNumberCreateParams.inboundChecks
body = accountNumberCreateParams.body.toBuilder()
additionalHeaders = accountNumberCreateParams.additionalHeaders.toBuilder()
additionalQueryParams = accountNumberCreateParams.additionalQueryParams.toBuilder()
additionalBodyProperties =
accountNumberCreateParams.additionalBodyProperties.toMutableMap()
}

/** The Account the Account Number should belong to. */
fun accountId(accountId: String) = apply { this.accountId = accountId }
fun accountId(accountId: String) = apply { body.accountId(accountId) }

/** The name you choose for the Account Number. */
fun name(name: String) = apply { this.name = name }
fun name(name: String) = apply { body.name(name) }

/** Options related to how this Account Number should handle inbound ACH transfers. */
fun inboundAch(inboundAch: InboundAch) = apply { this.inboundAch = inboundAch }
fun inboundAch(inboundAch: InboundAch) = apply { body.inboundAch(inboundAch) }

/** Options related to how this Account Number should handle inbound check withdrawals. */
fun inboundChecks(inboundChecks: InboundChecks) = apply {
this.inboundChecks = inboundChecks
body.inboundChecks(inboundChecks)
}

fun additionalHeaders(additionalHeaders: Headers) = apply {
Expand Down Expand Up @@ -319,36 +301,29 @@ constructor(
}

fun additionalBodyProperties(additionalBodyProperties: Map<String, JsonValue>) = apply {
this.additionalBodyProperties.clear()
putAllAdditionalBodyProperties(additionalBodyProperties)
body.additionalProperties(additionalBodyProperties)
}

fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply {
additionalBodyProperties.put(key, value)
body.putAdditionalProperty(key, value)
}

fun putAllAdditionalBodyProperties(additionalBodyProperties: Map<String, JsonValue>) =
apply {
this.additionalBodyProperties.putAll(additionalBodyProperties)
body.putAllAdditionalProperties(additionalBodyProperties)
}

fun removeAdditionalBodyProperty(key: String) = apply {
additionalBodyProperties.remove(key)
}
fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) }

fun removeAllAdditionalBodyProperties(keys: Set<String>) = apply {
keys.forEach(::removeAdditionalBodyProperty)
body.removeAllAdditionalProperties(keys)
}

fun build(): AccountNumberCreateParams =
AccountNumberCreateParams(
checkNotNull(accountId) { "`accountId` is required but was not set" },
checkNotNull(name) { "`name` is required but was not set" },
inboundAch,
inboundChecks,
body.build(),
additionalHeaders.build(),
additionalQueryParams.build(),
additionalBodyProperties.toImmutable(),
)
}

Expand Down Expand Up @@ -649,11 +624,11 @@ constructor(
return true
}

return /* spotless:off */ other is AccountNumberCreateParams && accountId == other.accountId && name == other.name && inboundAch == other.inboundAch && inboundChecks == other.inboundChecks && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */
return /* spotless:off */ other is AccountNumberCreateParams && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */
}

override fun hashCode(): Int = /* spotless:off */ Objects.hash(accountId, name, inboundAch, inboundChecks, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */
override fun hashCode(): Int = /* spotless:off */ Objects.hash(body, additionalHeaders, additionalQueryParams) /* spotless:on */

override fun toString() =
"AccountNumberCreateParams{accountId=$accountId, name=$name, inboundAch=$inboundAch, inboundChecks=$inboundChecks, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}"
"AccountNumberCreateParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
}
Loading