Ejemplo n.º 1
0
        public void UpdateDelegates(string senderId, List <string> delegateIds)
        {
            string path = template.UrlFor(UrlTemplate.DELEGATES_PATH)
                          .Replace("{senderId}", senderId)
                          .Build();

            try {
                string json = JsonConvert.SerializeObject(delegateIds, jsonSettings);
                restClient.Put(path, json);
            }

            catch (EslServerException e) {
                throw new EslServerException("Failed to update delegates of the Sender.\t" + " Exception: " + e.Message, e.ServerError, e);
            }
            catch (Exception e) {
                throw new EslException("Failed to update delegates of the Sender.\t" + " Exception: " + e.Message, e);
            }
        }
Ejemplo n.º 2
0
        public Silanis.ESL.API.Group UpdateGroup(Silanis.ESL.API.Group apiGroup, String groupId)
        {
            string path = template.UrlFor(UrlTemplate.GROUPS_ID_PATH)
                          .Replace("{groupId}", groupId)
                          .Build();

            try {
                string json     = JsonConvert.SerializeObject(apiGroup, settings);
                string response = restClient.Put(path, json);
                Silanis.ESL.API.Group apiResponse = JsonConvert.DeserializeObject <Silanis.ESL.API.Group> (response);
                return(apiResponse);
            }
            catch (EslServerException e) {
                throw new EslServerException("Failed to update group." + " Exception: " + e.Message, e.ServerError, e);
            }
            catch (Exception e) {
                throw new EslException("Failed to update group." + " Exception: " + e.Message, e);
            }
        }
        internal void UpdateSignerVerification(PackageId packageId, string roleId, Silanis.ESL.API.Verification verification)
        {
            string path = template.UrlFor(UrlTemplate.UPDATE_SIGNER_VERIFICATION_PATH)
                          .Replace("{packageId}", packageId.Id)
                          .Replace("{roleId}", roleId)
                          .Build();

            try
            {
                string json = JsonConvert.SerializeObject(verification, settings);
                restClient.Put(path, json);
            }
            catch (EslServerException e)
            {
                throw new EslServerException("Could not update signer verification." + " Exception: " + e.Message, e.ServerError, e);
            }
            catch (Exception e)
            {
                throw new EslException("Could not add update verification." + " Exception: " + e.Message, e);
            }
        }