Skip to content

Commit

Permalink
refactor: rename DealUpdateFlow to EntityUpdateFlow
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidRouyer committed Feb 13, 2021
1 parent b7c5690 commit ed918da
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/Pipedrive.net.Tests/Clients/DealsClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ public async Task RequestsCorrectUrl()

Received.InOrder(async () =>
{
await connection.GetAll<DealUpdateFlow>(
await connection.GetAll<EntityUpdateFlow>(
Arg.Is<Uri>(u => u.ToString() == "deals/123/flow"),
Arg.Is<Dictionary<string, string>>(d => d.Count == 1
&& d["id"] == "123"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ public async Task RequestsCorrectUrl()

Received.InOrder(async () =>
{
await connection.GetAll<DealUpdateFlow>(
await connection.GetAll<EntityUpdateFlow>(
Arg.Is<Uri>(u => u.ToString() == "organizations/123/flow"),
Arg.Is<Dictionary<string, string>>(d => d.Count == 1
&& d["id"] == "123"),
Expand Down
4 changes: 2 additions & 2 deletions src/Pipedrive.net/Clients/DealsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public Task Delete(long id)
return ApiConnection.Delete(ApiUrls.Deal(id));
}

public Task<IReadOnlyList<DealUpdateFlow>> GetUpdates(long dealId, DealUpdateFilters filters)
public Task<IReadOnlyList<EntityUpdateFlow>> GetUpdates(long dealId, DealUpdateFilters filters)
{
Ensure.ArgumentNotNull(filters, nameof(filters));

Expand All @@ -130,7 +130,7 @@ public Task<IReadOnlyList<DealUpdateFlow>> GetUpdates(long dealId, DealUpdateFil
PageSize = filters.PageSize
};

return ApiConnection.GetAll<DealUpdateFlow>(ApiUrls.DealUpdates(dealId), parameters, options);
return ApiConnection.GetAll<EntityUpdateFlow>(ApiUrls.DealUpdates(dealId), parameters, options);
}

public Task<IReadOnlyList<DealFollower>> GetFollowers(long dealId)
Expand Down
2 changes: 1 addition & 1 deletion src/Pipedrive.net/Clients/IDealsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public interface IDealsClient

Task Delete(long id);

Task<IReadOnlyList<DealUpdateFlow>> GetUpdates(long dealId, DealUpdateFilters filters);
Task<IReadOnlyList<EntityUpdateFlow>> GetUpdates(long dealId, DealUpdateFilters filters);

Task<IReadOnlyList<DealFollower>> GetFollowers(long dealId);

Expand Down
2 changes: 1 addition & 1 deletion src/Pipedrive.net/Clients/IOrganizationsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ public interface IOrganizationsClient

Task<IReadOnlyList<File>> GetFiles(long id, OrganizationFileFilters filters);

Task<IReadOnlyList<DealUpdateFlow>> GetUpdates(long dealId, OrganizationUpdateFilters filters);
Task<IReadOnlyList<EntityUpdateFlow>> GetUpdates(long dealId, OrganizationUpdateFilters filters);
}
}
4 changes: 2 additions & 2 deletions src/Pipedrive.net/Clients/OrganizationsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public Task<IReadOnlyList<File>> GetFiles(long id, OrganizationFileFilters filte
return ApiConnection.GetAll<File>(ApiUrls.OrganizationFiles(id), parameters, options);
}

public Task<IReadOnlyList<DealUpdateFlow>> GetUpdates(long id, OrganizationUpdateFilters filters)
public Task<IReadOnlyList<EntityUpdateFlow>> GetUpdates(long id, OrganizationUpdateFilters filters)
{
Ensure.ArgumentNotNull(filters, nameof(filters));

Expand All @@ -199,7 +199,7 @@ public Task<IReadOnlyList<DealUpdateFlow>> GetUpdates(long id, OrganizationUpdat
PageSize = filters.PageSize
};

return ApiConnection.GetAll<DealUpdateFlow>(ApiUrls.OrganizationUpdates(id), parameters, options);
return ApiConnection.GetAll<EntityUpdateFlow>(ApiUrls.OrganizationUpdates(id), parameters, options);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Pipedrive.Internal
{
public class DealUpdateConverter : JsonConverter
public class EntityUpdateConverter : JsonConverter
{
public override bool CanConvert(Type objectType)
{
Expand Down Expand Up @@ -47,7 +47,7 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist
}
}

DealUpdateFlow model = (DealUpdateFlow)Activator.CreateInstance(objectType);
EntityUpdateFlow model = (EntityUpdateFlow)Activator.CreateInstance(objectType);
serializer.Populate(jObject.CreateReader(), model);
model.Data = dealUpdateEntity;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

namespace Pipedrive
{
[JsonConverter(typeof(DealUpdateConverter))]
public class DealUpdateFlow
[JsonConverter(typeof(EntityUpdateConverter))]
public class EntityUpdateFlow
{
[JsonProperty("object")]
public string Object { get; set; }
Expand Down

0 comments on commit ed918da

Please sign in to comment.