
com.adyen.model.management.CreateMerchantApiCredentialRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of adyen-java-api-library Show documentation
Show all versions of adyen-java-api-library Show documentation
Adyen API Client Library for Java
/*
* Management API
*
* The version of the OpenAPI document: 3
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.adyen.model.management;
import java.util.Objects;
import java.util.Map;
import java.util.HashMap;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.core.JsonProcessingException;
/**
* CreateMerchantApiCredentialRequest
*/
@JsonPropertyOrder({
CreateMerchantApiCredentialRequest.JSON_PROPERTY_ALLOWED_ORIGINS,
CreateMerchantApiCredentialRequest.JSON_PROPERTY_DESCRIPTION,
CreateMerchantApiCredentialRequest.JSON_PROPERTY_ROLES
})
public class CreateMerchantApiCredentialRequest {
public static final String JSON_PROPERTY_ALLOWED_ORIGINS = "allowedOrigins";
private List allowedOrigins;
public static final String JSON_PROPERTY_DESCRIPTION = "description";
private String description;
public static final String JSON_PROPERTY_ROLES = "roles";
private List roles;
public CreateMerchantApiCredentialRequest() {
}
/**
* The list of [allowed origins](https://docs.adyen.com/development-resources/client-side-authentication#allowed-origins) for the new API credential.
*
* @param allowedOrigins The list of [allowed origins](https://docs.adyen.com/development-resources/client-side-authentication#allowed-origins) for the new API credential.
* @return the current {@code CreateMerchantApiCredentialRequest} instance, allowing for method chaining
*/
public CreateMerchantApiCredentialRequest allowedOrigins(List allowedOrigins) {
this.allowedOrigins = allowedOrigins;
return this;
}
public CreateMerchantApiCredentialRequest addAllowedOriginsItem(String allowedOriginsItem) {
if (this.allowedOrigins == null) {
this.allowedOrigins = new ArrayList<>();
}
this.allowedOrigins.add(allowedOriginsItem);
return this;
}
/**
* The list of [allowed origins](https://docs.adyen.com/development-resources/client-side-authentication#allowed-origins) for the new API credential.
* @return allowedOrigins The list of [allowed origins](https://docs.adyen.com/development-resources/client-side-authentication#allowed-origins) for the new API credential.
*/
@JsonProperty(JSON_PROPERTY_ALLOWED_ORIGINS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public List getAllowedOrigins() {
return allowedOrigins;
}
/**
* The list of [allowed origins](https://docs.adyen.com/development-resources/client-side-authentication#allowed-origins) for the new API credential.
*
* @param allowedOrigins The list of [allowed origins](https://docs.adyen.com/development-resources/client-side-authentication#allowed-origins) for the new API credential.
*/
@JsonProperty(JSON_PROPERTY_ALLOWED_ORIGINS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setAllowedOrigins(List allowedOrigins) {
this.allowedOrigins = allowedOrigins;
}
/**
* Description of the API credential.
*
* @param description Description of the API credential.
* @return the current {@code CreateMerchantApiCredentialRequest} instance, allowing for method chaining
*/
public CreateMerchantApiCredentialRequest description(String description) {
this.description = description;
return this;
}
/**
* Description of the API credential.
* @return description Description of the API credential.
*/
@JsonProperty(JSON_PROPERTY_DESCRIPTION)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getDescription() {
return description;
}
/**
* Description of the API credential.
*
* @param description Description of the API credential.
*/
@JsonProperty(JSON_PROPERTY_DESCRIPTION)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setDescription(String description) {
this.description = description;
}
/**
* List of [roles](https://docs.adyen.com/development-resources/api-credentials#roles-1) for the API credential. Only roles assigned to 'ws@Company.<CompanyName>' can be assigned to other API credentials.
*
* @param roles List of [roles](https://docs.adyen.com/development-resources/api-credentials#roles-1) for the API credential. Only roles assigned to 'ws@Company.<CompanyName>' can be assigned to other API credentials.
* @return the current {@code CreateMerchantApiCredentialRequest} instance, allowing for method chaining
*/
public CreateMerchantApiCredentialRequest roles(List roles) {
this.roles = roles;
return this;
}
public CreateMerchantApiCredentialRequest addRolesItem(String rolesItem) {
if (this.roles == null) {
this.roles = new ArrayList<>();
}
this.roles.add(rolesItem);
return this;
}
/**
* List of [roles](https://docs.adyen.com/development-resources/api-credentials#roles-1) for the API credential. Only roles assigned to 'ws@Company.<CompanyName>' can be assigned to other API credentials.
* @return roles List of [roles](https://docs.adyen.com/development-resources/api-credentials#roles-1) for the API credential. Only roles assigned to 'ws@Company.<CompanyName>' can be assigned to other API credentials.
*/
@JsonProperty(JSON_PROPERTY_ROLES)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public List getRoles() {
return roles;
}
/**
* List of [roles](https://docs.adyen.com/development-resources/api-credentials#roles-1) for the API credential. Only roles assigned to 'ws@Company.<CompanyName>' can be assigned to other API credentials.
*
* @param roles List of [roles](https://docs.adyen.com/development-resources/api-credentials#roles-1) for the API credential. Only roles assigned to 'ws@Company.<CompanyName>' can be assigned to other API credentials.
*/
@JsonProperty(JSON_PROPERTY_ROLES)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setRoles(List roles) {
this.roles = roles;
}
/**
* Return true if this CreateMerchantApiCredentialRequest object is equal to o.
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CreateMerchantApiCredentialRequest createMerchantApiCredentialRequest = (CreateMerchantApiCredentialRequest) o;
return Objects.equals(this.allowedOrigins, createMerchantApiCredentialRequest.allowedOrigins) &&
Objects.equals(this.description, createMerchantApiCredentialRequest.description) &&
Objects.equals(this.roles, createMerchantApiCredentialRequest.roles);
}
@Override
public int hashCode() {
return Objects.hash(allowedOrigins, description, roles);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CreateMerchantApiCredentialRequest {\n");
sb.append(" allowedOrigins: ").append(toIndentedString(allowedOrigins)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" roles: ").append(toIndentedString(roles)).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 ");
}
/**
* Create an instance of CreateMerchantApiCredentialRequest given an JSON string
*
* @param jsonString JSON string
* @return An instance of CreateMerchantApiCredentialRequest
* @throws JsonProcessingException if the JSON string is invalid with respect to CreateMerchantApiCredentialRequest
*/
public static CreateMerchantApiCredentialRequest fromJson(String jsonString) throws JsonProcessingException {
return JSON.getMapper().readValue(jsonString, CreateMerchantApiCredentialRequest.class);
}
/**
* Convert an instance of CreateMerchantApiCredentialRequest to an JSON string
*
* @return JSON string
*/
public String toJson() throws JsonProcessingException {
return JSON.getMapper().writeValueAsString(this);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy