001/* 002 * Copyright 2024 Vonage 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package com.vonage.client.proactiveconnect; 017 018import com.fasterxml.jackson.annotation.JsonProperty; 019import java.util.Objects; 020 021/** 022 * Represents the {@code salesforce} datasource type for a Proactive Connect list. 023 */ 024public class SalesforceDatasource extends Datasource { 025 private String integrationId, soql; 026 027 protected SalesforceDatasource() { 028 super("salesforce"); 029 } 030 031 /** 032 * Creates a new Salesforce datasource for the list. 033 * 034 * @param integrationId Integration ID defining Salesforce credential to use for this datasource. 035 * @param soql Salesforce query defining which data to fetch from salesforce. 036 */ 037 public SalesforceDatasource(String integrationId, String soql) { 038 this(); 039 this.integrationId = Objects.requireNonNull(integrationId, "Integration ID is required."); 040 this.soql = Objects.requireNonNull(soql, "Salesforce query is required."); 041 } 042 043 /** 044 * Integration ID defining Salesforce credential to use for this datasource. 045 * 046 * @return The integration ID. 047 */ 048 @JsonProperty("integration_id") 049 public String getIntegrationId() { 050 return integrationId; 051 } 052 053 054 /** 055 * Salesforce query defining which data to fetch from salesforce. 056 * 057 * @return The Salesforce query as a string. 058 */ 059 @JsonProperty("soql") 060 public String getSoql() { 061 return soql; 062 } 063}