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

com.kintone.client.api.common.BulkRequestsRequest Maven / Gradle / Ivy

// Generated by delombok at Fri Jan 21 13:34:53 JST 2022
package com.kintone.client.api.common;

import com.kintone.client.KintoneApi;
import com.kintone.client.api.KintoneRequest;
import com.kintone.client.api.record.AddRecordRequest;
import com.kintone.client.api.record.AddRecordsRequest;
import com.kintone.client.api.record.DeleteRecordsRequest;
import com.kintone.client.api.record.UpdateRecordAssigneesRequest;
import com.kintone.client.api.record.UpdateRecordRequest;
import com.kintone.client.api.record.UpdateRecordStatusRequest;
import com.kintone.client.api.record.UpdateRecordStatusesRequest;
import com.kintone.client.api.record.UpdateRecordsRequest;
import com.kintone.client.model.BulkRequestContent;
import java.util.ArrayList;
import java.util.List;

/**
 * A request object for Bulk Requests API.
 */
public class BulkRequestsRequest implements KintoneRequest {
    /**
     * The list of requests.
     */
    private final List requests = new ArrayList<>();

    /**
     * Add a request of Add Record API.
     *
     * @param request a request object for Add Record API
     */
    public void registerAddRecord(AddRecordRequest request) {
        register(KintoneApi.ADD_RECORD, request);
    }

    /**
     * Add a request of Add Records API.
     *
     * @param request a request object for Add Records API
     */
    public void registerAddRecords(AddRecordsRequest request) {
        register(KintoneApi.ADD_RECORDS, request);
    }

    /**
     * Add a request of Update Record API.
     *
     * @param request a request object for Update Record API
     */
    public void registerUpdateRecord(UpdateRecordRequest request) {
        register(KintoneApi.UPDATE_RECORD, request);
    }

    /**
     * Add a request of Update Records API.
     *
     * @param request a request object for Update Records API
     */
    public void registerUpdateRecords(UpdateRecordsRequest request) {
        register(KintoneApi.UPDATE_RECORDS, request);
    }

    /**
     * Add a request of Delete Records API.
     *
     * @param request a request object for Delete Records API
     */
    public void registerDeleteRecords(DeleteRecordsRequest request) {
        register(KintoneApi.DELETE_RECORDS, request);
    }

    /**
     * Add a request of Update Record Status API.
     *
     * @param request a request object for Update Record Status API
     */
    public void registerUpdateRecordStatus(UpdateRecordStatusRequest request) {
        register(KintoneApi.UPDATE_RECORD_STATUS, request);
    }

    /**
     * Add a request of Update Record Statuses API.
     *
     * @param request a request object for Update Record Statuses API
     */
    public void registerUpdateRecordStatuses(UpdateRecordStatusesRequest request) {
        register(KintoneApi.UPDATE_RECORD_STATUSES, request);
    }

    /**
     * Add a request of Update Record Assignees API.
     *
     * @param request a request object for Update Record Assignees API
     */
    public void registerUpdateRecordAssignees(UpdateRecordAssigneesRequest request) {
        register(KintoneApi.UPDATE_RECORD_ASSIGNEES, request);
    }

    private void register(KintoneApi api, KintoneRequest request) {
        BulkRequestContent req = new BulkRequestContent(api, request);
        requests.add(req);
    }

    @java.lang.SuppressWarnings("all")
    public BulkRequestsRequest() {
    }

    /**
     * The list of requests.
     */
    @java.lang.SuppressWarnings("all")
    public List getRequests() {
        return this.requests;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("all")
    public boolean equals(final java.lang.Object o) {
        if (o == this) return true;
        if (!(o instanceof BulkRequestsRequest)) return false;
        final BulkRequestsRequest other = (BulkRequestsRequest) o;
        if (!other.canEqual((java.lang.Object) this)) return false;
        final java.lang.Object this$requests = this.getRequests();
        final java.lang.Object other$requests = other.getRequests();
        if (this$requests == null ? other$requests != null : !this$requests.equals(other$requests)) return false;
        return true;
    }

    @java.lang.SuppressWarnings("all")
    protected boolean canEqual(final java.lang.Object other) {
        return other instanceof BulkRequestsRequest;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("all")
    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        final java.lang.Object $requests = this.getRequests();
        result = result * PRIME + ($requests == null ? 43 : $requests.hashCode());
        return result;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("all")
    public java.lang.String toString() {
        return "BulkRequestsRequest(requests=" + this.getRequests() + ")";
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy