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

org.telegram.telegrambots.meta.api.objects.ResponseParameters Maven / Gradle / Ivy

There is a newer version: 7.10.0
Show newest version
/*
 * This file is part of TelegramBots.
 *
 * TelegramBots is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * TelegramBots is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with TelegramBots.  If not, see .
 */

package org.telegram.telegrambots.meta.api.objects;

import com.fasterxml.jackson.annotation.JsonProperty;

import org.telegram.telegrambots.meta.api.interfaces.BotApiObject;

/**
 * @author Ruben Bermudez
 * @version 1.0
 * @brief Contains information about why a request was unsuccessfull.
 * @date 28 of September of 2016
 */
public class ResponseParameters implements BotApiObject {
    private static final String MIGRATETOCHATID_FIELD = "migrate_to_chat_id";
    private static final String RETRYAFTER_FIELD = "retry_after";

    /**
     * Optional. The group has been migrated to a supergroup with the specified identifier.
     * This number may be greater than 32 bits and some programming languages may have
     * difficulty/silent defects in interpreting it. But it is smaller than 52 bits,
     * so a signed 64 bit integer or double-precision float type are safe for storing this identifier.
     */
    @JsonProperty(MIGRATETOCHATID_FIELD)
    private Long migrateToChatId;
    /**
     * Optional. In case of exceeding flood control a number of seconds to
     * wait before the request can be repeated
     */
    @JsonProperty(RETRYAFTER_FIELD)
    private Integer retryAfter;

    public ResponseParameters() {
        super();
    }

    public Long getMigrateToChatId() {
        return migrateToChatId;
    }

    public Integer getRetryAfter() {
        return retryAfter;
    }

    @Override
    public String toString() {
        return "ResponseParameters{" +
                "migrateToChatId=" + migrateToChatId +
                ", retryAfter=" + retryAfter +
                '}';
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy