Skip to content

Commit

Permalink
feat: add the ability to update custom fields on a person or organiza…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
DavidRouyer committed May 14, 2019
1 parent 8a9761e commit 0f20c91
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
10 changes: 8 additions & 2 deletions src/Pipedrive.net/Models/Request/OrganizationUpdate.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
using Newtonsoft.Json;
using System.Collections.Generic;
using Newtonsoft.Json;
using Pipedrive.Internal;

namespace Pipedrive
{
public class OrganizationUpdate
[JsonConverter(typeof(CustomFieldConverter))]
public class OrganizationUpdate : IEntityWithCustomFields
{
[JsonProperty("name")]
public string Name { get; set; }
Expand All @@ -12,5 +15,8 @@ public class OrganizationUpdate

[JsonProperty("visible_to")]
public Visibility VisibleTo { get; set; }

[JsonIgnore]
public IDictionary<string, ICustomField> CustomFields { get; set; }
}
}
7 changes: 6 additions & 1 deletion src/Pipedrive.net/Models/Request/PersonUpdate.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using Newtonsoft.Json;
using Pipedrive.Internal;
using System.Collections.Generic;

namespace Pipedrive
{
public class PersonUpdate
[JsonConverter(typeof(CustomFieldConverter))]
public class PersonUpdate : IEntityWithCustomFields
{
[JsonProperty("name")]
public string Name { get; set; }
Expand All @@ -22,5 +24,8 @@ public class PersonUpdate

[JsonProperty("visible_to")]
public Visibility VisibleTo { get; set; }

[JsonIgnore]
public IDictionary<string, ICustomField> CustomFields { get; set; }
}
}
3 changes: 2 additions & 1 deletion src/Pipedrive.net/Models/Response/Organization.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ public OrganizationUpdate ToUpdate()
{
Name = Name,
OwnerId = OwnerId?.Value,
VisibleTo = VisibleTo
VisibleTo = VisibleTo,
CustomFields = CustomFields
};
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/Pipedrive.net/Models/Response/Person.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ public PersonUpdate ToUpdate()
Phone = Phone,
OrgId = OrgId?.Value,
OwnerId = OwnerId?.Value,
VisibleTo = VisibleTo
VisibleTo = VisibleTo,
CustomFields = CustomFields
};
}
}
Expand Down

0 comments on commit 0f20c91

Please sign in to comment.