com.starkinfra.PixDirector Maven / Gradle / Ivy
Show all versions of sdk Show documentation
package com.starkinfra;
import com.starkinfra.utils.Rest;
import com.starkinfra.utils.SubResource;
import java.util.Map;
import java.util.HashMap;
public final class PixDirector extends SubResource {
/**
* PixDirector object
*
* Mandatory data that must be registered within the Central Bank for emergency contact purposes.
*
* When you initialize a PixDirector, the entity will not be automatically
* created in the Stark Infra API. The 'create' function sends the objects
* to the Stark Infra API and returns the list of created objects.
*
* Parameters:
* name [string]: name of the PixDirector. ex: "Edward Stark".
* taxId [string]: tax ID (CPF/CNPJ) of the PixDirector. ex: "03.300.300/0001-00"
* phone [string]: phone of the PixDirector. ex: "+551198989898"
* email [string]: email of the PixDirector. ex: "[email protected]"
* password [string]: password of the PixDirector. ex: "12345678"
* teamEmail [string]: team email. ex: "[email protected]"
* teamPhones [list of strings]: list of phones of the team. ex: ["+5511988889999", "+5511988889998"]
* status [string]: current PixDirector status. ex: "success"
*
*/
static ClassData data = new ClassData(PixDirector.class, "PixDirector");
public String name;
public String taxId;
public String phone;
public String email;
public String password;
public String teamEmail;
public String[] teamPhones;
public String status;
/**
* PixDirector object
*
* Mandatory data that must be registered within the Central Bank for emergency contact purposes.
*
* When you initialize a PixDirector, the entity will not be automatically
* created in the Stark Infra API. The 'create' function sends the objects
* to the Stark Infra API and returns the list of created objects.
*
* Parameters:
* @param name [string]: name of the PixDirector. ex: "Edward Stark".
* @param taxId [string]: tax ID (CPF/CNPJ) of the PixDirector. ex: "03.300.300/0001-00"
* @param phone [string]: phone of the PixDirector. ex: "+551198989898"
* @param email [string]: email of the PixDirector. ex: "[email protected]"
* @param password [string]: password of the PixDirector. ex: "12345678"
* @param teamEmail [string]: team email. ex: "[email protected]"
* @param teamPhones [list of strings]: list of phones of the team. ex: ["+5511988889999", "+5511988889998"]
* @param status [string]: current PixDirector status. ex: "success"
*/
public PixDirector(String name, String taxId, String phone, String email, String password, String teamEmail,
String[] teamPhones, String status
) {
this.name = name;
this.taxId = taxId;
this.phone = phone;
this.email = email;
this.password = password;
this.teamEmail = teamEmail;
this.teamPhones = teamPhones;
this.status = status;
}
/**
* PixDirector object
*
* Mandatory data that must be registered within the Central Bank for emergency contact purposes.
*
* When you initialize a PixDirector, the entity will not be automatically
* created in the Stark Infra API. The 'create' function sends the objects
* to the Stark Infra API and returns the list of created objects.
*
* Parameters:
* @param data map of properties for the creation of the PixDirector
* name [string]: name of the PixDirector. ex: "Edward Stark".
* taxId [string]: tax ID (CPF/CNPJ) of the PixDirector. ex: "03.300.300/0001-00"
* phone [string]: phone of the PixDirector. ex: "+551198989898"
* email [string]: email of the PixDirector. ex: "[email protected]"
* password [string]: password of the PixDirector. ex: "12345678"
* teamEmail [string]: team email. ex: "[email protected]"
* teamPhones [list of strings]: list of phones of the team. ex: ["+5511988889999", "+5511988889998"]
*
* Attributes (return-only):
* status [string]: current PixDirector status. ex: "success"
* @throws Exception error in the request
*/
public PixDirector(Map data) throws Exception {
HashMap dataCopy = new HashMap<>(data);
this.name = (String) dataCopy.remove("name");
this.taxId = (String) dataCopy.remove("taxId");
this.phone = (String) dataCopy.remove("phone");
this.email = (String) dataCopy.remove("email");
this.password = (String) dataCopy.remove("password");
this.teamEmail = (String) dataCopy.remove("teamEmail");
this.teamPhones = (String[]) dataCopy.remove("teamPhones");
this.status = null;
if (!dataCopy.isEmpty()) {
throw new Exception("Unknown parameters used in constructor: [" + String.join(", ", dataCopy.keySet()) + "]");
}
}
/**
* Create a PixDirector
*
* Send a PixDirector object for creation in the Stark Infra API
*
* Parameters:
* @param director [PixDirector object or HashMap]: PixDirector object to be created in the API
*
* Return:
* @return PixDirector object with updated attributes
* @throws Exception error in the request
*/
public static PixDirector create(PixDirector director) throws Exception {
return PixDirector.create(director, null);
}
/**
* Create a PixDirector
*
* Send a PixDirector object for creation in the Stark Infra API
*
* Parameters:
* @param director [PixDirector object or HashMaps]: PixDirector object to be created in the API
* @param user [Organization/Project object, default null]: Organization or Project object. Not necessary if starkinfra.Settings.user was set before function call
*
* Return:
* @return PixDirector object with updated attributes
* @throws Exception error in the request
*/
public static PixDirector create(PixDirector director, User user) throws Exception {
return Rest.postSingle(data, director, user);
}
}