Skip to content

Commit

Permalink
chore(internal): codegen related update (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] committed Dec 13, 2024
1 parent 543556d commit b943cf3
Show file tree
Hide file tree
Showing 11 changed files with 188 additions and 160 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ import so.prelude.sdk.models.VerificationCreateResponse;

VerificationCreateParams params = VerificationCreateParams.builder()
.target(VerificationCreateParams.Target.builder()
.type(VerificationCreateParams.Target.Type.phone_number)
.type(VerificationCreateParams.Target.Type.PHONE_NUMBER)
.value("+30123456789")
.build())
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,21 +374,9 @@ constructor(

@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField<String> = value

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

return /* spotless:off */ other is Type && value == other.value /* spotless:on */
}

override fun hashCode() = value.hashCode()

override fun toString() = value.toString()

companion object {

@JvmField val PHONE_NUMBER = Type(JsonField.of("phone_number"))
@JvmField val PHONE_NUMBER = of("phone_number")

@JvmStatic fun of(value: String) = Type(JsonField.of(value))
}
Expand All @@ -415,6 +403,18 @@ constructor(
}

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

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

return /* spotless:off */ other is Type && value == other.value /* spotless:on */
}

override fun hashCode() = value.hashCode()

override fun toString() = value.toString()
}

override fun equals(other: Any?): Boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,25 +151,13 @@ private constructor(

@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField<String> = value

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

return /* spotless:off */ other is Status && value == other.value /* spotless:on */
}

override fun hashCode() = value.hashCode()

override fun toString() = value.toString()

companion object {

@JvmField val SUCCESS = Status(JsonField.of("success"))
@JvmField val SUCCESS = of("success")

@JvmField val FAILURE = Status(JsonField.of("failure"))
@JvmField val FAILURE = of("failure")

@JvmField val EXPIRED_OR_NOT_FOUND = Status(JsonField.of("expired_or_not_found"))
@JvmField val EXPIRED_OR_NOT_FOUND = of("expired_or_not_found")

@JvmStatic fun of(value: String) = Status(JsonField.of(value))
}
Expand Down Expand Up @@ -204,6 +192,18 @@ private constructor(
}

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

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

return /* spotless:off */ other is Status && value == other.value /* spotless:on */
}

override fun hashCode() = value.hashCode()

override fun toString() = value.toString()
}

/** The metadata for this verification. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -427,21 +427,9 @@ constructor(

@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField<String> = value

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

return /* spotless:off */ other is Type && value == other.value /* spotless:on */
}

override fun hashCode() = value.hashCode()

override fun toString() = value.toString()

companion object {

@JvmField val PHONE_NUMBER = Type(JsonField.of("phone_number"))
@JvmField val PHONE_NUMBER = of("phone_number")

@JvmStatic fun of(value: String) = Type(JsonField.of(value))
}
Expand All @@ -468,6 +456,18 @@ constructor(
}

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

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

return /* spotless:off */ other is Type && value == other.value /* spotless:on */
}

override fun hashCode() = value.hashCode()

override fun toString() = value.toString()
}

override fun equals(other: Any?): Boolean {
Expand Down Expand Up @@ -860,29 +860,17 @@ constructor(

@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField<String> = value

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

return /* spotless:off */ other is DevicePlatform && value == other.value /* spotless:on */
}

override fun hashCode() = value.hashCode()

override fun toString() = value.toString()

companion object {

@JvmField val ANDROID = DevicePlatform(JsonField.of("android"))
@JvmField val ANDROID = of("android")

@JvmField val IOS = DevicePlatform(JsonField.of("ios"))
@JvmField val IOS = of("ios")

@JvmField val IPADOS = DevicePlatform(JsonField.of("ipados"))
@JvmField val IPADOS = of("ipados")

@JvmField val TVOS = DevicePlatform(JsonField.of("tvos"))
@JvmField val TVOS = of("tvos")

@JvmField val WEB = DevicePlatform(JsonField.of("web"))
@JvmField val WEB = of("web")

@JvmStatic fun of(value: String) = DevicePlatform(JsonField.of(value))
}
Expand Down Expand Up @@ -925,6 +913,18 @@ constructor(
}

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

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

return /* spotless:off */ other is DevicePlatform && value == other.value /* spotless:on */
}

override fun hashCode() = value.hashCode()

override fun toString() = value.toString()
}

override fun equals(other: Any?): Boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,21 +170,9 @@ private constructor(

@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField<String> = value

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

return /* spotless:off */ other is Method && value == other.value /* spotless:on */
}

override fun hashCode() = value.hashCode()

override fun toString() = value.toString()

companion object {

@JvmField val MESSAGE = Method(JsonField.of("message"))
@JvmField val MESSAGE = of("message")

@JvmStatic fun of(value: String) = Method(JsonField.of(value))
}
Expand All @@ -211,35 +199,35 @@ private constructor(
}

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

class Status
@JsonCreator
private constructor(
private val value: JsonField<String>,
) : Enum {

@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField<String> = value

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

return /* spotless:off */ other is Status && value == other.value /* spotless:on */
return /* spotless:off */ other is Method && value == other.value /* spotless:on */
}

override fun hashCode() = value.hashCode()

override fun toString() = value.toString()
}

class Status
@JsonCreator
private constructor(
private val value: JsonField<String>,
) : Enum {

@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField<String> = value

companion object {

@JvmField val SUCCESS = Status(JsonField.of("success"))
@JvmField val SUCCESS = of("success")

@JvmField val RETRY = Status(JsonField.of("retry"))
@JvmField val RETRY = of("retry")

@JvmField val BLOCKED = Status(JsonField.of("blocked"))
@JvmField val BLOCKED = of("blocked")

@JvmStatic fun of(value: String) = Status(JsonField.of(value))
}
Expand Down Expand Up @@ -274,6 +262,18 @@ private constructor(
}

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

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

return /* spotless:off */ other is Status && value == other.value /* spotless:on */
}

override fun hashCode() = value.hashCode()

override fun toString() = value.toString()
}

/** The metadata for this verification. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,21 +382,9 @@ constructor(

@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField<String> = value

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

return /* spotless:off */ other is Type && value == other.value /* spotless:on */
}

override fun hashCode() = value.hashCode()

override fun toString() = value.toString()

companion object {

@JvmField val CONFIRM_TARGET = Type(JsonField.of("CONFIRM_TARGET"))
@JvmField val CONFIRM_TARGET = of("CONFIRM_TARGET")

@JvmStatic fun of(value: String) = Type(JsonField.of(value))
}
Expand All @@ -423,6 +411,18 @@ constructor(
}

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

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

return /* spotless:off */ other is Type && value == other.value /* spotless:on */
}

override fun hashCode() = value.hashCode()

override fun toString() = value.toString()
}

override fun equals(other: Any?): Boolean {
Expand Down Expand Up @@ -518,21 +518,9 @@ constructor(

@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField<String> = value

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

return /* spotless:off */ other is Type && value == other.value /* spotless:on */
}

override fun hashCode() = value.hashCode()

override fun toString() = value.toString()

companion object {

@JvmField val PHONE_NUMBER = Type(JsonField.of("phone_number"))
@JvmField val PHONE_NUMBER = of("phone_number")

@JvmStatic fun of(value: String) = Type(JsonField.of(value))
}
Expand All @@ -559,6 +547,18 @@ constructor(
}

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

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

return /* spotless:off */ other is Type && value == other.value /* spotless:on */
}

override fun hashCode() = value.hashCode()

override fun toString() = value.toString()
}

override fun equals(other: Any?): Boolean {
Expand Down
Loading

0 comments on commit b943cf3

Please sign in to comment.