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

com.azure.communication.sms.models.SmsSendResult Maven / Gradle / Ivy

Go to download

This package contains clients and data structures used to send SMS messages with Azure Communication SMS Service. For this release, see notes - https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/communication/azure-communication-sms/README.md and https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/communication/azure-communication-sms/CHANGELOG.md. Microsoft Azure Communication SMS quickstart - https://docs.microsoft.com/azure/communication-services/quickstarts/telephony-sms/send?pivots=programming-language-java

There is a newer version: 1.1.27
Show newest version
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package com.azure.communication.sms.models;

import com.azure.core.annotation.Immutable;

/** The SmsSendResult model. */
@Immutable
public final class SmsSendResult {
    private final String to;
    private final String messageId;
    private final int httpStatusCode;
    private final boolean isSuccessful;
    private final String errorMessage;

    /**
     * Constructor to wrap the smsSendResponseItem
     * @param to The recipient's phone number in E.164 format.
     * @param messageId The identifier of the outgoing Sms message. Only present if message processed.
     * @param httpStatusCode The httpStatusCode property: HTTP Status code.
     * @param isSuccessful The successful property: Indicates if the message is processed successfully or not.
     * @param errorMessage Optional error message in case of 4xx/5xx/repeatable errors.
     */
    public SmsSendResult(String to, String messageId, int httpStatusCode, boolean isSuccessful, String errorMessage) {
        this.to = to;
        this.messageId = messageId;
        this.httpStatusCode = httpStatusCode;
        this.isSuccessful = isSuccessful;
        this.errorMessage = errorMessage;
    }

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

    /**
     * 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;
    }

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy