001 002package com.commercetools.api.models.message; 003 004import java.time.*; 005import java.util.*; 006import java.util.function.Function; 007 008import javax.annotation.Nullable; 009import javax.validation.Valid; 010import javax.validation.constraints.NotNull; 011 012import com.commercetools.api.models.common.Address; 013import com.fasterxml.jackson.annotation.*; 014import com.fasterxml.jackson.databind.annotation.*; 015 016import io.vrap.rmf.base.client.utils.Generated; 017 018/** 019 * <p>Generated after a successful Add Billing Address Identifier update action.</p> 020 * 021 * <hr> 022 * Example to create an instance using the builder pattern 023 * <div class=code-example> 024 * <pre><code class='java'> 025 * BusinessUnitBillingAddressAddedMessage businessUnitBillingAddressAddedMessage = BusinessUnitBillingAddressAddedMessage.builder() 026 * .id("{id}") 027 * .version(0.3) 028 * .createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z")) 029 * .lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z")) 030 * .sequenceNumber(0.3) 031 * .resource(resourceBuilder -> resourceBuilder) 032 * .resourceVersion(0.3) 033 * .address(addressBuilder -> addressBuilder) 034 * .build() 035 * </code></pre> 036 * </div> 037 */ 038@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 039@JsonDeserialize(as = BusinessUnitBillingAddressAddedMessageImpl.class) 040public interface BusinessUnitBillingAddressAddedMessage extends Message { 041 042 /** 043 * discriminator value for BusinessUnitBillingAddressAddedMessage 044 */ 045 String BUSINESS_UNIT_BILLING_ADDRESS_ADDED = "BusinessUnitBillingAddressAdded"; 046 047 /** 048 * <p>The address that was added to the Business Unit as billing address.</p> 049 * @return address 050 */ 051 @NotNull 052 @Valid 053 @JsonProperty("address") 054 public Address getAddress(); 055 056 /** 057 * <p>The address that was added to the Business Unit as billing address.</p> 058 * @param address value to be set 059 */ 060 061 public void setAddress(final Address address); 062 063 /** 064 * factory method 065 * @return instance of BusinessUnitBillingAddressAddedMessage 066 */ 067 public static BusinessUnitBillingAddressAddedMessage of() { 068 return new BusinessUnitBillingAddressAddedMessageImpl(); 069 } 070 071 /** 072 * factory method to create a shallow copy BusinessUnitBillingAddressAddedMessage 073 * @param template instance to be copied 074 * @return copy instance 075 */ 076 public static BusinessUnitBillingAddressAddedMessage of(final BusinessUnitBillingAddressAddedMessage template) { 077 BusinessUnitBillingAddressAddedMessageImpl instance = new BusinessUnitBillingAddressAddedMessageImpl(); 078 instance.setId(template.getId()); 079 instance.setVersion(template.getVersion()); 080 instance.setCreatedAt(template.getCreatedAt()); 081 instance.setLastModifiedAt(template.getLastModifiedAt()); 082 instance.setLastModifiedBy(template.getLastModifiedBy()); 083 instance.setCreatedBy(template.getCreatedBy()); 084 instance.setSequenceNumber(template.getSequenceNumber()); 085 instance.setResource(template.getResource()); 086 instance.setResourceVersion(template.getResourceVersion()); 087 instance.setResourceUserProvidedIdentifiers(template.getResourceUserProvidedIdentifiers()); 088 instance.setAddress(template.getAddress()); 089 return instance; 090 } 091 092 /** 093 * factory method to create a deep copy of BusinessUnitBillingAddressAddedMessage 094 * @param template instance to be copied 095 * @return copy instance 096 */ 097 @Nullable 098 public static BusinessUnitBillingAddressAddedMessage deepCopy( 099 @Nullable final BusinessUnitBillingAddressAddedMessage template) { 100 if (template == null) { 101 return null; 102 } 103 BusinessUnitBillingAddressAddedMessageImpl instance = new BusinessUnitBillingAddressAddedMessageImpl(); 104 instance.setId(template.getId()); 105 instance.setVersion(template.getVersion()); 106 instance.setCreatedAt(template.getCreatedAt()); 107 instance.setLastModifiedAt(template.getLastModifiedAt()); 108 instance.setLastModifiedBy( 109 com.commercetools.api.models.common.LastModifiedBy.deepCopy(template.getLastModifiedBy())); 110 instance.setCreatedBy(com.commercetools.api.models.common.CreatedBy.deepCopy(template.getCreatedBy())); 111 instance.setSequenceNumber(template.getSequenceNumber()); 112 instance.setResource(com.commercetools.api.models.common.Reference.deepCopy(template.getResource())); 113 instance.setResourceVersion(template.getResourceVersion()); 114 instance.setResourceUserProvidedIdentifiers(com.commercetools.api.models.message.UserProvidedIdentifiers 115 .deepCopy(template.getResourceUserProvidedIdentifiers())); 116 instance.setAddress(com.commercetools.api.models.common.Address.deepCopy(template.getAddress())); 117 return instance; 118 } 119 120 /** 121 * builder factory method for BusinessUnitBillingAddressAddedMessage 122 * @return builder 123 */ 124 public static BusinessUnitBillingAddressAddedMessageBuilder builder() { 125 return BusinessUnitBillingAddressAddedMessageBuilder.of(); 126 } 127 128 /** 129 * create builder for BusinessUnitBillingAddressAddedMessage instance 130 * @param template instance with prefilled values for the builder 131 * @return builder 132 */ 133 public static BusinessUnitBillingAddressAddedMessageBuilder builder( 134 final BusinessUnitBillingAddressAddedMessage template) { 135 return BusinessUnitBillingAddressAddedMessageBuilder.of(template); 136 } 137 138 /** 139 * accessor map function 140 * @param <T> mapped type 141 * @param helper function to map the object 142 * @return mapped value 143 */ 144 default <T> T withBusinessUnitBillingAddressAddedMessage( 145 Function<BusinessUnitBillingAddressAddedMessage, T> helper) { 146 return helper.apply(this); 147 } 148 149 /** 150 * gives a TypeReference for usage with Jackson DataBind 151 * @return TypeReference 152 */ 153 public static com.fasterxml.jackson.core.type.TypeReference<BusinessUnitBillingAddressAddedMessage> typeReference() { 154 return new com.fasterxml.jackson.core.type.TypeReference<BusinessUnitBillingAddressAddedMessage>() { 155 @Override 156 public String toString() { 157 return "TypeReference<BusinessUnitBillingAddressAddedMessage>"; 158 } 159 }; 160 } 161}