001 002package com.commercetools.api.models.business_unit; 003 004import java.util.*; 005import java.util.function.Function; 006 007import javax.annotation.Nullable; 008 009import io.vrap.rmf.base.client.Builder; 010import io.vrap.rmf.base.client.utils.Generated; 011 012/** 013 * DivisionDraftBuilder 014 * <hr> 015 * Example to create an instance using the builder pattern 016 * <div class=code-example> 017 * <pre><code class='java'> 018 * DivisionDraft divisionDraft = DivisionDraft.builder() 019 * .key("{key}") 020 * .name("{name}") 021 * .parentUnit(parentUnitBuilder -> parentUnitBuilder) 022 * .build() 023 * </code></pre> 024 * </div> 025 */ 026@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 027public class DivisionDraftBuilder implements Builder<DivisionDraft> { 028 029 private String key; 030 031 @Nullable 032 private com.commercetools.api.models.business_unit.BusinessUnitStatus status; 033 034 @Nullable 035 private java.util.List<com.commercetools.api.models.store.StoreResourceIdentifier> stores; 036 037 @Nullable 038 private com.commercetools.api.models.business_unit.BusinessUnitStoreMode storeMode; 039 040 private String name; 041 042 @Nullable 043 private String contactEmail; 044 045 @Nullable 046 private com.commercetools.api.models.business_unit.BusinessUnitAssociateMode associateMode; 047 048 @Nullable 049 private java.util.List<com.commercetools.api.models.business_unit.AssociateDraft> associates; 050 051 @Nullable 052 private java.util.List<com.commercetools.api.models.common.BaseAddress> addresses; 053 054 @Nullable 055 private java.util.List<Integer> shippingAddresses; 056 057 @Nullable 058 private Integer defaultShippingAddress; 059 060 @Nullable 061 private java.util.List<Integer> billingAddresses; 062 063 @Nullable 064 private Integer defaultBillingAddress; 065 066 @Nullable 067 private com.commercetools.api.models.type.CustomFieldsDraft custom; 068 069 private com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifier parentUnit; 070 071 /** 072 * <p>User-defined unique identifier for the Business Unit.</p> 073 * @param key value to be set 074 * @return Builder 075 */ 076 077 public DivisionDraftBuilder key(final String key) { 078 this.key = key; 079 return this; 080 } 081 082 /** 083 * <p>Indicates whether the Business Unit can be edited and used in Orders.</p> 084 * @param status value to be set 085 * @return Builder 086 */ 087 088 public DivisionDraftBuilder status( 089 @Nullable final com.commercetools.api.models.business_unit.BusinessUnitStatus status) { 090 this.status = status; 091 return this; 092 } 093 094 /** 095 * <p>Sets the Stores the Business Unit is associated with. Can only be set when <code>storeMode</code> is <code>Explicit</code>. Defaults to empty for Companies and not set for Divisions.</p> 096 * <p>If the Business Unit has Stores defined, then all of its Carts, Orders, Quotes, or Quote Requests must belong to one of the Business Unit's Stores.</p> 097 * <p>If the Business Unit has no Stores, then all of its Carts, Orders, Quotes, or Quote Requests must not belong to any Store.</p> 098 * @param stores value to be set 099 * @return Builder 100 */ 101 102 public DivisionDraftBuilder stores( 103 @Nullable final com.commercetools.api.models.store.StoreResourceIdentifier... stores) { 104 this.stores = new ArrayList<>(Arrays.asList(stores)); 105 return this; 106 } 107 108 /** 109 * <p>Sets the Stores the Business Unit is associated with. Can only be set when <code>storeMode</code> is <code>Explicit</code>. Defaults to empty for Companies and not set for Divisions.</p> 110 * <p>If the Business Unit has Stores defined, then all of its Carts, Orders, Quotes, or Quote Requests must belong to one of the Business Unit's Stores.</p> 111 * <p>If the Business Unit has no Stores, then all of its Carts, Orders, Quotes, or Quote Requests must not belong to any Store.</p> 112 * @param stores value to be set 113 * @return Builder 114 */ 115 116 public DivisionDraftBuilder stores( 117 @Nullable final java.util.List<com.commercetools.api.models.store.StoreResourceIdentifier> stores) { 118 this.stores = stores; 119 return this; 120 } 121 122 /** 123 * <p>Sets the Stores the Business Unit is associated with. Can only be set when <code>storeMode</code> is <code>Explicit</code>. Defaults to empty for Companies and not set for Divisions.</p> 124 * <p>If the Business Unit has Stores defined, then all of its Carts, Orders, Quotes, or Quote Requests must belong to one of the Business Unit's Stores.</p> 125 * <p>If the Business Unit has no Stores, then all of its Carts, Orders, Quotes, or Quote Requests must not belong to any Store.</p> 126 * @param stores value to be set 127 * @return Builder 128 */ 129 130 public DivisionDraftBuilder plusStores( 131 @Nullable final com.commercetools.api.models.store.StoreResourceIdentifier... stores) { 132 if (this.stores == null) { 133 this.stores = new ArrayList<>(); 134 } 135 this.stores.addAll(Arrays.asList(stores)); 136 return this; 137 } 138 139 /** 140 * <p>Sets the Stores the Business Unit is associated with. Can only be set when <code>storeMode</code> is <code>Explicit</code>. Defaults to empty for Companies and not set for Divisions.</p> 141 * <p>If the Business Unit has Stores defined, then all of its Carts, Orders, Quotes, or Quote Requests must belong to one of the Business Unit's Stores.</p> 142 * <p>If the Business Unit has no Stores, then all of its Carts, Orders, Quotes, or Quote Requests must not belong to any Store.</p> 143 * @param builder function to build the stores value 144 * @return Builder 145 */ 146 147 public DivisionDraftBuilder plusStores( 148 Function<com.commercetools.api.models.store.StoreResourceIdentifierBuilder, com.commercetools.api.models.store.StoreResourceIdentifierBuilder> builder) { 149 if (this.stores == null) { 150 this.stores = new ArrayList<>(); 151 } 152 this.stores.add(builder.apply(com.commercetools.api.models.store.StoreResourceIdentifierBuilder.of()).build()); 153 return this; 154 } 155 156 /** 157 * <p>Sets the Stores the Business Unit is associated with. Can only be set when <code>storeMode</code> is <code>Explicit</code>. Defaults to empty for Companies and not set for Divisions.</p> 158 * <p>If the Business Unit has Stores defined, then all of its Carts, Orders, Quotes, or Quote Requests must belong to one of the Business Unit's Stores.</p> 159 * <p>If the Business Unit has no Stores, then all of its Carts, Orders, Quotes, or Quote Requests must not belong to any Store.</p> 160 * @param builder function to build the stores value 161 * @return Builder 162 */ 163 164 public DivisionDraftBuilder withStores( 165 Function<com.commercetools.api.models.store.StoreResourceIdentifierBuilder, com.commercetools.api.models.store.StoreResourceIdentifierBuilder> builder) { 166 this.stores = new ArrayList<>(); 167 this.stores.add(builder.apply(com.commercetools.api.models.store.StoreResourceIdentifierBuilder.of()).build()); 168 return this; 169 } 170 171 /** 172 * <p>Sets the Stores the Business Unit is associated with. Can only be set when <code>storeMode</code> is <code>Explicit</code>. Defaults to empty for Companies and not set for Divisions.</p> 173 * <p>If the Business Unit has Stores defined, then all of its Carts, Orders, Quotes, or Quote Requests must belong to one of the Business Unit's Stores.</p> 174 * <p>If the Business Unit has no Stores, then all of its Carts, Orders, Quotes, or Quote Requests must not belong to any Store.</p> 175 * @param builder function to build the stores value 176 * @return Builder 177 */ 178 179 public DivisionDraftBuilder addStores( 180 Function<com.commercetools.api.models.store.StoreResourceIdentifierBuilder, com.commercetools.api.models.store.StoreResourceIdentifier> builder) { 181 return plusStores(builder.apply(com.commercetools.api.models.store.StoreResourceIdentifierBuilder.of())); 182 } 183 184 /** 185 * <p>Sets the Stores the Business Unit is associated with. Can only be set when <code>storeMode</code> is <code>Explicit</code>. Defaults to empty for Companies and not set for Divisions.</p> 186 * <p>If the Business Unit has Stores defined, then all of its Carts, Orders, Quotes, or Quote Requests must belong to one of the Business Unit's Stores.</p> 187 * <p>If the Business Unit has no Stores, then all of its Carts, Orders, Quotes, or Quote Requests must not belong to any Store.</p> 188 * @param builder function to build the stores value 189 * @return Builder 190 */ 191 192 public DivisionDraftBuilder setStores( 193 Function<com.commercetools.api.models.store.StoreResourceIdentifierBuilder, com.commercetools.api.models.store.StoreResourceIdentifier> builder) { 194 return stores(builder.apply(com.commercetools.api.models.store.StoreResourceIdentifierBuilder.of())); 195 } 196 197 /** 198 * <p>If not set, the Division inherits the Stores from a parent unit. Set this to <code>Explicit</code> if you want to set the Stores explicitly in the <code>stores</code> field instead.</p> 199 * @param storeMode value to be set 200 * @return Builder 201 */ 202 203 public DivisionDraftBuilder storeMode( 204 @Nullable final com.commercetools.api.models.business_unit.BusinessUnitStoreMode storeMode) { 205 this.storeMode = storeMode; 206 return this; 207 } 208 209 /** 210 * <p>Name of the Business Unit.</p> 211 * @param name value to be set 212 * @return Builder 213 */ 214 215 public DivisionDraftBuilder name(final String name) { 216 this.name = name; 217 return this; 218 } 219 220 /** 221 * <p>Email address of the Business Unit.</p> 222 * @param contactEmail value to be set 223 * @return Builder 224 */ 225 226 public DivisionDraftBuilder contactEmail(@Nullable final String contactEmail) { 227 this.contactEmail = contactEmail; 228 return this; 229 } 230 231 /** 232 * <p>Determines whether the Division can inherit Associates from a parent.</p> 233 * @param associateMode value to be set 234 * @return Builder 235 */ 236 237 public DivisionDraftBuilder associateMode( 238 @Nullable final com.commercetools.api.models.business_unit.BusinessUnitAssociateMode associateMode) { 239 this.associateMode = associateMode; 240 return this; 241 } 242 243 /** 244 * <p>List of members that are part of the Business Unit in specific roles.</p> 245 * @param associates value to be set 246 * @return Builder 247 */ 248 249 public DivisionDraftBuilder associates( 250 @Nullable final com.commercetools.api.models.business_unit.AssociateDraft... associates) { 251 this.associates = new ArrayList<>(Arrays.asList(associates)); 252 return this; 253 } 254 255 /** 256 * <p>List of members that are part of the Business Unit in specific roles.</p> 257 * @param associates value to be set 258 * @return Builder 259 */ 260 261 public DivisionDraftBuilder associates( 262 @Nullable final java.util.List<com.commercetools.api.models.business_unit.AssociateDraft> associates) { 263 this.associates = associates; 264 return this; 265 } 266 267 /** 268 * <p>List of members that are part of the Business Unit in specific roles.</p> 269 * @param associates value to be set 270 * @return Builder 271 */ 272 273 public DivisionDraftBuilder plusAssociates( 274 @Nullable final com.commercetools.api.models.business_unit.AssociateDraft... associates) { 275 if (this.associates == null) { 276 this.associates = new ArrayList<>(); 277 } 278 this.associates.addAll(Arrays.asList(associates)); 279 return this; 280 } 281 282 /** 283 * <p>List of members that are part of the Business Unit in specific roles.</p> 284 * @param builder function to build the associates value 285 * @return Builder 286 */ 287 288 public DivisionDraftBuilder plusAssociates( 289 Function<com.commercetools.api.models.business_unit.AssociateDraftBuilder, com.commercetools.api.models.business_unit.AssociateDraftBuilder> builder) { 290 if (this.associates == null) { 291 this.associates = new ArrayList<>(); 292 } 293 this.associates 294 .add(builder.apply(com.commercetools.api.models.business_unit.AssociateDraftBuilder.of()).build()); 295 return this; 296 } 297 298 /** 299 * <p>List of members that are part of the Business Unit in specific roles.</p> 300 * @param builder function to build the associates value 301 * @return Builder 302 */ 303 304 public DivisionDraftBuilder withAssociates( 305 Function<com.commercetools.api.models.business_unit.AssociateDraftBuilder, com.commercetools.api.models.business_unit.AssociateDraftBuilder> builder) { 306 this.associates = new ArrayList<>(); 307 this.associates 308 .add(builder.apply(com.commercetools.api.models.business_unit.AssociateDraftBuilder.of()).build()); 309 return this; 310 } 311 312 /** 313 * <p>List of members that are part of the Business Unit in specific roles.</p> 314 * @param builder function to build the associates value 315 * @return Builder 316 */ 317 318 public DivisionDraftBuilder addAssociates( 319 Function<com.commercetools.api.models.business_unit.AssociateDraftBuilder, com.commercetools.api.models.business_unit.AssociateDraft> builder) { 320 return plusAssociates(builder.apply(com.commercetools.api.models.business_unit.AssociateDraftBuilder.of())); 321 } 322 323 /** 324 * <p>List of members that are part of the Business Unit in specific roles.</p> 325 * @param builder function to build the associates value 326 * @return Builder 327 */ 328 329 public DivisionDraftBuilder setAssociates( 330 Function<com.commercetools.api.models.business_unit.AssociateDraftBuilder, com.commercetools.api.models.business_unit.AssociateDraft> builder) { 331 return associates(builder.apply(com.commercetools.api.models.business_unit.AssociateDraftBuilder.of())); 332 } 333 334 /** 335 * <p>Addresses used by the Business Unit.</p> 336 * @param addresses value to be set 337 * @return Builder 338 */ 339 340 public DivisionDraftBuilder addresses( 341 @Nullable final com.commercetools.api.models.common.BaseAddress... addresses) { 342 this.addresses = new ArrayList<>(Arrays.asList(addresses)); 343 return this; 344 } 345 346 /** 347 * <p>Addresses used by the Business Unit.</p> 348 * @param addresses value to be set 349 * @return Builder 350 */ 351 352 public DivisionDraftBuilder addresses( 353 @Nullable final java.util.List<com.commercetools.api.models.common.BaseAddress> addresses) { 354 this.addresses = addresses; 355 return this; 356 } 357 358 /** 359 * <p>Addresses used by the Business Unit.</p> 360 * @param addresses value to be set 361 * @return Builder 362 */ 363 364 public DivisionDraftBuilder plusAddresses( 365 @Nullable final com.commercetools.api.models.common.BaseAddress... addresses) { 366 if (this.addresses == null) { 367 this.addresses = new ArrayList<>(); 368 } 369 this.addresses.addAll(Arrays.asList(addresses)); 370 return this; 371 } 372 373 /** 374 * <p>Addresses used by the Business Unit.</p> 375 * @param builder function to build the addresses value 376 * @return Builder 377 */ 378 379 public DivisionDraftBuilder plusAddresses( 380 Function<com.commercetools.api.models.common.BaseAddressBuilder, com.commercetools.api.models.common.BaseAddressBuilder> builder) { 381 if (this.addresses == null) { 382 this.addresses = new ArrayList<>(); 383 } 384 this.addresses.add(builder.apply(com.commercetools.api.models.common.BaseAddressBuilder.of()).build()); 385 return this; 386 } 387 388 /** 389 * <p>Addresses used by the Business Unit.</p> 390 * @param builder function to build the addresses value 391 * @return Builder 392 */ 393 394 public DivisionDraftBuilder withAddresses( 395 Function<com.commercetools.api.models.common.BaseAddressBuilder, com.commercetools.api.models.common.BaseAddressBuilder> builder) { 396 this.addresses = new ArrayList<>(); 397 this.addresses.add(builder.apply(com.commercetools.api.models.common.BaseAddressBuilder.of()).build()); 398 return this; 399 } 400 401 /** 402 * <p>Addresses used by the Business Unit.</p> 403 * @param builder function to build the addresses value 404 * @return Builder 405 */ 406 407 public DivisionDraftBuilder addAddresses( 408 Function<com.commercetools.api.models.common.BaseAddressBuilder, com.commercetools.api.models.common.BaseAddress> builder) { 409 return plusAddresses(builder.apply(com.commercetools.api.models.common.BaseAddressBuilder.of())); 410 } 411 412 /** 413 * <p>Addresses used by the Business Unit.</p> 414 * @param builder function to build the addresses value 415 * @return Builder 416 */ 417 418 public DivisionDraftBuilder setAddresses( 419 Function<com.commercetools.api.models.common.BaseAddressBuilder, com.commercetools.api.models.common.BaseAddress> builder) { 420 return addresses(builder.apply(com.commercetools.api.models.common.BaseAddressBuilder.of())); 421 } 422 423 /** 424 * <p>Indexes of entries in <code>addresses</code> to set as shipping addresses. The <code>shippingAddressIds</code> of the Customer will be replaced by these addresses.</p> 425 * @param shippingAddresses value to be set 426 * @return Builder 427 */ 428 429 public DivisionDraftBuilder shippingAddresses(@Nullable final Integer... shippingAddresses) { 430 this.shippingAddresses = new ArrayList<>(Arrays.asList(shippingAddresses)); 431 return this; 432 } 433 434 /** 435 * <p>Indexes of entries in <code>addresses</code> to set as shipping addresses. The <code>shippingAddressIds</code> of the Customer will be replaced by these addresses.</p> 436 * @param shippingAddresses value to be set 437 * @return Builder 438 */ 439 440 public DivisionDraftBuilder shippingAddresses(@Nullable final java.util.List<Integer> shippingAddresses) { 441 this.shippingAddresses = shippingAddresses; 442 return this; 443 } 444 445 /** 446 * <p>Indexes of entries in <code>addresses</code> to set as shipping addresses. The <code>shippingAddressIds</code> of the Customer will be replaced by these addresses.</p> 447 * @param shippingAddresses value to be set 448 * @return Builder 449 */ 450 451 public DivisionDraftBuilder plusShippingAddresses(@Nullable final Integer... shippingAddresses) { 452 if (this.shippingAddresses == null) { 453 this.shippingAddresses = new ArrayList<>(); 454 } 455 this.shippingAddresses.addAll(Arrays.asList(shippingAddresses)); 456 return this; 457 } 458 459 /** 460 * <p>Index of the entry in <code>addresses</code> to set as the default shipping address.</p> 461 * @param defaultShippingAddress value to be set 462 * @return Builder 463 */ 464 465 public DivisionDraftBuilder defaultShippingAddress(@Nullable final Integer defaultShippingAddress) { 466 this.defaultShippingAddress = defaultShippingAddress; 467 return this; 468 } 469 470 /** 471 * <p>Indexes of entries in <code>addresses</code> to set as billing addresses. The <code>billingAddressIds</code> of the Customer will be replaced by these addresses.</p> 472 * @param billingAddresses value to be set 473 * @return Builder 474 */ 475 476 public DivisionDraftBuilder billingAddresses(@Nullable final Integer... billingAddresses) { 477 this.billingAddresses = new ArrayList<>(Arrays.asList(billingAddresses)); 478 return this; 479 } 480 481 /** 482 * <p>Indexes of entries in <code>addresses</code> to set as billing addresses. The <code>billingAddressIds</code> of the Customer will be replaced by these addresses.</p> 483 * @param billingAddresses value to be set 484 * @return Builder 485 */ 486 487 public DivisionDraftBuilder billingAddresses(@Nullable final java.util.List<Integer> billingAddresses) { 488 this.billingAddresses = billingAddresses; 489 return this; 490 } 491 492 /** 493 * <p>Indexes of entries in <code>addresses</code> to set as billing addresses. The <code>billingAddressIds</code> of the Customer will be replaced by these addresses.</p> 494 * @param billingAddresses value to be set 495 * @return Builder 496 */ 497 498 public DivisionDraftBuilder plusBillingAddresses(@Nullable final Integer... billingAddresses) { 499 if (this.billingAddresses == null) { 500 this.billingAddresses = new ArrayList<>(); 501 } 502 this.billingAddresses.addAll(Arrays.asList(billingAddresses)); 503 return this; 504 } 505 506 /** 507 * <p>Index of the entry in <code>addresses</code> to set as the default billing address.</p> 508 * @param defaultBillingAddress value to be set 509 * @return Builder 510 */ 511 512 public DivisionDraftBuilder defaultBillingAddress(@Nullable final Integer defaultBillingAddress) { 513 this.defaultBillingAddress = defaultBillingAddress; 514 return this; 515 } 516 517 /** 518 * <p>Custom Fields for the Business Unit.</p> 519 * @param builder function to build the custom value 520 * @return Builder 521 */ 522 523 public DivisionDraftBuilder custom( 524 Function<com.commercetools.api.models.type.CustomFieldsDraftBuilder, com.commercetools.api.models.type.CustomFieldsDraftBuilder> builder) { 525 this.custom = builder.apply(com.commercetools.api.models.type.CustomFieldsDraftBuilder.of()).build(); 526 return this; 527 } 528 529 /** 530 * <p>Custom Fields for the Business Unit.</p> 531 * @param builder function to build the custom value 532 * @return Builder 533 */ 534 535 public DivisionDraftBuilder withCustom( 536 Function<com.commercetools.api.models.type.CustomFieldsDraftBuilder, com.commercetools.api.models.type.CustomFieldsDraft> builder) { 537 this.custom = builder.apply(com.commercetools.api.models.type.CustomFieldsDraftBuilder.of()); 538 return this; 539 } 540 541 /** 542 * <p>Custom Fields for the Business Unit.</p> 543 * @param custom value to be set 544 * @return Builder 545 */ 546 547 public DivisionDraftBuilder custom(@Nullable final com.commercetools.api.models.type.CustomFieldsDraft custom) { 548 this.custom = custom; 549 return this; 550 } 551 552 /** 553 * <p>The parent unit of this Division. Can be a Company or a Division.</p> 554 * @param builder function to build the parentUnit value 555 * @return Builder 556 */ 557 558 public DivisionDraftBuilder parentUnit( 559 Function<com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifierBuilder, com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifierBuilder> builder) { 560 this.parentUnit = builder 561 .apply(com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifierBuilder.of()) 562 .build(); 563 return this; 564 } 565 566 /** 567 * <p>The parent unit of this Division. Can be a Company or a Division.</p> 568 * @param builder function to build the parentUnit value 569 * @return Builder 570 */ 571 572 public DivisionDraftBuilder withParentUnit( 573 Function<com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifierBuilder, com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifier> builder) { 574 this.parentUnit = builder 575 .apply(com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifierBuilder.of()); 576 return this; 577 } 578 579 /** 580 * <p>The parent unit of this Division. Can be a Company or a Division.</p> 581 * @param parentUnit value to be set 582 * @return Builder 583 */ 584 585 public DivisionDraftBuilder parentUnit( 586 final com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifier parentUnit) { 587 this.parentUnit = parentUnit; 588 return this; 589 } 590 591 /** 592 * <p>User-defined unique identifier for the Business Unit.</p> 593 * @return key 594 */ 595 596 public String getKey() { 597 return this.key; 598 } 599 600 /** 601 * <p>Indicates whether the Business Unit can be edited and used in Orders.</p> 602 * @return status 603 */ 604 605 @Nullable 606 public com.commercetools.api.models.business_unit.BusinessUnitStatus getStatus() { 607 return this.status; 608 } 609 610 /** 611 * <p>Sets the Stores the Business Unit is associated with. Can only be set when <code>storeMode</code> is <code>Explicit</code>. Defaults to empty for Companies and not set for Divisions.</p> 612 * <p>If the Business Unit has Stores defined, then all of its Carts, Orders, Quotes, or Quote Requests must belong to one of the Business Unit's Stores.</p> 613 * <p>If the Business Unit has no Stores, then all of its Carts, Orders, Quotes, or Quote Requests must not belong to any Store.</p> 614 * @return stores 615 */ 616 617 @Nullable 618 public java.util.List<com.commercetools.api.models.store.StoreResourceIdentifier> getStores() { 619 return this.stores; 620 } 621 622 /** 623 * <p>If not set, the Division inherits the Stores from a parent unit. Set this to <code>Explicit</code> if you want to set the Stores explicitly in the <code>stores</code> field instead.</p> 624 * @return storeMode 625 */ 626 627 @Nullable 628 public com.commercetools.api.models.business_unit.BusinessUnitStoreMode getStoreMode() { 629 return this.storeMode; 630 } 631 632 /** 633 * <p>Name of the Business Unit.</p> 634 * @return name 635 */ 636 637 public String getName() { 638 return this.name; 639 } 640 641 /** 642 * <p>Email address of the Business Unit.</p> 643 * @return contactEmail 644 */ 645 646 @Nullable 647 public String getContactEmail() { 648 return this.contactEmail; 649 } 650 651 /** 652 * <p>Determines whether the Division can inherit Associates from a parent.</p> 653 * @return associateMode 654 */ 655 656 @Nullable 657 public com.commercetools.api.models.business_unit.BusinessUnitAssociateMode getAssociateMode() { 658 return this.associateMode; 659 } 660 661 /** 662 * <p>List of members that are part of the Business Unit in specific roles.</p> 663 * @return associates 664 */ 665 666 @Nullable 667 public java.util.List<com.commercetools.api.models.business_unit.AssociateDraft> getAssociates() { 668 return this.associates; 669 } 670 671 /** 672 * <p>Addresses used by the Business Unit.</p> 673 * @return addresses 674 */ 675 676 @Nullable 677 public java.util.List<com.commercetools.api.models.common.BaseAddress> getAddresses() { 678 return this.addresses; 679 } 680 681 /** 682 * <p>Indexes of entries in <code>addresses</code> to set as shipping addresses. The <code>shippingAddressIds</code> of the Customer will be replaced by these addresses.</p> 683 * @return shippingAddresses 684 */ 685 686 @Nullable 687 public java.util.List<Integer> getShippingAddresses() { 688 return this.shippingAddresses; 689 } 690 691 /** 692 * <p>Index of the entry in <code>addresses</code> to set as the default shipping address.</p> 693 * @return defaultShippingAddress 694 */ 695 696 @Nullable 697 public Integer getDefaultShippingAddress() { 698 return this.defaultShippingAddress; 699 } 700 701 /** 702 * <p>Indexes of entries in <code>addresses</code> to set as billing addresses. The <code>billingAddressIds</code> of the Customer will be replaced by these addresses.</p> 703 * @return billingAddresses 704 */ 705 706 @Nullable 707 public java.util.List<Integer> getBillingAddresses() { 708 return this.billingAddresses; 709 } 710 711 /** 712 * <p>Index of the entry in <code>addresses</code> to set as the default billing address.</p> 713 * @return defaultBillingAddress 714 */ 715 716 @Nullable 717 public Integer getDefaultBillingAddress() { 718 return this.defaultBillingAddress; 719 } 720 721 /** 722 * <p>Custom Fields for the Business Unit.</p> 723 * @return custom 724 */ 725 726 @Nullable 727 public com.commercetools.api.models.type.CustomFieldsDraft getCustom() { 728 return this.custom; 729 } 730 731 /** 732 * <p>The parent unit of this Division. Can be a Company or a Division.</p> 733 * @return parentUnit 734 */ 735 736 public com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifier getParentUnit() { 737 return this.parentUnit; 738 } 739 740 /** 741 * builds DivisionDraft with checking for non-null required values 742 * @return DivisionDraft 743 */ 744 public DivisionDraft build() { 745 Objects.requireNonNull(key, DivisionDraft.class + ": key is missing"); 746 Objects.requireNonNull(name, DivisionDraft.class + ": name is missing"); 747 Objects.requireNonNull(parentUnit, DivisionDraft.class + ": parentUnit is missing"); 748 return new DivisionDraftImpl(key, status, stores, storeMode, name, contactEmail, associateMode, associates, 749 addresses, shippingAddresses, defaultShippingAddress, billingAddresses, defaultBillingAddress, custom, 750 parentUnit); 751 } 752 753 /** 754 * builds DivisionDraft without checking for non-null required values 755 * @return DivisionDraft 756 */ 757 public DivisionDraft buildUnchecked() { 758 return new DivisionDraftImpl(key, status, stores, storeMode, name, contactEmail, associateMode, associates, 759 addresses, shippingAddresses, defaultShippingAddress, billingAddresses, defaultBillingAddress, custom, 760 parentUnit); 761 } 762 763 /** 764 * factory method for an instance of DivisionDraftBuilder 765 * @return builder 766 */ 767 public static DivisionDraftBuilder of() { 768 return new DivisionDraftBuilder(); 769 } 770 771 /** 772 * create builder for DivisionDraft instance 773 * @param template instance with prefilled values for the builder 774 * @return builder 775 */ 776 public static DivisionDraftBuilder of(final DivisionDraft template) { 777 DivisionDraftBuilder builder = new DivisionDraftBuilder(); 778 builder.key = template.getKey(); 779 builder.status = template.getStatus(); 780 builder.stores = template.getStores(); 781 builder.storeMode = template.getStoreMode(); 782 builder.name = template.getName(); 783 builder.contactEmail = template.getContactEmail(); 784 builder.associateMode = template.getAssociateMode(); 785 builder.associates = template.getAssociates(); 786 builder.addresses = template.getAddresses(); 787 builder.shippingAddresses = template.getShippingAddresses(); 788 builder.defaultShippingAddress = template.getDefaultShippingAddress(); 789 builder.billingAddresses = template.getBillingAddresses(); 790 builder.defaultBillingAddress = template.getDefaultBillingAddress(); 791 builder.custom = template.getCustom(); 792 builder.parentUnit = template.getParentUnit(); 793 return builder; 794 } 795 796}