com.zuora.model.CreateBatchQueryJobRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zuora-sdk-java Show documentation
Show all versions of zuora-sdk-java Show documentation
The SDK of JAVA language for Zuora pricing system
/*
* Zuora API Reference
* REST API reference for the Zuora Billing, Payments, and Central Platform! Check out the [REST API Overview](https://www.zuora.com/developer/api-references/api/overview/).
*
* The version of the OpenAPI document: 2024-05-20
* 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.zuora.model;
import java.util.Objects;
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 com.zuora.model.BatchQueryFormat;
import com.zuora.model.CreateBatchQueryRequest;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import com.google.gson.TypeAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import com.zuora.JSON;
/**
* CreateBatchQueryJobRequest
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0")
public class CreateBatchQueryJobRequest {
public static final String SERIALIZED_NAME_DATE_TIME_UTC = "dateTimeUtc";
@SerializedName(SERIALIZED_NAME_DATE_TIME_UTC)
private Boolean dateTimeUtc;
public static final String SERIALIZED_NAME_FORMAT = "format";
@SerializedName(SERIALIZED_NAME_FORMAT)
private BatchQueryFormat format;
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
public static final String SERIALIZED_NAME_NOTIFY_URL = "notifyUrl";
@SerializedName(SERIALIZED_NAME_NOTIFY_URL)
private String notifyUrl;
public static final String SERIALIZED_NAME_NULL_REPLACEMENT = "nullReplacement";
@SerializedName(SERIALIZED_NAME_NULL_REPLACEMENT)
private String nullReplacement;
public static final String SERIALIZED_NAME_OFFSET = "offset";
@SerializedName(SERIALIZED_NAME_OFFSET)
private BigDecimal offset;
public static final String SERIALIZED_NAME_PARTNER = "partner";
@SerializedName(SERIALIZED_NAME_PARTNER)
private String partner;
public static final String SERIALIZED_NAME_PROJECT = "project";
@SerializedName(SERIALIZED_NAME_PROJECT)
private String project;
public static final String SERIALIZED_NAME_QUERIES = "queries";
@SerializedName(SERIALIZED_NAME_QUERIES)
private List queries;
public static final String SERIALIZED_NAME_USE_QUERY_LABELS = "useQueryLabels";
@SerializedName(SERIALIZED_NAME_USE_QUERY_LABELS)
private Boolean useQueryLabels;
public static final String SERIALIZED_NAME_VERSION = "version";
@SerializedName(SERIALIZED_NAME_VERSION)
private Float version;
public CreateBatchQueryJobRequest() {
}
public CreateBatchQueryJobRequest dateTimeUtc(Boolean dateTimeUtc) {
this.dateTimeUtc = dateTimeUtc;
return this;
}
/**
* When using WSDL 69 and later you can ensure that the exported output of dateTime records are rendered according to ISO-8601 generic UTC form by setting `dateTimeUtc` to `true`. When `dateTimeUtc` is set to `true`, exports of dateTime data types will be rendered in the following generic format: `YYYY-MM-DDThh:mm:ss-hhmm` or `YYYY-MM-DDThh:mm:ss+hhmm`. **Note**: Regardless of what batchType query is used (`zoql` or `zoqlexport`), the query response output for datetime data types can be standardized by setting dateTimeUtc to `true`. When `true`, the results will display datetime types with the format: YYYY-MM-DDThh:mm:ss+/-hhmm.
* @return dateTimeUtc
*/
@javax.annotation.Nullable
public Boolean getDateTimeUtc() {
return dateTimeUtc;
}
public void setDateTimeUtc(Boolean dateTimeUtc) {
this.dateTimeUtc = dateTimeUtc;
}
public CreateBatchQueryJobRequest format(BatchQueryFormat format) {
this.format = format;
return this;
}
/**
* Get format
* @return format
*/
@javax.annotation.Nullable
public BatchQueryFormat getFormat() {
return format;
}
public void setFormat(BatchQueryFormat format) {
this.format = format;
}
public CreateBatchQueryJobRequest name(String name) {
this.name = name;
return this;
}
/**
* The name of the job. 32 character limit.
* @return name
*/
@javax.annotation.Nullable
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public CreateBatchQueryJobRequest notifyUrl(String notifyUrl) {
this.notifyUrl = notifyUrl;
return this;
}
/**
* If URL is provided, the AQuA job will call this `notifyUrl` once the job has completed. The value of `notifyUrl` needs to have `${JOBID}` and `${STATUS}` placeholders. These placeholders will be replaced by the actual job ID and status when returned in the response. Status will be `Completed` after the AQuA job is done. If you submit an AQuA query with `notifyUrl` specified, the value of `notifyUrl` will be ignored if your organization has already <a href=\"https://knowledgecenter.zuora.com/Zuora_Central_Platform/API/AB_Aggregate_Query_API/Callout_Notification_for_Completed_AQuA_Jobs\" target=\"_blank\">configured a callout notification through the Zuora user interface</a>.
* @return notifyUrl
*/
@javax.annotation.Nullable
public String getNotifyUrl() {
return notifyUrl;
}
public void setNotifyUrl(String notifyUrl) {
this.notifyUrl = notifyUrl;
}
public CreateBatchQueryJobRequest nullReplacement(String nullReplacement) {
this.nullReplacement = nullReplacement;
return this;
}
/**
* The string used to represent null values in the query results. If you do not set this parameter, null values are represented by the empty string in the query results.
* @return nullReplacement
*/
@javax.annotation.Nullable
public String getNullReplacement() {
return nullReplacement;
}
public void setNullReplacement(String nullReplacement) {
this.nullReplacement = nullReplacement;
}
public CreateBatchQueryJobRequest offset(BigDecimal offset) {
this.offset = offset;
return this;
}
/**
* This field specifies the time offset for AQuA queries in stateful mode. It is an integer in the range 0 to 3,600 seconds. For example, if you set this field to 600 seconds and you post a query in stateful mode at 2:00 AM, it will query against data created or updated between the completion time of the previous query and 1:50 AM. The value of this field will override the value you configured in **Settings** > **Administration** > **AQuA API Stateful Mode Time Offset**.
* @return offset
*/
@javax.annotation.Nullable
public BigDecimal getOffset() {
return offset;
}
public void setOffset(BigDecimal offset) {
this.offset = offset;
}
public CreateBatchQueryJobRequest partner(String partner) {
this.partner = partner;
return this;
}
/**
* The partner field indicates the unique ID of a data integration partner. The dropdown list of this field displays partner IDs for the past thirty days. It must be used together with \"project\" field to uniquely identify a data integration target. For example, if a continuous AQuA session is to retrieve data incrementally for a Salesforce.com Org 00170000011K3Ub, you can use partner as \"Salesforce\", and \"project\" as \"00170000011K3Ub.\" This field is required only if you are using AQuA in stateful mode. Otherwise, if you are using AQuA in stateless mode, partner field can be null. **Note**: Zuora highly recommends you use the stateless mode instead of the stateful mode to extract bulk data. See <a href=\"https://knowledgecenter.zuora.com/Zuora_Central_Platform/API/AB_Aggregate_Query_API/Bulk_data__extraction_from_Zuora_using_AQuA\" target=\"_blank\">Bulk data extraction from Zuora using AQuA</a> for best practices. **Note**: Submit a request at <a href=\"http://support.zuora.com\" target=\"_blank\">Zuora Global Support</a> to obtain a partner ID.
* @return partner
*/
@javax.annotation.Nullable
public String getPartner() {
return partner;
}
public void setPartner(String partner) {
this.partner = partner;
}
public CreateBatchQueryJobRequest project(String project) {
this.project = project;
return this;
}
/**
* The project field contains the unique ID of a data integration project for a particular partner. The dropdown list of this field displays project IDs for the past thirty days. This field must be used together with partner field to uniquely identify a data integration target. This field is required only if you are using AQuA in stateful mode. Otherwise, if you are using AQuA in stateless mode, partner field can be null.
* @return project
*/
@javax.annotation.Nullable
public String getProject() {
return project;
}
public void setProject(String project) {
this.project = project;
}
public CreateBatchQueryJobRequest queries(List queries) {
this.queries = queries;
return this;
}
public CreateBatchQueryJobRequest addQueriesItem(CreateBatchQueryRequest queriesItem) {
if (this.queries == null) {
this.queries = new ArrayList<>();
}
this.queries.add(queriesItem);
return this;
}
/**
* A JSON array object that contains a list of batch objects.
* @return queries
*/
@javax.annotation.Nullable
public List getQueries() {
return queries;
}
public void setQueries(List queries) {
this.queries = queries;
}
public CreateBatchQueryJobRequest useQueryLabels(Boolean useQueryLabels) {
this.useQueryLabels = useQueryLabels;
return this;
}
/**
* When this optional flag is set to `true` the request will use object and field API names for the CSV header output instead of the field labels. Data integration projects should set `useQueryLabels` to `true` so that API names remain the same. By default `useQueryLabels` is `false`, so that output CSV headers display the more user-friendly object and field labels.
* @return useQueryLabels
*/
@javax.annotation.Nullable
public Boolean getUseQueryLabels() {
return useQueryLabels;
}
public void setUseQueryLabels(Boolean useQueryLabels) {
this.useQueryLabels = useQueryLabels;
}
public CreateBatchQueryJobRequest version(Float version) {
this.version = version;
return this;
}
/**
* The API version you want to use. The supported versions are as follows: - `1.1`. It supports both modes - `1.0`. Default. It supports stateless modes only. See <a href=\"https://knowledgecenter.zuora.com/Zuora_Central_Platform/API/AB_Aggregate_Query_API/BA_Stateless_and_Stateful_Modes\" target=\"_blank\">Stateless and stateful modes</a> for more information.
* @return version
*/
@javax.annotation.Nullable
public Float getVersion() {
return version;
}
public void setVersion(Float version) {
this.version = version;
}
/**
* A container for additional, undeclared properties.
* This is a holder for any undeclared properties as specified with
* the 'additionalProperties' keyword in the OAS document.
*/
private Map additionalProperties;
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the CreateBatchQueryJobRequest instance itself
*/
public CreateBatchQueryJobRequest putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
this.additionalProperties = new HashMap();
}
this.additionalProperties.put(key, value);
return this;
}
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map getAdditionalProperties() {
return additionalProperties;
}
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
return null;
}
return this.additionalProperties.get(key);
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CreateBatchQueryJobRequest createBatchQueryJobRequest = (CreateBatchQueryJobRequest) o;
return Objects.equals(this.dateTimeUtc, createBatchQueryJobRequest.dateTimeUtc) &&
Objects.equals(this.format, createBatchQueryJobRequest.format) &&
Objects.equals(this.name, createBatchQueryJobRequest.name) &&
Objects.equals(this.notifyUrl, createBatchQueryJobRequest.notifyUrl) &&
Objects.equals(this.nullReplacement, createBatchQueryJobRequest.nullReplacement) &&
Objects.equals(this.offset, createBatchQueryJobRequest.offset) &&
Objects.equals(this.partner, createBatchQueryJobRequest.partner) &&
Objects.equals(this.project, createBatchQueryJobRequest.project) &&
Objects.equals(this.queries, createBatchQueryJobRequest.queries) &&
Objects.equals(this.useQueryLabels, createBatchQueryJobRequest.useQueryLabels) &&
Objects.equals(this.version, createBatchQueryJobRequest.version)&&
Objects.equals(this.additionalProperties, createBatchQueryJobRequest.additionalProperties);
}
@Override
public int hashCode() {
return Objects.hash(dateTimeUtc, format, name, notifyUrl, nullReplacement, offset, partner, project, queries, useQueryLabels, version, additionalProperties);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CreateBatchQueryJobRequest {\n");
sb.append(" dateTimeUtc: ").append(toIndentedString(dateTimeUtc)).append("\n");
sb.append(" format: ").append(toIndentedString(format)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" notifyUrl: ").append(toIndentedString(notifyUrl)).append("\n");
sb.append(" nullReplacement: ").append(toIndentedString(nullReplacement)).append("\n");
sb.append(" offset: ").append(toIndentedString(offset)).append("\n");
sb.append(" partner: ").append(toIndentedString(partner)).append("\n");
sb.append(" project: ").append(toIndentedString(project)).append("\n");
sb.append(" queries: ").append(toIndentedString(queries)).append("\n");
sb.append(" useQueryLabels: ").append(toIndentedString(useQueryLabels)).append("\n");
sb.append(" version: ").append(toIndentedString(version)).append("\n");
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 ");
}
public static HashSet openapiFields;
public static HashSet openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet();
openapiFields.add("dateTimeUtc");
openapiFields.add("format");
openapiFields.add("name");
openapiFields.add("notifyUrl");
openapiFields.add("nullReplacement");
openapiFields.add("offset");
openapiFields.add("partner");
openapiFields.add("project");
openapiFields.add("queries");
openapiFields.add("useQueryLabels");
openapiFields.add("version");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet();
}
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to CreateBatchQueryJobRequest
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
if (!CreateBatchQueryJobRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
throw new IllegalArgumentException(String.format("The required field(s) %s in CreateBatchQueryJobRequest is not found in the empty JSON string", CreateBatchQueryJobRequest.openapiRequiredFields.toString()));
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
if ((jsonObj.get("format") != null && !jsonObj.get("format").isJsonNull()) && !jsonObj.get("format").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `format` to be a primitive type in the JSON string but got `%s`", jsonObj.get("format").toString()));
}
// validate the optional field `format`
if (jsonObj.get("format") != null && !jsonObj.get("format").isJsonNull()) {
BatchQueryFormat.validateJsonElement(jsonObj.get("format"));
}
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
}
if ((jsonObj.get("notifyUrl") != null && !jsonObj.get("notifyUrl").isJsonNull()) && !jsonObj.get("notifyUrl").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `notifyUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("notifyUrl").toString()));
}
if ((jsonObj.get("nullReplacement") != null && !jsonObj.get("nullReplacement").isJsonNull()) && !jsonObj.get("nullReplacement").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `nullReplacement` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nullReplacement").toString()));
}
if ((jsonObj.get("partner") != null && !jsonObj.get("partner").isJsonNull()) && !jsonObj.get("partner").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `partner` to be a primitive type in the JSON string but got `%s`", jsonObj.get("partner").toString()));
}
if ((jsonObj.get("project") != null && !jsonObj.get("project").isJsonNull()) && !jsonObj.get("project").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `project` to be a primitive type in the JSON string but got `%s`", jsonObj.get("project").toString()));
}
if (jsonObj.get("queries") != null && !jsonObj.get("queries").isJsonNull()) {
JsonArray jsonArrayqueries = jsonObj.getAsJsonArray("queries");
if (jsonArrayqueries != null) {
// ensure the json data is an array
if (!jsonObj.get("queries").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `queries` to be an array in the JSON string but got `%s`", jsonObj.get("queries").toString()));
}
// validate the optional field `queries` (array)
for (int i = 0; i < jsonArrayqueries.size(); i++) {
CreateBatchQueryRequest.validateJsonElement(jsonArrayqueries.get(i));
};
}
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public TypeAdapter create(Gson gson, TypeToken type) {
if (!CreateBatchQueryJobRequest.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'CreateBatchQueryJobRequest' and its subtypes
}
final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(CreateBatchQueryJobRequest.class));
return (TypeAdapter) new TypeAdapter() {
@Override
public void write(JsonWriter out, CreateBatchQueryJobRequest value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
obj.remove("additionalProperties");
// support null values
out.beginObject();
Iterator iterator = obj.entrySet().iterator();
while(iterator.hasNext()) {
Map.Entry e = (Map.Entry) iterator.next();
out.name((String)e.getKey());
elementAdapter.write(out, e.getValue());
}
// end
// serialize additional properties
if (value.getAdditionalProperties() != null) {
// support null values
boolean oldSerializeNulls = out.getSerializeNulls();
out.setSerializeNulls(true); //force serialize
// end
for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
if (entry.getValue() instanceof String)
obj.addProperty(entry.getKey(), (String) entry.getValue());
else if (entry.getValue() instanceof Number)
obj.addProperty(entry.getKey(), (Number) entry.getValue());
else if (entry.getValue() instanceof Boolean)
obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
else if (entry.getValue() instanceof Character)
obj.addProperty(entry.getKey(), (Character) entry.getValue());
else if (entry.getValue() == null)
obj.add(entry.getKey(), null);
else {
JsonElement jsonElement = gson.toJsonTree(entry.getValue());
if (jsonElement.isJsonArray()) {
obj.add(entry.getKey(), jsonElement.getAsJsonArray());
} else {
obj.add(entry.getKey(), jsonElement.getAsJsonObject());
}
}
out.name((String)entry.getKey());
elementAdapter.write(out, obj.get(entry.getKey()));
}
out.setSerializeNulls(oldSerializeNulls); //restore
}
out.endObject();
}
@Override
public CreateBatchQueryJobRequest read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
JsonObject jsonObj = jsonElement.getAsJsonObject();
// store additional fields in the deserialized instance
CreateBatchQueryJobRequest instance = thisAdapter.fromJsonTree(jsonObj);
for (Map.Entry entry : jsonObj.entrySet()) {
if (!openapiFields.contains(entry.getKey())) {
if (entry.getValue().isJsonPrimitive()) { // primitive type
if (entry.getValue().getAsJsonPrimitive().isString())
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
else if (entry.getValue().getAsJsonPrimitive().isNumber())
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
else if (entry.getValue().getAsJsonPrimitive().isBoolean())
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}
return instance;
}
}.nullSafe();
}
}
/**
* Create an instance of CreateBatchQueryJobRequest given an JSON string
*
* @param jsonString JSON string
* @return An instance of CreateBatchQueryJobRequest
* @throws IOException if the JSON string is invalid with respect to CreateBatchQueryJobRequest
*/
public static CreateBatchQueryJobRequest fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, CreateBatchQueryJobRequest.class);
}
/**
* Convert an instance of CreateBatchQueryJobRequest to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy