Skip to content

Commit d747f0e

Browse files
authored
Merge pull request #26 from MukeshVSF4243/Master_Migration_1
v6.0.7
2 parents 25ea1b9 + 621f28e commit d747f0e

File tree

102 files changed

+9397
-1110
lines changed

Some content is hidden

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

102 files changed

+9397
-1110
lines changed

examples/BoldSign.Examples.csproj

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@
55
<RootNamespace>BoldSign.Examples</RootNamespace>
66
</PropertyGroup>
77

8+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
9+
<RunAnalyzersDuringBuild>false</RunAnalyzersDuringBuild>
10+
<RunAnalyzersDuringLiveAnalysis>true</RunAnalyzersDuringLiveAnalysis>
11+
</PropertyGroup>
12+
813
<ItemGroup>
9-
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
10-
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.0" />
14+
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
15+
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.22" />
1116
</ItemGroup>
1217

1318
<ItemGroup>

examples/BrandingExamples.cs

Lines changed: 50 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using BoldSign.Api;
1+
using System.IO;
2+
using BoldSign.Api;
23
using BoldSign.Model;
34

45
namespace BoldSign.Examples
@@ -41,14 +42,27 @@ public void ResetDefaultBrand()
4142
/// </summary>
4243
public BrandingData CreateBrand()
4344
{
45+
var fileBytes = File.ReadAllBytes("assets/sample.jpg");
46+
var stream = new MemoryStream(fileBytes);
47+
4448
var createBrandData = new BrandSettings()
4549
{
4650
// This is an example brand settings data to create, add your own brand settings upon usage.
4751
BrandName = "Brand from SDK",
48-
BrandLogo = new DocumentFileBytes
52+
// BrandLogo = new ImageFileBytes()
53+
// {
54+
// ContentType = "image/jpeg",
55+
// FileBytes = fileBytes,
56+
// },
57+
// BrandLogo = new ImageFileStream()
58+
// {
59+
// FileStream = stream,
60+
// ContentType = "image/jpeg",
61+
// },
62+
BrandLogo = new ImageFilePath()
4963
{
50-
ContentType = "image/jpg",
51-
FileName = "assets/sample.jpg",
64+
FilePath = "assets/sample.jpg",
65+
ContentType = "image/jpeg",
5266
},
5367
CombineAuditTrail = false,
5468
IsDefault = false,
@@ -60,6 +74,11 @@ public BrandingData CreateBrand()
6074
ButtonColor = "#00BDD4",
6175
ButtonTextColor = "#FFFFFF",
6276
RedirectUrl = "https://app.boldsign.com/dashboard",
77+
AllowCustomFieldCreation = false,
78+
ShowBuiltInFormFields = true,
79+
ShowSharedCustomFields = false,
80+
HideDecline = false,
81+
HideSave = false,
6382
};
6483
var result = this.BrandingClient.CreateBrand(createBrandData);
6584
return result;
@@ -71,15 +90,27 @@ public BrandingData CreateBrand()
7190
public BrandingData EditBrand()
7291
{
7392
string brandId = "Your brand-id";
93+
var fileBytes = File.ReadAllBytes("assets/sample.jpg");
94+
var stream = new MemoryStream(fileBytes);
7495

7596
var editBrandData = new BrandSettings()
7697
{
7798
// This is an example brand settings data to edit, add your own brand settings upon usage.
7899
BrandName = "Brand edit from SDK",
79-
BrandLogo = new DocumentFileBytes
100+
// BrandLogo = new ImageFileBytes()
101+
// {
102+
// ContentType = "image/jpeg",
103+
// FileBytes = fileBytes,
104+
// },
105+
// BrandLogo = new ImageFileStream()
106+
// {
107+
// FileStream = stream,
108+
// ContentType = "image/jpeg",
109+
// },
110+
BrandLogo = new ImageFilePath()
80111
{
81-
ContentType = "image/jpg",
82-
FileName = "assets/sample.jpg",
112+
FilePath = "assets/sample.jpg",
113+
ContentType = "image/jpeg",
83114
},
84115
CombineAuditTrail = false,
85116
IsDefault = false,
@@ -104,5 +135,17 @@ public BrandingRecords ListBrand()
104135
var brandRecords = this.BrandingClient.ListBrand();
105136
return brandRecords;
106137
}
138+
139+
/// <summary>
140+
/// Get the brand.
141+
/// </summary>
142+
public BrandDetails GetBrand()
143+
{
144+
// This is an example brand id, add your own brand id upon usage.
145+
var brandId = "your brand-id";
146+
147+
var brandSettings = this.BrandingClient.GetBrandDetails(brandId);
148+
return brandSettings;
149+
}
107150
}
108151
}

examples/ContactExamples.cs

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
namespace BoldSign.Examples
2+
{
3+
using System.Collections.Generic;
4+
using BoldSign.Api;
5+
using BoldSign.Api.Model;
6+
using BoldSign.Model;
7+
using System.Threading.Tasks;
8+
9+
/// <summary>
10+
/// The create user examples.
11+
/// </summary>
12+
public class ContactExamples
13+
{
14+
private readonly ContactClient ContactClient;
15+
16+
/// <summary>
17+
/// Initializes a new instance of the <see cref="ContactExamples" /> class.
18+
/// </summary>
19+
/// <param name="ContactClient">The create user api.</param>
20+
public ContactExamples(ContactClient ContactClient)
21+
{
22+
this.ContactClient = ContactClient;
23+
}
24+
25+
///<summary>
26+
/// Get contact list
27+
/// </summary>
28+
public ContactsList ContactList()
29+
{
30+
var response = this.ContactClient.ListContacts(1, 10, "", ContactType.AllContacts);
31+
return response;
32+
}
33+
34+
/// <summary>
35+
/// Delete Contact details
36+
/// </summary>
37+
public void DeleteContact()
38+
{
39+
// This is an example contact id, add your own brand id upon usage.
40+
var id = "contact-Id";
41+
this.ContactClient.DeleteContact(id);
42+
}
43+
44+
/// <summary>
45+
/// Create Contact details
46+
/// </summary>
47+
public CreatedContact CreateContact()
48+
{
49+
var contactsDetailsList = new List<ContactDetails>();
50+
ContactDetails contactsDetails = new ContactDetails()
51+
{
52+
Email = "[email protected]",
53+
Name = "API-SDK_Test",
54+
PhoneNumber = new PhoneNumber()
55+
{
56+
CountryCode = "91",
57+
Number = "6547456721"
58+
},
59+
CompanyName = "1711",
60+
JobTitle = "Test"
61+
};
62+
63+
contactsDetailsList.Add(contactsDetails);
64+
var response = this.ContactClient.CreateContact(contactsDetailsList);
65+
return response;
66+
}
67+
68+
/// <summary>
69+
/// Update Contact details
70+
/// </summary>
71+
public void UpdateContact()
72+
{
73+
string id = "6797a07d-26d7-41fa-b3a8-c8f72378a7a6c_gEkPI";
74+
var updateContact = new ContactDetails()
75+
{
76+
Email = "[email protected]",
77+
Name = "Test_Engineer",
78+
PhoneNumber = new PhoneNumber()
79+
{
80+
CountryCode = "91",
81+
Number = "9182736450"
82+
},
83+
CompanyName = "1711_1802",
84+
JobTitle = "Test"
85+
};
86+
87+
this.ContactClient.UpdateContact(id, updateContact);
88+
}
89+
90+
public ContactsDetails GetContact()
91+
{
92+
string id = "6797a07d-26d7-41fa-b3a8-c8f72378a7a6c_KRMh4";
93+
var response = this.ContactClient.GetContact(id);
94+
return response;
95+
}
96+
}
97+
}

examples/CustomFieldExamples.cs

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
using BoldSign.Api;
2+
using BoldSign.Model;
3+
using System;
4+
5+
namespace BoldSign.Examples
6+
{
7+
/// <summary>
8+
/// The Custom Field Examples.
9+
/// </summary>
10+
public class CustomFieldExamples
11+
{
12+
private readonly ICustomFieldClient CustomFieldClient;
13+
14+
public CustomFieldExamples(ICustomFieldClient customFieldClient) => this.CustomFieldClient = customFieldClient;
15+
16+
/// <summary>
17+
/// Creates a custom field for the specified brand.
18+
/// </summary>
19+
public void CreateCustomField()
20+
{
21+
var brandCustomFieldDetails = new BrandCustomFieldDetails()
22+
{
23+
FieldName = "Field Name",
24+
FieldDescription = "Description",
25+
FieldOrder = 1,
26+
BrandId = "Brand Id",
27+
FormField = new CustomFormField(
28+
type: FieldType.Signature,
29+
isRequired: true),
30+
};
31+
32+
this.CustomFieldClient.CreateCustomField(brandCustomFieldDetails);
33+
}
34+
35+
/// <summary>
36+
/// Edits a custom field for the specified brand.
37+
/// </summary>
38+
public void EditCustomField()
39+
{
40+
var brandCustomFieldDetails = new BrandCustomFieldDetails()
41+
{
42+
FieldName = "Field Name",
43+
FieldDescription = "Description",
44+
FieldOrder = 1,
45+
BrandId = "Brand Id",
46+
FormField = new CustomFormField(
47+
type: FieldType.Signature,
48+
isRequired: true),
49+
};
50+
51+
var customFieldId = "custom field id";
52+
53+
this.CustomFieldClient.EditCustomField(customFieldId, brandCustomFieldDetails);
54+
}
55+
56+
/// <summary>
57+
/// Deletes a custom field for the specified brand.
58+
/// </summary>
59+
public void DeleteCustomField()
60+
{
61+
var customFieldId = "custom field id";
62+
63+
this.CustomFieldClient.DeleteCustomField(customFieldId);
64+
}
65+
66+
/// <summary>
67+
/// Gets the all custom field for the specified brand.
68+
/// </summary>
69+
public void GetCustomField()
70+
{
71+
var brandId = "Brand Id";
72+
73+
this.CustomFieldClient.GetBrandBasedCustomFields(brandId);
74+
}
75+
76+
/// <summary>
77+
/// Generates a URL to embed manipulation of custom field process.
78+
/// </summary>
79+
public void CreateEmbeddedCustomFieldUrl()
80+
{
81+
var embeddedCustomFieldDetails = new EmbeddedCustomFieldDetails()
82+
{
83+
BrandId = "Brand Id",
84+
LinkValidTill = DateTime.UtcNow.AddDays(1),
85+
};
86+
87+
this.CustomFieldClient.CreateEmbeddedCustomFieldUrl(embeddedCustomFieldDetails);
88+
}
89+
}
90+
}

0 commit comments

Comments
 (0)