Skip to content

Commit e3a9b08

Browse files
Merge pull request #3 from SendSafely/v3.0.3
Updates for v3.0.3 release
2 parents ca699ac + b114d5b commit e3a9b08

4 files changed

Lines changed: 65 additions & 11 deletions

File tree

SendsafelyAPI/ClientAPI.cs

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,7 @@ public void DeletePackage(String packageId)
332332
}
333333

334334
/// <summary>
335-
/// Deletes a temporary package. This action must be called before the package is finalized. Before this function can be called, the package must have been created with
336-
/// <seealso cref="CreatePackage()">CreatePackage()</seealso>.
335+
/// Deletes a temporary package, which is a package that has not yet been finalized.
337336
/// </summary>
338337
/// <param name="packageId"> The unique package id of the package to be deleted.</param>
339338
/// <exception cref="APINotInitializedException">Thrown when the API has not been initialized.</exception>
@@ -853,6 +852,15 @@ public List<PackageInformation> GetArchivedPackages()
853852
/// <returns>
854853
/// List<ContactGroup> object of Contact Groups and email addresses.
855854
/// </returns>
855+
public List<ContactGroup> GetContactGroups()
856+
{
857+
EnforceInitialized();
858+
859+
PackageUtility pu = new PackageUtility(connection);
860+
return pu.GetContactGroups(false);
861+
}
862+
863+
[Obsolete("getContactGroups is deprecated, please use GetContactGroups instead", false)]
856864
public List<ContactGroup> getContactGroups()
857865
{
858866
EnforceInitialized();
@@ -897,6 +905,15 @@ public List<String> GetDropzoneRecipients()
897905
/// <returns>
898906
/// List<ContactGroup> object of Contact Groups and email addresses.
899907
/// </returns>
908+
public List<ContactGroup> GetEnterpriseContactGroups()
909+
{
910+
EnforceInitialized();
911+
912+
PackageUtility pu = new PackageUtility(connection);
913+
return pu.GetContactGroups(true);
914+
}
915+
916+
[Obsolete("getEnterpriseContactGroups is deprecated, please use GetEnterpriseContactGroups instead", false)]
900917
public List<ContactGroup> getEnterpriseContactGroups()
901918
{
902919
EnforceInitialized();
@@ -940,9 +957,9 @@ public FileInformation GetFileInformation(String packageId, String directoryId,
940957
}
941958

942959
/// <summary>
943-
/// Downloads and decrypts a keycode from the Server given a packageId and a private key.
960+
/// Downloads and decrypts a keycode from the server for a given packageId and RSA Key pair.
944961
/// </summary>
945-
/// <param name="privateKey">The private key associated with the package for the keycode.</param>
962+
/// <param name="privateKey">The private key associated with the RSA Key pair used to encrypt the package keycode.</param>
946963
/// <param name="packageId">The package id for the keycode.</param>
947964
/// <exception cref="APINotInitializedException">Thrown when the API has not been initialized.</exception>
948965
/// <exception cref="GettingKeycodeFailedException">Will be thrown if the server returns an error message while downloading the keycode.</exception>
@@ -1035,6 +1052,20 @@ public PackageInformation GetPackageInformation(String packageId)
10351052
/// <returns>
10361053
/// A PackageInformation object containing information about the package.
10371054
/// </returns>
1055+
public PackageInformation GetPackageInformationFromLink(Uri link)
1056+
{
1057+
EnforceInitialized();
1058+
1059+
if (link == null)
1060+
{
1061+
throw new InvalidPackageException("The supplied link is null");
1062+
}
1063+
1064+
PackageUtility pu = new PackageUtility(connection);
1065+
return pu.GetPackageInformationFromLink(link);
1066+
}
1067+
1068+
[Obsolete("getPackageInformationFromLink is deprecated, please use GetPackageInformationFromLink instead", false)]
10381069
public PackageInformation getPackageInformationFromLink(Uri link)
10391070
{
10401071
EnforceInitialized();
@@ -1094,7 +1125,7 @@ public String GetPackageLink(String packageId, String keyCode)
10941125
}
10951126

10961127
/// <summary>
1097-
/// Retrieves a list of all active received packages for the given API User.
1128+
/// Retrieves a list of all active packages received for the given API User.
10981129
/// </summary>
10991130
/// <exception cref="APINotInitializedException">Thrown when the API has not been initialized.</exception>
11001131
/// <exception cref="InvalidCredentialsException">Thrown when the API credentials are incorrect.</exception>
@@ -1130,11 +1161,11 @@ public Recipient GetRecipient(String packageId, String recipientId)
11301161
}
11311162

11321163
/// <summary>
1133-
/// Retrieves all packages belonging to the given Recipient.
1164+
/// Retrieves a list of packages where the passed in email address is a package recipient.
11341165
/// </summary>
1135-
/// <param name="recipientEmail"> The recipient Email for which the packages information should be fetched.</param>
1166+
/// <param name="recipientEmail"> The email address of the recipient.</param>
11361167
/// <returns>
1137-
/// A PackageInfo object containing information about the package.
1168+
/// A PackageInfo object containing information about each package retrieved, including confirmed downloads for the recipient.
11381169
/// </returns>
11391170
public List<RecipientHistory> GetRecipientHistory(String recipientEmail)
11401171
{

SendsafelyAPI/CountryCodes.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ public enum CountryCode
4040
ES = 34,
4141
SE = 46,
4242
CH = 41,
43-
AE = 971
43+
AE = 971,
44+
OT
4445
};
4546

4647
/// <summary>
@@ -76,7 +77,8 @@ public enum CountryCode
7677
{ CountryCode.ES, "Spain" },
7778
{ CountryCode.SE, "Sweden" },
7879
{ CountryCode.CH, "Switzerland" },
79-
{ CountryCode.AE, "United Arab Emirates" }
80+
{ CountryCode.AE, "United Arab Emirates" },
81+
{ CountryCode.OT, "Other" }
8082
};
8183
}
8284
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace SendSafely.Exceptions
6+
{
7+
/// <summary>
8+
/// Thrown when an organization enforce two fa flag is true
9+
/// </summary>
10+
[Serializable]
11+
public class TwoFAEnforcedException : BaseException
12+
{
13+
public TwoFAEnforcedException(String message)
14+
: base(message)
15+
{
16+
;
17+
}
18+
}
19+
20+
}

SendsafelyAPI/SendsafelyAPI.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
44
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -54,6 +54,7 @@
5454
<Compile Include="Confirmation.cs" />
5555
<Compile Include="CountryCodes.cs" />
5656
<Compile Include="Directory.cs" />
57+
<Compile Include="Exceptions\TwoFAEnforcedException.cs" />
5758
<Compile Include="File.cs" />
5859
<Compile Include="ISendSafelyProgress.cs" />
5960
<Compile Include="EnterpriseInformation.cs" />

0 commit comments

Comments
 (0)