Skip to content

Commit

Permalink
Set up CI with Azure Pipelines (#62)
Browse files Browse the repository at this point in the history
Set up CI with Azure Pipelines, updated some code from a PR targeting `EmailEvents` to fit the latest codebase
  • Loading branch information
Psypher9 authored Nov 25, 2019
1 parent d3c5033 commit fb80df5
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 9 deletions.
6 changes: 3 additions & 3 deletions HubSpot.NET/Api/EmailEvents/HubSpotEmailEventsApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public HubSpotEmailEventsApi(IHubSpotClient client)
{
var path = $"{(new T()).RouteBasePath}/{campaignId}"
.SetQueryParam("appId", appId);
var data = _client.Execute<T>(path, Method.GET, convertToPropertiesSchema: false);
var data = _client.Execute<T>(path, Method.GET);
return data;
}

Expand All @@ -56,7 +56,7 @@ public HubSpotEmailEventsApi(IHubSpotClient client)
path = path.SetQueryParam("offset", opts.Offset);
}

var data = _client.ExecuteList<EmailCampaignListHubSpotModel<T>>(path, opts, convertToPropertiesSchema: false);
var data = _client.Execute<EmailCampaignListHubSpotModel<T>>(path);

return data;
}
Expand All @@ -82,7 +82,7 @@ public HubSpotEmailEventsApi(IHubSpotClient client)
path = path.SetQueryParam("offset", opts.Offset);
}

var data = _client.ExecuteList<EmailCampaignListHubSpotModel<T>>(path, opts, convertToPropertiesSchema: false);
var data = _client.Execute<EmailCampaignListHubSpotModel<T>>(path);

return data;
}
Expand Down
4 changes: 2 additions & 2 deletions HubSpot.NET/Api/Engagement/HubSpotEngagementApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public EngagementHubSpotModel GetById(long engagementId)
/// <returns>List of engagements, with additional metadata, e.g. total</returns>
public EngagementListHubSpotModel<T> List<T>(EngagementListRequestOptions opts = null) where T: EngagementHubSpotModel
{
opts = opts ?? new EngagementListRequestOptions();
opts = opts ?? new EngagementListRequestOptions();

var path = $"{GetRoute<T>("paged")}".SetQueryParam("limit", opts.Limit);

Expand All @@ -70,7 +70,7 @@ public EngagementListHubSpotModel<T> List<T>(EngagementListRequestOptions opts =
/// <returns>List of engagements, with additional metadata, e.g. total</returns>
public EngagementListHubSpotModel<T> ListRecent<T>(EngagementListRequestOptions opts = null) where T : EngagementHubSpotModel
{
opts ??= new EngagementListRequestOptions();
opts = opts ?? new EngagementListRequestOptions();

var path = $"{GetRoute<T>()}/engagements/recent/modified".SetQueryParam("count", opts.Limit);

Expand Down
3 changes: 2 additions & 1 deletion HubSpot.NET/Core/HubSpotApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using HubSpot.NET.Api.Company;
using HubSpot.NET.Api.Contact;
using HubSpot.NET.Api.Deal;
using HubSpot.NET.Api.EmailEvents;
using HubSpot.NET.Api.EmailSubscriptions;
using HubSpot.NET.Api.Engagement;
using HubSpot.NET.Api.Files;
Expand All @@ -27,7 +28,7 @@ public class HubSpotApi : IHubSpotApi
public IHubSpotCosFileApi File { get; private set; }
public IHubSpotOwnerApi Owner { get; private set; }
public IHubSpotCompanyPropertiesApi CompanyProperties { get; private set; }

public IHubSpotEmailEventsApi EmailEvents { get; private set; }
public IHubSpotEmailSubscriptionsApi EmailSubscriptions { get; private set; }
public IHubSpotTimelineApi Timelines { get; private set; }

Expand Down
6 changes: 3 additions & 3 deletions HubSpot.NET/HubSpot.NET.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@
<Company>HubSpot.NET</Company>
<Description>C# .NET client library targeting the HubSpot APIs.</Description>
<Copyright>HubSpot.NET</Copyright>
<PackageLicenseUrl>https://github.com/squaredup/HubSpot.NET/blob/master/LICENSE</PackageLicenseUrl>
<PackageLicenseUrl>https://github.com/hubspot-net/HubSpot.NET/blob/master/LICENSE</PackageLicenseUrl>
<PackageProjectUrl>https://github.com/hubspot-net/HubSpot.NET</PackageProjectUrl>
<RepositoryUrl>https://github.com/hubspot-net/HubSpot.NET.git</RepositoryUrl>
<PackageTags>hubspot api wrapper c# contact company deal engagement properties crm</PackageTags>
<PackageReleaseNotes>0.8.13</PackageReleaseNotes>
<PackageId>HubSpot.NET</PackageId>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<LangVersion>7.1</LangVersion>
<LangVersion>7.3</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<LangVersion>7.1</LangVersion>
<LangVersion>7.3</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Flurl" Version="2.8.0" />
Expand Down
40 changes: 40 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# ASP.NET Core (.NET Framework)
# Build and test ASP.NET Core projects targeting the full .NET Framework.
# Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core

trigger:
branches:
include:
- master
- refs/tags/*

pr:
- master

pool:
vmImage: 'windows-latest'

variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'

steps:
- task: NuGetToolInstaller@1

- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'

- task: VSBuild@1
inputs:
solution: '$(solution)'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation="$(build.artifactStagingDirectory)\WebApp.zip" /p:DeployIisAppPath="Default Web Site"'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'

- task: VSTest@2
inputs:
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'

0 comments on commit fb80df5

Please sign in to comment.