Skip to content

Instantly share code, notes, and snippets.

@mcohen01
Created September 17, 2024 12:13
Show Gist options
  • Save mcohen01/637a196f86e77212ee8fa7678383071d to your computer and use it in GitHub Desktop.
Save mcohen01/637a196f86e77212ee8fa7678383071d to your computer and use it in GitHub Desktop.
using System.Text.Json.Serialization;
using RestSharp;
var client = new RestSharp.RestClient(
new RestClientOptions("http://localhost:8080/api/"));
var request = new RestRequest(
"users/teller-accounts/token_55mrwcpjtk43b2qevuhfakvowy",
Method.Get);
var accounts = client.Execute<List<Account>>(request);
accounts.Data.ForEach(Console.WriteLine);
Console.ReadLine();
internal class Account
{
[JsonPropertyName("enrollment_id")]
public string EnrollmentId { get; set; }
public string Status { get; set; }
public string Subtype { get; set; }
public override string ToString()
{
return $"EnrollmentId: {EnrollmentId} {Environment.NewLine}" +
$"Status: {Status} {Environment.NewLine}" +
$"Subtype: {Subtype} {Environment.NewLine}";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment