Skip to content

Commit a2fe597

Browse files
feat(api): manual updates
1 parent c6249db commit a2fe597

File tree

11 files changed

+666
-4
lines changed

11 files changed

+666
-4
lines changed

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 43
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/inty%2Finty-75693228159e3b80133b46750a39e294ae40ac9cab0d65831d7632fcdf72ca5f.yml
3-
openapi_spec_hash: a449467e89739f4e1789e77b7acb92ae
4-
config_hash: c1821fa1362c0f084f8b4b913bb6a709
1+
configured_endpoints: 44
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/inty%2Finty-8c144d825fdfa369cf16995bf00706fb8bef562ade8cf6948b28b737ecb6a6cb.yml
3+
openapi_spec_hash: 0131ffad8903eedaf491699b0e28351b
4+
config_hash: c0a34dbff811a8b614d969c58e58846e
Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
// File generated from our OpenAPI spec by Stainless.
2+
3+
package com.inty.api.models.api.v1.users.profile
4+
5+
import com.inty.api.core.Params
6+
import com.inty.api.core.http.Headers
7+
import com.inty.api.core.http.QueryParams
8+
import java.util.Objects
9+
10+
/** Get current user profile. */
11+
class ProfileMeParams
12+
private constructor(
13+
private val additionalHeaders: Headers,
14+
private val additionalQueryParams: QueryParams,
15+
) : Params {
16+
17+
/** Additional headers to send with the request. */
18+
fun _additionalHeaders(): Headers = additionalHeaders
19+
20+
/** Additional query param to send with the request. */
21+
fun _additionalQueryParams(): QueryParams = additionalQueryParams
22+
23+
fun toBuilder() = Builder().from(this)
24+
25+
companion object {
26+
27+
fun none(): ProfileMeParams = builder().build()
28+
29+
/** Returns a mutable builder for constructing an instance of [ProfileMeParams]. */
30+
fun builder() = Builder()
31+
}
32+
33+
/** A builder for [ProfileMeParams]. */
34+
class Builder internal constructor() {
35+
36+
private var additionalHeaders: Headers.Builder = Headers.builder()
37+
private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
38+
39+
internal fun from(profileMeParams: ProfileMeParams) = apply {
40+
additionalHeaders = profileMeParams.additionalHeaders.toBuilder()
41+
additionalQueryParams = profileMeParams.additionalQueryParams.toBuilder()
42+
}
43+
44+
fun additionalHeaders(additionalHeaders: Headers) = apply {
45+
this.additionalHeaders.clear()
46+
putAllAdditionalHeaders(additionalHeaders)
47+
}
48+
49+
fun additionalHeaders(additionalHeaders: Map<String, Iterable<String>>) = apply {
50+
this.additionalHeaders.clear()
51+
putAllAdditionalHeaders(additionalHeaders)
52+
}
53+
54+
fun putAdditionalHeader(name: String, value: String) = apply {
55+
additionalHeaders.put(name, value)
56+
}
57+
58+
fun putAdditionalHeaders(name: String, values: Iterable<String>) = apply {
59+
additionalHeaders.put(name, values)
60+
}
61+
62+
fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply {
63+
this.additionalHeaders.putAll(additionalHeaders)
64+
}
65+
66+
fun putAllAdditionalHeaders(additionalHeaders: Map<String, Iterable<String>>) = apply {
67+
this.additionalHeaders.putAll(additionalHeaders)
68+
}
69+
70+
fun replaceAdditionalHeaders(name: String, value: String) = apply {
71+
additionalHeaders.replace(name, value)
72+
}
73+
74+
fun replaceAdditionalHeaders(name: String, values: Iterable<String>) = apply {
75+
additionalHeaders.replace(name, values)
76+
}
77+
78+
fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply {
79+
this.additionalHeaders.replaceAll(additionalHeaders)
80+
}
81+
82+
fun replaceAllAdditionalHeaders(additionalHeaders: Map<String, Iterable<String>>) = apply {
83+
this.additionalHeaders.replaceAll(additionalHeaders)
84+
}
85+
86+
fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) }
87+
88+
fun removeAllAdditionalHeaders(names: Set<String>) = apply {
89+
additionalHeaders.removeAll(names)
90+
}
91+
92+
fun additionalQueryParams(additionalQueryParams: QueryParams) = apply {
93+
this.additionalQueryParams.clear()
94+
putAllAdditionalQueryParams(additionalQueryParams)
95+
}
96+
97+
fun additionalQueryParams(additionalQueryParams: Map<String, Iterable<String>>) = apply {
98+
this.additionalQueryParams.clear()
99+
putAllAdditionalQueryParams(additionalQueryParams)
100+
}
101+
102+
fun putAdditionalQueryParam(key: String, value: String) = apply {
103+
additionalQueryParams.put(key, value)
104+
}
105+
106+
fun putAdditionalQueryParams(key: String, values: Iterable<String>) = apply {
107+
additionalQueryParams.put(key, values)
108+
}
109+
110+
fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply {
111+
this.additionalQueryParams.putAll(additionalQueryParams)
112+
}
113+
114+
fun putAllAdditionalQueryParams(additionalQueryParams: Map<String, Iterable<String>>) =
115+
apply {
116+
this.additionalQueryParams.putAll(additionalQueryParams)
117+
}
118+
119+
fun replaceAdditionalQueryParams(key: String, value: String) = apply {
120+
additionalQueryParams.replace(key, value)
121+
}
122+
123+
fun replaceAdditionalQueryParams(key: String, values: Iterable<String>) = apply {
124+
additionalQueryParams.replace(key, values)
125+
}
126+
127+
fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply {
128+
this.additionalQueryParams.replaceAll(additionalQueryParams)
129+
}
130+
131+
fun replaceAllAdditionalQueryParams(additionalQueryParams: Map<String, Iterable<String>>) =
132+
apply {
133+
this.additionalQueryParams.replaceAll(additionalQueryParams)
134+
}
135+
136+
fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) }
137+
138+
fun removeAllAdditionalQueryParams(keys: Set<String>) = apply {
139+
additionalQueryParams.removeAll(keys)
140+
}
141+
142+
/**
143+
* Returns an immutable instance of [ProfileMeParams].
144+
*
145+
* Further updates to this [Builder] will not mutate the returned instance.
146+
*/
147+
fun build(): ProfileMeParams =
148+
ProfileMeParams(additionalHeaders.build(), additionalQueryParams.build())
149+
}
150+
151+
override fun _headers(): Headers = additionalHeaders
152+
153+
override fun _queryParams(): QueryParams = additionalQueryParams
154+
155+
override fun equals(other: Any?): Boolean {
156+
if (this === other) {
157+
return true
158+
}
159+
160+
return other is ProfileMeParams &&
161+
additionalHeaders == other.additionalHeaders &&
162+
additionalQueryParams == other.additionalQueryParams
163+
}
164+
165+
override fun hashCode(): Int = Objects.hash(additionalHeaders, additionalQueryParams)
166+
167+
override fun toString() =
168+
"ProfileMeParams{additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
169+
}
Lines changed: 215 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,215 @@
1+
// File generated from our OpenAPI spec by Stainless.
2+
3+
package com.inty.api.models.api.v1.users.profile
4+
5+
import com.fasterxml.jackson.annotation.JsonAnyGetter
6+
import com.fasterxml.jackson.annotation.JsonAnySetter
7+
import com.fasterxml.jackson.annotation.JsonCreator
8+
import com.fasterxml.jackson.annotation.JsonProperty
9+
import com.inty.api.core.ExcludeMissing
10+
import com.inty.api.core.JsonField
11+
import com.inty.api.core.JsonMissing
12+
import com.inty.api.core.JsonValue
13+
import com.inty.api.errors.IntyInvalidDataException
14+
import java.util.Collections
15+
import java.util.Objects
16+
17+
class ProfileMeResponse
18+
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
19+
private constructor(
20+
private val code: JsonField<Long>,
21+
private val data: JsonField<User>,
22+
private val message: JsonField<String>,
23+
private val additionalProperties: MutableMap<String, JsonValue>,
24+
) {
25+
26+
@JsonCreator
27+
private constructor(
28+
@JsonProperty("code") @ExcludeMissing code: JsonField<Long> = JsonMissing.of(),
29+
@JsonProperty("data") @ExcludeMissing data: JsonField<User> = JsonMissing.of(),
30+
@JsonProperty("message") @ExcludeMissing message: JsonField<String> = JsonMissing.of(),
31+
) : this(code, data, message, mutableMapOf())
32+
33+
/**
34+
* @throws IntyInvalidDataException if the JSON field has an unexpected type (e.g. if the server
35+
* responded with an unexpected value).
36+
*/
37+
fun code(): Long? = code.getNullable("code")
38+
39+
/**
40+
* 返回给客户端的用户信息
41+
*
42+
* @throws IntyInvalidDataException if the JSON field has an unexpected type (e.g. if the server
43+
* responded with an unexpected value).
44+
*/
45+
fun data(): User? = data.getNullable("data")
46+
47+
/**
48+
* @throws IntyInvalidDataException if the JSON field has an unexpected type (e.g. if the server
49+
* responded with an unexpected value).
50+
*/
51+
fun message(): String? = message.getNullable("message")
52+
53+
/**
54+
* Returns the raw JSON value of [code].
55+
*
56+
* Unlike [code], this method doesn't throw if the JSON field has an unexpected type.
57+
*/
58+
@JsonProperty("code") @ExcludeMissing fun _code(): JsonField<Long> = code
59+
60+
/**
61+
* Returns the raw JSON value of [data].
62+
*
63+
* Unlike [data], this method doesn't throw if the JSON field has an unexpected type.
64+
*/
65+
@JsonProperty("data") @ExcludeMissing fun _data(): JsonField<User> = data
66+
67+
/**
68+
* Returns the raw JSON value of [message].
69+
*
70+
* Unlike [message], this method doesn't throw if the JSON field has an unexpected type.
71+
*/
72+
@JsonProperty("message") @ExcludeMissing fun _message(): JsonField<String> = message
73+
74+
@JsonAnySetter
75+
private fun putAdditionalProperty(key: String, value: JsonValue) {
76+
additionalProperties.put(key, value)
77+
}
78+
79+
@JsonAnyGetter
80+
@ExcludeMissing
81+
fun _additionalProperties(): Map<String, JsonValue> =
82+
Collections.unmodifiableMap(additionalProperties)
83+
84+
fun toBuilder() = Builder().from(this)
85+
86+
companion object {
87+
88+
/** Returns a mutable builder for constructing an instance of [ProfileMeResponse]. */
89+
fun builder() = Builder()
90+
}
91+
92+
/** A builder for [ProfileMeResponse]. */
93+
class Builder internal constructor() {
94+
95+
private var code: JsonField<Long> = JsonMissing.of()
96+
private var data: JsonField<User> = JsonMissing.of()
97+
private var message: JsonField<String> = JsonMissing.of()
98+
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
99+
100+
internal fun from(profileMeResponse: ProfileMeResponse) = apply {
101+
code = profileMeResponse.code
102+
data = profileMeResponse.data
103+
message = profileMeResponse.message
104+
additionalProperties = profileMeResponse.additionalProperties.toMutableMap()
105+
}
106+
107+
fun code(code: Long) = code(JsonField.of(code))
108+
109+
/**
110+
* Sets [Builder.code] to an arbitrary JSON value.
111+
*
112+
* You should usually call [Builder.code] with a well-typed [Long] value instead. This
113+
* method is primarily for setting the field to an undocumented or not yet supported value.
114+
*/
115+
fun code(code: JsonField<Long>) = apply { this.code = code }
116+
117+
/** 返回给客户端的用户信息 */
118+
fun data(data: User?) = data(JsonField.ofNullable(data))
119+
120+
/**
121+
* Sets [Builder.data] to an arbitrary JSON value.
122+
*
123+
* You should usually call [Builder.data] with a well-typed [User] value instead. This
124+
* method is primarily for setting the field to an undocumented or not yet supported value.
125+
*/
126+
fun data(data: JsonField<User>) = apply { this.data = data }
127+
128+
fun message(message: String) = message(JsonField.of(message))
129+
130+
/**
131+
* Sets [Builder.message] to an arbitrary JSON value.
132+
*
133+
* You should usually call [Builder.message] with a well-typed [String] value instead. This
134+
* method is primarily for setting the field to an undocumented or not yet supported value.
135+
*/
136+
fun message(message: JsonField<String>) = apply { this.message = message }
137+
138+
fun additionalProperties(additionalProperties: Map<String, JsonValue>) = apply {
139+
this.additionalProperties.clear()
140+
putAllAdditionalProperties(additionalProperties)
141+
}
142+
143+
fun putAdditionalProperty(key: String, value: JsonValue) = apply {
144+
additionalProperties.put(key, value)
145+
}
146+
147+
fun putAllAdditionalProperties(additionalProperties: Map<String, JsonValue>) = apply {
148+
this.additionalProperties.putAll(additionalProperties)
149+
}
150+
151+
fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) }
152+
153+
fun removeAllAdditionalProperties(keys: Set<String>) = apply {
154+
keys.forEach(::removeAdditionalProperty)
155+
}
156+
157+
/**
158+
* Returns an immutable instance of [ProfileMeResponse].
159+
*
160+
* Further updates to this [Builder] will not mutate the returned instance.
161+
*/
162+
fun build(): ProfileMeResponse =
163+
ProfileMeResponse(code, data, message, additionalProperties.toMutableMap())
164+
}
165+
166+
private var validated: Boolean = false
167+
168+
fun validate(): ProfileMeResponse = apply {
169+
if (validated) {
170+
return@apply
171+
}
172+
173+
code()
174+
data()?.validate()
175+
message()
176+
validated = true
177+
}
178+
179+
fun isValid(): Boolean =
180+
try {
181+
validate()
182+
true
183+
} catch (e: IntyInvalidDataException) {
184+
false
185+
}
186+
187+
/**
188+
* Returns a score indicating how many valid values are contained in this object recursively.
189+
*
190+
* Used for best match union deserialization.
191+
*/
192+
internal fun validity(): Int =
193+
(if (code.asKnown() == null) 0 else 1) +
194+
(data.asKnown()?.validity() ?: 0) +
195+
(if (message.asKnown() == null) 0 else 1)
196+
197+
override fun equals(other: Any?): Boolean {
198+
if (this === other) {
199+
return true
200+
}
201+
202+
return other is ProfileMeResponse &&
203+
code == other.code &&
204+
data == other.data &&
205+
message == other.message &&
206+
additionalProperties == other.additionalProperties
207+
}
208+
209+
private val hashCode: Int by lazy { Objects.hash(code, data, message, additionalProperties) }
210+
211+
override fun hashCode(): Int = hashCode
212+
213+
override fun toString() =
214+
"ProfileMeResponse{code=$code, data=$data, message=$message, additionalProperties=$additionalProperties}"
215+
}

0 commit comments

Comments
 (0)