SmsSendResponseItem.java

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.communication.sms.implementation.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;

/** The SmsSendResponseItem model. */
@Fluent
public final class SmsSendResponseItem {
    /*
     * The recipient's phone number in E.164 format.
     */
    @JsonProperty(value = "to", required = true)
    private String to;

    /*
     * The identifier of the outgoing Sms message. Only present if message
     * processed.
     */
    @JsonProperty(value = "messageId")
    private String messageId;

    /*
     * HTTP Status code.
     */
    @JsonProperty(value = "httpStatusCode", required = true)
    private int httpStatusCode;

    /*
     * The result of a repeatable request with one of the case-insensitive
     * values accepted or rejected.
     */
    @JsonProperty(value = "repeatabilityResult")
    private SmsSendResponseItemRepeatabilityResult repeatabilityResult;

    /*
     * Indicates if the message is processed successfully or not.
     */
    @JsonProperty(value = "successful", required = true)
    private boolean successful;

    /*
     * Optional error message in case of 4xx/5xx/repeatable errors.
     */
    @JsonProperty(value = "errorMessage")
    private String errorMessage;

    /**
     * Get the to property: The recipient's phone number in E.164 format.
     *
     * @return the to value.
     */
    public String getTo() {
        return this.to;
    }

    /**
     * Set the to property: The recipient's phone number in E.164 format.
     *
     * @param to the to value to set.
     * @return the SmsSendResponseItem object itself.
     */
    public SmsSendResponseItem setTo(String to) {
        this.to = to;
        return this;
    }

    /**
     * Get the messageId property: The identifier of the outgoing Sms message. Only present if message processed.
     *
     * @return the messageId value.
     */
    public String getMessageId() {
        return this.messageId;
    }

    /**
     * Set the messageId property: The identifier of the outgoing Sms message. Only present if message processed.
     *
     * @param messageId the messageId value to set.
     * @return the SmsSendResponseItem object itself.
     */
    public SmsSendResponseItem setMessageId(String messageId) {
        this.messageId = messageId;
        return this;
    }

    /**
     * Get the httpStatusCode property: HTTP Status code.
     *
     * @return the httpStatusCode value.
     */
    public int getHttpStatusCode() {
        return this.httpStatusCode;
    }

    /**
     * Set the httpStatusCode property: HTTP Status code.
     *
     * @param httpStatusCode the httpStatusCode value to set.
     * @return the SmsSendResponseItem object itself.
     */
    public SmsSendResponseItem setHttpStatusCode(int httpStatusCode) {
        this.httpStatusCode = httpStatusCode;
        return this;
    }

    /**
     * Get the repeatabilityResult property: The result of a repeatable request with one of the case-insensitive values
     * accepted or rejected.
     *
     * @return the repeatabilityResult value.
     */
    public SmsSendResponseItemRepeatabilityResult getRepeatabilityResult() {
        return this.repeatabilityResult;
    }

    /**
     * Set the repeatabilityResult property: The result of a repeatable request with one of the case-insensitive values
     * accepted or rejected.
     *
     * @param repeatabilityResult the repeatabilityResult value to set.
     * @return the SmsSendResponseItem object itself.
     */
    public SmsSendResponseItem setRepeatabilityResult(SmsSendResponseItemRepeatabilityResult repeatabilityResult) {
        this.repeatabilityResult = repeatabilityResult;
        return this;
    }

    /**
     * Get the successful property: Indicates if the message is processed successfully or not.
     *
     * @return the successful value.
     */
    public boolean isSuccessful() {
        return this.successful;
    }

    /**
     * Set the successful property: Indicates if the message is processed successfully or not.
     *
     * @param successful the successful value to set.
     * @return the SmsSendResponseItem object itself.
     */
    public SmsSendResponseItem setSuccessful(boolean successful) {
        this.successful = successful;
        return this;
    }

    /**
     * Get the errorMessage property: Optional error message in case of 4xx/5xx/repeatable errors.
     *
     * @return the errorMessage value.
     */
    public String getErrorMessage() {
        return this.errorMessage;
    }

    /**
     * Set the errorMessage property: Optional error message in case of 4xx/5xx/repeatable errors.
     *
     * @param errorMessage the errorMessage value to set.
     * @return the SmsSendResponseItem object itself.
     */
    public SmsSendResponseItem setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
        return this;
    }
}