diff --git a/src/Merge.Client.sln b/src/Merge.Client.sln index cd0cddee..ba4993c9 100644 --- a/src/Merge.Client.sln +++ b/src/Merge.Client.sln @@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.0.31903.59 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Merge.Client", "Merge.Client\Merge.Client.csproj", "{7C85A18D-E005-41C3-B45E-741361D6A8A3}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Merge.Client", "Merge.Client\Merge.Client.csproj", "{27AD8103-97AD-423F-BC71-E9BCB0969C7A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Merge.Client.Test", "Merge.Client.Test\Merge.Client.Test.csproj", "{D3A437A0-C43E-4356-A33D-6BCEDF5AD119}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Merge.Client.Test", "Merge.Client.Test\Merge.Client.Test.csproj", "{5BFBB886-1761-46AD-84F0-6AA9D284B3FE}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -16,13 +16,13 @@ Global HideSolutionNode = FALSE EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7C85A18D-E005-41C3-B45E-741361D6A8A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7C85A18D-E005-41C3-B45E-741361D6A8A3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7C85A18D-E005-41C3-B45E-741361D6A8A3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7C85A18D-E005-41C3-B45E-741361D6A8A3}.Release|Any CPU.Build.0 = Release|Any CPU - {D3A437A0-C43E-4356-A33D-6BCEDF5AD119}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D3A437A0-C43E-4356-A33D-6BCEDF5AD119}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D3A437A0-C43E-4356-A33D-6BCEDF5AD119}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D3A437A0-C43E-4356-A33D-6BCEDF5AD119}.Release|Any CPU.Build.0 = Release|Any CPU + {27AD8103-97AD-423F-BC71-E9BCB0969C7A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {27AD8103-97AD-423F-BC71-E9BCB0969C7A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {27AD8103-97AD-423F-BC71-E9BCB0969C7A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {27AD8103-97AD-423F-BC71-E9BCB0969C7A}.Release|Any CPU.Build.0 = Release|Any CPU + {5BFBB886-1761-46AD-84F0-6AA9D284B3FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5BFBB886-1761-46AD-84F0-6AA9D284B3FE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5BFBB886-1761-46AD-84F0-6AA9D284B3FE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5BFBB886-1761-46AD-84F0-6AA9D284B3FE}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal diff --git a/src/Merge.Client/Accounting/AccountDetails/AccountDetailsClient.cs b/src/Merge.Client/Accounting/AccountDetails/AccountDetailsClient.cs index e1468163..7c26b411 100644 --- a/src/Merge.Client/Accounting/AccountDetails/AccountDetailsClient.cs +++ b/src/Merge.Client/Accounting/AccountDetails/AccountDetailsClient.cs @@ -21,10 +21,10 @@ public AccountDetailsClient(RawClient client) public async Task RetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/accounting/v1/account-details" + Path = "accounting/v1/account-details" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Accounting/AccountToken/AccountTokenClient.cs b/src/Merge.Client/Accounting/AccountToken/AccountTokenClient.cs index c769aa6d..fe1cfa42 100644 --- a/src/Merge.Client/Accounting/AccountToken/AccountTokenClient.cs +++ b/src/Merge.Client/Accounting/AccountToken/AccountTokenClient.cs @@ -21,10 +21,10 @@ public AccountTokenClient(RawClient client) public async Task RetrieveAsync(string publicToken) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/accounting/v1/account-token/{publicToken}" + Path = $"accounting/v1/account-token/{publicToken}" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Accounting/AccountingPeriods/AccountingPeriodsClient.cs b/src/Merge.Client/Accounting/AccountingPeriods/AccountingPeriodsClient.cs index 92a3690c..3e984e0f 100644 --- a/src/Merge.Client/Accounting/AccountingPeriods/AccountingPeriodsClient.cs +++ b/src/Merge.Client/Accounting/AccountingPeriods/AccountingPeriodsClient.cs @@ -38,10 +38,10 @@ public async Task ListAsync(AccountingPeriodsList _query["page_size"] = request.PageSize.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/accounting/v1/accounting-periods", + Path = "accounting/v1/accounting-periods", Query = _query } ); @@ -67,10 +67,10 @@ AccountingPeriodsRetrieveRequest request _query["include_remote_data"] = request.IncludeRemoteData.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/accounting/v1/accounting-periods/{id}", + Path = $"accounting/v1/accounting-periods/{id}", Query = _query } ); diff --git a/src/Merge.Client/Accounting/Accounts/AccountsClient.cs b/src/Merge.Client/Accounting/Accounts/AccountsClient.cs index 551b8dc1..d57aff15 100644 --- a/src/Merge.Client/Accounting/Accounts/AccountsClient.cs +++ b/src/Merge.Client/Accounting/Accounts/AccountsClient.cs @@ -63,7 +63,7 @@ public async Task ListAsync(AccountsListRequest request) } if (request.RemoteFields != null) { - _query["remote_fields"] = request.RemoteFields.ToString(); + _query["remote_fields"] = JsonSerializer.Serialize(request.RemoteFields.Value); } if (request.RemoteId != null) { @@ -71,13 +71,13 @@ public async Task ListAsync(AccountsListRequest request) } if (request.ShowEnumOrigins != null) { - _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); + _query["show_enum_origins"] = JsonSerializer.Serialize(request.ShowEnumOrigins.Value); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/accounting/v1/accounts", + Path = "accounting/v1/accounts", Query = _query } ); @@ -104,10 +104,10 @@ public async Task CreateAsync(AccountEndpointRequest request) _query["run_async"] = request.RunAsync.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/accounting/v1/accounts", + Path = "accounting/v1/accounts", Query = _query } ); @@ -135,17 +135,17 @@ public async Task RetrieveAsync(string id, AccountsRetrieveRequest requ } if (request.RemoteFields != null) { - _query["remote_fields"] = request.RemoteFields.ToString(); + _query["remote_fields"] = JsonSerializer.Serialize(request.RemoteFields.Value); } if (request.ShowEnumOrigins != null) { - _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); + _query["show_enum_origins"] = JsonSerializer.Serialize(request.ShowEnumOrigins.Value); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/accounting/v1/accounts/{id}", + Path = $"accounting/v1/accounts/{id}", Query = _query } ); @@ -163,10 +163,10 @@ public async Task RetrieveAsync(string id, AccountsRetrieveRequest requ public async Task MetaPostRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/accounting/v1/accounts/meta/post" + Path = "accounting/v1/accounts/meta/post" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Accounting/Addresses/AddressesClient.cs b/src/Merge.Client/Accounting/Addresses/AddressesClient.cs index a19c862b..70b8a2d0 100644 --- a/src/Merge.Client/Accounting/Addresses/AddressesClient.cs +++ b/src/Merge.Client/Accounting/Addresses/AddressesClient.cs @@ -34,10 +34,10 @@ public async Task
RetrieveAsync(string id, AddressesRetrieveRequest req _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/accounting/v1/addresses/{id}", + Path = $"accounting/v1/addresses/{id}", Query = _query } ); diff --git a/src/Merge.Client/Accounting/AsyncPassthrough/AsyncPassthroughClient.cs b/src/Merge.Client/Accounting/AsyncPassthrough/AsyncPassthroughClient.cs index a6a57f92..e5e43567 100644 --- a/src/Merge.Client/Accounting/AsyncPassthrough/AsyncPassthroughClient.cs +++ b/src/Merge.Client/Accounting/AsyncPassthrough/AsyncPassthroughClient.cs @@ -21,10 +21,10 @@ public AsyncPassthroughClient(RawClient client) public async Task CreateAsync(DataPassthroughRequest request) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/accounting/v1/async-passthrough", + Path = "accounting/v1/async-passthrough", Body = request } ); @@ -42,10 +42,10 @@ public async Task CreateAsync(DataPassthroughRequest re public async Task RetrieveAsync(string asyncPassthroughReceiptId) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/accounting/v1/async-passthrough/{asyncPassthroughReceiptId}" + Path = $"accounting/v1/async-passthrough/{asyncPassthroughReceiptId}" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Accounting/Attachments/AttachmentsClient.cs b/src/Merge.Client/Accounting/Attachments/AttachmentsClient.cs index 70316157..e40f00f7 100644 --- a/src/Merge.Client/Accounting/Attachments/AttachmentsClient.cs +++ b/src/Merge.Client/Accounting/Attachments/AttachmentsClient.cs @@ -62,10 +62,10 @@ public async Task ListAsync(AttachmentsListRe _query["remote_id"] = request.RemoteId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/accounting/v1/attachments", + Path = "accounting/v1/attachments", Query = _query } ); @@ -94,10 +94,10 @@ AccountingAttachmentEndpointRequest request _query["run_async"] = request.RunAsync.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/accounting/v1/attachments", + Path = "accounting/v1/attachments", Query = _query } ); @@ -123,10 +123,10 @@ AttachmentsRetrieveRequest request _query["include_remote_data"] = request.IncludeRemoteData.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/accounting/v1/attachments/{id}", + Path = $"accounting/v1/attachments/{id}", Query = _query } ); @@ -144,10 +144,10 @@ AttachmentsRetrieveRequest request public async Task MetaPostRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/accounting/v1/attachments/meta/post" + Path = "accounting/v1/attachments/meta/post" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Accounting/AuditTrail/AuditTrailClient.cs b/src/Merge.Client/Accounting/AuditTrail/AuditTrailClient.cs index 365b900f..bbb83d62 100644 --- a/src/Merge.Client/Accounting/AuditTrail/AuditTrailClient.cs +++ b/src/Merge.Client/Accounting/AuditTrail/AuditTrailClient.cs @@ -46,10 +46,10 @@ public async Task ListAsync(AuditTrailListRequest re _query["user_email"] = request.UserEmail; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/accounting/v1/audit-trail", + Path = "accounting/v1/audit-trail", Query = _query } ); diff --git a/src/Merge.Client/Accounting/AvailableActions/AvailableActionsClient.cs b/src/Merge.Client/Accounting/AvailableActions/AvailableActionsClient.cs index e4e4c5a9..9475fb25 100644 --- a/src/Merge.Client/Accounting/AvailableActions/AvailableActionsClient.cs +++ b/src/Merge.Client/Accounting/AvailableActions/AvailableActionsClient.cs @@ -21,10 +21,10 @@ public AvailableActionsClient(RawClient client) public async Task RetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/accounting/v1/available-actions" + Path = "accounting/v1/available-actions" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Accounting/BalanceSheets/BalanceSheetsClient.cs b/src/Merge.Client/Accounting/BalanceSheets/BalanceSheetsClient.cs index e937becb..00b3dd48 100644 --- a/src/Merge.Client/Accounting/BalanceSheets/BalanceSheetsClient.cs +++ b/src/Merge.Client/Accounting/BalanceSheets/BalanceSheetsClient.cs @@ -66,10 +66,10 @@ public async Task ListAsync(BalanceSheetsListRequest _query["remote_id"] = request.RemoteId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/accounting/v1/balance-sheets", + Path = "accounting/v1/balance-sheets", Query = _query } ); @@ -96,10 +96,10 @@ public async Task RetrieveAsync(string id, BalanceSheetsRetrieveRe _query["include_remote_data"] = request.IncludeRemoteData.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/accounting/v1/balance-sheets/{id}", + Path = $"accounting/v1/balance-sheets/{id}", Query = _query } ); diff --git a/src/Merge.Client/Accounting/CashFlowStatements/CashFlowStatementsClient.cs b/src/Merge.Client/Accounting/CashFlowStatements/CashFlowStatementsClient.cs index 3cdb5a6c..ce1f1599 100644 --- a/src/Merge.Client/Accounting/CashFlowStatements/CashFlowStatementsClient.cs +++ b/src/Merge.Client/Accounting/CashFlowStatements/CashFlowStatementsClient.cs @@ -68,10 +68,10 @@ CashFlowStatementsListRequest request _query["remote_id"] = request.RemoteId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/accounting/v1/cash-flow-statements", + Path = "accounting/v1/cash-flow-statements", Query = _query } ); @@ -101,10 +101,10 @@ CashFlowStatementsRetrieveRequest request _query["include_remote_data"] = request.IncludeRemoteData.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/accounting/v1/cash-flow-statements/{id}", + Path = $"accounting/v1/cash-flow-statements/{id}", Query = _query } ); diff --git a/src/Merge.Client/Accounting/CompanyInfo/CompanyInfoClient.cs b/src/Merge.Client/Accounting/CompanyInfo/CompanyInfoClient.cs index 28b83564..58326778 100644 --- a/src/Merge.Client/Accounting/CompanyInfo/CompanyInfoClient.cs +++ b/src/Merge.Client/Accounting/CompanyInfo/CompanyInfoClient.cs @@ -35,7 +35,7 @@ public async Task ListAsync(CompanyInfoListRequest req } if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeDeletedData != null) { @@ -62,10 +62,10 @@ public async Task ListAsync(CompanyInfoListRequest req _query["remote_id"] = request.RemoteId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/accounting/v1/company-info", + Path = "accounting/v1/company-info", Query = _query } ); @@ -85,17 +85,17 @@ public async Task RetrieveAsync(string id, CompanyInfoRetrieveReque var _query = new Dictionary() { }; if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeRemoteData != null) { _query["include_remote_data"] = request.IncludeRemoteData.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/accounting/v1/company-info/{id}", + Path = $"accounting/v1/company-info/{id}", Query = _query } ); diff --git a/src/Merge.Client/Accounting/Contacts/ContactsClient.cs b/src/Merge.Client/Accounting/Contacts/ContactsClient.cs index e480f5e7..cdd91a5e 100644 --- a/src/Merge.Client/Accounting/Contacts/ContactsClient.cs +++ b/src/Merge.Client/Accounting/Contacts/ContactsClient.cs @@ -39,7 +39,7 @@ public async Task ListAsync(ContactsListRequest request) } if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeDeletedData != null) { @@ -82,10 +82,10 @@ public async Task ListAsync(ContactsListRequest request) _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/accounting/v1/contacts", + Path = "accounting/v1/contacts", Query = _query } ); @@ -112,10 +112,10 @@ public async Task CreateAsync(ContactEndpointRequest request) _query["run_async"] = request.RunAsync.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/accounting/v1/contacts", + Path = "accounting/v1/contacts", Query = _query } ); @@ -135,7 +135,7 @@ public async Task RetrieveAsync(string id, ContactsRetrieveRequest requ var _query = new Dictionary() { }; if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeRemoteData != null) { @@ -150,10 +150,10 @@ public async Task RetrieveAsync(string id, ContactsRetrieveRequest requ _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/accounting/v1/contacts/{id}", + Path = $"accounting/v1/contacts/{id}", Query = _query } ); @@ -171,10 +171,10 @@ public async Task RetrieveAsync(string id, ContactsRetrieveRequest requ public async Task MetaPostRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/accounting/v1/contacts/meta/post" + Path = "accounting/v1/contacts/meta/post" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Accounting/CreditNotes/CreditNotesClient.cs b/src/Merge.Client/Accounting/CreditNotes/CreditNotesClient.cs index bf15fa85..bf4b8e46 100644 --- a/src/Merge.Client/Accounting/CreditNotes/CreditNotesClient.cs +++ b/src/Merge.Client/Accounting/CreditNotes/CreditNotesClient.cs @@ -39,7 +39,7 @@ public async Task ListAsync(CreditNotesListRequest requ } if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeDeletedData != null) { @@ -63,7 +63,7 @@ public async Task ListAsync(CreditNotesListRequest requ } if (request.RemoteFields != null) { - _query["remote_fields"] = request.RemoteFields.ToString(); + _query["remote_fields"] = JsonSerializer.Serialize(request.RemoteFields.Value); } if (request.RemoteId != null) { @@ -71,7 +71,7 @@ public async Task ListAsync(CreditNotesListRequest requ } if (request.ShowEnumOrigins != null) { - _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); + _query["show_enum_origins"] = JsonSerializer.Serialize(request.ShowEnumOrigins.Value); } if (request.TransactionDateAfter != null) { @@ -82,10 +82,10 @@ public async Task ListAsync(CreditNotesListRequest requ _query["transaction_date_before"] = request.TransactionDateBefore.Value.ToString("o0"); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/accounting/v1/credit-notes", + Path = "accounting/v1/credit-notes", Query = _query } ); @@ -105,7 +105,7 @@ public async Task RetrieveAsync(string id, CreditNotesRetrieveReques var _query = new Dictionary() { }; if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeRemoteData != null) { @@ -113,17 +113,17 @@ public async Task RetrieveAsync(string id, CreditNotesRetrieveReques } if (request.RemoteFields != null) { - _query["remote_fields"] = request.RemoteFields.ToString(); + _query["remote_fields"] = JsonSerializer.Serialize(request.RemoteFields.Value); } if (request.ShowEnumOrigins != null) { - _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); + _query["show_enum_origins"] = JsonSerializer.Serialize(request.ShowEnumOrigins.Value); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/accounting/v1/credit-notes/{id}", + Path = $"accounting/v1/credit-notes/{id}", Query = _query } ); diff --git a/src/Merge.Client/Accounting/DeleteAccount/DeleteAccountClient.cs b/src/Merge.Client/Accounting/DeleteAccount/DeleteAccountClient.cs index aa00c9d4..62eae1ab 100644 --- a/src/Merge.Client/Accounting/DeleteAccount/DeleteAccountClient.cs +++ b/src/Merge.Client/Accounting/DeleteAccount/DeleteAccountClient.cs @@ -19,10 +19,10 @@ public DeleteAccountClient(RawClient client) public async void DeleteAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/accounting/v1/delete-account" + Path = "accounting/v1/delete-account" } ); } diff --git a/src/Merge.Client/Accounting/Expenses/ExpensesClient.cs b/src/Merge.Client/Accounting/Expenses/ExpensesClient.cs index 5696f670..ade4e39e 100644 --- a/src/Merge.Client/Accounting/Expenses/ExpensesClient.cs +++ b/src/Merge.Client/Accounting/Expenses/ExpensesClient.cs @@ -39,7 +39,7 @@ public async Task ListAsync(ExpensesListRequest request) } if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeDeletedData != null) { @@ -74,10 +74,10 @@ public async Task ListAsync(ExpensesListRequest request) _query["transaction_date_before"] = request.TransactionDateBefore.Value.ToString("o0"); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/accounting/v1/expenses", + Path = "accounting/v1/expenses", Query = _query } ); @@ -104,10 +104,10 @@ public async Task CreateAsync(ExpenseEndpointRequest request) _query["run_async"] = request.RunAsync.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/accounting/v1/expenses", + Path = "accounting/v1/expenses", Query = _query } ); @@ -127,17 +127,17 @@ public async Task RetrieveAsync(string id, ExpensesRetrieveRequest requ var _query = new Dictionary() { }; if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeRemoteData != null) { _query["include_remote_data"] = request.IncludeRemoteData.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/accounting/v1/expenses/{id}", + Path = $"accounting/v1/expenses/{id}", Query = _query } ); @@ -155,10 +155,10 @@ public async Task RetrieveAsync(string id, ExpensesRetrieveRequest requ public async Task MetaPostRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/accounting/v1/expenses/meta/post" + Path = "accounting/v1/expenses/meta/post" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Accounting/FieldMapping/FieldMappingClient.cs b/src/Merge.Client/Accounting/FieldMapping/FieldMappingClient.cs index bdffc7e5..f83096eb 100644 --- a/src/Merge.Client/Accounting/FieldMapping/FieldMappingClient.cs +++ b/src/Merge.Client/Accounting/FieldMapping/FieldMappingClient.cs @@ -21,10 +21,10 @@ public FieldMappingClient(RawClient client) public async Task FieldMappingsRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/accounting/v1/field-mappings" + Path = "accounting/v1/field-mappings" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); @@ -43,10 +43,10 @@ CreateFieldMappingRequest request ) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/accounting/v1/field-mappings", + Path = "accounting/v1/field-mappings", Body = request } ); @@ -64,10 +64,10 @@ CreateFieldMappingRequest request public async Task FieldMappingsDestroyAsync(string fieldMappingId) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Delete, - Path = $"/accounting/v1/field-mappings/{fieldMappingId}" + Path = $"accounting/v1/field-mappings/{fieldMappingId}" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); @@ -87,10 +87,10 @@ PatchedEditFieldMappingRequest request ) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Patch, - Path = $"/accounting/v1/field-mappings/{fieldMappingId}", + Path = $"accounting/v1/field-mappings/{fieldMappingId}", Body = request } ); @@ -119,10 +119,10 @@ RemoteFieldsRetrieveRequest request _query["include_example_values"] = request.IncludeExampleValues; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/accounting/v1/remote-fields", + Path = "accounting/v1/remote-fields", Query = _query } ); @@ -140,10 +140,10 @@ RemoteFieldsRetrieveRequest request public async Task TargetFieldsRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/accounting/v1/target-fields" + Path = "accounting/v1/target-fields" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Accounting/ForceResync/ForceResyncClient.cs b/src/Merge.Client/Accounting/ForceResync/ForceResyncClient.cs index f8264865..00e59577 100644 --- a/src/Merge.Client/Accounting/ForceResync/ForceResyncClient.cs +++ b/src/Merge.Client/Accounting/ForceResync/ForceResyncClient.cs @@ -21,10 +21,10 @@ public ForceResyncClient(RawClient client) public async Task> SyncStatusResyncCreateAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/accounting/v1/sync-status/resync" + Path = "accounting/v1/sync-status/resync" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Accounting/GenerateKey/GenerateKeyClient.cs b/src/Merge.Client/Accounting/GenerateKey/GenerateKeyClient.cs index e9429f16..607e1b81 100644 --- a/src/Merge.Client/Accounting/GenerateKey/GenerateKeyClient.cs +++ b/src/Merge.Client/Accounting/GenerateKey/GenerateKeyClient.cs @@ -21,10 +21,10 @@ public GenerateKeyClient(RawClient client) public async Task CreateAsync(GenerateRemoteKeyRequest request) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/accounting/v1/generate-key", + Path = "accounting/v1/generate-key", Body = request } ); diff --git a/src/Merge.Client/Accounting/IncomeStatements/IncomeStatementsClient.cs b/src/Merge.Client/Accounting/IncomeStatements/IncomeStatementsClient.cs index 90197efa..1c5be94b 100644 --- a/src/Merge.Client/Accounting/IncomeStatements/IncomeStatementsClient.cs +++ b/src/Merge.Client/Accounting/IncomeStatements/IncomeStatementsClient.cs @@ -66,10 +66,10 @@ public async Task ListAsync(IncomeStatementsListRe _query["remote_id"] = request.RemoteId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/accounting/v1/income-statements", + Path = "accounting/v1/income-statements", Query = _query } ); @@ -99,10 +99,10 @@ IncomeStatementsRetrieveRequest request _query["include_remote_data"] = request.IncludeRemoteData.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/accounting/v1/income-statements/{id}", + Path = $"accounting/v1/income-statements/{id}", Query = _query } ); diff --git a/src/Merge.Client/Accounting/Invoices/InvoicesClient.cs b/src/Merge.Client/Accounting/Invoices/InvoicesClient.cs index a3ad9001..692f127e 100644 --- a/src/Merge.Client/Accounting/Invoices/InvoicesClient.cs +++ b/src/Merge.Client/Accounting/Invoices/InvoicesClient.cs @@ -43,7 +43,7 @@ public async Task ListAsync(InvoicesListRequest request) } if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeDeletedData != null) { @@ -87,13 +87,13 @@ public async Task ListAsync(InvoicesListRequest request) } if (request.Type != null) { - _query["type"] = request.Type.ToString(); + _query["type"] = JsonSerializer.Serialize(request.Type.Value); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/accounting/v1/invoices", + Path = "accounting/v1/invoices", Query = _query } ); @@ -120,10 +120,10 @@ public async Task CreateAsync(InvoiceEndpointRequest request) _query["run_async"] = request.RunAsync.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/accounting/v1/invoices", + Path = "accounting/v1/invoices", Query = _query } ); @@ -143,7 +143,7 @@ public async Task RetrieveAsync(string id, InvoicesRetrieveRequest requ var _query = new Dictionary() { }; if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeRemoteData != null) { @@ -158,10 +158,10 @@ public async Task RetrieveAsync(string id, InvoicesRetrieveRequest requ _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/accounting/v1/invoices/{id}", + Path = $"accounting/v1/invoices/{id}", Query = _query } ); @@ -191,10 +191,10 @@ PatchedInvoiceEndpointRequest request _query["run_async"] = request.RunAsync.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Patch, - Path = $"/accounting/v1/invoices/{id}", + Path = $"accounting/v1/invoices/{id}", Query = _query } ); @@ -212,10 +212,10 @@ PatchedInvoiceEndpointRequest request public async Task MetaPatchRetrieveAsync(string id) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/accounting/v1/invoices/meta/patch/{id}" + Path = $"accounting/v1/invoices/meta/patch/{id}" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); @@ -232,10 +232,10 @@ public async Task MetaPatchRetrieveAsync(string id) public async Task MetaPostRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/accounting/v1/invoices/meta/post" + Path = "accounting/v1/invoices/meta/post" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Accounting/Issues/IssuesClient.cs b/src/Merge.Client/Accounting/Issues/IssuesClient.cs index 4582f8f8..f5ca8204 100644 --- a/src/Merge.Client/Accounting/Issues/IssuesClient.cs +++ b/src/Merge.Client/Accounting/Issues/IssuesClient.cs @@ -77,13 +77,13 @@ public async Task ListAsync(IssuesListRequest request) } if (request.Status != null) { - _query["status"] = request.Status.ToString(); + _query["status"] = JsonSerializer.Serialize(request.Status.Value); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/accounting/v1/issues", + Path = "accounting/v1/issues", Query = _query } ); @@ -101,10 +101,10 @@ public async Task ListAsync(IssuesListRequest request) public async Task RetrieveAsync(string id) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/accounting/v1/issues/{id}" + Path = $"accounting/v1/issues/{id}" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Accounting/Items/ItemsClient.cs b/src/Merge.Client/Accounting/Items/ItemsClient.cs index 02672b93..8792ad50 100644 --- a/src/Merge.Client/Accounting/Items/ItemsClient.cs +++ b/src/Merge.Client/Accounting/Items/ItemsClient.cs @@ -39,7 +39,7 @@ public async Task ListAsync(ItemsListRequest request) } if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeDeletedData != null) { @@ -74,10 +74,10 @@ public async Task ListAsync(ItemsListRequest request) _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/accounting/v1/items", + Path = "accounting/v1/items", Query = _query } ); @@ -97,7 +97,7 @@ public async Task RetrieveAsync(string id, ItemsRetrieveRequest request) var _query = new Dictionary() { }; if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeRemoteData != null) { @@ -112,10 +112,10 @@ public async Task RetrieveAsync(string id, ItemsRetrieveRequest request) _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/accounting/v1/items/{id}", + Path = $"accounting/v1/items/{id}", Query = _query } ); diff --git a/src/Merge.Client/Accounting/JournalEntries/JournalEntriesClient.cs b/src/Merge.Client/Accounting/JournalEntries/JournalEntriesClient.cs index 3236d5d0..f105597d 100644 --- a/src/Merge.Client/Accounting/JournalEntries/JournalEntriesClient.cs +++ b/src/Merge.Client/Accounting/JournalEntries/JournalEntriesClient.cs @@ -39,7 +39,7 @@ public async Task ListAsync(JournalEntriesListRequest } if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeDeletedData != null) { @@ -74,10 +74,10 @@ public async Task ListAsync(JournalEntriesListRequest _query["transaction_date_before"] = request.TransactionDateBefore.Value.ToString("o0"); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/accounting/v1/journal-entries", + Path = "accounting/v1/journal-entries", Query = _query } ); @@ -104,10 +104,10 @@ public async Task CreateAsync(JournalEntryEndpointRequest _query["run_async"] = request.RunAsync.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/accounting/v1/journal-entries", + Path = "accounting/v1/journal-entries", Query = _query } ); @@ -127,17 +127,17 @@ public async Task RetrieveAsync(string id, JournalEntriesRetrieveR var _query = new Dictionary() { }; if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeRemoteData != null) { _query["include_remote_data"] = request.IncludeRemoteData.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/accounting/v1/journal-entries/{id}", + Path = $"accounting/v1/journal-entries/{id}", Query = _query } ); @@ -155,10 +155,10 @@ public async Task RetrieveAsync(string id, JournalEntriesRetrieveR public async Task MetaPostRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/accounting/v1/journal-entries/meta/post" + Path = "accounting/v1/journal-entries/meta/post" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Accounting/LinkToken/LinkTokenClient.cs b/src/Merge.Client/Accounting/LinkToken/LinkTokenClient.cs index 294ab880..0b7756cb 100644 --- a/src/Merge.Client/Accounting/LinkToken/LinkTokenClient.cs +++ b/src/Merge.Client/Accounting/LinkToken/LinkTokenClient.cs @@ -21,10 +21,10 @@ public LinkTokenClient(RawClient client) public async Task CreateAsync(EndUserDetailsRequest request) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/accounting/v1/link-token", + Path = "accounting/v1/link-token", Body = request } ); diff --git a/src/Merge.Client/Accounting/LinkedAccounts/LinkedAccountsClient.cs b/src/Merge.Client/Accounting/LinkedAccounts/LinkedAccountsClient.cs index d4552b94..e4dec16f 100644 --- a/src/Merge.Client/Accounting/LinkedAccounts/LinkedAccountsClient.cs +++ b/src/Merge.Client/Accounting/LinkedAccounts/LinkedAccountsClient.cs @@ -25,7 +25,7 @@ LinkedAccountsListRequest request var _query = new Dictionary() { }; if (request.Category != null) { - _query["category"] = request.Category.ToString(); + _query["category"] = JsonSerializer.Serialize(request.Category.Value); } if (request.Cursor != null) { @@ -76,10 +76,10 @@ LinkedAccountsListRequest request _query["status"] = request.Status; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/accounting/v1/linked-accounts", + Path = "accounting/v1/linked-accounts", Query = _query } ); diff --git a/src/Merge.Client/Accounting/Passthrough/PassthroughClient.cs b/src/Merge.Client/Accounting/Passthrough/PassthroughClient.cs index bac40879..22c45efa 100644 --- a/src/Merge.Client/Accounting/Passthrough/PassthroughClient.cs +++ b/src/Merge.Client/Accounting/Passthrough/PassthroughClient.cs @@ -21,10 +21,10 @@ public PassthroughClient(RawClient client) public async Task CreateAsync(DataPassthroughRequest request) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/accounting/v1/passthrough", + Path = "accounting/v1/passthrough", Body = request } ); diff --git a/src/Merge.Client/Accounting/Payments/PaymentsClient.cs b/src/Merge.Client/Accounting/Payments/PaymentsClient.cs index 019db569..d9595579 100644 --- a/src/Merge.Client/Accounting/Payments/PaymentsClient.cs +++ b/src/Merge.Client/Accounting/Payments/PaymentsClient.cs @@ -47,7 +47,7 @@ public async Task ListAsync(PaymentsListRequest request) } if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeDeletedData != null) { @@ -82,10 +82,10 @@ public async Task ListAsync(PaymentsListRequest request) _query["transaction_date_before"] = request.TransactionDateBefore.Value.ToString("o0"); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/accounting/v1/payments", + Path = "accounting/v1/payments", Query = _query } ); @@ -112,10 +112,10 @@ public async Task CreateAsync(PaymentEndpointRequest request) _query["run_async"] = request.RunAsync.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/accounting/v1/payments", + Path = "accounting/v1/payments", Query = _query } ); @@ -135,17 +135,17 @@ public async Task RetrieveAsync(string id, PaymentsRetrieveRequest requ var _query = new Dictionary() { }; if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeRemoteData != null) { _query["include_remote_data"] = request.IncludeRemoteData.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/accounting/v1/payments/{id}", + Path = $"accounting/v1/payments/{id}", Query = _query } ); @@ -175,10 +175,10 @@ PatchedPaymentEndpointRequest request _query["run_async"] = request.RunAsync.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Patch, - Path = $"/accounting/v1/payments/{id}", + Path = $"accounting/v1/payments/{id}", Query = _query } ); @@ -196,10 +196,10 @@ PatchedPaymentEndpointRequest request public async Task MetaPatchRetrieveAsync(string id) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/accounting/v1/payments/meta/patch/{id}" + Path = $"accounting/v1/payments/meta/patch/{id}" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); @@ -216,10 +216,10 @@ public async Task MetaPatchRetrieveAsync(string id) public async Task MetaPostRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/accounting/v1/payments/meta/post" + Path = "accounting/v1/payments/meta/post" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Accounting/PhoneNumbers/PhoneNumbersClient.cs b/src/Merge.Client/Accounting/PhoneNumbers/PhoneNumbersClient.cs index e9a88cf0..cdc47dfc 100644 --- a/src/Merge.Client/Accounting/PhoneNumbers/PhoneNumbersClient.cs +++ b/src/Merge.Client/Accounting/PhoneNumbers/PhoneNumbersClient.cs @@ -29,10 +29,10 @@ PhoneNumbersRetrieveRequest request _query["include_remote_data"] = request.IncludeRemoteData.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/accounting/v1/phone-numbers/{id}", + Path = $"accounting/v1/phone-numbers/{id}", Query = _query } ); diff --git a/src/Merge.Client/Accounting/PurchaseOrders/PurchaseOrdersClient.cs b/src/Merge.Client/Accounting/PurchaseOrders/PurchaseOrdersClient.cs index 56ce26c0..70fafa93 100644 --- a/src/Merge.Client/Accounting/PurchaseOrders/PurchaseOrdersClient.cs +++ b/src/Merge.Client/Accounting/PurchaseOrders/PurchaseOrdersClient.cs @@ -39,7 +39,7 @@ public async Task ListAsync(PurchaseOrdersListReques } if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeDeletedData != null) { @@ -82,10 +82,10 @@ public async Task ListAsync(PurchaseOrdersListReques _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/accounting/v1/purchase-orders", + Path = "accounting/v1/purchase-orders", Query = _query } ); @@ -112,10 +112,10 @@ public async Task CreateAsync(PurchaseOrderEndpointReques _query["run_async"] = request.RunAsync.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/accounting/v1/purchase-orders", + Path = "accounting/v1/purchase-orders", Query = _query } ); @@ -135,7 +135,7 @@ public async Task RetrieveAsync(string id, PurchaseOrdersRetrieve var _query = new Dictionary() { }; if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeRemoteData != null) { @@ -150,10 +150,10 @@ public async Task RetrieveAsync(string id, PurchaseOrdersRetrieve _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/accounting/v1/purchase-orders/{id}", + Path = $"accounting/v1/purchase-orders/{id}", Query = _query } ); @@ -171,10 +171,10 @@ public async Task RetrieveAsync(string id, PurchaseOrdersRetrieve public async Task MetaPostRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/accounting/v1/purchase-orders/meta/post" + Path = "accounting/v1/purchase-orders/meta/post" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Accounting/RegenerateKey/RegenerateKeyClient.cs b/src/Merge.Client/Accounting/RegenerateKey/RegenerateKeyClient.cs index 6bb300c5..9e6b0e60 100644 --- a/src/Merge.Client/Accounting/RegenerateKey/RegenerateKeyClient.cs +++ b/src/Merge.Client/Accounting/RegenerateKey/RegenerateKeyClient.cs @@ -21,10 +21,10 @@ public RegenerateKeyClient(RawClient client) public async Task CreateAsync(RemoteKeyForRegenerationRequest request) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/accounting/v1/regenerate-key", + Path = "accounting/v1/regenerate-key", Body = request } ); diff --git a/src/Merge.Client/Accounting/Scopes/ScopesClient.cs b/src/Merge.Client/Accounting/Scopes/ScopesClient.cs index 76d73da5..0750e4ee 100644 --- a/src/Merge.Client/Accounting/Scopes/ScopesClient.cs +++ b/src/Merge.Client/Accounting/Scopes/ScopesClient.cs @@ -21,10 +21,10 @@ public ScopesClient(RawClient client) public async Task DefaultScopesRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/accounting/v1/default-scopes" + Path = "accounting/v1/default-scopes" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); @@ -41,10 +41,10 @@ public async Task DefaultScopesRetrieveAsync() public async Task LinkedAccountScopesRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/accounting/v1/linked-account-scopes" + Path = "accounting/v1/linked-account-scopes" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); @@ -63,10 +63,10 @@ LinkedAccountCommonModelScopeDeserializerRequest request ) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/accounting/v1/linked-account-scopes", + Path = "accounting/v1/linked-account-scopes", Body = request } ); diff --git a/src/Merge.Client/Accounting/SyncStatus/SyncStatusClient.cs b/src/Merge.Client/Accounting/SyncStatus/SyncStatusClient.cs index 979cf413..c431be4a 100644 --- a/src/Merge.Client/Accounting/SyncStatus/SyncStatusClient.cs +++ b/src/Merge.Client/Accounting/SyncStatus/SyncStatusClient.cs @@ -30,10 +30,10 @@ public async Task ListAsync(SyncStatusListRequest reque _query["page_size"] = request.PageSize.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/accounting/v1/sync-status", + Path = "accounting/v1/sync-status", Query = _query } ); diff --git a/src/Merge.Client/Accounting/TaxRates/TaxRatesClient.cs b/src/Merge.Client/Accounting/TaxRates/TaxRatesClient.cs index 47f0f833..f1019f96 100644 --- a/src/Merge.Client/Accounting/TaxRates/TaxRatesClient.cs +++ b/src/Merge.Client/Accounting/TaxRates/TaxRatesClient.cs @@ -66,10 +66,10 @@ public async Task ListAsync(TaxRatesListRequest request) _query["remote_id"] = request.RemoteId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/accounting/v1/tax-rates", + Path = "accounting/v1/tax-rates", Query = _query } ); @@ -96,10 +96,10 @@ public async Task RetrieveAsync(string id, TaxRatesRetrieveRequest requ _query["include_remote_data"] = request.IncludeRemoteData.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/accounting/v1/tax-rates/{id}", + Path = $"accounting/v1/tax-rates/{id}", Query = _query } ); diff --git a/src/Merge.Client/Accounting/TrackingCategories/TrackingCategoriesClient.cs b/src/Merge.Client/Accounting/TrackingCategories/TrackingCategoriesClient.cs index b78086da..70f03ece 100644 --- a/src/Merge.Client/Accounting/TrackingCategories/TrackingCategoriesClient.cs +++ b/src/Merge.Client/Accounting/TrackingCategories/TrackingCategoriesClient.cs @@ -76,10 +76,10 @@ TrackingCategoriesListRequest request _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/accounting/v1/tracking-categories", + Path = "accounting/v1/tracking-categories", Query = _query } ); @@ -117,10 +117,10 @@ TrackingCategoriesRetrieveRequest request _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/accounting/v1/tracking-categories/{id}", + Path = $"accounting/v1/tracking-categories/{id}", Query = _query } ); diff --git a/src/Merge.Client/Accounting/Transactions/TransactionsClient.cs b/src/Merge.Client/Accounting/Transactions/TransactionsClient.cs index a28b3098..60c67187 100644 --- a/src/Merge.Client/Accounting/Transactions/TransactionsClient.cs +++ b/src/Merge.Client/Accounting/Transactions/TransactionsClient.cs @@ -39,7 +39,7 @@ public async Task ListAsync(TransactionsListRequest re } if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeDeletedData != null) { @@ -74,10 +74,10 @@ public async Task ListAsync(TransactionsListRequest re _query["transaction_date_before"] = request.TransactionDateBefore.Value.ToString("o0"); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/accounting/v1/transactions", + Path = "accounting/v1/transactions", Query = _query } ); @@ -97,17 +97,17 @@ public async Task RetrieveAsync(string id, TransactionsRetrieveRequ var _query = new Dictionary() { }; if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeRemoteData != null) { _query["include_remote_data"] = request.IncludeRemoteData.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/accounting/v1/transactions/{id}", + Path = $"accounting/v1/transactions/{id}", Query = _query } ); diff --git a/src/Merge.Client/Accounting/Types/CreditNoteLineItem.cs b/src/Merge.Client/Accounting/Types/CreditNoteLineItem.cs index 5c9e0c20..30068ac2 100644 --- a/src/Merge.Client/Accounting/Types/CreditNoteLineItem.cs +++ b/src/Merge.Client/Accounting/Types/CreditNoteLineItem.cs @@ -80,7 +80,7 @@ public class CreditNoteLineItem /// The credit note line item's associated tracking categories. /// [JsonPropertyName("tracking_categories")] - public IEnumerable TrackingCategories { get; init; } + public IEnumerable? TrackingCategories { get; init; } /// /// The credit note line item's account. diff --git a/src/Merge.Client/Accounting/Types/PurchaseOrderLineItem.cs b/src/Merge.Client/Accounting/Types/PurchaseOrderLineItem.cs index 14f6150b..c541efa1 100644 --- a/src/Merge.Client/Accounting/Types/PurchaseOrderLineItem.cs +++ b/src/Merge.Client/Accounting/Types/PurchaseOrderLineItem.cs @@ -68,7 +68,7 @@ public class PurchaseOrderLineItem /// The purchase order line item's associated tracking categories. /// [JsonPropertyName("tracking_categories")] - public IEnumerable TrackingCategories { get; init; } + public IEnumerable? TrackingCategories { get; init; } /// /// The purchase order line item's tax amount. diff --git a/src/Merge.Client/Accounting/Types/PurchaseOrderLineItemRequest.cs b/src/Merge.Client/Accounting/Types/PurchaseOrderLineItemRequest.cs index 674be8df..4a763330 100644 --- a/src/Merge.Client/Accounting/Types/PurchaseOrderLineItemRequest.cs +++ b/src/Merge.Client/Accounting/Types/PurchaseOrderLineItemRequest.cs @@ -53,7 +53,7 @@ public class PurchaseOrderLineItemRequest /// The purchase order line item's associated tracking categories. /// [JsonPropertyName("tracking_categories")] - public IEnumerable TrackingCategories { get; init; } + public IEnumerable? TrackingCategories { get; init; } /// /// The purchase order line item's tax amount. diff --git a/src/Merge.Client/Accounting/Types/TransactionLineItem.cs b/src/Merge.Client/Accounting/Types/TransactionLineItem.cs index f0f11014..ecb10392 100644 --- a/src/Merge.Client/Accounting/Types/TransactionLineItem.cs +++ b/src/Merge.Client/Accounting/Types/TransactionLineItem.cs @@ -68,7 +68,7 @@ public class TransactionLineItem /// The line's associated tracking categories. /// [JsonPropertyName("tracking_categories")] - public IEnumerable TrackingCategories { get; init; } + public IEnumerable? TrackingCategories { get; init; } /// /// The line item's total. diff --git a/src/Merge.Client/Accounting/Types/VendorCreditLine.cs b/src/Merge.Client/Accounting/Types/VendorCreditLine.cs index 5ef87610..431b682a 100644 --- a/src/Merge.Client/Accounting/Types/VendorCreditLine.cs +++ b/src/Merge.Client/Accounting/Types/VendorCreditLine.cs @@ -46,7 +46,7 @@ public class VendorCreditLine /// The line's associated tracking categories. /// [JsonPropertyName("tracking_categories")] - public IEnumerable TrackingCategories { get; init; } + public IEnumerable? TrackingCategories { get; init; } /// /// The line's description. diff --git a/src/Merge.Client/Accounting/VendorCredits/VendorCreditsClient.cs b/src/Merge.Client/Accounting/VendorCredits/VendorCreditsClient.cs index 0a0ac662..377790c7 100644 --- a/src/Merge.Client/Accounting/VendorCredits/VendorCreditsClient.cs +++ b/src/Merge.Client/Accounting/VendorCredits/VendorCreditsClient.cs @@ -39,7 +39,7 @@ public async Task ListAsync(VendorCreditsListRequest } if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeDeletedData != null) { @@ -74,10 +74,10 @@ public async Task ListAsync(VendorCreditsListRequest _query["transaction_date_before"] = request.TransactionDateBefore.Value.ToString("o0"); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/accounting/v1/vendor-credits", + Path = "accounting/v1/vendor-credits", Query = _query } ); @@ -97,17 +97,17 @@ public async Task RetrieveAsync(string id, VendorCreditsRetrieveRe var _query = new Dictionary() { }; if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeRemoteData != null) { _query["include_remote_data"] = request.IncludeRemoteData.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/accounting/v1/vendor-credits/{id}", + Path = $"accounting/v1/vendor-credits/{id}", Query = _query } ); diff --git a/src/Merge.Client/Accounting/WebhookReceivers/WebhookReceiversClient.cs b/src/Merge.Client/Accounting/WebhookReceivers/WebhookReceiversClient.cs index be86488d..f0980ce4 100644 --- a/src/Merge.Client/Accounting/WebhookReceivers/WebhookReceiversClient.cs +++ b/src/Merge.Client/Accounting/WebhookReceivers/WebhookReceiversClient.cs @@ -21,10 +21,10 @@ public WebhookReceiversClient(RawClient client) public async Task> ListAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/accounting/v1/webhook-receivers" + Path = "accounting/v1/webhook-receivers" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); @@ -41,10 +41,10 @@ public async Task> ListAsync() public async Task CreateAsync(WebhookReceiverRequest request) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/accounting/v1/webhook-receivers", + Path = "accounting/v1/webhook-receivers", Body = request } ); diff --git a/src/Merge.Client/Ats/AccountDetails/AccountDetailsClient.cs b/src/Merge.Client/Ats/AccountDetails/AccountDetailsClient.cs index 8e0c5df2..558bcd8b 100644 --- a/src/Merge.Client/Ats/AccountDetails/AccountDetailsClient.cs +++ b/src/Merge.Client/Ats/AccountDetails/AccountDetailsClient.cs @@ -21,7 +21,11 @@ public AccountDetailsClient(RawClient client) public async Task RetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest { Method = HttpMethod.Get, Path = "/ats/v1/account-details" } + new RawClient.JsonApiRequest + { + Method = HttpMethod.Get, + Path = "ats/v1/account-details" + } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode >= 200 && response.StatusCode < 400) diff --git a/src/Merge.Client/Ats/AccountToken/AccountTokenClient.cs b/src/Merge.Client/Ats/AccountToken/AccountTokenClient.cs index 616428d2..d5c9fb4f 100644 --- a/src/Merge.Client/Ats/AccountToken/AccountTokenClient.cs +++ b/src/Merge.Client/Ats/AccountToken/AccountTokenClient.cs @@ -21,10 +21,10 @@ public AccountTokenClient(RawClient client) public async Task RetrieveAsync(string publicToken) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/ats/v1/account-token/{publicToken}" + Path = $"ats/v1/account-token/{publicToken}" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Ats/Activities/ActivitiesClient.cs b/src/Merge.Client/Ats/Activities/ActivitiesClient.cs index 390b71b8..806e125d 100644 --- a/src/Merge.Client/Ats/Activities/ActivitiesClient.cs +++ b/src/Merge.Client/Ats/Activities/ActivitiesClient.cs @@ -59,7 +59,7 @@ public async Task ListAsync(ActivitiesListRequest request } if (request.RemoteFields != null) { - _query["remote_fields"] = request.RemoteFields.ToString(); + _query["remote_fields"] = JsonSerializer.Serialize(request.RemoteFields.Value); } if (request.RemoteId != null) { @@ -67,17 +67,17 @@ public async Task ListAsync(ActivitiesListRequest request } if (request.ShowEnumOrigins != null) { - _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); + _query["show_enum_origins"] = JsonSerializer.Serialize(request.ShowEnumOrigins.Value); } if (request.UserId != null) { _query["user_id"] = request.UserId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ats/v1/activities", + Path = "ats/v1/activities", Query = _query } ); @@ -104,10 +104,10 @@ public async Task CreateAsync(ActivityEndpointRequest request) _query["run_async"] = request.RunAsync.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/ats/v1/activities", + Path = "ats/v1/activities", Query = _query } ); @@ -135,17 +135,17 @@ public async Task RetrieveAsync(string id, ActivitiesRetrieveRequest r } if (request.RemoteFields != null) { - _query["remote_fields"] = request.RemoteFields.ToString(); + _query["remote_fields"] = JsonSerializer.Serialize(request.RemoteFields.Value); } if (request.ShowEnumOrigins != null) { - _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); + _query["show_enum_origins"] = JsonSerializer.Serialize(request.ShowEnumOrigins.Value); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/ats/v1/activities/{id}", + Path = $"ats/v1/activities/{id}", Query = _query } ); @@ -163,10 +163,10 @@ public async Task RetrieveAsync(string id, ActivitiesRetrieveRequest r public async Task MetaPostRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ats/v1/activities/meta/post" + Path = "ats/v1/activities/meta/post" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Ats/Applications/ApplicationsClient.cs b/src/Merge.Client/Ats/Applications/ApplicationsClient.cs index fc83cbad..65137382 100644 --- a/src/Merge.Client/Ats/Applications/ApplicationsClient.cs +++ b/src/Merge.Client/Ats/Applications/ApplicationsClient.cs @@ -47,7 +47,7 @@ public async Task ListAsync(ApplicationsListRequest re } if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeDeletedData != null) { @@ -86,10 +86,10 @@ public async Task ListAsync(ApplicationsListRequest re _query["source"] = request.Source; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ats/v1/applications", + Path = "ats/v1/applications", Query = _query } ); @@ -116,10 +116,10 @@ public async Task CreateAsync(ApplicationEndpointRequest re _query["run_async"] = request.RunAsync.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/ats/v1/applications", + Path = "ats/v1/applications", Query = _query } ); @@ -139,17 +139,17 @@ public async Task RetrieveAsync(string id, ApplicationsRetrieveRequ var _query = new Dictionary() { }; if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeRemoteData != null) { _query["include_remote_data"] = request.IncludeRemoteData.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/ats/v1/applications/{id}", + Path = $"ats/v1/applications/{id}", Query = _query } ); @@ -179,10 +179,10 @@ UpdateApplicationStageRequest request _query["run_async"] = request.RunAsync.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = $"/ats/v1/applications/{id}/change-stage", + Path = $"ats/v1/applications/{id}/change-stage", Query = _query } ); @@ -207,10 +207,10 @@ ApplicationsMetaPostRetrieveRequest request _query["application_remote_template_id"] = request.ApplicationRemoteTemplateId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ats/v1/applications/meta/post", + Path = "ats/v1/applications/meta/post", Query = _query } ); diff --git a/src/Merge.Client/Ats/AsyncPassthrough/AsyncPassthroughClient.cs b/src/Merge.Client/Ats/AsyncPassthrough/AsyncPassthroughClient.cs index 255e476b..47285c6f 100644 --- a/src/Merge.Client/Ats/AsyncPassthrough/AsyncPassthroughClient.cs +++ b/src/Merge.Client/Ats/AsyncPassthrough/AsyncPassthroughClient.cs @@ -21,10 +21,10 @@ public AsyncPassthroughClient(RawClient client) public async Task CreateAsync(DataPassthroughRequest request) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/ats/v1/async-passthrough", + Path = "ats/v1/async-passthrough", Body = request } ); @@ -42,10 +42,10 @@ public async Task CreateAsync(DataPassthroughRequest re public async Task RetrieveAsync(string asyncPassthroughReceiptId) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/ats/v1/async-passthrough/{asyncPassthroughReceiptId}" + Path = $"ats/v1/async-passthrough/{asyncPassthroughReceiptId}" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Ats/Attachments/AttachmentsClient.cs b/src/Merge.Client/Ats/Attachments/AttachmentsClient.cs index 9562da59..5cc91c35 100644 --- a/src/Merge.Client/Ats/Attachments/AttachmentsClient.cs +++ b/src/Merge.Client/Ats/Attachments/AttachmentsClient.cs @@ -74,10 +74,10 @@ public async Task ListAsync(AttachmentsListRequest requ _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ats/v1/attachments", + Path = "ats/v1/attachments", Query = _query } ); @@ -104,10 +104,10 @@ public async Task CreateAsync(AttachmentEndpointRequest requ _query["run_async"] = request.RunAsync.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/ats/v1/attachments", + Path = "ats/v1/attachments", Query = _query } ); @@ -142,10 +142,10 @@ public async Task RetrieveAsync(string id, AttachmentsRetrieveReques _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/ats/v1/attachments/{id}", + Path = $"ats/v1/attachments/{id}", Query = _query } ); @@ -163,10 +163,10 @@ public async Task RetrieveAsync(string id, AttachmentsRetrieveReques public async Task MetaPostRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ats/v1/attachments/meta/post" + Path = "ats/v1/attachments/meta/post" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Ats/AuditTrail/AuditTrailClient.cs b/src/Merge.Client/Ats/AuditTrail/AuditTrailClient.cs index 4f20a829..47022661 100644 --- a/src/Merge.Client/Ats/AuditTrail/AuditTrailClient.cs +++ b/src/Merge.Client/Ats/AuditTrail/AuditTrailClient.cs @@ -46,10 +46,10 @@ public async Task ListAsync(AuditTrailListRequest re _query["user_email"] = request.UserEmail; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ats/v1/audit-trail", + Path = "ats/v1/audit-trail", Query = _query } ); diff --git a/src/Merge.Client/Ats/AvailableActions/AvailableActionsClient.cs b/src/Merge.Client/Ats/AvailableActions/AvailableActionsClient.cs index 8da66cbf..56e93bdb 100644 --- a/src/Merge.Client/Ats/AvailableActions/AvailableActionsClient.cs +++ b/src/Merge.Client/Ats/AvailableActions/AvailableActionsClient.cs @@ -21,7 +21,11 @@ public AvailableActionsClient(RawClient client) public async Task RetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest { Method = HttpMethod.Get, Path = "/ats/v1/available-actions" } + new RawClient.JsonApiRequest + { + Method = HttpMethod.Get, + Path = "ats/v1/available-actions" + } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode >= 200 && response.StatusCode < 400) diff --git a/src/Merge.Client/Ats/Candidates/CandidatesClient.cs b/src/Merge.Client/Ats/Candidates/CandidatesClient.cs index c8b57308..cbad4285 100644 --- a/src/Merge.Client/Ats/Candidates/CandidatesClient.cs +++ b/src/Merge.Client/Ats/Candidates/CandidatesClient.cs @@ -39,7 +39,7 @@ public async Task ListAsync(CandidatesListRequest reques } if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.FirstName != null) { @@ -78,10 +78,10 @@ public async Task ListAsync(CandidatesListRequest reques _query["tags"] = request.Tags; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ats/v1/candidates", + Path = "ats/v1/candidates", Query = _query } ); @@ -108,10 +108,10 @@ public async Task CreateAsync(CandidateEndpointRequest reques _query["run_async"] = request.RunAsync.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/ats/v1/candidates", + Path = "ats/v1/candidates", Query = _query } ); @@ -131,17 +131,17 @@ public async Task RetrieveAsync(string id, CandidatesRetrieveRequest var _query = new Dictionary() { }; if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeRemoteData != null) { _query["include_remote_data"] = request.IncludeRemoteData.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/ats/v1/candidates/{id}", + Path = $"ats/v1/candidates/{id}", Query = _query } ); @@ -171,10 +171,10 @@ PatchedCandidateEndpointRequest request _query["run_async"] = request.RunAsync.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Patch, - Path = $"/ats/v1/candidates/{id}", + Path = $"ats/v1/candidates/{id}", Query = _query } ); @@ -192,10 +192,10 @@ PatchedCandidateEndpointRequest request public async void IgnoreCreateAsync(string modelId, IgnoreCommonModelRequest request) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = $"/ats/v1/candidates/ignore/{modelId}", + Path = $"ats/v1/candidates/ignore/{modelId}", Body = request } ); @@ -207,10 +207,10 @@ public async void IgnoreCreateAsync(string modelId, IgnoreCommonModelRequest req public async Task MetaPatchRetrieveAsync(string id) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/ats/v1/candidates/meta/patch/{id}" + Path = $"ats/v1/candidates/meta/patch/{id}" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); @@ -227,10 +227,10 @@ public async Task MetaPatchRetrieveAsync(string id) public async Task MetaPostRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ats/v1/candidates/meta/post" + Path = "ats/v1/candidates/meta/post" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Ats/DeleteAccount/DeleteAccountClient.cs b/src/Merge.Client/Ats/DeleteAccount/DeleteAccountClient.cs index 31868831..3f1ef205 100644 --- a/src/Merge.Client/Ats/DeleteAccount/DeleteAccountClient.cs +++ b/src/Merge.Client/Ats/DeleteAccount/DeleteAccountClient.cs @@ -19,7 +19,11 @@ public DeleteAccountClient(RawClient client) public async void DeleteAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest { Method = HttpMethod.Post, Path = "/ats/v1/delete-account" } + new RawClient.JsonApiRequest + { + Method = HttpMethod.Post, + Path = "ats/v1/delete-account" + } ); } } diff --git a/src/Merge.Client/Ats/Departments/DepartmentsClient.cs b/src/Merge.Client/Ats/Departments/DepartmentsClient.cs index 6753bb0e..77c304bc 100644 --- a/src/Merge.Client/Ats/Departments/DepartmentsClient.cs +++ b/src/Merge.Client/Ats/Departments/DepartmentsClient.cs @@ -58,10 +58,10 @@ public async Task ListAsync(DepartmentsListRequest requ _query["remote_id"] = request.RemoteId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ats/v1/departments", + Path = "ats/v1/departments", Query = _query } ); @@ -84,10 +84,10 @@ public async Task RetrieveAsync(string id, DepartmentsRetrieveReques _query["include_remote_data"] = request.IncludeRemoteData.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/ats/v1/departments/{id}", + Path = $"ats/v1/departments/{id}", Query = _query } ); diff --git a/src/Merge.Client/Ats/Eeocs/EeocsClient.cs b/src/Merge.Client/Ats/Eeocs/EeocsClient.cs index 7441379c..bbccb8ac 100644 --- a/src/Merge.Client/Ats/Eeocs/EeocsClient.cs +++ b/src/Merge.Client/Ats/Eeocs/EeocsClient.cs @@ -63,7 +63,7 @@ public async Task ListAsync(EeocsListRequest request) } if (request.RemoteFields != null) { - _query["remote_fields"] = request.RemoteFields.ToString(); + _query["remote_fields"] = JsonSerializer.Serialize(request.RemoteFields.Value); } if (request.RemoteId != null) { @@ -71,13 +71,13 @@ public async Task ListAsync(EeocsListRequest request) } if (request.ShowEnumOrigins != null) { - _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); + _query["show_enum_origins"] = JsonSerializer.Serialize(request.ShowEnumOrigins.Value); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ats/v1/eeocs", + Path = "ats/v1/eeocs", Query = _query } ); @@ -105,17 +105,17 @@ public async Task RetrieveAsync(string id, EeocsRetrieveRequest request) } if (request.RemoteFields != null) { - _query["remote_fields"] = request.RemoteFields.ToString(); + _query["remote_fields"] = JsonSerializer.Serialize(request.RemoteFields.Value); } if (request.ShowEnumOrigins != null) { - _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); + _query["show_enum_origins"] = JsonSerializer.Serialize(request.ShowEnumOrigins.Value); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/ats/v1/eeocs/{id}", + Path = $"ats/v1/eeocs/{id}", Query = _query } ); diff --git a/src/Merge.Client/Ats/FieldMapping/FieldMappingClient.cs b/src/Merge.Client/Ats/FieldMapping/FieldMappingClient.cs index 04ac7f05..84b57c66 100644 --- a/src/Merge.Client/Ats/FieldMapping/FieldMappingClient.cs +++ b/src/Merge.Client/Ats/FieldMapping/FieldMappingClient.cs @@ -21,7 +21,7 @@ public FieldMappingClient(RawClient client) public async Task FieldMappingsRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest { Method = HttpMethod.Get, Path = "/ats/v1/field-mappings" } + new RawClient.JsonApiRequest { Method = HttpMethod.Get, Path = "ats/v1/field-mappings" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode >= 200 && response.StatusCode < 400) @@ -39,10 +39,10 @@ CreateFieldMappingRequest request ) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/ats/v1/field-mappings", + Path = "ats/v1/field-mappings", Body = request } ); @@ -60,10 +60,10 @@ CreateFieldMappingRequest request public async Task FieldMappingsDestroyAsync(string fieldMappingId) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Delete, - Path = $"/ats/v1/field-mappings/{fieldMappingId}" + Path = $"ats/v1/field-mappings/{fieldMappingId}" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); @@ -83,10 +83,10 @@ PatchedEditFieldMappingRequest request ) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Patch, - Path = $"/ats/v1/field-mappings/{fieldMappingId}", + Path = $"ats/v1/field-mappings/{fieldMappingId}", Body = request } ); @@ -115,10 +115,10 @@ RemoteFieldsRetrieveRequest request _query["include_example_values"] = request.IncludeExampleValues; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ats/v1/remote-fields", + Path = "ats/v1/remote-fields", Query = _query } ); @@ -136,7 +136,7 @@ RemoteFieldsRetrieveRequest request public async Task TargetFieldsRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest { Method = HttpMethod.Get, Path = "/ats/v1/target-fields" } + new RawClient.JsonApiRequest { Method = HttpMethod.Get, Path = "ats/v1/target-fields" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode >= 200 && response.StatusCode < 400) diff --git a/src/Merge.Client/Ats/ForceResync/ForceResyncClient.cs b/src/Merge.Client/Ats/ForceResync/ForceResyncClient.cs index f55c35ce..a27b3ac9 100644 --- a/src/Merge.Client/Ats/ForceResync/ForceResyncClient.cs +++ b/src/Merge.Client/Ats/ForceResync/ForceResyncClient.cs @@ -21,10 +21,10 @@ public ForceResyncClient(RawClient client) public async Task> SyncStatusResyncCreateAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/ats/v1/sync-status/resync" + Path = "ats/v1/sync-status/resync" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Ats/GenerateKey/GenerateKeyClient.cs b/src/Merge.Client/Ats/GenerateKey/GenerateKeyClient.cs index da63450a..a73ea1de 100644 --- a/src/Merge.Client/Ats/GenerateKey/GenerateKeyClient.cs +++ b/src/Merge.Client/Ats/GenerateKey/GenerateKeyClient.cs @@ -21,10 +21,10 @@ public GenerateKeyClient(RawClient client) public async Task CreateAsync(GenerateRemoteKeyRequest request) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/ats/v1/generate-key", + Path = "ats/v1/generate-key", Body = request } ); diff --git a/src/Merge.Client/Ats/Interviews/InterviewsClient.cs b/src/Merge.Client/Ats/Interviews/InterviewsClient.cs index c96ad27a..c64f68c6 100644 --- a/src/Merge.Client/Ats/Interviews/InterviewsClient.cs +++ b/src/Merge.Client/Ats/Interviews/InterviewsClient.cs @@ -39,7 +39,7 @@ public async Task ListAsync(InterviewsListReque } if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeDeletedData != null) { @@ -86,10 +86,10 @@ public async Task ListAsync(InterviewsListReque _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ats/v1/interviews", + Path = "ats/v1/interviews", Query = _query } ); @@ -118,10 +118,10 @@ ScheduledInterviewEndpointRequest request _query["run_async"] = request.RunAsync.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/ats/v1/interviews", + Path = "ats/v1/interviews", Query = _query } ); @@ -144,7 +144,7 @@ InterviewsRetrieveRequest request var _query = new Dictionary() { }; if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeRemoteData != null) { @@ -159,10 +159,10 @@ InterviewsRetrieveRequest request _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/ats/v1/interviews/{id}", + Path = $"ats/v1/interviews/{id}", Query = _query } ); @@ -180,10 +180,10 @@ InterviewsRetrieveRequest request public async Task MetaPostRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ats/v1/interviews/meta/post" + Path = "ats/v1/interviews/meta/post" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Ats/Issues/IssuesClient.cs b/src/Merge.Client/Ats/Issues/IssuesClient.cs index f108544d..a735349b 100644 --- a/src/Merge.Client/Ats/Issues/IssuesClient.cs +++ b/src/Merge.Client/Ats/Issues/IssuesClient.cs @@ -77,13 +77,13 @@ public async Task ListAsync(IssuesListRequest request) } if (request.Status != null) { - _query["status"] = request.Status.ToString(); + _query["status"] = JsonSerializer.Serialize(request.Status.Value); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ats/v1/issues", + Path = "ats/v1/issues", Query = _query } ); @@ -101,7 +101,7 @@ public async Task ListAsync(IssuesListRequest request) public async Task RetrieveAsync(string id) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest { Method = HttpMethod.Get, Path = $"/ats/v1/issues/{id}" } + new RawClient.JsonApiRequest { Method = HttpMethod.Get, Path = $"ats/v1/issues/{id}" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode >= 200 && response.StatusCode < 400) diff --git a/src/Merge.Client/Ats/JobInterviewStages/JobInterviewStagesClient.cs b/src/Merge.Client/Ats/JobInterviewStages/JobInterviewStagesClient.cs index 0b8b441f..e853a859 100644 --- a/src/Merge.Client/Ats/JobInterviewStages/JobInterviewStagesClient.cs +++ b/src/Merge.Client/Ats/JobInterviewStages/JobInterviewStagesClient.cs @@ -68,10 +68,10 @@ JobInterviewStagesListRequest request _query["remote_id"] = request.RemoteId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ats/v1/job-interview-stages", + Path = "ats/v1/job-interview-stages", Query = _query } ); @@ -101,10 +101,10 @@ JobInterviewStagesRetrieveRequest request _query["include_remote_data"] = request.IncludeRemoteData.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/ats/v1/job-interview-stages/{id}", + Path = $"ats/v1/job-interview-stages/{id}", Query = _query } ); diff --git a/src/Merge.Client/Ats/JobPostings/JobPostingsClient.cs b/src/Merge.Client/Ats/JobPostings/JobPostingsClient.cs index 2d576a34..ddb5fc87 100644 --- a/src/Merge.Client/Ats/JobPostings/JobPostingsClient.cs +++ b/src/Merge.Client/Ats/JobPostings/JobPostingsClient.cs @@ -63,13 +63,13 @@ public async Task ListAsync(JobPostingsListRequest requ } if (request.Status != null) { - _query["status"] = request.Status.ToString(); + _query["status"] = JsonSerializer.Serialize(request.Status.Value); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ats/v1/job-postings", + Path = "ats/v1/job-postings", Query = _query } ); @@ -96,10 +96,10 @@ public async Task RetrieveAsync(string id, JobPostingsRetrieveReques _query["include_remote_data"] = request.IncludeRemoteData.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/ats/v1/job-postings/{id}", + Path = $"ats/v1/job-postings/{id}", Query = _query } ); diff --git a/src/Merge.Client/Ats/Jobs/JobsClient.cs b/src/Merge.Client/Ats/Jobs/JobsClient.cs index 68614720..79befac6 100644 --- a/src/Merge.Client/Ats/Jobs/JobsClient.cs +++ b/src/Merge.Client/Ats/Jobs/JobsClient.cs @@ -39,7 +39,7 @@ public async Task ListAsync(JobsListRequest request) } if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeDeletedData != null) { @@ -79,13 +79,13 @@ public async Task ListAsync(JobsListRequest request) } if (request.Status != null) { - _query["status"] = request.Status.ToString(); + _query["status"] = JsonSerializer.Serialize(request.Status.Value); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ats/v1/jobs", + Path = "ats/v1/jobs", Query = _query } ); @@ -105,7 +105,7 @@ public async Task RetrieveAsync(string id, JobsRetrieveRequest request) var _query = new Dictionary() { }; if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeRemoteData != null) { @@ -120,10 +120,10 @@ public async Task RetrieveAsync(string id, JobsRetrieveRequest request) _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/ats/v1/jobs/{id}", + Path = $"ats/v1/jobs/{id}", Query = _query } ); @@ -150,7 +150,7 @@ JobsScreeningQuestionsListRequest request } if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeDeletedData != null) { @@ -165,10 +165,10 @@ JobsScreeningQuestionsListRequest request _query["page_size"] = request.PageSize.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/ats/v1/jobs/{jobId}/screening-questions", + Path = $"ats/v1/jobs/{jobId}/screening-questions", Query = _query } ); diff --git a/src/Merge.Client/Ats/LinkToken/LinkTokenClient.cs b/src/Merge.Client/Ats/LinkToken/LinkTokenClient.cs index 97b1e95b..dfe0239e 100644 --- a/src/Merge.Client/Ats/LinkToken/LinkTokenClient.cs +++ b/src/Merge.Client/Ats/LinkToken/LinkTokenClient.cs @@ -21,10 +21,10 @@ public LinkTokenClient(RawClient client) public async Task CreateAsync(EndUserDetailsRequest request) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/ats/v1/link-token", + Path = "ats/v1/link-token", Body = request } ); diff --git a/src/Merge.Client/Ats/LinkedAccounts/LinkedAccountsClient.cs b/src/Merge.Client/Ats/LinkedAccounts/LinkedAccountsClient.cs index 78feb229..5e601afd 100644 --- a/src/Merge.Client/Ats/LinkedAccounts/LinkedAccountsClient.cs +++ b/src/Merge.Client/Ats/LinkedAccounts/LinkedAccountsClient.cs @@ -25,7 +25,7 @@ LinkedAccountsListRequest request var _query = new Dictionary() { }; if (request.Category != null) { - _query["category"] = request.Category.ToString(); + _query["category"] = JsonSerializer.Serialize(request.Category.Value); } if (request.Cursor != null) { @@ -76,10 +76,10 @@ LinkedAccountsListRequest request _query["status"] = request.Status; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ats/v1/linked-accounts", + Path = "ats/v1/linked-accounts", Query = _query } ); diff --git a/src/Merge.Client/Ats/Offers/OffersClient.cs b/src/Merge.Client/Ats/Offers/OffersClient.cs index b3e1464b..42c06bcd 100644 --- a/src/Merge.Client/Ats/Offers/OffersClient.cs +++ b/src/Merge.Client/Ats/Offers/OffersClient.cs @@ -43,7 +43,7 @@ public async Task ListAsync(OffersListRequest request) } if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeDeletedData != null) { @@ -78,10 +78,10 @@ public async Task ListAsync(OffersListRequest request) _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ats/v1/offers", + Path = "ats/v1/offers", Query = _query } ); @@ -101,7 +101,7 @@ public async Task RetrieveAsync(string id, OffersRetrieveRequest request) var _query = new Dictionary() { }; if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeRemoteData != null) { @@ -116,10 +116,10 @@ public async Task RetrieveAsync(string id, OffersRetrieveRequest request) _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/ats/v1/offers/{id}", + Path = $"ats/v1/offers/{id}", Query = _query } ); diff --git a/src/Merge.Client/Ats/Offices/OfficesClient.cs b/src/Merge.Client/Ats/Offices/OfficesClient.cs index 33b03782..b2ae3565 100644 --- a/src/Merge.Client/Ats/Offices/OfficesClient.cs +++ b/src/Merge.Client/Ats/Offices/OfficesClient.cs @@ -58,10 +58,10 @@ public async Task ListAsync(OfficesListRequest request) _query["remote_id"] = request.RemoteId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ats/v1/offices", + Path = "ats/v1/offices", Query = _query } ); @@ -84,10 +84,10 @@ public async Task RetrieveAsync(string id, OfficesRetrieveRequest reques _query["include_remote_data"] = request.IncludeRemoteData.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/ats/v1/offices/{id}", + Path = $"ats/v1/offices/{id}", Query = _query } ); diff --git a/src/Merge.Client/Ats/Passthrough/PassthroughClient.cs b/src/Merge.Client/Ats/Passthrough/PassthroughClient.cs index a7420d43..03f91c63 100644 --- a/src/Merge.Client/Ats/Passthrough/PassthroughClient.cs +++ b/src/Merge.Client/Ats/Passthrough/PassthroughClient.cs @@ -21,10 +21,10 @@ public PassthroughClient(RawClient client) public async Task CreateAsync(DataPassthroughRequest request) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/ats/v1/passthrough", + Path = "ats/v1/passthrough", Body = request } ); diff --git a/src/Merge.Client/Ats/RegenerateKey/RegenerateKeyClient.cs b/src/Merge.Client/Ats/RegenerateKey/RegenerateKeyClient.cs index 5ff84e1a..cc5b78b9 100644 --- a/src/Merge.Client/Ats/RegenerateKey/RegenerateKeyClient.cs +++ b/src/Merge.Client/Ats/RegenerateKey/RegenerateKeyClient.cs @@ -21,10 +21,10 @@ public RegenerateKeyClient(RawClient client) public async Task CreateAsync(RemoteKeyForRegenerationRequest request) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/ats/v1/regenerate-key", + Path = "ats/v1/regenerate-key", Body = request } ); diff --git a/src/Merge.Client/Ats/RejectReasons/RejectReasonsClient.cs b/src/Merge.Client/Ats/RejectReasons/RejectReasonsClient.cs index 7de92727..0df402ca 100644 --- a/src/Merge.Client/Ats/RejectReasons/RejectReasonsClient.cs +++ b/src/Merge.Client/Ats/RejectReasons/RejectReasonsClient.cs @@ -58,10 +58,10 @@ public async Task ListAsync(RejectReasonsListRequest _query["remote_id"] = request.RemoteId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ats/v1/reject-reasons", + Path = "ats/v1/reject-reasons", Query = _query } ); @@ -84,10 +84,10 @@ public async Task RetrieveAsync(string id, RejectReasonsRetrieveRe _query["include_remote_data"] = request.IncludeRemoteData.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/ats/v1/reject-reasons/{id}", + Path = $"ats/v1/reject-reasons/{id}", Query = _query } ); diff --git a/src/Merge.Client/Ats/Scopes/ScopesClient.cs b/src/Merge.Client/Ats/Scopes/ScopesClient.cs index afcbb50d..52b20d8b 100644 --- a/src/Merge.Client/Ats/Scopes/ScopesClient.cs +++ b/src/Merge.Client/Ats/Scopes/ScopesClient.cs @@ -21,7 +21,7 @@ public ScopesClient(RawClient client) public async Task DefaultScopesRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest { Method = HttpMethod.Get, Path = "/ats/v1/default-scopes" } + new RawClient.JsonApiRequest { Method = HttpMethod.Get, Path = "ats/v1/default-scopes" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode >= 200 && response.StatusCode < 400) @@ -37,10 +37,10 @@ public async Task DefaultScopesRetrieveAsync() public async Task LinkedAccountScopesRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ats/v1/linked-account-scopes" + Path = "ats/v1/linked-account-scopes" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); @@ -59,10 +59,10 @@ LinkedAccountCommonModelScopeDeserializerRequest request ) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/ats/v1/linked-account-scopes", + Path = "ats/v1/linked-account-scopes", Body = request } ); diff --git a/src/Merge.Client/Ats/Scorecards/ScorecardsClient.cs b/src/Merge.Client/Ats/Scorecards/ScorecardsClient.cs index 8942e48e..e35caa75 100644 --- a/src/Merge.Client/Ats/Scorecards/ScorecardsClient.cs +++ b/src/Merge.Client/Ats/Scorecards/ScorecardsClient.cs @@ -39,7 +39,7 @@ public async Task ListAsync(ScorecardsListRequest reques } if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeDeletedData != null) { @@ -82,10 +82,10 @@ public async Task ListAsync(ScorecardsListRequest reques _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ats/v1/scorecards", + Path = "ats/v1/scorecards", Query = _query } ); @@ -105,7 +105,7 @@ public async Task RetrieveAsync(string id, ScorecardsRetrieveRequest var _query = new Dictionary() { }; if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeRemoteData != null) { @@ -120,10 +120,10 @@ public async Task RetrieveAsync(string id, ScorecardsRetrieveRequest _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/ats/v1/scorecards/{id}", + Path = $"ats/v1/scorecards/{id}", Query = _query } ); diff --git a/src/Merge.Client/Ats/SyncStatus/SyncStatusClient.cs b/src/Merge.Client/Ats/SyncStatus/SyncStatusClient.cs index ab787717..0e5d0292 100644 --- a/src/Merge.Client/Ats/SyncStatus/SyncStatusClient.cs +++ b/src/Merge.Client/Ats/SyncStatus/SyncStatusClient.cs @@ -30,10 +30,10 @@ public async Task ListAsync(SyncStatusListRequest reque _query["page_size"] = request.PageSize.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ats/v1/sync-status", + Path = "ats/v1/sync-status", Query = _query } ); diff --git a/src/Merge.Client/Ats/Tags/TagsClient.cs b/src/Merge.Client/Ats/Tags/TagsClient.cs index 4bb12b7e..092074d3 100644 --- a/src/Merge.Client/Ats/Tags/TagsClient.cs +++ b/src/Merge.Client/Ats/Tags/TagsClient.cs @@ -58,10 +58,10 @@ public async Task ListAsync(TagsListRequest request) _query["remote_id"] = request.RemoteId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ats/v1/tags", + Path = "ats/v1/tags", Query = _query } ); diff --git a/src/Merge.Client/Ats/Users/UsersClient.cs b/src/Merge.Client/Ats/Users/UsersClient.cs index 7cc58fe0..746527ec 100644 --- a/src/Merge.Client/Ats/Users/UsersClient.cs +++ b/src/Merge.Client/Ats/Users/UsersClient.cs @@ -70,10 +70,10 @@ public async Task ListAsync(UsersListRequest request) _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ats/v1/users", + Path = "ats/v1/users", Query = _query } ); @@ -104,10 +104,10 @@ public async Task RetrieveAsync(string id, UsersRetrieveRequest requ _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/ats/v1/users/{id}", + Path = $"ats/v1/users/{id}", Query = _query } ); diff --git a/src/Merge.Client/Ats/WebhookReceivers/WebhookReceiversClient.cs b/src/Merge.Client/Ats/WebhookReceivers/WebhookReceiversClient.cs index 2a72e6dd..1c8cb206 100644 --- a/src/Merge.Client/Ats/WebhookReceivers/WebhookReceiversClient.cs +++ b/src/Merge.Client/Ats/WebhookReceivers/WebhookReceiversClient.cs @@ -21,7 +21,11 @@ public WebhookReceiversClient(RawClient client) public async Task> ListAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest { Method = HttpMethod.Get, Path = "/ats/v1/webhook-receivers" } + new RawClient.JsonApiRequest + { + Method = HttpMethod.Get, + Path = "ats/v1/webhook-receivers" + } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode >= 200 && response.StatusCode < 400) @@ -37,10 +41,10 @@ public async Task> ListAsync() public async Task CreateAsync(WebhookReceiverRequest request) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/ats/v1/webhook-receivers", + Path = "ats/v1/webhook-receivers", Body = request } ); diff --git a/src/Merge.Client/Core/RawClient.cs b/src/Merge.Client/Core/RawClient.cs index 5459afb1..bd0e2e00 100644 --- a/src/Merge.Client/Core/RawClient.cs +++ b/src/Merge.Client/Core/RawClient.cs @@ -26,12 +26,10 @@ public RawClient(Dictionary headers, ClientOptions clientOptions _headers = headers; } - public async Task MakeRequestAsync(ApiRequest request) + public async Task MakeRequestAsync(BaseApiRequest request) { - var httpRequest = new HttpRequestMessage( - request.Method, - this.BuildUrl(request.Path, request.Query) - ); + var url = this.BuildUrl(request.Path, request.Query); + var httpRequest = new HttpRequestMessage(request.Method, url); if (request.ContentType != null) { request.Headers.Add("Content-Type", request.ContentType); @@ -47,24 +45,31 @@ public async Task MakeRequestAsync(ApiRequest request) httpRequest.Headers.Add(key, value); } // Add the request body to the request - if (request.Body != null) + if (request is JsonApiRequest jsonRequest) { - var serializerOptions = new JsonSerializerOptions { WriteIndented = true, }; - httpRequest.Content = new StringContent( - JsonSerializer.Serialize(request.Body, serializerOptions), - Encoding.UTF8, - "application/json" - ); + if (jsonRequest.Body != null) + { + var serializerOptions = new JsonSerializerOptions { WriteIndented = true, }; + httpRequest.Content = new StringContent( + JsonSerializer.Serialize(jsonRequest.Body, serializerOptions), + Encoding.UTF8, + "application/json" + ); + } + } + else if (request is StreamApiRequest streamRequest) + { + if (streamRequest.Body != null) + { + httpRequest.Content = new StreamContent(streamRequest.Body); + } } // Send the request HttpResponseMessage response = await _clientOptions.HttpClient.SendAsync(httpRequest); return new ApiResponse { StatusCode = (int)response.StatusCode, Raw = response }; } - /// - /// The request object to be sent to the API. - /// - public class ApiRequest + public abstract class BaseApiRequest { public HttpMethod Method; @@ -72,8 +77,6 @@ public class ApiRequest public string? ContentType = null; - public object? Body { get; init; } = null; - public Dictionary Query { get; init; } = new(); public Dictionary Headers { get; init; } = new(); @@ -81,6 +84,22 @@ public class ApiRequest public object RequestOptions { get; init; } } + /// + /// The request object to be sent for streaming uploads. + /// + public class StreamApiRequest : BaseApiRequest + { + public Stream? Body { get; init; } = null; + } + + /// + /// The request object to be sent for JSON APIs. + /// + public class JsonApiRequest : BaseApiRequest + { + public object? Body { get; init; } = null; + } + /// /// The response object returned from the API. /// @@ -91,7 +110,7 @@ public class ApiResponse public HttpResponseMessage Raw; } - private Dictionary GetHeaders(ApiRequest request) + private Dictionary GetHeaders(BaseApiRequest request) { var headers = new Dictionary(); foreach (var (key, value) in request.Headers) @@ -105,9 +124,11 @@ private Dictionary GetHeaders(ApiRequest request) return headers; } - private string BuildUrl(string path, Dictionary query) + public string BuildUrl(string path, Dictionary query) { - var url = $"{_clientOptions.BaseUrl}{path}"; + var trimmedBaseUrl = _clientOptions.BaseUrl.TrimEnd('/'); + var trimmedBasePath = path.TrimStart('/'); + var url = $"{trimmedBaseUrl}/{trimmedBasePath}"; if (query.Count > 0) { url += "?"; diff --git a/src/Merge.Client/Crm/AccountDetails/AccountDetailsClient.cs b/src/Merge.Client/Crm/AccountDetails/AccountDetailsClient.cs index d36f6dd7..88678902 100644 --- a/src/Merge.Client/Crm/AccountDetails/AccountDetailsClient.cs +++ b/src/Merge.Client/Crm/AccountDetails/AccountDetailsClient.cs @@ -21,7 +21,11 @@ public AccountDetailsClient(RawClient client) public async Task RetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest { Method = HttpMethod.Get, Path = "/crm/v1/account-details" } + new RawClient.JsonApiRequest + { + Method = HttpMethod.Get, + Path = "crm/v1/account-details" + } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode >= 200 && response.StatusCode < 400) diff --git a/src/Merge.Client/Crm/AccountToken/AccountTokenClient.cs b/src/Merge.Client/Crm/AccountToken/AccountTokenClient.cs index e2bdccc6..fb8cd263 100644 --- a/src/Merge.Client/Crm/AccountToken/AccountTokenClient.cs +++ b/src/Merge.Client/Crm/AccountToken/AccountTokenClient.cs @@ -21,10 +21,10 @@ public AccountTokenClient(RawClient client) public async Task RetrieveAsync(string publicToken) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/crm/v1/account-token/{publicToken}" + Path = $"crm/v1/account-token/{publicToken}" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Crm/Accounts/AccountsClient.cs b/src/Merge.Client/Crm/Accounts/AccountsClient.cs index 38f90c7d..68804e4d 100644 --- a/src/Merge.Client/Crm/Accounts/AccountsClient.cs +++ b/src/Merge.Client/Crm/Accounts/AccountsClient.cs @@ -74,10 +74,10 @@ public async Task ListAsync(AccountsListRequest request) _query["remote_id"] = request.RemoteId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/crm/v1/accounts", + Path = "crm/v1/accounts", Query = _query } ); @@ -104,10 +104,10 @@ public async Task CreateAsync(CrmAccountEndpointRequest requ _query["run_async"] = request.RunAsync.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/crm/v1/accounts", + Path = "crm/v1/accounts", Query = _query } ); @@ -138,10 +138,10 @@ public async Task RetrieveAsync(string id, AccountsRetrieveRequest requ _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/crm/v1/accounts/{id}", + Path = $"crm/v1/accounts/{id}", Query = _query } ); @@ -171,10 +171,10 @@ PatchedCrmAccountEndpointRequest request _query["run_async"] = request.RunAsync.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Patch, - Path = $"/crm/v1/accounts/{id}", + Path = $"crm/v1/accounts/{id}", Query = _query } ); @@ -192,10 +192,10 @@ PatchedCrmAccountEndpointRequest request public async Task MetaPatchRetrieveAsync(string id) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/crm/v1/accounts/meta/patch/{id}" + Path = $"crm/v1/accounts/meta/patch/{id}" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); @@ -212,10 +212,10 @@ public async Task MetaPatchRetrieveAsync(string id) public async Task MetaPostRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/crm/v1/accounts/meta/post" + Path = "crm/v1/accounts/meta/post" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); @@ -255,10 +255,10 @@ AccountsRemoteFieldClassesListRequest request _query["page_size"] = request.PageSize.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/crm/v1/accounts/remote-field-classes", + Path = "crm/v1/accounts/remote-field-classes", Query = _query } ); diff --git a/src/Merge.Client/Crm/AssociationTypes/AssociationTypesClient.cs b/src/Merge.Client/Crm/AssociationTypes/AssociationTypesClient.cs index c9912e04..147b43ab 100644 --- a/src/Merge.Client/Crm/AssociationTypes/AssociationTypesClient.cs +++ b/src/Merge.Client/Crm/AssociationTypes/AssociationTypesClient.cs @@ -65,10 +65,10 @@ CustomObjectClassesAssociationTypesListRequest request _query["remote_id"] = request.RemoteId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/crm/v1/custom-object-classes/{customObjectClassId}/association-types", + Path = $"crm/v1/custom-object-classes/{customObjectClassId}/association-types", Query = _query } ); @@ -98,10 +98,10 @@ CrmAssociationTypeEndpointRequest request _query["run_async"] = request.RunAsync.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = $"/crm/v1/custom-object-classes/{customObjectClassId}/association-types", + Path = $"crm/v1/custom-object-classes/{customObjectClassId}/association-types", Query = _query } ); @@ -132,11 +132,10 @@ CustomObjectClassesAssociationTypesRetrieveRequest request _query["include_remote_data"] = request.IncludeRemoteData.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = - $"/crm/v1/custom-object-classes/{customObjectClassId}/association-types/{id}", + Path = $"crm/v1/custom-object-classes/{customObjectClassId}/association-types/{id}", Query = _query } ); @@ -156,11 +155,11 @@ string customObjectClassId ) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, Path = - $"/crm/v1/custom-object-classes/{customObjectClassId}/association-types/meta/post" + $"crm/v1/custom-object-classes/{customObjectClassId}/association-types/meta/post" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Crm/Associations/AssociationsClient.cs b/src/Merge.Client/Crm/Associations/AssociationsClient.cs index 12a8786d..4800ffd2 100644 --- a/src/Merge.Client/Crm/Associations/AssociationsClient.cs +++ b/src/Merge.Client/Crm/Associations/AssociationsClient.cs @@ -70,11 +70,11 @@ CustomObjectClassesCustomObjectsAssociationsListRequest request _query["remote_id"] = request.RemoteId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, Path = - $"/crm/v1/custom-object-classes/{customObjectClassId}/custom-objects/{objectId}/associations", + $"crm/v1/custom-object-classes/{customObjectClassId}/custom-objects/{objectId}/associations", Query = _query } ); @@ -108,11 +108,11 @@ CustomObjectClassesCustomObjectsAssociationsUpdateRequest request _query["run_async"] = request.RunAsync.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Put, Path = - $"/crm/v1/custom-object-classes/{sourceClassId}/custom-objects/{sourceObjectId}/associations/{targetClassId}/{targetObjectId}/{associationTypeId}", + $"crm/v1/custom-object-classes/{sourceClassId}/custom-objects/{sourceObjectId}/associations/{targetClassId}/{targetObjectId}/{associationTypeId}", Query = _query } ); diff --git a/src/Merge.Client/Crm/AsyncPassthrough/AsyncPassthroughClient.cs b/src/Merge.Client/Crm/AsyncPassthrough/AsyncPassthroughClient.cs index dd384f32..08a19507 100644 --- a/src/Merge.Client/Crm/AsyncPassthrough/AsyncPassthroughClient.cs +++ b/src/Merge.Client/Crm/AsyncPassthrough/AsyncPassthroughClient.cs @@ -21,10 +21,10 @@ public AsyncPassthroughClient(RawClient client) public async Task CreateAsync(DataPassthroughRequest request) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/crm/v1/async-passthrough", + Path = "crm/v1/async-passthrough", Body = request } ); @@ -42,10 +42,10 @@ public async Task CreateAsync(DataPassthroughRequest re public async Task RetrieveAsync(string asyncPassthroughReceiptId) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/crm/v1/async-passthrough/{asyncPassthroughReceiptId}" + Path = $"crm/v1/async-passthrough/{asyncPassthroughReceiptId}" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Crm/AuditTrail/AuditTrailClient.cs b/src/Merge.Client/Crm/AuditTrail/AuditTrailClient.cs index 0e17af4f..e9ac999c 100644 --- a/src/Merge.Client/Crm/AuditTrail/AuditTrailClient.cs +++ b/src/Merge.Client/Crm/AuditTrail/AuditTrailClient.cs @@ -46,10 +46,10 @@ public async Task ListAsync(AuditTrailListRequest re _query["user_email"] = request.UserEmail; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/crm/v1/audit-trail", + Path = "crm/v1/audit-trail", Query = _query } ); diff --git a/src/Merge.Client/Crm/AvailableActions/AvailableActionsClient.cs b/src/Merge.Client/Crm/AvailableActions/AvailableActionsClient.cs index cb06b7de..7cceaf68 100644 --- a/src/Merge.Client/Crm/AvailableActions/AvailableActionsClient.cs +++ b/src/Merge.Client/Crm/AvailableActions/AvailableActionsClient.cs @@ -21,7 +21,11 @@ public AvailableActionsClient(RawClient client) public async Task RetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest { Method = HttpMethod.Get, Path = "/crm/v1/available-actions" } + new RawClient.JsonApiRequest + { + Method = HttpMethod.Get, + Path = "crm/v1/available-actions" + } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode >= 200 && response.StatusCode < 400) diff --git a/src/Merge.Client/Crm/Contacts/ContactsClient.cs b/src/Merge.Client/Crm/Contacts/ContactsClient.cs index ac4f7122..321b8922 100644 --- a/src/Merge.Client/Crm/Contacts/ContactsClient.cs +++ b/src/Merge.Client/Crm/Contacts/ContactsClient.cs @@ -43,7 +43,7 @@ public async Task ListAsync(ContactsListRequest request) } if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeDeletedData != null) { @@ -78,10 +78,10 @@ public async Task ListAsync(ContactsListRequest request) _query["remote_id"] = request.RemoteId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/crm/v1/contacts", + Path = "crm/v1/contacts", Query = _query } ); @@ -108,10 +108,10 @@ public async Task CreateAsync(CrmContactEndpointRequest requ _query["run_async"] = request.RunAsync.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/crm/v1/contacts", + Path = "crm/v1/contacts", Query = _query } ); @@ -131,7 +131,7 @@ public async Task RetrieveAsync(string id, ContactsRetrieveRequest requ var _query = new Dictionary() { }; if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeRemoteData != null) { @@ -142,10 +142,10 @@ public async Task RetrieveAsync(string id, ContactsRetrieveRequest requ _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/crm/v1/contacts/{id}", + Path = $"crm/v1/contacts/{id}", Query = _query } ); @@ -175,10 +175,10 @@ PatchedCrmContactEndpointRequest request _query["run_async"] = request.RunAsync.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Patch, - Path = $"/crm/v1/contacts/{id}", + Path = $"crm/v1/contacts/{id}", Query = _query } ); @@ -196,10 +196,10 @@ PatchedCrmContactEndpointRequest request public async void IgnoreCreateAsync(string modelId, IgnoreCommonModelRequest request) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = $"/crm/v1/contacts/ignore/{modelId}", + Path = $"crm/v1/contacts/ignore/{modelId}", Body = request } ); @@ -211,10 +211,10 @@ public async void IgnoreCreateAsync(string modelId, IgnoreCommonModelRequest req public async Task MetaPatchRetrieveAsync(string id) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/crm/v1/contacts/meta/patch/{id}" + Path = $"crm/v1/contacts/meta/patch/{id}" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); @@ -231,10 +231,10 @@ public async Task MetaPatchRetrieveAsync(string id) public async Task MetaPostRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/crm/v1/contacts/meta/post" + Path = "crm/v1/contacts/meta/post" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); @@ -274,10 +274,10 @@ ContactsRemoteFieldClassesListRequest request _query["page_size"] = request.PageSize.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/crm/v1/contacts/remote-field-classes", + Path = "crm/v1/contacts/remote-field-classes", Query = _query } ); diff --git a/src/Merge.Client/Crm/CustomObjectClasses/CustomObjectClassesClient.cs b/src/Merge.Client/Crm/CustomObjectClasses/CustomObjectClassesClient.cs index 1940cf74..43894fbf 100644 --- a/src/Merge.Client/Crm/CustomObjectClasses/CustomObjectClassesClient.cs +++ b/src/Merge.Client/Crm/CustomObjectClasses/CustomObjectClassesClient.cs @@ -64,10 +64,10 @@ CustomObjectClassesListRequest request _query["remote_id"] = request.RemoteId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/crm/v1/custom-object-classes", + Path = "crm/v1/custom-object-classes", Query = _query } ); @@ -97,10 +97,10 @@ CustomObjectClassesRetrieveRequest request _query["include_remote_data"] = request.IncludeRemoteData.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/crm/v1/custom-object-classes/{id}", + Path = $"crm/v1/custom-object-classes/{id}", Query = _query } ); diff --git a/src/Merge.Client/Crm/CustomObjects/CustomObjectsClient.cs b/src/Merge.Client/Crm/CustomObjects/CustomObjectsClient.cs index 3740e48f..579e9fb0 100644 --- a/src/Merge.Client/Crm/CustomObjects/CustomObjectsClient.cs +++ b/src/Merge.Client/Crm/CustomObjects/CustomObjectsClient.cs @@ -65,10 +65,10 @@ CustomObjectClassesCustomObjectsListRequest request _query["remote_id"] = request.RemoteId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/crm/v1/custom-object-classes/{customObjectClassId}/custom-objects", + Path = $"crm/v1/custom-object-classes/{customObjectClassId}/custom-objects", Query = _query } ); @@ -98,10 +98,10 @@ CrmCustomObjectEndpointRequest request _query["run_async"] = request.RunAsync.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = $"/crm/v1/custom-object-classes/{customObjectClassId}/custom-objects", + Path = $"crm/v1/custom-object-classes/{customObjectClassId}/custom-objects", Query = _query } ); @@ -132,10 +132,10 @@ CustomObjectClassesCustomObjectsRetrieveRequest request _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/crm/v1/custom-object-classes/{customObjectClassId}/custom-objects/{id}", + Path = $"crm/v1/custom-object-classes/{customObjectClassId}/custom-objects/{id}", Query = _query } ); @@ -155,11 +155,11 @@ string customObjectClassId ) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, Path = - $"/crm/v1/custom-object-classes/{customObjectClassId}/custom-objects/meta/post" + $"crm/v1/custom-object-classes/{customObjectClassId}/custom-objects/meta/post" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Crm/DeleteAccount/DeleteAccountClient.cs b/src/Merge.Client/Crm/DeleteAccount/DeleteAccountClient.cs index 4127b6a1..92df8a08 100644 --- a/src/Merge.Client/Crm/DeleteAccount/DeleteAccountClient.cs +++ b/src/Merge.Client/Crm/DeleteAccount/DeleteAccountClient.cs @@ -19,7 +19,11 @@ public DeleteAccountClient(RawClient client) public async void DeleteAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest { Method = HttpMethod.Post, Path = "/crm/v1/delete-account" } + new RawClient.JsonApiRequest + { + Method = HttpMethod.Post, + Path = "crm/v1/delete-account" + } ); } } diff --git a/src/Merge.Client/Crm/EngagementTypes/EngagementTypesClient.cs b/src/Merge.Client/Crm/EngagementTypes/EngagementTypesClient.cs index 35f2b37f..ed807506 100644 --- a/src/Merge.Client/Crm/EngagementTypes/EngagementTypesClient.cs +++ b/src/Merge.Client/Crm/EngagementTypes/EngagementTypesClient.cs @@ -62,10 +62,10 @@ public async Task ListAsync(EngagementTypesListRequ _query["remote_id"] = request.RemoteId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/crm/v1/engagement-types", + Path = "crm/v1/engagement-types", Query = _query } ); @@ -95,10 +95,10 @@ EngagementTypesRetrieveRequest request _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/crm/v1/engagement-types/{id}", + Path = $"crm/v1/engagement-types/{id}", Query = _query } ); @@ -139,10 +139,10 @@ EngagementTypesRemoteFieldClassesListRequest request _query["page_size"] = request.PageSize.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/crm/v1/engagement-types/remote-field-classes", + Path = "crm/v1/engagement-types/remote-field-classes", Query = _query } ); diff --git a/src/Merge.Client/Crm/Engagements/EngagementsClient.cs b/src/Merge.Client/Crm/Engagements/EngagementsClient.cs index 2067e9a9..8a6c63e2 100644 --- a/src/Merge.Client/Crm/Engagements/EngagementsClient.cs +++ b/src/Merge.Client/Crm/Engagements/EngagementsClient.cs @@ -35,7 +35,7 @@ public async Task ListAsync(EngagementsListRequest requ } if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeDeletedData != null) { @@ -74,10 +74,10 @@ public async Task ListAsync(EngagementsListRequest requ _query["started_before"] = request.StartedBefore.Value.ToString("o0"); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/crm/v1/engagements", + Path = "crm/v1/engagements", Query = _query } ); @@ -104,10 +104,10 @@ public async Task CreateAsync(EngagementEndpointRequest requ _query["run_async"] = request.RunAsync.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/crm/v1/engagements", + Path = "crm/v1/engagements", Query = _query } ); @@ -127,7 +127,7 @@ public async Task RetrieveAsync(string id, EngagementsRetrieveReques var _query = new Dictionary() { }; if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeRemoteData != null) { @@ -138,10 +138,10 @@ public async Task RetrieveAsync(string id, EngagementsRetrieveReques _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/crm/v1/engagements/{id}", + Path = $"crm/v1/engagements/{id}", Query = _query } ); @@ -171,10 +171,10 @@ PatchedEngagementEndpointRequest request _query["run_async"] = request.RunAsync.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Patch, - Path = $"/crm/v1/engagements/{id}", + Path = $"crm/v1/engagements/{id}", Query = _query } ); @@ -192,10 +192,10 @@ PatchedEngagementEndpointRequest request public async Task MetaPatchRetrieveAsync(string id) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/crm/v1/engagements/meta/patch/{id}" + Path = $"crm/v1/engagements/meta/patch/{id}" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); @@ -212,10 +212,10 @@ public async Task MetaPatchRetrieveAsync(string id) public async Task MetaPostRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/crm/v1/engagements/meta/post" + Path = "crm/v1/engagements/meta/post" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); @@ -255,10 +255,10 @@ EngagementsRemoteFieldClassesListRequest request _query["page_size"] = request.PageSize.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/crm/v1/engagements/remote-field-classes", + Path = "crm/v1/engagements/remote-field-classes", Query = _query } ); diff --git a/src/Merge.Client/Crm/FieldMapping/FieldMappingClient.cs b/src/Merge.Client/Crm/FieldMapping/FieldMappingClient.cs index d2258ad8..64b842c5 100644 --- a/src/Merge.Client/Crm/FieldMapping/FieldMappingClient.cs +++ b/src/Merge.Client/Crm/FieldMapping/FieldMappingClient.cs @@ -21,7 +21,7 @@ public FieldMappingClient(RawClient client) public async Task FieldMappingsRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest { Method = HttpMethod.Get, Path = "/crm/v1/field-mappings" } + new RawClient.JsonApiRequest { Method = HttpMethod.Get, Path = "crm/v1/field-mappings" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode >= 200 && response.StatusCode < 400) @@ -39,10 +39,10 @@ CreateFieldMappingRequest request ) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/crm/v1/field-mappings", + Path = "crm/v1/field-mappings", Body = request } ); @@ -60,10 +60,10 @@ CreateFieldMappingRequest request public async Task FieldMappingsDestroyAsync(string fieldMappingId) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Delete, - Path = $"/crm/v1/field-mappings/{fieldMappingId}" + Path = $"crm/v1/field-mappings/{fieldMappingId}" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); @@ -83,10 +83,10 @@ PatchedEditFieldMappingRequest request ) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Patch, - Path = $"/crm/v1/field-mappings/{fieldMappingId}", + Path = $"crm/v1/field-mappings/{fieldMappingId}", Body = request } ); @@ -115,10 +115,10 @@ RemoteFieldsRetrieveRequest request _query["include_example_values"] = request.IncludeExampleValues; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/crm/v1/remote-fields", + Path = "crm/v1/remote-fields", Query = _query } ); @@ -136,7 +136,7 @@ RemoteFieldsRetrieveRequest request public async Task TargetFieldsRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest { Method = HttpMethod.Get, Path = "/crm/v1/target-fields" } + new RawClient.JsonApiRequest { Method = HttpMethod.Get, Path = "crm/v1/target-fields" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode >= 200 && response.StatusCode < 400) diff --git a/src/Merge.Client/Crm/ForceResync/ForceResyncClient.cs b/src/Merge.Client/Crm/ForceResync/ForceResyncClient.cs index ca78c3e3..b9b1075d 100644 --- a/src/Merge.Client/Crm/ForceResync/ForceResyncClient.cs +++ b/src/Merge.Client/Crm/ForceResync/ForceResyncClient.cs @@ -21,10 +21,10 @@ public ForceResyncClient(RawClient client) public async Task> SyncStatusResyncCreateAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/crm/v1/sync-status/resync" + Path = "crm/v1/sync-status/resync" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Crm/GenerateKey/GenerateKeyClient.cs b/src/Merge.Client/Crm/GenerateKey/GenerateKeyClient.cs index 0fea4f80..f1bb1e62 100644 --- a/src/Merge.Client/Crm/GenerateKey/GenerateKeyClient.cs +++ b/src/Merge.Client/Crm/GenerateKey/GenerateKeyClient.cs @@ -21,10 +21,10 @@ public GenerateKeyClient(RawClient client) public async Task CreateAsync(GenerateRemoteKeyRequest request) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/crm/v1/generate-key", + Path = "crm/v1/generate-key", Body = request } ); diff --git a/src/Merge.Client/Crm/Issues/IssuesClient.cs b/src/Merge.Client/Crm/Issues/IssuesClient.cs index 63063c6d..669078f4 100644 --- a/src/Merge.Client/Crm/Issues/IssuesClient.cs +++ b/src/Merge.Client/Crm/Issues/IssuesClient.cs @@ -77,13 +77,13 @@ public async Task ListAsync(IssuesListRequest request) } if (request.Status != null) { - _query["status"] = request.Status.ToString(); + _query["status"] = JsonSerializer.Serialize(request.Status.Value); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/crm/v1/issues", + Path = "crm/v1/issues", Query = _query } ); @@ -101,7 +101,7 @@ public async Task ListAsync(IssuesListRequest request) public async Task RetrieveAsync(string id) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest { Method = HttpMethod.Get, Path = $"/crm/v1/issues/{id}" } + new RawClient.JsonApiRequest { Method = HttpMethod.Get, Path = $"crm/v1/issues/{id}" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode >= 200 && response.StatusCode < 400) diff --git a/src/Merge.Client/Crm/Leads/LeadsClient.cs b/src/Merge.Client/Crm/Leads/LeadsClient.cs index 1b39b21c..b19de15f 100644 --- a/src/Merge.Client/Crm/Leads/LeadsClient.cs +++ b/src/Merge.Client/Crm/Leads/LeadsClient.cs @@ -47,7 +47,7 @@ public async Task ListAsync(LeadsListRequest request) } if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeDeletedData != null) { @@ -86,10 +86,10 @@ public async Task ListAsync(LeadsListRequest request) _query["remote_id"] = request.RemoteId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/crm/v1/leads", + Path = "crm/v1/leads", Query = _query } ); @@ -116,10 +116,10 @@ public async Task CreateAsync(LeadEndpointRequest request) _query["run_async"] = request.RunAsync.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/crm/v1/leads", + Path = "crm/v1/leads", Query = _query } ); @@ -139,7 +139,7 @@ public async Task RetrieveAsync(string id, LeadsRetrieveRequest request) var _query = new Dictionary() { }; if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeRemoteData != null) { @@ -150,10 +150,10 @@ public async Task RetrieveAsync(string id, LeadsRetrieveRequest request) _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/crm/v1/leads/{id}", + Path = $"crm/v1/leads/{id}", Query = _query } ); @@ -171,7 +171,11 @@ public async Task RetrieveAsync(string id, LeadsRetrieveRequest request) public async Task MetaPostRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest { Method = HttpMethod.Get, Path = "/crm/v1/leads/meta/post" } + new RawClient.JsonApiRequest + { + Method = HttpMethod.Get, + Path = "crm/v1/leads/meta/post" + } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode >= 200 && response.StatusCode < 400) @@ -210,10 +214,10 @@ LeadsRemoteFieldClassesListRequest request _query["page_size"] = request.PageSize.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/crm/v1/leads/remote-field-classes", + Path = "crm/v1/leads/remote-field-classes", Query = _query } ); diff --git a/src/Merge.Client/Crm/LinkToken/LinkTokenClient.cs b/src/Merge.Client/Crm/LinkToken/LinkTokenClient.cs index dd4dc162..7f224669 100644 --- a/src/Merge.Client/Crm/LinkToken/LinkTokenClient.cs +++ b/src/Merge.Client/Crm/LinkToken/LinkTokenClient.cs @@ -21,10 +21,10 @@ public LinkTokenClient(RawClient client) public async Task CreateAsync(EndUserDetailsRequest request) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/crm/v1/link-token", + Path = "crm/v1/link-token", Body = request } ); diff --git a/src/Merge.Client/Crm/LinkedAccounts/LinkedAccountsClient.cs b/src/Merge.Client/Crm/LinkedAccounts/LinkedAccountsClient.cs index d2f530af..ffa530be 100644 --- a/src/Merge.Client/Crm/LinkedAccounts/LinkedAccountsClient.cs +++ b/src/Merge.Client/Crm/LinkedAccounts/LinkedAccountsClient.cs @@ -25,7 +25,7 @@ LinkedAccountsListRequest request var _query = new Dictionary() { }; if (request.Category != null) { - _query["category"] = request.Category.ToString(); + _query["category"] = JsonSerializer.Serialize(request.Category.Value); } if (request.Cursor != null) { @@ -76,10 +76,10 @@ LinkedAccountsListRequest request _query["status"] = request.Status; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/crm/v1/linked-accounts", + Path = "crm/v1/linked-accounts", Query = _query } ); diff --git a/src/Merge.Client/Crm/Notes/NotesClient.cs b/src/Merge.Client/Crm/Notes/NotesClient.cs index 499618b1..6ae86b7b 100644 --- a/src/Merge.Client/Crm/Notes/NotesClient.cs +++ b/src/Merge.Client/Crm/Notes/NotesClient.cs @@ -43,7 +43,7 @@ public async Task ListAsync(NotesListRequest request) } if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeDeletedData != null) { @@ -82,10 +82,10 @@ public async Task ListAsync(NotesListRequest request) _query["remote_id"] = request.RemoteId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/crm/v1/notes", + Path = "crm/v1/notes", Query = _query } ); @@ -112,10 +112,10 @@ public async Task CreateAsync(NoteEndpointRequest request) _query["run_async"] = request.RunAsync.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/crm/v1/notes", + Path = "crm/v1/notes", Query = _query } ); @@ -135,7 +135,7 @@ public async Task RetrieveAsync(string id, NotesRetrieveRequest request) var _query = new Dictionary() { }; if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeRemoteData != null) { @@ -146,10 +146,10 @@ public async Task RetrieveAsync(string id, NotesRetrieveRequest request) _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/crm/v1/notes/{id}", + Path = $"crm/v1/notes/{id}", Query = _query } ); @@ -167,7 +167,11 @@ public async Task RetrieveAsync(string id, NotesRetrieveRequest request) public async Task MetaPostRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest { Method = HttpMethod.Get, Path = "/crm/v1/notes/meta/post" } + new RawClient.JsonApiRequest + { + Method = HttpMethod.Get, + Path = "crm/v1/notes/meta/post" + } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode >= 200 && response.StatusCode < 400) @@ -206,10 +210,10 @@ NotesRemoteFieldClassesListRequest request _query["page_size"] = request.PageSize.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/crm/v1/notes/remote-field-classes", + Path = "crm/v1/notes/remote-field-classes", Query = _query } ); diff --git a/src/Merge.Client/Crm/Opportunities/OpportunitiesClient.cs b/src/Merge.Client/Crm/Opportunities/OpportunitiesClient.cs index 51d15ed5..0717b3a9 100644 --- a/src/Merge.Client/Crm/Opportunities/OpportunitiesClient.cs +++ b/src/Merge.Client/Crm/Opportunities/OpportunitiesClient.cs @@ -39,7 +39,7 @@ public async Task ListAsync(OpportunitiesListRequest r } if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeDeletedData != null) { @@ -87,13 +87,13 @@ public async Task ListAsync(OpportunitiesListRequest r } if (request.Status != null) { - _query["status"] = request.Status.ToString(); + _query["status"] = JsonSerializer.Serialize(request.Status.Value); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/crm/v1/opportunities", + Path = "crm/v1/opportunities", Query = _query } ); @@ -120,10 +120,10 @@ public async Task CreateAsync(OpportunityEndpointRequest re _query["run_async"] = request.RunAsync.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/crm/v1/opportunities", + Path = "crm/v1/opportunities", Query = _query } ); @@ -143,7 +143,7 @@ public async Task RetrieveAsync(string id, OpportunitiesRetrieveReq var _query = new Dictionary() { }; if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeRemoteData != null) { @@ -162,10 +162,10 @@ public async Task RetrieveAsync(string id, OpportunitiesRetrieveReq _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/crm/v1/opportunities/{id}", + Path = $"crm/v1/opportunities/{id}", Query = _query } ); @@ -195,10 +195,10 @@ PatchedOpportunityEndpointRequest request _query["run_async"] = request.RunAsync.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Patch, - Path = $"/crm/v1/opportunities/{id}", + Path = $"crm/v1/opportunities/{id}", Query = _query } ); @@ -216,10 +216,10 @@ PatchedOpportunityEndpointRequest request public async Task MetaPatchRetrieveAsync(string id) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/crm/v1/opportunities/meta/patch/{id}" + Path = $"crm/v1/opportunities/meta/patch/{id}" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); @@ -236,10 +236,10 @@ public async Task MetaPatchRetrieveAsync(string id) public async Task MetaPostRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/crm/v1/opportunities/meta/post" + Path = "crm/v1/opportunities/meta/post" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); @@ -279,10 +279,10 @@ OpportunitiesRemoteFieldClassesListRequest request _query["page_size"] = request.PageSize.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/crm/v1/opportunities/remote-field-classes", + Path = "crm/v1/opportunities/remote-field-classes", Query = _query } ); diff --git a/src/Merge.Client/Crm/Passthrough/PassthroughClient.cs b/src/Merge.Client/Crm/Passthrough/PassthroughClient.cs index 4135fc51..77fb0bdc 100644 --- a/src/Merge.Client/Crm/Passthrough/PassthroughClient.cs +++ b/src/Merge.Client/Crm/Passthrough/PassthroughClient.cs @@ -21,10 +21,10 @@ public PassthroughClient(RawClient client) public async Task CreateAsync(DataPassthroughRequest request) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/crm/v1/passthrough", + Path = "crm/v1/passthrough", Body = request } ); diff --git a/src/Merge.Client/Crm/RegenerateKey/RegenerateKeyClient.cs b/src/Merge.Client/Crm/RegenerateKey/RegenerateKeyClient.cs index 014f2936..e6c7e9e5 100644 --- a/src/Merge.Client/Crm/RegenerateKey/RegenerateKeyClient.cs +++ b/src/Merge.Client/Crm/RegenerateKey/RegenerateKeyClient.cs @@ -21,10 +21,10 @@ public RegenerateKeyClient(RawClient client) public async Task CreateAsync(RemoteKeyForRegenerationRequest request) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/crm/v1/regenerate-key", + Path = "crm/v1/regenerate-key", Body = request } ); diff --git a/src/Merge.Client/Crm/Scopes/ScopesClient.cs b/src/Merge.Client/Crm/Scopes/ScopesClient.cs index b367ad57..f27066d4 100644 --- a/src/Merge.Client/Crm/Scopes/ScopesClient.cs +++ b/src/Merge.Client/Crm/Scopes/ScopesClient.cs @@ -21,7 +21,7 @@ public ScopesClient(RawClient client) public async Task DefaultScopesRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest { Method = HttpMethod.Get, Path = "/crm/v1/default-scopes" } + new RawClient.JsonApiRequest { Method = HttpMethod.Get, Path = "crm/v1/default-scopes" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode >= 200 && response.StatusCode < 400) @@ -37,10 +37,10 @@ public async Task DefaultScopesRetrieveAsync() public async Task LinkedAccountScopesRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/crm/v1/linked-account-scopes" + Path = "crm/v1/linked-account-scopes" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); @@ -59,10 +59,10 @@ LinkedAccountCommonModelScopeDeserializerRequest request ) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/crm/v1/linked-account-scopes", + Path = "crm/v1/linked-account-scopes", Body = request } ); diff --git a/src/Merge.Client/Crm/Stages/StagesClient.cs b/src/Merge.Client/Crm/Stages/StagesClient.cs index 6f2b71bf..39723b5a 100644 --- a/src/Merge.Client/Crm/Stages/StagesClient.cs +++ b/src/Merge.Client/Crm/Stages/StagesClient.cs @@ -62,10 +62,10 @@ public async Task ListAsync(StagesListRequest request) _query["remote_id"] = request.RemoteId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/crm/v1/stages", + Path = "crm/v1/stages", Query = _query } ); @@ -92,10 +92,10 @@ public async Task RetrieveAsync(string id, StagesRetrieveRequest request) _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/crm/v1/stages/{id}", + Path = $"crm/v1/stages/{id}", Query = _query } ); @@ -136,10 +136,10 @@ StagesRemoteFieldClassesListRequest request _query["page_size"] = request.PageSize.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/crm/v1/stages/remote-field-classes", + Path = "crm/v1/stages/remote-field-classes", Query = _query } ); diff --git a/src/Merge.Client/Crm/SyncStatus/SyncStatusClient.cs b/src/Merge.Client/Crm/SyncStatus/SyncStatusClient.cs index 3f9c8773..bfdd76e4 100644 --- a/src/Merge.Client/Crm/SyncStatus/SyncStatusClient.cs +++ b/src/Merge.Client/Crm/SyncStatus/SyncStatusClient.cs @@ -30,10 +30,10 @@ public async Task ListAsync(SyncStatusListRequest reque _query["page_size"] = request.PageSize.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/crm/v1/sync-status", + Path = "crm/v1/sync-status", Query = _query } ); diff --git a/src/Merge.Client/Crm/Tasks/TasksClient.cs b/src/Merge.Client/Crm/Tasks/TasksClient.cs index 21f30f34..250d1830 100644 --- a/src/Merge.Client/Crm/Tasks/TasksClient.cs +++ b/src/Merge.Client/Crm/Tasks/TasksClient.cs @@ -35,7 +35,7 @@ public async Task ListAsync(TasksListRequest request) } if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeDeletedData != null) { @@ -66,10 +66,10 @@ public async Task ListAsync(TasksListRequest request) _query["remote_id"] = request.RemoteId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/crm/v1/tasks", + Path = "crm/v1/tasks", Query = _query } ); @@ -96,10 +96,10 @@ public async Task CreateAsync(TaskEndpointRequest request) _query["run_async"] = request.RunAsync.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/crm/v1/tasks", + Path = "crm/v1/tasks", Query = _query } ); @@ -119,7 +119,7 @@ public async Task RetrieveAsync(string id, TasksRetrieveRequest request) var _query = new Dictionary() { }; if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeRemoteData != null) { @@ -130,10 +130,10 @@ public async Task RetrieveAsync(string id, TasksRetrieveRequest request) _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/crm/v1/tasks/{id}", + Path = $"crm/v1/tasks/{id}", Query = _query } ); @@ -163,10 +163,10 @@ PatchedTaskEndpointRequest request _query["run_async"] = request.RunAsync.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Patch, - Path = $"/crm/v1/tasks/{id}", + Path = $"crm/v1/tasks/{id}", Query = _query } ); @@ -184,10 +184,10 @@ PatchedTaskEndpointRequest request public async Task MetaPatchRetrieveAsync(string id) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/crm/v1/tasks/meta/patch/{id}" + Path = $"crm/v1/tasks/meta/patch/{id}" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); @@ -204,7 +204,11 @@ public async Task MetaPatchRetrieveAsync(string id) public async Task MetaPostRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest { Method = HttpMethod.Get, Path = "/crm/v1/tasks/meta/post" } + new RawClient.JsonApiRequest + { + Method = HttpMethod.Get, + Path = "crm/v1/tasks/meta/post" + } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode >= 200 && response.StatusCode < 400) @@ -243,10 +247,10 @@ TasksRemoteFieldClassesListRequest request _query["page_size"] = request.PageSize.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/crm/v1/tasks/remote-field-classes", + Path = "crm/v1/tasks/remote-field-classes", Query = _query } ); diff --git a/src/Merge.Client/Crm/Users/UsersClient.cs b/src/Merge.Client/Crm/Users/UsersClient.cs index 8643ca19..61f67872 100644 --- a/src/Merge.Client/Crm/Users/UsersClient.cs +++ b/src/Merge.Client/Crm/Users/UsersClient.cs @@ -62,10 +62,10 @@ public async Task ListAsync(UsersListRequest request) _query["remote_id"] = request.RemoteId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/crm/v1/users", + Path = "crm/v1/users", Query = _query } ); @@ -92,10 +92,10 @@ public async Task RetrieveAsync(string id, UsersRetrieveRequest request) _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/crm/v1/users/{id}", + Path = $"crm/v1/users/{id}", Query = _query } ); @@ -113,10 +113,10 @@ public async Task RetrieveAsync(string id, UsersRetrieveRequest request) public async void IgnoreCreateAsync(string modelId, IgnoreCommonModelRequest request) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = $"/crm/v1/users/ignore/{modelId}", + Path = $"crm/v1/users/ignore/{modelId}", Body = request } ); @@ -151,10 +151,10 @@ UsersRemoteFieldClassesListRequest request _query["page_size"] = request.PageSize.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/crm/v1/users/remote-field-classes", + Path = "crm/v1/users/remote-field-classes", Query = _query } ); diff --git a/src/Merge.Client/Crm/WebhookReceivers/WebhookReceiversClient.cs b/src/Merge.Client/Crm/WebhookReceivers/WebhookReceiversClient.cs index c51e526b..b8d2c3ba 100644 --- a/src/Merge.Client/Crm/WebhookReceivers/WebhookReceiversClient.cs +++ b/src/Merge.Client/Crm/WebhookReceivers/WebhookReceiversClient.cs @@ -21,7 +21,11 @@ public WebhookReceiversClient(RawClient client) public async Task> ListAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest { Method = HttpMethod.Get, Path = "/crm/v1/webhook-receivers" } + new RawClient.JsonApiRequest + { + Method = HttpMethod.Get, + Path = "crm/v1/webhook-receivers" + } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode >= 200 && response.StatusCode < 400) @@ -37,10 +41,10 @@ public async Task> ListAsync() public async Task CreateAsync(WebhookReceiverRequest request) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/crm/v1/webhook-receivers", + Path = "crm/v1/webhook-receivers", Body = request } ); diff --git a/src/Merge.Client/Filestorage/AccountDetails/AccountDetailsClient.cs b/src/Merge.Client/Filestorage/AccountDetails/AccountDetailsClient.cs index d61b9f35..412a1682 100644 --- a/src/Merge.Client/Filestorage/AccountDetails/AccountDetailsClient.cs +++ b/src/Merge.Client/Filestorage/AccountDetails/AccountDetailsClient.cs @@ -21,10 +21,10 @@ public AccountDetailsClient(RawClient client) public async Task RetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/filestorage/v1/account-details" + Path = "filestorage/v1/account-details" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Filestorage/AccountToken/AccountTokenClient.cs b/src/Merge.Client/Filestorage/AccountToken/AccountTokenClient.cs index df3fc94c..64ae04ad 100644 --- a/src/Merge.Client/Filestorage/AccountToken/AccountTokenClient.cs +++ b/src/Merge.Client/Filestorage/AccountToken/AccountTokenClient.cs @@ -21,10 +21,10 @@ public AccountTokenClient(RawClient client) public async Task RetrieveAsync(string publicToken) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/filestorage/v1/account-token/{publicToken}" + Path = $"filestorage/v1/account-token/{publicToken}" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Filestorage/AsyncPassthrough/AsyncPassthroughClient.cs b/src/Merge.Client/Filestorage/AsyncPassthrough/AsyncPassthroughClient.cs index 4cefece7..cf05535b 100644 --- a/src/Merge.Client/Filestorage/AsyncPassthrough/AsyncPassthroughClient.cs +++ b/src/Merge.Client/Filestorage/AsyncPassthrough/AsyncPassthroughClient.cs @@ -21,10 +21,10 @@ public AsyncPassthroughClient(RawClient client) public async Task CreateAsync(DataPassthroughRequest request) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/filestorage/v1/async-passthrough", + Path = "filestorage/v1/async-passthrough", Body = request } ); @@ -42,10 +42,10 @@ public async Task CreateAsync(DataPassthroughRequest re public async Task RetrieveAsync(string asyncPassthroughReceiptId) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/filestorage/v1/async-passthrough/{asyncPassthroughReceiptId}" + Path = $"filestorage/v1/async-passthrough/{asyncPassthroughReceiptId}" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Filestorage/AuditTrail/AuditTrailClient.cs b/src/Merge.Client/Filestorage/AuditTrail/AuditTrailClient.cs index 5590a1d8..412aeeb4 100644 --- a/src/Merge.Client/Filestorage/AuditTrail/AuditTrailClient.cs +++ b/src/Merge.Client/Filestorage/AuditTrail/AuditTrailClient.cs @@ -46,10 +46,10 @@ public async Task ListAsync(AuditTrailListRequest re _query["user_email"] = request.UserEmail; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/filestorage/v1/audit-trail", + Path = "filestorage/v1/audit-trail", Query = _query } ); diff --git a/src/Merge.Client/Filestorage/AvailableActions/AvailableActionsClient.cs b/src/Merge.Client/Filestorage/AvailableActions/AvailableActionsClient.cs index fd97bed6..4294ff7a 100644 --- a/src/Merge.Client/Filestorage/AvailableActions/AvailableActionsClient.cs +++ b/src/Merge.Client/Filestorage/AvailableActions/AvailableActionsClient.cs @@ -21,10 +21,10 @@ public AvailableActionsClient(RawClient client) public async Task RetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/filestorage/v1/available-actions" + Path = "filestorage/v1/available-actions" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Filestorage/DeleteAccount/DeleteAccountClient.cs b/src/Merge.Client/Filestorage/DeleteAccount/DeleteAccountClient.cs index f9aed53a..a43935cf 100644 --- a/src/Merge.Client/Filestorage/DeleteAccount/DeleteAccountClient.cs +++ b/src/Merge.Client/Filestorage/DeleteAccount/DeleteAccountClient.cs @@ -19,10 +19,10 @@ public DeleteAccountClient(RawClient client) public async void DeleteAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/filestorage/v1/delete-account" + Path = "filestorage/v1/delete-account" } ); } diff --git a/src/Merge.Client/Filestorage/Drives/DrivesClient.cs b/src/Merge.Client/Filestorage/Drives/DrivesClient.cs index b8de50a5..f451db63 100644 --- a/src/Merge.Client/Filestorage/Drives/DrivesClient.cs +++ b/src/Merge.Client/Filestorage/Drives/DrivesClient.cs @@ -62,10 +62,10 @@ public async Task ListAsync(DrivesListRequest request) _query["remote_id"] = request.RemoteId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/filestorage/v1/drives", + Path = "filestorage/v1/drives", Query = _query } ); @@ -88,10 +88,10 @@ public async Task RetrieveAsync(string id, DrivesRetrieveRequest request) _query["include_remote_data"] = request.IncludeRemoteData.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/filestorage/v1/drives/{id}", + Path = $"filestorage/v1/drives/{id}", Query = _query } ); diff --git a/src/Merge.Client/Filestorage/FieldMapping/FieldMappingClient.cs b/src/Merge.Client/Filestorage/FieldMapping/FieldMappingClient.cs index e455cc0b..6e69bb5b 100644 --- a/src/Merge.Client/Filestorage/FieldMapping/FieldMappingClient.cs +++ b/src/Merge.Client/Filestorage/FieldMapping/FieldMappingClient.cs @@ -21,10 +21,10 @@ public FieldMappingClient(RawClient client) public async Task FieldMappingsRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/filestorage/v1/field-mappings" + Path = "filestorage/v1/field-mappings" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); @@ -43,10 +43,10 @@ CreateFieldMappingRequest request ) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/filestorage/v1/field-mappings", + Path = "filestorage/v1/field-mappings", Body = request } ); @@ -64,10 +64,10 @@ CreateFieldMappingRequest request public async Task FieldMappingsDestroyAsync(string fieldMappingId) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Delete, - Path = $"/filestorage/v1/field-mappings/{fieldMappingId}" + Path = $"filestorage/v1/field-mappings/{fieldMappingId}" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); @@ -87,10 +87,10 @@ PatchedEditFieldMappingRequest request ) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Patch, - Path = $"/filestorage/v1/field-mappings/{fieldMappingId}", + Path = $"filestorage/v1/field-mappings/{fieldMappingId}", Body = request } ); @@ -119,10 +119,10 @@ RemoteFieldsRetrieveRequest request _query["include_example_values"] = request.IncludeExampleValues; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/filestorage/v1/remote-fields", + Path = "filestorage/v1/remote-fields", Query = _query } ); @@ -140,10 +140,10 @@ RemoteFieldsRetrieveRequest request public async Task TargetFieldsRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/filestorage/v1/target-fields" + Path = "filestorage/v1/target-fields" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Filestorage/Files/FilesClient.cs b/src/Merge.Client/Filestorage/Files/FilesClient.cs index c06ff5c8..d06426fb 100644 --- a/src/Merge.Client/Filestorage/Files/FilesClient.cs +++ b/src/Merge.Client/Filestorage/Files/FilesClient.cs @@ -39,7 +39,7 @@ public async Task ListAsync(FilesListRequest request) } if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.FolderId != null) { @@ -78,10 +78,10 @@ public async Task ListAsync(FilesListRequest request) _query["remote_id"] = request.RemoteId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/filestorage/v1/files", + Path = "filestorage/v1/files", Query = _query } ); @@ -108,10 +108,10 @@ public async Task CreateAsync(FileStorageFileEndpointRe _query["run_async"] = request.RunAsync.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/filestorage/v1/files", + Path = "filestorage/v1/files", Query = _query } ); @@ -131,17 +131,17 @@ public async Task RetrieveAsync(string id, FilesRetrieveRequest request) var _query = new Dictionary() { }; if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeRemoteData != null) { _query["include_remote_data"] = request.IncludeRemoteData.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/filestorage/v1/files/{id}", + Path = $"filestorage/v1/files/{id}", Query = _query } ); @@ -164,10 +164,10 @@ public async void DownloadRetrieveAsync(string id, FilesDownloadRetrieveRequest _query["mime_type"] = request.MimeType; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/filestorage/v1/files/{id}/download", + Path = $"filestorage/v1/files/{id}/download", Query = _query } ); @@ -179,10 +179,10 @@ public async void DownloadRetrieveAsync(string id, FilesDownloadRetrieveRequest public async Task MetaPostRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/filestorage/v1/files/meta/post" + Path = "filestorage/v1/files/meta/post" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Filestorage/Folders/FoldersClient.cs b/src/Merge.Client/Filestorage/Folders/FoldersClient.cs index 7b052c17..9204e1f0 100644 --- a/src/Merge.Client/Filestorage/Folders/FoldersClient.cs +++ b/src/Merge.Client/Filestorage/Folders/FoldersClient.cs @@ -39,7 +39,7 @@ public async Task ListAsync(FoldersListRequest request) } if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeDeletedData != null) { @@ -74,10 +74,10 @@ public async Task ListAsync(FoldersListRequest request) _query["remote_id"] = request.RemoteId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/filestorage/v1/folders", + Path = "filestorage/v1/folders", Query = _query } ); @@ -106,10 +106,10 @@ FileStorageFolderEndpointRequest request _query["run_async"] = request.RunAsync.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/filestorage/v1/folders", + Path = "filestorage/v1/folders", Query = _query } ); @@ -129,17 +129,17 @@ public async Task RetrieveAsync(string id, FoldersRetrieveRequest reques var _query = new Dictionary() { }; if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeRemoteData != null) { _query["include_remote_data"] = request.IncludeRemoteData.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/filestorage/v1/folders/{id}", + Path = $"filestorage/v1/folders/{id}", Query = _query } ); @@ -157,10 +157,10 @@ public async Task RetrieveAsync(string id, FoldersRetrieveRequest reques public async Task MetaPostRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/filestorage/v1/folders/meta/post" + Path = "filestorage/v1/folders/meta/post" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Filestorage/ForceResync/ForceResyncClient.cs b/src/Merge.Client/Filestorage/ForceResync/ForceResyncClient.cs index 9da157c3..bee403dd 100644 --- a/src/Merge.Client/Filestorage/ForceResync/ForceResyncClient.cs +++ b/src/Merge.Client/Filestorage/ForceResync/ForceResyncClient.cs @@ -21,10 +21,10 @@ public ForceResyncClient(RawClient client) public async Task> SyncStatusResyncCreateAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/filestorage/v1/sync-status/resync" + Path = "filestorage/v1/sync-status/resync" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Filestorage/GenerateKey/GenerateKeyClient.cs b/src/Merge.Client/Filestorage/GenerateKey/GenerateKeyClient.cs index 70ec78c1..be89818d 100644 --- a/src/Merge.Client/Filestorage/GenerateKey/GenerateKeyClient.cs +++ b/src/Merge.Client/Filestorage/GenerateKey/GenerateKeyClient.cs @@ -21,10 +21,10 @@ public GenerateKeyClient(RawClient client) public async Task CreateAsync(GenerateRemoteKeyRequest request) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/filestorage/v1/generate-key", + Path = "filestorage/v1/generate-key", Body = request } ); diff --git a/src/Merge.Client/Filestorage/Groups/GroupsClient.cs b/src/Merge.Client/Filestorage/Groups/GroupsClient.cs index 9550f2f8..be0b031c 100644 --- a/src/Merge.Client/Filestorage/Groups/GroupsClient.cs +++ b/src/Merge.Client/Filestorage/Groups/GroupsClient.cs @@ -58,10 +58,10 @@ public async Task ListAsync(GroupsListRequest request) _query["remote_id"] = request.RemoteId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/filestorage/v1/groups", + Path = "filestorage/v1/groups", Query = _query } ); @@ -84,10 +84,10 @@ public async Task RetrieveAsync(string id, GroupsRetrieveRequest request) _query["include_remote_data"] = request.IncludeRemoteData.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/filestorage/v1/groups/{id}", + Path = $"filestorage/v1/groups/{id}", Query = _query } ); diff --git a/src/Merge.Client/Filestorage/Issues/IssuesClient.cs b/src/Merge.Client/Filestorage/Issues/IssuesClient.cs index 384caf13..7d6ff706 100644 --- a/src/Merge.Client/Filestorage/Issues/IssuesClient.cs +++ b/src/Merge.Client/Filestorage/Issues/IssuesClient.cs @@ -77,13 +77,13 @@ public async Task ListAsync(IssuesListRequest request) } if (request.Status != null) { - _query["status"] = request.Status.ToString(); + _query["status"] = JsonSerializer.Serialize(request.Status.Value); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/filestorage/v1/issues", + Path = "filestorage/v1/issues", Query = _query } ); @@ -101,10 +101,10 @@ public async Task ListAsync(IssuesListRequest request) public async Task RetrieveAsync(string id) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/filestorage/v1/issues/{id}" + Path = $"filestorage/v1/issues/{id}" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Filestorage/LinkToken/LinkTokenClient.cs b/src/Merge.Client/Filestorage/LinkToken/LinkTokenClient.cs index 6607e180..9cdb75ab 100644 --- a/src/Merge.Client/Filestorage/LinkToken/LinkTokenClient.cs +++ b/src/Merge.Client/Filestorage/LinkToken/LinkTokenClient.cs @@ -21,10 +21,10 @@ public LinkTokenClient(RawClient client) public async Task CreateAsync(EndUserDetailsRequest request) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/filestorage/v1/link-token", + Path = "filestorage/v1/link-token", Body = request } ); diff --git a/src/Merge.Client/Filestorage/LinkedAccounts/LinkedAccountsClient.cs b/src/Merge.Client/Filestorage/LinkedAccounts/LinkedAccountsClient.cs index 0ae7e7e3..ce6ae079 100644 --- a/src/Merge.Client/Filestorage/LinkedAccounts/LinkedAccountsClient.cs +++ b/src/Merge.Client/Filestorage/LinkedAccounts/LinkedAccountsClient.cs @@ -25,7 +25,7 @@ LinkedAccountsListRequest request var _query = new Dictionary() { }; if (request.Category != null) { - _query["category"] = request.Category.ToString(); + _query["category"] = JsonSerializer.Serialize(request.Category.Value); } if (request.Cursor != null) { @@ -76,10 +76,10 @@ LinkedAccountsListRequest request _query["status"] = request.Status; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/filestorage/v1/linked-accounts", + Path = "filestorage/v1/linked-accounts", Query = _query } ); diff --git a/src/Merge.Client/Filestorage/Passthrough/PassthroughClient.cs b/src/Merge.Client/Filestorage/Passthrough/PassthroughClient.cs index 99db4ba7..070bb084 100644 --- a/src/Merge.Client/Filestorage/Passthrough/PassthroughClient.cs +++ b/src/Merge.Client/Filestorage/Passthrough/PassthroughClient.cs @@ -21,10 +21,10 @@ public PassthroughClient(RawClient client) public async Task CreateAsync(DataPassthroughRequest request) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/filestorage/v1/passthrough", + Path = "filestorage/v1/passthrough", Body = request } ); diff --git a/src/Merge.Client/Filestorage/RegenerateKey/RegenerateKeyClient.cs b/src/Merge.Client/Filestorage/RegenerateKey/RegenerateKeyClient.cs index 87aeed6d..0dd676c8 100644 --- a/src/Merge.Client/Filestorage/RegenerateKey/RegenerateKeyClient.cs +++ b/src/Merge.Client/Filestorage/RegenerateKey/RegenerateKeyClient.cs @@ -21,10 +21,10 @@ public RegenerateKeyClient(RawClient client) public async Task CreateAsync(RemoteKeyForRegenerationRequest request) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/filestorage/v1/regenerate-key", + Path = "filestorage/v1/regenerate-key", Body = request } ); diff --git a/src/Merge.Client/Filestorage/Scopes/ScopesClient.cs b/src/Merge.Client/Filestorage/Scopes/ScopesClient.cs index 644a5851..eed25071 100644 --- a/src/Merge.Client/Filestorage/Scopes/ScopesClient.cs +++ b/src/Merge.Client/Filestorage/Scopes/ScopesClient.cs @@ -21,10 +21,10 @@ public ScopesClient(RawClient client) public async Task DefaultScopesRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/filestorage/v1/default-scopes" + Path = "filestorage/v1/default-scopes" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); @@ -41,10 +41,10 @@ public async Task DefaultScopesRetrieveAsync() public async Task LinkedAccountScopesRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/filestorage/v1/linked-account-scopes" + Path = "filestorage/v1/linked-account-scopes" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); @@ -63,10 +63,10 @@ LinkedAccountCommonModelScopeDeserializerRequest request ) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/filestorage/v1/linked-account-scopes", + Path = "filestorage/v1/linked-account-scopes", Body = request } ); diff --git a/src/Merge.Client/Filestorage/SyncStatus/SyncStatusClient.cs b/src/Merge.Client/Filestorage/SyncStatus/SyncStatusClient.cs index 7eae2ee6..99a10592 100644 --- a/src/Merge.Client/Filestorage/SyncStatus/SyncStatusClient.cs +++ b/src/Merge.Client/Filestorage/SyncStatus/SyncStatusClient.cs @@ -30,10 +30,10 @@ public async Task ListAsync(SyncStatusListRequest reque _query["page_size"] = request.PageSize.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/filestorage/v1/sync-status", + Path = "filestorage/v1/sync-status", Query = _query } ); diff --git a/src/Merge.Client/Filestorage/Users/UsersClient.cs b/src/Merge.Client/Filestorage/Users/UsersClient.cs index 79fc7835..9fdfd26a 100644 --- a/src/Merge.Client/Filestorage/Users/UsersClient.cs +++ b/src/Merge.Client/Filestorage/Users/UsersClient.cs @@ -62,10 +62,10 @@ public async Task ListAsync(UsersListRequest request) _query["remote_id"] = request.RemoteId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/filestorage/v1/users", + Path = "filestorage/v1/users", Query = _query } ); @@ -88,10 +88,10 @@ public async Task RetrieveAsync(string id, UsersRetrieveRequest request) _query["include_remote_data"] = request.IncludeRemoteData.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/filestorage/v1/users/{id}", + Path = $"filestorage/v1/users/{id}", Query = _query } ); diff --git a/src/Merge.Client/Filestorage/WebhookReceivers/WebhookReceiversClient.cs b/src/Merge.Client/Filestorage/WebhookReceivers/WebhookReceiversClient.cs index 9e0ac754..dcb35d06 100644 --- a/src/Merge.Client/Filestorage/WebhookReceivers/WebhookReceiversClient.cs +++ b/src/Merge.Client/Filestorage/WebhookReceivers/WebhookReceiversClient.cs @@ -21,10 +21,10 @@ public WebhookReceiversClient(RawClient client) public async Task> ListAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/filestorage/v1/webhook-receivers" + Path = "filestorage/v1/webhook-receivers" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); @@ -41,10 +41,10 @@ public async Task> ListAsync() public async Task CreateAsync(WebhookReceiverRequest request) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/filestorage/v1/webhook-receivers", + Path = "filestorage/v1/webhook-receivers", Body = request } ); diff --git a/src/Merge.Client/Hris/AccountDetails/AccountDetailsClient.cs b/src/Merge.Client/Hris/AccountDetails/AccountDetailsClient.cs index 98d1f3c6..c59a1fdc 100644 --- a/src/Merge.Client/Hris/AccountDetails/AccountDetailsClient.cs +++ b/src/Merge.Client/Hris/AccountDetails/AccountDetailsClient.cs @@ -21,7 +21,11 @@ public AccountDetailsClient(RawClient client) public async Task RetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest { Method = HttpMethod.Get, Path = "/hris/v1/account-details" } + new RawClient.JsonApiRequest + { + Method = HttpMethod.Get, + Path = "hris/v1/account-details" + } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode >= 200 && response.StatusCode < 400) diff --git a/src/Merge.Client/Hris/AccountToken/AccountTokenClient.cs b/src/Merge.Client/Hris/AccountToken/AccountTokenClient.cs index 566ce0de..51bf2161 100644 --- a/src/Merge.Client/Hris/AccountToken/AccountTokenClient.cs +++ b/src/Merge.Client/Hris/AccountToken/AccountTokenClient.cs @@ -21,10 +21,10 @@ public AccountTokenClient(RawClient client) public async Task RetrieveAsync(string publicToken) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/hris/v1/account-token/{publicToken}" + Path = $"hris/v1/account-token/{publicToken}" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Hris/AsyncPassthrough/AsyncPassthroughClient.cs b/src/Merge.Client/Hris/AsyncPassthrough/AsyncPassthroughClient.cs index 4ba444fc..75553113 100644 --- a/src/Merge.Client/Hris/AsyncPassthrough/AsyncPassthroughClient.cs +++ b/src/Merge.Client/Hris/AsyncPassthrough/AsyncPassthroughClient.cs @@ -21,10 +21,10 @@ public AsyncPassthroughClient(RawClient client) public async Task CreateAsync(DataPassthroughRequest request) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/hris/v1/async-passthrough", + Path = "hris/v1/async-passthrough", Body = request } ); @@ -42,10 +42,10 @@ public async Task CreateAsync(DataPassthroughRequest re public async Task RetrieveAsync(string asyncPassthroughReceiptId) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/hris/v1/async-passthrough/{asyncPassthroughReceiptId}" + Path = $"hris/v1/async-passthrough/{asyncPassthroughReceiptId}" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Hris/AuditTrail/AuditTrailClient.cs b/src/Merge.Client/Hris/AuditTrail/AuditTrailClient.cs index 9eda12cb..b532a221 100644 --- a/src/Merge.Client/Hris/AuditTrail/AuditTrailClient.cs +++ b/src/Merge.Client/Hris/AuditTrail/AuditTrailClient.cs @@ -46,10 +46,10 @@ public async Task ListAsync(AuditTrailListRequest re _query["user_email"] = request.UserEmail; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/hris/v1/audit-trail", + Path = "hris/v1/audit-trail", Query = _query } ); diff --git a/src/Merge.Client/Hris/AvailableActions/AvailableActionsClient.cs b/src/Merge.Client/Hris/AvailableActions/AvailableActionsClient.cs index 375b1c26..5da0f49d 100644 --- a/src/Merge.Client/Hris/AvailableActions/AvailableActionsClient.cs +++ b/src/Merge.Client/Hris/AvailableActions/AvailableActionsClient.cs @@ -21,10 +21,10 @@ public AvailableActionsClient(RawClient client) public async Task RetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/hris/v1/available-actions" + Path = "hris/v1/available-actions" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Hris/BankInfo/BankInfoClient.cs b/src/Merge.Client/Hris/BankInfo/BankInfoClient.cs index 07cde646..d819204f 100644 --- a/src/Merge.Client/Hris/BankInfo/BankInfoClient.cs +++ b/src/Merge.Client/Hris/BankInfo/BankInfoClient.cs @@ -23,7 +23,7 @@ public async Task ListAsync(BankInfoListRequest request) var _query = new Dictionary() { }; if (request.AccountType != null) { - _query["account_type"] = request.AccountType.ToString(); + _query["account_type"] = JsonSerializer.Serialize(request.AccountType.Value); } if (request.BankName != null) { @@ -67,7 +67,7 @@ public async Task ListAsync(BankInfoListRequest request) } if (request.OrderBy != null) { - _query["order_by"] = request.OrderBy.ToString(); + _query["order_by"] = JsonSerializer.Serialize(request.OrderBy.Value); } if (request.PageSize != null) { @@ -86,10 +86,10 @@ public async Task ListAsync(BankInfoListRequest request) _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/hris/v1/bank-info", + Path = "hris/v1/bank-info", Query = _query } ); @@ -124,10 +124,10 @@ public async Task RetrieveAsync(string id, BankInfoRetrieveRequest req _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/hris/v1/bank-info/{id}", + Path = $"hris/v1/bank-info/{id}", Query = _query } ); diff --git a/src/Merge.Client/Hris/Benefits/BenefitsClient.cs b/src/Merge.Client/Hris/Benefits/BenefitsClient.cs index aa26fd9b..717cf2ee 100644 --- a/src/Merge.Client/Hris/Benefits/BenefitsClient.cs +++ b/src/Merge.Client/Hris/Benefits/BenefitsClient.cs @@ -66,10 +66,10 @@ public async Task ListAsync(BenefitsListRequest request) _query["remote_id"] = request.RemoteId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/hris/v1/benefits", + Path = "hris/v1/benefits", Query = _query } ); @@ -96,10 +96,10 @@ public async Task RetrieveAsync(string id, BenefitsRetrieveRequest requ _query["include_remote_data"] = request.IncludeRemoteData.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/hris/v1/benefits/{id}", + Path = $"hris/v1/benefits/{id}", Query = _query } ); diff --git a/src/Merge.Client/Hris/Companies/CompaniesClient.cs b/src/Merge.Client/Hris/Companies/CompaniesClient.cs index 9021fcd5..0f18be3a 100644 --- a/src/Merge.Client/Hris/Companies/CompaniesClient.cs +++ b/src/Merge.Client/Hris/Companies/CompaniesClient.cs @@ -58,10 +58,10 @@ public async Task ListAsync(CompaniesListRequest request) _query["remote_id"] = request.RemoteId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/hris/v1/companies", + Path = "hris/v1/companies", Query = _query } ); @@ -84,10 +84,10 @@ public async Task RetrieveAsync(string id, CompaniesRetrieveRequest req _query["include_remote_data"] = request.IncludeRemoteData.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/hris/v1/companies/{id}", + Path = $"hris/v1/companies/{id}", Query = _query } ); diff --git a/src/Merge.Client/Hris/DeleteAccount/DeleteAccountClient.cs b/src/Merge.Client/Hris/DeleteAccount/DeleteAccountClient.cs index abc340f7..7d6df7d9 100644 --- a/src/Merge.Client/Hris/DeleteAccount/DeleteAccountClient.cs +++ b/src/Merge.Client/Hris/DeleteAccount/DeleteAccountClient.cs @@ -19,7 +19,11 @@ public DeleteAccountClient(RawClient client) public async void DeleteAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest { Method = HttpMethod.Post, Path = "/hris/v1/delete-account" } + new RawClient.JsonApiRequest + { + Method = HttpMethod.Post, + Path = "hris/v1/delete-account" + } ); } } diff --git a/src/Merge.Client/Hris/Dependents/DependentsClient.cs b/src/Merge.Client/Hris/Dependents/DependentsClient.cs index a5b11a1d..63a90176 100644 --- a/src/Merge.Client/Hris/Dependents/DependentsClient.cs +++ b/src/Merge.Client/Hris/Dependents/DependentsClient.cs @@ -62,10 +62,10 @@ public async Task ListAsync(DependentsListRequest reques _query["remote_id"] = request.RemoteId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/hris/v1/dependents", + Path = "hris/v1/dependents", Query = _query } ); @@ -92,10 +92,10 @@ public async Task RetrieveAsync(string id, DependentsRetrieveRequest _query["include_sensitive_fields"] = request.IncludeSensitiveFields.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/hris/v1/dependents/{id}", + Path = $"hris/v1/dependents/{id}", Query = _query } ); diff --git a/src/Merge.Client/Hris/EmployeePayrollRuns/EmployeePayrollRunsClient.cs b/src/Merge.Client/Hris/EmployeePayrollRuns/EmployeePayrollRunsClient.cs index 5d847866..83fbbae4 100644 --- a/src/Merge.Client/Hris/EmployeePayrollRuns/EmployeePayrollRunsClient.cs +++ b/src/Merge.Client/Hris/EmployeePayrollRuns/EmployeePayrollRunsClient.cs @@ -49,7 +49,7 @@ EmployeePayrollRunsListRequest request } if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeDeletedData != null) { @@ -88,10 +88,10 @@ EmployeePayrollRunsListRequest request _query["started_before"] = request.StartedBefore.Value.ToString("o0"); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/hris/v1/employee-payroll-runs", + Path = "hris/v1/employee-payroll-runs", Query = _query } ); @@ -114,17 +114,17 @@ EmployeePayrollRunsRetrieveRequest request var _query = new Dictionary() { }; if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeRemoteData != null) { _query["include_remote_data"] = request.IncludeRemoteData.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/hris/v1/employee-payroll-runs/{id}", + Path = $"hris/v1/employee-payroll-runs/{id}", Query = _query } ); diff --git a/src/Merge.Client/Hris/Employees/EmployeesClient.cs b/src/Merge.Client/Hris/Employees/EmployeesClient.cs index 6bf430bb..89750da7 100644 --- a/src/Merge.Client/Hris/Employees/EmployeesClient.cs +++ b/src/Merge.Client/Hris/Employees/EmployeesClient.cs @@ -43,7 +43,7 @@ public async Task ListAsync(EmployeesListRequest request) } if (request.EmploymentStatus != null) { - _query["employment_status"] = request.EmploymentStatus.ToString(); + _query["employment_status"] = JsonSerializer.Serialize(request.EmploymentStatus.Value); } if (request.EmploymentType != null) { @@ -51,7 +51,7 @@ public async Task ListAsync(EmployeesListRequest request) } if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.FirstName != null) { @@ -111,7 +111,7 @@ public async Task ListAsync(EmployeesListRequest request) } if (request.RemoteFields != null) { - _query["remote_fields"] = request.RemoteFields.ToString(); + _query["remote_fields"] = JsonSerializer.Serialize(request.RemoteFields.Value); } if (request.RemoteId != null) { @@ -119,7 +119,7 @@ public async Task ListAsync(EmployeesListRequest request) } if (request.ShowEnumOrigins != null) { - _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); + _query["show_enum_origins"] = JsonSerializer.Serialize(request.ShowEnumOrigins.Value); } if (request.StartedAfter != null) { @@ -150,10 +150,10 @@ public async Task ListAsync(EmployeesListRequest request) _query["work_location_id"] = request.WorkLocationId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/hris/v1/employees", + Path = "hris/v1/employees", Query = _query } ); @@ -180,10 +180,10 @@ public async Task CreateAsync(EmployeeEndpointRequest request) _query["run_async"] = request.RunAsync.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/hris/v1/employees", + Path = "hris/v1/employees", Query = _query } ); @@ -203,7 +203,7 @@ public async Task RetrieveAsync(string id, EmployeesRetrieveRequest re var _query = new Dictionary() { }; if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeRemoteData != null) { @@ -215,17 +215,17 @@ public async Task RetrieveAsync(string id, EmployeesRetrieveRequest re } if (request.RemoteFields != null) { - _query["remote_fields"] = request.RemoteFields.ToString(); + _query["remote_fields"] = JsonSerializer.Serialize(request.RemoteFields.Value); } if (request.ShowEnumOrigins != null) { - _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); + _query["show_enum_origins"] = JsonSerializer.Serialize(request.ShowEnumOrigins.Value); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/hris/v1/employees/{id}", + Path = $"hris/v1/employees/{id}", Query = _query } ); @@ -243,10 +243,10 @@ public async Task RetrieveAsync(string id, EmployeesRetrieveRequest re public async void IgnoreCreateAsync(string modelId, IgnoreCommonModelRequest request) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = $"/hris/v1/employees/ignore/{modelId}", + Path = $"hris/v1/employees/ignore/{modelId}", Body = request } ); @@ -258,10 +258,10 @@ public async void IgnoreCreateAsync(string modelId, IgnoreCommonModelRequest req public async Task MetaPostRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/hris/v1/employees/meta/post" + Path = "hris/v1/employees/meta/post" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Hris/EmployerBenefits/EmployerBenefitsClient.cs b/src/Merge.Client/Hris/EmployerBenefits/EmployerBenefitsClient.cs index 8cc6e459..802c5963 100644 --- a/src/Merge.Client/Hris/EmployerBenefits/EmployerBenefitsClient.cs +++ b/src/Merge.Client/Hris/EmployerBenefits/EmployerBenefitsClient.cs @@ -58,10 +58,10 @@ public async Task ListAsync(EmployerBenefitsListRe _query["remote_id"] = request.RemoteId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/hris/v1/employer-benefits", + Path = "hris/v1/employer-benefits", Query = _query } ); @@ -87,10 +87,10 @@ EmployerBenefitsRetrieveRequest request _query["include_remote_data"] = request.IncludeRemoteData.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/hris/v1/employer-benefits/{id}", + Path = $"hris/v1/employer-benefits/{id}", Query = _query } ); diff --git a/src/Merge.Client/Hris/Employments/EmploymentsClient.cs b/src/Merge.Client/Hris/Employments/EmploymentsClient.cs index 66240149..d4e78ff1 100644 --- a/src/Merge.Client/Hris/Employments/EmploymentsClient.cs +++ b/src/Merge.Client/Hris/Employments/EmploymentsClient.cs @@ -39,7 +39,7 @@ public async Task ListAsync(EmploymentsListRequest requ } if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeDeletedData != null) { @@ -59,7 +59,7 @@ public async Task ListAsync(EmploymentsListRequest requ } if (request.OrderBy != null) { - _query["order_by"] = request.OrderBy.ToString(); + _query["order_by"] = JsonSerializer.Serialize(request.OrderBy.Value); } if (request.PageSize != null) { @@ -67,7 +67,7 @@ public async Task ListAsync(EmploymentsListRequest requ } if (request.RemoteFields != null) { - _query["remote_fields"] = request.RemoteFields.ToString(); + _query["remote_fields"] = JsonSerializer.Serialize(request.RemoteFields.Value); } if (request.RemoteId != null) { @@ -75,13 +75,13 @@ public async Task ListAsync(EmploymentsListRequest requ } if (request.ShowEnumOrigins != null) { - _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); + _query["show_enum_origins"] = JsonSerializer.Serialize(request.ShowEnumOrigins.Value); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/hris/v1/employments", + Path = "hris/v1/employments", Query = _query } ); @@ -101,7 +101,7 @@ public async Task RetrieveAsync(string id, EmploymentsRetrieveReques var _query = new Dictionary() { }; if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeRemoteData != null) { @@ -109,17 +109,17 @@ public async Task RetrieveAsync(string id, EmploymentsRetrieveReques } if (request.RemoteFields != null) { - _query["remote_fields"] = request.RemoteFields.ToString(); + _query["remote_fields"] = JsonSerializer.Serialize(request.RemoteFields.Value); } if (request.ShowEnumOrigins != null) { - _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); + _query["show_enum_origins"] = JsonSerializer.Serialize(request.ShowEnumOrigins.Value); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/hris/v1/employments/{id}", + Path = $"hris/v1/employments/{id}", Query = _query } ); diff --git a/src/Merge.Client/Hris/FieldMapping/FieldMappingClient.cs b/src/Merge.Client/Hris/FieldMapping/FieldMappingClient.cs index ff8470fb..b0940db6 100644 --- a/src/Merge.Client/Hris/FieldMapping/FieldMappingClient.cs +++ b/src/Merge.Client/Hris/FieldMapping/FieldMappingClient.cs @@ -21,7 +21,11 @@ public FieldMappingClient(RawClient client) public async Task FieldMappingsRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest { Method = HttpMethod.Get, Path = "/hris/v1/field-mappings" } + new RawClient.JsonApiRequest + { + Method = HttpMethod.Get, + Path = "hris/v1/field-mappings" + } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode >= 200 && response.StatusCode < 400) @@ -39,10 +43,10 @@ CreateFieldMappingRequest request ) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/hris/v1/field-mappings", + Path = "hris/v1/field-mappings", Body = request } ); @@ -60,10 +64,10 @@ CreateFieldMappingRequest request public async Task FieldMappingsDestroyAsync(string fieldMappingId) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Delete, - Path = $"/hris/v1/field-mappings/{fieldMappingId}" + Path = $"hris/v1/field-mappings/{fieldMappingId}" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); @@ -83,10 +87,10 @@ PatchedEditFieldMappingRequest request ) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Patch, - Path = $"/hris/v1/field-mappings/{fieldMappingId}", + Path = $"hris/v1/field-mappings/{fieldMappingId}", Body = request } ); @@ -115,10 +119,10 @@ RemoteFieldsRetrieveRequest request _query["include_example_values"] = request.IncludeExampleValues; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/hris/v1/remote-fields", + Path = "hris/v1/remote-fields", Query = _query } ); @@ -136,7 +140,7 @@ RemoteFieldsRetrieveRequest request public async Task TargetFieldsRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest { Method = HttpMethod.Get, Path = "/hris/v1/target-fields" } + new RawClient.JsonApiRequest { Method = HttpMethod.Get, Path = "hris/v1/target-fields" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode >= 200 && response.StatusCode < 400) diff --git a/src/Merge.Client/Hris/ForceResync/ForceResyncClient.cs b/src/Merge.Client/Hris/ForceResync/ForceResyncClient.cs index e3f563c3..c58a1f5d 100644 --- a/src/Merge.Client/Hris/ForceResync/ForceResyncClient.cs +++ b/src/Merge.Client/Hris/ForceResync/ForceResyncClient.cs @@ -21,10 +21,10 @@ public ForceResyncClient(RawClient client) public async Task> SyncStatusResyncCreateAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/hris/v1/sync-status/resync" + Path = "hris/v1/sync-status/resync" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Hris/GenerateKey/GenerateKeyClient.cs b/src/Merge.Client/Hris/GenerateKey/GenerateKeyClient.cs index 60781acb..a60ef0ba 100644 --- a/src/Merge.Client/Hris/GenerateKey/GenerateKeyClient.cs +++ b/src/Merge.Client/Hris/GenerateKey/GenerateKeyClient.cs @@ -21,10 +21,10 @@ public GenerateKeyClient(RawClient client) public async Task CreateAsync(GenerateRemoteKeyRequest request) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/hris/v1/generate-key", + Path = "hris/v1/generate-key", Body = request } ); diff --git a/src/Merge.Client/Hris/Groups/GroupsClient.cs b/src/Merge.Client/Hris/Groups/GroupsClient.cs index eb099c05..296ecb87 100644 --- a/src/Merge.Client/Hris/Groups/GroupsClient.cs +++ b/src/Merge.Client/Hris/Groups/GroupsClient.cs @@ -78,10 +78,10 @@ public async Task ListAsync(GroupsListRequest request) _query["types"] = request.Types; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/hris/v1/groups", + Path = "hris/v1/groups", Query = _query } ); @@ -112,10 +112,10 @@ public async Task RetrieveAsync(string id, GroupsRetrieveRequest request) _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/hris/v1/groups/{id}", + Path = $"hris/v1/groups/{id}", Query = _query } ); diff --git a/src/Merge.Client/Hris/Issues/IssuesClient.cs b/src/Merge.Client/Hris/Issues/IssuesClient.cs index 42377683..3bcef460 100644 --- a/src/Merge.Client/Hris/Issues/IssuesClient.cs +++ b/src/Merge.Client/Hris/Issues/IssuesClient.cs @@ -77,13 +77,13 @@ public async Task ListAsync(IssuesListRequest request) } if (request.Status != null) { - _query["status"] = request.Status.ToString(); + _query["status"] = JsonSerializer.Serialize(request.Status.Value); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/hris/v1/issues", + Path = "hris/v1/issues", Query = _query } ); @@ -101,7 +101,7 @@ public async Task ListAsync(IssuesListRequest request) public async Task RetrieveAsync(string id) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest { Method = HttpMethod.Get, Path = $"/hris/v1/issues/{id}" } + new RawClient.JsonApiRequest { Method = HttpMethod.Get, Path = $"hris/v1/issues/{id}" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode >= 200 && response.StatusCode < 400) diff --git a/src/Merge.Client/Hris/LinkToken/LinkTokenClient.cs b/src/Merge.Client/Hris/LinkToken/LinkTokenClient.cs index 38e46b51..02402e74 100644 --- a/src/Merge.Client/Hris/LinkToken/LinkTokenClient.cs +++ b/src/Merge.Client/Hris/LinkToken/LinkTokenClient.cs @@ -21,10 +21,10 @@ public LinkTokenClient(RawClient client) public async Task CreateAsync(EndUserDetailsRequest request) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/hris/v1/link-token", + Path = "hris/v1/link-token", Body = request } ); diff --git a/src/Merge.Client/Hris/LinkedAccounts/LinkedAccountsClient.cs b/src/Merge.Client/Hris/LinkedAccounts/LinkedAccountsClient.cs index b1cb2cc6..7592f55f 100644 --- a/src/Merge.Client/Hris/LinkedAccounts/LinkedAccountsClient.cs +++ b/src/Merge.Client/Hris/LinkedAccounts/LinkedAccountsClient.cs @@ -25,7 +25,7 @@ LinkedAccountsListRequest request var _query = new Dictionary() { }; if (request.Category != null) { - _query["category"] = request.Category.ToString(); + _query["category"] = JsonSerializer.Serialize(request.Category.Value); } if (request.Cursor != null) { @@ -76,10 +76,10 @@ LinkedAccountsListRequest request _query["status"] = request.Status; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/hris/v1/linked-accounts", + Path = "hris/v1/linked-accounts", Query = _query } ); diff --git a/src/Merge.Client/Hris/Locations/LocationsClient.cs b/src/Merge.Client/Hris/Locations/LocationsClient.cs index aeebc717..9d3b0b06 100644 --- a/src/Merge.Client/Hris/Locations/LocationsClient.cs +++ b/src/Merge.Client/Hris/Locations/LocationsClient.cs @@ -43,7 +43,7 @@ public async Task ListAsync(LocationsListRequest request) } if (request.LocationType != null) { - _query["location_type"] = request.LocationType.ToString(); + _query["location_type"] = JsonSerializer.Serialize(request.LocationType.Value); } if (request.ModifiedAfter != null) { @@ -70,10 +70,10 @@ public async Task ListAsync(LocationsListRequest request) _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/hris/v1/locations", + Path = "hris/v1/locations", Query = _query } ); @@ -104,10 +104,10 @@ public async Task RetrieveAsync(string id, LocationsRetrieveRequest re _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/hris/v1/locations/{id}", + Path = $"hris/v1/locations/{id}", Query = _query } ); diff --git a/src/Merge.Client/Hris/Passthrough/PassthroughClient.cs b/src/Merge.Client/Hris/Passthrough/PassthroughClient.cs index f727b306..72d5d071 100644 --- a/src/Merge.Client/Hris/Passthrough/PassthroughClient.cs +++ b/src/Merge.Client/Hris/Passthrough/PassthroughClient.cs @@ -21,10 +21,10 @@ public PassthroughClient(RawClient client) public async Task CreateAsync(DataPassthroughRequest request) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/hris/v1/passthrough", + Path = "hris/v1/passthrough", Body = request } ); diff --git a/src/Merge.Client/Hris/PayGroups/PayGroupsClient.cs b/src/Merge.Client/Hris/PayGroups/PayGroupsClient.cs index 1823f4f7..c26e0385 100644 --- a/src/Merge.Client/Hris/PayGroups/PayGroupsClient.cs +++ b/src/Merge.Client/Hris/PayGroups/PayGroupsClient.cs @@ -58,10 +58,10 @@ public async Task ListAsync(PayGroupsListRequest request) _query["remote_id"] = request.RemoteId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/hris/v1/pay-groups", + Path = "hris/v1/pay-groups", Query = _query } ); @@ -84,10 +84,10 @@ public async Task RetrieveAsync(string id, PayGroupsRetrieveRequest re _query["include_remote_data"] = request.IncludeRemoteData.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/hris/v1/pay-groups/{id}", + Path = $"hris/v1/pay-groups/{id}", Query = _query } ); diff --git a/src/Merge.Client/Hris/PayrollRuns/PayrollRunsClient.cs b/src/Merge.Client/Hris/PayrollRuns/PayrollRunsClient.cs index 346fb5b0..e0ac9813 100644 --- a/src/Merge.Client/Hris/PayrollRuns/PayrollRunsClient.cs +++ b/src/Merge.Client/Hris/PayrollRuns/PayrollRunsClient.cs @@ -63,7 +63,7 @@ public async Task ListAsync(PayrollRunsListRequest requ } if (request.RemoteFields != null) { - _query["remote_fields"] = request.RemoteFields.ToString(); + _query["remote_fields"] = JsonSerializer.Serialize(request.RemoteFields.Value); } if (request.RemoteId != null) { @@ -71,11 +71,11 @@ public async Task ListAsync(PayrollRunsListRequest requ } if (request.RunType != null) { - _query["run_type"] = request.RunType.ToString(); + _query["run_type"] = JsonSerializer.Serialize(request.RunType.Value); } if (request.ShowEnumOrigins != null) { - _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); + _query["show_enum_origins"] = JsonSerializer.Serialize(request.ShowEnumOrigins.Value); } if (request.StartedAfter != null) { @@ -86,10 +86,10 @@ public async Task ListAsync(PayrollRunsListRequest requ _query["started_before"] = request.StartedBefore.Value.ToString("o0"); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/hris/v1/payroll-runs", + Path = "hris/v1/payroll-runs", Query = _query } ); @@ -113,17 +113,17 @@ public async Task RetrieveAsync(string id, PayrollRunsRetrieveReques } if (request.RemoteFields != null) { - _query["remote_fields"] = request.RemoteFields.ToString(); + _query["remote_fields"] = JsonSerializer.Serialize(request.RemoteFields.Value); } if (request.ShowEnumOrigins != null) { - _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); + _query["show_enum_origins"] = JsonSerializer.Serialize(request.ShowEnumOrigins.Value); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/hris/v1/payroll-runs/{id}", + Path = $"hris/v1/payroll-runs/{id}", Query = _query } ); diff --git a/src/Merge.Client/Hris/RegenerateKey/RegenerateKeyClient.cs b/src/Merge.Client/Hris/RegenerateKey/RegenerateKeyClient.cs index 40bbb175..9ed15ae1 100644 --- a/src/Merge.Client/Hris/RegenerateKey/RegenerateKeyClient.cs +++ b/src/Merge.Client/Hris/RegenerateKey/RegenerateKeyClient.cs @@ -21,10 +21,10 @@ public RegenerateKeyClient(RawClient client) public async Task CreateAsync(RemoteKeyForRegenerationRequest request) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/hris/v1/regenerate-key", + Path = "hris/v1/regenerate-key", Body = request } ); diff --git a/src/Merge.Client/Hris/Scopes/ScopesClient.cs b/src/Merge.Client/Hris/Scopes/ScopesClient.cs index 1d6b317e..ff362f99 100644 --- a/src/Merge.Client/Hris/Scopes/ScopesClient.cs +++ b/src/Merge.Client/Hris/Scopes/ScopesClient.cs @@ -21,7 +21,11 @@ public ScopesClient(RawClient client) public async Task DefaultScopesRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest { Method = HttpMethod.Get, Path = "/hris/v1/default-scopes" } + new RawClient.JsonApiRequest + { + Method = HttpMethod.Get, + Path = "hris/v1/default-scopes" + } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode >= 200 && response.StatusCode < 400) @@ -37,10 +41,10 @@ public async Task DefaultScopesRetrieveAsync() public async Task LinkedAccountScopesRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/hris/v1/linked-account-scopes" + Path = "hris/v1/linked-account-scopes" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); @@ -59,10 +63,10 @@ LinkedAccountCommonModelScopeDeserializerRequest request ) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/hris/v1/linked-account-scopes", + Path = "hris/v1/linked-account-scopes", Body = request } ); diff --git a/src/Merge.Client/Hris/SyncStatus/SyncStatusClient.cs b/src/Merge.Client/Hris/SyncStatus/SyncStatusClient.cs index 010e6324..5af0bd55 100644 --- a/src/Merge.Client/Hris/SyncStatus/SyncStatusClient.cs +++ b/src/Merge.Client/Hris/SyncStatus/SyncStatusClient.cs @@ -30,10 +30,10 @@ public async Task ListAsync(SyncStatusListRequest reque _query["page_size"] = request.PageSize.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/hris/v1/sync-status", + Path = "hris/v1/sync-status", Query = _query } ); diff --git a/src/Merge.Client/Hris/Teams/TeamsClient.cs b/src/Merge.Client/Hris/Teams/TeamsClient.cs index ccce174e..ba9eaa73 100644 --- a/src/Merge.Client/Hris/Teams/TeamsClient.cs +++ b/src/Merge.Client/Hris/Teams/TeamsClient.cs @@ -66,10 +66,10 @@ public async Task ListAsync(TeamsListRequest request) _query["remote_id"] = request.RemoteId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/hris/v1/teams", + Path = "hris/v1/teams", Query = _query } ); @@ -96,10 +96,10 @@ public async Task RetrieveAsync(string id, TeamsRetrieveRequest request) _query["include_remote_data"] = request.IncludeRemoteData.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/hris/v1/teams/{id}", + Path = $"hris/v1/teams/{id}", Query = _query } ); diff --git a/src/Merge.Client/Hris/TimeOff/TimeOffClient.cs b/src/Merge.Client/Hris/TimeOff/TimeOffClient.cs index ff798d83..7a2fe644 100644 --- a/src/Merge.Client/Hris/TimeOff/TimeOffClient.cs +++ b/src/Merge.Client/Hris/TimeOff/TimeOffClient.cs @@ -51,7 +51,7 @@ public async Task ListAsync(TimeOffListRequest request) } if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeDeletedData != null) { @@ -75,7 +75,7 @@ public async Task ListAsync(TimeOffListRequest request) } if (request.RemoteFields != null) { - _query["remote_fields"] = request.RemoteFields.ToString(); + _query["remote_fields"] = JsonSerializer.Serialize(request.RemoteFields.Value); } if (request.RemoteId != null) { @@ -83,11 +83,11 @@ public async Task ListAsync(TimeOffListRequest request) } if (request.RequestType != null) { - _query["request_type"] = request.RequestType.ToString(); + _query["request_type"] = JsonSerializer.Serialize(request.RequestType.Value); } if (request.ShowEnumOrigins != null) { - _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); + _query["show_enum_origins"] = JsonSerializer.Serialize(request.ShowEnumOrigins.Value); } if (request.StartedAfter != null) { @@ -99,13 +99,13 @@ public async Task ListAsync(TimeOffListRequest request) } if (request.Status != null) { - _query["status"] = request.Status.ToString(); + _query["status"] = JsonSerializer.Serialize(request.Status.Value); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/hris/v1/time-off", + Path = "hris/v1/time-off", Query = _query } ); @@ -132,10 +132,10 @@ public async Task CreateAsync(TimeOffEndpointRequest request) _query["run_async"] = request.RunAsync.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/hris/v1/time-off", + Path = "hris/v1/time-off", Query = _query } ); @@ -155,7 +155,7 @@ public async Task RetrieveAsync(string id, TimeOffRetrieveRequest reque var _query = new Dictionary() { }; if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeRemoteData != null) { @@ -163,17 +163,17 @@ public async Task RetrieveAsync(string id, TimeOffRetrieveRequest reque } if (request.RemoteFields != null) { - _query["remote_fields"] = request.RemoteFields.ToString(); + _query["remote_fields"] = JsonSerializer.Serialize(request.RemoteFields.Value); } if (request.ShowEnumOrigins != null) { - _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); + _query["show_enum_origins"] = JsonSerializer.Serialize(request.ShowEnumOrigins.Value); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/hris/v1/time-off/{id}", + Path = $"hris/v1/time-off/{id}", Query = _query } ); @@ -191,10 +191,10 @@ public async Task RetrieveAsync(string id, TimeOffRetrieveRequest reque public async Task MetaPostRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/hris/v1/time-off/meta/post" + Path = "hris/v1/time-off/meta/post" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Hris/TimeOffBalances/TimeOffBalancesClient.cs b/src/Merge.Client/Hris/TimeOffBalances/TimeOffBalancesClient.cs index 6aa53f83..2f0c383c 100644 --- a/src/Merge.Client/Hris/TimeOffBalances/TimeOffBalancesClient.cs +++ b/src/Merge.Client/Hris/TimeOffBalances/TimeOffBalancesClient.cs @@ -63,7 +63,7 @@ public async Task ListAsync(TimeOffBalancesListRequ } if (request.PolicyType != null) { - _query["policy_type"] = request.PolicyType.ToString(); + _query["policy_type"] = JsonSerializer.Serialize(request.PolicyType.Value); } if (request.RemoteFields != null) { @@ -78,10 +78,10 @@ public async Task ListAsync(TimeOffBalancesListRequ _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/hris/v1/time-off-balances", + Path = "hris/v1/time-off-balances", Query = _query } ); @@ -119,10 +119,10 @@ TimeOffBalancesRetrieveRequest request _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/hris/v1/time-off-balances/{id}", + Path = $"hris/v1/time-off-balances/{id}", Query = _query } ); diff --git a/src/Merge.Client/Hris/TimesheetEntries/TimesheetEntriesClient.cs b/src/Merge.Client/Hris/TimesheetEntries/TimesheetEntriesClient.cs index 95a41b8d..ad148af7 100644 --- a/src/Merge.Client/Hris/TimesheetEntries/TimesheetEntriesClient.cs +++ b/src/Merge.Client/Hris/TimesheetEntries/TimesheetEntriesClient.cs @@ -63,7 +63,7 @@ public async Task ListAsync(TimesheetEntriesListReq } if (request.OrderBy != null) { - _query["order_by"] = request.OrderBy.ToString(); + _query["order_by"] = JsonSerializer.Serialize(request.OrderBy.Value); } if (request.PageSize != null) { @@ -82,10 +82,10 @@ public async Task ListAsync(TimesheetEntriesListReq _query["started_before"] = request.StartedBefore; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/hris/v1/timesheet-entries", + Path = "hris/v1/timesheet-entries", Query = _query } ); @@ -112,10 +112,10 @@ public async Task CreateAsync(TimesheetEntryEndpointRequ _query["run_async"] = request.RunAsync.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/hris/v1/timesheet-entries", + Path = "hris/v1/timesheet-entries", Query = _query } ); @@ -141,10 +141,10 @@ TimesheetEntriesRetrieveRequest request _query["include_remote_data"] = request.IncludeRemoteData.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/hris/v1/timesheet-entries/{id}", + Path = $"hris/v1/timesheet-entries/{id}", Query = _query } ); @@ -162,10 +162,10 @@ TimesheetEntriesRetrieveRequest request public async Task MetaPostRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/hris/v1/timesheet-entries/meta/post" + Path = "hris/v1/timesheet-entries/meta/post" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Hris/WebhookReceivers/WebhookReceiversClient.cs b/src/Merge.Client/Hris/WebhookReceivers/WebhookReceiversClient.cs index 9bb3e5a8..06b7f302 100644 --- a/src/Merge.Client/Hris/WebhookReceivers/WebhookReceiversClient.cs +++ b/src/Merge.Client/Hris/WebhookReceivers/WebhookReceiversClient.cs @@ -21,10 +21,10 @@ public WebhookReceiversClient(RawClient client) public async Task> ListAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/hris/v1/webhook-receivers" + Path = "hris/v1/webhook-receivers" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); @@ -41,10 +41,10 @@ public async Task> ListAsync() public async Task CreateAsync(WebhookReceiverRequest request) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/hris/v1/webhook-receivers", + Path = "hris/v1/webhook-receivers", Body = request } ); diff --git a/src/Merge.Client/Merge.Client.csproj b/src/Merge.Client/Merge.Client.csproj index 2241204d..8c52a4c2 100644 --- a/src/Merge.Client/Merge.Client.csproj +++ b/src/Merge.Client/Merge.Client.csproj @@ -5,7 +5,7 @@ net8.0;net7.0;net6.0; enable false - 0.0.11 + 0.0.12 README.md LICENSE https://github.com/merge-api/merge-csharp-client diff --git a/src/Merge.Client/Merge.cs b/src/Merge.Client/Merge.cs index 49b25010..8ba0b188 100644 --- a/src/Merge.Client/Merge.cs +++ b/src/Merge.Client/Merge.cs @@ -27,7 +27,7 @@ public Merge( { "X-Account-Token", accountToken }, { "X-Fern-Language", "C#" }, { "X-Fern-SDK-Name", "Merge.Client" }, - { "X-Fern-SDK-Version", "0.0.11" }, + { "X-Fern-SDK-Version", "0.0.12" }, }, clientOptions ?? new ClientOptions() ); diff --git a/src/Merge.Client/Ticketing/AccountDetails/AccountDetailsClient.cs b/src/Merge.Client/Ticketing/AccountDetails/AccountDetailsClient.cs index 6524a210..f2fea22d 100644 --- a/src/Merge.Client/Ticketing/AccountDetails/AccountDetailsClient.cs +++ b/src/Merge.Client/Ticketing/AccountDetails/AccountDetailsClient.cs @@ -21,10 +21,10 @@ public AccountDetailsClient(RawClient client) public async Task RetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ticketing/v1/account-details" + Path = "ticketing/v1/account-details" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Ticketing/AccountToken/AccountTokenClient.cs b/src/Merge.Client/Ticketing/AccountToken/AccountTokenClient.cs index 11a1ffeb..74a43715 100644 --- a/src/Merge.Client/Ticketing/AccountToken/AccountTokenClient.cs +++ b/src/Merge.Client/Ticketing/AccountToken/AccountTokenClient.cs @@ -21,10 +21,10 @@ public AccountTokenClient(RawClient client) public async Task RetrieveAsync(string publicToken) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/ticketing/v1/account-token/{publicToken}" + Path = $"ticketing/v1/account-token/{publicToken}" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Ticketing/Accounts/AccountsClient.cs b/src/Merge.Client/Ticketing/Accounts/AccountsClient.cs index 5b7d2452..d521553a 100644 --- a/src/Merge.Client/Ticketing/Accounts/AccountsClient.cs +++ b/src/Merge.Client/Ticketing/Accounts/AccountsClient.cs @@ -58,10 +58,10 @@ public async Task ListAsync(AccountsListRequest request) _query["remote_id"] = request.RemoteId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ticketing/v1/accounts", + Path = "ticketing/v1/accounts", Query = _query } ); @@ -84,10 +84,10 @@ public async Task RetrieveAsync(string id, AccountsRetrieveRequest requ _query["include_remote_data"] = request.IncludeRemoteData.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/ticketing/v1/accounts/{id}", + Path = $"ticketing/v1/accounts/{id}", Query = _query } ); diff --git a/src/Merge.Client/Ticketing/AsyncPassthrough/AsyncPassthroughClient.cs b/src/Merge.Client/Ticketing/AsyncPassthrough/AsyncPassthroughClient.cs index b0e6fc51..90db7cca 100644 --- a/src/Merge.Client/Ticketing/AsyncPassthrough/AsyncPassthroughClient.cs +++ b/src/Merge.Client/Ticketing/AsyncPassthrough/AsyncPassthroughClient.cs @@ -21,10 +21,10 @@ public AsyncPassthroughClient(RawClient client) public async Task CreateAsync(DataPassthroughRequest request) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/ticketing/v1/async-passthrough", + Path = "ticketing/v1/async-passthrough", Body = request } ); @@ -42,10 +42,10 @@ public async Task CreateAsync(DataPassthroughRequest re public async Task RetrieveAsync(string asyncPassthroughReceiptId) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/ticketing/v1/async-passthrough/{asyncPassthroughReceiptId}" + Path = $"ticketing/v1/async-passthrough/{asyncPassthroughReceiptId}" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Ticketing/Attachments/AttachmentsClient.cs b/src/Merge.Client/Ticketing/Attachments/AttachmentsClient.cs index c4c246db..939f1ddd 100644 --- a/src/Merge.Client/Ticketing/Attachments/AttachmentsClient.cs +++ b/src/Merge.Client/Ticketing/Attachments/AttachmentsClient.cs @@ -70,10 +70,10 @@ public async Task ListAsync(AttachmentsListRequest requ _query["ticket_id"] = request.TicketId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ticketing/v1/attachments", + Path = "ticketing/v1/attachments", Query = _query } ); @@ -102,10 +102,10 @@ TicketingAttachmentEndpointRequest request _query["run_async"] = request.RunAsync.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/ticketing/v1/attachments", + Path = "ticketing/v1/attachments", Query = _query } ); @@ -132,10 +132,10 @@ public async Task RetrieveAsync(string id, AttachmentsRetrieveReques _query["include_remote_data"] = request.IncludeRemoteData.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/ticketing/v1/attachments/{id}", + Path = $"ticketing/v1/attachments/{id}", Query = _query } ); @@ -158,10 +158,10 @@ public async void DownloadRetrieveAsync(string id, AttachmentsDownloadRetrieveRe _query["mime_type"] = request.MimeType; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/ticketing/v1/attachments/{id}/download", + Path = $"ticketing/v1/attachments/{id}/download", Query = _query } ); @@ -173,10 +173,10 @@ public async void DownloadRetrieveAsync(string id, AttachmentsDownloadRetrieveRe public async Task MetaPostRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ticketing/v1/attachments/meta/post" + Path = "ticketing/v1/attachments/meta/post" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Ticketing/AuditTrail/AuditTrailClient.cs b/src/Merge.Client/Ticketing/AuditTrail/AuditTrailClient.cs index e8fb2748..8c8b17ab 100644 --- a/src/Merge.Client/Ticketing/AuditTrail/AuditTrailClient.cs +++ b/src/Merge.Client/Ticketing/AuditTrail/AuditTrailClient.cs @@ -46,10 +46,10 @@ public async Task ListAsync(AuditTrailListRequest re _query["user_email"] = request.UserEmail; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ticketing/v1/audit-trail", + Path = "ticketing/v1/audit-trail", Query = _query } ); diff --git a/src/Merge.Client/Ticketing/AvailableActions/AvailableActionsClient.cs b/src/Merge.Client/Ticketing/AvailableActions/AvailableActionsClient.cs index ecdb903a..4e83c87a 100644 --- a/src/Merge.Client/Ticketing/AvailableActions/AvailableActionsClient.cs +++ b/src/Merge.Client/Ticketing/AvailableActions/AvailableActionsClient.cs @@ -21,10 +21,10 @@ public AvailableActionsClient(RawClient client) public async Task RetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ticketing/v1/available-actions" + Path = "ticketing/v1/available-actions" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Ticketing/Collections/CollectionsClient.cs b/src/Merge.Client/Ticketing/Collections/CollectionsClient.cs index d697cdb5..1e6e3e25 100644 --- a/src/Merge.Client/Ticketing/Collections/CollectionsClient.cs +++ b/src/Merge.Client/Ticketing/Collections/CollectionsClient.cs @@ -78,10 +78,10 @@ public async Task ListAsync(CollectionsListRequest requ _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ticketing/v1/collections", + Path = "ticketing/v1/collections", Query = _query } ); @@ -116,10 +116,10 @@ public async Task RetrieveAsync(string id, CollectionsRetrieveReques _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/ticketing/v1/collections/{id}", + Path = $"ticketing/v1/collections/{id}", Query = _query } ); @@ -146,7 +146,7 @@ CollectionsUsersListRequest request } if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeDeletedData != null) { @@ -161,10 +161,10 @@ CollectionsUsersListRequest request _query["page_size"] = request.PageSize.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/ticketing/v1/collections/{parentId}/users", + Path = $"ticketing/v1/collections/{parentId}/users", Query = _query } ); diff --git a/src/Merge.Client/Ticketing/Comments/CommentsClient.cs b/src/Merge.Client/Ticketing/Comments/CommentsClient.cs index 8e1ae05f..d353ca2a 100644 --- a/src/Merge.Client/Ticketing/Comments/CommentsClient.cs +++ b/src/Merge.Client/Ticketing/Comments/CommentsClient.cs @@ -35,7 +35,7 @@ public async Task ListAsync(CommentsListRequest request) } if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeDeletedData != null) { @@ -70,10 +70,10 @@ public async Task ListAsync(CommentsListRequest request) _query["ticket_id"] = request.TicketId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ticketing/v1/comments", + Path = "ticketing/v1/comments", Query = _query } ); @@ -100,10 +100,10 @@ public async Task CreateAsync(CommentEndpointRequest request) _query["run_async"] = request.RunAsync.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/ticketing/v1/comments", + Path = "ticketing/v1/comments", Query = _query } ); @@ -123,17 +123,17 @@ public async Task RetrieveAsync(string id, CommentsRetrieveRequest requ var _query = new Dictionary() { }; if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeRemoteData != null) { _query["include_remote_data"] = request.IncludeRemoteData.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/ticketing/v1/comments/{id}", + Path = $"ticketing/v1/comments/{id}", Query = _query } ); @@ -151,10 +151,10 @@ public async Task RetrieveAsync(string id, CommentsRetrieveRequest requ public async Task MetaPostRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ticketing/v1/comments/meta/post" + Path = "ticketing/v1/comments/meta/post" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Ticketing/Contacts/ContactsClient.cs b/src/Merge.Client/Ticketing/Contacts/ContactsClient.cs index 41369130..e810c466 100644 --- a/src/Merge.Client/Ticketing/Contacts/ContactsClient.cs +++ b/src/Merge.Client/Ticketing/Contacts/ContactsClient.cs @@ -62,10 +62,10 @@ public async Task ListAsync(ContactsListRequest request) _query["remote_id"] = request.RemoteId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ticketing/v1/contacts", + Path = "ticketing/v1/contacts", Query = _query } ); @@ -92,10 +92,10 @@ public async Task CreateAsync(TicketingContactEndpoint _query["run_async"] = request.RunAsync.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/ticketing/v1/contacts", + Path = "ticketing/v1/contacts", Query = _query } ); @@ -122,10 +122,10 @@ public async Task RetrieveAsync(string id, ContactsRetrieveRequest requ _query["include_remote_data"] = request.IncludeRemoteData.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/ticketing/v1/contacts/{id}", + Path = $"ticketing/v1/contacts/{id}", Query = _query } ); @@ -143,10 +143,10 @@ public async Task RetrieveAsync(string id, ContactsRetrieveRequest requ public async Task MetaPostRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ticketing/v1/contacts/meta/post" + Path = "ticketing/v1/contacts/meta/post" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Ticketing/DeleteAccount/DeleteAccountClient.cs b/src/Merge.Client/Ticketing/DeleteAccount/DeleteAccountClient.cs index 0232248e..7ff0180e 100644 --- a/src/Merge.Client/Ticketing/DeleteAccount/DeleteAccountClient.cs +++ b/src/Merge.Client/Ticketing/DeleteAccount/DeleteAccountClient.cs @@ -19,10 +19,10 @@ public DeleteAccountClient(RawClient client) public async void DeleteAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/ticketing/v1/delete-account" + Path = "ticketing/v1/delete-account" } ); } diff --git a/src/Merge.Client/Ticketing/FieldMapping/FieldMappingClient.cs b/src/Merge.Client/Ticketing/FieldMapping/FieldMappingClient.cs index a2270906..7a936880 100644 --- a/src/Merge.Client/Ticketing/FieldMapping/FieldMappingClient.cs +++ b/src/Merge.Client/Ticketing/FieldMapping/FieldMappingClient.cs @@ -21,10 +21,10 @@ public FieldMappingClient(RawClient client) public async Task FieldMappingsRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ticketing/v1/field-mappings" + Path = "ticketing/v1/field-mappings" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); @@ -43,10 +43,10 @@ CreateFieldMappingRequest request ) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/ticketing/v1/field-mappings", + Path = "ticketing/v1/field-mappings", Body = request } ); @@ -64,10 +64,10 @@ CreateFieldMappingRequest request public async Task FieldMappingsDestroyAsync(string fieldMappingId) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Delete, - Path = $"/ticketing/v1/field-mappings/{fieldMappingId}" + Path = $"ticketing/v1/field-mappings/{fieldMappingId}" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); @@ -87,10 +87,10 @@ PatchedEditFieldMappingRequest request ) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Patch, - Path = $"/ticketing/v1/field-mappings/{fieldMappingId}", + Path = $"ticketing/v1/field-mappings/{fieldMappingId}", Body = request } ); @@ -119,10 +119,10 @@ RemoteFieldsRetrieveRequest request _query["include_example_values"] = request.IncludeExampleValues; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ticketing/v1/remote-fields", + Path = "ticketing/v1/remote-fields", Query = _query } ); @@ -140,10 +140,10 @@ RemoteFieldsRetrieveRequest request public async Task TargetFieldsRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ticketing/v1/target-fields" + Path = "ticketing/v1/target-fields" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Ticketing/ForceResync/ForceResyncClient.cs b/src/Merge.Client/Ticketing/ForceResync/ForceResyncClient.cs index a5d1bbba..dc6c4671 100644 --- a/src/Merge.Client/Ticketing/ForceResync/ForceResyncClient.cs +++ b/src/Merge.Client/Ticketing/ForceResync/ForceResyncClient.cs @@ -21,10 +21,10 @@ public ForceResyncClient(RawClient client) public async Task> SyncStatusResyncCreateAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/ticketing/v1/sync-status/resync" + Path = "ticketing/v1/sync-status/resync" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Ticketing/GenerateKey/GenerateKeyClient.cs b/src/Merge.Client/Ticketing/GenerateKey/GenerateKeyClient.cs index 684d7e74..83db7b7f 100644 --- a/src/Merge.Client/Ticketing/GenerateKey/GenerateKeyClient.cs +++ b/src/Merge.Client/Ticketing/GenerateKey/GenerateKeyClient.cs @@ -21,10 +21,10 @@ public GenerateKeyClient(RawClient client) public async Task CreateAsync(GenerateRemoteKeyRequest request) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/ticketing/v1/generate-key", + Path = "ticketing/v1/generate-key", Body = request } ); diff --git a/src/Merge.Client/Ticketing/Issues/IssuesClient.cs b/src/Merge.Client/Ticketing/Issues/IssuesClient.cs index 1cab39d1..eca5af43 100644 --- a/src/Merge.Client/Ticketing/Issues/IssuesClient.cs +++ b/src/Merge.Client/Ticketing/Issues/IssuesClient.cs @@ -77,13 +77,13 @@ public async Task ListAsync(IssuesListRequest request) } if (request.Status != null) { - _query["status"] = request.Status.ToString(); + _query["status"] = JsonSerializer.Serialize(request.Status.Value); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ticketing/v1/issues", + Path = "ticketing/v1/issues", Query = _query } ); @@ -101,10 +101,10 @@ public async Task ListAsync(IssuesListRequest request) public async Task RetrieveAsync(string id) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/ticketing/v1/issues/{id}" + Path = $"ticketing/v1/issues/{id}" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); diff --git a/src/Merge.Client/Ticketing/LinkToken/LinkTokenClient.cs b/src/Merge.Client/Ticketing/LinkToken/LinkTokenClient.cs index 059ca48c..8de3a90e 100644 --- a/src/Merge.Client/Ticketing/LinkToken/LinkTokenClient.cs +++ b/src/Merge.Client/Ticketing/LinkToken/LinkTokenClient.cs @@ -21,10 +21,10 @@ public LinkTokenClient(RawClient client) public async Task CreateAsync(EndUserDetailsRequest request) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/ticketing/v1/link-token", + Path = "ticketing/v1/link-token", Body = request } ); diff --git a/src/Merge.Client/Ticketing/LinkedAccounts/LinkedAccountsClient.cs b/src/Merge.Client/Ticketing/LinkedAccounts/LinkedAccountsClient.cs index 6c0426e6..4de4c97d 100644 --- a/src/Merge.Client/Ticketing/LinkedAccounts/LinkedAccountsClient.cs +++ b/src/Merge.Client/Ticketing/LinkedAccounts/LinkedAccountsClient.cs @@ -25,7 +25,7 @@ LinkedAccountsListRequest request var _query = new Dictionary() { }; if (request.Category != null) { - _query["category"] = request.Category.ToString(); + _query["category"] = JsonSerializer.Serialize(request.Category.Value); } if (request.Cursor != null) { @@ -76,10 +76,10 @@ LinkedAccountsListRequest request _query["status"] = request.Status; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ticketing/v1/linked-accounts", + Path = "ticketing/v1/linked-accounts", Query = _query } ); diff --git a/src/Merge.Client/Ticketing/Passthrough/PassthroughClient.cs b/src/Merge.Client/Ticketing/Passthrough/PassthroughClient.cs index 73d013db..072e866e 100644 --- a/src/Merge.Client/Ticketing/Passthrough/PassthroughClient.cs +++ b/src/Merge.Client/Ticketing/Passthrough/PassthroughClient.cs @@ -21,10 +21,10 @@ public PassthroughClient(RawClient client) public async Task CreateAsync(DataPassthroughRequest request) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/ticketing/v1/passthrough", + Path = "ticketing/v1/passthrough", Body = request } ); diff --git a/src/Merge.Client/Ticketing/Projects/ProjectsClient.cs b/src/Merge.Client/Ticketing/Projects/ProjectsClient.cs index 0261d75f..ba3277b7 100644 --- a/src/Merge.Client/Ticketing/Projects/ProjectsClient.cs +++ b/src/Merge.Client/Ticketing/Projects/ProjectsClient.cs @@ -58,10 +58,10 @@ public async Task ListAsync(ProjectsListRequest request) _query["remote_id"] = request.RemoteId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ticketing/v1/projects", + Path = "ticketing/v1/projects", Query = _query } ); @@ -84,10 +84,10 @@ public async Task RetrieveAsync(string id, ProjectsRetrieveRequest requ _query["include_remote_data"] = request.IncludeRemoteData.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/ticketing/v1/projects/{id}", + Path = $"ticketing/v1/projects/{id}", Query = _query } ); @@ -114,7 +114,7 @@ ProjectsUsersListRequest request } if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeDeletedData != null) { @@ -129,10 +129,10 @@ ProjectsUsersListRequest request _query["page_size"] = request.PageSize.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/ticketing/v1/projects/{parentId}/users", + Path = $"ticketing/v1/projects/{parentId}/users", Query = _query } ); diff --git a/src/Merge.Client/Ticketing/RegenerateKey/RegenerateKeyClient.cs b/src/Merge.Client/Ticketing/RegenerateKey/RegenerateKeyClient.cs index 8a998731..d401e18d 100644 --- a/src/Merge.Client/Ticketing/RegenerateKey/RegenerateKeyClient.cs +++ b/src/Merge.Client/Ticketing/RegenerateKey/RegenerateKeyClient.cs @@ -21,10 +21,10 @@ public RegenerateKeyClient(RawClient client) public async Task CreateAsync(RemoteKeyForRegenerationRequest request) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/ticketing/v1/regenerate-key", + Path = "ticketing/v1/regenerate-key", Body = request } ); diff --git a/src/Merge.Client/Ticketing/Roles/RolesClient.cs b/src/Merge.Client/Ticketing/Roles/RolesClient.cs index 4abe03fe..39fab211 100644 --- a/src/Merge.Client/Ticketing/Roles/RolesClient.cs +++ b/src/Merge.Client/Ticketing/Roles/RolesClient.cs @@ -58,10 +58,10 @@ public async Task ListAsync(RolesListRequest request) _query["remote_id"] = request.RemoteId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ticketing/v1/roles", + Path = "ticketing/v1/roles", Query = _query } ); @@ -84,10 +84,10 @@ public async Task RetrieveAsync(string id, RolesRetrieveRequest request) _query["include_remote_data"] = request.IncludeRemoteData.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/ticketing/v1/roles/{id}", + Path = $"ticketing/v1/roles/{id}", Query = _query } ); diff --git a/src/Merge.Client/Ticketing/Scopes/ScopesClient.cs b/src/Merge.Client/Ticketing/Scopes/ScopesClient.cs index e29de13a..5198b892 100644 --- a/src/Merge.Client/Ticketing/Scopes/ScopesClient.cs +++ b/src/Merge.Client/Ticketing/Scopes/ScopesClient.cs @@ -21,10 +21,10 @@ public ScopesClient(RawClient client) public async Task DefaultScopesRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ticketing/v1/default-scopes" + Path = "ticketing/v1/default-scopes" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); @@ -41,10 +41,10 @@ public async Task DefaultScopesRetrieveAsync() public async Task LinkedAccountScopesRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ticketing/v1/linked-account-scopes" + Path = "ticketing/v1/linked-account-scopes" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); @@ -63,10 +63,10 @@ LinkedAccountCommonModelScopeDeserializerRequest request ) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/ticketing/v1/linked-account-scopes", + Path = "ticketing/v1/linked-account-scopes", Body = request } ); diff --git a/src/Merge.Client/Ticketing/SyncStatus/SyncStatusClient.cs b/src/Merge.Client/Ticketing/SyncStatus/SyncStatusClient.cs index a93887a1..f4c0d075 100644 --- a/src/Merge.Client/Ticketing/SyncStatus/SyncStatusClient.cs +++ b/src/Merge.Client/Ticketing/SyncStatus/SyncStatusClient.cs @@ -30,10 +30,10 @@ public async Task ListAsync(SyncStatusListRequest reque _query["page_size"] = request.PageSize.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ticketing/v1/sync-status", + Path = "ticketing/v1/sync-status", Query = _query } ); diff --git a/src/Merge.Client/Ticketing/Tags/TagsClient.cs b/src/Merge.Client/Ticketing/Tags/TagsClient.cs index 9e2b2121..b91fd440 100644 --- a/src/Merge.Client/Ticketing/Tags/TagsClient.cs +++ b/src/Merge.Client/Ticketing/Tags/TagsClient.cs @@ -58,10 +58,10 @@ public async Task ListAsync(TagsListRequest request) _query["remote_id"] = request.RemoteId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ticketing/v1/tags", + Path = "ticketing/v1/tags", Query = _query } ); @@ -84,10 +84,10 @@ public async Task RetrieveAsync(string id, TagsRetrieveRequest request) _query["include_remote_data"] = request.IncludeRemoteData.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/ticketing/v1/tags/{id}", + Path = $"ticketing/v1/tags/{id}", Query = _query } ); diff --git a/src/Merge.Client/Ticketing/Teams/TeamsClient.cs b/src/Merge.Client/Ticketing/Teams/TeamsClient.cs index ee79dab1..29e00c9a 100644 --- a/src/Merge.Client/Ticketing/Teams/TeamsClient.cs +++ b/src/Merge.Client/Ticketing/Teams/TeamsClient.cs @@ -58,10 +58,10 @@ public async Task ListAsync(TeamsListRequest request) _query["remote_id"] = request.RemoteId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ticketing/v1/teams", + Path = "ticketing/v1/teams", Query = _query } ); @@ -84,10 +84,10 @@ public async Task RetrieveAsync(string id, TeamsRetrieveRequest request) _query["include_remote_data"] = request.IncludeRemoteData.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/ticketing/v1/teams/{id}", + Path = $"ticketing/v1/teams/{id}", Query = _query } ); diff --git a/src/Merge.Client/Ticketing/Tickets/TicketsClient.cs b/src/Merge.Client/Ticketing/Tickets/TicketsClient.cs index c9e035fa..fb2e68cd 100644 --- a/src/Merge.Client/Ticketing/Tickets/TicketsClient.cs +++ b/src/Merge.Client/Ticketing/Tickets/TicketsClient.cs @@ -67,7 +67,7 @@ public async Task ListAsync(TicketsListRequest request) } if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeDeletedData != null) { @@ -99,7 +99,7 @@ public async Task ListAsync(TicketsListRequest request) } if (request.Priority != null) { - _query["priority"] = request.Priority.ToString(); + _query["priority"] = JsonSerializer.Serialize(request.Priority.Value); } if (request.RemoteCreatedAfter != null) { @@ -111,7 +111,7 @@ public async Task ListAsync(TicketsListRequest request) } if (request.RemoteFields != null) { - _query["remote_fields"] = request.RemoteFields.ToString(); + _query["remote_fields"] = JsonSerializer.Serialize(request.RemoteFields.Value); } if (request.RemoteId != null) { @@ -127,11 +127,11 @@ public async Task ListAsync(TicketsListRequest request) } if (request.ShowEnumOrigins != null) { - _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); + _query["show_enum_origins"] = JsonSerializer.Serialize(request.ShowEnumOrigins.Value); } if (request.Status != null) { - _query["status"] = request.Status.ToString(); + _query["status"] = JsonSerializer.Serialize(request.Status.Value); } if (request.Tags != null) { @@ -142,10 +142,10 @@ public async Task ListAsync(TicketsListRequest request) _query["ticket_type"] = request.TicketType; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ticketing/v1/tickets", + Path = "ticketing/v1/tickets", Query = _query } ); @@ -172,10 +172,10 @@ public async Task CreateAsync(TicketEndpointRequest request) _query["run_async"] = request.RunAsync.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/ticketing/v1/tickets", + Path = "ticketing/v1/tickets", Query = _query } ); @@ -195,7 +195,7 @@ public async Task RetrieveAsync(string id, TicketsRetrieveRequest reques var _query = new Dictionary() { }; if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeRemoteData != null) { @@ -207,17 +207,17 @@ public async Task RetrieveAsync(string id, TicketsRetrieveRequest reques } if (request.RemoteFields != null) { - _query["remote_fields"] = request.RemoteFields.ToString(); + _query["remote_fields"] = JsonSerializer.Serialize(request.RemoteFields.Value); } if (request.ShowEnumOrigins != null) { - _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); + _query["show_enum_origins"] = JsonSerializer.Serialize(request.ShowEnumOrigins.Value); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/ticketing/v1/tickets/{id}", + Path = $"ticketing/v1/tickets/{id}", Query = _query } ); @@ -247,10 +247,10 @@ PatchedTicketEndpointRequest request _query["run_async"] = request.RunAsync.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Patch, - Path = $"/ticketing/v1/tickets/{id}", + Path = $"ticketing/v1/tickets/{id}", Query = _query } ); @@ -277,7 +277,7 @@ TicketsCollaboratorsListRequest request } if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeDeletedData != null) { @@ -292,10 +292,10 @@ TicketsCollaboratorsListRequest request _query["page_size"] = request.PageSize.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/ticketing/v1/tickets/{parentId}/collaborators", + Path = $"ticketing/v1/tickets/{parentId}/collaborators", Query = _query } ); @@ -313,10 +313,10 @@ TicketsCollaboratorsListRequest request public async Task MetaPatchRetrieveAsync(string id) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/ticketing/v1/tickets/meta/patch/{id}" + Path = $"ticketing/v1/tickets/meta/patch/{id}" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); @@ -333,10 +333,10 @@ public async Task MetaPatchRetrieveAsync(string id) public async Task MetaPostRetrieveAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ticketing/v1/tickets/meta/post" + Path = "ticketing/v1/tickets/meta/post" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); @@ -372,10 +372,10 @@ TicketsRemoteFieldClassesListRequest request _query["page_size"] = request.PageSize.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ticketing/v1/tickets/remote-field-classes", + Path = "ticketing/v1/tickets/remote-field-classes", Query = _query } ); diff --git a/src/Merge.Client/Ticketing/Users/UsersClient.cs b/src/Merge.Client/Ticketing/Users/UsersClient.cs index d81c0eff..883f5721 100644 --- a/src/Merge.Client/Ticketing/Users/UsersClient.cs +++ b/src/Merge.Client/Ticketing/Users/UsersClient.cs @@ -39,7 +39,7 @@ public async Task ListAsync(UsersListRequest request) } if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeDeletedData != null) { @@ -66,10 +66,10 @@ public async Task ListAsync(UsersListRequest request) _query["remote_id"] = request.RemoteId; } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ticketing/v1/users", + Path = "ticketing/v1/users", Query = _query } ); @@ -89,17 +89,17 @@ public async Task RetrieveAsync(string id, UsersRetrieveRequest request) var _query = new Dictionary() { }; if (request.Expand != null) { - _query["expand"] = request.Expand.ToString(); + _query["expand"] = JsonSerializer.Serialize(request.Expand.Value); } if (request.IncludeRemoteData != null) { _query["include_remote_data"] = request.IncludeRemoteData.ToString(); } var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = $"/ticketing/v1/users/{id}", + Path = $"ticketing/v1/users/{id}", Query = _query } ); diff --git a/src/Merge.Client/Ticketing/WebhookReceivers/WebhookReceiversClient.cs b/src/Merge.Client/Ticketing/WebhookReceivers/WebhookReceiversClient.cs index 265e7f49..ff6142ac 100644 --- a/src/Merge.Client/Ticketing/WebhookReceivers/WebhookReceiversClient.cs +++ b/src/Merge.Client/Ticketing/WebhookReceivers/WebhookReceiversClient.cs @@ -21,10 +21,10 @@ public WebhookReceiversClient(RawClient client) public async Task> ListAsync() { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Get, - Path = "/ticketing/v1/webhook-receivers" + Path = "ticketing/v1/webhook-receivers" } ); string responseBody = await response.Raw.Content.ReadAsStringAsync(); @@ -41,10 +41,10 @@ public async Task> ListAsync() public async Task CreateAsync(WebhookReceiverRequest request) { var response = await _client.MakeRequestAsync( - new RawClient.ApiRequest + new RawClient.JsonApiRequest { Method = HttpMethod.Post, - Path = "/ticketing/v1/webhook-receivers", + Path = "ticketing/v1/webhook-receivers", Body = request } );