
com.vendasta.sales.v1.internal.GetAutoAssignConfigResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sales.v1 Show documentation
Show all versions of sales.v1 Show documentation
Java SDK for service sales
The newest version!
package com.vendasta.sales.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 org.apache.commons.lang3.StringUtils;
import com.vendasta.sales.v1.generated.ApiProto;
/**
*
**/
public final class GetAutoAssignConfigResponse {
private final String partnerId;
private final String marketId;
private final List rules;
private GetAutoAssignConfigResponse (
final String partnerId,
final String marketId,
final List rules)
{
this.partnerId = partnerId;
this.marketId = marketId;
this.rules = rules;
}
/**
* The unique partner ID.
* @return The final value of partnerId on the object
**/
public String getPartnerId() {
return this.partnerId;
}
/**
* The unique market ID.
* @return The final value of marketId on the object
**/
public String getMarketId() {
return this.marketId;
}
/**
* The rules the define which accounts get assigned to which salespeople.
* @return The final value of rules on the object
**/
public List getRules() {
return this.rules;
}
public static class Builder {
private String partnerId;
private String marketId;
private List rules;
public Builder() {
this.partnerId = "";
this.marketId = "";
this.rules = null;
}
/**
* Adds a value to the builder for partnerId
* @param partnerId Value to assign to the mutable Builder
* @return The Builder instance so that call chaining works
**/
public Builder setPartnerId(String partnerId) {
this.partnerId = partnerId;
return this;
}
/**
* Adds a value to the builder for marketId
* @param marketId Value to assign to the mutable Builder
* @return The Builder instance so that call chaining works
**/
public Builder setMarketId(String marketId) {
this.marketId = marketId;
return this;
}
/**
* Adds a value to the builder for rules
* @param rules Value to assign to the mutable Builder
* @return The Builder instance so that call chaining works
**/
public Builder setRules(List rules) {
this.rules = rules;
return this;
}
/**
* Takes the configuration in the mutable Builder and uses it to instantiate a final instance
* of the GetAutoAssignConfigResponse class
* @return The instantiated final GetAutoAssignConfigResponse
**/
public GetAutoAssignConfigResponse build() {
return new GetAutoAssignConfigResponse(
this.partnerId,
this.marketId,
this.rules);
}
}
/**
* Returns a Builder for GetAutoAssignConfigResponse, which is a mutable representation of the object. Once the
* client has built up an object they can then create an immutable GetAutoAssignConfigResponse 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 GetAutoAssignConfigResponse instance
**/
public String toString() {
String result = "GetAutoAssignConfigResponse\n";
result += "-> partnerId: (String)"
+ StringUtils.join("\n ", Arrays.asList(String.valueOf(this.partnerId).split("\n"))) + "\n";
result += "-> marketId: (String)"
+ StringUtils.join("\n ", Arrays.asList(String.valueOf(this.marketId).split("\n"))) + "\n";
result += "-> rules: (List)"
+ StringUtils.join("\n ", Arrays.asList(String.valueOf(this.rules).split("\n"))) + "\n";
return result;
}
/**
* Allows for simple conversion between the low-level generated protobuf object to
* GetAutoAssignConfigResponse, which is much more usable.
* @return An instance of GetAutoAssignConfigResponse representing the input proto object
**/
public static GetAutoAssignConfigResponse fromProto(ApiProto.GetAutoAssignConfigResponse proto) {
GetAutoAssignConfigResponse out = null;
if (proto != null) {
GetAutoAssignConfigResponse.Builder outBuilder = GetAutoAssignConfigResponse.newBuilder()
.setPartnerId(proto.getPartnerId())
.setMarketId(proto.getMarketId())
.setRules(AutoAssignRule.fromProtos(proto.getRulesList()));
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 GetAutoAssignConfigResponse instances representing the input proto objects
**/
public static List fromProtos(List protos) {
List out = new ArrayList();
for(ApiProto.GetAutoAssignConfigResponse proto : protos) {
out.add(GetAutoAssignConfigResponse.fromProto(proto));
}
return out;
}
/**
* Allows for simple conversion of an object to the low-level generated protobuf object.
* @return An instance of ApiProto.GetAutoAssignConfigResponse which is a proto object ready for wire transmission
**/
public ApiProto.GetAutoAssignConfigResponse toProto() {
GetAutoAssignConfigResponse obj = this;
ApiProto.GetAutoAssignConfigResponse.Builder outBuilder = ApiProto.GetAutoAssignConfigResponse.newBuilder();
outBuilder.setPartnerId(obj.getPartnerId());
outBuilder.setMarketId(obj.getMarketId());
outBuilder.addAllRules(AutoAssignRule.toProtos(obj.getRules()));
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.GetAutoAssignConfigResponse instances representing the input objects.
*/
public static List toProtos(List objects) {
List out = new ArrayList();
if(objects != null) {
for (GetAutoAssignConfigResponse obj : objects) {
out.add(obj!=null?obj.toProto():null);
}
}
return out;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy