Skip to content

Added missing 'version' field to ScheduledEvent from CloudWatch #447

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ public class ScheduledEvent implements Serializable, Cloneable {

private static final long serialVersionUID = -5810383198587331146L;

private String version;

private String account;

private String region;
Expand All @@ -47,6 +49,29 @@ public class ScheduledEvent implements Serializable, Cloneable {
*/
public ScheduledEvent() {}

/**
* @return the version number
*/
public String getVersion() {
return version;
}

/**
* @param version the version number
*/
public void setVersion(String version) {
this.version = version;
}

/**
* @param version version number
* @return ScheduledEvent
*/
public ScheduledEvent withVersion(String version) {
setVersion(version);
return this;
}

/**
* @return the account id
*/
Expand All @@ -69,7 +94,7 @@ public ScheduledEvent withAccount(String account) {
setAccount(account);
return this;
}

/**
* @return the aws region
*/
Expand All @@ -92,7 +117,7 @@ public ScheduledEvent withRegion(String region) {
setRegion(region);
return this;
}

/**
* @return The details of the events (usually left blank)
*/
Expand All @@ -115,7 +140,7 @@ public ScheduledEvent withDetail(Map<String, Object> detail) {
setDetail(detail);
return this;
}

/**
* @return The details type - see cloud watch events for more info
*/
Expand All @@ -138,19 +163,19 @@ public ScheduledEvent withDetailType(String detailType) {
setDetailType(detailType);
return this;
}

/**
* @return the soruce of the event
* @return the source of the event
*/
public String getSource() {
return source;
}

/**
* @param soruce the soruce of the event
* @param source the source of the event
*/
public void setSource(String soruce) {
this.source = soruce;
public void setSource(String source) {
this.source = source;
}

/**
Expand All @@ -161,7 +186,7 @@ public ScheduledEvent withSource(String source) {
setSource(source);
return this;
}

/**
* @return the timestamp for when the event is scheduled
*/
Expand All @@ -184,7 +209,7 @@ public ScheduledEvent withTime(DateTime time) {
setTime(time);
return this;
}

/**
* @return the id of the event
*/
Expand All @@ -207,7 +232,7 @@ public ScheduledEvent withId(String id) {
setId(id);
return this;
}

/**
* @return the resources used by event
*/
Expand Down Expand Up @@ -242,6 +267,8 @@ public ScheduledEvent withResources(List<String> resources) {
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getVersion() != null)
sb.append("version: ").append(getVersion()).append(",");
if (getAccount() != null)
sb.append("account: ").append(getAccount()).append(",");
if (getRegion() != null)
Expand Down Expand Up @@ -272,6 +299,10 @@ public boolean equals(Object obj) {
if (obj instanceof ScheduledEvent == false)
return false;
ScheduledEvent other = (ScheduledEvent) obj;
if (other.getVersion() == null ^ this.getVersion() == null)
return false;
if (other.getVersion() != null && other.getVersion().equals(this.getVersion()) == false)
return false;
if (other.getAccount() == null ^ this.getAccount() == null)
return false;
if (other.getAccount() != null && other.getAccount().equals(this.getAccount()) == false)
Expand Down Expand Up @@ -312,6 +343,7 @@ public int hashCode() {
final int prime = 31;
int hashCode = 1;

hashCode = prime * hashCode + ((getVersion() == null) ? 0 : getVersion().hashCode());
hashCode = prime * hashCode + ((getAccount() == null) ? 0 : getAccount().hashCode());
hashCode = prime * hashCode + ((getRegion() == null) ? 0 : getRegion().hashCode());
hashCode = prime * hashCode + ((getDetail() == null) ? 0 : getDetail().hashCode());
Expand All @@ -331,5 +363,5 @@ public ScheduledEvent clone() {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone()", e);
}
}

}