Skip to content

Commit

Permalink
Allow client_id param in get devices querystring (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
magnus-tretton37 committed Mar 19, 2019
1 parent cdd3c84 commit 9eb6bff
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ test_script:
- ps: nuget install OpenCover -OutputDirectory packages -Version 4.7.922
- ps: dotnet tool install coveralls.net --tool-path tools
- ps: .\packages\OpenCover.4.7.922\tools\OpenCover.Console.exe -register:user -target:dotnet.exe -targetargs:"test Tests\Tests.csproj" -filter:"+[Castle.Sdk*]*" -oldStyle -output:opencoverCoverage.xml
- ps: .\tools\csmacnz.coveralls.exe --opencover -i opencoverCoverage.xml --repoToken $env:COVERALLS_REPO_TOKEN --commitId $env:APPVEYOR_REPO_COMMIT --commitBranch $env:APPVEYOR_REPO_BRANCH --commitAuthor $env:APPVEYOR_REPO_COMMIT_AUTHOR --commitEmail $env:APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL --commitMessage $env:APPVEYOR_REPO_COMMIT_MESSAGE --jobId $env:APPVEYOR_JOB_ID
- ps: .\tools\csmacnz.coveralls.exe --opencover --useRelativePaths --basePath "src" -i opencoverCoverage.xml --repoToken $env:COVERALLS_REPO_TOKEN --commitId $env:APPVEYOR_REPO_COMMIT --commitBranch $env:APPVEYOR_REPO_BRANCH --commitAuthor $env:APPVEYOR_REPO_COMMIT_AUTHOR --commitEmail $env:APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL --commitMessage $env:APPVEYOR_REPO_COMMIT_MESSAGE --jobId $env:APPVEYOR_JOB_ID
5 changes: 3 additions & 2 deletions src/Castle.Sdk/CastleClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,10 @@ public async Task Track(ActionRequest request)
await SendTrackRequest(jsonRequest);
}

public async Task<DeviceList> GetDevicesForUser(string userId)
public async Task<DeviceList> GetDevicesForUser(string userId, string clientId = null)
{
return await TryRequest(() => _messageSender.Get<DeviceList>($"/v1/users/{userId}/devices"));
var clientIdQuery = string.IsNullOrEmpty(clientId) ? "" : $"?client_id={clientId}";
return await TryRequest(() => _messageSender.Get<DeviceList>($"/v1/users/{userId}/devices{clientIdQuery}"));
}

public async Task<Device> GetDevice(string deviceToken)
Expand Down
2 changes: 2 additions & 0 deletions src/Castle.Sdk/Messages/Responses/DeviceItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,7 @@ public class DeviceItem
public DateTime? MitigatedAt { get; set; }

public DeviceContext Context { get; set; }

public bool IsCurrentDevice { get; set; }
}
}
2 changes: 1 addition & 1 deletion src/pack_to_local_folder.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ if (Test-Path $packagePath) {
}

dotnet pack (Join-Path $PSScriptRoot "Castle.Sdk")
nuget add (Join-Path $PSScriptRoot Castle.Sdk\bin\Debug\Castle.Sdk.1.0.0.nupkg) -source $packages
nuget add (Join-Path $PSScriptRoot Castle.Sdk\bin\Debug\Castle.Sdk.1.0.1.nupkg) -source $packages
dotnet nuget locals all --clear

0 comments on commit 9eb6bff

Please sign in to comment.