Skip to content

Commit

Permalink
Added ArchiveDevices endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
magnus-tretton37 committed Mar 26, 2019
1 parent 3640f43 commit 37f0ea6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Castle.Sdk/CastleClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ public async Task ImpersonateEnd(ImpersonateEndRequest request)
await TryRequest(() => _messageSender.Delete<VoidResponse>("/v1/impersonate", request));
}

public async Task ArchiveDevices(string userId)
{
await TryRequest(() => _messageSender.Put<VoidResponse>($"/v1/users/{userId}/archive_devices"));
}

private async Task<T> TryRequest<T>(Func<Task<T>> request)
where T : new()
{
Expand Down
7 changes: 7 additions & 0 deletions src/Tests/When_calling_client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,12 @@ public void Should_end_impersonation(ImpersonateEndRequest request, CastleClient
Func<Task> act = async () => await sut.ImpersonateEnd(request);
act.Should().NotThrow();
}

[Theory, AutoFakeData(typeof(CastleConfigurationNoTrackCustomization))]
public void Should_archive_devices(string userId, CastleClient sut)
{
Func<Task> act = async () => await sut.ArchiveDevices(userId);
act.Should().NotThrow();
}
}
}

0 comments on commit 37f0ea6

Please sign in to comment.