Created
September 17, 2024 12:13
-
-
Save mcohen01/637a196f86e77212ee8fa7678383071d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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