001
002package com.commercetools.api.models.subscription;
003
004import java.time.*;
005import java.util.*;
006import java.util.function.Function;
007
008import javax.annotation.Nullable;
009import javax.validation.constraints.NotNull;
010
011import com.fasterxml.jackson.annotation.*;
012import com.fasterxml.jackson.databind.annotation.*;
013
014import io.vrap.rmf.base.client.utils.Generated;
015
016/**
017 *  <p>Azure Event Grid can be used to push messages to Azure Functions, HTTP endpoints (webhooks), and several other Azure tools. Event Grid can only be used with the CloudEventsFormat. To set up a Subscription with Azure Event Grid, first create a topic in the Azure Portal. To allow Composable Commerce to push messages to your topic, provide an access key.</p>
018 *
019 * <hr>
020 * Example to create an instance using the builder pattern
021 * <div class=code-example>
022 * <pre><code class='java'>
023 *     AzureEventGridDestination azureEventGridDestination = AzureEventGridDestination.builder()
024 *             .uri("{uri}")
025 *             .accessKey("{accessKey}")
026 *             .build()
027 * </code></pre>
028 * </div>
029 */
030@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
031@JsonDeserialize(as = AzureEventGridDestinationImpl.class)
032public interface AzureEventGridDestination extends Destination {
033
034    /**
035     * discriminator value for AzureEventGridDestination
036     */
037    String EVENT_GRID = "EventGrid";
038
039    /**
040     *  <p>URI of the topic.</p>
041     * @return uri
042     */
043    @NotNull
044    @JsonProperty("uri")
045    public String getUri();
046
047    /**
048     *  <p>Partially hidden on retrieval for security reasons.</p>
049     * @return accessKey
050     */
051    @NotNull
052    @JsonProperty("accessKey")
053    public String getAccessKey();
054
055    /**
056     *  <p>URI of the topic.</p>
057     * @param uri value to be set
058     */
059
060    public void setUri(final String uri);
061
062    /**
063     *  <p>Partially hidden on retrieval for security reasons.</p>
064     * @param accessKey value to be set
065     */
066
067    public void setAccessKey(final String accessKey);
068
069    /**
070     * factory method
071     * @return instance of AzureEventGridDestination
072     */
073    public static AzureEventGridDestination of() {
074        return new AzureEventGridDestinationImpl();
075    }
076
077    /**
078     * factory method to create a shallow copy AzureEventGridDestination
079     * @param template instance to be copied
080     * @return copy instance
081     */
082    public static AzureEventGridDestination of(final AzureEventGridDestination template) {
083        AzureEventGridDestinationImpl instance = new AzureEventGridDestinationImpl();
084        instance.setUri(template.getUri());
085        instance.setAccessKey(template.getAccessKey());
086        return instance;
087    }
088
089    /**
090     * factory method to create a deep copy of AzureEventGridDestination
091     * @param template instance to be copied
092     * @return copy instance
093     */
094    @Nullable
095    public static AzureEventGridDestination deepCopy(@Nullable final AzureEventGridDestination template) {
096        if (template == null) {
097            return null;
098        }
099        AzureEventGridDestinationImpl instance = new AzureEventGridDestinationImpl();
100        instance.setUri(template.getUri());
101        instance.setAccessKey(template.getAccessKey());
102        return instance;
103    }
104
105    /**
106     * builder factory method for AzureEventGridDestination
107     * @return builder
108     */
109    public static AzureEventGridDestinationBuilder builder() {
110        return AzureEventGridDestinationBuilder.of();
111    }
112
113    /**
114     * create builder for AzureEventGridDestination instance
115     * @param template instance with prefilled values for the builder
116     * @return builder
117     */
118    public static AzureEventGridDestinationBuilder builder(final AzureEventGridDestination template) {
119        return AzureEventGridDestinationBuilder.of(template);
120    }
121
122    /**
123     * accessor map function
124     * @param <T> mapped type
125     * @param helper function to map the object
126     * @return mapped value
127     */
128    default <T> T withAzureEventGridDestination(Function<AzureEventGridDestination, T> helper) {
129        return helper.apply(this);
130    }
131
132    /**
133     * gives a TypeReference for usage with Jackson DataBind
134     * @return TypeReference
135     */
136    public static com.fasterxml.jackson.core.type.TypeReference<AzureEventGridDestination> typeReference() {
137        return new com.fasterxml.jackson.core.type.TypeReference<AzureEventGridDestination>() {
138            @Override
139            public String toString() {
140                return "TypeReference<AzureEventGridDestination>";
141            }
142        };
143    }
144}