
com.vendasta.sales.v1.internal.GetUserActionsRequest 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.UserActionsProto;
/**
*
**/
public final class GetUserActionsRequest {
private final String accountGroupId;
private final String cursor;
private final long pageSize;
private GetUserActionsRequest (
final String accountGroupId,
final String cursor,
final long pageSize)
{
this.accountGroupId = accountGroupId;
this.cursor = cursor;
this.pageSize = pageSize;
}
/**
* The account group that the action is associated with
* @return The final value of accountGroupId on the object
**/
public String getAccountGroupId() {
return this.accountGroupId;
}
/**
* Cursor allows paging of results, the next_cursor returned by the last response is expected.
* @return The final value of cursor on the object
**/
public String getCursor() {
return this.cursor;
}
/**
* The number of results to return.
* @return The final value of pageSize on the object
**/
public long getPageSize() {
return this.pageSize;
}
public static class Builder {
private String accountGroupId;
private String cursor;
private long pageSize;
public Builder() {
this.accountGroupId = "";
this.cursor = "";
this.pageSize = 0;
}
/**
* Adds a value to the builder for accountGroupId
* @param accountGroupId Value to assign to the mutable Builder
* @return The Builder instance so that call chaining works
**/
public Builder setAccountGroupId(String accountGroupId) {
this.accountGroupId = accountGroupId;
return this;
}
/**
* Adds a value to the builder for cursor
* @param cursor Value to assign to the mutable Builder
* @return The Builder instance so that call chaining works
**/
public Builder setCursor(String cursor) {
this.cursor = cursor;
return this;
}
/**
* Adds a value to the builder for pageSize
* @param pageSize Value to assign to the mutable Builder
* @return The Builder instance so that call chaining works
**/
public Builder setPageSize(long pageSize) {
this.pageSize = pageSize;
return this;
}
/**
* Takes the configuration in the mutable Builder and uses it to instantiate a final instance
* of the GetUserActionsRequest class
* @return The instantiated final GetUserActionsRequest
**/
public GetUserActionsRequest build() {
return new GetUserActionsRequest(
this.accountGroupId,
this.cursor,
this.pageSize);
}
}
/**
* Returns a Builder for GetUserActionsRequest, which is a mutable representation of the object. Once the
* client has built up an object they can then create an immutable GetUserActionsRequest 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 GetUserActionsRequest instance
**/
public String toString() {
String result = "GetUserActionsRequest\n";
result += "-> accountGroupId: (String)"
+ StringUtils.join("\n ", Arrays.asList(String.valueOf(this.accountGroupId).split("\n"))) + "\n";
result += "-> cursor: (String)"
+ StringUtils.join("\n ", Arrays.asList(String.valueOf(this.cursor).split("\n"))) + "\n";
result += "-> pageSize: (long)"
+ StringUtils.join("\n ", Arrays.asList(String.valueOf(this.pageSize).split("\n"))) + "\n";
return result;
}
/**
* Allows for simple conversion between the low-level generated protobuf object to
* GetUserActionsRequest, which is much more usable.
* @return An instance of GetUserActionsRequest representing the input proto object
**/
public static GetUserActionsRequest fromProto(UserActionsProto.GetUserActionsRequest proto) {
GetUserActionsRequest out = null;
if (proto != null) {
GetUserActionsRequest.Builder outBuilder = GetUserActionsRequest.newBuilder()
.setAccountGroupId(proto.getAccountGroupId())
.setCursor(proto.getCursor())
.setPageSize(proto.getPageSize());
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 GetUserActionsRequest instances representing the input proto objects
**/
public static List fromProtos(List protos) {
List out = new ArrayList();
for(UserActionsProto.GetUserActionsRequest proto : protos) {
out.add(GetUserActionsRequest.fromProto(proto));
}
return out;
}
/**
* Allows for simple conversion of an object to the low-level generated protobuf object.
* @return An instance of UserActionsProto.GetUserActionsRequest which is a proto object ready for wire transmission
**/
public UserActionsProto.GetUserActionsRequest toProto() {
GetUserActionsRequest obj = this;
UserActionsProto.GetUserActionsRequest.Builder outBuilder = UserActionsProto.GetUserActionsRequest.newBuilder();
outBuilder.setAccountGroupId(obj.getAccountGroupId());
outBuilder.setCursor(obj.getCursor());
outBuilder.setPageSize(obj.getPageSize());
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 UserActionsProto.GetUserActionsRequest instances representing the input objects.
*/
public static List toProtos(List objects) {
List out = new ArrayList();
if(objects != null) {
for (GetUserActionsRequest obj : objects) {
out.add(obj!=null?obj.toProto():null);
}
}
return out;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy