Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style(internal): reorder some params methods and improve consistency of implementations #385

Merged
merged 1 commit into from
Nov 21, 2024
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 @@ -35,6 +35,10 @@ constructor(

fun kycExempt(): KycExempt? = kycExempt

fun _additionalHeaders(): Headers = additionalHeaders

fun _additionalQueryParams(): QueryParams = additionalQueryParams

internal fun getBody(): AccountHolderCreateBody {
return AccountHolderCreateBody(
kyb,
Expand Down Expand Up @@ -165,23 +169,6 @@ constructor(
}
}

fun _additionalHeaders(): Headers = additionalHeaders

fun _additionalQueryParams(): QueryParams = additionalQueryParams

override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}

return /* spotless:off */ other is AccountHolderCreateParams && kyb == other.kyb && kyc == other.kyc && kycExempt == other.kycExempt && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */
}

override fun hashCode(): Int = /* spotless:off */ Objects.hash(kyb, kyc, kycExempt, additionalHeaders, additionalQueryParams) /* spotless:on */

override fun toString() =
"AccountHolderCreateParams{kyb=$kyb, kyc=$kyc, kycExempt=$kycExempt, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"

fun toBuilder() = Builder().from(this)

companion object {
Expand All @@ -199,11 +186,11 @@ constructor(
private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()

internal fun from(accountHolderCreateParams: AccountHolderCreateParams) = apply {
this.kyb = accountHolderCreateParams.kyb
this.kyc = accountHolderCreateParams.kyc
this.kycExempt = accountHolderCreateParams.kycExempt
additionalHeaders(accountHolderCreateParams.additionalHeaders)
additionalQueryParams(accountHolderCreateParams.additionalQueryParams)
kyb = accountHolderCreateParams.kyb
kyc = accountHolderCreateParams.kyc
kycExempt = accountHolderCreateParams.kycExempt
additionalHeaders = accountHolderCreateParams.additionalHeaders.toBuilder()
additionalQueryParams = accountHolderCreateParams.additionalQueryParams.toBuilder()
}

fun forKyb(kyb: Kyb) = apply {
Expand Down Expand Up @@ -331,4 +318,17 @@ constructor(
additionalQueryParams.build(),
)
}

override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}

return /* spotless:off */ other is AccountHolderCreateParams && kyb == other.kyb && kyc == other.kyc && kycExempt == other.kycExempt && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */
}

override fun hashCode(): Int = /* spotless:off */ Objects.hash(kyb, kyc, kycExempt, additionalHeaders, additionalQueryParams) /* spotless:on */

override fun toString() =
"AccountHolderCreateParams{kyb=$kyb, kyc=$kyc, kycExempt=$kycExempt, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ constructor(

fun accountHolderToken(): String = accountHolderToken

fun _additionalHeaders(): Headers = additionalHeaders

fun _additionalQueryParams(): QueryParams = additionalQueryParams

internal fun getHeaders(): Headers = additionalHeaders

internal fun getQueryParams(): QueryParams = additionalQueryParams
Expand All @@ -28,23 +32,6 @@ constructor(
}
}

fun _additionalHeaders(): Headers = additionalHeaders

fun _additionalQueryParams(): QueryParams = additionalQueryParams

override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}

return /* spotless:off */ other is AccountHolderListDocumentsParams && accountHolderToken == other.accountHolderToken && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */
}

override fun hashCode(): Int = /* spotless:off */ Objects.hash(accountHolderToken, additionalHeaders, additionalQueryParams) /* spotless:on */

override fun toString() =
"AccountHolderListDocumentsParams{accountHolderToken=$accountHolderToken, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"

fun toBuilder() = Builder().from(this)

companion object {
Expand All @@ -61,9 +48,10 @@ constructor(

internal fun from(accountHolderListDocumentsParams: AccountHolderListDocumentsParams) =
apply {
this.accountHolderToken = accountHolderListDocumentsParams.accountHolderToken
additionalHeaders(accountHolderListDocumentsParams.additionalHeaders)
additionalQueryParams(accountHolderListDocumentsParams.additionalQueryParams)
accountHolderToken = accountHolderListDocumentsParams.accountHolderToken
additionalHeaders = accountHolderListDocumentsParams.additionalHeaders.toBuilder()
additionalQueryParams =
accountHolderListDocumentsParams.additionalQueryParams.toBuilder()
}

fun accountHolderToken(accountHolderToken: String) = apply {
Expand Down Expand Up @@ -177,4 +165,17 @@ constructor(
additionalQueryParams.build(),
)
}

override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}

return /* spotless:off */ other is AccountHolderListDocumentsParams && accountHolderToken == other.accountHolderToken && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */
}

override fun hashCode(): Int = /* spotless:off */ Objects.hash(accountHolderToken, additionalHeaders, additionalQueryParams) /* spotless:on */

override fun toString() =
"AccountHolderListDocumentsParams{accountHolderToken=$accountHolderToken, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ constructor(

fun startingAfter(): String? = startingAfter

fun _additionalHeaders(): Headers = additionalHeaders

fun _additionalQueryParams(): QueryParams = additionalQueryParams

internal fun getHeaders(): Headers = additionalHeaders

internal fun getQueryParams(): QueryParams {
Expand All @@ -74,23 +78,6 @@ constructor(
return queryParams.build()
}

fun _additionalHeaders(): Headers = additionalHeaders

fun _additionalQueryParams(): QueryParams = additionalQueryParams

override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}

return /* spotless:off */ other is AccountHolderListParams && begin == other.begin && email == other.email && end == other.end && endingBefore == other.endingBefore && externalId == other.externalId && firstName == other.firstName && lastName == other.lastName && legalBusinessName == other.legalBusinessName && limit == other.limit && phoneNumber == other.phoneNumber && startingAfter == other.startingAfter && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */
}

override fun hashCode(): Int = /* spotless:off */ Objects.hash(begin, email, end, endingBefore, externalId, firstName, lastName, legalBusinessName, limit, phoneNumber, startingAfter, additionalHeaders, additionalQueryParams) /* spotless:on */

override fun toString() =
"AccountHolderListParams{begin=$begin, email=$email, end=$end, endingBefore=$endingBefore, externalId=$externalId, firstName=$firstName, lastName=$lastName, legalBusinessName=$legalBusinessName, limit=$limit, phoneNumber=$phoneNumber, startingAfter=$startingAfter, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"

fun toBuilder() = Builder().from(this)

companion object {
Expand All @@ -116,19 +103,19 @@ constructor(
private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()

internal fun from(accountHolderListParams: AccountHolderListParams) = apply {
this.begin = accountHolderListParams.begin
this.email = accountHolderListParams.email
this.end = accountHolderListParams.end
this.endingBefore = accountHolderListParams.endingBefore
this.externalId = accountHolderListParams.externalId
this.firstName = accountHolderListParams.firstName
this.lastName = accountHolderListParams.lastName
this.legalBusinessName = accountHolderListParams.legalBusinessName
this.limit = accountHolderListParams.limit
this.phoneNumber = accountHolderListParams.phoneNumber
this.startingAfter = accountHolderListParams.startingAfter
additionalHeaders(accountHolderListParams.additionalHeaders)
additionalQueryParams(accountHolderListParams.additionalQueryParams)
begin = accountHolderListParams.begin
email = accountHolderListParams.email
end = accountHolderListParams.end
endingBefore = accountHolderListParams.endingBefore
externalId = accountHolderListParams.externalId
firstName = accountHolderListParams.firstName
lastName = accountHolderListParams.lastName
legalBusinessName = accountHolderListParams.legalBusinessName
limit = accountHolderListParams.limit
phoneNumber = accountHolderListParams.phoneNumber
startingAfter = accountHolderListParams.startingAfter
additionalHeaders = accountHolderListParams.additionalHeaders.toBuilder()
additionalQueryParams = accountHolderListParams.additionalQueryParams.toBuilder()
}

/**
Expand Down Expand Up @@ -304,4 +291,17 @@ constructor(
additionalQueryParams.build(),
)
}

override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}

return /* spotless:off */ other is AccountHolderListParams && begin == other.begin && email == other.email && end == other.end && endingBefore == other.endingBefore && externalId == other.externalId && firstName == other.firstName && lastName == other.lastName && legalBusinessName == other.legalBusinessName && limit == other.limit && phoneNumber == other.phoneNumber && startingAfter == other.startingAfter && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */
}

override fun hashCode(): Int = /* spotless:off */ Objects.hash(begin, email, end, endingBefore, externalId, firstName, lastName, legalBusinessName, limit, phoneNumber, startingAfter, additionalHeaders, additionalQueryParams) /* spotless:on */

override fun toString() =
"AccountHolderListParams{begin=$begin, email=$email, end=$end, endingBefore=$endingBefore, externalId=$externalId, firstName=$firstName, lastName=$lastName, legalBusinessName=$legalBusinessName, limit=$limit, phoneNumber=$phoneNumber, startingAfter=$startingAfter, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ constructor(

fun workflow(): Workflow = workflow

fun _additionalHeaders(): Headers = additionalHeaders

fun _additionalQueryParams(): QueryParams = additionalQueryParams

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

internal fun getBody(): AccountHolderResubmitBody {
return AccountHolderResubmitBody(
individual,
Expand Down Expand Up @@ -166,25 +172,6 @@ constructor(
"AccountHolderResubmitBody{individual=$individual, tosTimestamp=$tosTimestamp, workflow=$workflow, additionalProperties=$additionalProperties}"
}

fun _additionalHeaders(): Headers = additionalHeaders

fun _additionalQueryParams(): QueryParams = additionalQueryParams

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

override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}

return /* spotless:off */ other is AccountHolderResubmitParams && accountHolderToken == other.accountHolderToken && individual == other.individual && tosTimestamp == other.tosTimestamp && workflow == other.workflow && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */
}

override fun hashCode(): Int = /* spotless:off */ Objects.hash(accountHolderToken, individual, tosTimestamp, workflow, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */

override fun toString() =
"AccountHolderResubmitParams{accountHolderToken=$accountHolderToken, individual=$individual, tosTimestamp=$tosTimestamp, workflow=$workflow, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}"

fun toBuilder() = Builder().from(this)

companion object {
Expand All @@ -204,13 +191,14 @@ constructor(
private var additionalBodyProperties: MutableMap<String, JsonValue> = mutableMapOf()

internal fun from(accountHolderResubmitParams: AccountHolderResubmitParams) = apply {
this.accountHolderToken = accountHolderResubmitParams.accountHolderToken
this.individual = accountHolderResubmitParams.individual
this.tosTimestamp = accountHolderResubmitParams.tosTimestamp
this.workflow = accountHolderResubmitParams.workflow
additionalHeaders(accountHolderResubmitParams.additionalHeaders)
additionalQueryParams(accountHolderResubmitParams.additionalQueryParams)
additionalBodyProperties(accountHolderResubmitParams.additionalBodyProperties)
accountHolderToken = accountHolderResubmitParams.accountHolderToken
individual = accountHolderResubmitParams.individual
tosTimestamp = accountHolderResubmitParams.tosTimestamp
workflow = accountHolderResubmitParams.workflow
additionalHeaders = accountHolderResubmitParams.additionalHeaders.toBuilder()
additionalQueryParams = accountHolderResubmitParams.additionalQueryParams.toBuilder()
additionalBodyProperties =
accountHolderResubmitParams.additionalBodyProperties.toMutableMap()
}

fun accountHolderToken(accountHolderToken: String) = apply {
Expand Down Expand Up @@ -577,4 +565,17 @@ constructor(

fun asString(): String = _value().asStringOrThrow()
}

override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}

return /* spotless:off */ other is AccountHolderResubmitParams && accountHolderToken == other.accountHolderToken && individual == other.individual && tosTimestamp == other.tosTimestamp && workflow == other.workflow && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */
}

override fun hashCode(): Int = /* spotless:off */ Objects.hash(accountHolderToken, individual, tosTimestamp, workflow, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */

override fun toString() =
"AccountHolderResubmitParams{accountHolderToken=$accountHolderToken, individual=$individual, tosTimestamp=$tosTimestamp, workflow=$workflow, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}"
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ constructor(

fun documentToken(): String = documentToken

fun _additionalHeaders(): Headers = additionalHeaders

fun _additionalQueryParams(): QueryParams = additionalQueryParams

internal fun getHeaders(): Headers = additionalHeaders

internal fun getQueryParams(): QueryParams = additionalQueryParams
Expand All @@ -32,23 +36,6 @@ constructor(
}
}

fun _additionalHeaders(): Headers = additionalHeaders

fun _additionalQueryParams(): QueryParams = additionalQueryParams

override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}

return /* spotless:off */ other is AccountHolderRetrieveDocumentParams && accountHolderToken == other.accountHolderToken && documentToken == other.documentToken && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */
}

override fun hashCode(): Int = /* spotless:off */ Objects.hash(accountHolderToken, documentToken, additionalHeaders, additionalQueryParams) /* spotless:on */

override fun toString() =
"AccountHolderRetrieveDocumentParams{accountHolderToken=$accountHolderToken, documentToken=$documentToken, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"

fun toBuilder() = Builder().from(this)

companion object {
Expand All @@ -67,10 +54,11 @@ constructor(
internal fun from(
accountHolderRetrieveDocumentParams: AccountHolderRetrieveDocumentParams
) = apply {
this.accountHolderToken = accountHolderRetrieveDocumentParams.accountHolderToken
this.documentToken = accountHolderRetrieveDocumentParams.documentToken
additionalHeaders(accountHolderRetrieveDocumentParams.additionalHeaders)
additionalQueryParams(accountHolderRetrieveDocumentParams.additionalQueryParams)
accountHolderToken = accountHolderRetrieveDocumentParams.accountHolderToken
documentToken = accountHolderRetrieveDocumentParams.documentToken
additionalHeaders = accountHolderRetrieveDocumentParams.additionalHeaders.toBuilder()
additionalQueryParams =
accountHolderRetrieveDocumentParams.additionalQueryParams.toBuilder()
}

fun accountHolderToken(accountHolderToken: String) = apply {
Expand Down Expand Up @@ -187,4 +175,17 @@ constructor(
additionalQueryParams.build(),
)
}

override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}

return /* spotless:off */ other is AccountHolderRetrieveDocumentParams && accountHolderToken == other.accountHolderToken && documentToken == other.documentToken && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */
}

override fun hashCode(): Int = /* spotless:off */ Objects.hash(accountHolderToken, documentToken, additionalHeaders, additionalQueryParams) /* spotless:on */

override fun toString() =
"AccountHolderRetrieveDocumentParams{accountHolderToken=$accountHolderToken, documentToken=$documentToken, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
}
Loading