/*
 * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
 *
 * WSO2 Inc. licenses this file to you under the Apache License,
 * Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package org.wso2.carbon.analytics.auth.rest.api.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;

import java.util.Objects;

/**
 * RedirectionDTO.
 */
public class RedirectionDTO {
    @JsonProperty("clientId")
    private String clientId = null;

    @JsonProperty("redirectUrl")
    private String redirectUrl = null;

    @JsonProperty("callbackUrl")
    private String callbackUrl = null;

    @JsonProperty("scope")
    private String scope = null;

    public RedirectionDTO clientId(String clientId) {
        this.clientId = clientId;
        return this;
    }

    /**
     * Get clientId.
     *
     * @return clientId
     **/
    @ApiModelProperty(value = "")
    public String getClientId() {
        return clientId;
    }

    public void setClientId(String clientId) {
        this.clientId = clientId;
    }

    public RedirectionDTO scope(String scope) {
        this.scope = scope;
        return this;
    }

    /**
     * Get scope.
     *
     * @return scope
     **/
    @ApiModelProperty(value = "")
    public String getScope() {
        return scope;
    }

    public void setScope(String scope) {
        this.scope = scope;
    }

    public RedirectionDTO redirectUrl(String redirectUrl) {
        this.redirectUrl = redirectUrl;
        return this;
    }

    /**
     * Get redirectUrl.
     *
     * @return redirectUrl
     **/
    @ApiModelProperty(value = "")
    public String getRedirectUrl() {
        return redirectUrl;
    }

    public void setRedirectUrl(String redirectUrl) {
        this.redirectUrl = redirectUrl;
    }

    public RedirectionDTO callbackUrl(String callbackUrl) {
        this.callbackUrl = callbackUrl;
        return this;
    }

    /**
     * Get callbackUrl.
     *
     * @return callbackUrl
     **/
    @ApiModelProperty(value = "")
    public String getCallbackUrl() {
        return callbackUrl;
    }

    public void setCallbackUrl(String callbackUrl) {
        this.callbackUrl = callbackUrl;
    }


    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        RedirectionDTO redirection = (RedirectionDTO) o;
        return Objects.equals(this.clientId, redirection.clientId) &&
                Objects.equals(this.redirectUrl, redirection.redirectUrl) &&
                Objects.equals(this.scope, redirection.scope) &&
                Objects.equals(this.callbackUrl, redirection.callbackUrl);
    }

    @Override
    public int hashCode() {
        return Objects.hash(clientId, redirectUrl, callbackUrl, scope);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class RedirectionDTO {\n");

        sb.append("    clientId: ").append(toIndentedString(clientId)).append("\n");
        sb.append("    redirectUrl: ").append(toIndentedString(redirectUrl)).append("\n");
        sb.append("    callbackUrl: ").append(toIndentedString(callbackUrl)).append("\n");
        sb.append("    scope: ").append(toIndentedString(scope)).append("\n");
        sb.append("}");
        return sb.toString();
    }

    /**
     * Convert the given object to string with each line indented by 4 spaces (except the first line).
     */
    private String toIndentedString(java.lang.Object o) {
        if (o == null) {
            return "null";
        }
        return o.toString().replace("\n", "\n    ");
    }
}

