public void ConvertNullSDKToAPI() { sdkSigner1 = null; converter = new SignerConverter(sdkSigner1); Assert.IsNull(converter.ToAPISigner()); }
public void ConvertNullAPIToAPI() { apiRole = null; converter = new SignerConverter(apiRole); Assert.IsNull(converter.ToAPISigner()); }
public void UpdateSigner(PackageId packageId, Signer signer) { Role apiPayload = new SignerConverter(signer).ToAPIRole(System.Guid.NewGuid().ToString()); string path = template.UrlFor(UrlTemplate.UPDATE_SIGNER_PATH) .Replace("{packageId}", packageId.Id) .Replace("{roleId}", signer.Id) .Build(); try { string json = JsonConvert.SerializeObject(apiPayload, settings); restClient.Put(path, json); } catch (EslServerException e) { throw new EslServerException("Could not update signer." + " Exception: " + e.Message, e.ServerError, e); } catch (Exception e) { throw new EslException("Could not update signer." + " Exception: " + e.Message, e); } }
public string AddSigner(PackageId packageId, Signer signer) { Role apiPayload = new SignerConverter(signer).ToAPIRole(System.Guid.NewGuid().ToString()); string path = template.UrlFor(UrlTemplate.ADD_SIGNER_PATH) .Replace("{packageId}", packageId.Id) .Build(); try { string json = JsonConvert.SerializeObject(apiPayload, settings); string response = restClient.Post(path, json); Role apiRole = JsonConvert.DeserializeObject <Role> (response); return(apiRole.Id); } catch (EslServerException e) { throw new EslServerException("Could not add signer." + " Exception: " + e.Message, e.ServerError, e); } catch (Exception e) { throw new EslException("Could not add signer." + " Exception: " + e.Message, e); } }
public void UpdateSigner( PackageId packageId, Signer signer ) { Role apiPayload = new SignerConverter( signer ).ToAPIRole( System.Guid.NewGuid().ToString()); string path = template.UrlFor (UrlTemplate.UPDATE_SIGNER_PATH) .Replace( "{packageId}", packageId.Id ) .Replace( "{roleId}", signer.Id ) .Build (); try { string json = JsonConvert.SerializeObject (apiPayload, settings); restClient.Put(path, json); } catch (EslServerException e) { throw new EslServerException ("Could not update signer." + " Exception: " + e.Message, e.ServerError, e); } catch (Exception e) { throw new EslException ("Could not update signer." + " Exception: " + e.Message, e); } }
public string AddSigner( PackageId packageId, Signer signer ) { Role apiPayload = new SignerConverter( signer ).ToAPIRole( System.Guid.NewGuid().ToString()); string path = template.UrlFor (UrlTemplate.ADD_SIGNER_PATH) .Replace( "{packageId}", packageId.Id ) .Build (); try { string json = JsonConvert.SerializeObject (apiPayload, settings); string response = restClient.Post(path, json); Role apiRole = JsonConvert.DeserializeObject<Role> (response); return apiRole.Id; } catch (EslServerException e) { throw new EslServerException ("Could not add signer." + " Exception: " + e.Message, e.ServerError, e); } catch (Exception e) { throw new EslException ("Could not add signer." + " Exception: " + e.Message, e); } }