diff --git a/HubSpot.NET.Tests.Integration/ContactTests.cs b/HubSpot.NET.Tests.Integration/ContactTests.cs
index 1a2fb18..84cb373 100644
--- a/HubSpot.NET.Tests.Integration/ContactTests.cs
+++ b/HubSpot.NET.Tests.Integration/ContactTests.cs
@@ -27,8 +27,11 @@ public void Search_5SamplesLimitedTo3WitContinuations_ReturnsCollectionWith3Item
sampleContacts.Add(contact);
}
- try
- {
+ // HubSpot is rather slow to update... wait 5 seconds to allow it to catch up
+ System.Threading.Thread.Sleep(10 * 1000);
+
+ try
+ {
var searchOptions = new ContactSearchRequestOptions
{
Query = "sampledomain.com",
diff --git a/HubSpot.NET.Tests.Integration/HubSpot.NET.Tests.Integration.csproj b/HubSpot.NET.Tests.Integration/HubSpot.NET.Tests.Integration.csproj
index 32a0c53..c9a3baf 100644
--- a/HubSpot.NET.Tests.Integration/HubSpot.NET.Tests.Integration.csproj
+++ b/HubSpot.NET.Tests.Integration/HubSpot.NET.Tests.Integration.csproj
@@ -1,21 +1,22 @@
- net472;netcoreapp3.1
+ net472;net9.0
false
-
-
-
-
+
+
+
+
-
-
-
+
+
+
+
@@ -36,9 +37,4 @@
Never
-
-
-
-
-
\ No newline at end of file
diff --git a/HubSpot.NET.Tests.Integration/TicketTests.cs b/HubSpot.NET.Tests.Integration/TicketTests.cs
index 1f642a4..8937420 100644
--- a/HubSpot.NET.Tests.Integration/TicketTests.cs
+++ b/HubSpot.NET.Tests.Integration/TicketTests.cs
@@ -11,6 +11,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
+using System.Threading;
namespace HubSpot.NET.Tests.Integration
{
@@ -335,7 +336,7 @@ public void AssociateToContact_TicketIsAssociatedToContact()
{
// Assert
Assert.IsTrue(ticketAssociations.Associations.AssociatedContacts.Any());
- Assert.IsNull(ticketAssociations.Associations.AssociatedCompany);
+ Assert.IsNotNull(ticketAssociations.Associations.AssociatedCompany);
}
finally
{
diff --git a/HubSpot.NET/Api/Company/HubSpotCompanyApi.cs b/HubSpot.NET/Api/Company/HubSpotCompanyApi.cs
index 6df0df4..9353e3d 100644
--- a/HubSpot.NET/Api/Company/HubSpotCompanyApi.cs
+++ b/HubSpot.NET/Api/Company/HubSpotCompanyApi.cs
@@ -30,7 +30,7 @@ public HubSpotCompanyApi(IHubSpotClient client)
{
var path = $"{entity.RouteBasePath}/companies";
- return _client.Execute(path, entity, Method.POST, convertToPropertiesSchema: true);
+ return _client.Execute(path, entity, Method.Post, convertToPropertiesSchema: true);
}
///
@@ -45,7 +45,7 @@ public HubSpotCompanyApi(IHubSpotClient client)
try
{
- return _client.Execute(path, Method.GET, convertToPropertiesSchema: true);
+ return _client.Execute(path, Method.Get, convertToPropertiesSchema: true);
}
catch (HubSpotException exception)
{
@@ -72,7 +72,7 @@ public HubSpotCompanyApi(IHubSpotClient client)
try
{
- CompanySearchResultModel data = _client.ExecuteList>(path, options, Method.POST, convertToPropertiesSchema: true);
+ CompanySearchResultModel data = _client.ExecuteList>(path, options, Method.Post, convertToPropertiesSchema: true);
return data;
}
@@ -116,7 +116,7 @@ public HubSpotCompanyApi(IHubSpotClient client)
var path = $"{entity.RouteBasePath}/companies/{entity.Id}";
- T data = _client.Execute(path, entity, Method.PUT, convertToPropertiesSchema: true);
+ T data = _client.Execute(path, entity, Method.Put, convertToPropertiesSchema: true);
return data;
}
@@ -129,7 +129,7 @@ public void Delete(long companyId)
{
var path = $"{new CompanyHubSpotModel().RouteBasePath}/companies/{companyId}";
- _client.Execute(path, method: Method.DELETE, convertToPropertiesSchema: true);
+ _client.Execute(path, method: Method.Delete, convertToPropertiesSchema: true);
}
public CompanySearchHubSpotModel Search(SearchRequestOptions opts = null) where T : CompanyHubSpotModel, new()
@@ -139,7 +139,7 @@ public void Delete(long companyId)
var path = "/crm/v3/objects/companies/search";
- CompanySearchHubSpotModel data = _client.ExecuteList>(path, opts, Method.POST, convertToPropertiesSchema: true);
+ CompanySearchHubSpotModel data = _client.ExecuteList>(path, opts, Method.Post, convertToPropertiesSchema: true);
return data;
}
diff --git a/HubSpot.NET/Api/Contact/HubSpotContactApi.cs b/HubSpot.NET/Api/Contact/HubSpotContactApi.cs
index 52cfccf..a225d51 100644
--- a/HubSpot.NET/Api/Contact/HubSpotContactApi.cs
+++ b/HubSpot.NET/Api/Contact/HubSpotContactApi.cs
@@ -31,7 +31,7 @@ public HubSpotContactApi(IHubSpotClient client)
public T Create(T entity) where T : ContactHubSpotModel, new()
{
var path = $"{entity.RouteBasePath}/contact";
- return _client.Execute(path, entity, Method.POST, convertToPropertiesSchema: true);
+ return _client.Execute(path, entity, Method.Post, convertToPropertiesSchema: true);
}
///
@@ -43,7 +43,7 @@ public HubSpotContactApi(IHubSpotClient client)
public T CreateOrUpdate(T entity) where T : ContactHubSpotModel, new()
{
var path = $"{entity.RouteBasePath}/contact/createOrUpdate/email/{entity.Email}/";
- return _client.Execute(path, entity, Method.POST, convertToPropertiesSchema: true);
+ return _client.Execute(path, entity, Method.Post, convertToPropertiesSchema: true);
}
///
@@ -58,7 +58,7 @@ public HubSpotContactApi(IHubSpotClient client)
try
{
- T data = _client.Execute(path, Method.GET, convertToPropertiesSchema: true);
+ T data = _client.Execute(path, Method.Get, convertToPropertiesSchema: true);
return data;
}
catch (HubSpotException exception)
@@ -81,7 +81,7 @@ public HubSpotContactApi(IHubSpotClient client)
try
{
- T data = _client.Execute(path, Method.GET, convertToPropertiesSchema: true);
+ T data = _client.Execute(path, Method.Get, convertToPropertiesSchema: true);
return data;
}
catch (HubSpotException exception)
@@ -104,7 +104,7 @@ public HubSpotContactApi(IHubSpotClient client)
try
{
- T data = _client.Execute(path, Method.GET, convertToPropertiesSchema: true);
+ T data = _client.Execute(path, Method.Get, convertToPropertiesSchema: true);
return data;
}
catch (HubSpotException exception)
@@ -153,7 +153,7 @@ public HubSpotContactApi(IHubSpotClient client)
var path = $"{contact.RouteBasePath}/contact/vid/{contact.Id}/profile";
- _client.Execute(path, contact, Method.POST, convertToPropertiesSchema: true);
+ _client.Execute(path, contact, Method.Post, convertToPropertiesSchema: true);
}
///
@@ -164,7 +164,7 @@ public void Delete(long contactId)
{
var path = $"{new ContactHubSpotModel().RouteBasePath}/contact/vid/{contactId}";
- _client.Execute(path, method: Method.DELETE, convertToPropertiesSchema: true);
+ _client.Execute(path, method: Method.Delete, convertToPropertiesSchema: true);
}
///
@@ -177,7 +177,7 @@ public void Delete(long contactId)
{
var path = $"{new T().RouteBasePath}/contact/batch";
- _client.ExecuteBatch(path, contacts.Select(c => (object) c).ToList(), Method.POST, convertToPropertiesSchema: true);
+ _client.ExecuteBatch(path, contacts.Select(c => (object) c).ToList(), Method.Post, convertToPropertiesSchema: true);
}
///
diff --git a/HubSpot.NET/Api/ContactList/HubSpotContactListApi.cs b/HubSpot.NET/Api/ContactList/HubSpotContactListApi.cs
index d990899..a0fbeb9 100644
--- a/HubSpot.NET/Api/ContactList/HubSpotContactListApi.cs
+++ b/HubSpot.NET/Api/ContactList/HubSpotContactListApi.cs
@@ -97,7 +97,7 @@ public ContactListUpdateResponseModel AddContactsToList(long listId, IEnumerable
var model = new ContactListUpdateModel();
var path = $"{model.RouteBasePath}/{listId}/add";
model.ContactIds.AddRange(contactIds);
- var data = _client.Execute(path, model, Method.POST, convertToPropertiesSchema: false);
+ var data = _client.Execute(path, model, Method.Post, convertToPropertiesSchema: false);
return data;
}
@@ -113,7 +113,7 @@ public ContactListUpdateResponseModel RemoveContactsFromList(long listId, IEnume
var model = new ContactListUpdateModel();
var path = $"{model.RouteBasePath}/{listId}/remove";
model.ContactIds.AddRange(contactIds);
- var data = _client.Execute(path, model, Method.POST, convertToPropertiesSchema: false);
+ var data = _client.Execute(path, model, Method.Post, convertToPropertiesSchema: false);
return data;
}
@@ -125,7 +125,7 @@ public ContactListUpdateResponseModel RemoveContactsFromList(long listId, IEnume
public void DeleteContactList(long listId)
{
var path = $"{new ContactListModel().RouteBasePath}/{listId}";
- _client.Execute(path, method: Method.DELETE, convertToPropertiesSchema: true);
+ _client.Execute(path, method: Method.Delete, convertToPropertiesSchema: true);
}
///
@@ -141,7 +141,7 @@ public ContactListModel CreateStaticContactList(string contactListName )
Dynamic = false
};
var path = $"{model.RouteBasePath}";
- var data = _client.Execute(path, model, Method.POST, convertToPropertiesSchema: false);
+ var data = _client.Execute(path, model, Method.Post, convertToPropertiesSchema: false);
return data;
}
}
diff --git a/HubSpot.NET/Api/Deal/HubSpotDealApi.cs b/HubSpot.NET/Api/Deal/HubSpotDealApi.cs
index 74a4645..9757b8e 100644
--- a/HubSpot.NET/Api/Deal/HubSpotDealApi.cs
+++ b/HubSpot.NET/Api/Deal/HubSpotDealApi.cs
@@ -28,7 +28,7 @@ public HubSpotDealApi(IHubSpotClient client)
public T Create(T entity) where T : DealHubSpotModel, new()
{
var path = $"{entity.RouteBasePath}/deal";
- var data = _client.Execute(path, entity, Method.POST, convertToPropertiesSchema: true);
+ var data = _client.Execute(path, entity, Method.Post, convertToPropertiesSchema: true);
return data;
}
@@ -44,7 +44,7 @@ public HubSpotDealApi(IHubSpotClient client)
try
{
- var data = _client.Execute(path, Method.GET, convertToPropertiesSchema: true);
+ var data = _client.Execute(path, Method.Get, convertToPropertiesSchema: true);
return data;
}
catch (HubSpotException exception)
@@ -68,7 +68,7 @@ public HubSpotDealApi(IHubSpotClient client)
var path = $"{entity.RouteBasePath}/deal/{entity.Id}";
- var data = _client.Execute(path, entity, method: Method.PUT, convertToPropertiesSchema: true);
+ var data = _client.Execute(path, entity, method: Method.Put, convertToPropertiesSchema: true);
return data;
}
@@ -140,7 +140,7 @@ public void Delete(long dealId)
{
var path = $"{new DealHubSpotModel().RouteBasePath}/deal/{dealId}";
- _client.Execute(path, method: Method.DELETE, convertToPropertiesSchema: true);
+ _client.Execute(path, method: Method.Delete, convertToPropertiesSchema: true);
}
///
@@ -213,7 +213,7 @@ public void Delete(long dealId)
var path = "/crm/v3/objects/deals/search";
- var data = _client.ExecuteList>(path, opts, Method.POST, convertToPropertiesSchema: true);
+ var data = _client.ExecuteList>(path, opts, Method.Post, convertToPropertiesSchema: true);
return data;
}
@@ -234,7 +234,7 @@ public void Delete(long dealId)
toObjectId = companyId,
category = "HUBSPOT_DEFINED",
definitionId = 5 // see https://legacydocs.hubspot.com/docs/methods/crm-associations/crm-associations-overview
- }, method: Method.PUT, convertToPropertiesSchema: true);
+ }, method: Method.Put, convertToPropertiesSchema: true);
entity.Associations.AssociatedCompany = new[] { companyId };
return entity;
}
@@ -255,7 +255,7 @@ public void Delete(long dealId)
toObjectId = contactId,
category = "HUBSPOT_DEFINED",
definitionId = 3 // see https://legacydocs.hubspot.com/docs/methods/crm-associations/crm-associations-overview
- }, method: Method.PUT, convertToPropertiesSchema: true);
+ }, method: Method.Put, convertToPropertiesSchema: true);
entity.Associations.AssociatedContacts = new[] { contactId };
return entity;
}
diff --git a/HubSpot.NET/Api/EmailSubscriptions/HubSpotEmailSubcriptionsApi.cs b/HubSpot.NET/Api/EmailSubscriptions/HubSpotEmailSubcriptionsApi.cs
index 6283f47..ea5a659 100644
--- a/HubSpot.NET/Api/EmailSubscriptions/HubSpotEmailSubcriptionsApi.cs
+++ b/HubSpot.NET/Api/EmailSubscriptions/HubSpotEmailSubcriptionsApi.cs
@@ -43,7 +43,7 @@ public SubscriptionStatusHubSpotModel GetStatus(string email)
{
var path = $"{new SubscriptionTypeListHubSpotModel().RouteBasePath}/subscriptions/{email}";
- return _client.Execute(path, Method.GET, false);
+ return _client.Execute(path, Method.Get, false);
}
@@ -56,7 +56,7 @@ public void UnsubscribeAll(string email)
{
var path = $"{new SubscriptionTypeListHubSpotModel().RouteBasePath}/subscriptions/{email}";
- _client.Execute(path, new { unsubscribeFromAll = true }, Method.PUT, false);
+ _client.Execute(path, new { unsubscribeFromAll = true }, Method.Put, false);
}
///
@@ -81,7 +81,7 @@ public void UnsubscribeFrom(string email, long id)
}
};
- _client.Execute(path, model, Method.PUT, false);
+ _client.Execute(path, model, Method.Put, false);
}
@@ -133,7 +133,7 @@ public void SubscribeTo(string email, long id, string basis, string basisExplana
var path = $"{model.RouteBasePath}/{email}";
- _client.Execute(path, model, Method.PUT, false);
+ _client.Execute(path, model, Method.Put, false);
}
}
}
\ No newline at end of file
diff --git a/HubSpot.NET/Api/Engagement/HubSpotEngagementApi.cs b/HubSpot.NET/Api/Engagement/HubSpotEngagementApi.cs
index 465ec0b..e3b63d3 100644
--- a/HubSpot.NET/Api/Engagement/HubSpotEngagementApi.cs
+++ b/HubSpot.NET/Api/Engagement/HubSpotEngagementApi.cs
@@ -25,7 +25,7 @@ public HubSpotEngagementApi(IHubSpotClient client)
public EngagementHubSpotModel Create(EngagementHubSpotModel entity)
{
var path = $"{entity.RouteBasePath}/engagements";
- var data = _client.Execute(path, entity, Method.POST, false);
+ var data = _client.Execute(path, entity, Method.Post, false);
return data;
}
@@ -42,7 +42,7 @@ public void Update(EngagementHubSpotModel entity)
var path = $"{entity.RouteBasePath}/engagements/{entity.Engagement.Id}";
- _client.Execute(path, entity, Method.PATCH, false);
+ _client.Execute(path, entity, Method.Patch, false);
}
///
@@ -56,7 +56,7 @@ public EngagementHubSpotModel GetById(long engagementId)
try
{
- var data = _client.Execute(path, Method.GET, false);
+ var data = _client.Execute(path, Method.Get, false);
return data;
}
catch (HubSpotException exception)
@@ -120,7 +120,7 @@ public void Delete(long engagementId)
{
var path = $"{new EngagementHubSpotModel().RouteBasePath}/engagements/{engagementId}";
- _client.Execute(path, method: Method.DELETE, convertToPropertiesSchema: true);
+ _client.Execute(path, method: Method.Delete, convertToPropertiesSchema: true);
}
///
@@ -133,7 +133,7 @@ public void Associate(long engagementId, string objectType, long objectId)
{
var path = $"{new EngagementHubSpotModel().RouteBasePath}/engagements/{engagementId}/associations/{objectType}/{objectId}";
- _client.Execute(path, method: Method.PUT, convertToPropertiesSchema: true);
+ _client.Execute(path, method: Method.Put, convertToPropertiesSchema: true);
}
///
diff --git a/HubSpot.NET/Api/Files/HubSpotCosFileApi.cs b/HubSpot.NET/Api/Files/HubSpotCosFileApi.cs
index a50ec19..c3b5ccb 100644
--- a/HubSpot.NET/Api/Files/HubSpotCosFileApi.cs
+++ b/HubSpot.NET/Api/Files/HubSpotCosFileApi.cs
@@ -41,7 +41,7 @@ public HubSpotCosFileApi(IHubSpotClient client)
public FolderHubSpotModel CreateFolder(FolderHubSpotModel folder)
{
var path = $"{new FolderHubSpotModel().RouteBasePath}/folders";
- return _client.Execute(path, folder, Method.POST, false);
+ return _client.Execute(path, folder, Method.Post, false);
}
diff --git a/HubSpot.NET/Api/Properties/HubSpotCompaniesPropertiesApi.cs b/HubSpot.NET/Api/Properties/HubSpotCompaniesPropertiesApi.cs
index 930b499..898dbb9 100644
--- a/HubSpot.NET/Api/Properties/HubSpotCompaniesPropertiesApi.cs
+++ b/HubSpot.NET/Api/Properties/HubSpotCompaniesPropertiesApi.cs
@@ -24,21 +24,21 @@ public CompanyPropertyHubSpotModel Create(CompanyPropertyHubSpotModel property)
{
var path = $"{new PropertiesListHubSpotModel().RouteBasePath}";
- return _client.Execute(path, property, Method.POST, convertToPropertiesSchema: false);
+ return _client.Execute(path, property, Method.Post, convertToPropertiesSchema: false);
}
public CompanyPropertyHubSpotModel Update(CompanyPropertyHubSpotModel property)
{
var path = $"{new PropertiesListHubSpotModel().RouteBasePath}/named/{property.Name}";
- return _client.Execute(path, property, Method.PUT, convertToPropertiesSchema: false);
+ return _client.Execute(path, property, Method.Put, convertToPropertiesSchema: false);
}
public void Delete(string propertyName)
{
var path = $"{new PropertiesListHubSpotModel().RouteBasePath}/named/{propertyName}";
- _client.Execute(path, method: Method.DELETE, convertToPropertiesSchema: true);
+ _client.Execute(path, method: Method.Delete, convertToPropertiesSchema: true);
}
}
}
\ No newline at end of file
diff --git a/HubSpot.NET/Api/Task/HubSpotTaskApi.cs b/HubSpot.NET/Api/Task/HubSpotTaskApi.cs
index ec17a12..8d57759 100644
--- a/HubSpot.NET/Api/Task/HubSpotTaskApi.cs
+++ b/HubSpot.NET/Api/Task/HubSpotTaskApi.cs
@@ -30,7 +30,7 @@ public HubSpotTaskApi(IHubSpotClient client)
{
string path = $"{entity.RouteBasePath}";
- return _client.Execute(path, entity, Method.POST, SerialisationType.PropertyBag);
+ return _client.Execute(path, entity, Method.Post, SerialisationType.PropertyBag);
}
///
@@ -51,7 +51,7 @@ public HubSpotTaskApi(IHubSpotClient client)
try
{
- return _client.Execute(path, Method.GET, SerialisationType.PropertyBag);
+ return _client.Execute(path, Method.Get, SerialisationType.PropertyBag);
}
catch (HubSpotException exception)
{
@@ -94,7 +94,7 @@ public HubSpotTaskApi(IHubSpotClient client)
long entityId = entity.Id.Value;
string path = $"{entity.RouteBasePath}/{entity.Id}";
- T data = _client.Execute(path, entity, Method.PATCH, SerialisationType.PropertyBag);
+ T data = _client.Execute(path, entity, Method.Patch, SerialisationType.PropertyBag);
// this just undoes some dirty meddling
entity.Id = entityId;
@@ -109,7 +109,7 @@ public void Delete(long taskId)
{
var path = $"{new TaskHubSpotModel().RouteBasePath}/{taskId}";
- _client.Execute(path, method: Method.DELETE, convertToPropertiesSchema: true);
+ _client.Execute(path, method: Method.Delete, convertToPropertiesSchema: true);
}
}
}
\ No newline at end of file
diff --git a/HubSpot.NET/Api/Ticket/HubSpotTicketApi.cs b/HubSpot.NET/Api/Ticket/HubSpotTicketApi.cs
index 5303c47..3c01ded 100644
--- a/HubSpot.NET/Api/Ticket/HubSpotTicketApi.cs
+++ b/HubSpot.NET/Api/Ticket/HubSpotTicketApi.cs
@@ -28,7 +28,7 @@ public HubSpotTicketApi(IHubSpotClient client)
public T Create(T entity) where T : TicketHubSpotModel, new()
{
var path = $"{entity.RouteBasePath}";
- var data = _client.Execute(path, entity, Method.POST, SerialisationType.PropertyBag);
+ var data = _client.Execute(path, entity, Method.Post, SerialisationType.PropertyBag);
return data;
}
@@ -44,7 +44,7 @@ public HubSpotTicketApi(IHubSpotClient client)
try
{
- var data = _client.Execute(path, Method.GET, SerialisationType.PropertyBag);
+ var data = _client.Execute(path, Method.Get, SerialisationType.PropertyBag);
data.Id = data.ObjectId;
return data;
}
@@ -69,7 +69,7 @@ public HubSpotTicketApi(IHubSpotClient client)
var path = $"{entity.RouteBasePath}/{entity.Id}";
- var data = _client.Execute(path, entity, Method.PATCH, SerialisationType.PropertyBag);
+ var data = _client.Execute(path, entity, Method.Patch, SerialisationType.PropertyBag);
return data;
}
@@ -137,7 +137,7 @@ public void Delete(long ticketId)
{
var path = $"{new TicketHubSpotModel().RouteBasePath}/{ticketId}";
- _client.Execute(path, method: Method.DELETE, convertToPropertiesSchema: true);
+ _client.Execute(path, method: Method.Delete, convertToPropertiesSchema: true);
}
///
@@ -153,7 +153,7 @@ public void Delete(long ticketId)
var path = "/crm/v3/objects/tickets/search";
- var data = _client.ExecuteList>(path, opts, Method.POST, convertToPropertiesSchema: true);
+ var data = _client.ExecuteList>(path, opts, Method.Post, convertToPropertiesSchema: true);
return data;
}
@@ -172,7 +172,7 @@ public void Delete(long ticketId)
{
associationCategory = associationCategory,
associationTypeId = associationTypeId
- }}, method: Method.PUT, convertToPropertiesSchema: true);
+ }}, method: Method.Put, convertToPropertiesSchema: true);
entity.Associations.AssociatedCompany = new[] { companyId };
return entity;
}
@@ -186,7 +186,7 @@ public void DeleteCompanyAssociation(long ticketId, long companyId)
{
var path = $"https://api.hubapi.com/crm/v4/objects/tickets/{ticketId}/associations/company/{companyId}";
- _client.Execute(path, method: Method.DELETE, convertToPropertiesSchema: true);
+ _client.Execute(path, method: Method.Delete, convertToPropertiesSchema: true);
}
///
@@ -203,7 +203,7 @@ public void DeleteCompanyAssociation(long ticketId, long companyId)
{
associationCategory = associationCategory,
associationTypeId = associationTypeId
- }}, method: Method.PUT, convertToPropertiesSchema: true);
+ }}, method: Method.Put, convertToPropertiesSchema: true);
entity.Associations.AssociatedContacts = new[] { contactId };
return entity;
}
@@ -217,7 +217,7 @@ public void DeleteContactAssociation(long ticketId, long contactId)
{
var path = $"https://api.hubapi.com/crm/v4/objects/tickets/{ticketId}/associations/contact/{contactId}";
- _client.Execute(path, method: Method.DELETE, convertToPropertiesSchema: true);
+ _client.Execute(path, method: Method.Delete, convertToPropertiesSchema: true);
}
///
@@ -234,7 +234,7 @@ public void DeleteContactAssociation(long ticketId, long contactId)
{
associationCategory = associationCategory,
associationTypeId = associationTypeId
- }}, method: Method.PUT, convertToPropertiesSchema: true);
+ }}, method: Method.Put, convertToPropertiesSchema: true);
entity.Associations.AssociatedDeals = new[] { dealId };
return entity;
}
@@ -248,7 +248,7 @@ public void DeleteDealAssociation(long ticketId, long dealId)
{
var path = $"https://api.hubapi.com/crm/v4/objects/tickets/{ticketId}/associations/deal/{dealId}";
- _client.Execute(path, method: Method.DELETE, convertToPropertiesSchema: true);
+ _client.Execute(path, method: Method.Delete, convertToPropertiesSchema: true);
}
///
diff --git a/HubSpot.NET/Core/HubSpotBaseClient.cs b/HubSpot.NET/Core/HubSpotBaseClient.cs
index 8468f33..43f5167 100644
--- a/HubSpot.NET/Core/HubSpotBaseClient.cs
+++ b/HubSpot.NET/Core/HubSpotBaseClient.cs
@@ -49,13 +49,13 @@ public HubSpotBaseClient(HubSpotToken token)
Initialise();
}
- public T Execute(string absoluteUriPath, object entity = null, Method method = Method.GET, bool convertToPropertiesSchema = true) where T : IHubSpotModel, new()
+ public T Execute(string absoluteUriPath, object entity = null, Method method = Method.Get, bool convertToPropertiesSchema = true) where T : IHubSpotModel, new()
{
return Execute(absoluteUriPath, entity, method, convertToPropertiesSchema ? SerialisationType.PropertiesSchema : SerialisationType.Raw);
}
- public T Execute(string absoluteUriPath, object entity = null, Method method = Method.GET, SerialisationType serialisationType = SerialisationType.PropertyBag) where T : IHubSpotModel, new()
+ public T Execute(string absoluteUriPath, object entity = null, Method method = Method.Get, SerialisationType serialisationType = SerialisationType.PropertyBag) where T : IHubSpotModel, new()
{
- string json = (method == Method.GET || entity == null)
+ string json = (method == Method.Get || entity == null)
? null
: _serializer.SerializeEntity(entity, serialisationType);
@@ -64,55 +64,55 @@ public HubSpotBaseClient(HubSpotToken token)
return data;
}
- public T Execute(string absoluteUriPath, Method method = Method.GET, bool convertToPropertiesSchema = true) where T : IHubSpotModel, new()
+ public T Execute(string absoluteUriPath, Method method = Method.Get, bool convertToPropertiesSchema = true) where T : IHubSpotModel, new()
{
return Execute(absoluteUriPath, method, convertToPropertiesSchema ? SerialisationType.PropertiesSchema : SerialisationType.Raw);
}
- public T Execute(string absoluteUriPath, Method method = Method.GET, SerialisationType serialisationType = SerialisationType.PropertyBag) where T : IHubSpotModel, new()
+ public T Execute(string absoluteUriPath, Method method = Method.Get, SerialisationType serialisationType = SerialisationType.PropertyBag) where T : IHubSpotModel, new()
{
T data = SendRequest(absoluteUriPath, method, null, responseData => (T)_serializer.DeserializeEntity(responseData, serialisationType != SerialisationType.Raw));
return data;
}
- public void Execute(string absoluteUriPath, object entity = null, Method method = Method.GET, bool convertToPropertiesSchema = true)
+ public void Execute(string absoluteUriPath, object entity = null, Method method = Method.Get, bool convertToPropertiesSchema = true)
{
Execute(absoluteUriPath, entity, method, convertToPropertiesSchema ? SerialisationType.PropertiesSchema : SerialisationType.Raw);
}
- public void Execute(string absoluteUriPath, object entity = null, Method method = Method.GET, SerialisationType serialisationType = SerialisationType.PropertyBag)
+ public void Execute(string absoluteUriPath, object entity = null, Method method = Method.Get, SerialisationType serialisationType = SerialisationType.PropertyBag)
{
- string json = (method == Method.GET || entity == null)
+ string json = (method == Method.Get || entity == null)
? null
: _serializer.SerializeEntity(entity, serialisationType);
SendRequest(absoluteUriPath, method, json);
}
- public void ExecuteBatch(string absoluteUriPath, List