
com.vendasta.accountgroup.v1.internal.UpdateOperation 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;
/**
* Update operation allows updating a specific piece of the account gruop
**/
public final class UpdateOperation {
/**
*
**/
public static final class AccountGroupHealthUpdate {
private final double rating;
private final String reason;
private AccountGroupHealthUpdate (
final double rating,
final String reason)
{
this.rating = rating;
this.reason = reason;
}
/**
*
* @return The final value of rating on the object
**/
public double getRating() {
return this.rating;
}
/**
*
* @return The final value of reason on the object
**/
public String getReason() {
return this.reason;
}
public static class Builder {
private double rating;
private String reason;
public Builder() {
this.rating = 0;
this.reason = "";
}
/**
* Adds a value to the builder for rating
* @param rating Value to assign to the mutable Builder
* @return The Builder instance so that call chaining works
**/
public Builder setRating(double rating) {
this.rating = rating;
return this;
}
/**
* Adds a value to the builder for reason
* @param reason Value to assign to the mutable Builder
* @return The Builder instance so that call chaining works
**/
public Builder setReason(String reason) {
this.reason = reason;
return this;
}
/**
* Takes the configuration in the mutable Builder and uses it to instantiate a final instance
* of the AccountGroupHealthUpdate class
* @return The instantiated final AccountGroupHealthUpdate
**/
public AccountGroupHealthUpdate build() {
return new AccountGroupHealthUpdate(
this.rating,
this.reason);
}
}
/**
* Returns a Builder for AccountGroupHealthUpdate, which is a mutable representation of the object. Once the
* client has built up an object they can then create an immutable AccountGroupHealthUpdate 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 AccountGroupHealthUpdate instance
**/
public String toString() {
String result = "AccountGroupHealthUpdate\n";
result += "-> rating: (double)"
+ StringUtils.join("\n ", Arrays.asList(String.valueOf(this.rating).split("\n"))) + "\n";
result += "-> reason: (String)"
+ StringUtils.join("\n ", Arrays.asList(String.valueOf(this.reason).split("\n"))) + "\n";
return result;
}
/**
* Allows for simple conversion between the low-level generated protobuf object to
* AccountGroupHealthUpdate, which is much more usable.
* @return An instance of AccountGroupHealthUpdate representing the input proto object
**/
public static AccountGroupHealthUpdate fromProto(ApiProto.UpdateOperation.AccountGroupHealthUpdate proto) {
AccountGroupHealthUpdate out = null;
if (proto != null) {
AccountGroupHealthUpdate.Builder outBuilder = AccountGroupHealthUpdate.newBuilder()
.setRating(proto.getRating())
.setReason(proto.getReason());
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 AccountGroupHealthUpdate instances representing the input proto objects
**/
public static List fromProtos(List protos) {
List out = new ArrayList();
for(ApiProto.UpdateOperation.AccountGroupHealthUpdate proto : protos) {
out.add(AccountGroupHealthUpdate.fromProto(proto));
}
return out;
}
/**
* Allows for simple conversion of an object to the low-level generated protobuf object.
* @return An instance of ApiProto.UpdateOperation.AccountGroupHealthUpdate which is a proto object ready for wire transmission
**/
public ApiProto.UpdateOperation.AccountGroupHealthUpdate toProto() {
AccountGroupHealthUpdate obj = this;
ApiProto.UpdateOperation.AccountGroupHealthUpdate.Builder outBuilder = ApiProto.UpdateOperation.AccountGroupHealthUpdate.newBuilder();
outBuilder.setRating(obj.getRating());
outBuilder.setReason(obj.getReason());
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.UpdateOperation.AccountGroupHealthUpdate instances representing the input objects.
*/
public static List toProtos(List objects) {
List out = new ArrayList();
if(objects != null) {
for (AccountGroupHealthUpdate obj : objects) {
out.add(obj!=null?obj.toProto():null);
}
}
return out;
}
}
private final AccountGroupLocation accountGroupNap;
private final ListingSyncPro listingSyncProto;
private final AccountGroupExternalIdentifiers accountGroupExternalIdentifiers;
private final SocialURLs socialUrls;
private final HoursOfOperation hoursOfOperation;
private final ContactDetails contactDetails;
private final Snapshots snapshots;
private final LegacyProductDetails legacyProductDetails;
private final RichData richData;
private final Status status;
private final ActionListAppend actionListAppend;
private final ActionListModify actionListModify;
private final UpdateOperation.AccountGroupHealthUpdate health;
private final FieldMask fieldMask;
private UpdateOperation (
final AccountGroupLocation accountGroupNap,
final ListingSyncPro listingSyncProto,
final AccountGroupExternalIdentifiers accountGroupExternalIdentifiers,
final SocialURLs socialUrls,
final HoursOfOperation hoursOfOperation,
final ContactDetails contactDetails,
final Snapshots snapshots,
final LegacyProductDetails legacyProductDetails,
final RichData richData,
final Status status,
final ActionListAppend actionListAppend,
final ActionListModify actionListModify,
final UpdateOperation.AccountGroupHealthUpdate health,
final FieldMask fieldMask)
{
this.accountGroupNap = accountGroupNap;
this.listingSyncProto = listingSyncProto;
this.accountGroupExternalIdentifiers = accountGroupExternalIdentifiers;
this.socialUrls = socialUrls;
this.hoursOfOperation = hoursOfOperation;
this.contactDetails = contactDetails;
this.snapshots = snapshots;
this.legacyProductDetails = legacyProductDetails;
this.richData = richData;
this.status = status;
this.actionListAppend = actionListAppend;
this.actionListModify = actionListModify;
this.health = health;
this.fieldMask = fieldMask;
}
/**
*
* @return The final value of accountGroupNap on the object
**/
public AccountGroupLocation getAccountGroupNap() {
return this.accountGroupNap;
}
/**
*
* @return The final value of listingSyncProto on the object
**/
public ListingSyncPro getListingSyncProto() {
return this.listingSyncProto;
}
/**
*
* @return The final value of accountGroupExternalIdentifiers on the object
**/
public AccountGroupExternalIdentifiers getAccountGroupExternalIdentifiers() {
return this.accountGroupExternalIdentifiers;
}
/**
*
* @return The final value of socialUrls on the object
**/
public SocialURLs getSocialUrls() {
return this.socialUrls;
}
/**
*
* @return The final value of hoursOfOperation on the object
**/
public HoursOfOperation getHoursOfOperation() {
return this.hoursOfOperation;
}
/**
*
* @return The final value of contactDetails on the object
**/
public ContactDetails getContactDetails() {
return this.contactDetails;
}
/**
*
* @return The final value of snapshots on the object
**/
public Snapshots getSnapshots() {
return this.snapshots;
}
/**
*
* @return The final value of legacyProductDetails on the object
**/
public LegacyProductDetails getLegacyProductDetails() {
return this.legacyProductDetails;
}
/**
*
* @return The final value of richData on the object
**/
public RichData getRichData() {
return this.richData;
}
/**
*
* @return The final value of status on the object
**/
public Status getStatus() {
return this.status;
}
/**
* Deprecated: use action_list_modify instead
* @return The final value of actionListAppend on the object
**/
public ActionListAppend getActionListAppend() {
return this.actionListAppend;
}
/**
*
* @return The final value of actionListModify on the object
**/
public ActionListModify getActionListModify() {
return this.actionListModify;
}
/**
*
* @return The final value of health on the object
**/
public UpdateOperation.AccountGroupHealthUpdate getHealth() {
return this.health;
}
/**
*
* @return The final value of fieldMask on the object
**/
public FieldMask getFieldMask() {
return this.fieldMask;
}
public static class Builder {
private AccountGroupLocation accountGroupNap;
private ListingSyncPro listingSyncProto;
private AccountGroupExternalIdentifiers accountGroupExternalIdentifiers;
private SocialURLs socialUrls;
private HoursOfOperation hoursOfOperation;
private ContactDetails contactDetails;
private Snapshots snapshots;
private LegacyProductDetails legacyProductDetails;
private RichData richData;
private Status status;
private ActionListAppend actionListAppend;
private ActionListModify actionListModify;
private UpdateOperation.AccountGroupHealthUpdate health;
private FieldMask fieldMask;
public Builder() {
this.accountGroupNap = null;
this.listingSyncProto = null;
this.accountGroupExternalIdentifiers = null;
this.socialUrls = null;
this.hoursOfOperation = null;
this.contactDetails = null;
this.snapshots = null;
this.legacyProductDetails = null;
this.richData = null;
this.status = null;
this.actionListAppend = null;
this.actionListModify = null;
this.health = null;
this.fieldMask = null;
}
/**
* Adds a value to the builder for accountGroupNap
* @param accountGroupNap Value to assign to the mutable Builder
* @return The Builder instance so that call chaining works
**/
public Builder setAccountGroupNap(AccountGroupLocation accountGroupNap) {
this.accountGroupNap = accountGroupNap;
return this;
}
/**
* Adds a value to the builder for listingSyncProto
* @param listingSyncProto Value to assign to the mutable Builder
* @return The Builder instance so that call chaining works
**/
public Builder setListingSyncProto(ListingSyncPro listingSyncProto) {
this.listingSyncProto = listingSyncProto;
return this;
}
/**
* Adds a value to the builder for accountGroupExternalIdentifiers
* @param accountGroupExternalIdentifiers Value to assign to the mutable Builder
* @return The Builder instance so that call chaining works
**/
public Builder setAccountGroupExternalIdentifiers(AccountGroupExternalIdentifiers accountGroupExternalIdentifiers) {
this.accountGroupExternalIdentifiers = accountGroupExternalIdentifiers;
return this;
}
/**
* Adds a value to the builder for socialUrls
* @param socialUrls Value to assign to the mutable Builder
* @return The Builder instance so that call chaining works
**/
public Builder setSocialUrls(SocialURLs socialUrls) {
this.socialUrls = socialUrls;
return this;
}
/**
* Adds a value to the builder for hoursOfOperation
* @param hoursOfOperation Value to assign to the mutable Builder
* @return The Builder instance so that call chaining works
**/
public Builder setHoursOfOperation(HoursOfOperation hoursOfOperation) {
this.hoursOfOperation = hoursOfOperation;
return this;
}
/**
* Adds a value to the builder for contactDetails
* @param contactDetails Value to assign to the mutable Builder
* @return The Builder instance so that call chaining works
**/
public Builder setContactDetails(ContactDetails contactDetails) {
this.contactDetails = contactDetails;
return this;
}
/**
* Adds a value to the builder for snapshots
* @param snapshots Value to assign to the mutable Builder
* @return The Builder instance so that call chaining works
**/
public Builder setSnapshots(Snapshots snapshots) {
this.snapshots = snapshots;
return this;
}
/**
* Adds a value to the builder for legacyProductDetails
* @param legacyProductDetails Value to assign to the mutable Builder
* @return The Builder instance so that call chaining works
**/
public Builder setLegacyProductDetails(LegacyProductDetails legacyProductDetails) {
this.legacyProductDetails = legacyProductDetails;
return this;
}
/**
* Adds a value to the builder for richData
* @param richData Value to assign to the mutable Builder
* @return The Builder instance so that call chaining works
**/
public Builder setRichData(RichData richData) {
this.richData = richData;
return this;
}
/**
* Adds a value to the builder for status
* @param status Value to assign to the mutable Builder
* @return The Builder instance so that call chaining works
**/
public Builder setStatus(Status status) {
this.status = status;
return this;
}
/**
* Adds a value to the builder for actionListAppend
* @param actionListAppend Value to assign to the mutable Builder
* @return The Builder instance so that call chaining works
**/
public Builder setActionListAppend(ActionListAppend actionListAppend) {
this.actionListAppend = actionListAppend;
return this;
}
/**
* Adds a value to the builder for actionListModify
* @param actionListModify Value to assign to the mutable Builder
* @return The Builder instance so that call chaining works
**/
public Builder setActionListModify(ActionListModify actionListModify) {
this.actionListModify = actionListModify;
return this;
}
/**
* Adds a value to the builder for health
* @param health Value to assign to the mutable Builder
* @return The Builder instance so that call chaining works
**/
public Builder setHealth(UpdateOperation.AccountGroupHealthUpdate health) {
this.health = health;
return this;
}
/**
* Adds a value to the builder for fieldMask
* @param fieldMask Value to assign to the mutable Builder
* @return The Builder instance so that call chaining works
**/
public Builder setFieldMask(FieldMask fieldMask) {
this.fieldMask = fieldMask;
return this;
}
/**
* Takes the configuration in the mutable Builder and uses it to instantiate a final instance
* of the UpdateOperation class
* @return The instantiated final UpdateOperation
**/
public UpdateOperation build() {
return new UpdateOperation(
this.accountGroupNap,
this.listingSyncProto,
this.accountGroupExternalIdentifiers,
this.socialUrls,
this.hoursOfOperation,
this.contactDetails,
this.snapshots,
this.legacyProductDetails,
this.richData,
this.status,
this.actionListAppend,
this.actionListModify,
this.health,
this.fieldMask);
}
}
/**
* Returns a Builder for UpdateOperation, which is a mutable representation of the object. Once the
* client has built up an object they can then create an immutable UpdateOperation 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 UpdateOperation instance
**/
public String toString() {
String result = "UpdateOperation\n";
result += "-> accountGroupNap: (AccountGroupLocation)"
+ StringUtils.join("\n ", Arrays.asList(String.valueOf(this.accountGroupNap).split("\n"))) + "\n";
result += "-> listingSyncProto: (ListingSyncPro)"
+ StringUtils.join("\n ", Arrays.asList(String.valueOf(this.listingSyncProto).split("\n"))) + "\n";
result += "-> accountGroupExternalIdentifiers: (AccountGroupExternalIdentifiers)"
+ StringUtils.join("\n ", Arrays.asList(String.valueOf(this.accountGroupExternalIdentifiers).split("\n"))) + "\n";
result += "-> socialUrls: (SocialURLs)"
+ StringUtils.join("\n ", Arrays.asList(String.valueOf(this.socialUrls).split("\n"))) + "\n";
result += "-> hoursOfOperation: (HoursOfOperation)"
+ StringUtils.join("\n ", Arrays.asList(String.valueOf(this.hoursOfOperation).split("\n"))) + "\n";
result += "-> contactDetails: (ContactDetails)"
+ StringUtils.join("\n ", Arrays.asList(String.valueOf(this.contactDetails).split("\n"))) + "\n";
result += "-> snapshots: (Snapshots)"
+ StringUtils.join("\n ", Arrays.asList(String.valueOf(this.snapshots).split("\n"))) + "\n";
result += "-> legacyProductDetails: (LegacyProductDetails)"
+ StringUtils.join("\n ", Arrays.asList(String.valueOf(this.legacyProductDetails).split("\n"))) + "\n";
result += "-> richData: (RichData)"
+ StringUtils.join("\n ", Arrays.asList(String.valueOf(this.richData).split("\n"))) + "\n";
result += "-> status: (Status)"
+ StringUtils.join("\n ", Arrays.asList(String.valueOf(this.status).split("\n"))) + "\n";
result += "-> actionListAppend: (ActionListAppend)"
+ StringUtils.join("\n ", Arrays.asList(String.valueOf(this.actionListAppend).split("\n"))) + "\n";
result += "-> actionListModify: (ActionListModify)"
+ StringUtils.join("\n ", Arrays.asList(String.valueOf(this.actionListModify).split("\n"))) + "\n";
result += "-> health: (UpdateOperation.AccountGroupHealthUpdate)"
+ StringUtils.join("\n ", Arrays.asList(String.valueOf(this.health).split("\n"))) + "\n";
result += "-> fieldMask: (FieldMask)"
+ StringUtils.join("\n ", Arrays.asList(String.valueOf(this.fieldMask).split("\n"))) + "\n";
return result;
}
/**
* Allows for simple conversion between the low-level generated protobuf object to
* UpdateOperation, which is much more usable.
* @return An instance of UpdateOperation representing the input proto object
**/
public static UpdateOperation fromProto(ApiProto.UpdateOperation proto) {
UpdateOperation out = null;
if (proto != null) {
UpdateOperation.Builder outBuilder = UpdateOperation.newBuilder()
.setAccountGroupNap(AccountGroupLocation.fromProto(proto.getAccountGroupNap()))
.setListingSyncProto(ListingSyncPro.fromProto(proto.getListingSyncProto()))
.setAccountGroupExternalIdentifiers(AccountGroupExternalIdentifiers.fromProto(proto.getAccountGroupExternalIdentifiers()))
.setSocialUrls(SocialURLs.fromProto(proto.getSocialUrls()))
.setHoursOfOperation(HoursOfOperation.fromProto(proto.getHoursOfOperation()))
.setContactDetails(ContactDetails.fromProto(proto.getContactDetails()))
.setSnapshots(Snapshots.fromProto(proto.getSnapshots()))
.setLegacyProductDetails(LegacyProductDetails.fromProto(proto.getLegacyProductDetails()))
.setRichData(RichData.fromProto(proto.getRichData()))
.setStatus(Status.fromProto(proto.getStatus()))
.setActionListAppend(ActionListAppend.fromProto(proto.getActionListAppend()))
.setActionListModify(ActionListModify.fromProto(proto.getActionListModify()))
.setHealth(UpdateOperation.AccountGroupHealthUpdate.fromProto(proto.getHealth()))
.setFieldMask(FieldMask.fromProto(proto.getFieldMask()));
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 UpdateOperation instances representing the input proto objects
**/
public static List fromProtos(List protos) {
List out = new ArrayList();
for(ApiProto.UpdateOperation proto : protos) {
out.add(UpdateOperation.fromProto(proto));
}
return out;
}
/**
* Allows for simple conversion of an object to the low-level generated protobuf object.
* @return An instance of ApiProto.UpdateOperation which is a proto object ready for wire transmission
**/
public ApiProto.UpdateOperation toProto() {
UpdateOperation obj = this;
ApiProto.UpdateOperation.Builder outBuilder = ApiProto.UpdateOperation.newBuilder();
if(obj.getAccountGroupNap() != null){outBuilder.setAccountGroupNap(obj.getAccountGroupNap().toProto());}
if(obj.getListingSyncProto() != null){outBuilder.setListingSyncProto(obj.getListingSyncProto().toProto());}
if(obj.getAccountGroupExternalIdentifiers() != null){outBuilder.setAccountGroupExternalIdentifiers(obj.getAccountGroupExternalIdentifiers().toProto());}
if(obj.getSocialUrls() != null){outBuilder.setSocialUrls(obj.getSocialUrls().toProto());}
if(obj.getHoursOfOperation() != null){outBuilder.setHoursOfOperation(obj.getHoursOfOperation().toProto());}
if(obj.getContactDetails() != null){outBuilder.setContactDetails(obj.getContactDetails().toProto());}
if(obj.getSnapshots() != null){outBuilder.setSnapshots(obj.getSnapshots().toProto());}
if(obj.getLegacyProductDetails() != null){outBuilder.setLegacyProductDetails(obj.getLegacyProductDetails().toProto());}
if(obj.getRichData() != null){outBuilder.setRichData(obj.getRichData().toProto());}
if(obj.getStatus() != null){outBuilder.setStatus(obj.getStatus().toProto());}
if(obj.getActionListAppend() != null){outBuilder.setActionListAppend(obj.getActionListAppend().toProto());}
if(obj.getActionListModify() != null){outBuilder.setActionListModify(obj.getActionListModify().toProto());}
if(obj.getHealth() != null){outBuilder.setHealth(obj.getHealth().toProto());}
if(obj.getFieldMask() != null){outBuilder.setFieldMask(obj.getFieldMask().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.UpdateOperation instances representing the input objects.
*/
public static List toProtos(List objects) {
List out = new ArrayList();
if(objects != null) {
for (UpdateOperation obj : objects) {
out.add(obj!=null?obj.toProto():null);
}
}
return out;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy