-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add options for embedded invite request
- Loading branch information
1 parent
a690219
commit 058eb79
Showing
4 changed files
with
186 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
using System; | ||
using Bogus; | ||
using SignNow.Net.Model; | ||
using SignNow.Net.Model.Requests; | ||
|
@@ -17,7 +18,15 @@ public class EmbeddedInviteFaker : Faker<EmbeddedInvite> | |
/// <code> | ||
/// { | ||
/// "email": "[email protected]", | ||
/// "language": "en", | ||
/// "auth_method": "none", | ||
/// "first_name": "Jesus", | ||
/// "last_name": "Monahan", | ||
/// "prefill_signature_name": "Jesus Monahan prefill signature", | ||
/// "force_new_signature": "1", | ||
/// "redirect_uri": "https://signnow.com", | ||
/// "decline_redirect_uri": "https://signnow.com", | ||
/// "redirect_target": "self", | ||
/// "role_id": "c376990ca7e1e84ea7f6e252144e435f314bb63b", | ||
/// "order": 1 | ||
/// } | ||
|
@@ -28,7 +37,15 @@ public EmbeddedInviteFaker() | |
Rules((f, o) => | ||
{ | ||
o.Email = f.Internet.Email(); | ||
o.Language = f.PickRandom<Lang>(); | ||
o.AuthMethod = f.PickRandom<EmbeddedAuthType>(); | ||
o.Firstname = f.Person.FirstName; | ||
o.Lastname = f.Person.LastName; | ||
o.PrefillSignatureName = $"{f.Person.FirstName} {f.Person.LastName} prefill signature"; | ||
o.ForceNewSignature = f.Random.Bool(); | ||
o.RedirectUrl = new Uri(f.Internet.Url()); | ||
o.DeclineRedirectUrl = new Uri(f.Internet.Url()); | ||
o.RedirectTarget = f.PickRandom<RedirectTarget>(); | ||
o.RoleId = f.Random.Hash(40); | ||
o.SigningOrder = (uint)f.Random.Number(1, 10); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System.Runtime.Serialization; | ||
|
||
namespace SignNow.Net.Model | ||
{ | ||
public enum Lang | ||
{ | ||
[EnumMember(Value = "en")] | ||
English, | ||
|
||
[EnumMember(Value = "es")] | ||
Spanish, | ||
|
||
[EnumMember(Value = "fr")] | ||
French | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System.Runtime.Serialization; | ||
|
||
namespace SignNow.Net.Model | ||
{ | ||
public enum RedirectTarget | ||
{ | ||
/// <summary> | ||
/// opens the link in the new tab | ||
/// </summary> | ||
[EnumMember(Value = "blank")] | ||
Blank, | ||
|
||
/// <summary> | ||
/// opens the link in the same tab. | ||
/// </summary> | ||
[EnumMember(Value = "self")] | ||
Self | ||
} | ||
} |