@@ -18,39 +18,36 @@ import java.util.Optional
1818
1919class AccountCreateParams
2020constructor (
21- private val name: String ,
22- private val entityId: String? ,
23- private val informationalEntityId: String? ,
24- private val programId: String? ,
21+ private val body: AccountCreateBody ,
2522 private val additionalHeaders: Headers ,
2623 private val additionalQueryParams: QueryParams ,
27- private val additionalBodyProperties: Map <String , JsonValue >,
2824) {
2925
30- fun name (): String = name
26+ /* * The name you choose for the Account. */
27+ fun name (): String = body.name()
3128
32- fun entityId (): Optional <String > = Optional .ofNullable(entityId)
29+ /* * The identifier for the Entity that will own the Account. */
30+ fun entityId (): Optional <String > = body.entityId()
3331
34- fun informationalEntityId (): Optional <String > = Optional .ofNullable(informationalEntityId)
32+ /* *
33+ * The identifier of an Entity that, while not owning the Account, is associated with its
34+ * activity. Its relationship to your group must be `informational`.
35+ */
36+ fun informationalEntityId (): Optional <String > = body.informationalEntityId()
3537
36- fun programId (): Optional <String > = Optional .ofNullable(programId)
38+ /* *
39+ * The identifier for the Program that this Account falls under. Required if you operate more
40+ * than one Program.
41+ */
42+ fun programId (): Optional <String > = body.programId()
3743
3844 fun _additionalHeaders (): Headers = additionalHeaders
3945
4046 fun _additionalQueryParams (): QueryParams = additionalQueryParams
4147
42- fun _additionalBodyProperties (): Map <String , JsonValue > = additionalBodyProperties
43-
44- @JvmSynthetic
45- internal fun getBody (): AccountCreateBody {
46- return AccountCreateBody (
47- name,
48- entityId,
49- informationalEntityId,
50- programId,
51- additionalBodyProperties,
52- )
53- }
48+ fun _additionalBodyProperties (): Map <String , JsonValue > = body._additionalProperties ()
49+
50+ @JvmSynthetic internal fun getBody (): AccountCreateBody = body
5451
5552 @JvmSynthetic internal fun getHeaders (): Headers = additionalHeaders
5653
@@ -193,44 +190,36 @@ constructor(
193190 @NoAutoDetect
194191 class Builder {
195192
196- private var name: String? = null
197- private var entityId: String? = null
198- private var informationalEntityId: String? = null
199- private var programId: String? = null
193+ private var body: AccountCreateBody .Builder = AccountCreateBody .builder()
200194 private var additionalHeaders: Headers .Builder = Headers .builder()
201195 private var additionalQueryParams: QueryParams .Builder = QueryParams .builder()
202- private var additionalBodyProperties: MutableMap <String , JsonValue > = mutableMapOf ()
203196
204197 @JvmSynthetic
205198 internal fun from (accountCreateParams : AccountCreateParams ) = apply {
206- name = accountCreateParams.name
207- entityId = accountCreateParams.entityId
208- informationalEntityId = accountCreateParams.informationalEntityId
209- programId = accountCreateParams.programId
199+ body = accountCreateParams.body.toBuilder()
210200 additionalHeaders = accountCreateParams.additionalHeaders.toBuilder()
211201 additionalQueryParams = accountCreateParams.additionalQueryParams.toBuilder()
212- additionalBodyProperties = accountCreateParams.additionalBodyProperties.toMutableMap()
213202 }
214203
215204 /* * The name you choose for the Account. */
216- fun name (name : String ) = apply { this .name = name }
205+ fun name (name : String ) = apply { body .name( name) }
217206
218207 /* * The identifier for the Entity that will own the Account. */
219- fun entityId (entityId : String ) = apply { this .entityId = entityId }
208+ fun entityId (entityId : String ) = apply { body .entityId( entityId) }
220209
221210 /* *
222211 * The identifier of an Entity that, while not owning the Account, is associated with its
223212 * activity. Its relationship to your group must be `informational`.
224213 */
225214 fun informationalEntityId (informationalEntityId : String ) = apply {
226- this .informationalEntityId = informationalEntityId
215+ body .informationalEntityId( informationalEntityId)
227216 }
228217
229218 /* *
230219 * The identifier for the Program that this Account falls under. Required if you operate
231220 * more than one Program.
232221 */
233- fun programId (programId : String ) = apply { this .programId = programId }
222+ fun programId (programId : String ) = apply { body .programId( programId) }
234223
235224 fun additionalHeaders (additionalHeaders : Headers ) = apply {
236225 this .additionalHeaders.clear()
@@ -331,36 +320,29 @@ constructor(
331320 }
332321
333322 fun additionalBodyProperties (additionalBodyProperties : Map <String , JsonValue >) = apply {
334- this .additionalBodyProperties.clear()
335- putAllAdditionalBodyProperties(additionalBodyProperties)
323+ body.additionalProperties(additionalBodyProperties)
336324 }
337325
338326 fun putAdditionalBodyProperty (key : String , value : JsonValue ) = apply {
339- additionalBodyProperties.put (key, value)
327+ body.putAdditionalProperty (key, value)
340328 }
341329
342330 fun putAllAdditionalBodyProperties (additionalBodyProperties : Map <String , JsonValue >) =
343331 apply {
344- this .additionalBodyProperties.putAll (additionalBodyProperties)
332+ body.putAllAdditionalProperties (additionalBodyProperties)
345333 }
346334
347- fun removeAdditionalBodyProperty (key : String ) = apply {
348- additionalBodyProperties.remove(key)
349- }
335+ fun removeAdditionalBodyProperty (key : String ) = apply { body.removeAdditionalProperty(key) }
350336
351337 fun removeAllAdditionalBodyProperties (keys : Set <String >) = apply {
352- keys.forEach(::removeAdditionalBodyProperty )
338+ body.removeAllAdditionalProperties(keys )
353339 }
354340
355341 fun build (): AccountCreateParams =
356342 AccountCreateParams (
357- checkNotNull(name) { " `name` is required but was not set" },
358- entityId,
359- informationalEntityId,
360- programId,
343+ body.build(),
361344 additionalHeaders.build(),
362345 additionalQueryParams.build(),
363- additionalBodyProperties.toImmutable(),
364346 )
365347 }
366348
@@ -369,11 +351,11 @@ constructor(
369351 return true
370352 }
371353
372- 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 */
354+ return /* spotless:off */ other is AccountCreateParams && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */
373355 }
374356
375- override fun hashCode (): Int = /* spotless:off */ Objects .hash(name, entityId, informationalEntityId, programId, additionalHeaders, additionalQueryParams, additionalBodyProperties ) /* spotless:on */
357+ override fun hashCode (): Int = /* spotless:off */ Objects .hash(body, additionalHeaders, additionalQueryParams) /* spotless:on */
376358
377359 override fun toString () =
378- " AccountCreateParams{name= $name , entityId= $entityId , informationalEntityId= $informationalEntityId , programId= $programId , additionalHeaders=$additionalHeaders , additionalQueryParams=$additionalQueryParams , additionalBodyProperties= $additionalBodyProperties }"
360+ " AccountCreateParams{body= $body , additionalHeaders=$additionalHeaders , additionalQueryParams=$additionalQueryParams }"
379361}
0 commit comments