All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.messagebird.objects.conversations.ConversationContentHsm Maven / Gradle / Ivy

Go to download

The MessageBird API provides a API to the MessageBird SMS and voicemail services located at https://www.messagebird.com.

The newest version!
package com.messagebird.objects.conversations;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * Highly structured message, only for WhatsApp channels. This is a
 * pre-approved, reusable message template required when messaging over
 * WhatsApp. It allows you to just send the required parameter values instead
 * of the full message. It also allows for localization of the message and
 * decreases the possibility of being blocked on the first contact as the
 * message is pre-approved by WhatsApp.
 */
public class ConversationContentHsm {

    private String namespace;
    private String templateName;
    private ConversationHsmLanguage language;
    private List params;
    private List components;

    public ConversationContentHsm(
            final String namespace,
            final String templateName,
            final ConversationHsmLanguage language,
            final List params,
            final List components
    ) {
        this.namespace = namespace;
        this.templateName = templateName;
        this.language = language;
        this.params = params;
        this.components = components;
    }

    public ConversationContentHsm(
            final String namespace,
            final String templateName,
            final ConversationHsmLanguage language
    ) {
        this.namespace = namespace;
        this.templateName = templateName;
        this.language = language;
    }

    public ConversationContentHsm() {
        //
    }

    public String getNamespace() {
        return namespace;
    }

    public void setNamespace(final String namespace) {
        this.namespace = namespace;
    }

    public String getTemplateName() {
        return templateName;
    }

    public void setTemplateName(final String templateName) {
        this.templateName = templateName;
    }

    public ConversationHsmLanguage getLanguage() {
        return language;
    }

    public void setLanguage(final ConversationHsmLanguage language) {
        this.language = language;
    }

    public List getParams() {
        return params;
    }

    public void addParams(final ConversationHsmLocalizableParameter... params) {
        if (this.params == null) {
            this.params = new ArrayList<>(params.length);
        }

        Collections.addAll(this.params, params);
    }

    public void setParams(final List params) {
        this.params = params;
    }

    public List getComponents() {
        return components;
    }

    public void setComponents(List components) {
        this.components = components;
    }

    @Override
    public String toString() {
        return "ConversationContentHsm{" +
                "namespace='" + namespace + '\'' +
                ", templateName='" + templateName + '\'' +
                ", language=" + language +
                ", params=" + params +
                ", components=" + components +
                '}';
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy