Skip to content

Commit

Permalink
fix: Update sign template missing enum (#1201)
Browse files Browse the repository at this point in the history
  • Loading branch information
congminh1254 authored Sep 12, 2023
1 parent 2e931d8 commit fcb6657
Show file tree
Hide file tree
Showing 8 changed files with 939 additions and 226 deletions.
217 changes: 5 additions & 212 deletions src/main/java/com/box/sdk/BoxSignTemplate.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public class Info extends BoxResource.Info {
private String name;
private BoxFolder.Info parentFolder;
private BoxSignTemplateReadySignLink readySignLink;
private List<BoxSignRequestSigner> signers;
private List<BoxSignTemplateSigner> signers;
private List<BoxFile.Info> sourceFiles;

/**
Expand Down Expand Up @@ -271,7 +271,7 @@ public BoxSignTemplateReadySignLink getReadySignLink() {
*
* @return the signers for this Sign Template.
*/
public List<BoxSignRequestSigner> getSigners() {
public List<BoxSignTemplateSigner> getSigners() {
return this.signers;
}

Expand Down Expand Up @@ -383,11 +383,11 @@ private List<BoxFile.Info> parseSourceFiles(JsonValue filesArray) {
return files;
}

private List<BoxSignRequestSigner> parseSigners(JsonValue signersArray) {
List<BoxSignRequestSigner> signers = new ArrayList<BoxSignRequestSigner>();
private List<BoxSignTemplateSigner> parseSigners(JsonValue signersArray) {
List<BoxSignTemplateSigner> signers = new ArrayList<BoxSignTemplateSigner>();
for (JsonValue signerJSON : signersArray.asArray()) {
JsonObject signerObj = signerJSON.asObject();
signers.add(new BoxSignRequestSigner(signerObj, getAPI()));
signers.add(new BoxSignTemplateSigner(signerObj, getAPI()));
}
return signers;
}
Expand All @@ -410,212 +410,5 @@ private BoxSignTemplateReadySignLink parseReadySignLink(JsonObject readySignLink
return new BoxSignTemplateReadySignLink(folderID, instructions, isActive,
isNofiticationDisabled, name, url);
}

/**
* Box Sign Template additional information on which fields are required
* and which fields are not editable.
*/
public class BoxSignTemplateAdditionalInfo {
private final List<String> nonEditable;
private final BoxSignTemplateAdditionalInfoRequired required;

public BoxSignTemplateAdditionalInfo(List<String> nonEditable,
BoxSignTemplateAdditionalInfoRequired required) {
this.nonEditable = nonEditable;
this.required = required;
}

/**
* Get non-editable fields.
*
* @return list of non-editable fields.\
*/
public List<String> getNonEditable() {
return this.nonEditable;
}

/**
* Gets the required fields.
*
* @return the required fields.
*/
public BoxSignTemplateAdditionalInfoRequired getRequired() {
return this.required;
}
}

/**
* Box Sign Template additional information on which fields are required.
*/
public class BoxSignTemplateAdditionalInfoRequired {
private final List<List<String>> signers;

/**
* Constructs a BoxSignTemplateAdditionalInfoRequired object with the provided list of signers.
*/
public BoxSignTemplateAdditionalInfoRequired(List<List<String>> signers) {
this.signers = signers;
}

/**
* Gets the required signer fields.
*
* @return the required signer fields.
*/
public List<List<String>> getSigners() {
return this.signers;
}
}

/**
* Custom branding applied to notifications and signature requests.
*/
public class BoxSignTemplateCustomBranding {
private final String brandingColor;
private final String companyName;
private final String emailFooterText;
private final String logoUri;

/**
* Constructs a BoxSignTemplateCustomBranding object with the provided information.
*
* @param brandingColor the branding color.
* @param companyName the company name.
* @param emailFooterText the email footer text.
* @param logoUri the logo URI.
*/
public BoxSignTemplateCustomBranding(String brandingColor, String companyName, String emailFooterText,
String logoUri) {
this.brandingColor = brandingColor;
this.companyName = companyName;
this.emailFooterText = emailFooterText;
this.logoUri = logoUri;
}

/**
* Gets the branding color.
*
* @return the branding color.
*/
public String getBrandingColor() {
return this.brandingColor;
}

/**
* Gets the company name.
*
* @return the company name.
*/
public String getCompanyName() {
return this.companyName;
}

/**
* Gets the email footer text.
*
* @return the email footer text.
*/
public String getEmailFooterText() {
return this.emailFooterText;
}

/**
* Gets the logo URI.
*
* @return the logo URI.
*/
public String getLogoUri() {
return this.logoUri;
}
}

/**
* Box's ready-sign link feature enables you to create a link to a signature request that you've created from a template.
* Use this link when you want to post a signature request on a public form — such as an email,
* social media post, or web page — without knowing who the signers will be.
* Note: The ready-sign link feature is limited to Enterprise Plus customers and not available to Box Verified Enterprises.
*/
public class BoxSignTemplateReadySignLink {
private final String folderID;
private final String instructions;
private final boolean isActive;
private final boolean isNofiticationDisabled;
private final String name;
private final String url;

/**
* Constructs a BoxSignTemplateReadySignLink object with the provided information.
*
* @param folderID the folder ID.
* @param instructions the instructions.
* @param isActive whether the link is active or not.
* @param isNofiticationDisabled whether the notification is disabled or not.
* @param name the name.
* @param url the URL.
*/
public BoxSignTemplateReadySignLink(String folderID, String instructions, boolean isActive,
boolean isNofiticationDisabled, String name, String url) {
this.folderID = folderID;
this.instructions = instructions;
this.isActive = isActive;
this.isNofiticationDisabled = isNofiticationDisabled;
this.name = name;
this.url = url;
}

/**
* Gets the folder ID.
*
* @return the folder ID.
*/
public String getFolderID() {
return this.folderID;
}

/**
* Gets the instructions.
*
* @return the instructions.
*/
public String getInstructions() {
return this.instructions;
}

/**
* Gets whether the link is active or not.
*
* @return true if the link is active; otherwise false.
*/
public boolean getIsActive() {
return this.isActive;
}

/**
* Gets whether the notification is disabled or not.
*
* @return true if the notification is disabled; otherwise false.
*/
public boolean getIsNofiticationDisabled() {
return this.isNofiticationDisabled;
}

/**
* Gets the name of the ready-sign link.
*
* @return the name.
*/
public String getName() {
return this.name;
}

/**
* Gets the URL of the ready-sign link.
*
* @return the URL.
*/
public String getUrl() {
return this.url;
}
}
}
}
37 changes: 37 additions & 0 deletions src/main/java/com/box/sdk/BoxSignTemplateAdditionalInfo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package com.box.sdk;

import java.util.List;


/**
* Box Sign Template additional information on which fields are required
* and which fields are not editable.
*/
public class BoxSignTemplateAdditionalInfo {
private final List<String> nonEditable;
private final BoxSignTemplateAdditionalInfoRequired required;

public BoxSignTemplateAdditionalInfo(List<String> nonEditable,
BoxSignTemplateAdditionalInfoRequired required) {
this.nonEditable = nonEditable;
this.required = required;
}

/**
* Get non-editable fields.
*
* @return list of non-editable fields.\
*/
public List<String> getNonEditable() {
return this.nonEditable;
}

/**
* Gets the required fields.
*
* @return the required fields.
*/
public BoxSignTemplateAdditionalInfoRequired getRequired() {
return this.required;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.box.sdk;

import java.util.List;


/**
* Box Sign Template additional information on which fields are required.
*/
public class BoxSignTemplateAdditionalInfoRequired {
private final List<List<String>> signers;

/**
* Constructs a BoxSignTemplateAdditionalInfoRequired object with the provided list of signers.
*/
public BoxSignTemplateAdditionalInfoRequired(List<List<String>> signers) {
this.signers = signers;
}

/**
* Gets the required signer fields.
*
* @return the required signer fields.
*/
public List<List<String>> getSigners() {
return this.signers;
}
}
63 changes: 63 additions & 0 deletions src/main/java/com/box/sdk/BoxSignTemplateCustomBranding.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
package com.box.sdk;

/**
* Custom branding applied to notifications and signature requests.
*/
public class BoxSignTemplateCustomBranding {
private final String brandingColor;
private final String companyName;
private final String emailFooterText;
private final String logoUri;

/**
* Constructs a BoxSignTemplateCustomBranding object with the provided information.
*
* @param brandingColor the branding color.
* @param companyName the company name.
* @param emailFooterText the email footer text.
* @param logoUri the logo URI.
*/
public BoxSignTemplateCustomBranding(String brandingColor, String companyName, String emailFooterText,
String logoUri) {
this.brandingColor = brandingColor;
this.companyName = companyName;
this.emailFooterText = emailFooterText;
this.logoUri = logoUri;
}

/**
* Gets the branding color.
*
* @return the branding color.
*/
public String getBrandingColor() {
return this.brandingColor;
}

/**
* Gets the company name.
*
* @return the company name.
*/
public String getCompanyName() {
return this.companyName;
}

/**
* Gets the email footer text.
*
* @return the email footer text.
*/
public String getEmailFooterText() {
return this.emailFooterText;
}

/**
* Gets the logo URI.
*
* @return the logo URI.
*/
public String getLogoUri() {
return this.logoUri;
}
}
Loading

0 comments on commit fcb6657

Please sign in to comment.