/*
 * Copyright 2016 Lime - HighTech Solutions s.r.o.
 *
 * Licensed 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 io.getlime.security.powerauth.rest.api.model.base;

/**
 * Generic response object for all PowerAuth RESTful API responses.
 *
 * @author Petr Dvorak
 *
 * @param <T> Type of the response object
 */
public class PowerAuthApiResponse<T> {

    /**
     * Response status string
     */
    public class Status {

        /**
         * In case response was OK
         */
        public static final String OK = "OK";

        /**
         * In case an error response is sent
         */
        public static final String ERROR = "ERROR";

    }

    private String status;
    private T responseObject;

    /**
     * Default constructor
     */
    public PowerAuthApiResponse() {
    }

    /**
     * Constructor with response status and response object
     * @param status Response status, use static constant from {@link Status} class.
     * @param responseObject Response object.
     */
    public PowerAuthApiResponse(String status, T responseObject) {
        this.status = status;
        this.responseObject = responseObject;
    }

    /**
     * Get response status.
     * @return Response status.
     */
    public String getStatus() {
        return status;
    }

    /**
     * Get response object
     * @return Response object
     */
    public T getResponseObject() {
        return responseObject;
    }

    /**
     * Set response status
     * @param status Response status
     */
    public void setStatus(String status) {
        this.status = status;
    }

    /**
     * Set response object
     * @param responseObject Response object
     */
    public void setResponseObject(T responseObject) {
        this.responseObject = responseObject;
    }

}

@@ -1168,29 +1168,478 @@
     
-private String status
+/**%0A     * Response encryption type%0A     */%0A    public class Encryption %7B%0A%0A        /**%0A         * None%0A         */%0A        public static final String NONE = %22none%22;%0A%0A        /**%0A         * Personalized%0A         */%0A        public static final String PERSONALIZED = %22personalized%22;%0A%0A        /**%0A         * Non-personalized%0A         */%0A        public static final String NON_PERSONALIZED = %22nonpersonalized%22;%0A%0A    %7D%0A%0A    private String status;%0A    private String encryption
 ;%0A  
@@ -2053,24 +2053,67 @@
 s = status;%0A
+        this.encryption = Encryption.NONE;%0A
         this
@@ -2172,122 +2172,517 @@
   * 
-Get response status.%0A     * @return Response status.%0A     */%0A    public String getStatus() %7B%0A        return status
+Constructor with response status, encryption type and response object%0A     * @param status Response status, use static constant from %7B@link Status%7D class.%0A     * @param encryption Response encryption type, use static constant from %7B@link Encryption%7D class.%0A     * @param responseObject Response object.%0A     */%0A    public PowerAuthApiResponse(String status, String encryption, T responseObject) %7B%0A        this.status = status;%0A        this.encryption = encryption;%0A        this.responseObject = responseObject
 ;%0A  
@@ -2706,38 +2706,39 @@
  * Get response 
-object
+status.
 %0A     * @return 
@@ -2738,38 +2738,39 @@
 return Response 
-object
+status.
 %0A     */%0A    pub
@@ -2777,27 +2777,24 @@
 lic 
-T getResponseObject
+String getStatus
 () %7B
@@ -2809,30 +2809,22 @@
  return 
-responseObject
+status
 ;%0A    %7D%0A
@@ -2976,32 +2976,507 @@
  status;%0A    %7D%0A%0A
+    /**%0A     * Get encryption type.%0A     * @return Encryption type.%0A     */%0A    public String getEncryption() %7B%0A        return encryption;%0A    %7D%0A%0A    /**%0A     * Set encryption type.%0A     * @param encryption Encryption type.%0A     */%0A    public void setEncryption(String encryption) %7B%0A        this.encryption = encryption;%0A    %7D%0A%0A    /**%0A     * Get response object%0A     * @return Response object%0A     */%0A    public T getResponseObject() %7B%0A        return responseObject;%0A    %7D%0A%0A
     /**%0A     * S

Add encryption attribute in PA2Response class (network transport object).