
com.vendasta.accountgroup.v1.internal.RichData Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of accountgroup.v1 Show documentation
Show all versions of accountgroup.v1 Show documentation
Java SDK for service account-group
The newest version!
package com.vendasta.accountgroup.v1.internal;
import java.util.List;
import java.util.ArrayList;
import java.util.Date;
import java.util.Map;
import java.util.HashMap;
import java.util.Collections;
import java.util.Arrays;
import java.time.Duration;
import org.apache.commons.lang3.StringUtils;
import com.vendasta.accountgroup.v1.generated.ApiProto;
/**
*
**/
public final class RichData {
/**
*
**/
public enum PaymentMethods {
AMERICAN_EXPRESS(0),
ANDROID_PAY(1),
APPLE_PAY(2),
CASH(3),
CHECK(4),
DEBIT(5),
DINERS_CLUB(6),
DISCOVER(7),
MASTERCARD(8),
PAYPAL(9),
SAMSUNG_PAY(10),
STORE_CARD(11),
TRAVELERS_CHECK(12),
VISA(13),
CCS(14),
SODEXO(15),
GOPAY(16),
V_PAY(17),
FINANCING(18),
INVOICE(19),
PAYSEC(20),
BITCOIN(21);
private static final Map protoTypeMap;
static {
Map aMap;
aMap = new HashMap();
aMap.put(ApiProto.RichData.PaymentMethods.AMERICAN_EXPRESS, RichData.PaymentMethods.AMERICAN_EXPRESS);
aMap.put(ApiProto.RichData.PaymentMethods.ANDROID_PAY, RichData.PaymentMethods.ANDROID_PAY);
aMap.put(ApiProto.RichData.PaymentMethods.APPLE_PAY, RichData.PaymentMethods.APPLE_PAY);
aMap.put(ApiProto.RichData.PaymentMethods.CASH, RichData.PaymentMethods.CASH);
aMap.put(ApiProto.RichData.PaymentMethods.CHECK, RichData.PaymentMethods.CHECK);
aMap.put(ApiProto.RichData.PaymentMethods.DEBIT, RichData.PaymentMethods.DEBIT);
aMap.put(ApiProto.RichData.PaymentMethods.DINERS_CLUB, RichData.PaymentMethods.DINERS_CLUB);
aMap.put(ApiProto.RichData.PaymentMethods.DISCOVER, RichData.PaymentMethods.DISCOVER);
aMap.put(ApiProto.RichData.PaymentMethods.MASTERCARD, RichData.PaymentMethods.MASTERCARD);
aMap.put(ApiProto.RichData.PaymentMethods.PAYPAL, RichData.PaymentMethods.PAYPAL);
aMap.put(ApiProto.RichData.PaymentMethods.SAMSUNG_PAY, RichData.PaymentMethods.SAMSUNG_PAY);
aMap.put(ApiProto.RichData.PaymentMethods.STORE_CARD, RichData.PaymentMethods.STORE_CARD);
aMap.put(ApiProto.RichData.PaymentMethods.TRAVELERS_CHECK, RichData.PaymentMethods.TRAVELERS_CHECK);
aMap.put(ApiProto.RichData.PaymentMethods.VISA, RichData.PaymentMethods.VISA);
aMap.put(ApiProto.RichData.PaymentMethods.CCS, RichData.PaymentMethods.CCS);
aMap.put(ApiProto.RichData.PaymentMethods.SODEXO, RichData.PaymentMethods.SODEXO);
aMap.put(ApiProto.RichData.PaymentMethods.GOPAY, RichData.PaymentMethods.GOPAY);
aMap.put(ApiProto.RichData.PaymentMethods.V_PAY, RichData.PaymentMethods.V_PAY);
aMap.put(ApiProto.RichData.PaymentMethods.FINANCING, RichData.PaymentMethods.FINANCING);
aMap.put(ApiProto.RichData.PaymentMethods.INVOICE, RichData.PaymentMethods.INVOICE);
aMap.put(ApiProto.RichData.PaymentMethods.PAYSEC, RichData.PaymentMethods.PAYSEC);
aMap.put(ApiProto.RichData.PaymentMethods.BITCOIN, RichData.PaymentMethods.BITCOIN);
protoTypeMap = Collections.unmodifiableMap(aMap);
}
private static final Map javaTypeMap;
static {
Map aMap;
aMap = new HashMap();
aMap.put(RichData.PaymentMethods.AMERICAN_EXPRESS, ApiProto.RichData.PaymentMethods.AMERICAN_EXPRESS);
aMap.put(RichData.PaymentMethods.ANDROID_PAY, ApiProto.RichData.PaymentMethods.ANDROID_PAY);
aMap.put(RichData.PaymentMethods.APPLE_PAY, ApiProto.RichData.PaymentMethods.APPLE_PAY);
aMap.put(RichData.PaymentMethods.CASH, ApiProto.RichData.PaymentMethods.CASH);
aMap.put(RichData.PaymentMethods.CHECK, ApiProto.RichData.PaymentMethods.CHECK);
aMap.put(RichData.PaymentMethods.DEBIT, ApiProto.RichData.PaymentMethods.DEBIT);
aMap.put(RichData.PaymentMethods.DINERS_CLUB, ApiProto.RichData.PaymentMethods.DINERS_CLUB);
aMap.put(RichData.PaymentMethods.DISCOVER, ApiProto.RichData.PaymentMethods.DISCOVER);
aMap.put(RichData.PaymentMethods.MASTERCARD, ApiProto.RichData.PaymentMethods.MASTERCARD);
aMap.put(RichData.PaymentMethods.PAYPAL, ApiProto.RichData.PaymentMethods.PAYPAL);
aMap.put(RichData.PaymentMethods.SAMSUNG_PAY, ApiProto.RichData.PaymentMethods.SAMSUNG_PAY);
aMap.put(RichData.PaymentMethods.STORE_CARD, ApiProto.RichData.PaymentMethods.STORE_CARD);
aMap.put(RichData.PaymentMethods.TRAVELERS_CHECK, ApiProto.RichData.PaymentMethods.TRAVELERS_CHECK);
aMap.put(RichData.PaymentMethods.VISA, ApiProto.RichData.PaymentMethods.VISA);
aMap.put(RichData.PaymentMethods.CCS, ApiProto.RichData.PaymentMethods.CCS);
aMap.put(RichData.PaymentMethods.SODEXO, ApiProto.RichData.PaymentMethods.SODEXO);
aMap.put(RichData.PaymentMethods.GOPAY, ApiProto.RichData.PaymentMethods.GOPAY);
aMap.put(RichData.PaymentMethods.V_PAY, ApiProto.RichData.PaymentMethods.V_PAY);
aMap.put(RichData.PaymentMethods.FINANCING, ApiProto.RichData.PaymentMethods.FINANCING);
aMap.put(RichData.PaymentMethods.INVOICE, ApiProto.RichData.PaymentMethods.INVOICE);
aMap.put(RichData.PaymentMethods.PAYSEC, ApiProto.RichData.PaymentMethods.PAYSEC);
aMap.put(RichData.PaymentMethods.BITCOIN, ApiProto.RichData.PaymentMethods.BITCOIN);
javaTypeMap = Collections.unmodifiableMap(aMap);
}
private int value;
private PaymentMethods(int i) {
value = i;
}
public int getValue() {
return value;
}
public static PaymentMethods fromProto(ApiProto.RichData.PaymentMethods proto) {
return protoTypeMap.get(proto);
}
public static List fromProtos(List protos) {
List result = new ArrayList();
for(ApiProto.RichData.PaymentMethods proto : protos) {
result.add(PaymentMethods.fromProto(proto));
}
return result;
}
public ApiProto.RichData.PaymentMethods toProto() {
return javaTypeMap.get(this);
}
public static List toProtos(List objects) {
List result = new ArrayList();
for(PaymentMethods obj : objects) {
result.add(obj.toProto());
}
return result;
}
}
private final String tollFreeNumber;
private final String description;
private final String shortDescription;
private final List servicesOffered;
private final List brandsCarried;
private final String landmark;
private final List paymentMethods;
private final List customFields;
private final HealthCareProfessionalInformation healthCareProfessionalInformation;
private final List inferredAttributes;
private final ServiceAvailability serviceAvailability;
private RichData (
final String tollFreeNumber,
final String description,
final String shortDescription,
final List servicesOffered,
final List brandsCarried,
final String landmark,
final List paymentMethods,
final List customFields,
final HealthCareProfessionalInformation healthCareProfessionalInformation,
final List inferredAttributes,
final ServiceAvailability serviceAvailability)
{
this.tollFreeNumber = tollFreeNumber;
this.description = description;
this.shortDescription = shortDescription;
this.servicesOffered = servicesOffered;
this.brandsCarried = brandsCarried;
this.landmark = landmark;
this.paymentMethods = paymentMethods;
this.customFields = customFields;
this.healthCareProfessionalInformation = healthCareProfessionalInformation;
this.inferredAttributes = inferredAttributes;
this.serviceAvailability = serviceAvailability;
}
/**
*
* @return The final value of tollFreeNumber on the object
**/
public String getTollFreeNumber() {
return this.tollFreeNumber;
}
/**
*
* @return The final value of description on the object
**/
public String getDescription() {
return this.description;
}
/**
*
* @return The final value of shortDescription on the object
**/
public String getShortDescription() {
return this.shortDescription;
}
/**
*
* @return The final value of servicesOffered on the object
**/
public List getServicesOffered() {
return this.servicesOffered;
}
/**
*
* @return The final value of brandsCarried on the object
**/
public List getBrandsCarried() {
return this.brandsCarried;
}
/**
*
* @return The final value of landmark on the object
**/
public String getLandmark() {
return this.landmark;
}
/**
*
* @return The final value of paymentMethods on the object
**/
public List getPaymentMethods() {
return this.paymentMethods;
}
/**
*
* @return The final value of customFields on the object
**/
public List getCustomFields() {
return this.customFields;
}
/**
*
* @return The final value of healthCareProfessionalInformation on the object
**/
public HealthCareProfessionalInformation getHealthCareProfessionalInformation() {
return this.healthCareProfessionalInformation;
}
/**
*
* @return The final value of inferredAttributes on the object
**/
public List getInferredAttributes() {
return this.inferredAttributes;
}
/**
*
* @return The final value of serviceAvailability on the object
**/
public ServiceAvailability getServiceAvailability() {
return this.serviceAvailability;
}
public static class Builder {
private String tollFreeNumber;
private String description;
private String shortDescription;
private List servicesOffered;
private List brandsCarried;
private String landmark;
private List paymentMethods;
private List customFields;
private HealthCareProfessionalInformation healthCareProfessionalInformation;
private List inferredAttributes;
private ServiceAvailability serviceAvailability;
public Builder() {
this.tollFreeNumber = "";
this.description = "";
this.shortDescription = "";
this.servicesOffered = new ArrayList();
this.brandsCarried = new ArrayList();
this.landmark = "";
this.paymentMethods = null;
this.customFields = null;
this.healthCareProfessionalInformation = null;
this.inferredAttributes = new ArrayList();
this.serviceAvailability = null;
}
/**
* Adds a value to the builder for tollFreeNumber
* @param tollFreeNumber Value to assign to the mutable Builder
* @return The Builder instance so that call chaining works
**/
public Builder setTollFreeNumber(String tollFreeNumber) {
this.tollFreeNumber = tollFreeNumber;
return this;
}
/**
* Adds a value to the builder for description
* @param description Value to assign to the mutable Builder
* @return The Builder instance so that call chaining works
**/
public Builder setDescription(String description) {
this.description = description;
return this;
}
/**
* Adds a value to the builder for shortDescription
* @param shortDescription Value to assign to the mutable Builder
* @return The Builder instance so that call chaining works
**/
public Builder setShortDescription(String shortDescription) {
this.shortDescription = shortDescription;
return this;
}
/**
* Adds a value to the builder for servicesOffered
* @param servicesOffered Value to assign to the mutable Builder
* @return The Builder instance so that call chaining works
**/
public Builder setServicesOffered(List servicesOffered) {
this.servicesOffered = servicesOffered;
return this;
}
/**
* Adds a value to the builder for brandsCarried
* @param brandsCarried Value to assign to the mutable Builder
* @return The Builder instance so that call chaining works
**/
public Builder setBrandsCarried(List brandsCarried) {
this.brandsCarried = brandsCarried;
return this;
}
/**
* Adds a value to the builder for landmark
* @param landmark Value to assign to the mutable Builder
* @return The Builder instance so that call chaining works
**/
public Builder setLandmark(String landmark) {
this.landmark = landmark;
return this;
}
/**
* Adds a value to the builder for paymentMethods
* @param paymentMethods Value to assign to the mutable Builder
* @return The Builder instance so that call chaining works
**/
public Builder setPaymentMethods(List paymentMethods) {
this.paymentMethods = paymentMethods;
return this;
}
/**
* Adds a value to the builder for customFields
* @param customFields Value to assign to the mutable Builder
* @return The Builder instance so that call chaining works
**/
public Builder setCustomFields(List customFields) {
this.customFields = customFields;
return this;
}
/**
* Adds a value to the builder for healthCareProfessionalInformation
* @param healthCareProfessionalInformation Value to assign to the mutable Builder
* @return The Builder instance so that call chaining works
**/
public Builder setHealthCareProfessionalInformation(HealthCareProfessionalInformation healthCareProfessionalInformation) {
this.healthCareProfessionalInformation = healthCareProfessionalInformation;
return this;
}
/**
* Adds a value to the builder for inferredAttributes
* @param inferredAttributes Value to assign to the mutable Builder
* @return The Builder instance so that call chaining works
**/
public Builder setInferredAttributes(List inferredAttributes) {
this.inferredAttributes = inferredAttributes;
return this;
}
/**
* Adds a value to the builder for serviceAvailability
* @param serviceAvailability Value to assign to the mutable Builder
* @return The Builder instance so that call chaining works
**/
public Builder setServiceAvailability(ServiceAvailability serviceAvailability) {
this.serviceAvailability = serviceAvailability;
return this;
}
/**
* Takes the configuration in the mutable Builder and uses it to instantiate a final instance
* of the RichData class
* @return The instantiated final RichData
**/
public RichData build() {
return new RichData(
this.tollFreeNumber,
this.description,
this.shortDescription,
this.servicesOffered,
this.brandsCarried,
this.landmark,
this.paymentMethods,
this.customFields,
this.healthCareProfessionalInformation,
this.inferredAttributes,
this.serviceAvailability);
}
}
/**
* Returns a Builder for RichData, which is a mutable representation of the object. Once the
* client has built up an object they can then create an immutable RichData object using the
* build function.
* @return A fresh Builder instance with no values set
**/
public static Builder newBuilder() {
return new Builder();
}
/**
* Provides a human-readable representation of this object. Useful for debugging.
* @return A string representation of the RichData instance
**/
public String toString() {
String result = "RichData\n";
result += "-> tollFreeNumber: (String)"
+ StringUtils.join("\n ", Arrays.asList(String.valueOf(this.tollFreeNumber).split("\n"))) + "\n";
result += "-> description: (String)"
+ StringUtils.join("\n ", Arrays.asList(String.valueOf(this.description).split("\n"))) + "\n";
result += "-> shortDescription: (String)"
+ StringUtils.join("\n ", Arrays.asList(String.valueOf(this.shortDescription).split("\n"))) + "\n";
result += "-> servicesOffered: (List)"
+ StringUtils.join("\n ", Arrays.asList(String.valueOf(this.servicesOffered).split("\n"))) + "\n";
result += "-> brandsCarried: (List)"
+ StringUtils.join("\n ", Arrays.asList(String.valueOf(this.brandsCarried).split("\n"))) + "\n";
result += "-> landmark: (String)"
+ StringUtils.join("\n ", Arrays.asList(String.valueOf(this.landmark).split("\n"))) + "\n";
result += "-> paymentMethods: (List)"
+ StringUtils.join("\n ", Arrays.asList(String.valueOf(this.paymentMethods).split("\n"))) + "\n";
result += "-> customFields: (List)"
+ StringUtils.join("\n ", Arrays.asList(String.valueOf(this.customFields).split("\n"))) + "\n";
result += "-> healthCareProfessionalInformation: (HealthCareProfessionalInformation)"
+ StringUtils.join("\n ", Arrays.asList(String.valueOf(this.healthCareProfessionalInformation).split("\n"))) + "\n";
result += "-> inferredAttributes: (List)"
+ StringUtils.join("\n ", Arrays.asList(String.valueOf(this.inferredAttributes).split("\n"))) + "\n";
result += "-> serviceAvailability: (ServiceAvailability)"
+ StringUtils.join("\n ", Arrays.asList(String.valueOf(this.serviceAvailability).split("\n"))) + "\n";
return result;
}
/**
* Allows for simple conversion between the low-level generated protobuf object to
* RichData, which is much more usable.
* @return An instance of RichData representing the input proto object
**/
public static RichData fromProto(ApiProto.RichData proto) {
RichData out = null;
if (proto != null) {
RichData.Builder outBuilder = RichData.newBuilder()
.setTollFreeNumber(proto.getTollFreeNumber())
.setDescription(proto.getDescription())
.setShortDescription(proto.getShortDescription())
.setServicesOffered(proto.getServicesOfferedList())
.setBrandsCarried(proto.getBrandsCarriedList())
.setLandmark(proto.getLandmark())
.setPaymentMethods(RichData.PaymentMethods.fromProtos(proto.getPaymentMethodsList()))
.setCustomFields(CustomField.fromProtos(proto.getCustomFieldsList()))
.setHealthCareProfessionalInformation(HealthCareProfessionalInformation.fromProto(proto.getHealthCareProfessionalInformation()))
.setInferredAttributes(proto.getInferredAttributesList())
.setServiceAvailability(ServiceAvailability.fromProto(proto.getServiceAvailability()));
out = outBuilder.build();
}
return out;
}
/**
* Convenience method for handling lists of proto objects. It calls .fromProto on each one
* and returns a list of the converted results.
* @return A list of RichData instances representing the input proto objects
**/
public static List fromProtos(List protos) {
List out = new ArrayList();
for(ApiProto.RichData proto : protos) {
out.add(RichData.fromProto(proto));
}
return out;
}
/**
* Allows for simple conversion of an object to the low-level generated protobuf object.
* @return An instance of ApiProto.RichData which is a proto object ready for wire transmission
**/
public ApiProto.RichData toProto() {
RichData obj = this;
ApiProto.RichData.Builder outBuilder = ApiProto.RichData.newBuilder();
outBuilder.setTollFreeNumber(obj.getTollFreeNumber());
outBuilder.setDescription(obj.getDescription());
outBuilder.setShortDescription(obj.getShortDescription());
outBuilder.addAllServicesOffered(obj.getServicesOffered());
outBuilder.addAllBrandsCarried(obj.getBrandsCarried());
outBuilder.setLandmark(obj.getLandmark());
outBuilder.addAllPaymentMethods(RichData.PaymentMethods.toProtos(obj.getPaymentMethods()));
outBuilder.addAllCustomFields(CustomField.toProtos(obj.getCustomFields()));
if(obj.getHealthCareProfessionalInformation() != null){outBuilder.setHealthCareProfessionalInformation(obj.getHealthCareProfessionalInformation().toProto());}
outBuilder.addAllInferredAttributes(obj.getInferredAttributes());
if(obj.getServiceAvailability() != null){outBuilder.setServiceAvailability(obj.getServiceAvailability().toProto());}
return outBuilder.build();
}
/**
* Convenience method for handling lists of objects. It calls .toProto on each one and
* returns a list of the converted results.
* @return A list of ApiProto.RichData instances representing the input objects.
*/
public static List toProtos(List objects) {
List out = new ArrayList();
if(objects != null) {
for (RichData obj : objects) {
out.add(obj!=null?obj.toProto():null);
}
}
return out;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy