|
| 1 | + |
| 2 | +package com.commercetools.api.models.message; |
| 3 | + |
| 4 | +import java.time.*; |
| 5 | +import java.util.*; |
| 6 | +import java.util.function.Function; |
| 7 | + |
| 8 | +import javax.annotation.Nullable; |
| 9 | + |
| 10 | +import com.commercetools.api.models.business_unit.BusinessUnitKeyReference; |
| 11 | +import com.fasterxml.jackson.annotation.*; |
| 12 | +import com.fasterxml.jackson.databind.annotation.*; |
| 13 | + |
| 14 | +import io.vrap.rmf.base.client.utils.Generated; |
| 15 | + |
| 16 | +import jakarta.validation.Valid; |
| 17 | + |
| 18 | +/** |
| 19 | + * <p>Generated after a successful Set Business Unit update action on Orders or Set Business Unit update action on Order Edits.</p> |
| 20 | + * |
| 21 | + * <hr> |
| 22 | + * Example to create an instance using the builder pattern |
| 23 | + * <div class=code-example> |
| 24 | + * <pre><code class='java'> |
| 25 | + * OrderBusinessUnitSetMessage orderBusinessUnitSetMessage = OrderBusinessUnitSetMessage.builder() |
| 26 | + * .id("{id}") |
| 27 | + * .version(0.3) |
| 28 | + * .createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z")) |
| 29 | + * .lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z")) |
| 30 | + * .sequenceNumber(0.3) |
| 31 | + * .resource(resourceBuilder -> resourceBuilder) |
| 32 | + * .resourceVersion(0.3) |
| 33 | + * .build() |
| 34 | + * </code></pre> |
| 35 | + * </div> |
| 36 | + */ |
| 37 | +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") |
| 38 | +@JsonDeserialize(as = OrderBusinessUnitSetMessageImpl.class) |
| 39 | +public interface OrderBusinessUnitSetMessage extends OrderMessage { |
| 40 | + |
| 41 | + /** |
| 42 | + * discriminator value for OrderBusinessUnitSetMessage |
| 43 | + */ |
| 44 | + String ORDER_BUSINESS_UNIT_SET = "OrderBusinessUnitSet"; |
| 45 | + |
| 46 | + /** |
| 47 | + * <p>BusinessUnit on the Order after the Set Business Unit update action on Orders or Set Business Unit update action on Order Edits.</p> |
| 48 | + * @return businessUnit |
| 49 | + */ |
| 50 | + @Valid |
| 51 | + @JsonProperty("businessUnit") |
| 52 | + public BusinessUnitKeyReference getBusinessUnit(); |
| 53 | + |
| 54 | + /** |
| 55 | + * <p>BusinessUnit on the Order before the Set Business Unit update action on Orders or Set Business Unit update action on Order Edits.</p> |
| 56 | + * @return oldbusinessUnit |
| 57 | + */ |
| 58 | + @Valid |
| 59 | + @JsonProperty("oldbusinessUnit") |
| 60 | + public BusinessUnitKeyReference getOldbusinessUnit(); |
| 61 | + |
| 62 | + /** |
| 63 | + * <p>BusinessUnit on the Order after the Set Business Unit update action on Orders or Set Business Unit update action on Order Edits.</p> |
| 64 | + * @param businessUnit value to be set |
| 65 | + */ |
| 66 | + |
| 67 | + public void setBusinessUnit(final BusinessUnitKeyReference businessUnit); |
| 68 | + |
| 69 | + /** |
| 70 | + * <p>BusinessUnit on the Order before the Set Business Unit update action on Orders or Set Business Unit update action on Order Edits.</p> |
| 71 | + * @param oldbusinessUnit value to be set |
| 72 | + */ |
| 73 | + |
| 74 | + public void setOldbusinessUnit(final BusinessUnitKeyReference oldbusinessUnit); |
| 75 | + |
| 76 | + /** |
| 77 | + * factory method |
| 78 | + * @return instance of OrderBusinessUnitSetMessage |
| 79 | + */ |
| 80 | + public static OrderBusinessUnitSetMessage of() { |
| 81 | + return new OrderBusinessUnitSetMessageImpl(); |
| 82 | + } |
| 83 | + |
| 84 | + /** |
| 85 | + * factory method to create a shallow copy OrderBusinessUnitSetMessage |
| 86 | + * @param template instance to be copied |
| 87 | + * @return copy instance |
| 88 | + */ |
| 89 | + public static OrderBusinessUnitSetMessage of(final OrderBusinessUnitSetMessage template) { |
| 90 | + OrderBusinessUnitSetMessageImpl instance = new OrderBusinessUnitSetMessageImpl(); |
| 91 | + instance.setId(template.getId()); |
| 92 | + instance.setVersion(template.getVersion()); |
| 93 | + instance.setCreatedAt(template.getCreatedAt()); |
| 94 | + instance.setLastModifiedAt(template.getLastModifiedAt()); |
| 95 | + instance.setLastModifiedBy(template.getLastModifiedBy()); |
| 96 | + instance.setCreatedBy(template.getCreatedBy()); |
| 97 | + instance.setSequenceNumber(template.getSequenceNumber()); |
| 98 | + instance.setResource(template.getResource()); |
| 99 | + instance.setResourceVersion(template.getResourceVersion()); |
| 100 | + instance.setResourceUserProvidedIdentifiers(template.getResourceUserProvidedIdentifiers()); |
| 101 | + instance.setBusinessUnit(template.getBusinessUnit()); |
| 102 | + instance.setOldbusinessUnit(template.getOldbusinessUnit()); |
| 103 | + return instance; |
| 104 | + } |
| 105 | + |
| 106 | + /** |
| 107 | + * factory method to create a deep copy of OrderBusinessUnitSetMessage |
| 108 | + * @param template instance to be copied |
| 109 | + * @return copy instance |
| 110 | + */ |
| 111 | + @Nullable |
| 112 | + public static OrderBusinessUnitSetMessage deepCopy(@Nullable final OrderBusinessUnitSetMessage template) { |
| 113 | + if (template == null) { |
| 114 | + return null; |
| 115 | + } |
| 116 | + OrderBusinessUnitSetMessageImpl instance = new OrderBusinessUnitSetMessageImpl(); |
| 117 | + instance.setId(template.getId()); |
| 118 | + instance.setVersion(template.getVersion()); |
| 119 | + instance.setCreatedAt(template.getCreatedAt()); |
| 120 | + instance.setLastModifiedAt(template.getLastModifiedAt()); |
| 121 | + instance.setLastModifiedBy( |
| 122 | + com.commercetools.api.models.common.LastModifiedBy.deepCopy(template.getLastModifiedBy())); |
| 123 | + instance.setCreatedBy(com.commercetools.api.models.common.CreatedBy.deepCopy(template.getCreatedBy())); |
| 124 | + instance.setSequenceNumber(template.getSequenceNumber()); |
| 125 | + instance.setResource(com.commercetools.api.models.common.Reference.deepCopy(template.getResource())); |
| 126 | + instance.setResourceVersion(template.getResourceVersion()); |
| 127 | + instance.setResourceUserProvidedIdentifiers(com.commercetools.api.models.message.UserProvidedIdentifiers |
| 128 | + .deepCopy(template.getResourceUserProvidedIdentifiers())); |
| 129 | + instance.setBusinessUnit( |
| 130 | + com.commercetools.api.models.business_unit.BusinessUnitKeyReference.deepCopy(template.getBusinessUnit())); |
| 131 | + instance.setOldbusinessUnit(com.commercetools.api.models.business_unit.BusinessUnitKeyReference |
| 132 | + .deepCopy(template.getOldbusinessUnit())); |
| 133 | + return instance; |
| 134 | + } |
| 135 | + |
| 136 | + /** |
| 137 | + * builder factory method for OrderBusinessUnitSetMessage |
| 138 | + * @return builder |
| 139 | + */ |
| 140 | + public static OrderBusinessUnitSetMessageBuilder builder() { |
| 141 | + return OrderBusinessUnitSetMessageBuilder.of(); |
| 142 | + } |
| 143 | + |
| 144 | + /** |
| 145 | + * create builder for OrderBusinessUnitSetMessage instance |
| 146 | + * @param template instance with prefilled values for the builder |
| 147 | + * @return builder |
| 148 | + */ |
| 149 | + public static OrderBusinessUnitSetMessageBuilder builder(final OrderBusinessUnitSetMessage template) { |
| 150 | + return OrderBusinessUnitSetMessageBuilder.of(template); |
| 151 | + } |
| 152 | + |
| 153 | + /** |
| 154 | + * accessor map function |
| 155 | + * @param <T> mapped type |
| 156 | + * @param helper function to map the object |
| 157 | + * @return mapped value |
| 158 | + */ |
| 159 | + default <T> T withOrderBusinessUnitSetMessage(Function<OrderBusinessUnitSetMessage, T> helper) { |
| 160 | + return helper.apply(this); |
| 161 | + } |
| 162 | + |
| 163 | + /** |
| 164 | + * gives a TypeReference for usage with Jackson DataBind |
| 165 | + * @return TypeReference |
| 166 | + */ |
| 167 | + public static com.fasterxml.jackson.core.type.TypeReference<OrderBusinessUnitSetMessage> typeReference() { |
| 168 | + return new com.fasterxml.jackson.core.type.TypeReference<OrderBusinessUnitSetMessage>() { |
| 169 | + @Override |
| 170 | + public String toString() { |
| 171 | + return "TypeReference<OrderBusinessUnitSetMessage>"; |
| 172 | + } |
| 173 | + }; |
| 174 | + } |
| 175 | +} |
0 commit comments