Skip to content

Commit

Permalink
Fix typo in GetPayee (#31)
Browse files Browse the repository at this point in the history
* Fix typo in GetPayee

* Fix GetScheduledTransaction
Add PostScheduledTransaction
Add DeleteTransaction

* Update YNAB.Rest/IApiClient.cs

Co-authored-by: Joshua Marble <[email protected]>

* Update YNAB.Rest/IApiClient.cs

Co-authored-by: Joshua Marble <[email protected]>

---------

Co-authored-by: Jacob Draddy <[email protected]>
Co-authored-by: Joshua Marble <[email protected]>
  • Loading branch information
3 people authored Sep 4, 2024
1 parent ad944e7 commit 9697b17
Showing 1 changed file with 24 additions and 7 deletions.
31 changes: 24 additions & 7 deletions YNAB.Rest/IApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,15 @@ public interface IApiClient
[Put("/budgets/{budgetId}/transactions/{transactionId}")]
Task<ApiResponse<TransactionBody>> PutTransaction(string budgetId, string transactionId, [Body] TransactionBody transaction);

/// <summary>
/// Deletes a single Transaction in the specified Budget.
/// </summary>
/// <param name="budgetId">The ID of the Budget.</param>
/// <param name="transactionId">The ID of the Transaction.</param>
/// <returns>A response containing the deleted Transaction.</returns>
[Delete("/budgets/{budgetId}/transactions/{transactionId}")]
Task<ApiResponse<TransactionBody>> DeleteTransaction(string budgetId, string transactionId);

/// <summary>
/// Gets a list of payees in the specified Budget.
/// </summary>
Expand All @@ -171,15 +180,15 @@ public interface IApiClient
/// <param name="budgetId">The ID of the Budget.</param>
/// <param name="payeeId">The ID of the Payee.</param>
/// <returns>An ApiResponse object containing a single payee in the Data property.</returns>
[Get("/budgets/{budgetId/payees/{payeeId}")]
[Get("/budgets/{budgetId}/payees/{payeeId}")]
Task<ApiResponse<PayeeData>> GetPayee(string budgetId, string payeeId);

/// <summary>
/// Gets a list of payee locations in the specified Budget.
/// </summary>
/// <param name="budgetId">The ID of the Budget.</param>
/// <returns>An ApiResponse object containing a list of payee locations in the Data Property.</returns>
[Get ("/budgets/{budgetId}/payee_locations")]
[Get("/budgets/{budgetId}/payee_locations")]
Task<ApiResponse<PayeeLocationsData>> GetPayeeLocations(string budgetId);

/// <summary>
Expand All @@ -188,7 +197,7 @@ public interface IApiClient
/// <param name="budgetId">The ID of the Budget.</param>
/// <param name="payeeLocationId">The ID of the Payee Location</param>
/// <returns>An ApiResponse object containing a single payee location in the Data Property.</returns>
[Get ("/budgets/{budgetId}/payee_locations/{payeeLocationId}")]
[Get("/budgets/{budgetId}/payee_locations/{payeeLocationId}")]
Task<ApiResponse<PayeeLocationsData>> GetPayeeLocation(string budgetId, string payeeLocationId);

/// <summary>
Expand All @@ -197,7 +206,7 @@ public interface IApiClient
/// <param name="budgetId">The ID of the Budget.</param>
/// <param name="payeeId">The ID of the Payee.</param>
/// <returns>An ApiResponse object containing a list of locations for a payee</returns>
[Get ("/budgets/{budgetId}/payees/{payeeId}/payee_locations")]
[Get("/budgets/{budgetId}/payees/{payeeId}/payee_locations")]
Task<ApiResponse<PayeeLocationsData>> GetLocationsForPayee(string budgetId, string payeeId);

/// <summary>
Expand All @@ -206,7 +215,7 @@ public interface IApiClient
/// <param name="budgetId">The ID of the Budget.</param>
/// <param name="month">The month to retrieve.</param>
/// <returns> An ApiResponse object containing data for a month</returns>
[Get ("/budgets/{budgetId}/months/{month}")]
[Get("/budgets/{budgetId}/months/{month}")]
Task<ApiResponse<MonthData>> GetMonth(string budgetId, string month);

/// <summary>
Expand All @@ -215,7 +224,7 @@ public interface IApiClient
/// <param name="budgetId">The ID of the Budget.</param>
/// <param name="lastKnowledgeOfServer">(Optional) Only the data that has changed since the last knowledge of server will be included in the response.</param>
/// <returns> An ApiResponse object containing a list of months for a budget</returns>
[Get ("/budgets/{budgetId}/months?last_knowledge_of_server={lastKnowledgeOfServer}")]
[Get("/budgets/{budgetId}/months?last_knowledge_of_server={lastKnowledgeOfServer}")]
Task<ApiResponse<MonthsData>> GetMonths(string budgetId, long lastKnowledgeOfServer = 0);

/// <summary>
Expand All @@ -233,8 +242,16 @@ public interface IApiClient
/// <param name="budgetId">The ID of the Budget</param>
/// <param name="scheduledTransactionId">The ID of the scheduled transaction</param>
/// <returns>An ApiResponse object containing a scheduled transaction in the Data property</returns>
[Get("/budgets/{budgetId}/scheduled_transactions/{scheduledTransactionId")]
[Get("/budgets/{budgetId}/scheduled_transactions/{scheduledTransactionId}")]
Task<ApiResponse<ScheduledTransactionData>> GetScheduledTransaction(string budgetId, string scheduledTransactionId);

/// <summary>
/// Gets a single scheduled transaction in the specified Budget.
/// </summary>
/// <param name="budgetId">The ID of the Budget</param>
/// <param name="scheduledTransaction">The scheduled transaction</param>
/// <returns>An ApiResponse object containing a scheduled transaction in the Data property</returns>
[Post("/budgets/{budgetId}/scheduled_transactions")]
Task<ApiResponse<ScheduledTransactionData>> PostScheduledTransaction(string budgetId, [Body] ScheduledTransactionData scheduledTransaction);
}
}

0 comments on commit 9697b17

Please sign in to comment.