All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.fireblocks.sdk.model.AuditLogData Maven / Gradle / Ivy

/*
 * Fireblocks API
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.6.2
 * Contact: [email protected]
 *
 * 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.fireblocks.sdk.model;


import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Objects;
import java.util.StringJoiner;

/** AuditLogData */
@JsonPropertyOrder({
    AuditLogData.JSON_PROPERTY_ID,
    AuditLogData.JSON_PROPERTY_TIMESTAMP,
    AuditLogData.JSON_PROPERTY_CREATED_AT,
    AuditLogData.JSON_PROPERTY_USER,
    AuditLogData.JSON_PROPERTY_SUBJECT,
    AuditLogData.JSON_PROPERTY_EVENT,
    AuditLogData.JSON_PROPERTY_TENANT_ID,
    AuditLogData.JSON_PROPERTY_USER_ID
})
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class AuditLogData {
    public static final String JSON_PROPERTY_ID = "id";
    private String id;

    public static final String JSON_PROPERTY_TIMESTAMP = "timestamp";
    private String timestamp;

    public static final String JSON_PROPERTY_CREATED_AT = "createdAt";
    private String createdAt;

    public static final String JSON_PROPERTY_USER = "user";
    private String user;

    public static final String JSON_PROPERTY_SUBJECT = "subject";
    private String subject;

    public static final String JSON_PROPERTY_EVENT = "event";
    private String event;

    public static final String JSON_PROPERTY_TENANT_ID = "tenantId";
    private String tenantId;

    public static final String JSON_PROPERTY_USER_ID = "userId";
    private String userId;

    public AuditLogData() {}

    public AuditLogData id(String id) {
        this.id = id;
        return this;
    }

    /**
     * The unique identifier of the audit log
     *
     * @return id
     */
    @jakarta.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_ID)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getId() {
        return id;
    }

    @JsonProperty(JSON_PROPERTY_ID)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setId(String id) {
        this.id = id;
    }

    public AuditLogData timestamp(String timestamp) {
        this.timestamp = timestamp;
        return this;
    }

    /**
     * The timestamp of the audit log
     *
     * @return timestamp
     */
    @jakarta.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_TIMESTAMP)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getTimestamp() {
        return timestamp;
    }

    @JsonProperty(JSON_PROPERTY_TIMESTAMP)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setTimestamp(String timestamp) {
        this.timestamp = timestamp;
    }

    public AuditLogData createdAt(String createdAt) {
        this.createdAt = createdAt;
        return this;
    }

    /**
     * The timestamp of the audit log creation
     *
     * @return createdAt
     */
    @jakarta.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_CREATED_AT)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getCreatedAt() {
        return createdAt;
    }

    @JsonProperty(JSON_PROPERTY_CREATED_AT)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setCreatedAt(String createdAt) {
        this.createdAt = createdAt;
    }

    public AuditLogData user(String user) {
        this.user = user;
        return this;
    }

    /**
     * The user who performed the action
     *
     * @return user
     */
    @jakarta.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_USER)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getUser() {
        return user;
    }

    @JsonProperty(JSON_PROPERTY_USER)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setUser(String user) {
        this.user = user;
    }

    public AuditLogData subject(String subject) {
        this.subject = subject;
        return this;
    }

    /**
     * The subject of the action
     *
     * @return subject
     */
    @jakarta.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_SUBJECT)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getSubject() {
        return subject;
    }

    @JsonProperty(JSON_PROPERTY_SUBJECT)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setSubject(String subject) {
        this.subject = subject;
    }

    public AuditLogData event(String event) {
        this.event = event;
        return this;
    }

    /**
     * The event that was performed
     *
     * @return event
     */
    @jakarta.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_EVENT)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getEvent() {
        return event;
    }

    @JsonProperty(JSON_PROPERTY_EVENT)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setEvent(String event) {
        this.event = event;
    }

    public AuditLogData tenantId(String tenantId) {
        this.tenantId = tenantId;
        return this;
    }

    /**
     * The tenant ID of the audit log
     *
     * @return tenantId
     */
    @jakarta.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_TENANT_ID)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getTenantId() {
        return tenantId;
    }

    @JsonProperty(JSON_PROPERTY_TENANT_ID)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setTenantId(String tenantId) {
        this.tenantId = tenantId;
    }

    public AuditLogData userId(String userId) {
        this.userId = userId;
        return this;
    }

    /**
     * The user ID of the audit log
     *
     * @return userId
     */
    @jakarta.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_USER_ID)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getUserId() {
        return userId;
    }

    @JsonProperty(JSON_PROPERTY_USER_ID)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setUserId(String userId) {
        this.userId = userId;
    }

    /** Return true if this AuditLogData object is equal to o. */
    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        AuditLogData auditLogData = (AuditLogData) o;
        return Objects.equals(this.id, auditLogData.id)
                && Objects.equals(this.timestamp, auditLogData.timestamp)
                && Objects.equals(this.createdAt, auditLogData.createdAt)
                && Objects.equals(this.user, auditLogData.user)
                && Objects.equals(this.subject, auditLogData.subject)
                && Objects.equals(this.event, auditLogData.event)
                && Objects.equals(this.tenantId, auditLogData.tenantId)
                && Objects.equals(this.userId, auditLogData.userId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, timestamp, createdAt, user, subject, event, tenantId, userId);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class AuditLogData {\n");
        sb.append("    id: ").append(toIndentedString(id)).append("\n");
        sb.append("    timestamp: ").append(toIndentedString(timestamp)).append("\n");
        sb.append("    createdAt: ").append(toIndentedString(createdAt)).append("\n");
        sb.append("    user: ").append(toIndentedString(user)).append("\n");
        sb.append("    subject: ").append(toIndentedString(subject)).append("\n");
        sb.append("    event: ").append(toIndentedString(event)).append("\n");
        sb.append("    tenantId: ").append(toIndentedString(tenantId)).append("\n");
        sb.append("    userId: ").append(toIndentedString(userId)).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    ");
    }

    /**
     * Convert the instance into URL query string.
     *
     * @return URL query string
     */
    public String toUrlQueryString() {
        return toUrlQueryString(null);
    }

    /**
     * Convert the instance into URL query string.
     *
     * @param prefix prefix of the query string
     * @return URL query string
     */
    public String toUrlQueryString(String prefix) {
        String suffix = "";
        String containerSuffix = "";
        String containerPrefix = "";
        if (prefix == null) {
            // style=form, explode=true, e.g. /pet?name=cat&type=manx
            prefix = "";
        } else {
            // deepObject style e.g. /pet?id[name]=cat&id[type]=manx
            prefix = prefix + "[";
            suffix = "]";
            containerSuffix = "]";
            containerPrefix = "[";
        }

        StringJoiner joiner = new StringJoiner("&");

        // add `id` to the URL query string
        if (getId() != null) {
            joiner.add(
                    String.format(
                            "%sid%s=%s",
                            prefix,
                            suffix,
                            URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8)
                                    .replaceAll("\\+", "%20")));
        }

        // add `timestamp` to the URL query string
        if (getTimestamp() != null) {
            joiner.add(
                    String.format(
                            "%stimestamp%s=%s",
                            prefix,
                            suffix,
                            URLEncoder.encode(
                                            String.valueOf(getTimestamp()), StandardCharsets.UTF_8)
                                    .replaceAll("\\+", "%20")));
        }

        // add `createdAt` to the URL query string
        if (getCreatedAt() != null) {
            joiner.add(
                    String.format(
                            "%screatedAt%s=%s",
                            prefix,
                            suffix,
                            URLEncoder.encode(
                                            String.valueOf(getCreatedAt()), StandardCharsets.UTF_8)
                                    .replaceAll("\\+", "%20")));
        }

        // add `user` to the URL query string
        if (getUser() != null) {
            joiner.add(
                    String.format(
                            "%suser%s=%s",
                            prefix,
                            suffix,
                            URLEncoder.encode(String.valueOf(getUser()), StandardCharsets.UTF_8)
                                    .replaceAll("\\+", "%20")));
        }

        // add `subject` to the URL query string
        if (getSubject() != null) {
            joiner.add(
                    String.format(
                            "%ssubject%s=%s",
                            prefix,
                            suffix,
                            URLEncoder.encode(String.valueOf(getSubject()), StandardCharsets.UTF_8)
                                    .replaceAll("\\+", "%20")));
        }

        // add `event` to the URL query string
        if (getEvent() != null) {
            joiner.add(
                    String.format(
                            "%sevent%s=%s",
                            prefix,
                            suffix,
                            URLEncoder.encode(String.valueOf(getEvent()), StandardCharsets.UTF_8)
                                    .replaceAll("\\+", "%20")));
        }

        // add `tenantId` to the URL query string
        if (getTenantId() != null) {
            joiner.add(
                    String.format(
                            "%stenantId%s=%s",
                            prefix,
                            suffix,
                            URLEncoder.encode(String.valueOf(getTenantId()), StandardCharsets.UTF_8)
                                    .replaceAll("\\+", "%20")));
        }

        // add `userId` to the URL query string
        if (getUserId() != null) {
            joiner.add(
                    String.format(
                            "%suserId%s=%s",
                            prefix,
                            suffix,
                            URLEncoder.encode(String.valueOf(getUserId()), StandardCharsets.UTF_8)
                                    .replaceAll("\\+", "%20")));
        }

        return joiner.toString();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy