jp.co.freee.accounting.models.MeResponseUserCompanies Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of freee-accounting-sdk Show documentation
Show all versions of freee-accounting-sdk Show documentation
freee accounting client SDK for Java
/*
* freee API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: v1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package jp.co.freee.accounting.models;
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 org.openapitools.jackson.nullable.JsonNullable;
/**
* MeResponseUserCompanies
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class MeResponseUserCompanies {
public static final String SERIALIZED_NAME_ADVISOR_ID = "advisor_id";
@SerializedName(SERIALIZED_NAME_ADVISOR_ID)
private Integer advisorId;
public static final String SERIALIZED_NAME_DISPLAY_NAME = "display_name";
@SerializedName(SERIALIZED_NAME_DISPLAY_NAME)
private String displayName;
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private Integer id;
/**
* ユーザーの権限 <ul> <li>admin: 管理者</li> <li>simple_accounting: 一般</li> <li>self_only: 取引登録のみ</li> <li>read_only: 閲覧のみ</li> <li>workflow: 申請・承認</li> </ul>
*/
@JsonAdapter(RoleEnum.Adapter.class)
public enum RoleEnum {
ADMIN("admin"),
SIMPLE_ACCOUNTING("simple_accounting"),
SELF_ONLY("self_only"),
READ_ONLY("read_only"),
WORKFLOW("workflow");
private String value;
RoleEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static RoleEnum fromValue(String value) {
for (RoleEnum b : RoleEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter {
@Override
public void write(final JsonWriter jsonWriter, final RoleEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public RoleEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return RoleEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_ROLE = "role";
@SerializedName(SERIALIZED_NAME_ROLE)
private RoleEnum role;
public static final String SERIALIZED_NAME_USE_CUSTOM_ROLE = "use_custom_role";
@SerializedName(SERIALIZED_NAME_USE_CUSTOM_ROLE)
private Boolean useCustomRole;
public MeResponseUserCompanies() {
}
public MeResponseUserCompanies advisorId(Integer advisorId) {
this.advisorId = advisorId;
return this;
}
/**
* アドバイザープロファイルID(アドバイザー事業所で無い場合にnullになります)
* minimum: 1
* maximum: 2147483647
* @return advisorId
**/
@javax.annotation.Nullable
@ApiModelProperty(example = "1234", value = "アドバイザープロファイルID(アドバイザー事業所で無い場合にnullになります)")
public Integer getAdvisorId() {
return advisorId;
}
public void setAdvisorId(Integer advisorId) {
this.advisorId = advisorId;
}
public MeResponseUserCompanies displayName(String displayName) {
this.displayName = displayName;
return this;
}
/**
* 表示名
* @return displayName
**/
@javax.annotation.Nonnull
@ApiModelProperty(example = "freee株式会社", required = true, value = "表示名")
public String getDisplayName() {
return displayName;
}
public void setDisplayName(String displayName) {
this.displayName = displayName;
}
public MeResponseUserCompanies id(Integer id) {
this.id = id;
return this;
}
/**
* 事業所ID
* minimum: 1
* maximum: 2147483647
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(example = "1", required = true, value = "事業所ID")
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public MeResponseUserCompanies role(RoleEnum role) {
this.role = role;
return this;
}
/**
* ユーザーの権限 <ul> <li>admin: 管理者</li> <li>simple_accounting: 一般</li> <li>self_only: 取引登録のみ</li> <li>read_only: 閲覧のみ</li> <li>workflow: 申請・承認</li> </ul>
* @return role
**/
@javax.annotation.Nonnull
@ApiModelProperty(example = "admin", required = true, value = "ユーザーの権限 - admin: 管理者
- simple_accounting: 一般
- self_only: 取引登録のみ
- read_only: 閲覧のみ
- workflow: 申請・承認
")
public RoleEnum getRole() {
return role;
}
public void setRole(RoleEnum role) {
this.role = role;
}
public MeResponseUserCompanies useCustomRole(Boolean useCustomRole) {
this.useCustomRole = useCustomRole;
return this;
}
/**
* カスタム権限(true: 使用する、false: 使用しない)
* @return useCustomRole
**/
@javax.annotation.Nonnull
@ApiModelProperty(example = "false", required = true, value = "カスタム権限(true: 使用する、false: 使用しない)")
public Boolean getUseCustomRole() {
return useCustomRole;
}
public void setUseCustomRole(Boolean useCustomRole) {
this.useCustomRole = useCustomRole;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
MeResponseUserCompanies meResponseUserCompanies = (MeResponseUserCompanies) o;
return Objects.equals(this.advisorId, meResponseUserCompanies.advisorId) &&
Objects.equals(this.displayName, meResponseUserCompanies.displayName) &&
Objects.equals(this.id, meResponseUserCompanies.id) &&
Objects.equals(this.role, meResponseUserCompanies.role) &&
Objects.equals(this.useCustomRole, meResponseUserCompanies.useCustomRole);
}
private static boolean equalsNullable(JsonNullable a, JsonNullable b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(advisorId, displayName, id, role, useCustomRole);
}
private static int hashCodeNullable(JsonNullable a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class MeResponseUserCompanies {\n");
sb.append(" advisorId: ").append(toIndentedString(advisorId)).append("\n");
sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" role: ").append(toIndentedString(role)).append("\n");
sb.append(" useCustomRole: ").append(toIndentedString(useCustomRole)).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 ");
}
}