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

com.konfigthis.carbonai.client.api.CrmApiGenerated Maven / Gradle / Ivy

Go to download

Connect external data to LLMs, no matter the source. This library was generated by https://konfigthis.com

There is a newer version: 0.1.51
Show newest version
/*
 * Carbon
 * Connect external data to LLMs, no matter the source.
 *
 * The version of the OpenAPI document: 1.0.0
 * 
 *
 * NOTE: This class is auto generated by Konfig (https://konfigthis.com).
 * Do not edit the class manually.
 */


package com.konfigthis.carbonai.client.api;

import com.konfigthis.carbonai.client.ApiCallback;
import com.konfigthis.carbonai.client.ApiClient;
import com.konfigthis.carbonai.client.ApiException;
import com.konfigthis.carbonai.client.ApiResponse;
import com.konfigthis.carbonai.client.Configuration;
import com.konfigthis.carbonai.client.Pair;
import com.konfigthis.carbonai.client.ProgressRequestBody;
import com.konfigthis.carbonai.client.ProgressResponseBody;

import com.google.gson.reflect.TypeToken;

import java.io.IOException;


import com.konfigthis.carbonai.client.model.Account;
import com.konfigthis.carbonai.client.model.AccountFilters;
import com.konfigthis.carbonai.client.model.AccountResponse;
import com.konfigthis.carbonai.client.model.AccountsOrderByNullable;
import com.konfigthis.carbonai.client.model.AccountsRequest;
import com.konfigthis.carbonai.client.model.BaseIncludes;
import com.konfigthis.carbonai.client.model.Contact;
import com.konfigthis.carbonai.client.model.ContactFilters;
import com.konfigthis.carbonai.client.model.ContactsOrderByNullable;
import com.konfigthis.carbonai.client.model.ContactsRequest;
import com.konfigthis.carbonai.client.model.ContactsResponse;
import com.konfigthis.carbonai.client.model.Lead;
import com.konfigthis.carbonai.client.model.LeadFilters;
import com.konfigthis.carbonai.client.model.LeadsOrderByNullable;
import com.konfigthis.carbonai.client.model.LeadsRequest;
import com.konfigthis.carbonai.client.model.LeadsResponse;
import com.konfigthis.carbonai.client.model.OpportunitiesOrderByNullable;
import com.konfigthis.carbonai.client.model.OpportunitiesRequest;
import com.konfigthis.carbonai.client.model.OpportunitiesResponse;
import com.konfigthis.carbonai.client.model.Opportunity;
import com.konfigthis.carbonai.client.model.OpportunityFilters;
import com.konfigthis.carbonai.client.model.OrderDirV2Nullable;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ws.rs.core.GenericType;

public class CrmApiGenerated {
    private ApiClient localVarApiClient;
    private int localHostIndex;
    private String localCustomBaseUrl;

    public CrmApiGenerated() throws IllegalArgumentException {
        this(Configuration.getDefaultApiClient());
    }

    public CrmApiGenerated(ApiClient apiClient) throws IllegalArgumentException {
        this.localVarApiClient = apiClient;
    }

    public ApiClient getApiClient() {
        return localVarApiClient;
    }

    public void setApiClient(ApiClient apiClient) {
        this.localVarApiClient = apiClient;
    }

    public int getHostIndex() {
        return localHostIndex;
    }

    public void setHostIndex(int hostIndex) {
        this.localHostIndex = hostIndex;
    }

    public String getCustomBaseUrl() {
        return localCustomBaseUrl;
    }

    public void setCustomBaseUrl(String customBaseUrl) {
        this.localCustomBaseUrl = customBaseUrl;
    }

    private okhttp3.Call getAccountCall(String id, Integer dataSourceId, Boolean includeRemoteData, List includes, final ApiCallback _callback) throws ApiException {
        String basePath = null;
        // Operation Servers
        String[] localBasePaths = new String[] {  };

        // Determine Base Path to Use
        if (localCustomBaseUrl != null){
            basePath = localCustomBaseUrl;
        } else if ( localBasePaths.length > 0 ) {
            basePath = localBasePaths[localHostIndex];
        } else {
            basePath = null;
        }

        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/integrations/data/crm/accounts/{id}"
            .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString()));

        List localVarQueryParams = new ArrayList();
        List localVarCollectionQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();
        Map localVarCookieParams = new HashMap();
        Map localVarFormParams = new HashMap();

        if (dataSourceId != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("data_source_id", dataSourceId));
        }

        if (includeRemoteData != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("include_remote_data", includeRemoteData));
        }

        if (includes != null) {
            localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "includes", includes));
        }

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        if (localVarContentType != null) {
            localVarHeaderParams.put("Content-Type", localVarContentType);
        }

        String[] localVarAuthNames = new String[] { "accessToken", "apiKey", "customerId" };
        return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call getAccountValidateBeforeCall(String id, Integer dataSourceId, Boolean includeRemoteData, List includes, final ApiCallback _callback) throws ApiException {
        // verify the required parameter 'id' is set
        if (id == null) {
            throw new ApiException("Missing the required parameter 'id' when calling getAccount(Async)");
        }

        // verify the required parameter 'dataSourceId' is set
        if (dataSourceId == null) {
            throw new ApiException("Missing the required parameter 'dataSourceId' when calling getAccount(Async)");
        }

        return getAccountCall(id, dataSourceId, includeRemoteData, includes, _callback);

    }


    private ApiResponse getAccountWithHttpInfo(String id, Integer dataSourceId, Boolean includeRemoteData, List includes) throws ApiException {
        okhttp3.Call localVarCall = getAccountValidateBeforeCall(id, dataSourceId, includeRemoteData, includes, null);
        Type localVarReturnType = new TypeToken(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    private okhttp3.Call getAccountAsync(String id, Integer dataSourceId, Boolean includeRemoteData, List includes, final ApiCallback _callback) throws ApiException {

        okhttp3.Call localVarCall = getAccountValidateBeforeCall(id, dataSourceId, includeRemoteData, includes, _callback);
        Type localVarReturnType = new TypeToken(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }

    public abstract class GetAccountRequestBuilderGenerated {
        final String id;
        final Integer dataSourceId;
        Boolean includeRemoteData;
        List includes;

        public GetAccountRequestBuilderGenerated(String id, Integer dataSourceId) {
            this.id = id;
            this.dataSourceId = dataSourceId;
        }

        /**
         * Set includeRemoteData
         * @param includeRemoteData  (optional, default to false)
         * @return CrmApi.GetAccountRequestBuilder
         */
        public CrmApi.GetAccountRequestBuilder includeRemoteData(Boolean includeRemoteData) {
            this.includeRemoteData = includeRemoteData;
            return (CrmApi.GetAccountRequestBuilder) this;
        }
        
        /**
         * Set includes
         * @param includes  (optional)
         * @return CrmApi.GetAccountRequestBuilder
         */
        public CrmApi.GetAccountRequestBuilder includes(List includes) {
            this.includes = includes;
            return (CrmApi.GetAccountRequestBuilder) this;
        }
        
        /**
         * Build call for getAccount
         * @param _callback ApiCallback API callback
         * @return Call to execute
         * @throws ApiException If fail to serialize the request body object
         * @http.response.details
         
Status Code Description Response Headers
200 Successful Response -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { return getAccountCall(id, dataSourceId, includeRemoteData, includes, _callback); } /** * Execute getAccount request * @return Account * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public Account execute() throws ApiException { ApiResponse localVarResp = getAccountWithHttpInfo(id, dataSourceId, includeRemoteData, includes); return localVarResp.getResponseBody(); } /** * Execute getAccount request with HTTP info returned * @return ApiResponse<Account> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public ApiResponse executeWithHttpInfo() throws ApiException { return getAccountWithHttpInfo(id, dataSourceId, includeRemoteData, includes); } /** * Execute getAccount request (asynchronously) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { return getAccountAsync(id, dataSourceId, includeRemoteData, includes, _callback); } } /** * Get Account * * @param id (required) * @param dataSourceId (required) * @return GetAccountRequestBuilder * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public CrmApi.GetAccountRequestBuilder getAccount(String id, Integer dataSourceId) throws IllegalArgumentException { if (id == null) throw new IllegalArgumentException("\"id\" is required but got null"); if (dataSourceId == null) throw new IllegalArgumentException("\"dataSourceId\" is required but got null"); return ((CrmApi) this).new GetAccountRequestBuilder(id, dataSourceId); } private okhttp3.Call getAccountsCall(AccountsRequest accountsRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; // Determine Base Path to Use if (localCustomBaseUrl != null){ basePath = localCustomBaseUrl; } else if ( localBasePaths.length > 0 ) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } Object localVarPostBody = accountsRequest; // create path and map variables String localVarPath = "/integrations/data/crm/accounts"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } String[] localVarAuthNames = new String[] { "accessToken", "apiKey", "customerId" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getAccountsValidateBeforeCall(AccountsRequest accountsRequest, final ApiCallback _callback) throws ApiException { // verify the required parameter 'accountsRequest' is set if (accountsRequest == null) { throw new ApiException("Missing the required parameter 'accountsRequest' when calling getAccounts(Async)"); } return getAccountsCall(accountsRequest, _callback); } private ApiResponse getAccountsWithHttpInfo(AccountsRequest accountsRequest) throws ApiException { okhttp3.Call localVarCall = getAccountsValidateBeforeCall(accountsRequest, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call getAccountsAsync(AccountsRequest accountsRequest, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getAccountsValidateBeforeCall(accountsRequest, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public abstract class GetAccountsRequestBuilderGenerated { final Integer dataSourceId; Boolean includeRemoteData; String nextCursor; Integer pageSize; OrderDirV2Nullable orderDir; List includes; AccountFilters filters; AccountsOrderByNullable orderBy; public GetAccountsRequestBuilderGenerated(Integer dataSourceId) { this.dataSourceId = dataSourceId; } /** * Set includeRemoteData * @param includeRemoteData (optional, default to false) * @return CrmApi.GetAccountsRequestBuilder */ public CrmApi.GetAccountsRequestBuilder includeRemoteData(Boolean includeRemoteData) { this.includeRemoteData = includeRemoteData; return (CrmApi.GetAccountsRequestBuilder) this; } /** * Set nextCursor * @param nextCursor (optional) * @return CrmApi.GetAccountsRequestBuilder */ public CrmApi.GetAccountsRequestBuilder nextCursor(String nextCursor) { this.nextCursor = nextCursor; return (CrmApi.GetAccountsRequestBuilder) this; } /** * Set pageSize * @param pageSize (optional) * @return CrmApi.GetAccountsRequestBuilder */ public CrmApi.GetAccountsRequestBuilder pageSize(Integer pageSize) { this.pageSize = pageSize; return (CrmApi.GetAccountsRequestBuilder) this; } /** * Set orderDir * @param orderDir (optional, default to asc) * @return CrmApi.GetAccountsRequestBuilder */ public CrmApi.GetAccountsRequestBuilder orderDir(OrderDirV2Nullable orderDir) { this.orderDir = orderDir; return (CrmApi.GetAccountsRequestBuilder) this; } /** * Set includes * @param includes (optional) * @return CrmApi.GetAccountsRequestBuilder */ public CrmApi.GetAccountsRequestBuilder includes(List includes) { this.includes = includes; return (CrmApi.GetAccountsRequestBuilder) this; } /** * Set filters * @param filters (optional) * @return CrmApi.GetAccountsRequestBuilder */ public CrmApi.GetAccountsRequestBuilder filters(AccountFilters filters) { this.filters = filters; return (CrmApi.GetAccountsRequestBuilder) this; } /** * Set orderBy * @param orderBy (optional) * @return CrmApi.GetAccountsRequestBuilder */ public CrmApi.GetAccountsRequestBuilder orderBy(AccountsOrderByNullable orderBy) { this.orderBy = orderBy; return (CrmApi.GetAccountsRequestBuilder) this; } /** * Build call for getAccounts * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { AccountsRequest accountsRequest = buildBodyParams(); return getAccountsCall(accountsRequest, _callback); } private AccountsRequest buildBodyParams() { AccountsRequest accountsRequest = new AccountsRequest(); accountsRequest.dataSourceId(this.dataSourceId); accountsRequest.includeRemoteData(this.includeRemoteData); accountsRequest.nextCursor(this.nextCursor); accountsRequest.pageSize(this.pageSize); accountsRequest.orderDir(this.orderDir); accountsRequest.includes(this.includes); accountsRequest.filters(this.filters); accountsRequest.orderBy(this.orderBy); return accountsRequest; } /** * Execute getAccounts request * @return AccountResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public AccountResponse execute() throws ApiException { AccountsRequest accountsRequest = buildBodyParams(); ApiResponse localVarResp = getAccountsWithHttpInfo(accountsRequest); return localVarResp.getResponseBody(); } /** * Execute getAccounts request with HTTP info returned * @return ApiResponse<AccountResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public ApiResponse executeWithHttpInfo() throws ApiException { AccountsRequest accountsRequest = buildBodyParams(); return getAccountsWithHttpInfo(accountsRequest); } /** * Execute getAccounts request (asynchronously) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { AccountsRequest accountsRequest = buildBodyParams(); return getAccountsAsync(accountsRequest, _callback); } } /** * Get Accounts * * @param accountsRequest (required) * @return GetAccountsRequestBuilder * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public CrmApi.GetAccountsRequestBuilder getAccounts(Integer dataSourceId) throws IllegalArgumentException { if (dataSourceId == null) throw new IllegalArgumentException("\"dataSourceId\" is required but got null"); return ((CrmApi) this).new GetAccountsRequestBuilder(dataSourceId); } private okhttp3.Call getContactCall(String id, Integer dataSourceId, Boolean includeRemoteData, List includes, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; // Determine Base Path to Use if (localCustomBaseUrl != null){ basePath = localCustomBaseUrl; } else if ( localBasePaths.length > 0 ) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } Object localVarPostBody = null; // create path and map variables String localVarPath = "/integrations/data/crm/contacts/{id}" .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (dataSourceId != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("data_source_id", dataSourceId)); } if (includeRemoteData != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("include_remote_data", includeRemoteData)); } if (includes != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "includes", includes)); } final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } String[] localVarAuthNames = new String[] { "accessToken", "apiKey", "customerId" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getContactValidateBeforeCall(String id, Integer dataSourceId, Boolean includeRemoteData, List includes, final ApiCallback _callback) throws ApiException { // verify the required parameter 'id' is set if (id == null) { throw new ApiException("Missing the required parameter 'id' when calling getContact(Async)"); } // verify the required parameter 'dataSourceId' is set if (dataSourceId == null) { throw new ApiException("Missing the required parameter 'dataSourceId' when calling getContact(Async)"); } return getContactCall(id, dataSourceId, includeRemoteData, includes, _callback); } private ApiResponse getContactWithHttpInfo(String id, Integer dataSourceId, Boolean includeRemoteData, List includes) throws ApiException { okhttp3.Call localVarCall = getContactValidateBeforeCall(id, dataSourceId, includeRemoteData, includes, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call getContactAsync(String id, Integer dataSourceId, Boolean includeRemoteData, List includes, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getContactValidateBeforeCall(id, dataSourceId, includeRemoteData, includes, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public abstract class GetContactRequestBuilderGenerated { final String id; final Integer dataSourceId; Boolean includeRemoteData; List includes; public GetContactRequestBuilderGenerated(String id, Integer dataSourceId) { this.id = id; this.dataSourceId = dataSourceId; } /** * Set includeRemoteData * @param includeRemoteData (optional, default to false) * @return CrmApi.GetContactRequestBuilder */ public CrmApi.GetContactRequestBuilder includeRemoteData(Boolean includeRemoteData) { this.includeRemoteData = includeRemoteData; return (CrmApi.GetContactRequestBuilder) this; } /** * Set includes * @param includes (optional) * @return CrmApi.GetContactRequestBuilder */ public CrmApi.GetContactRequestBuilder includes(List includes) { this.includes = includes; return (CrmApi.GetContactRequestBuilder) this; } /** * Build call for getContact * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { return getContactCall(id, dataSourceId, includeRemoteData, includes, _callback); } /** * Execute getContact request * @return Contact * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public Contact execute() throws ApiException { ApiResponse localVarResp = getContactWithHttpInfo(id, dataSourceId, includeRemoteData, includes); return localVarResp.getResponseBody(); } /** * Execute getContact request with HTTP info returned * @return ApiResponse<Contact> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public ApiResponse executeWithHttpInfo() throws ApiException { return getContactWithHttpInfo(id, dataSourceId, includeRemoteData, includes); } /** * Execute getContact request (asynchronously) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { return getContactAsync(id, dataSourceId, includeRemoteData, includes, _callback); } } /** * Get Contact * * @param id (required) * @param dataSourceId (required) * @return GetContactRequestBuilder * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public CrmApi.GetContactRequestBuilder getContact(String id, Integer dataSourceId) throws IllegalArgumentException { if (id == null) throw new IllegalArgumentException("\"id\" is required but got null"); if (dataSourceId == null) throw new IllegalArgumentException("\"dataSourceId\" is required but got null"); return ((CrmApi) this).new GetContactRequestBuilder(id, dataSourceId); } private okhttp3.Call getContactsCall(ContactsRequest contactsRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; // Determine Base Path to Use if (localCustomBaseUrl != null){ basePath = localCustomBaseUrl; } else if ( localBasePaths.length > 0 ) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } Object localVarPostBody = contactsRequest; // create path and map variables String localVarPath = "/integrations/data/crm/contacts"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } String[] localVarAuthNames = new String[] { "accessToken", "apiKey", "customerId" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getContactsValidateBeforeCall(ContactsRequest contactsRequest, final ApiCallback _callback) throws ApiException { // verify the required parameter 'contactsRequest' is set if (contactsRequest == null) { throw new ApiException("Missing the required parameter 'contactsRequest' when calling getContacts(Async)"); } return getContactsCall(contactsRequest, _callback); } private ApiResponse getContactsWithHttpInfo(ContactsRequest contactsRequest) throws ApiException { okhttp3.Call localVarCall = getContactsValidateBeforeCall(contactsRequest, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call getContactsAsync(ContactsRequest contactsRequest, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getContactsValidateBeforeCall(contactsRequest, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public abstract class GetContactsRequestBuilderGenerated { final Integer dataSourceId; Boolean includeRemoteData; String nextCursor; Integer pageSize; OrderDirV2Nullable orderDir; List includes; ContactFilters filters; ContactsOrderByNullable orderBy; public GetContactsRequestBuilderGenerated(Integer dataSourceId) { this.dataSourceId = dataSourceId; } /** * Set includeRemoteData * @param includeRemoteData (optional, default to false) * @return CrmApi.GetContactsRequestBuilder */ public CrmApi.GetContactsRequestBuilder includeRemoteData(Boolean includeRemoteData) { this.includeRemoteData = includeRemoteData; return (CrmApi.GetContactsRequestBuilder) this; } /** * Set nextCursor * @param nextCursor (optional) * @return CrmApi.GetContactsRequestBuilder */ public CrmApi.GetContactsRequestBuilder nextCursor(String nextCursor) { this.nextCursor = nextCursor; return (CrmApi.GetContactsRequestBuilder) this; } /** * Set pageSize * @param pageSize (optional) * @return CrmApi.GetContactsRequestBuilder */ public CrmApi.GetContactsRequestBuilder pageSize(Integer pageSize) { this.pageSize = pageSize; return (CrmApi.GetContactsRequestBuilder) this; } /** * Set orderDir * @param orderDir (optional, default to asc) * @return CrmApi.GetContactsRequestBuilder */ public CrmApi.GetContactsRequestBuilder orderDir(OrderDirV2Nullable orderDir) { this.orderDir = orderDir; return (CrmApi.GetContactsRequestBuilder) this; } /** * Set includes * @param includes (optional) * @return CrmApi.GetContactsRequestBuilder */ public CrmApi.GetContactsRequestBuilder includes(List includes) { this.includes = includes; return (CrmApi.GetContactsRequestBuilder) this; } /** * Set filters * @param filters (optional) * @return CrmApi.GetContactsRequestBuilder */ public CrmApi.GetContactsRequestBuilder filters(ContactFilters filters) { this.filters = filters; return (CrmApi.GetContactsRequestBuilder) this; } /** * Set orderBy * @param orderBy (optional) * @return CrmApi.GetContactsRequestBuilder */ public CrmApi.GetContactsRequestBuilder orderBy(ContactsOrderByNullable orderBy) { this.orderBy = orderBy; return (CrmApi.GetContactsRequestBuilder) this; } /** * Build call for getContacts * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { ContactsRequest contactsRequest = buildBodyParams(); return getContactsCall(contactsRequest, _callback); } private ContactsRequest buildBodyParams() { ContactsRequest contactsRequest = new ContactsRequest(); contactsRequest.dataSourceId(this.dataSourceId); contactsRequest.includeRemoteData(this.includeRemoteData); contactsRequest.nextCursor(this.nextCursor); contactsRequest.pageSize(this.pageSize); contactsRequest.orderDir(this.orderDir); contactsRequest.includes(this.includes); contactsRequest.filters(this.filters); contactsRequest.orderBy(this.orderBy); return contactsRequest; } /** * Execute getContacts request * @return ContactsResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public ContactsResponse execute() throws ApiException { ContactsRequest contactsRequest = buildBodyParams(); ApiResponse localVarResp = getContactsWithHttpInfo(contactsRequest); return localVarResp.getResponseBody(); } /** * Execute getContacts request with HTTP info returned * @return ApiResponse<ContactsResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public ApiResponse executeWithHttpInfo() throws ApiException { ContactsRequest contactsRequest = buildBodyParams(); return getContactsWithHttpInfo(contactsRequest); } /** * Execute getContacts request (asynchronously) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { ContactsRequest contactsRequest = buildBodyParams(); return getContactsAsync(contactsRequest, _callback); } } /** * Get Contacts * * @param contactsRequest (required) * @return GetContactsRequestBuilder * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public CrmApi.GetContactsRequestBuilder getContacts(Integer dataSourceId) throws IllegalArgumentException { if (dataSourceId == null) throw new IllegalArgumentException("\"dataSourceId\" is required but got null"); return ((CrmApi) this).new GetContactsRequestBuilder(dataSourceId); } private okhttp3.Call getLeadCall(String id, Integer dataSourceId, Boolean includeRemoteData, List includes, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; // Determine Base Path to Use if (localCustomBaseUrl != null){ basePath = localCustomBaseUrl; } else if ( localBasePaths.length > 0 ) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } Object localVarPostBody = null; // create path and map variables String localVarPath = "/integrations/data/crm/leads/{id}" .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (dataSourceId != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("data_source_id", dataSourceId)); } if (includeRemoteData != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("include_remote_data", includeRemoteData)); } if (includes != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "includes", includes)); } final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } String[] localVarAuthNames = new String[] { "accessToken", "apiKey", "customerId" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getLeadValidateBeforeCall(String id, Integer dataSourceId, Boolean includeRemoteData, List includes, final ApiCallback _callback) throws ApiException { // verify the required parameter 'id' is set if (id == null) { throw new ApiException("Missing the required parameter 'id' when calling getLead(Async)"); } // verify the required parameter 'dataSourceId' is set if (dataSourceId == null) { throw new ApiException("Missing the required parameter 'dataSourceId' when calling getLead(Async)"); } return getLeadCall(id, dataSourceId, includeRemoteData, includes, _callback); } private ApiResponse getLeadWithHttpInfo(String id, Integer dataSourceId, Boolean includeRemoteData, List includes) throws ApiException { okhttp3.Call localVarCall = getLeadValidateBeforeCall(id, dataSourceId, includeRemoteData, includes, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call getLeadAsync(String id, Integer dataSourceId, Boolean includeRemoteData, List includes, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getLeadValidateBeforeCall(id, dataSourceId, includeRemoteData, includes, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public abstract class GetLeadRequestBuilderGenerated { final String id; final Integer dataSourceId; Boolean includeRemoteData; List includes; public GetLeadRequestBuilderGenerated(String id, Integer dataSourceId) { this.id = id; this.dataSourceId = dataSourceId; } /** * Set includeRemoteData * @param includeRemoteData (optional, default to false) * @return CrmApi.GetLeadRequestBuilder */ public CrmApi.GetLeadRequestBuilder includeRemoteData(Boolean includeRemoteData) { this.includeRemoteData = includeRemoteData; return (CrmApi.GetLeadRequestBuilder) this; } /** * Set includes * @param includes (optional) * @return CrmApi.GetLeadRequestBuilder */ public CrmApi.GetLeadRequestBuilder includes(List includes) { this.includes = includes; return (CrmApi.GetLeadRequestBuilder) this; } /** * Build call for getLead * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { return getLeadCall(id, dataSourceId, includeRemoteData, includes, _callback); } /** * Execute getLead request * @return Lead * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public Lead execute() throws ApiException { ApiResponse localVarResp = getLeadWithHttpInfo(id, dataSourceId, includeRemoteData, includes); return localVarResp.getResponseBody(); } /** * Execute getLead request with HTTP info returned * @return ApiResponse<Lead> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public ApiResponse executeWithHttpInfo() throws ApiException { return getLeadWithHttpInfo(id, dataSourceId, includeRemoteData, includes); } /** * Execute getLead request (asynchronously) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { return getLeadAsync(id, dataSourceId, includeRemoteData, includes, _callback); } } /** * Get Lead * * @param id (required) * @param dataSourceId (required) * @return GetLeadRequestBuilder * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public CrmApi.GetLeadRequestBuilder getLead(String id, Integer dataSourceId) throws IllegalArgumentException { if (id == null) throw new IllegalArgumentException("\"id\" is required but got null"); if (dataSourceId == null) throw new IllegalArgumentException("\"dataSourceId\" is required but got null"); return ((CrmApi) this).new GetLeadRequestBuilder(id, dataSourceId); } private okhttp3.Call getLeadsCall(LeadsRequest leadsRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; // Determine Base Path to Use if (localCustomBaseUrl != null){ basePath = localCustomBaseUrl; } else if ( localBasePaths.length > 0 ) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } Object localVarPostBody = leadsRequest; // create path and map variables String localVarPath = "/integrations/data/crm/leads"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } String[] localVarAuthNames = new String[] { "accessToken", "apiKey", "customerId" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getLeadsValidateBeforeCall(LeadsRequest leadsRequest, final ApiCallback _callback) throws ApiException { // verify the required parameter 'leadsRequest' is set if (leadsRequest == null) { throw new ApiException("Missing the required parameter 'leadsRequest' when calling getLeads(Async)"); } return getLeadsCall(leadsRequest, _callback); } private ApiResponse getLeadsWithHttpInfo(LeadsRequest leadsRequest) throws ApiException { okhttp3.Call localVarCall = getLeadsValidateBeforeCall(leadsRequest, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call getLeadsAsync(LeadsRequest leadsRequest, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getLeadsValidateBeforeCall(leadsRequest, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public abstract class GetLeadsRequestBuilderGenerated { final Integer dataSourceId; Boolean includeRemoteData; String nextCursor; Integer pageSize; OrderDirV2Nullable orderDir; List includes; LeadFilters filters; LeadsOrderByNullable orderBy; public GetLeadsRequestBuilderGenerated(Integer dataSourceId) { this.dataSourceId = dataSourceId; } /** * Set includeRemoteData * @param includeRemoteData (optional, default to false) * @return CrmApi.GetLeadsRequestBuilder */ public CrmApi.GetLeadsRequestBuilder includeRemoteData(Boolean includeRemoteData) { this.includeRemoteData = includeRemoteData; return (CrmApi.GetLeadsRequestBuilder) this; } /** * Set nextCursor * @param nextCursor (optional) * @return CrmApi.GetLeadsRequestBuilder */ public CrmApi.GetLeadsRequestBuilder nextCursor(String nextCursor) { this.nextCursor = nextCursor; return (CrmApi.GetLeadsRequestBuilder) this; } /** * Set pageSize * @param pageSize (optional) * @return CrmApi.GetLeadsRequestBuilder */ public CrmApi.GetLeadsRequestBuilder pageSize(Integer pageSize) { this.pageSize = pageSize; return (CrmApi.GetLeadsRequestBuilder) this; } /** * Set orderDir * @param orderDir (optional, default to asc) * @return CrmApi.GetLeadsRequestBuilder */ public CrmApi.GetLeadsRequestBuilder orderDir(OrderDirV2Nullable orderDir) { this.orderDir = orderDir; return (CrmApi.GetLeadsRequestBuilder) this; } /** * Set includes * @param includes (optional) * @return CrmApi.GetLeadsRequestBuilder */ public CrmApi.GetLeadsRequestBuilder includes(List includes) { this.includes = includes; return (CrmApi.GetLeadsRequestBuilder) this; } /** * Set filters * @param filters (optional) * @return CrmApi.GetLeadsRequestBuilder */ public CrmApi.GetLeadsRequestBuilder filters(LeadFilters filters) { this.filters = filters; return (CrmApi.GetLeadsRequestBuilder) this; } /** * Set orderBy * @param orderBy (optional) * @return CrmApi.GetLeadsRequestBuilder */ public CrmApi.GetLeadsRequestBuilder orderBy(LeadsOrderByNullable orderBy) { this.orderBy = orderBy; return (CrmApi.GetLeadsRequestBuilder) this; } /** * Build call for getLeads * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { LeadsRequest leadsRequest = buildBodyParams(); return getLeadsCall(leadsRequest, _callback); } private LeadsRequest buildBodyParams() { LeadsRequest leadsRequest = new LeadsRequest(); leadsRequest.dataSourceId(this.dataSourceId); leadsRequest.includeRemoteData(this.includeRemoteData); leadsRequest.nextCursor(this.nextCursor); leadsRequest.pageSize(this.pageSize); leadsRequest.orderDir(this.orderDir); leadsRequest.includes(this.includes); leadsRequest.filters(this.filters); leadsRequest.orderBy(this.orderBy); return leadsRequest; } /** * Execute getLeads request * @return LeadsResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public LeadsResponse execute() throws ApiException { LeadsRequest leadsRequest = buildBodyParams(); ApiResponse localVarResp = getLeadsWithHttpInfo(leadsRequest); return localVarResp.getResponseBody(); } /** * Execute getLeads request with HTTP info returned * @return ApiResponse<LeadsResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public ApiResponse executeWithHttpInfo() throws ApiException { LeadsRequest leadsRequest = buildBodyParams(); return getLeadsWithHttpInfo(leadsRequest); } /** * Execute getLeads request (asynchronously) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { LeadsRequest leadsRequest = buildBodyParams(); return getLeadsAsync(leadsRequest, _callback); } } /** * Get Leads * * @param leadsRequest (required) * @return GetLeadsRequestBuilder * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public CrmApi.GetLeadsRequestBuilder getLeads(Integer dataSourceId) throws IllegalArgumentException { if (dataSourceId == null) throw new IllegalArgumentException("\"dataSourceId\" is required but got null"); return ((CrmApi) this).new GetLeadsRequestBuilder(dataSourceId); } private okhttp3.Call getOpportunitiesCall(OpportunitiesRequest opportunitiesRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; // Determine Base Path to Use if (localCustomBaseUrl != null){ basePath = localCustomBaseUrl; } else if ( localBasePaths.length > 0 ) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } Object localVarPostBody = opportunitiesRequest; // create path and map variables String localVarPath = "/integrations/data/crm/opportunities"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } String[] localVarAuthNames = new String[] { "accessToken", "apiKey", "customerId" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getOpportunitiesValidateBeforeCall(OpportunitiesRequest opportunitiesRequest, final ApiCallback _callback) throws ApiException { // verify the required parameter 'opportunitiesRequest' is set if (opportunitiesRequest == null) { throw new ApiException("Missing the required parameter 'opportunitiesRequest' when calling getOpportunities(Async)"); } return getOpportunitiesCall(opportunitiesRequest, _callback); } private ApiResponse getOpportunitiesWithHttpInfo(OpportunitiesRequest opportunitiesRequest) throws ApiException { okhttp3.Call localVarCall = getOpportunitiesValidateBeforeCall(opportunitiesRequest, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call getOpportunitiesAsync(OpportunitiesRequest opportunitiesRequest, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getOpportunitiesValidateBeforeCall(opportunitiesRequest, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public abstract class GetOpportunitiesRequestBuilderGenerated { final Integer dataSourceId; Boolean includeRemoteData; String nextCursor; Integer pageSize; OrderDirV2Nullable orderDir; List includes; OpportunityFilters filters; OpportunitiesOrderByNullable orderBy; public GetOpportunitiesRequestBuilderGenerated(Integer dataSourceId) { this.dataSourceId = dataSourceId; } /** * Set includeRemoteData * @param includeRemoteData (optional, default to false) * @return CrmApi.GetOpportunitiesRequestBuilder */ public CrmApi.GetOpportunitiesRequestBuilder includeRemoteData(Boolean includeRemoteData) { this.includeRemoteData = includeRemoteData; return (CrmApi.GetOpportunitiesRequestBuilder) this; } /** * Set nextCursor * @param nextCursor (optional) * @return CrmApi.GetOpportunitiesRequestBuilder */ public CrmApi.GetOpportunitiesRequestBuilder nextCursor(String nextCursor) { this.nextCursor = nextCursor; return (CrmApi.GetOpportunitiesRequestBuilder) this; } /** * Set pageSize * @param pageSize (optional) * @return CrmApi.GetOpportunitiesRequestBuilder */ public CrmApi.GetOpportunitiesRequestBuilder pageSize(Integer pageSize) { this.pageSize = pageSize; return (CrmApi.GetOpportunitiesRequestBuilder) this; } /** * Set orderDir * @param orderDir (optional, default to asc) * @return CrmApi.GetOpportunitiesRequestBuilder */ public CrmApi.GetOpportunitiesRequestBuilder orderDir(OrderDirV2Nullable orderDir) { this.orderDir = orderDir; return (CrmApi.GetOpportunitiesRequestBuilder) this; } /** * Set includes * @param includes (optional) * @return CrmApi.GetOpportunitiesRequestBuilder */ public CrmApi.GetOpportunitiesRequestBuilder includes(List includes) { this.includes = includes; return (CrmApi.GetOpportunitiesRequestBuilder) this; } /** * Set filters * @param filters (optional) * @return CrmApi.GetOpportunitiesRequestBuilder */ public CrmApi.GetOpportunitiesRequestBuilder filters(OpportunityFilters filters) { this.filters = filters; return (CrmApi.GetOpportunitiesRequestBuilder) this; } /** * Set orderBy * @param orderBy (optional) * @return CrmApi.GetOpportunitiesRequestBuilder */ public CrmApi.GetOpportunitiesRequestBuilder orderBy(OpportunitiesOrderByNullable orderBy) { this.orderBy = orderBy; return (CrmApi.GetOpportunitiesRequestBuilder) this; } /** * Build call for getOpportunities * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { OpportunitiesRequest opportunitiesRequest = buildBodyParams(); return getOpportunitiesCall(opportunitiesRequest, _callback); } private OpportunitiesRequest buildBodyParams() { OpportunitiesRequest opportunitiesRequest = new OpportunitiesRequest(); opportunitiesRequest.dataSourceId(this.dataSourceId); opportunitiesRequest.includeRemoteData(this.includeRemoteData); opportunitiesRequest.nextCursor(this.nextCursor); opportunitiesRequest.pageSize(this.pageSize); opportunitiesRequest.orderDir(this.orderDir); opportunitiesRequest.includes(this.includes); opportunitiesRequest.filters(this.filters); opportunitiesRequest.orderBy(this.orderBy); return opportunitiesRequest; } /** * Execute getOpportunities request * @return OpportunitiesResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public OpportunitiesResponse execute() throws ApiException { OpportunitiesRequest opportunitiesRequest = buildBodyParams(); ApiResponse localVarResp = getOpportunitiesWithHttpInfo(opportunitiesRequest); return localVarResp.getResponseBody(); } /** * Execute getOpportunities request with HTTP info returned * @return ApiResponse<OpportunitiesResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public ApiResponse executeWithHttpInfo() throws ApiException { OpportunitiesRequest opportunitiesRequest = buildBodyParams(); return getOpportunitiesWithHttpInfo(opportunitiesRequest); } /** * Execute getOpportunities request (asynchronously) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { OpportunitiesRequest opportunitiesRequest = buildBodyParams(); return getOpportunitiesAsync(opportunitiesRequest, _callback); } } /** * Get Opportunities * * @param opportunitiesRequest (required) * @return GetOpportunitiesRequestBuilder * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public CrmApi.GetOpportunitiesRequestBuilder getOpportunities(Integer dataSourceId) throws IllegalArgumentException { if (dataSourceId == null) throw new IllegalArgumentException("\"dataSourceId\" is required but got null"); return ((CrmApi) this).new GetOpportunitiesRequestBuilder(dataSourceId); } private okhttp3.Call getOpportunityCall(String id, Integer dataSourceId, Boolean includeRemoteData, List includes, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; // Determine Base Path to Use if (localCustomBaseUrl != null){ basePath = localCustomBaseUrl; } else if ( localBasePaths.length > 0 ) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } Object localVarPostBody = null; // create path and map variables String localVarPath = "/integrations/data/crm/opportunities/{id}" .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (dataSourceId != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("data_source_id", dataSourceId)); } if (includeRemoteData != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("include_remote_data", includeRemoteData)); } if (includes != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "includes", includes)); } final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } String[] localVarAuthNames = new String[] { "accessToken", "apiKey", "customerId" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getOpportunityValidateBeforeCall(String id, Integer dataSourceId, Boolean includeRemoteData, List includes, final ApiCallback _callback) throws ApiException { // verify the required parameter 'id' is set if (id == null) { throw new ApiException("Missing the required parameter 'id' when calling getOpportunity(Async)"); } // verify the required parameter 'dataSourceId' is set if (dataSourceId == null) { throw new ApiException("Missing the required parameter 'dataSourceId' when calling getOpportunity(Async)"); } return getOpportunityCall(id, dataSourceId, includeRemoteData, includes, _callback); } private ApiResponse getOpportunityWithHttpInfo(String id, Integer dataSourceId, Boolean includeRemoteData, List includes) throws ApiException { okhttp3.Call localVarCall = getOpportunityValidateBeforeCall(id, dataSourceId, includeRemoteData, includes, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call getOpportunityAsync(String id, Integer dataSourceId, Boolean includeRemoteData, List includes, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getOpportunityValidateBeforeCall(id, dataSourceId, includeRemoteData, includes, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public abstract class GetOpportunityRequestBuilderGenerated { final String id; final Integer dataSourceId; Boolean includeRemoteData; List includes; public GetOpportunityRequestBuilderGenerated(String id, Integer dataSourceId) { this.id = id; this.dataSourceId = dataSourceId; } /** * Set includeRemoteData * @param includeRemoteData (optional, default to false) * @return CrmApi.GetOpportunityRequestBuilder */ public CrmApi.GetOpportunityRequestBuilder includeRemoteData(Boolean includeRemoteData) { this.includeRemoteData = includeRemoteData; return (CrmApi.GetOpportunityRequestBuilder) this; } /** * Set includes * @param includes (optional) * @return CrmApi.GetOpportunityRequestBuilder */ public CrmApi.GetOpportunityRequestBuilder includes(List includes) { this.includes = includes; return (CrmApi.GetOpportunityRequestBuilder) this; } /** * Build call for getOpportunity * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { return getOpportunityCall(id, dataSourceId, includeRemoteData, includes, _callback); } /** * Execute getOpportunity request * @return Opportunity * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public Opportunity execute() throws ApiException { ApiResponse localVarResp = getOpportunityWithHttpInfo(id, dataSourceId, includeRemoteData, includes); return localVarResp.getResponseBody(); } /** * Execute getOpportunity request with HTTP info returned * @return ApiResponse<Opportunity> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public ApiResponse executeWithHttpInfo() throws ApiException { return getOpportunityWithHttpInfo(id, dataSourceId, includeRemoteData, includes); } /** * Execute getOpportunity request (asynchronously) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { return getOpportunityAsync(id, dataSourceId, includeRemoteData, includes, _callback); } } /** * Get Opportunity * * @param id (required) * @param dataSourceId (required) * @return GetOpportunityRequestBuilder * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public CrmApi.GetOpportunityRequestBuilder getOpportunity(String id, Integer dataSourceId) throws IllegalArgumentException { if (id == null) throw new IllegalArgumentException("\"id\" is required but got null"); if (dataSourceId == null) throw new IllegalArgumentException("\"dataSourceId\" is required but got null"); return ((CrmApi) this).new GetOpportunityRequestBuilder(id, dataSourceId); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy