Skip to content

Commit fe19eb6

Browse files
Merge pull request #19 from boldsign/v-4.6.0
v4.6.0 is released
2 parents 6c92441 + aeae516 commit fe19eb6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+7256
-55
lines changed

examples/BoldSign.Examples.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
</ItemGroup>
1515

1616
<ItemGroup>
17+
<None Update="assets\sample.jpg">
18+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
19+
</None>
1720
<None Update="doc-1.pdf">
1821
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
1922
</None>

examples/BrandingExamples.cs

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
using BoldSign.Api;
2+
using BoldSign.Model;
3+
4+
namespace BoldSign.Examples
5+
{
6+
/// <summary>
7+
/// The branding examples.
8+
/// </summary>
9+
public class BrandingExamples
10+
{
11+
private readonly BrandingClient BrandingClient;
12+
13+
/// <summary>
14+
/// Initializes a new instance of the <see cref="BrandingExamples" /> class.
15+
/// </summary>
16+
/// <param name="BrandingClient">The brand api.</param>
17+
public BrandingExamples(BrandingClient BrandingClient) => this.BrandingClient = BrandingClient;
18+
19+
/// <summary>
20+
/// Deletes the brand.
21+
/// </summary>
22+
public void DeleteBrand()
23+
{
24+
// This is an example brand id, add your own brand id upon usage.
25+
var brandId = "Your brand-id";
26+
this.BrandingClient.DeleteBrand(brandId);
27+
}
28+
29+
/// <summary>
30+
/// Reset the default brand.
31+
/// </summary>
32+
public void ResetDefaultBrand()
33+
{
34+
// This is an example brand id, add your own brand id upon usage.
35+
var brandId = "Your brand-id";
36+
this.BrandingClient.ResetDefaultBrand(brandId);
37+
}
38+
39+
/// <summary>
40+
/// Create the brand.
41+
/// </summary>
42+
public BrandingData CreateBrand()
43+
{
44+
var createBrandData = new BrandSettings()
45+
{
46+
// This is an example brand settings data to create, add your own brand settings upon usage.
47+
BrandName = "Brand from SDK",
48+
BrandLogo = new DocumentFileBytes
49+
{
50+
ContentType = "image/jpg",
51+
FileName = "assets/sample.jpg",
52+
},
53+
CombineAuditTrail = false,
54+
IsDefault = false,
55+
CanHideTagLine = false,
56+
DisclaimerDescription = "Consumer disclosure regarding conducting business electronically, receiving electronic notices, disclosures and other documents and to electronically sign documents.",
57+
DisclaimerTitle = "Classic Company Policy",
58+
EmailDisplayName = "{SenderName} via Your company name",
59+
BackgroundColor = "#EEF4F8",
60+
ButtonColor = "#00BDD4",
61+
ButtonTextColor = "#FFFFFF",
62+
RedirectUrl = "https://app.boldsign.com/dashboard",
63+
};
64+
var result = this.BrandingClient.CreateBrand(createBrandData);
65+
return result;
66+
}
67+
68+
/// <summary>
69+
/// Edit the brand.
70+
/// </summary>
71+
public BrandingData EditBrand()
72+
{
73+
string brandId = "Your brand-id";
74+
75+
var editBrandData = new BrandSettings()
76+
{
77+
// This is an example brand settings data to edit, add your own brand settings upon usage.
78+
BrandName = "Brand edit from SDK",
79+
BrandLogo = new DocumentFileBytes
80+
{
81+
ContentType = "image/jpg",
82+
FileName = "assets/sample.jpg",
83+
},
84+
CombineAuditTrail = false,
85+
IsDefault = false,
86+
CanHideTagLine = false,
87+
DisclaimerDescription = "Consumer disclosure regarding conducting business electronically, receiving electronic notices, disclosures and other documents and to electronically sign documents.",
88+
DisclaimerTitle = "Classic Company Policy",
89+
EmailDisplayName = "{SenderName} via Your company name",
90+
BackgroundColor = "#EEF4F8",
91+
ButtonColor = "#00BDD4",
92+
ButtonTextColor = "#FFFFFF",
93+
RedirectUrl = "https://app.boldsign.com/dashboard",
94+
};
95+
var result = this.BrandingClient.EditBrand(brandId, editBrandData);
96+
return result;
97+
}
98+
99+
/// <summary>
100+
/// list the brand.
101+
/// </summary>
102+
public BrandingRecords ListBrand()
103+
{
104+
var brandRecords = this.BrandingClient.ListBrand();
105+
return brandRecords;
106+
}
107+
}
108+
}

examples/DocumentExamples.cs

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@ public DocumentRecords ListDocuments()
3131
return documents;
3232
}
3333

34+
/// <summary>
35+
/// Lists the team documents.
36+
/// </summary>
37+
public TeamDocumentRecords ListTeamDocuments()
38+
{
39+
var documents = this.DocumentClient.ListTeamDocuments(page: 1, pageSize: 20);
40+
41+
return documents;
42+
}
43+
3444
/// <summary>
3545
/// Lists the document by senders.
3646
/// </summary>
@@ -141,6 +151,44 @@ public void DeleteDocument()
141151
this.DocumentClient.DeleteDocument(documentId);
142152
}
143153

154+
/// <summary>
155+
///Add the Tag.
156+
/// </summary>
157+
public void AddTags()
158+
{
159+
// This is an example document id, add your own document id upon usage.
160+
DocumentTags addTags = new DocumentTags()
161+
{
162+
DocumentId = "0ab99f4e-6d03-415e-b7bb-0d4b7c083e17",
163+
Tags = new List<string>
164+
{
165+
"test",
166+
"test1"
167+
}
168+
169+
};
170+
this.DocumentClient.AddTag(addTags);
171+
172+
}
173+
174+
/// <summary>
175+
///Delete the Tag.
176+
/// </summary>
177+
public void DeleteTags()
178+
{
179+
// This is an example document id, add your own document id upon usage.
180+
DocumentTags deletetags = new DocumentTags()
181+
{
182+
DocumentId = "0ab99f4e-6d03-415e-b7bb-0d4b7c083e17",
183+
Tags = new List<string>
184+
{
185+
"test",
186+
"test1"
187+
},
188+
189+
};
190+
this.DocumentClient.DeleteTag(deletetags);
191+
}
144192
/// <summary>
145193
/// Sends the reminder.
146194
/// </summary>
@@ -165,6 +213,17 @@ public void ChangeAccessCode()
165213
this.DocumentClient.ChangeAccessCode(documentId, "signer1@email.com", "newAccessCodeHere");
166214
}
167215

216+
/// <summary>
217+
/// chnages the recipient details.
218+
/// </summary>
219+
public void ChangeRecipient()
220+
{
221+
// This is an example document id, add your own document id upon usage.
222+
var documentId = "1ace7c82-6770-4d03-b514-b593e20c4550";
223+
224+
this.DocumentClient.ChangeRecipient(documentId, "signer1@gmail.com", "wrong email", "signer2", "signer2@email.com");
225+
}
226+
168227
/// <summary>
169228
/// Changes the access code (When Document signing order enabled).
170229
/// </summary>
@@ -215,7 +274,7 @@ public async Task<DocumentCreated> CreateDocument()
215274
{
216275
new DocumentSigner(
217276
name: "Signer Name 1",
218-
emailAddress: "signer1@email.com",
277+
emailAddress: "test@boldsign.dev",
219278
signerOrder: 1,
220279
authenticationCode: "123",
221280
signerType: SignerType.Signer,

examples/Program.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ private static async Task Main(string[] args)
1616

1717
var documentExamples = new DocumentExamples(new DocumentClient(apiClient));
1818
var templateExamples = new TemplateExamples(new TemplateClient(apiClient));
19+
var userExamples = new UserExamples(new UserClient(apiClient));
20+
var brandingExamples = new BrandingExamples(new BrandingClient(apiClient));
1921
await documentExamples.CreateDocument().ConfigureAwait(false);
2022

2123
}

examples/TeamExamples.cs

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
namespace BoldSign.Examples
2+
{
3+
using BoldSign.Api;
4+
using BoldSign.Model;
5+
using System;
6+
using System.Collections.Generic;
7+
using System.IO;
8+
using System.Linq;
9+
using System.Net.Http;
10+
using System.Threading.Tasks;
11+
12+
/// <summary>
13+
/// The team examples.
14+
/// </summary>
15+
public class TeamExamples
16+
{
17+
private readonly TeamClient TeamClient;
18+
19+
/// <summary>
20+
/// Initializes a new instance of the <see cref="TeamExamples" /> class.
21+
/// </summary>
22+
/// <param name="TeamClient">The team api.</param>
23+
public TeamExamples(TeamClient TeamClient) => this.TeamClient = TeamClient;
24+
25+
/// <summary>
26+
/// Gets the Team Details.
27+
/// </summary>
28+
/// <returns>A Team Response.</returns>
29+
public TeamDetails GetTeamDetails()
30+
{
31+
// This is an example team id, add your own team id upon usage.
32+
var teamId = "91e302a6-2eab-430b-9684-999b484aef2b";
33+
34+
var teamDetails = this.TeamClient.GetTeamDetails(teamId);
35+
36+
return teamDetails;
37+
}
38+
39+
/// <summary>
40+
/// Get the team list.
41+
/// </summary>
42+
/// <returns>A Team List Response.</returns>
43+
public TeamList List()
44+
{
45+
var teamListDetails = this.TeamClient.ListTeam(page: 1, pageSize: 1);
46+
47+
return teamListDetails;
48+
}
49+
50+
/// <summary>
51+
/// Creates a new team.
52+
/// </summary>
53+
/// <returns>A Created team.</returns>
54+
public TeamCreated Create()
55+
{
56+
var createTeam = new CreateTeam()
57+
{
58+
TeamName = "Team test1",
59+
};
60+
61+
var create = this.TeamClient.CreateTeam(createTeam);
62+
63+
return create;
64+
}
65+
66+
/// <summary>
67+
/// Updates team Name.
68+
/// </summary>
69+
public void Update()
70+
{
71+
var updateTeam = new UpdateTeam()
72+
{
73+
// This is an example team id, add your own team id upon usage.
74+
TeamId = "bc51981f-5669-4cb2-95e0-f043e44366e2",
75+
TeamName = "Team test1",
76+
};
77+
78+
this.TeamClient.UpdateTeam(updateTeam);
79+
}
80+
}
81+
}

0 commit comments

Comments
 (0)