package com.perforce.hwsclient.models;
import java.util.Objects;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.*;
import java.util.Date;
import com.google.gson.annotations.SerializedName;
/**
* The client workspace specification and its view.\n\nFor more information see the [command reference](https://www.perforce.com/perforce/doc.current/manuals/cmdref/p4_client.html).
**/
@ApiModel(description = "The client workspace specification and its view.\n\nFor more information see the [command reference](https://www.perforce.com/perforce/doc.current/manuals/cmdref/p4_client.html).")
public class ClientCommand {
@SerializedName("client")
private String client = null;
@SerializedName("owner")
private String owner = null;
@SerializedName("update")
private Date update = null;
@SerializedName("access")
private Date access = null;
@SerializedName("host")
private String host = null;
@SerializedName("description")
private String description = null;
@SerializedName("root")
private String root = null;
@SerializedName("altRoots")
private List<String> altRoots = new ArrayList<String>();
@SerializedName("options")
private String options = null;
@SerializedName("submitOptions")
private String submitOptions = null;
@SerializedName("lineEnd")
private String lineEnd = null;
@SerializedName("stream")
private String stream = null;
@SerializedName("streamAtChange")
private String streamAtChange = null;
@SerializedName("serverID")
private String serverID = null;
@SerializedName("view")
private List<String> view = new ArrayList<String>();
@SerializedName("changeView")
private List<String> changeView = new ArrayList<String>();
@SerializedName("type")
private String type = null;
/**
* The client workspace name, as specified in the `P4CLIENT` environment variable or its equivalents.
**/
@ApiModelProperty(value = "The client workspace name, as specified in the `P4CLIENT` environment variable or its equivalents.")
public String getClient() {
return client;
}
public void setClient(String client) {
this.client = client;
}
/**
* The name of the user who owns the workspace.\nThe default is the user who created the workspace.\n\nThe specified owner does not have to be a Perforce user.\nYou might want to use an arbitrary name if the user does not yet exist, or if you have deleted the user and need a placeholder until you can assign the spec to a new user.
**/
@ApiModelProperty(value = "The name of the user who owns the workspace.\nThe default is the user who created the workspace.\n\nThe specified owner does not have to be a Perforce user.\nYou might want to use an arbitrary name if the user does not yet exist, or if you have deleted the user and need a placeholder until you can assign the spec to a new user.")
public String getOwner() {
return owner;
}
public void setOwner(String owner) {
this.owner = owner;
}
/**
* The time the workspace specification was last modified.
**/
@ApiModelProperty(value = "The time the workspace specification was last modified.")
public Date getUpdate() {
return update;
}
public void setUpdate(Date update) {
this.update = update;
}
/**
* The date and time that the workspace was last used in any way.\n(Note: Reloading a workspace with p4 reload does not affect the access time.)
**/
@ApiModelProperty(value = "The date and time that the workspace was last used in any way.\n(Note: Reloading a workspace with p4 reload does not affect the access time.)")
public Date getAccess() {
return access;
}
public void setAccess(Date access) {
this.access = access;
}
/**
* The name of the workstation on which this workspace resides.\nIf included, operations on this client workspace can be run only from this host.\nIf not set, access is allowed from any host.\n\nThe hostname must be provided exactly as it appears in the output of p4 info when run from that host.\n\nThis field is meant to prevent accidental misuse of client workspaces on the wrong machine.\nProviding a host name does not guarantee security, because the actual value of the host name can be overridden with the -H option to any p4 command, or with the P4HOST environment variable.\nFor a similar mechanism that does provide security, use the IP address restriction feature of p4 protect.
**/
@ApiModelProperty(value = "The name of the workstation on which this workspace resides.\nIf included, operations on this client workspace can be run only from this host.\nIf not set, access is allowed from any host.\n\nThe hostname must be provided exactly as it appears in the output of p4 info when run from that host.\n\nThis field is meant to prevent accidental misuse of client workspaces on the wrong machine.\nProviding a host name does not guarantee security, because the actual value of the host name can be overridden with the -H option to any p4 command, or with the P4HOST environment variable.\nFor a similar mechanism that does provide security, use the IP address restriction feature of p4 protect.")
public String getHost() {
return host;
}
public void setHost(String host) {
this.host = host;
}
/**
* A textual description of the workspace. The default text is Created by owner.
**/
@ApiModelProperty(value = "A textual description of the workspace. The default text is Created by owner.")
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
/**
* The directory (on the local host) relative to which all the files in the `View:` are specified.\nThe default is the current working directory.\nThe path must be specified in local file system syntax.\n\nIf you change this setting, you must physically relocate any files that currently reside there.\nOn Windows client machines, you can specify the root as null to enable you to map files to multiple drives.
**/
@ApiModelProperty(value = "The directory (on the local host) relative to which all the files in the `View:` are specified.\nThe default is the current working directory.\nThe path must be specified in local file system syntax.\n\nIf you change this setting, you must physically relocate any files that currently reside there.\nOn Windows client machines, you can specify the root as null to enable you to map files to multiple drives.")
public String getRoot() {
return root;
}
public void setRoot(String root) {
this.root = root;
}
/**
* Up to two optional alternate client workspace roots.\n\nPerforce applications use the first of the main and alternate roots that match the application’s current working directory.\nUse the p4 info command to display the root being used.\n\nThis enables users to use the same Perforce client workspace specification on multiple platforms, even those with different directory naming conventions.\n\nIf you are using multiple or alternate workspace roots (the AltRoots: field), you can always tell which root is in effect by looking at the Client root: reported by p4 info.\n\nIf you are using a Windows directory in any of your workspace roots, you must specify the Windows directory as your main workspace root and specify your other workspace roots in the AltRoots: field.
**/
@ApiModelProperty(value = "Up to two optional alternate client workspace roots.\n\nPerforce applications use the first of the main and alternate roots that match the application’s current working directory.\nUse the p4 info command to display the root being used.\n\nThis enables users to use the same Perforce client workspace specification on multiple platforms, even those with different directory naming conventions.\n\nIf you are using multiple or alternate workspace roots (the AltRoots: field), you can always tell which root is in effect by looking at the Client root: reported by p4 info.\n\nIf you are using a Windows directory in any of your workspace roots, you must specify the Windows directory as your main workspace root and specify your other workspace roots in the AltRoots: field.")
public List<String> getAltRoots() {
return altRoots;
}
public void setAltRoots(List<String> altRoots) {
this.altRoots = altRoots;
}
/**
* A set of seven switches that control particular workspace options.\n\nSee [Usage Notes](https://www.perforce.com/perforce/doc.current/manuals/cmdref/p4_client.html#p4_client.usage) for a listing of these options.
**/
@ApiModelProperty(value = "A set of seven switches that control particular workspace options.\n\nSee [Usage Notes](https://www.perforce.com/perforce/doc.current/manuals/cmdref/p4_client.html#p4_client.usage) for a listing of these options.")
public String getOptions() {
return options;
}
public void setOptions(String options) {
this.options = options;
}
/**
* Options to govern the default behavior of p4 submit.\n\n* submitunchanged\n+\nAll open files (with or without changes) are submitted to the depot. This is the default behavior of Perforce.\n\n* submitunchanged+reopen\n+\nAll open files (with or without changes) are submitted to the depot, and all files are automatically reopened in the default changelist.\n\n* revertunchanged\n+\nOnly those files with content, type, or resolved changes are submitted to the depot. Unchanged files are reverted.\n\n* revertunchanged+reopen\n+\nOnly those files with content, type, or resolved changes are submitted to the depot and reopened in the default changelist. Unchanged files are reverted and not reopened in the default changelist.\n\n* leaveunchanged\n+\nOnly those files with content, type, or resolved changes are submitted to the depot. Any unchanged files are moved to the default changelist.\n\n* leaveunchanged+reopen\n+\nOnly those files with content, type, or resolved changes are submitted to the depot. Unchanged files are moved to the default changelist, and changed files are reopened in the default changelist. This option is similar to submitunchanged+reopen, except that no unchanged files are submitted to the depot.
**/
@ApiModelProperty(value = "Options to govern the default behavior of p4 submit.\n\n* submitunchanged\n+\nAll open files (with or without changes) are submitted to the depot. This is the default behavior of Perforce.\n\n* submitunchanged+reopen\n+\nAll open files (with or without changes) are submitted to the depot, and all files are automatically reopened in the default changelist.\n\n* revertunchanged\n+\nOnly those files with content, type, or resolved changes are submitted to the depot. Unchanged files are reverted.\n\n* revertunchanged+reopen\n+\nOnly those files with content, type, or resolved changes are submitted to the depot and reopened in the default changelist. Unchanged files are reverted and not reopened in the default changelist.\n\n* leaveunchanged\n+\nOnly those files with content, type, or resolved changes are submitted to the depot. Any unchanged files are moved to the default changelist.\n\n* leaveunchanged+reopen\n+\nOnly those files with content, type, or resolved changes are submitted to the depot. Unchanged files are moved to the default changelist, and changed files are reopened in the default changelist. This option is similar to submitunchanged+reopen, except that no unchanged files are submitted to the depot.")
public String getSubmitOptions() {
return submitOptions;
}
public void setSubmitOptions(String submitOptions) {
this.submitOptions = submitOptions;
}
/**
* Configure carriage-return/linefeed (CR/LF) conversion.\n\nSee [Usage Notes](https://www.perforce.com/perforce/doc.current/manuals/cmdref/p4_client.html#p4_client.usage) for a listing of these options.
**/
@ApiModelProperty(value = "Configure carriage-return/linefeed (CR/LF) conversion.\n\nSee [Usage Notes](https://www.perforce.com/perforce/doc.current/manuals/cmdref/p4_client.html#p4_client.usage) for a listing of these options.")
public String getLineEnd() {
return lineEnd;
}
public void setLineEnd(String lineEnd) {
this.lineEnd = lineEnd;
}
/**
* Associates the workspace with the specified stream.\n\nPerforce generates the view for stream-associated workspaces: you cannot modify it manually.
**/
@ApiModelProperty(value = "Associates the workspace with the specified stream.\n\nPerforce generates the view for stream-associated workspaces: you cannot modify it manually.")
public String getStream() {
return stream;
}
public void setStream(String stream) {
this.stream = stream;
}
/**
* A changelist number that sets a back-in-time view of a stream.\n\nWhen StreamAtChange is set, running p4 sync (when called with no arguments) updates the workspace to files at this changelist revision, instead of the head revision.\nYou cannot submit changes (p4 submit returns an error) when StreamAtChange is set, because the workspace view no longer reflects the current stream inheritance.\n\nThis field is ignored unless the Stream field is also set to a valid stream.
**/
@ApiModelProperty(value = "A changelist number that sets a back-in-time view of a stream.\n\nWhen StreamAtChange is set, running p4 sync (when called with no arguments) updates the workspace to files at this changelist revision, instead of the head revision.\nYou cannot submit changes (p4 submit returns an error) when StreamAtChange is set, because the workspace view no longer reflects the current stream inheritance.\n\nThis field is ignored unless the Stream field is also set to a valid stream.")
public String getStreamAtChange() {
return streamAtChange;
}
public void setStreamAtChange(String streamAtChange) {
this.streamAtChange = streamAtChange;
}
/**
* If set, restricts usage of the workspace to the named server.\nIf unset, use is allowed on master server and on any replicas of the master other than Edge servers.
**/
@ApiModelProperty(value = "If set, restricts usage of the workspace to the named server.\nIf unset, use is allowed on master server and on any replicas of the master other than Edge servers.")
public String getServerID() {
return serverID;
}
public void setServerID(String serverID) {
this.serverID = serverID;
}
/**
* Specifies the mappings between files in the depot and files in the workspace.\nA new view takes effect on the next p4 sync operation.
**/
@ApiModelProperty(value = "Specifies the mappings between files in the depot and files in the workspace.\nA new view takes effect on the next p4 sync operation.")
public List<String> getView() {
return view;
}
public void setView(List<String> view) {
this.view = view;
}
/**
* Restricts access to depot paths to a particular point in time.\nFiles specified for the ChangeView field are read-only: they may be opened but not submitted.\nFor example: `//depot/path/...@1000`\n\nRevisions of the files in the specified path will not be visible if they were submitted after the specified changelist number.\nFiles matching a ChangeView path may not be submitted.
**/
@ApiModelProperty(value = "Restricts access to depot paths to a particular point in time.\nFiles specified for the ChangeView field are read-only: they may be opened but not submitted.\nFor example: `//depot/path/...@1000`\n\nRevisions of the files in the specified path will not be visible if they were submitted after the specified changelist number.\nFiles matching a ChangeView path may not be submitted.")
public List<String> getChangeView() {
return changeView;
}
public void setChangeView(List<String> changeView) {
this.changeView = changeView;
}
/**
* By default clients are writeable.\nSpecify readonly for short lived clients used in build automation scripts.\nSuch clients cannot edit or submit files, but this should not be an issue in build scripts.\n\nUsing writeable clients in build automation scripts can lead to db.have table fragmentation, which is used to track what files a client has synced.\nIf you are experiencing such issues, use a read-only client instead.\nA readonly client is assigned its own personal db.have database table.\nThe location of this table must first be specified by an administrator with the client.readonly.dir configurable.
**/
@ApiModelProperty(value = "By default clients are writeable.\nSpecify readonly for short lived clients used in build automation scripts.\nSuch clients cannot edit or submit files, but this should not be an issue in build scripts.\n\nUsing writeable clients in build automation scripts can lead to db.have table fragmentation, which is used to track what files a client has synced.\nIf you are experiencing such issues, use a read-only client instead.\nA readonly client is assigned its own personal db.have database table.\nThe location of this table must first be specified by an administrator with the client.readonly.dir configurable.")
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ClientCommand clientCommand = (ClientCommand) o;
return Objects.equals(this.client, clientCommand.client) &&
Objects.equals(this.owner, clientCommand.owner) &&
Objects.equals(this.update, clientCommand.update) &&
Objects.equals(this.access, clientCommand.access) &&
Objects.equals(this.host, clientCommand.host) &&
Objects.equals(this.description, clientCommand.description) &&
Objects.equals(this.root, clientCommand.root) &&
Objects.equals(this.altRoots, clientCommand.altRoots) &&
Objects.equals(this.options, clientCommand.options) &&
Objects.equals(this.submitOptions, clientCommand.submitOptions) &&
Objects.equals(this.lineEnd, clientCommand.lineEnd) &&
Objects.equals(this.stream, clientCommand.stream) &&
Objects.equals(this.streamAtChange, clientCommand.streamAtChange) &&
Objects.equals(this.serverID, clientCommand.serverID) &&
Objects.equals(this.view, clientCommand.view) &&
Objects.equals(this.changeView, clientCommand.changeView) &&
Objects.equals(this.type, clientCommand.type);
}
@Override
public int hashCode() {
return Objects.hash(client, owner, update, access, host, description, root, altRoots, options, submitOptions, lineEnd, stream, streamAtChange, serverID, view, changeView, type);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ClientCommand {\n");
sb.append(" client: ").append(toIndentedString(client)).append("\n");
sb.append(" owner: ").append(toIndentedString(owner)).append("\n");
sb.append(" update: ").append(toIndentedString(update)).append("\n");
sb.append(" access: ").append(toIndentedString(access)).append("\n");
sb.append(" host: ").append(toIndentedString(host)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" root: ").append(toIndentedString(root)).append("\n");
sb.append(" altRoots: ").append(toIndentedString(altRoots)).append("\n");
sb.append(" options: ").append(toIndentedString(options)).append("\n");
sb.append(" submitOptions: ").append(toIndentedString(submitOptions)).append("\n");
sb.append(" lineEnd: ").append(toIndentedString(lineEnd)).append("\n");
sb.append(" stream: ").append(toIndentedString(stream)).append("\n");
sb.append(" streamAtChange: ").append(toIndentedString(streamAtChange)).append("\n");
sb.append(" serverID: ").append(toIndentedString(serverID)).append("\n");
sb.append(" view: ").append(toIndentedString(view)).append("\n");
sb.append(" changeView: ").append(toIndentedString(changeView)).append("\n");
sb.append(" type: ").append(toIndentedString(type)).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 ");
}
}