/*
 * WSO2 API Manager - Publisher API
 * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**.  # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ```   {   \"callbackUrl\":\"www.google.lk\",   \"clientName\":\"rest_api_publisher\",   \"owner\":\"admin\",   \"grantType\":\"client_credentials password refresh_token\",   \"saasApp\":true   } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ```   curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\"   \\ -d @payload.json https://<host>:<servlet_port>/client-registration/v0.17/register ``` **Sample request** ```   curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\"   \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=<admin_username>&password=<admin_passowrd&scope=<scopes seperated by space>\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://<host>:<servlet_port>/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change.  # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance.  [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) 
 *
 * The version of the OpenAPI document: v4
 * Contact: architecture@wso2.com
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package org.wso2.am.integration.clients.publisher.api.v1.dto;

import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.wso2.am.integration.clients.publisher.api.v1.dto.EnvironmentDTO;
import org.wso2.am.integration.clients.publisher.api.v1.dto.MonetizationAttributeDTO;
import com.fasterxml.jackson.annotation.JsonCreator;
/**
* SettingsDTO
*/

public class SettingsDTO {
        public static final String SERIALIZED_NAME_DEVPORTAL_URL = "devportalUrl";
        @SerializedName(SERIALIZED_NAME_DEVPORTAL_URL)
            private String devportalUrl;

        public static final String SERIALIZED_NAME_ENVIRONMENT = "environment";
        @SerializedName(SERIALIZED_NAME_ENVIRONMENT)
            private List<EnvironmentDTO> environment = null;

        public static final String SERIALIZED_NAME_GATEWAY_TYPES = "gatewayTypes";
        @SerializedName(SERIALIZED_NAME_GATEWAY_TYPES)
            private List<String> gatewayTypes = null;

        public static final String SERIALIZED_NAME_SCOPES = "scopes";
        @SerializedName(SERIALIZED_NAME_SCOPES)
            private List<String> scopes = null;

        public static final String SERIALIZED_NAME_MONETIZATION_ATTRIBUTES = "monetizationAttributes";
        @SerializedName(SERIALIZED_NAME_MONETIZATION_ATTRIBUTES)
            private List<MonetizationAttributeDTO> monetizationAttributes = null;

        public static final String SERIALIZED_NAME_SECURITY_AUDIT_PROPERTIES = "securityAuditProperties";
        @SerializedName(SERIALIZED_NAME_SECURITY_AUDIT_PROPERTIES)
            private Object securityAuditProperties;

        public static final String SERIALIZED_NAME_EXTERNAL_STORES_ENABLED = "externalStoresEnabled";
        @SerializedName(SERIALIZED_NAME_EXTERNAL_STORES_ENABLED)
            private Boolean externalStoresEnabled;

        public static final String SERIALIZED_NAME_DOC_VISIBILITY_ENABLED = "docVisibilityEnabled";
        @SerializedName(SERIALIZED_NAME_DOC_VISIBILITY_ENABLED)
            private Boolean docVisibilityEnabled;

        public static final String SERIALIZED_NAME_CROSS_TENANT_SUBSCRIPTION_ENABLED = "crossTenantSubscriptionEnabled";
        @SerializedName(SERIALIZED_NAME_CROSS_TENANT_SUBSCRIPTION_ENABLED)
            private Boolean crossTenantSubscriptionEnabled = false;

        public static final String SERIALIZED_NAME_DEFAULT_ADVANCE_POLICY = "defaultAdvancePolicy";
        @SerializedName(SERIALIZED_NAME_DEFAULT_ADVANCE_POLICY)
            private String defaultAdvancePolicy;

        public static final String SERIALIZED_NAME_DEFAULT_SUBSCRIPTION_POLICY = "defaultSubscriptionPolicy";
        @SerializedName(SERIALIZED_NAME_DEFAULT_SUBSCRIPTION_POLICY)
            private String defaultSubscriptionPolicy;

        public static final String SERIALIZED_NAME_AUTHORIZATION_HEADER = "authorizationHeader";
        @SerializedName(SERIALIZED_NAME_AUTHORIZATION_HEADER)
            private String authorizationHeader;


        public SettingsDTO devportalUrl(String devportalUrl) {
        
        this.devportalUrl = devportalUrl;
        return this;
        }

    /**
        * The Developer Portal URL
    * @return devportalUrl
    **/
        @javax.annotation.Nullable
      @ApiModelProperty(example = "https://localhost:9443/devportal", value = "The Developer Portal URL")
    
    public String getDevportalUrl() {
        return devportalUrl;
    }


    public void setDevportalUrl(String devportalUrl) {
        this.devportalUrl = devportalUrl;
    }


        public SettingsDTO environment(List<EnvironmentDTO> environment) {
        
        this.environment = environment;
        return this;
        }

    /**
        * Get environment
    * @return environment
    **/
        @javax.annotation.Nullable
      @ApiModelProperty(value = "")
    
    public List<EnvironmentDTO> getEnvironment() {
        return environment;
    }


    public void setEnvironment(List<EnvironmentDTO> environment) {
        this.environment = environment;
    }


        public SettingsDTO gatewayTypes(List<String> gatewayTypes) {
        
        this.gatewayTypes = gatewayTypes;
        return this;
        }

    /**
        * Get gatewayTypes
    * @return gatewayTypes
    **/
        @javax.annotation.Nullable
      @ApiModelProperty(example = "[\"Regular\",\"APK\"]", value = "")
    
    public List<String> getGatewayTypes() {
        return gatewayTypes;
    }


    public void setGatewayTypes(List<String> gatewayTypes) {
        this.gatewayTypes = gatewayTypes;
    }


        public SettingsDTO scopes(List<String> scopes) {
        
        this.scopes = scopes;
        return this;
        }

    /**
        * Get scopes
    * @return scopes
    **/
        @javax.annotation.Nullable
      @ApiModelProperty(example = "[\"apim:api_create\",\"apim:api_manage\",\"apim:api_publish\"]", value = "")
    
    public List<String> getScopes() {
        return scopes;
    }


    public void setScopes(List<String> scopes) {
        this.scopes = scopes;
    }


        public SettingsDTO monetizationAttributes(List<MonetizationAttributeDTO> monetizationAttributes) {
        
        this.monetizationAttributes = monetizationAttributes;
        return this;
        }

    /**
        * Get monetizationAttributes
    * @return monetizationAttributes
    **/
        @javax.annotation.Nullable
      @ApiModelProperty(example = "[]", value = "")
    
    public List<MonetizationAttributeDTO> getMonetizationAttributes() {
        return monetizationAttributes;
    }


    public void setMonetizationAttributes(List<MonetizationAttributeDTO> monetizationAttributes) {
        this.monetizationAttributes = monetizationAttributes;
    }


        public SettingsDTO securityAuditProperties(Object securityAuditProperties) {
        
        this.securityAuditProperties = securityAuditProperties;
        return this;
        }

    /**
        * Get securityAuditProperties
    * @return securityAuditProperties
    **/
        @javax.annotation.Nullable
      @ApiModelProperty(value = "")
    
    public Object getSecurityAuditProperties() {
        return securityAuditProperties;
    }


    public void setSecurityAuditProperties(Object securityAuditProperties) {
        this.securityAuditProperties = securityAuditProperties;
    }


        public SettingsDTO externalStoresEnabled(Boolean externalStoresEnabled) {
        
        this.externalStoresEnabled = externalStoresEnabled;
        return this;
        }

    /**
        * Is External Stores configuration enabled 
    * @return externalStoresEnabled
    **/
        @javax.annotation.Nullable
      @ApiModelProperty(example = "true", value = "Is External Stores configuration enabled ")
    
    public Boolean isExternalStoresEnabled() {
        return externalStoresEnabled;
    }


    public void setExternalStoresEnabled(Boolean externalStoresEnabled) {
        this.externalStoresEnabled = externalStoresEnabled;
    }


        public SettingsDTO docVisibilityEnabled(Boolean docVisibilityEnabled) {
        
        this.docVisibilityEnabled = docVisibilityEnabled;
        return this;
        }

    /**
        * Is Document Visibility configuration enabled 
    * @return docVisibilityEnabled
    **/
        @javax.annotation.Nullable
      @ApiModelProperty(example = "false", value = "Is Document Visibility configuration enabled ")
    
    public Boolean isDocVisibilityEnabled() {
        return docVisibilityEnabled;
    }


    public void setDocVisibilityEnabled(Boolean docVisibilityEnabled) {
        this.docVisibilityEnabled = docVisibilityEnabled;
    }


        public SettingsDTO crossTenantSubscriptionEnabled(Boolean crossTenantSubscriptionEnabled) {
        
        this.crossTenantSubscriptionEnabled = crossTenantSubscriptionEnabled;
        return this;
        }

    /**
        * Is Cross Tenant Subscriptions Enabled 
    * @return crossTenantSubscriptionEnabled
    **/
        @javax.annotation.Nullable
      @ApiModelProperty(example = "false", value = "Is Cross Tenant Subscriptions Enabled ")
    
    public Boolean isCrossTenantSubscriptionEnabled() {
        return crossTenantSubscriptionEnabled;
    }


    public void setCrossTenantSubscriptionEnabled(Boolean crossTenantSubscriptionEnabled) {
        this.crossTenantSubscriptionEnabled = crossTenantSubscriptionEnabled;
    }


        public SettingsDTO defaultAdvancePolicy(String defaultAdvancePolicy) {
        
        this.defaultAdvancePolicy = defaultAdvancePolicy;
        return this;
        }

    /**
        * Default Advance Policy.
    * @return defaultAdvancePolicy
    **/
        @javax.annotation.Nullable
      @ApiModelProperty(value = "Default Advance Policy.")
    
    public String getDefaultAdvancePolicy() {
        return defaultAdvancePolicy;
    }


    public void setDefaultAdvancePolicy(String defaultAdvancePolicy) {
        this.defaultAdvancePolicy = defaultAdvancePolicy;
    }


        public SettingsDTO defaultSubscriptionPolicy(String defaultSubscriptionPolicy) {
        
        this.defaultSubscriptionPolicy = defaultSubscriptionPolicy;
        return this;
        }

    /**
        * Default Subscription Policy.
    * @return defaultSubscriptionPolicy
    **/
        @javax.annotation.Nullable
      @ApiModelProperty(value = "Default Subscription Policy.")
    
    public String getDefaultSubscriptionPolicy() {
        return defaultSubscriptionPolicy;
    }


    public void setDefaultSubscriptionPolicy(String defaultSubscriptionPolicy) {
        this.defaultSubscriptionPolicy = defaultSubscriptionPolicy;
    }


        public SettingsDTO authorizationHeader(String authorizationHeader) {
        
        this.authorizationHeader = authorizationHeader;
        return this;
        }

    /**
        * Authorization Header
    * @return authorizationHeader
    **/
        @javax.annotation.Nullable
      @ApiModelProperty(example = "authorization", value = "Authorization Header")
    
    public String getAuthorizationHeader() {
        return authorizationHeader;
    }


    public void setAuthorizationHeader(String authorizationHeader) {
        this.authorizationHeader = authorizationHeader;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) {
        return true;
        }
        if (o == null || getClass() != o.getClass()) {
        return false;
        }
            SettingsDTO settings = (SettingsDTO) o;
            return Objects.equals(this.devportalUrl, settings.devportalUrl) &&
            Objects.equals(this.environment, settings.environment) &&
            Objects.equals(this.gatewayTypes, settings.gatewayTypes) &&
            Objects.equals(this.scopes, settings.scopes) &&
            Objects.equals(this.monetizationAttributes, settings.monetizationAttributes) &&
            Objects.equals(this.securityAuditProperties, settings.securityAuditProperties) &&
            Objects.equals(this.externalStoresEnabled, settings.externalStoresEnabled) &&
            Objects.equals(this.docVisibilityEnabled, settings.docVisibilityEnabled) &&
            Objects.equals(this.crossTenantSubscriptionEnabled, settings.crossTenantSubscriptionEnabled) &&
            Objects.equals(this.defaultAdvancePolicy, settings.defaultAdvancePolicy) &&
            Objects.equals(this.defaultSubscriptionPolicy, settings.defaultSubscriptionPolicy) &&
            Objects.equals(this.authorizationHeader, settings.authorizationHeader);
    }

    @Override
    public int hashCode() {
        return Objects.hash(devportalUrl, environment, gatewayTypes, scopes, monetizationAttributes, securityAuditProperties, externalStoresEnabled, docVisibilityEnabled, crossTenantSubscriptionEnabled, defaultAdvancePolicy, defaultSubscriptionPolicy, authorizationHeader);
    }


@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class SettingsDTO {\n");
    sb.append("    devportalUrl: ").append(toIndentedString(devportalUrl)).append("\n");
    sb.append("    environment: ").append(toIndentedString(environment)).append("\n");
    sb.append("    gatewayTypes: ").append(toIndentedString(gatewayTypes)).append("\n");
    sb.append("    scopes: ").append(toIndentedString(scopes)).append("\n");
    sb.append("    monetizationAttributes: ").append(toIndentedString(monetizationAttributes)).append("\n");
    sb.append("    securityAuditProperties: ").append(toIndentedString(securityAuditProperties)).append("\n");
    sb.append("    externalStoresEnabled: ").append(toIndentedString(externalStoresEnabled)).append("\n");
    sb.append("    docVisibilityEnabled: ").append(toIndentedString(docVisibilityEnabled)).append("\n");
    sb.append("    crossTenantSubscriptionEnabled: ").append(toIndentedString(crossTenantSubscriptionEnabled)).append("\n");
    sb.append("    defaultAdvancePolicy: ").append(toIndentedString(defaultAdvancePolicy)).append("\n");
    sb.append("    defaultSubscriptionPolicy: ").append(toIndentedString(defaultSubscriptionPolicy)).append("\n");
    sb.append("    authorizationHeader: ").append(toIndentedString(authorizationHeader)).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(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n    ");
}

}

