internal UserCustomField toAPIUserCustomField() { UserCustomField result = new UserCustomField(); result.Name = ""; result.Id = Id; result.Value = Value; return result; }
public Sender AddUserCustomField(UserCustomField value) { if (value == null) { throw new ArgumentNullException("Argument cannot be null"); } _userCustomFields.Add(value); return(this); }
internal static CustomFieldValueBuilder CustomFieldValue(UserCustomField userCustomField) { return new CustomFieldValueBuilder(). WithId(userCustomField.Id). WithValue(userCustomField.Value); }
public UserCustomField SubmitCustomFieldValue(UserCustomField apiCustomFieldValue) { string path = template.UrlFor(UrlTemplate.USER_CUSTOMFIELD_PATH).Build(); string response; try { string payload = JsonConvert.SerializeObject(apiCustomFieldValue, settings); if (DoesCustomFieldValueExist(apiCustomFieldValue.Id)) { response = client.Put(path, payload); } else { response = client.Post(path, payload); } return JsonConvert.DeserializeObject<UserCustomField>(response); } catch (EslServerException e) { throw new EslServerException("Could not add/update the custom field to account." + " Exception: " + e.Message, e.ServerError, e); } catch (Exception e) { throw new EslException("Could not add/update the custom field to account." + " Exception: " + e.Message, e); } }
public Signer AddUserCustomField(UserCustomField value) { if (value == null) { throw new ArgumentNullException("Argument cannot be null"); } _userCustomFields.Add(value); return this; }