|
| 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.fasterxml.jackson.annotation.*; |
| 11 | +import com.fasterxml.jackson.databind.annotation.*; |
| 12 | + |
| 13 | +import io.vrap.rmf.base.client.utils.Generated; |
| 14 | + |
| 15 | +/** |
| 16 | + * <p>Generated after a successful <a href="https://docs.commercetools.com/apis/ctp:api:type:CartFreezeCartAction" rel="nofollow">Freeze Cart</a> update action.</p> |
| 17 | + * |
| 18 | + * <hr> |
| 19 | + * Example to create an instance using the builder pattern |
| 20 | + * <div class=code-example> |
| 21 | + * <pre><code class='java'> |
| 22 | + * CartFrozenMessage cartFrozenMessage = CartFrozenMessage.builder() |
| 23 | + * .id("{id}") |
| 24 | + * .version(0.3) |
| 25 | + * .createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z")) |
| 26 | + * .lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z")) |
| 27 | + * .sequenceNumber(0.3) |
| 28 | + * .resource(resourceBuilder -> resourceBuilder) |
| 29 | + * .resourceVersion(0.3) |
| 30 | + * .build() |
| 31 | + * </code></pre> |
| 32 | + * </div> |
| 33 | + */ |
| 34 | +@io.vrap.rmf.base.client.utils.json.SubType("CartFrozen") |
| 35 | +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") |
| 36 | +@JsonDeserialize(as = CartFrozenMessageImpl.class) |
| 37 | +public interface CartFrozenMessage extends Message { |
| 38 | + |
| 39 | + /** |
| 40 | + * discriminator value for CartFrozenMessage |
| 41 | + */ |
| 42 | + String CART_FROZEN = "CartFrozen"; |
| 43 | + |
| 44 | + /** |
| 45 | + * factory method |
| 46 | + * @return instance of CartFrozenMessage |
| 47 | + */ |
| 48 | + public static CartFrozenMessage of() { |
| 49 | + return new CartFrozenMessageImpl(); |
| 50 | + } |
| 51 | + |
| 52 | + /** |
| 53 | + * factory method to create a shallow copy CartFrozenMessage |
| 54 | + * @param template instance to be copied |
| 55 | + * @return copy instance |
| 56 | + */ |
| 57 | + public static CartFrozenMessage of(final CartFrozenMessage template) { |
| 58 | + CartFrozenMessageImpl instance = new CartFrozenMessageImpl(); |
| 59 | + instance.setId(template.getId()); |
| 60 | + instance.setVersion(template.getVersion()); |
| 61 | + instance.setCreatedAt(template.getCreatedAt()); |
| 62 | + instance.setLastModifiedAt(template.getLastModifiedAt()); |
| 63 | + instance.setLastModifiedBy(template.getLastModifiedBy()); |
| 64 | + instance.setCreatedBy(template.getCreatedBy()); |
| 65 | + instance.setSequenceNumber(template.getSequenceNumber()); |
| 66 | + instance.setResource(template.getResource()); |
| 67 | + instance.setResourceVersion(template.getResourceVersion()); |
| 68 | + instance.setResourceUserProvidedIdentifiers(template.getResourceUserProvidedIdentifiers()); |
| 69 | + return instance; |
| 70 | + } |
| 71 | + |
| 72 | + public CartFrozenMessage copyDeep(); |
| 73 | + |
| 74 | + /** |
| 75 | + * factory method to create a deep copy of CartFrozenMessage |
| 76 | + * @param template instance to be copied |
| 77 | + * @return copy instance |
| 78 | + */ |
| 79 | + @Nullable |
| 80 | + public static CartFrozenMessage deepCopy(@Nullable final CartFrozenMessage template) { |
| 81 | + if (template == null) { |
| 82 | + return null; |
| 83 | + } |
| 84 | + CartFrozenMessageImpl instance = new CartFrozenMessageImpl(); |
| 85 | + instance.setId(template.getId()); |
| 86 | + instance.setVersion(template.getVersion()); |
| 87 | + instance.setCreatedAt(template.getCreatedAt()); |
| 88 | + instance.setLastModifiedAt(template.getLastModifiedAt()); |
| 89 | + instance.setLastModifiedBy( |
| 90 | + com.commercetools.api.models.common.LastModifiedBy.deepCopy(template.getLastModifiedBy())); |
| 91 | + instance.setCreatedBy(com.commercetools.api.models.common.CreatedBy.deepCopy(template.getCreatedBy())); |
| 92 | + instance.setSequenceNumber(template.getSequenceNumber()); |
| 93 | + instance.setResource(com.commercetools.api.models.common.Reference.deepCopy(template.getResource())); |
| 94 | + instance.setResourceVersion(template.getResourceVersion()); |
| 95 | + instance.setResourceUserProvidedIdentifiers(com.commercetools.api.models.message.UserProvidedIdentifiers |
| 96 | + .deepCopy(template.getResourceUserProvidedIdentifiers())); |
| 97 | + return instance; |
| 98 | + } |
| 99 | + |
| 100 | + /** |
| 101 | + * builder factory method for CartFrozenMessage |
| 102 | + * @return builder |
| 103 | + */ |
| 104 | + public static CartFrozenMessageBuilder builder() { |
| 105 | + return CartFrozenMessageBuilder.of(); |
| 106 | + } |
| 107 | + |
| 108 | + /** |
| 109 | + * create builder for CartFrozenMessage instance |
| 110 | + * @param template instance with prefilled values for the builder |
| 111 | + * @return builder |
| 112 | + */ |
| 113 | + public static CartFrozenMessageBuilder builder(final CartFrozenMessage template) { |
| 114 | + return CartFrozenMessageBuilder.of(template); |
| 115 | + } |
| 116 | + |
| 117 | + /** |
| 118 | + * accessor map function |
| 119 | + * @param <T> mapped type |
| 120 | + * @param helper function to map the object |
| 121 | + * @return mapped value |
| 122 | + */ |
| 123 | + default <T> T withCartFrozenMessage(Function<CartFrozenMessage, T> helper) { |
| 124 | + return helper.apply(this); |
| 125 | + } |
| 126 | + |
| 127 | + /** |
| 128 | + * gives a TypeReference for usage with Jackson DataBind |
| 129 | + * @return TypeReference |
| 130 | + */ |
| 131 | + public static com.fasterxml.jackson.core.type.TypeReference<CartFrozenMessage> typeReference() { |
| 132 | + return new com.fasterxml.jackson.core.type.TypeReference<CartFrozenMessage>() { |
| 133 | + @Override |
| 134 | + public String toString() { |
| 135 | + return "TypeReference<CartFrozenMessage>"; |
| 136 | + } |
| 137 | + }; |
| 138 | + } |
| 139 | +} |
0 commit comments