Skip to content

Commit

Permalink
Add created field
Browse files Browse the repository at this point in the history
  • Loading branch information
diazos1 authored and john committed Mar 24, 2017
1 parent 117ca77 commit dde4df2
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 8 deletions.
32 changes: 27 additions & 5 deletions sdk/src/main/java/com/silanis/esl/api/model/BasePackage.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ public class BasePackage extends Entity
public static final String FIELD_UPDATED = "updated";
@JsonIgnore
public static final String FIELD_VISIBILITY = "visibility";
@JsonIgnore
public static final String FIELD_CREATED = "created";

// Empty Constructor
public BasePackage ( ) {}
Expand All @@ -85,6 +87,7 @@ public BasePackage ( ) {}
protected String _type = "PACKAGE";
protected java.util.Date _updated;
protected String _visibility = "ACCOUNT";
protected java.util.Date _created;

// Accessors

Expand Down Expand Up @@ -160,7 +163,7 @@ public BasePackage setDescription( String value ){
// Used internally by aws. Invokes a the corresponding setter if the value is not null
@JsonIgnore
public BasePackage safeSetDescription( String value ){
if ( value != null ) { this.setDescription( value ); }
if ( value != null ) { this.setDescription(value); }
return this;
}
public String getDescription(){
Expand Down Expand Up @@ -265,7 +268,7 @@ public BasePackage setLanguage( String value ){
// Used internally by aws. Invokes a the corresponding setter if the value is not null
@JsonIgnore
public BasePackage safeSetLanguage( String value ){
if ( value != null ) { this.setLanguage( value ); }
if ( value != null ) { this.setLanguage(value); }
return this;
}
public String getLanguage(){
Expand Down Expand Up @@ -344,7 +347,7 @@ public BasePackage setNotarized( Boolean value ){
// Used internally by aws. Invokes a the corresponding setter if the value is not null
@JsonIgnore
public BasePackage safeSetNotarized( Boolean value ){
if ( value != null ) { this.setNotarized( value ); }
if ( value != null ) { this.setNotarized(value); }
return this;
}
public Boolean getNotarized(){
Expand Down Expand Up @@ -537,6 +540,25 @@ public BasePackage safeSetVisibility( String value ){
public String getVisibility(){
return _visibility;
}




@JsonDeserialize(using = JsonDateDeserializer.class)
public BasePackage setCreated( java.util.Date value ){
SchemaSanitizer.throwOnNull(FIELD_CREATED, value);
this._created = value;
setDirty(FIELD_CREATED);
return this;
}
// Used internally by aws. Invokes a the corresponding setter if the value is not null
@JsonIgnore
public BasePackage safeSetCreated( java.util.Date value ){
if ( value != null ) { this.setCreated( value ); }
return this;
}

@JsonSerialize(using = JsonDateSerializer.class)
public java.util.Date getCreated(){
return _created;
}

}
16 changes: 15 additions & 1 deletion sdk/src/main/java/com/silanis/esl/api/model/Layout.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public class Layout extends BaseTemplate
public static final String FIELD_UPDATED = "updated";
@JsonIgnore
public static final String FIELD_VISIBILITY = "visibility";
@JsonIgnore
public static final String FIELD_CREATED = "created";

// Empty Constructor
public Layout ( ) {}
Expand Down Expand Up @@ -392,6 +394,18 @@ public Layout safeSetVisibility( String value ){
if ( value != null ) { this.setVisibility( value ); }
return this;
}


@JsonDeserialize(using = JsonDateDeserializer.class)
@Override
public Layout setCreated( java.util.Date value ){
super.setCreated(value);
return this;
}
// Used internally by aws. Invokes a the corresponding setter if the value is not null
@JsonIgnore
public Layout safeSetCreated( java.util.Date value ){
if ( value != null ) { this.setCreated( value ); }
return this;
}

}
15 changes: 14 additions & 1 deletion sdk/src/main/java/com/silanis/esl/api/model/Package.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ public class Package extends BasePackage
public static final String FIELD_UPDATED = "updated";
@JsonIgnore
public static final String FIELD_VISIBILITY = "visibility";
@JsonIgnore
public static final String FIELD_CREATED = "created";

// Empty Constructor
public Package ( ) {}
Expand Down Expand Up @@ -445,6 +447,17 @@ public Package safeSetVisibility( String value ){
if ( value != null ) { this.setVisibility( value ); }
return this;
}


@JsonDeserialize(using = JsonDateDeserializer.class)
@Override
public Package setCreated( java.util.Date value ){
super.setCreated(value);
return this;
}
@JsonIgnore
public Package safeSetCreated( java.util.Date value ){
if ( value != null ) { this.setCreated( value ); }
return this;
}

}
16 changes: 15 additions & 1 deletion sdk/src/main/java/com/silanis/esl/api/model/Template.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public class Template extends BaseTemplate
public static final String FIELD_UPDATED = "updated";
@JsonIgnore
public static final String FIELD_VISIBILITY = "visibility";
@JsonIgnore
public static final String FIELD_CREATED = "created";

// Empty Constructor
public Template ( ) {}
Expand Down Expand Up @@ -391,6 +393,18 @@ public Template safeSetVisibility( String value ){
if ( value != null ) { this.setVisibility( value ); }
return this;
}


@JsonDeserialize(using = JsonDateDeserializer.class)
@Override
public Template setCreated( java.util.Date value ){
super.setCreated(value);
return this;
}
// Used internally by aws. Invokes a the corresponding setter if the value is not null
@JsonIgnore
public Template safeSetCreated( java.util.Date value ){
if ( value != null ) { this.setCreated( value ); }
return this;
}

}
10 changes: 10 additions & 0 deletions sdk/src/main/java/com/silanis/esl/sdk/DocumentPackage.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public class DocumentPackage implements Serializable {
private String description;
private Date expiryDate;
private Date updatedDate;
private Date createdDate;
private String packageMessage;
private Boolean notarized;
private Boolean trashed;
Expand Down Expand Up @@ -208,6 +209,15 @@ public Date getUpdatedDate() {
return updatedDate;
}


public Date getCreatedDate() {
return createdDate;
}

public void setCreatedDate(Date createdDate) {
this.createdDate = createdDate;
}

/**
* Sets the package message
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,9 @@ else if ( role.getSigners().get( 0 ).getGroup() != null ) {
if (apiPackage.getUpdated() != null) {
documentPackage.setUpdatedDate(apiPackage.getUpdated());
}
if (apiPackage.getCreated() != null) {
documentPackage.setCreatedDate(apiPackage.getCreated());
}

return documentPackage;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ public void convertAPIToSDK() {
assertThat("Message status was not correctly set", apiPackage1.getMessages().get(0).getStatus().toString(), is(equalTo(sdkDocumentPackage1.getMessages().get(0).getStatus().toString())));
assertThat("Message content was not correctly set", apiPackage1.getMessages().get(0).getContent(), is(equalTo(sdkDocumentPackage1.getMessages().get(0).getContent())));
assertThat("Sender email address was not correctly set", apiPackage1.getSender().getEmail(), is(equalTo(sdkDocumentPackage1.getSenderInfo().getEmail())));
assertThat("Creation date was not correctly set", apiPackage1.getCreated(), is(sdkDocumentPackage1.getCreatedDate()));
}

@Override
Expand Down Expand Up @@ -159,6 +160,7 @@ private com.silanis.esl.api.model.Package createTypicalAPIDocumentPackage() {
apiDocumentPackage.setDue(new Date());
apiDocumentPackage.setName("API package name");
apiDocumentPackage.setStatus(PackageStatus.DRAFT.getApiValue());
apiDocumentPackage.setCreated(new Date());

Message apiMessage = new Message();
apiMessage.setContent("opt-out reason");
Expand Down

0 comments on commit dde4df2

Please sign in to comment.