Skip to content

Commit

Permalink
v3.0.5 updates
Browse files Browse the repository at this point in the history
- add allowReplyAll for Outlook integration
- add parentPackageId property to identify reply packages
  • Loading branch information
SendSafely-GitHub committed Mar 11, 2020
1 parent 2c659ab commit 092ac81
Show file tree
Hide file tree
Showing 7 changed files with 361 additions and 270 deletions.
26 changes: 26 additions & 0 deletions SendsafelyAPI/ClientAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,32 @@ public String FinalizePackage(String packageId, String keycode)
return pu.FinalizePackage(packageId, keycode);
}

/// <summary>
/// Finalizes the package so it can be delivered to the recipients.
/// <seealso cref="CreatePackage()">createPackage()</seealso>. Additionally, the package must contain at least one file.
/// </summary>
/// <param name="packageId"> The unique package id of the package to be finalized.</param>
/// <param name="keycode"> The keycode belonging to the package.</param>
/// <param name="allowReplyAll"> Determines whether package recipients permitted to reply to all recipients or just sender.</param>
/// <exception cref="APINotInitializedException">Thrown when the API has not been initialized.</exception>
/// <exception cref="InvalidCredentialsException">Thrown when the API credentials are incorrect.</exception>
/// <exception cref="ServerUnavailableException">Thrown when the API failed to connect to the server.</exception>
/// <exception cref="InvalidPackageException">Thrown when a non-existent or invalid package ID is used.</exception>
/// <exception cref="LimitExceededException">Thrown when the package limits has been exceeded.</exception>
/// <exception cref="PackageFinalizationException">Thrown when the package couldn't be finalized. The message will contain detailed information</exception>
/// <exception cref="MissingKeyCodeException">Thrown when the keycode is null, empty or to short.</exception>
/// <exception cref="ActionFailedException">Will be thrown if the server returns an error message</exception>
/// <returns>
/// A link to access the package. This link can be sent to the recipients.
/// </returns>
public String FinalizePackage(String packageId, String keycode, bool allowReplyAll)
{
EnforceInitialized();

PackageUtility pu = new PackageUtility(connection);
return pu.FinalizePackage(packageId, keycode, allowReplyAll);
}

/// <summary>
/// Finalizes an undisclosed package, which is a package without recipients. Anyone with access to the link can access the package.
/// </summary>
Expand Down
6 changes: 5 additions & 1 deletion SendsafelyAPI/Objects/FinalizePackageRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ class FinalizePackageRequest
{
private String _password;
private String _checksum;
private bool undisclosedRecipients;
private bool undisclosedRecipients;
private bool allowReplyAll = false;

[JsonProperty(PropertyName = "password")]
public String Password { get; set; }
Expand All @@ -20,5 +21,8 @@ class FinalizePackageRequest

[JsonProperty(PropertyName = "undisclosedRecipients")]
public bool UndisclosedRecipients { get; set; }

[JsonProperty(PropertyName = "allowReplyAll")]
public bool AllowReplyAll { get; set; }
}
}
7 changes: 7 additions & 0 deletions SendsafelyAPI/Objects/PackageDTO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class PackageDTO
private String packageUserName;
private String packageState;
private List<String> contactGroups;
private String _packageParentId;

[JsonProperty(PropertyName = "response")]
internal APIResponse Response
Expand Down Expand Up @@ -125,5 +126,11 @@ public List<String> ContactGroups
get { return contactGroups; }
set { contactGroups = value; }
}
[JsonProperty(PropertyName = "packageParentId")]
public String PackageParentId
{
get { return _packageParentId; }
set { _packageParentId = value; }
}
}
}
319 changes: 167 additions & 152 deletions SendsafelyAPI/Objects/PackageInformationResponse.cs
Original file line number Diff line number Diff line change
@@ -1,155 +1,170 @@
using System;
using System.Collections.Generic;
using System.Text;
using Newtonsoft.Json;

namespace SendSafely.Objects
{
[JsonObject(MemberSerialization.OptIn)]
class PackageInformationResponse
{
private String _packageId;
private String _packageCode;
private String _serverSecret;
private APIResponse _response;
private String _message;
private bool _needsApprover;
private String state;
private List<Recipient> _recipients;
private List<File> _files;
private List<String> _approvers;
using System;
using System.Collections.Generic;
using System.Text;
using Newtonsoft.Json;

namespace SendSafely.Objects
{
[JsonObject(MemberSerialization.OptIn)]
class PackageInformationResponse
{
private String _packageId;
private String _packageCode;
private String _serverSecret;
private APIResponse _response;
private String _message;
private bool _needsApprover;
private String state;
private List<Recipient> _recipients;
private List<File> _files;
private List<String> _approvers;
private int _life;
private DateTime _packageTimestamp;
private String _packageSender;
private String _rootDirectoryId;
private String _label;
private bool _isVDR;
private List<ContactGroup> contactGroups;

[JsonProperty(PropertyName = "response")]
internal APIResponse Response
{
get { return _response; }
set { _response = value; }
}

[JsonProperty(PropertyName = "packageId")]
internal String PackageID
{
get { return _packageId; }
set { _packageId = value; }
}

[JsonProperty(PropertyName = "packageCode")]
internal String PackageCode
{
get { return _packageCode; }
set { _packageCode = value; }
}

[JsonProperty(PropertyName = "serverSecret")]
internal String ServerSecret
{
get { return _serverSecret; }
set { _serverSecret = value; }
}

[JsonProperty(PropertyName = "message")]
public String Message
{
get { return _message; }
set { _message = value; }
}

[JsonProperty(PropertyName = "needsApproval")]
public bool NeedsApprover
{
get { return _needsApprover; }
set { _needsApprover = value; }
}

[JsonProperty(PropertyName = "recipients")]
internal List<Recipient> Recipients
{
get { return _recipients; }
set { _recipients = value; }
}

[JsonProperty(PropertyName = "files")]
public List<File> Files
{
get { return _files; }
set { _files = value; }
}

[JsonProperty(PropertyName = "approverList")]
public List<String> Approvers
{
get { return _approvers; }
set { _approvers = value; }
}

[JsonProperty(PropertyName = "life")]
public int Life
{
get { return _life; }
set { _life = value; }
}

[JsonProperty(PropertyName = "packageTimestamp")]
public DateTime PackageTimestamp
{
get { return _packageTimestamp; }
set { _packageTimestamp = value; }
}

[JsonProperty(PropertyName = "packageSender")]
public String PackageSender
{
get { return _packageSender; }
set { _packageSender = value; }
}

[JsonProperty(PropertyName = "rootDirectoryId")]
public String RootDirectoryId
{
get { return _rootDirectoryId; }
set { _rootDirectoryId = value; }
}

[JsonProperty(PropertyName = "label")]
public String Label
{
get { return _label; }
set { _label = value; }
}

[JsonProperty(PropertyName = "isVDR")]
public Boolean IsVDR
{
get { return _isVDR; }
set { _isVDR = value; }
}

/// <summary>
/// A list of contact groups
/// </summary>
[JsonProperty(PropertyName = "contactGroups")]
public List<ContactGroup> ContactGroups
{
get { return contactGroups; }
set { contactGroups = value; }
}

private DateTime _packageTimestamp;
private String _packageSender;
private String _rootDirectoryId;
private String _label;
private bool _isVDR;
private List<ContactGroup> contactGroups;
private bool _allowReplyAll;
private String _packageParentId;

[JsonProperty(PropertyName = "response")]
internal APIResponse Response
{
get { return _response; }
set { _response = value; }
}

[JsonProperty(PropertyName = "packageId")]
internal String PackageID
{
get { return _packageId; }
set { _packageId = value; }
}

[JsonProperty(PropertyName = "packageCode")]
internal String PackageCode
{
get { return _packageCode; }
set { _packageCode = value; }
}

[JsonProperty(PropertyName = "serverSecret")]
internal String ServerSecret
{
get { return _serverSecret; }
set { _serverSecret = value; }
}

[JsonProperty(PropertyName = "message")]
public String Message
{
get { return _message; }
set { _message = value; }
}

[JsonProperty(PropertyName = "needsApproval")]
public bool NeedsApprover
{
get { return _needsApprover; }
set { _needsApprover = value; }
}

[JsonProperty(PropertyName = "recipients")]
internal List<Recipient> Recipients
{
get { return _recipients; }
set { _recipients = value; }
}

[JsonProperty(PropertyName = "files")]
public List<File> Files
{
get { return _files; }
set { _files = value; }
}

[JsonProperty(PropertyName = "approverList")]
public List<String> Approvers
{
get { return _approvers; }
set { _approvers = value; }
}

[JsonProperty(PropertyName = "life")]
public int Life
{
get { return _life; }
set { _life = value; }
}

[JsonProperty(PropertyName = "packageTimestamp")]
public DateTime PackageTimestamp
{
get { return _packageTimestamp; }
set { _packageTimestamp = value; }
}

[JsonProperty(PropertyName = "packageSender")]
public String PackageSender
{
get { return _packageSender; }
set { _packageSender = value; }
}

[JsonProperty(PropertyName = "rootDirectoryId")]
public String RootDirectoryId
{
get { return _rootDirectoryId; }
set { _rootDirectoryId = value; }
}

[JsonProperty(PropertyName = "label")]
public String Label
{
get { return _label; }
set { _label = value; }
}

[JsonProperty(PropertyName = "isVDR")]
public Boolean IsVDR
{
get { return _isVDR; }
set { _isVDR = value; }
}

/// <summary>
/// A list of contact groups
/// </summary>
[JsonProperty(PropertyName = "contactGroups")]
public List<ContactGroup> ContactGroups
{
get { return contactGroups; }
set { contactGroups = value; }
}

/// <summary>
/// a string of state
/// </summary>
[JsonProperty(PropertyName = "state")]
public String State
{
get { return state; }
set { state = value; }
}

}
}
/// </summary>
[JsonProperty(PropertyName = "state")]
public String State
{
get { return state; }
set { state = value; }
}

[JsonProperty(PropertyName = "allowReplyAll")]
public Boolean AllowReplyAll
{
get { return _allowReplyAll; }
set { _allowReplyAll = value; }
}

[JsonProperty(PropertyName = "packageParentId")]
public String PackageParentId
{
get { return _packageParentId; }
set { _packageParentId = value; }
}
}
}
Loading

0 comments on commit 092ac81

Please sign in to comment.