/*
 * Copyright (c) 2023-2026, WSO2 LLC. (http://www.wso2.com).
 *
 * WSO2 LLC. 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.identity.rest.api.user.push.v1.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.wso2.carbon.identity.rest.api.user.push.v1.model.ProviderDTO;
import javax.validation.constraints.*;

/**
 * The registration request body sent from the mobile device
 **/

import io.swagger.annotations.*;
import java.util.Objects;
import javax.validation.Valid;
import javax.xml.bind.annotation.*;
@ApiModel(description = "The registration request body sent from the mobile device")
public class RegistrationRequestDTO  {
  
    private String deviceId;
    private String model;
    private String name;
    private String deviceToken;
    private String publicKey;
    private String signature;
    private ProviderDTO provider;

    /**
    * Unique UUID for the device
    **/
    public RegistrationRequestDTO deviceId(String deviceId) {

        this.deviceId = deviceId;
        return this;
    }
    
    @ApiModelProperty(example = "b03f90c9-6723-48f6-863b-a35f1ac77f57", value = "Unique UUID for the device")
    @JsonProperty("deviceId")
    @Valid
    public String getDeviceId() {
        return deviceId;
    }
    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }

    /**
    * Model of the device
    **/
    public RegistrationRequestDTO model(String model) {

        this.model = model;
        return this;
    }
    
    @ApiModelProperty(example = "iPhone 16", value = "Model of the device")
    @JsonProperty("model")
    @Valid
    public String getModel() {
        return model;
    }
    public void setModel(String model) {
        this.model = model;
    }

    /**
    * Name of the device
    **/
    public RegistrationRequestDTO name(String name) {

        this.name = name;
        return this;
    }
    
    @ApiModelProperty(example = "My Device", value = "Name of the device")
    @JsonProperty("name")
    @Valid
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }

    /**
    * device token unique to the device
    **/
    public RegistrationRequestDTO deviceToken(String deviceToken) {

        this.deviceToken = deviceToken;
        return this;
    }
    
    @ApiModelProperty(example = "fuRr8s_eQrmB88nu5Tz8oa:APA91bFMqYbuzDYyOGK28VoiLHWYXZYzGNVg3tfxfNwKPH-jDIFpNDdUHkmq5wqBUySYZnuHfpycyQvUrPhwV3UZ1YzjUNLvb9gzFZudfJd1N3fWuU0w2nq_hVJc0UPRabvNPuJy8wMB", value = "device token unique to the device")
    @JsonProperty("deviceToken")
    @Valid
    public String getDeviceToken() {
        return deviceToken;
    }
    public void setDeviceToken(String deviceToken) {
        this.deviceToken = deviceToken;
    }

    /**
    * Public key of the keypair generated by the device for the account
    **/
    public RegistrationRequestDTO publicKey(String publicKey) {

        this.publicKey = publicKey;
        return this;
    }
    
    @ApiModelProperty(example = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDOhCpj5pAEqdCdyxuHii0oLFAgnTePMI1EeomZHCRaZZNGv8fdcHyme9rpknNx/caAz9Gck5HrB/vto86cHpBkAghsBBLLWPUlblWNZCBX4pqFhZu+uZKvOnSqp1SwP13yx72nLKbjHRRJGgwCrg/mbdSGN/QKxRU+UhdKVVpQIDAQAB", value = "Public key of the keypair generated by the device for the account")
    @JsonProperty("publicKey")
    @Valid
    public String getPublicKey() {
        return publicKey;
    }
    public void setPublicKey(String publicKey) {
        this.publicKey = publicKey;
    }

    /**
    * Signature string comprising of the pushId and the challenge
    **/
    public RegistrationRequestDTO signature(String signature) {

        this.signature = signature;
        return this;
    }
    
    @ApiModelProperty(example = "rT/VxgPYMioT6wHajYg0mJpBv46HvFBm/elZ/VL4ClUIFfX7i3Ou5ER5sEiFtehaurLXPNsA8hF4SQAueVBRymEAmchhwYlT160g3wv6kDQvWLkTqnLWGfn++wg5xRManOoN9zG9GhxCgRr9y+lk9rtvydfX0lTcdEZBkynSJnM=", value = "Signature string comprising of the pushId and the challenge")
    @JsonProperty("signature")
    @Valid
    public String getSignature() {
        return signature;
    }
    public void setSignature(String signature) {
        this.signature = signature;
    }

    /**
    **/
    public RegistrationRequestDTO provider(ProviderDTO provider) {

        this.provider = provider;
        return this;
    }
    
    @ApiModelProperty(value = "")
    @JsonProperty("provider")
    @Valid
    public ProviderDTO getProvider() {
        return provider;
    }
    public void setProvider(ProviderDTO provider) {
        this.provider = provider;
    }



    @Override
    public boolean equals(java.lang.Object o) {

        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        RegistrationRequestDTO registrationRequestDTO = (RegistrationRequestDTO) o;
        return Objects.equals(this.deviceId, registrationRequestDTO.deviceId) &&
            Objects.equals(this.model, registrationRequestDTO.model) &&
            Objects.equals(this.name, registrationRequestDTO.name) &&
            Objects.equals(this.deviceToken, registrationRequestDTO.deviceToken) &&
            Objects.equals(this.publicKey, registrationRequestDTO.publicKey) &&
            Objects.equals(this.signature, registrationRequestDTO.signature) &&
            Objects.equals(this.provider, registrationRequestDTO.provider);
    }

    @Override
    public int hashCode() {
        return Objects.hash(deviceId, model, name, deviceToken, publicKey, signature, provider);
    }

    @Override
    public String toString() {

        StringBuilder sb = new StringBuilder();
        sb.append("class RegistrationRequestDTO {\n");
        
        sb.append("    deviceId: ").append(toIndentedString(deviceId)).append("\n");
        sb.append("    model: ").append(toIndentedString(model)).append("\n");
        sb.append("    name: ").append(toIndentedString(name)).append("\n");
        sb.append("    deviceToken: ").append(toIndentedString(deviceToken)).append("\n");
        sb.append("    publicKey: ").append(toIndentedString(publicKey)).append("\n");
        sb.append("    signature: ").append(toIndentedString(signature)).append("\n");
        sb.append("    provider: ").append(toIndentedString(provider)).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");
    }
}

