Created
December 15, 2019 03:50
-
-
Save tabvn/f8356a4062eba14ee59eadaacb205c5c 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; | |
using System.Net.Http; | |
using System.Net.Http.Headers; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Collections.Generic; | |
using System.Globalization; | |
using Newtonsoft.Json; | |
using Newtonsoft.Json.Converters; | |
namespace bha | |
{ | |
public class GraphQL | |
{ | |
static HttpClient httpClient = new HttpClient(); | |
public string token { get; set; } | |
public GraphQL() | |
{ | |
} | |
public async Task<string> Execute(dynamic data) | |
{ | |
var json = JsonConvert.SerializeObject(data); | |
if (token != null && token != "") | |
{ | |
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); | |
} | |
var url = "https://api.cloud.bodyhealthanalyzer.com/query"; | |
var response = await httpClient.PostAsync(url, new StringContent(json, Encoding.UTF8, "application/json")); | |
string result = response.Content.ReadAsStringAsync().Result; | |
Console.WriteLine(result); | |
return result; | |
} | |
public partial class Token | |
{ | |
[JsonProperty("id")] | |
public string Id { get; set; } | |
[JsonProperty("user")] | |
public User User { get; set; } | |
[JsonProperty("expiredAt")] | |
public long ExpiredAt { get; set; } | |
} | |
public partial class Sharing | |
{ | |
[JsonProperty("id")] | |
[JsonConverter(typeof(ParseStringConverter))] | |
public long Id { get; set; } | |
[JsonProperty("client")] | |
public Client Client { get; set; } | |
[JsonProperty("acceptClient")] | |
public bool AcceptClient { get; set; } | |
[JsonProperty("acceptCaregiver")] | |
public bool AcceptCaregiver { get; set; } | |
[JsonProperty("createdAt")] | |
public DateTimeOffset CreatedAt { get; set; } | |
} | |
public partial class User | |
{ | |
[JsonProperty("id")] | |
[JsonConverter(typeof(ParseStringConverter))] | |
public long Id { get; set; } | |
[JsonProperty("userType")] | |
public string UserType { get; set; } | |
[JsonProperty("firstName")] | |
public string FirstName { get; set; } | |
[JsonProperty("lastName")] | |
public string LastName { get; set; } | |
[JsonProperty("namePrefix")] | |
public string NamePrefix { get; set; } | |
[JsonProperty("nameSuffix")] | |
public string NameSuffix { get; set; } | |
[JsonProperty("phone")] | |
public string Phone { get; set; } | |
[JsonProperty("email")] | |
public string Email { get; set; } | |
[JsonProperty("username")] | |
public string Username { get; set; } | |
[JsonProperty("roles")] | |
public string[] Roles { get; set; } | |
[JsonProperty("address")] | |
public string Address { get; set; } | |
[JsonProperty("status")] | |
public string Status { get; set; } | |
[JsonProperty("language")] | |
public string Language { get; set; } | |
[JsonProperty("measuringSystem")] | |
public string MeasuringSystem { get; set; } | |
[JsonProperty("lastAccessed")] | |
public DateTimeOffset? LastAccessed { get; set; } | |
[JsonProperty("lastResetPassword")] | |
public DateTimeOffset? LastResetPassword { get; set; } | |
[JsonProperty("isPasswordExpired")] | |
public bool IsPasswordExpired { get; set; } | |
[JsonProperty("createdAt")] | |
public DateTimeOffset CreatedAt { get; set; } | |
[JsonProperty("caregiver")] | |
public Caregiver Caregiver { get; set; } | |
[JsonProperty("client")] | |
public Client Client { get; set; } | |
[JsonProperty("enabledProcedures")] | |
public EnabledProcedure[] EnabledProcedures { get; set; } | |
} | |
public partial class DataConnection | |
{ | |
[JsonProperty("total")] | |
public long Total { get; set; } | |
[JsonProperty("nodes")] | |
public Data[] Nodes { get; set; } | |
} | |
public partial class Caregiver | |
{ | |
[JsonProperty("id")] | |
[JsonConverter(typeof(ParseStringConverter))] | |
public long Id { get; set; } | |
[JsonProperty("businessName")] | |
public string BusinessName { get; set; } | |
[JsonProperty("shareCode")] | |
public string ShareCode { get; set; } | |
} | |
public partial class Client | |
{ | |
[JsonProperty("id")] | |
[JsonConverter(typeof(ParseStringConverter))] | |
public long Id { get; set; } | |
[JsonProperty("caregiverRegistrationNumber")] | |
public string CaregiverRegistrationNumber { get; set; } | |
[JsonProperty("gender")] | |
public string Gender { get; set; } | |
[JsonProperty("dateOfBirth")] | |
public string DateOfBirth { get; set; } | |
[JsonProperty("heathNotes")] | |
public string HeathNotes { get; set; } | |
[JsonProperty("guide")] | |
public Guide Guide { get; set; } | |
[JsonProperty("preferredBreathRate")] | |
public string PreferredBreathRate { get; set; } | |
[JsonProperty("audioGuide")] | |
public bool AudioGuide { get; set; } | |
[JsonProperty("audioType")] | |
public string AudioType { get; set; } | |
[JsonProperty("audioFile")] | |
public string AudioFile { get; set; } | |
[JsonProperty("disclaimerAccepted")] | |
public bool? DisclaimerAccepted { get; set; } | |
[JsonProperty("lastTested")] | |
public DateTimeOffset? LastTested { get; set; } | |
} | |
public partial class CaregiverInviteInfo | |
{ | |
[JsonProperty("id")] | |
[JsonConverter(typeof(ParseStringConverter))] | |
public long Id { get; set; } | |
[JsonProperty("clientUserId")] | |
[JsonConverter(typeof(ParseStringConverter))] | |
public long? ClientUserId { get; set; } | |
[JsonProperty("businessName")] | |
public string BusinessName { get; set; } | |
[JsonProperty("inviteEmail")] | |
public string InviteEmail { get; set; } | |
} | |
public partial class UserConnection | |
{ | |
[JsonProperty("total")] | |
public long Total { get; set; } | |
[JsonProperty("nodes")] | |
public User[] Nodes { get; set; } | |
} | |
public partial class CaregiverPublicInfo | |
{ | |
[JsonProperty("id")] | |
[JsonConverter(typeof(ParseStringConverter))] | |
public long Id { get; set; } | |
[JsonProperty("businessName")] | |
public string BusinessName { get; set; } | |
} | |
public partial class Guide | |
{ | |
[JsonProperty("id")] | |
[JsonConverter(typeof(ParseStringConverter))] | |
public long Id { get; set; } | |
[JsonProperty("caregiver")] | |
public Caregiver Caregiver { get; set; } | |
[JsonProperty("name")] | |
public string Name { get; set; } | |
[JsonProperty("inhaleTime")] | |
public double? InhaleTime { get; set; } | |
[JsonProperty("holdTime")] | |
public double? HoldTime { get; set; } | |
[JsonProperty("exhaleTime")] | |
public double? ExhaleTime { get; set; } | |
[JsonProperty("pauseTime")] | |
public double? PauseTime { get; set; } | |
[JsonProperty("isPredefined")] | |
public bool IsPredefined { get; set; } | |
[JsonProperty("createdAt")] | |
public DateTimeOffset CreatedAt { get; set; } | |
} | |
public partial class EnabledProcedure | |
{ | |
[JsonProperty("id")] | |
public string Id { get; set; } | |
[JsonProperty("procedureId")] | |
[JsonConverter(typeof(ParseStringConverter))] | |
public long ProcedureId { get; set; } | |
[JsonProperty("name")] | |
public string Name { get; set; } | |
[JsonProperty("isEnabled")] | |
public bool IsEnabled { get; set; } | |
[JsonProperty("createdAt")] | |
public DateTimeOffset? CreatedAt { get; set; } | |
} | |
public partial class Data | |
{ | |
[JsonProperty("id")] | |
[JsonConverter(typeof(ParseStringConverter))] | |
public long Id { get; set; } | |
[JsonProperty("procedure")] | |
public Procedure Procedure { get; set; } | |
[JsonProperty("user")] | |
public User User { get; set; } | |
[JsonProperty("procedureComment")] | |
public string ProcedureComment { get; set; } | |
[JsonProperty("data")] | |
public string RawData { get; set; } | |
[JsonProperty("rawData1")] | |
public string RawData1 { get; set; } | |
[JsonProperty("rawData2")] | |
public string RawData2 { get; set; } | |
[JsonProperty("createdAt")] | |
public DateTimeOffset CreatedAt { get; set; } | |
} | |
public partial class GuideConnection | |
{ | |
[JsonProperty("total")] | |
public long Total { get; set; } | |
[JsonProperty("nodes")] | |
public Guide[] Nodes { get; set; } | |
} | |
public partial class Procedure | |
{ | |
[JsonProperty("id")] | |
[JsonConverter(typeof(ParseStringConverter))] | |
public long Id { get; set; } | |
[JsonProperty("name")] | |
public string Name { get; set; } | |
[JsonProperty("createdAt")] | |
public DateTimeOffset CreatedAt { get; set; } | |
} | |
public partial class UpdateGuide | |
{ | |
[JsonProperty("id")] | |
public long Id { get; set; } | |
[JsonProperty("name")] | |
public string Name { get; set; } | |
[JsonProperty("inhaleTime")] | |
public double? InhaleTime { get; set; } | |
[JsonProperty("holdTime")] | |
public double? HoldTime { get; set; } | |
[JsonProperty("exhaleTime")] | |
public double? ExhaleTime { get; set; } | |
[JsonProperty("pauseTime")] | |
public double? PauseTime { get; set; } | |
} | |
public partial class FindFilter | |
{ | |
[JsonProperty("search")] | |
public string Search { get; set; } | |
[JsonProperty("limit")] | |
public long? Limit { get; set; } | |
[JsonProperty("offset")] | |
public long? Offset { get; set; } | |
} | |
public partial class NewAccount | |
{ | |
[JsonProperty("userType")] | |
public string UserType { get; set; } | |
[JsonProperty("firstName")] | |
public string FirstName { get; set; } | |
[JsonProperty("lastName")] | |
public string LastName { get; set; } | |
[JsonProperty("namePrefix")] | |
public string NamePrefix { get; set; } | |
[JsonProperty("nameSuffix")] | |
public string NameSuffix { get; set; } | |
[JsonProperty("phone")] | |
public string Phone { get; set; } | |
[JsonProperty("email")] | |
public string Email { get; set; } | |
[JsonProperty("username")] | |
public string Username { get; set; } | |
[JsonProperty("password")] | |
public string Password { get; set; } | |
[JsonProperty("address")] | |
public string Address { get; set; } | |
[JsonProperty("language")] | |
public string Language { get; set; } | |
[JsonProperty("measuringSystem")] | |
public string MeasuringSystem { get; set; } | |
} | |
public partial class RequestResetPassword | |
{ | |
[JsonProperty("email")] | |
public string Email { get; set; } | |
[JsonProperty("username")] | |
public string Username { get; set; } | |
} | |
public partial class NewUser | |
{ | |
[JsonProperty("account")] | |
public NewAccount Account { get; set; } | |
[JsonProperty("client")] | |
public NewClient Client { get; set; } | |
[JsonProperty("caregiver")] | |
public NewCaregiver Caregiver { get; set; } | |
} | |
public partial class UpdateProcedure | |
{ | |
[JsonProperty("id")] | |
public long Id { get; set; } | |
[JsonProperty("name")] | |
public string Name { get; set; } | |
} | |
public partial class NewGuide | |
{ | |
[JsonProperty("name")] | |
public string Name { get; set; } | |
[JsonProperty("inhaleTime")] | |
public double? InhaleTime { get; set; } | |
[JsonProperty("holdTime")] | |
public double? HoldTime { get; set; } | |
[JsonProperty("exhaleTime")] | |
public double? ExhaleTime { get; set; } | |
[JsonProperty("pauseTime")] | |
public double? PauseTime { get; set; } | |
} | |
public partial class NewCaregiver | |
{ | |
[JsonProperty("businessName")] | |
public string BusinessName { get; set; } | |
} | |
public partial class UpdateEnableProcedures | |
{ | |
[JsonProperty("userId")] | |
public long? UserId { get; set; } | |
[JsonProperty("procedures")] | |
public UpdateEnableProcedure[] Procedures { get; set; } | |
} | |
public partial class NewCaregiverClient | |
{ | |
[JsonProperty("firstName")] | |
public string FirstName { get; set; } | |
[JsonProperty("lastName")] | |
public string LastName { get; set; } | |
[JsonProperty("namePrefix")] | |
public string NamePrefix { get; set; } | |
[JsonProperty("nameSuffix")] | |
public string NameSuffix { get; set; } | |
[JsonProperty("phone")] | |
public string Phone { get; set; } | |
[JsonProperty("email")] | |
public string Email { get; set; } | |
[JsonProperty("username")] | |
public string Username { get; set; } | |
[JsonProperty("gender")] | |
public string Gender { get; set; } | |
[JsonProperty("dateOfBirth")] | |
public string DateOfBirth { get; set; } | |
[JsonProperty("heathNotes")] | |
public string HeathNotes { get; set; } | |
} | |
public partial class UpdateData | |
{ | |
[JsonProperty("id")] | |
public long Id { get; set; } | |
[JsonProperty("procedureComment")] | |
public string ProcedureComment { get; set; } | |
} | |
public partial class Login | |
{ | |
[JsonProperty("username")] | |
public string Username { get; set; } | |
[JsonProperty("email")] | |
public string Email { get; set; } | |
[JsonProperty("password")] | |
public string Password { get; set; } | |
} | |
public partial class NewClient | |
{ | |
[JsonProperty("caregiverRegistrationNumber")] | |
public string CaregiverRegistrationNumber { get; set; } | |
[JsonProperty("caregiverInviteToken")] | |
public string CaregiverInviteToken { get; set; } | |
[JsonProperty("gender")] | |
public string Gender { get; set; } | |
[JsonProperty("dateOfBirth")] | |
public string DateOfBirth { get; set; } | |
[JsonProperty("healthNotes")] | |
public string HealthNotes { get; set; } | |
[JsonProperty("guideId")] | |
public long? GuideId { get; set; } | |
[JsonProperty("preferredBreathRate")] | |
public string PreferredBreathRate { get; set; } | |
[JsonProperty("audioGuide")] | |
public bool? AudioGuide { get; set; } | |
[JsonProperty("audioType")] | |
public string AudioType { get; set; } | |
[JsonProperty("audioFile")] | |
public string AudioFile { get; set; } | |
[JsonProperty("disclaimerAccepted")] | |
public bool? DisclaimerAccepted { get; set; } | |
} | |
public partial class ResetPassword | |
{ | |
[JsonProperty("newPassword")] | |
public string NewPassword { get; set; } | |
[JsonProperty("token")] | |
public string Token { get; set; } | |
} | |
public partial class NewData | |
{ | |
[JsonProperty("procedureId")] | |
public long ProcedureId { get; set; } | |
[JsonProperty("clientId")] | |
public long? ClientId { get; set; } | |
[JsonProperty("procedureComment")] | |
public string ProcedureComment { get; set; } | |
[JsonProperty("data")] | |
public string Data { get; set; } | |
[JsonProperty("rawData1")] | |
public string RawData1 { get; set; } | |
[JsonProperty("rawData2")] | |
public string RawData2 { get; set; } | |
} | |
public partial class DataFilter | |
{ | |
[JsonProperty("search")] | |
public string Search { get; set; } | |
[JsonProperty("procedureId")] | |
public long? ProcedureId { get; set; } | |
[JsonProperty("clientId")] | |
public long? ClientId { get; set; } | |
[JsonProperty("limit")] | |
public long? Limit { get; set; } | |
[JsonProperty("offset")] | |
public long? Offset { get; set; } | |
} | |
public partial class UpdateEnableProcedure | |
{ | |
[JsonProperty("procedureId")] | |
public long ProcedureId { get; set; } | |
[JsonProperty("isEnabled")] | |
public bool IsEnabled { get; set; } | |
} | |
public partial class UpdateUser | |
{ | |
[JsonProperty("id")] | |
public long Id { get; set; } | |
[JsonProperty("firstName")] | |
public string FirstName { get; set; } | |
[JsonProperty("lastName")] | |
public string LastName { get; set; } | |
[JsonProperty("namePrefix")] | |
public string NamePrefix { get; set; } | |
[JsonProperty("nameSuffix")] | |
public string NameSuffix { get; set; } | |
[JsonProperty("phone")] | |
public string Phone { get; set; } | |
[JsonProperty("email")] | |
public string Email { get; set; } | |
[JsonProperty("username")] | |
public string Username { get; set; } | |
[JsonProperty("address")] | |
public string Address { get; set; } | |
[JsonProperty("status")] | |
public string Status { get; set; } | |
[JsonProperty("roles")] | |
public string[] Roles { get; set; } | |
[JsonProperty("newPassword")] | |
public string NewPassword { get; set; } | |
[JsonProperty("isPasswordExpired")] | |
public bool? IsPasswordExpired { get; set; } | |
} | |
public partial class RegisterMutation | |
{ | |
public RegisterMutation() | |
{ | |
Query = @"mutation register($input:NewUser!) { register(input: $input){id userType firstName lastName namePrefix nameSuffix phone email username roles address status language measuringSystem lastAccessed lastResetPassword isPasswordExpired createdAt caregiver {id businessName shareCode }client {id caregiverRegistrationNumber gender dateOfBirth heathNotes guide {id caregiver {id businessName shareCode }name inhaleTime holdTime exhaleTime pauseTime isPredefined createdAt }preferredBreathRate audioGuide audioType audioFile disclaimerAccepted lastTested }enabledProcedures {id procedureId name isEnabled createdAt }}}"; | |
} | |
[JsonProperty("operationName")] | |
public string OperationName { get; set; } | |
[JsonProperty("query")] | |
public string Query { get; set; } | |
[JsonProperty("variables")] | |
public RegisterVariables Variables { get; set; } | |
} | |
public partial class RegisterVariables | |
{ | |
[JsonProperty("input")] | |
public NewUser Input { get; set; } | |
} | |
public partial class RegisterMutationResponse | |
{ | |
[JsonProperty("errors")] | |
public Error[] Errors { get; set; } | |
[JsonProperty("data")] | |
public RegisterData Data { get; set; } | |
} | |
public partial class RegisterData | |
{ | |
[JsonProperty("Register")] | |
public User Register { get; set; } | |
} | |
public partial class RegisterMutationResponse | |
{ | |
public static RegisterMutationResponse FromJson(string json) => JsonConvert.DeserializeObject<RegisterMutationResponse>(json, bha.Converter.Settings); | |
} | |
public partial class LoginMutation | |
{ | |
public LoginMutation() | |
{ | |
Query = @"mutation login($input:Login!) { login(input: $input){id user {id userType firstName lastName namePrefix nameSuffix phone email username roles address status language measuringSystem lastAccessed lastResetPassword isPasswordExpired createdAt caregiver {id businessName shareCode }client {id caregiverRegistrationNumber gender dateOfBirth heathNotes guide {id caregiver {id businessName shareCode }name inhaleTime holdTime exhaleTime pauseTime isPredefined createdAt }preferredBreathRate audioGuide audioType audioFile disclaimerAccepted lastTested }enabledProcedures {id procedureId name isEnabled createdAt }}expiredAt }}"; | |
} | |
[JsonProperty("operationName")] | |
public string OperationName { get; set; } | |
[JsonProperty("query")] | |
public string Query { get; set; } | |
[JsonProperty("variables")] | |
public LoginVariables Variables { get; set; } | |
} | |
public partial class LoginVariables | |
{ | |
[JsonProperty("input")] | |
public Login Input { get; set; } | |
} | |
public partial class LoginMutationResponse | |
{ | |
[JsonProperty("errors")] | |
public Error[] Errors { get; set; } | |
[JsonProperty("data")] | |
public LoginData Data { get; set; } | |
} | |
public partial class LoginData | |
{ | |
[JsonProperty("Login")] | |
public Token Login { get; set; } | |
} | |
public partial class LoginMutationResponse | |
{ | |
public static LoginMutationResponse FromJson(string json) => JsonConvert.DeserializeObject<LoginMutationResponse>(json, bha.Converter.Settings); | |
} | |
public partial class LogoutMutation | |
{ | |
public LogoutMutation() | |
{ | |
Query = @"mutation logout{logout}"; | |
} | |
[JsonProperty("operationName")] | |
public string OperationName { get; set; } | |
[JsonProperty("query")] | |
public string Query { get; set; } | |
[JsonProperty("variables")] | |
public LogoutVariables Variables { get; set; } | |
} | |
public partial class LogoutVariables | |
{ | |
} | |
public partial class LogoutMutationResponse | |
{ | |
[JsonProperty("errors")] | |
public Error[] Errors { get; set; } | |
[JsonProperty("data")] | |
public LogoutData Data { get; set; } | |
} | |
public partial class LogoutData | |
{ | |
[JsonProperty("Logout")] | |
public bool Logout { get; set; } | |
} | |
public partial class LogoutMutationResponse | |
{ | |
public static LogoutMutationResponse FromJson(string json) => JsonConvert.DeserializeObject<LogoutMutationResponse>(json, bha.Converter.Settings); | |
} | |
public partial class UpdateUserMutation | |
{ | |
public UpdateUserMutation() | |
{ | |
Query = @"mutation updateUser($input:UpdateUser!) { updateUser(input: $input){id userType firstName lastName namePrefix nameSuffix phone email username roles address status language measuringSystem lastAccessed lastResetPassword isPasswordExpired createdAt caregiver {id businessName shareCode }client {id caregiverRegistrationNumber gender dateOfBirth heathNotes guide {id caregiver {id businessName shareCode }name inhaleTime holdTime exhaleTime pauseTime isPredefined createdAt }preferredBreathRate audioGuide audioType audioFile disclaimerAccepted lastTested }enabledProcedures {id procedureId name isEnabled createdAt }}}"; | |
} | |
[JsonProperty("operationName")] | |
public string OperationName { get; set; } | |
[JsonProperty("query")] | |
public string Query { get; set; } | |
[JsonProperty("variables")] | |
public UpdateUserVariables Variables { get; set; } | |
} | |
public partial class UpdateUserVariables | |
{ | |
[JsonProperty("input")] | |
public UpdateUser Input { get; set; } | |
} | |
public partial class UpdateUserMutationResponse | |
{ | |
[JsonProperty("errors")] | |
public Error[] Errors { get; set; } | |
[JsonProperty("data")] | |
public UpdateUserData Data { get; set; } | |
} | |
public partial class UpdateUserData | |
{ | |
[JsonProperty("UpdateUser")] | |
public User UpdateUser { get; set; } | |
} | |
public partial class UpdateUserMutationResponse | |
{ | |
public static UpdateUserMutationResponse FromJson(string json) => JsonConvert.DeserializeObject<UpdateUserMutationResponse>(json, bha.Converter.Settings); | |
} | |
public partial class RequestResetPasswordMutation | |
{ | |
public RequestResetPasswordMutation() | |
{ | |
Query = @"mutation requestResetPassword($input:RequestResetPassword!) { requestResetPassword(input: $input)"; | |
} | |
[JsonProperty("operationName")] | |
public string OperationName { get; set; } | |
[JsonProperty("query")] | |
public string Query { get; set; } | |
[JsonProperty("variables")] | |
public RequestResetPasswordVariables Variables { get; set; } | |
} | |
public partial class RequestResetPasswordVariables | |
{ | |
[JsonProperty("input")] | |
public RequestResetPassword Input { get; set; } | |
} | |
public partial class RequestResetPasswordMutationResponse | |
{ | |
[JsonProperty("errors")] | |
public Error[] Errors { get; set; } | |
[JsonProperty("data")] | |
public RequestResetPasswordData Data { get; set; } | |
} | |
public partial class RequestResetPasswordData | |
{ | |
[JsonProperty("RequestResetPassword")] | |
public bool RequestResetPassword { get; set; } | |
} | |
public partial class RequestResetPasswordMutationResponse | |
{ | |
public static RequestResetPasswordMutationResponse FromJson(string json) => JsonConvert.DeserializeObject<RequestResetPasswordMutationResponse>(json, bha.Converter.Settings); | |
} | |
public partial class ResetPasswordMutation | |
{ | |
public ResetPasswordMutation() | |
{ | |
Query = @"mutation resetPassword($input:ResetPassword!) { resetPassword(input: $input)"; | |
} | |
[JsonProperty("operationName")] | |
public string OperationName { get; set; } | |
[JsonProperty("query")] | |
public string Query { get; set; } | |
[JsonProperty("variables")] | |
public ResetPasswordVariables Variables { get; set; } | |
} | |
public partial class ResetPasswordVariables | |
{ | |
[JsonProperty("input")] | |
public ResetPassword Input { get; set; } | |
} | |
public partial class ResetPasswordMutationResponse | |
{ | |
[JsonProperty("errors")] | |
public Error[] Errors { get; set; } | |
[JsonProperty("data")] | |
public ResetPasswordData Data { get; set; } | |
} | |
public partial class ResetPasswordData | |
{ | |
[JsonProperty("ResetPassword")] | |
public bool ResetPassword { get; set; } | |
} | |
public partial class ResetPasswordMutationResponse | |
{ | |
public static ResetPasswordMutationResponse FromJson(string json) => JsonConvert.DeserializeObject<ResetPasswordMutationResponse>(json, bha.Converter.Settings); | |
} | |
public partial class EnableUserProceduresMutation | |
{ | |
public EnableUserProceduresMutation() | |
{ | |
Query = @"mutation enableUserProcedures($input:UpdateEnableProcedures!) { enableUserProcedures(input: $input)"; | |
} | |
[JsonProperty("operationName")] | |
public string OperationName { get; set; } | |
[JsonProperty("query")] | |
public string Query { get; set; } | |
[JsonProperty("variables")] | |
public EnableUserProceduresVariables Variables { get; set; } | |
} | |
public partial class EnableUserProceduresVariables | |
{ | |
[JsonProperty("input")] | |
public UpdateEnableProcedures Input { get; set; } | |
} | |
public partial class EnableUserProceduresMutationResponse | |
{ | |
[JsonProperty("errors")] | |
public Error[] Errors { get; set; } | |
[JsonProperty("data")] | |
public EnableUserProceduresData Data { get; set; } | |
} | |
public partial class EnableUserProceduresData | |
{ | |
[JsonProperty("EnableUserProcedures")] | |
public bool EnableUserProcedures { get; set; } | |
} | |
public partial class EnableUserProceduresMutationResponse | |
{ | |
public static EnableUserProceduresMutationResponse FromJson(string json) => JsonConvert.DeserializeObject<EnableUserProceduresMutationResponse>(json, bha.Converter.Settings); | |
} | |
public partial class UpdateProcedureMutation | |
{ | |
public UpdateProcedureMutation() | |
{ | |
Query = @"mutation updateProcedure($input:UpdateProcedure!) { updateProcedure(input: $input){id name createdAt }}"; | |
} | |
[JsonProperty("operationName")] | |
public string OperationName { get; set; } | |
[JsonProperty("query")] | |
public string Query { get; set; } | |
[JsonProperty("variables")] | |
public UpdateProcedureVariables Variables { get; set; } | |
} | |
public partial class UpdateProcedureVariables | |
{ | |
[JsonProperty("input")] | |
public UpdateProcedure Input { get; set; } | |
} | |
public partial class UpdateProcedureMutationResponse | |
{ | |
[JsonProperty("errors")] | |
public Error[] Errors { get; set; } | |
[JsonProperty("data")] | |
public UpdateProcedureData Data { get; set; } | |
} | |
public partial class UpdateProcedureData | |
{ | |
[JsonProperty("UpdateProcedure")] | |
public Procedure UpdateProcedure { get; set; } | |
} | |
public partial class UpdateProcedureMutationResponse | |
{ | |
public static UpdateProcedureMutationResponse FromJson(string json) => JsonConvert.DeserializeObject<UpdateProcedureMutationResponse>(json, bha.Converter.Settings); | |
} | |
public partial class DeleteProcedureMutation | |
{ | |
public DeleteProcedureMutation() | |
{ | |
Query = @"mutation deleteProcedure($id:ID!) { deleteProcedure(id: $id)"; | |
} | |
[JsonProperty("operationName")] | |
public string OperationName { get; set; } | |
[JsonProperty("query")] | |
public string Query { get; set; } | |
[JsonProperty("variables")] | |
public DeleteProcedureVariables Variables { get; set; } | |
} | |
public partial class DeleteProcedureVariables | |
{ | |
[JsonProperty("id")] | |
public long Id { get; set; } | |
} | |
public partial class DeleteProcedureMutationResponse | |
{ | |
[JsonProperty("errors")] | |
public Error[] Errors { get; set; } | |
[JsonProperty("data")] | |
public DeleteProcedureData Data { get; set; } | |
} | |
public partial class DeleteProcedureData | |
{ | |
[JsonProperty("DeleteProcedure")] | |
public bool DeleteProcedure { get; set; } | |
} | |
public partial class DeleteProcedureMutationResponse | |
{ | |
public static DeleteProcedureMutationResponse FromJson(string json) => JsonConvert.DeserializeObject<DeleteProcedureMutationResponse>(json, bha.Converter.Settings); | |
} | |
public partial class InviteClientMutation | |
{ | |
public InviteClientMutation() | |
{ | |
Query = @"mutation inviteClient($email:String!) { inviteClient(email: $email)"; | |
} | |
[JsonProperty("operationName")] | |
public string OperationName { get; set; } | |
[JsonProperty("query")] | |
public string Query { get; set; } | |
[JsonProperty("variables")] | |
public InviteClientVariables Variables { get; set; } | |
} | |
public partial class InviteClientVariables | |
{ | |
[JsonProperty("email")] | |
public string Email { get; set; } | |
} | |
public partial class InviteClientMutationResponse | |
{ | |
[JsonProperty("errors")] | |
public Error[] Errors { get; set; } | |
[JsonProperty("data")] | |
public InviteClientData Data { get; set; } | |
} | |
public partial class InviteClientData | |
{ | |
[JsonProperty("InviteClient")] | |
public bool InviteClient { get; set; } | |
} | |
public partial class InviteClientMutationResponse | |
{ | |
public static InviteClientMutationResponse FromJson(string json) => JsonConvert.DeserializeObject<InviteClientMutationResponse>(json, bha.Converter.Settings); | |
} | |
public partial class StopShareWithCaregiverMutation | |
{ | |
public StopShareWithCaregiverMutation() | |
{ | |
Query = @"mutation stopShareWithCaregiver($caregiverId:ID!) { stopShareWithCaregiver(caregiverId: $caregiverId)"; | |
} | |
[JsonProperty("operationName")] | |
public string OperationName { get; set; } | |
[JsonProperty("query")] | |
public string Query { get; set; } | |
[JsonProperty("variables")] | |
public StopShareWithCaregiverVariables Variables { get; set; } | |
} | |
public partial class StopShareWithCaregiverVariables | |
{ | |
[JsonProperty("caregiverId")] | |
public long CaregiverId { get; set; } | |
} | |
public partial class StopShareWithCaregiverMutationResponse | |
{ | |
[JsonProperty("errors")] | |
public Error[] Errors { get; set; } | |
[JsonProperty("data")] | |
public StopShareWithCaregiverData Data { get; set; } | |
} | |
public partial class StopShareWithCaregiverData | |
{ | |
[JsonProperty("StopShareWithCaregiver")] | |
public bool StopShareWithCaregiver { get; set; } | |
} | |
public partial class StopShareWithCaregiverMutationResponse | |
{ | |
public static StopShareWithCaregiverMutationResponse FromJson(string json) => JsonConvert.DeserializeObject<StopShareWithCaregiverMutationResponse>(json, bha.Converter.Settings); | |
} | |
public partial class AcceptCaregiverInviteMutation | |
{ | |
public AcceptCaregiverInviteMutation() | |
{ | |
Query = @"mutation acceptCaregiverInvite($token:String!) { acceptCaregiverInvite(token: $token)"; | |
} | |
[JsonProperty("operationName")] | |
public string OperationName { get; set; } | |
[JsonProperty("query")] | |
public string Query { get; set; } | |
[JsonProperty("variables")] | |
public AcceptCaregiverInviteVariables Variables { get; set; } | |
} | |
public partial class AcceptCaregiverInviteVariables | |
{ | |
[JsonProperty("token")] | |
public string Token { get; set; } | |
} | |
public partial class AcceptCaregiverInviteMutationResponse | |
{ | |
[JsonProperty("errors")] | |
public Error[] Errors { get; set; } | |
[JsonProperty("data")] | |
public AcceptCaregiverInviteData Data { get; set; } | |
} | |
public partial class AcceptCaregiverInviteData | |
{ | |
[JsonProperty("AcceptCaregiverInvite")] | |
public bool AcceptCaregiverInvite { get; set; } | |
} | |
public partial class AcceptCaregiverInviteMutationResponse | |
{ | |
public static AcceptCaregiverInviteMutationResponse FromJson(string json) => JsonConvert.DeserializeObject<AcceptCaregiverInviteMutationResponse>(json, bha.Converter.Settings); | |
} | |
public partial class CreateGuideMutation | |
{ | |
public CreateGuideMutation() | |
{ | |
Query = @"mutation createGuide($input:NewGuide!) { createGuide(input: $input){id caregiver {id businessName shareCode }name inhaleTime holdTime exhaleTime pauseTime isPredefined createdAt }}"; | |
} | |
[JsonProperty("operationName")] | |
public string OperationName { get; set; } | |
[JsonProperty("query")] | |
public string Query { get; set; } | |
[JsonProperty("variables")] | |
public CreateGuideVariables Variables { get; set; } | |
} | |
public partial class CreateGuideVariables | |
{ | |
[JsonProperty("input")] | |
public NewGuide Input { get; set; } | |
} | |
public partial class CreateGuideMutationResponse | |
{ | |
[JsonProperty("errors")] | |
public Error[] Errors { get; set; } | |
[JsonProperty("data")] | |
public CreateGuideData Data { get; set; } | |
} | |
public partial class CreateGuideData | |
{ | |
[JsonProperty("CreateGuide")] | |
public Guide CreateGuide { get; set; } | |
} | |
public partial class CreateGuideMutationResponse | |
{ | |
public static CreateGuideMutationResponse FromJson(string json) => JsonConvert.DeserializeObject<CreateGuideMutationResponse>(json, bha.Converter.Settings); | |
} | |
public partial class UpdateGuideMutation | |
{ | |
public UpdateGuideMutation() | |
{ | |
Query = @"mutation updateGuide($input:UpdateGuide!) { updateGuide(input: $input){id caregiver {id businessName shareCode }name inhaleTime holdTime exhaleTime pauseTime isPredefined createdAt }}"; | |
} | |
[JsonProperty("operationName")] | |
public string OperationName { get; set; } | |
[JsonProperty("query")] | |
public string Query { get; set; } | |
[JsonProperty("variables")] | |
public UpdateGuideVariables Variables { get; set; } | |
} | |
public partial class UpdateGuideVariables | |
{ | |
[JsonProperty("input")] | |
public UpdateGuide Input { get; set; } | |
} | |
public partial class UpdateGuideMutationResponse | |
{ | |
[JsonProperty("errors")] | |
public Error[] Errors { get; set; } | |
[JsonProperty("data")] | |
public UpdateGuideData Data { get; set; } | |
} | |
public partial class UpdateGuideData | |
{ | |
[JsonProperty("UpdateGuide")] | |
public Guide UpdateGuide { get; set; } | |
} | |
public partial class UpdateGuideMutationResponse | |
{ | |
public static UpdateGuideMutationResponse FromJson(string json) => JsonConvert.DeserializeObject<UpdateGuideMutationResponse>(json, bha.Converter.Settings); | |
} | |
public partial class DeleteGuideMutation | |
{ | |
public DeleteGuideMutation() | |
{ | |
Query = @"mutation deleteGuide($id:ID!) { deleteGuide(id: $id)"; | |
} | |
[JsonProperty("operationName")] | |
public string OperationName { get; set; } | |
[JsonProperty("query")] | |
public string Query { get; set; } | |
[JsonProperty("variables")] | |
public DeleteGuideVariables Variables { get; set; } | |
} | |
public partial class DeleteGuideVariables | |
{ | |
[JsonProperty("id")] | |
public long Id { get; set; } | |
} | |
public partial class DeleteGuideMutationResponse | |
{ | |
[JsonProperty("errors")] | |
public Error[] Errors { get; set; } | |
[JsonProperty("data")] | |
public DeleteGuideData Data { get; set; } | |
} | |
public partial class DeleteGuideData | |
{ | |
[JsonProperty("DeleteGuide")] | |
public bool DeleteGuide { get; set; } | |
} | |
public partial class DeleteGuideMutationResponse | |
{ | |
public static DeleteGuideMutationResponse FromJson(string json) => JsonConvert.DeserializeObject<DeleteGuideMutationResponse>(json, bha.Converter.Settings); | |
} | |
public partial class CreateProcedureDataMutation | |
{ | |
public CreateProcedureDataMutation() | |
{ | |
Query = @"mutation createProcedureData($input:NewData!) { createProcedureData(input: $input){id procedure {id name createdAt }user {id userType firstName lastName namePrefix nameSuffix phone email username roles address status language measuringSystem lastAccessed lastResetPassword isPasswordExpired createdAt caregiver {id businessName shareCode }client {id caregiverRegistrationNumber gender dateOfBirth heathNotes guide {id caregiver {id businessName shareCode }name inhaleTime holdTime exhaleTime pauseTime isPredefined createdAt }preferredBreathRate audioGuide audioType audioFile disclaimerAccepted lastTested }enabledProcedures {id procedureId name isEnabled createdAt }}procedureComment data rawData1 rawData2 createdAt }}"; | |
} | |
[JsonProperty("operationName")] | |
public string OperationName { get; set; } | |
[JsonProperty("query")] | |
public string Query { get; set; } | |
[JsonProperty("variables")] | |
public CreateProcedureDataVariables Variables { get; set; } | |
} | |
public partial class CreateProcedureDataVariables | |
{ | |
[JsonProperty("input")] | |
public NewData Input { get; set; } | |
} | |
public partial class CreateProcedureDataMutationResponse | |
{ | |
[JsonProperty("errors")] | |
public Error[] Errors { get; set; } | |
[JsonProperty("data")] | |
public CreateProcedureDataData Data { get; set; } | |
} | |
public partial class CreateProcedureDataData | |
{ | |
[JsonProperty("CreateProcedureData")] | |
public Data CreateProcedureData { get; set; } | |
} | |
public partial class CreateProcedureDataMutationResponse | |
{ | |
public static CreateProcedureDataMutationResponse FromJson(string json) => JsonConvert.DeserializeObject<CreateProcedureDataMutationResponse>(json, bha.Converter.Settings); | |
} | |
public partial class UpdateProcedureDataMutation | |
{ | |
public UpdateProcedureDataMutation() | |
{ | |
Query = @"mutation updateProcedureData($input:UpdateData!) { updateProcedureData(input: $input){id procedure {id name createdAt }user {id userType firstName lastName namePrefix nameSuffix phone email username roles address status language measuringSystem lastAccessed lastResetPassword isPasswordExpired createdAt caregiver {id businessName shareCode }client {id caregiverRegistrationNumber gender dateOfBirth heathNotes guide {id caregiver {id businessName shareCode }name inhaleTime holdTime exhaleTime pauseTime isPredefined createdAt }preferredBreathRate audioGuide audioType audioFile disclaimerAccepted lastTested }enabledProcedures {id procedureId name isEnabled createdAt }}procedureComment data rawData1 rawData2 createdAt }}"; | |
} | |
[JsonProperty("operationName")] | |
public string OperationName { get; set; } | |
[JsonProperty("query")] | |
public string Query { get; set; } | |
[JsonProperty("variables")] | |
public UpdateProcedureDataVariables Variables { get; set; } | |
} | |
public partial class UpdateProcedureDataVariables | |
{ | |
[JsonProperty("input")] | |
public UpdateData Input { get; set; } | |
} | |
public partial class UpdateProcedureDataMutationResponse | |
{ | |
[JsonProperty("errors")] | |
public Error[] Errors { get; set; } | |
[JsonProperty("data")] | |
public UpdateProcedureDataData Data { get; set; } | |
} | |
public partial class UpdateProcedureDataData | |
{ | |
[JsonProperty("UpdateProcedureData")] | |
public Data UpdateProcedureData { get; set; } | |
} | |
public partial class UpdateProcedureDataMutationResponse | |
{ | |
public static UpdateProcedureDataMutationResponse FromJson(string json) => JsonConvert.DeserializeObject<UpdateProcedureDataMutationResponse>(json, bha.Converter.Settings); | |
} | |
public partial class DeleteDataMutation | |
{ | |
public DeleteDataMutation() | |
{ | |
Query = @"mutation deleteData($id:ID!) { deleteData(id: $id)"; | |
} | |
[JsonProperty("operationName")] | |
public string OperationName { get; set; } | |
[JsonProperty("query")] | |
public string Query { get; set; } | |
[JsonProperty("variables")] | |
public DeleteDataVariables Variables { get; set; } | |
} | |
public partial class DeleteDataVariables | |
{ | |
[JsonProperty("id")] | |
public long Id { get; set; } | |
} | |
public partial class DeleteDataMutationResponse | |
{ | |
[JsonProperty("errors")] | |
public Error[] Errors { get; set; } | |
[JsonProperty("data")] | |
public DeleteDataData Data { get; set; } | |
} | |
public partial class DeleteDataData | |
{ | |
[JsonProperty("DeleteData")] | |
public bool DeleteData { get; set; } | |
} | |
public partial class DeleteDataMutationResponse | |
{ | |
public static DeleteDataMutationResponse FromJson(string json) => JsonConvert.DeserializeObject<DeleteDataMutationResponse>(json, bha.Converter.Settings); | |
} | |
public partial class MeQuery | |
{ | |
public MeQuery() | |
{ | |
Query = @"query me{id userType firstName lastName namePrefix nameSuffix phone email username roles address status language measuringSystem lastAccessed lastResetPassword isPasswordExpired createdAt caregiver {id businessName shareCode }client {id caregiverRegistrationNumber gender dateOfBirth heathNotes guide {id caregiver {id businessName shareCode }name inhaleTime holdTime exhaleTime pauseTime isPredefined createdAt }preferredBreathRate audioGuide audioType audioFile disclaimerAccepted lastTested }enabledProcedures {id procedureId name isEnabled createdAt }}}"; | |
} | |
[JsonProperty("operationName")] | |
public string OperationName { get; set; } | |
[JsonProperty("query")] | |
public string Query { get; set; } | |
[JsonProperty("variables")] | |
public MeVariables Variables { get; set; } | |
} | |
public partial class MeVariables | |
{ | |
} | |
public partial class MeQueryResponse | |
{ | |
[JsonProperty("errors")] | |
public Error[] Errors { get; set; } | |
[JsonProperty("data")] | |
public MeData Data { get; set; } | |
} | |
public partial class MeData | |
{ | |
[JsonProperty("Me")] | |
public User Me { get; set; } | |
} | |
public partial class MeQueryResponse | |
{ | |
public static MeQueryResponse FromJson(string json) => JsonConvert.DeserializeObject<MeQueryResponse>(json, bha.Converter.Settings); | |
} | |
public partial class UserQuery | |
{ | |
public UserQuery() | |
{ | |
Query = @"query user($id:ID!) { user(id: $id){id userType firstName lastName namePrefix nameSuffix phone email username roles address status language measuringSystem lastAccessed lastResetPassword isPasswordExpired createdAt caregiver {id businessName shareCode }client {id caregiverRegistrationNumber gender dateOfBirth heathNotes guide {id caregiver {id businessName shareCode }name inhaleTime holdTime exhaleTime pauseTime isPredefined createdAt }preferredBreathRate audioGuide audioType audioFile disclaimerAccepted lastTested }enabledProcedures {id procedureId name isEnabled createdAt }}}"; | |
} | |
[JsonProperty("operationName")] | |
public string OperationName { get; set; } | |
[JsonProperty("query")] | |
public string Query { get; set; } | |
[JsonProperty("variables")] | |
public UserVariables Variables { get; set; } | |
} | |
public partial class UserVariables | |
{ | |
[JsonProperty("id")] | |
public long Id { get; set; } | |
} | |
public partial class UserQueryResponse | |
{ | |
[JsonProperty("errors")] | |
public Error[] Errors { get; set; } | |
[JsonProperty("data")] | |
public UserData Data { get; set; } | |
} | |
public partial class UserData | |
{ | |
[JsonProperty("User")] | |
public User User { get; set; } | |
} | |
public partial class UserQueryResponse | |
{ | |
public static UserQueryResponse FromJson(string json) => JsonConvert.DeserializeObject<UserQueryResponse>(json, bha.Converter.Settings); | |
} | |
public partial class UsersQuery | |
{ | |
public UsersQuery() | |
{ | |
Query = @"query users($filter:FindFilter) { users(filter: $filter){total nodes {id userType firstName lastName namePrefix nameSuffix phone email username roles address status language measuringSystem lastAccessed lastResetPassword isPasswordExpired createdAt caregiver {id businessName shareCode }client {id caregiverRegistrationNumber gender dateOfBirth heathNotes guide {id caregiver {id businessName shareCode }name inhaleTime holdTime exhaleTime pauseTime isPredefined createdAt }preferredBreathRate audioGuide audioType audioFile disclaimerAccepted lastTested }enabledProcedures {id procedureId name isEnabled createdAt }}}}"; | |
} | |
[JsonProperty("operationName")] | |
public string OperationName { get; set; } | |
[JsonProperty("query")] | |
public string Query { get; set; } | |
[JsonProperty("variables")] | |
public UsersVariables Variables { get; set; } | |
} | |
public partial class UsersVariables | |
{ | |
[JsonProperty("filter")] | |
public FindFilter Filter { get; set; } | |
} | |
public partial class UsersQueryResponse | |
{ | |
[JsonProperty("errors")] | |
public Error[] Errors { get; set; } | |
[JsonProperty("data")] | |
public UsersData Data { get; set; } | |
} | |
public partial class UsersData | |
{ | |
[JsonProperty("Users")] | |
public UserConnection Users { get; set; } | |
} | |
public partial class UsersQueryResponse | |
{ | |
public static UsersQueryResponse FromJson(string json) => JsonConvert.DeserializeObject<UsersQueryResponse>(json, bha.Converter.Settings); | |
} | |
public partial class ClientsQuery | |
{ | |
public ClientsQuery() | |
{ | |
Query = @"query clients($filter:FindFilter) { clients(filter: $filter){total nodes {id userType firstName lastName namePrefix nameSuffix phone email username roles address status language measuringSystem lastAccessed lastResetPassword isPasswordExpired createdAt caregiver {id businessName shareCode }client {id caregiverRegistrationNumber gender dateOfBirth heathNotes guide {id caregiver {id businessName shareCode }name inhaleTime holdTime exhaleTime pauseTime isPredefined createdAt }preferredBreathRate audioGuide audioType audioFile disclaimerAccepted lastTested }enabledProcedures {id procedureId name isEnabled createdAt }}}}"; | |
} | |
[JsonProperty("operationName")] | |
public string OperationName { get; set; } | |
[JsonProperty("query")] | |
public string Query { get; set; } | |
[JsonProperty("variables")] | |
public ClientsVariables Variables { get; set; } | |
} | |
public partial class ClientsVariables | |
{ | |
[JsonProperty("filter")] | |
public FindFilter Filter { get; set; } | |
} | |
public partial class ClientsQueryResponse | |
{ | |
[JsonProperty("errors")] | |
public Error[] Errors { get; set; } | |
[JsonProperty("data")] | |
public ClientsData Data { get; set; } | |
} | |
public partial class ClientsData | |
{ | |
[JsonProperty("Clients")] | |
public UserConnection Clients { get; set; } | |
} | |
public partial class ClientsQueryResponse | |
{ | |
public static ClientsQueryResponse FromJson(string json) => JsonConvert.DeserializeObject<ClientsQueryResponse>(json, bha.Converter.Settings); | |
} | |
public partial class CaregiversQuery | |
{ | |
public CaregiversQuery() | |
{ | |
Query = @"query caregivers($filter:FindFilter) { caregivers(filter: $filter){total nodes {id userType firstName lastName namePrefix nameSuffix phone email username roles address status language measuringSystem lastAccessed lastResetPassword isPasswordExpired createdAt caregiver {id businessName shareCode }client {id caregiverRegistrationNumber gender dateOfBirth heathNotes guide {id caregiver {id businessName shareCode }name inhaleTime holdTime exhaleTime pauseTime isPredefined createdAt }preferredBreathRate audioGuide audioType audioFile disclaimerAccepted lastTested }enabledProcedures {id procedureId name isEnabled createdAt }}}}"; | |
} | |
[JsonProperty("operationName")] | |
public string OperationName { get; set; } | |
[JsonProperty("query")] | |
public string Query { get; set; } | |
[JsonProperty("variables")] | |
public CaregiversVariables Variables { get; set; } | |
} | |
public partial class CaregiversVariables | |
{ | |
[JsonProperty("filter")] | |
public FindFilter Filter { get; set; } | |
} | |
public partial class CaregiversQueryResponse | |
{ | |
[JsonProperty("errors")] | |
public Error[] Errors { get; set; } | |
[JsonProperty("data")] | |
public CaregiversData Data { get; set; } | |
} | |
public partial class CaregiversData | |
{ | |
[JsonProperty("Caregivers")] | |
public UserConnection Caregivers { get; set; } | |
} | |
public partial class CaregiversQueryResponse | |
{ | |
public static CaregiversQueryResponse FromJson(string json) => JsonConvert.DeserializeObject<CaregiversQueryResponse>(json, bha.Converter.Settings); | |
} | |
public partial class CaregiverInfoByInviteTokenQuery | |
{ | |
public CaregiverInfoByInviteTokenQuery() | |
{ | |
Query = @"query caregiverInfoByInviteToken($inviteToken:String!) { caregiverInfoByInviteToken(inviteToken: $inviteToken){id clientUserId businessName inviteEmail }}"; | |
} | |
[JsonProperty("operationName")] | |
public string OperationName { get; set; } | |
[JsonProperty("query")] | |
public string Query { get; set; } | |
[JsonProperty("variables")] | |
public CaregiverInfoByInviteTokenVariables Variables { get; set; } | |
} | |
public partial class CaregiverInfoByInviteTokenVariables | |
{ | |
[JsonProperty("inviteToken")] | |
public string InviteToken { get; set; } | |
} | |
public partial class CaregiverInfoByInviteTokenQueryResponse | |
{ | |
[JsonProperty("errors")] | |
public Error[] Errors { get; set; } | |
[JsonProperty("data")] | |
public CaregiverInfoByInviteTokenData Data { get; set; } | |
} | |
public partial class CaregiverInfoByInviteTokenData | |
{ | |
[JsonProperty("CaregiverInfoByInviteToken")] | |
public CaregiverInviteInfo CaregiverInfoByInviteToken { get; set; } | |
} | |
public partial class CaregiverInfoByInviteTokenQueryResponse | |
{ | |
public static CaregiverInfoByInviteTokenQueryResponse FromJson(string json) => JsonConvert.DeserializeObject<CaregiverInfoByInviteTokenQueryResponse>(json, bha.Converter.Settings); | |
} | |
public partial class CaregiverClientsQuery | |
{ | |
public CaregiverClientsQuery() | |
{ | |
Query = @"query caregiverClients($caregiverId:ID!,$filter:FindFilter) { caregiverClients(caregiverId: $caregiverId,filter: $filter){total nodes {id userType firstName lastName namePrefix nameSuffix phone email username roles address status language measuringSystem lastAccessed lastResetPassword isPasswordExpired createdAt caregiver {id businessName shareCode }client {id caregiverRegistrationNumber gender dateOfBirth heathNotes guide {id caregiver {id businessName shareCode }name inhaleTime holdTime exhaleTime pauseTime isPredefined createdAt }preferredBreathRate audioGuide audioType audioFile disclaimerAccepted lastTested }enabledProcedures {id procedureId name isEnabled createdAt }}}}"; | |
} | |
[JsonProperty("operationName")] | |
public string OperationName { get; set; } | |
[JsonProperty("query")] | |
public string Query { get; set; } | |
[JsonProperty("variables")] | |
public CaregiverClientsVariables Variables { get; set; } | |
} | |
public partial class CaregiverClientsVariables | |
{ | |
[JsonProperty("caregiverId")] | |
public long CaregiverId { get; set; } | |
[JsonProperty("filter")] | |
public FindFilter Filter { get; set; } | |
} | |
public partial class CaregiverClientsQueryResponse | |
{ | |
[JsonProperty("errors")] | |
public Error[] Errors { get; set; } | |
[JsonProperty("data")] | |
public CaregiverClientsData Data { get; set; } | |
} | |
public partial class CaregiverClientsData | |
{ | |
[JsonProperty("CaregiverClients")] | |
public UserConnection CaregiverClients { get; set; } | |
} | |
public partial class CaregiverClientsQueryResponse | |
{ | |
public static CaregiverClientsQueryResponse FromJson(string json) => JsonConvert.DeserializeObject<CaregiverClientsQueryResponse>(json, bha.Converter.Settings); | |
} | |
public partial class ProceduresQuery | |
{ | |
public ProceduresQuery() | |
{ | |
Query = @"query procedures"; | |
} | |
[JsonProperty("operationName")] | |
public string OperationName { get; set; } | |
[JsonProperty("query")] | |
public string Query { get; set; } | |
[JsonProperty("variables")] | |
public ProceduresVariables Variables { get; set; } | |
} | |
public partial class ProceduresVariables | |
{ | |
} | |
public partial class ProceduresQueryResponse | |
{ | |
[JsonProperty("errors")] | |
public Error[] Errors { get; set; } | |
[JsonProperty("data")] | |
public ProceduresData Data { get; set; } | |
} | |
public partial class ProceduresData | |
{ | |
[JsonProperty("Procedures")] | |
public Procedure Procedures { get; set; } | |
} | |
public partial class ProceduresQueryResponse | |
{ | |
public static ProceduresQueryResponse FromJson(string json) => JsonConvert.DeserializeObject<ProceduresQueryResponse>(json, bha.Converter.Settings); | |
} | |
public partial class GuidesQuery | |
{ | |
public GuidesQuery() | |
{ | |
Query = @"query guides($filter:FindFilter) { guides(filter: $filter){total nodes {id caregiver {id businessName shareCode }name inhaleTime holdTime exhaleTime pauseTime isPredefined createdAt }}}"; | |
} | |
[JsonProperty("operationName")] | |
public string OperationName { get; set; } | |
[JsonProperty("query")] | |
public string Query { get; set; } | |
[JsonProperty("variables")] | |
public GuidesVariables Variables { get; set; } | |
} | |
public partial class GuidesVariables | |
{ | |
[JsonProperty("filter")] | |
public FindFilter Filter { get; set; } | |
} | |
public partial class GuidesQueryResponse | |
{ | |
[JsonProperty("errors")] | |
public Error[] Errors { get; set; } | |
[JsonProperty("data")] | |
public GuidesData Data { get; set; } | |
} | |
public partial class GuidesData | |
{ | |
[JsonProperty("Guides")] | |
public GuideConnection Guides { get; set; } | |
} | |
public partial class GuidesQueryResponse | |
{ | |
public static GuidesQueryResponse FromJson(string json) => JsonConvert.DeserializeObject<GuidesQueryResponse>(json, bha.Converter.Settings); | |
} | |
public partial class FindDataQuery | |
{ | |
public FindDataQuery() | |
{ | |
Query = @"query findData($filter:DataFilter) { findData(filter: $filter){total nodes {id procedure {id name createdAt }user {id userType firstName lastName namePrefix nameSuffix phone email username roles address status language measuringSystem lastAccessed lastResetPassword isPasswordExpired createdAt caregiver {id businessName shareCode }client {id caregiverRegistrationNumber gender dateOfBirth heathNotes guide {id caregiver {id businessName shareCode }name inhaleTime holdTime exhaleTime pauseTime isPredefined createdAt }preferredBreathRate audioGuide audioType audioFile disclaimerAccepted lastTested }enabledProcedures {id procedureId name isEnabled createdAt }}procedureComment data rawData1 rawData2 createdAt }}}"; | |
} | |
[JsonProperty("operationName")] | |
public string OperationName { get; set; } | |
[JsonProperty("query")] | |
public string Query { get; set; } | |
[JsonProperty("variables")] | |
public FindDataVariables Variables { get; set; } | |
} | |
public partial class FindDataVariables | |
{ | |
[JsonProperty("filter")] | |
public DataFilter Filter { get; set; } | |
} | |
public partial class FindDataQueryResponse | |
{ | |
[JsonProperty("errors")] | |
public Error[] Errors { get; set; } | |
[JsonProperty("data")] | |
public FindDataData Data { get; set; } | |
} | |
public partial class FindDataData | |
{ | |
[JsonProperty("FindData")] | |
public DataConnection FindData { get; set; } | |
} | |
public partial class FindDataQueryResponse | |
{ | |
public static FindDataQueryResponse FromJson(string json) => JsonConvert.DeserializeObject<FindDataQueryResponse>(json, bha.Converter.Settings); | |
} | |
public partial class Error | |
{ | |
[JsonProperty("message")] | |
public string Message { get; set; } | |
} | |
} | |
internal static class Converter | |
{ | |
public static readonly JsonSerializerSettings Settings = new JsonSerializerSettings | |
{ | |
MetadataPropertyHandling = MetadataPropertyHandling.Ignore, | |
DateParseHandling = DateParseHandling.None, | |
Converters = | |
{ | |
new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal } | |
}, | |
}; | |
} | |
internal class ParseStringConverter : JsonConverter | |
{ | |
public override bool CanConvert(Type t) => t == typeof(long) || t == typeof(long?); | |
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer) | |
{ | |
if (reader.TokenType == JsonToken.Null) return null; | |
var value = serializer.Deserialize<string>(reader); | |
long l; | |
if (Int64.TryParse(value, out l)) | |
{ | |
return l; | |
} | |
throw new Exception("Cannot unmarshal type long"); | |
} | |
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer) | |
{ | |
if (untypedValue == null) | |
{ | |
serializer.Serialize(writer, null); | |
return; | |
} | |
var value = (long)untypedValue; | |
serializer.Serialize(writer, value.ToString()); | |
return; | |
} | |
public static readonly ParseStringConverter Singleton = new ParseStringConverter(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment