001
002package com.commercetools.api.models.subscription;
003
004import java.time.*;
005import java.util.*;
006
007import com.fasterxml.jackson.annotation.JsonCreator;
008import com.fasterxml.jackson.annotation.JsonProperty;
009import com.fasterxml.jackson.databind.annotation.*;
010
011import io.vrap.rmf.base.client.ModelBase;
012import io.vrap.rmf.base.client.utils.Generated;
013
014import org.apache.commons.lang3.builder.EqualsBuilder;
015import org.apache.commons.lang3.builder.HashCodeBuilder;
016
017/**
018 *  <p>This destination can be used to push events and messages to Confluent Cloud. To set up a Subscription of this type, first, create a topic in Confluent Cloud. Then, to allow Composable Commerce to push events and messages to your topic, generate API keys for your topic, and create the Subscription destination using the generated credentials.</p>
019 *  <p>The Composable Commerce producer uses the following values: <code>SASL_SSL</code> for<code>security.protocol</code>, <code>PLAIN</code> for<code>sasl.mechanism</code>, and the default value (1048576) for <code>max.request.size</code>.</p>
020 */
021@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
022public class ConfluentCloudDestinationImpl implements ConfluentCloudDestination, ModelBase {
023
024    private String type;
025
026    private String bootstrapServer;
027
028    private String apiKey;
029
030    private String apiSecret;
031
032    private String acks;
033
034    private String topic;
035
036    private String key;
037
038    /**
039     * create instance with all properties
040     */
041    @JsonCreator
042    ConfluentCloudDestinationImpl(@JsonProperty("bootstrapServer") final String bootstrapServer,
043            @JsonProperty("apiKey") final String apiKey, @JsonProperty("apiSecret") final String apiSecret,
044            @JsonProperty("acks") final String acks, @JsonProperty("topic") final String topic,
045            @JsonProperty("key") final String key) {
046        this.bootstrapServer = bootstrapServer;
047        this.apiKey = apiKey;
048        this.apiSecret = apiSecret;
049        this.acks = acks;
050        this.topic = topic;
051        this.key = key;
052        this.type = CONFLUENT_CLOUD;
053    }
054
055    /**
056     * create empty instance
057     */
058    public ConfluentCloudDestinationImpl() {
059        this.type = CONFLUENT_CLOUD;
060    }
061
062    /**
063     *
064     */
065
066    public String getType() {
067        return this.type;
068    }
069
070    /**
071     *  <p>URL to the bootstrap server including the port number in the format <code>&lt;xxxxx&gt;.&lt;region&gt;.&lt;provider&gt;.confluent.cloud:9092</code>.</p>
072     */
073
074    public String getBootstrapServer() {
075        return this.bootstrapServer;
076    }
077
078    /**
079     *  <p>Partially hidden on retrieval for security reasons.</p>
080     */
081
082    public String getApiKey() {
083        return this.apiKey;
084    }
085
086    /**
087     *  <p>Partially hidden on retrieval for security reasons.</p>
088     */
089
090    public String getApiSecret() {
091        return this.apiSecret;
092    }
093
094    /**
095     *  <p>The Kafka <code>acks</code> value.</p>
096     */
097
098    public String getAcks() {
099        return this.acks;
100    }
101
102    /**
103     *  <p>The name of the topic.</p>
104     */
105
106    public String getTopic() {
107        return this.topic;
108    }
109
110    /**
111     *  <p>The Kafka record key.</p>
112     */
113
114    public String getKey() {
115        return this.key;
116    }
117
118    public void setBootstrapServer(final String bootstrapServer) {
119        this.bootstrapServer = bootstrapServer;
120    }
121
122    public void setApiKey(final String apiKey) {
123        this.apiKey = apiKey;
124    }
125
126    public void setApiSecret(final String apiSecret) {
127        this.apiSecret = apiSecret;
128    }
129
130    public void setAcks(final String acks) {
131        this.acks = acks;
132    }
133
134    public void setTopic(final String topic) {
135        this.topic = topic;
136    }
137
138    public void setKey(final String key) {
139        this.key = key;
140    }
141
142    @Override
143    public boolean equals(Object o) {
144        if (this == o)
145            return true;
146
147        if (o == null || getClass() != o.getClass())
148            return false;
149
150        ConfluentCloudDestinationImpl that = (ConfluentCloudDestinationImpl) o;
151
152        return new EqualsBuilder().append(type, that.type)
153                .append(bootstrapServer, that.bootstrapServer)
154                .append(apiKey, that.apiKey)
155                .append(apiSecret, that.apiSecret)
156                .append(acks, that.acks)
157                .append(topic, that.topic)
158                .append(key, that.key)
159                .isEquals();
160    }
161
162    @Override
163    public int hashCode() {
164        return new HashCodeBuilder(17, 37).append(type)
165                .append(bootstrapServer)
166                .append(apiKey)
167                .append(apiSecret)
168                .append(acks)
169                .append(topic)
170                .append(key)
171                .toHashCode();
172    }
173
174}